CGEM BOSS 6.6.5.i
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 up to 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] - [0,1] west - [2.3] east
39 // > LAYER2 has 8 ROC [4-11] - [4,7] west - [8,11] east
40 // > LAYER3 HAS 10 ROC [12-21] - [12,16] west - [17,21] east
41 int GetROC(int ilayer, int isheet, int iview, int istrip);
42
43 // identifier of the TIGER in a ROC
44 // each ROC has up to 8 TIGER [0-8]
45 int GetTIGER(int ilayer, int isheet, int iview, int istrip);
46
47 // identifier of the FEB
48 // > LAYER1 has 16 FEB [0-15]
49 // > LAYER2 has 28 FEB [16-43]
50 // > LAYER3 has 36 FEB [44,79]
51 int GetFEB(int ilayer, int isheet, int iview, int istrip);
52
53 // identifier of the TIGER chip in a FEB [0-1]
54 int GetChip(int ilayer, int isheet, int iview, int istrip);
55
56 // identifier of the TIGER channel [0-63]
57 int GetChannel(int ilayer, int isheet, int iview, int istrip);
58
59 // superfluous function, just for checking
60 int GetLayer(int ilayer, int isheet, int iview, int istrip);
61
62 // superfluous function, just for checking
63 int GetSheet(int ilayer, int isheet, int iview, int istrip);
64
65 // readout side: (fixed: +1->west/-1->east on 15 june 2020 lia lavezzi)
66 // > +1 = west
67 // > -1 = east
68 int GetSide(int ilayer, int isheet, int iview, int istrip);
69
70 // strip identifier in GRAAL
71 int GetStrip_x_GRAAL(int ilayer, int isheet, int iview, int istrip);
72 int GetStrip_v_GRAAL(int ilayer, int isheet, int iview, int istrip);
73
74 // strip identifier in CgemBOSS (theone used as istrip!)
75 int GetStrip_x_BOSS(int ilayer, int isheet, int iview, int istrip);
76 int GetStrip_v_BOSS(int ilayer, int isheet, int iview, int istrip);
77
78 // calibration line of sample-and-hold (E branch)
79 float GetCalib_QCD_slope(int ilayer, int isheet, int iview, int istrip);
80 float GetCalib_QCD_const(int ilayer, int isheet, int iview, int istrip);
81
82 // saturation value (QDC)
83 float GetCalib_QCD_saturation(int ilayer, int isheet, int iview, int istrip);
84
85 // threshold applied to the T branch (in mV)
86 float GetV_thr_T_mV(int ilayer, int isheet, int iview, int istrip);
87
88 // threshold applied to the E branch (in mV)
89 float GetV_thr_E_mV(int ilayer, int isheet, int iview, int istrip);
90
91 // threshold in the T branch (translated to fC)
92 float Get_thr_T_fC(int ilayer, int isheet, int iview, int istrip);
93
94 // threshold in the E branch (translated to fC)
95 float Get_thr_E_fC(int ilayer, int isheet, int iview, int istrip);
96
97 // baseline in the T branch (in mV)
98 float GetBaseline_T_mV(int ilayer, int isheet, int iview, int istrip);
99
100 // baseline in the E branch (in mV)
101 float GetBaseline_E_mV(int ilayer, int isheet, int iview, int istrip);
102
103 // measured effective threshold (in fC)
104 float Get_thr_fC(int ilayer, int isheet, int iview, int istrip);
105
106 // measured noise rate (Hz)
107 float GetNoise_Rate_Hz(int ilayer, int isheet, int iview, int istrip);
108
109 // measured noise level (fC)
110 float GetNoise_MeanQ_fC(int ilayer, int isheet, int iview, int istrip);
111
112 // measured signal mean value (fC)
113 float GetSignal_MeanQ_fC(int ilayer, int isheet, int iview, int istrip);
114
115 // measured signal maximum value (fC)
116 float GetSignal_MaxQ_fC(int ilayer, int isheet, int iview, int istrip);
117
118 // measured signal rate (Hz)
119 float GetSignal_Rate_Hz(int ilayer, int isheet, int iview, int istrip);
120
121 // measured signal rising edge (channel by channel) --> start time (ns)
122 float GetSignal_StartTime_ns(int ilayer, int isheet, int iview, int istrip);
123
124 // measured signal falling edge (channel by channel) --> stop time (ns)
125 float GetSignal_StopTime_ns(int ilayer, int isheet, int iview, int istrip);
126
127 // measured signal start time width (ns) (channel by channel)
128 float GetSignal_SigmaTime_ns(int ilayer, int isheet, int iview, int istrip);
129
130 // measured signal rising edge (FEB by FEB) --> start time (ns)
131 float GetSignal_FEBStartTime_ns(int ilayer, int isheet, int iview, int istrip);
132
133 // measured signal falling edge (FEB by FEB) --> stop time (ns)
134 float GetSignal_FEBStopTime_ns(int ilayer, int isheet, int iview, int istrip);
135
136 // measured signal start time width (ns) (FEB by FEB)
137 float GetSignal_FEBSigmaTime_ns(int ilayer, int isheet, int iview, int istrip);
138
139 // strip/channel quality
140 // 0 = good
141 // the following are with "minus" sign, but could be with "plus" sign: consider the abs value
142 // -1 = channels not connected
143 // -2 = low rate in signal time window (< 10 Hz)
144 // -3 = max charge < 20 fC (only x view)
145 // -4 = mean charge < 3 fC (only x view)
146 // -5 = torn tail on L2 top
147 // -6 = noise charge > 20 fC
148 int GetQuality(int ilayer, int isheet, int iview, int istrip);
149
150 bool PrintMap(int ilayer, int isheet, int iview);
151
152 //private:
154
155 std::map<int, int> map_L1_S1_stripx_to_entry;
156 std::map<int, int> map_L2_S1_stripx_to_entry;
157 std::map<int, int> map_L2_S2_stripx_to_entry;
158 std::map<int, int> map_L3_S1_stripx_to_entry;
159 std::map<int, int> map_L3_S2_stripx_to_entry;
160 std::map<int, int> map_L1_S1_stripv_to_entry;
161 std::map<int, int> map_L2_S1_stripv_to_entry;
162 std::map<int, int> map_L2_S2_stripv_to_entry;
163 std::map<int, int> map_L3_S1_stripv_to_entry;
164 std::map<int, int> map_L3_S2_stripv_to_entry;
165
166
167 //public:
168 TFile *f;
169 TTree *tree;
170 int ROC;
171 int TIGER;
172 // SW_FEB
173 int FEB;
174 int chip;
176 int layer;
177 int side;
182 int sheet;
188 float thr_T_fC;
189 float thr_E_fC;
192 float thr_fC;
205
206 // general
207 TTree *general;
233
234
235};
236#endif
std::map< int, int > map_L3_S2_stripx_to_entry
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 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 Get_thr_T_fC(int ilayer, int isheet, int iview, int istrip)
std::map< int, int > map_L3_S1_stripx_to_entry
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)
TString CosmicRayLUTName
int GetSheet(int ilayer, int isheet, int iview, int istrip)
std::map< int, int > map_L3_S1_stripv_to_entry
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)
std::map< int, int > map_L3_S2_stripv_to_entry
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)
int GetFEB(int ilayer, int isheet, int iview, int istrip)
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)