CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
CgemLUTReader.h
Go to the documentation of this file.
1#ifndef CGEMLUTREADER
2#define CGEMLUTREADER
3
4#include <string>
5#include "TFile.h"
6#include "TString.h"
7#include "TTree.h"
8
9/**
10#define MAXLAYER 3
11#define MAXSHEET 2
12#define MAXVIEW 2
13#define MAXSTRIP 1395 // LAYER3
14**/
15
17public:
18 // Constructor
20 CgemLUTReader(TString name);
22
23 bool ReadLUT();
24 std::map<int, int> * GetMap(int ilayer, int isheet, int iview);
25
26 bool LoadStripInfo(int ilayer, int isheet, int iview, int istrip);
27
28 /**
29 Setup of each LAYER readout: strip -> TIGER -> FEB -> ROC
30 > each ROC has 4 FEB
31 > each FEB has 2 TIGER
32 To select a strip use : layer, sheet, view and strip ID (in Cgemboss style)
33
34 More info at: https://docbes3.ihep.ac.cn/~cgem/index.php/Documentation
35 **/
36
37 // identifier of the ROC:
38 // > LAYER1 has 4 ROC [0-3]
39 // > LAYER2 has 7 ROC (no separation between sheets) [4-10]
40 int GetROC(int ilayer, int isheet, int iview, int istrip);
41
42 // identifier of the TIGER in a ROC
43 // each ROC has 8 TIGER [0-8]
44 int GetTIGER(int ilayer, int isheet, int iview, int istrip);
45
46 // identifier of the FEB
47 // > LAYER1 has 16 ROC [0-15]
48 // > LAYER2 has 28 ROC [16-44]
49 int GetFEB(int ilayer, int isheet, int iview, int istrip);
50
51 // identifier of the TIGER chip in a FEB [0-1]
52 int GetChip(int ilayer, int isheet, int iview, int istrip);
53
54 // identifier of the TIGER channel [0-63]
55 int GetChannel(int ilayer, int isheet, int iview, int istrip);
56
57 // superfluous function, just for checking
58 int GetLayer(int ilayer, int isheet, int iview, int istrip);
59
60 // superfluous function, just for checking
61 int GetSheet(int ilayer, int isheet, int iview, int istrip);
62
63 // readout side: (fixed: +1->west/-1->east on 15 june 2020 lia lavezzi)
64 // > +1 = west
65 // > -1 = east
66 int GetSide(int ilayer, int isheet, int iview, int istrip);
67
68 // strip identifier in GRAAL
69 int GetStrip_x_GRAAL(int ilayer, int isheet, int iview, int istrip);
70 int GetStrip_v_GRAAL(int ilayer, int isheet, int iview, int istrip);
71
72 // strip identifier in CgemBOSS (theone used as istrip!)
73 int GetStrip_x_BOSS(int ilayer, int isheet, int iview, int istrip);
74 int GetStrip_v_BOSS(int ilayer, int isheet, int iview, int istrip);
75
76 // calibration line of sample-and-hold (E branch)
77 float GetCalib_QCD_slope(int ilayer, int isheet, int iview, int istrip);
78 float GetCalib_QCD_const(int ilayer, int isheet, int iview, int istrip);
79
80 // saturation value (QDC)
81 float GetCalib_QCD_saturation(int ilayer, int isheet, int iview, int istrip);
82
83 // threshold applied to the T branch (in mV)
84 float GetV_thr_T_mV(int ilayer, int isheet, int iview, int istrip);
85
86 // threshold applied to the E branch (in mV)
87 float GetV_thr_E_mV(int ilayer, int isheet, int iview, int istrip);
88
89 // threshold in the T branch (translated to fC)
90 float Get_thr_T_fC(int ilayer, int isheet, int iview, int istrip);
91
92 // threshold in the E branch (translated to fC)
93 float Get_thr_E_fC(int ilayer, int isheet, int iview, int istrip);
94
95 // baseline in the T branch (in mV)
96 float GetBaseline_T_mV(int ilayer, int isheet, int iview, int istrip);
97
98 // baseline in the E branch (in mV)
99 float GetBaseline_E_mV(int ilayer, int isheet, int iview, int istrip);
100
101 // measured effective threshold (in fC)
102 float Get_thr_fC(int ilayer, int isheet, int iview, int istrip);
103
104 // measured noise rate (Hz)
105 float GetNoise_Rate_Hz(int ilayer, int isheet, int iview, int istrip);
106
107 // measured noise level (fC)
108 float GetNoise_MeanQ_fC(int ilayer, int isheet, int iview, int istrip);
109
110 // measured signal mean value (fC)
111 float GetSignal_MeanQ_fC(int ilayer, int isheet, int iview, int istrip);
112
113 // measured signal maximum value (fC)
114 float GetSignal_MaxQ_fC(int ilayer, int isheet, int iview, int istrip);
115
116 // measured signal rate (Hz)
117 float GetSignal_Rate_Hz(int ilayer, int isheet, int iview, int istrip);
118
119 // measured signal rising edge (channel by channel) --> start time (ns)
120 float GetSignal_StartTime_ns(int ilayer, int isheet, int iview, int istrip);
121
122 // measured signal falling edge (channel by channel) --> stop time (ns)
123 float GetSignal_StopTime_ns(int ilayer, int isheet, int iview, int istrip);
124
125 // measured signal start time width (ns) (channel by channel)
126 float GetSignal_SigmaTime_ns(int ilayer, int isheet, int iview, int istrip);
127
128 // measured signal rising edge (FEB by FEB) --> start time (ns)
129 float GetSignal_FEBStartTime_ns(int ilayer, int isheet, int iview, int istrip);
130
131 // measured signal falling edge (FEB by FEB) --> stop time (ns)
132 float GetSignal_FEBStopTime_ns(int ilayer, int isheet, int iview, int istrip);
133
134 // measured signal start time width (ns) (FEB by FEB)
135 float GetSignal_FEBSigmaTime_ns(int ilayer, int isheet, int iview, int istrip);
136
137 // strip/channel quality
138 // 0 = good
139 // the following are with "minus" sign, but could be with "plus" sign: consider the abs value
140 // -1 = channels not connected
141 // -2 = low rate in signal time window (< 10 Hz)
142 // -3 = max charge < 20 fC (only x view)
143 // -4 = mean charge < 3 fC (only x view)
144 // -5 = torn tail on L2 top
145 // -6 = noise charge > 20 fC
146 int GetQuality(int ilayer, int isheet, int iview, int istrip);
147
148 bool PrintMap(int ilayer, int isheet, int iview);
149
150 //private:
152
153 std::map<int, int> map_L1_S1_stripx_to_entry;
154 std::map<int, int> map_L2_S1_stripx_to_entry;
155 std::map<int, int> map_L2_S2_stripx_to_entry;
156 std::map<int, int> map_L1_S1_stripv_to_entry;
157 std::map<int, int> map_L2_S1_stripv_to_entry;
158 std::map<int, int> map_L2_S2_stripv_to_entry;
159
160 //public:
161 TFile *f;
162 TTree *tree;
163 int ROC;
164 int TIGER;
165 // SW_FEB
166 int FEB;
167 int chip;
169 int layer;
170 int side;
175 int sheet;
181 float thr_T_fC;
182 float thr_E_fC;
185 float thr_fC;
198
199 // general
200 TTree *general;
226
227
228};
229#endif
int GetChip(int ilayer, int isheet, int iview, int istrip)
float GetSignal_StartTime_ns(int ilayer, int isheet, int iview, int istrip)
float GetCalib_QCD_const(int ilayer, int isheet, int iview, int istrip)
int GetQuality(int ilayer, int isheet, int iview, int istrip)
std::map< int, int > map_L1_S1_stripx_to_entry
float signal_startTime_ns
float calib_QDC_saturation
int GetROC(int ilayer, int isheet, int iview, int istrip)
float calib_QDC_slope
float GetSignal_FEBStopTime_ns(int ilayer, int isheet, int iview, int istrip)
float GetCalib_QCD_saturation(int ilayer, int isheet, int iview, int istrip)
std::map< int, int > map_L2_S2_stripx_to_entry
float signal_FEBstopTime_ns
float GetNoise_Rate_Hz(int ilayer, int isheet, int iview, int istrip)
bool LoadStripInfo(int ilayer, int isheet, int iview, int istrip)
std::map< int, int > map_L2_S1_stripv_to_entry
float signal_maxQ_fC
float Get_thr_T_fC(int ilayer, int isheet, int iview, int istrip)
float GetSignal_FEBStartTime_ns(int ilayer, int isheet, int iview, int istrip)
float GetCalib_QCD_slope(int ilayer, int isheet, int iview, int istrip)
bool PrintMap(int ilayer, int isheet, int iview)
std::map< int, int > map_L1_S1_stripv_to_entry
float signal_sigmaTime_ns
int GetStrip_x_GRAAL(int ilayer, int isheet, int iview, int istrip)
float GetSignal_MaxQ_fC(int ilayer, int isheet, int iview, int istrip)
std::map< int, int > map_L2_S1_stripx_to_entry
float Get_thr_E_fC(int ilayer, int isheet, int iview, int istrip)
float GetV_thr_E_mV(int ilayer, int isheet, int iview, int istrip)
float GetV_thr_T_mV(int ilayer, int isheet, int iview, int istrip)
float signal_rate_Hz
TString CosmicRayLUTName
int GetSheet(int ilayer, int isheet, int iview, int istrip)
float calib_QDC_const
float GetSignal_MeanQ_fC(int ilayer, int isheet, int iview, int istrip)
float GetSignal_Rate_Hz(int ilayer, int isheet, int iview, int istrip)
int GetStrip_v_GRAAL(int ilayer, int isheet, int iview, int istrip)
int GetChannel(int ilayer, int isheet, int iview, int istrip)
float GetSignal_FEBSigmaTime_ns(int ilayer, int isheet, int iview, int istrip)
std::map< int, int > * GetMap(int ilayer, int isheet, int iview)
float signal_FEBsigmaTime_ns
float GetSignal_SigmaTime_ns(int ilayer, int isheet, int iview, int istrip)
float signal_stopTime_ns
int GetTIGER(int ilayer, int isheet, int iview, int istrip)
int GetSide(int ilayer, int isheet, int iview, int istrip)
float signal_FEBstartTime_ns
float GetBaseline_E_mV(int ilayer, int isheet, int iview, int istrip)
int GetLayer(int ilayer, int isheet, int iview, int istrip)
int GetStrip_x_BOSS(int ilayer, int isheet, int iview, int istrip)
float GetSignal_StopTime_ns(int ilayer, int isheet, int iview, int istrip)
float Get_thr_fC(int ilayer, int isheet, int iview, int istrip)
int GetStrip_v_BOSS(int ilayer, int isheet, int iview, int istrip)
float signal_meanQ_fC
int GetFEB(int ilayer, int isheet, int iview, int istrip)
float noise_meanQ_fC
float GetNoise_MeanQ_fC(int ilayer, int isheet, int iview, int istrip)
std::map< int, int > map_L2_S2_stripv_to_entry
float GetBaseline_T_mV(int ilayer, int isheet, int iview, int istrip)