CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
Cgem/ReadCosmicRayData/ReadCosmicRayData-00-00-23/ReadCosmicRayData/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:
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 // -1 = channels not connected
140 // -2 = low rate in signal time window (< 10 Hz)
141 // -3 = max charge < 30 fC (only x view)
142 // -4 = mean charge < 3 fC (only x view)
143 // -5 = torn tail on L2 top
144 int GetQuality(int ilayer, int isheet, int iview, int istrip);
145
146 bool PrintMap(int ilayer, int isheet, int iview);
147
148 //private:
150
151 std::map<int, int> map_L1_S1_stripx_to_entry;
152 std::map<int, int> map_L2_S1_stripx_to_entry;
153 std::map<int, int> map_L2_S2_stripx_to_entry;
154 std::map<int, int> map_L1_S1_stripv_to_entry;
155 std::map<int, int> map_L2_S1_stripv_to_entry;
156 std::map<int, int> map_L2_S2_stripv_to_entry;
157
158 //public:
159 TFile *f;
160 TTree *tree;
161 int ROC;
162 int TIGER;
163 // SW_FEB
164 int FEB;
165 int chip;
167 int layer;
168 int side;
173 int sheet;
179 float thr_T_fC;
180 float thr_E_fC;
183 float thr_fC;
196
197 // general
198 TTree *general;
224
225
226};
227#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)
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)
float GetNoise_Rate_Hz(int ilayer, int isheet, int iview, int istrip)
bool LoadStripInfo(int ilayer, int isheet, int iview, int istrip)
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)
int GetStrip_x_GRAAL(int ilayer, int isheet, int iview, int istrip)
float GetSignal_MaxQ_fC(int ilayer, int isheet, int iview, int istrip)
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)
int GetSheet(int ilayer, int isheet, int iview, int istrip)
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 GetSignal_SigmaTime_ns(int ilayer, int isheet, int iview, int istrip)
int GetTIGER(int ilayer, int isheet, int iview, int istrip)
int GetSide(int ilayer, int isheet, int iview, int istrip)
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)
int GetFEB(int ilayer, int isheet, int iview, int istrip)
float GetNoise_MeanQ_fC(int ilayer, int isheet, int iview, int istrip)
float GetBaseline_T_mV(int ilayer, int isheet, int iview, int istrip)