CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
Reconstruction/MrpcRecDBS/MrpcRecDBS-00-00-02/MrpcRecDBS/MrpcDBSTrack.h
Go to the documentation of this file.
1#ifndef MRPCTRACK_H
2#define MRPCTRACK_H
3
4#include "ExtEvent/RecExtTrack.h"
5#include "RawDataProviderSvc/TofData.h"
6#include "TofRecEvent/RecTofTrack.h"
7#include "TofRecEvent/RecBTofCalHit.h"
8#include "TofRecEvent/RecETofCalHit.h"
9#include "MrpcCalibSvc/MrpcCalibSvc.h"
10
11
12const double adc_Cut = 10000.0;
13const double tdc_Cut = 100000.0;
14const double ztdc_Cut = 15.0;
15const double ztdc_Cut1 = 1.65*4.0;
16const double ztdc_Cut2 = 1.73*4.0;
17const double zadc_Cut = 25.0;
18const double mass[5] = { 0.00051100, 0.10566, 0.13957, 0.49368, 0.93827 };
19
20
22
23
24class MrpcDBSTrack{
25 public:
28
29 int trackId() const { return m_trackId; }
30 int tofTrackId() const { return m_tofTrackId; }
31 int id1() const { return m_id1; }
32 int id2() const { return m_id2; }
33 unsigned int barrel() const { return m_barrel; }
34 ExtTrackCase hitCase() const { return m_hitCase; }
35 double p() const { return m_momentum; }
36 double path() const { return m_path; }
37 double path1() const { return m_path1; }
38 double path2() const { return m_path2; }
39 double zrhit1() const { return m_zrhit1; }
40 double zrhit2() const { return m_zrhit2; }
41 double errzr1() const { return m_errzr1; }
42 double errzr2() const { return m_errzr2; }
43 int kal(unsigned int i) const { return m_kal[i]; }
44 double zrhit1(unsigned int i) const { return m_zr1[i]; }
45 double zrhit2(unsigned int i) const { return m_zr2[i]; }
46 double errzr1(unsigned int i) const { return m_ezr1[i]; }
47 double errzr2(unsigned int i) const { return m_ezr2[i]; }
48 std::vector<TofData*> tofData1() const { return m_tofData1; }
49 std::vector<TofData*> tofData2() const { return m_tofData2; }
50 int size1() const { return m_tofData1.size(); }
51 int size2() const { return m_tofData2.size(); }
52 int size3() const { return m_tofData3.size(); }
53 int size4() const { return m_tofData4.size(); }
54 double theta1() const { return m_theta1; }
55 double theta2() const { return m_theta2; }
56 double phi1() const { return m_phi1; }
57 double phi2() const { return m_phi2; }
58 unsigned int quality1() const { return m_quality1; }
59 unsigned int quality2() const { return m_quality2; }
60 unsigned int quality() const { return m_quality; }
61
62 int tofId1() const { return m_tofId1; }
63 int tofId2() const { return m_tofId2; }
64
65 double ph11() const { return m_ph11; }
66 double ph12() const { return m_ph12; }
67 double ph21() const { return m_ph21; }
68 double ph22() const { return m_ph22; }
69 double ph1() const { return m_ph1; }
70 double ph2() const { return m_ph2; }
71 double ph() const { return m_ph; }
72
73 double tof11(unsigned int i) const { return m_tof11[i]; }
74 double tof12(unsigned int i) const { return m_tof12[i]; }
75 double tof21(unsigned int i) const { return m_tof21[i]; }
76 double tof22(unsigned int i) const { return m_tof22[i]; }
77 double tof1(unsigned int i) const { return m_tof1[i]; }
78 double tof2(unsigned int i) const { return m_tof2[i]; }
79 double tof(unsigned int i) const { return m_tof[i]; }
80
81 double qch1() const { return m_qch1; }
82 double qch2() const { return m_qch2; }
83 double qch3() const { return m_qch3; }
84 double qch4() const { return m_qch4; }
85 double adc1() const { return m_adc1; }
86 double adc2() const { return m_adc2; }
87 double adc3() const { return m_adc3; }
88 double adc4() const { return m_adc4; }
89 double tdc1() const { return m_tdc1; }
90 double tdc2() const { return m_tdc2; }
91 double tdc3() const { return m_tdc3; }
92 double tdc4() const { return m_tdc4; }
93
94 double texpInner(unsigned int i) const { return m_texpInner[i]; }
95 double texpOuter(unsigned int i) const { return m_texpOuter[i]; }
96 double texp(unsigned int i) const { return m_texp[i]; }
97
98 double ztdc1() const { return m_ztdc1; }
99 double ztdc2() const { return m_ztdc2; }
100 double zadc1() const { return m_zadc1; }
101 double zadc2() const { return m_zadc2; }
102
103 double estime() const { return m_estime; }
104 double tdiff1() const { return m_tdiff1; }
105 double tdiff2() const { return m_tdiff2; }
106
107 int t0Stat() const { return m_t0Stat; }
108
109 unsigned int flag() const { return m_flag; }
110
111 bool trans_with_extrap_track(void) {return t_trans_with_extrap;}
112 bool trans_with_dbs_info(void) {return t_trans_with_dbs;}
113
114
115 public:
116 bool isNoHit() const { return m_hitCase==NoHit; }
117 void setQuality( int qual ) { m_quality = qual; }
118 void setQuality1( int qual1 ) { m_quality1 = qual1; }
119 void setQuality2( int qual2 ) { m_quality2 = qual2; }
120 void setFlag( unsigned int flag ) { m_flag = flag; }
121
122 void setExtTrack( RecExtTrack* extTrack, int kal[5], double t0, int t0Stat );
124 void setTofData( TofDataMap tofDataMap, int );
125 void tofDataAnalysis( TofData* tof, unsigned int iflag );
126 void getTofData( TofData* tof, unsigned int iflag );
127 void getTofDataEast( TofData* tof, unsigned int iflag );
128 void getTofDataWest( TofData* tof, unsigned int iflag );
129 void getTofDataNohit( unsigned int iflag );
130 void match(std::vector<MrpcDBSTrack*>*& tofTrackVec );
131 void findTofDataMRPC( std::vector<TofData*> tofDataVec1, std::vector<TofData*> tofDataVec2, double zrhit, unsigned int iflag);
132 TofData* chooseTofDataMRPC(std::vector<TofData*, std::allocator<TofData*> >);
133 void getTofDataMRPC(TofData*, unsigned int);
135
136
137 void findTofDataBarrel( std::vector<TofData*> tofDataVec1, std::vector<TofData*> tofDataVec2, double zrhit, unsigned int iflag, std::vector<MrpcDBSTrack*>*& tofTrackVec );
138 TofData* chooseTofData( std::vector<TofData*> tofDataVec, double zrhit );
140 void findTofDataEndcap( std::vector<TofData*> tofDataVec1, std::vector<TofData*> tofDataVec2, double zr1[5] );
141 TofData* chooseTofDataEndcap( std::vector<TofData*> tofDataVec, double zr1[5] );
143
144
145
147
149
150 void convert2RecTofTrackCol( RecTofTrackCol* recTofTrackCol );
151 void buildRecTofTrack( RecTofTrack* track, int layerorend );
152 void setRecTofTrack( RecTofTrack* track, int layerorend );
153
154
155
157
158
159
160
161
162 int get_strip_number_neighbour_base_12(string which,int strip_base_24);
163 int get_mrpc_module_id_neighbour(string which,int stripid,int layer);
164 int get_mrpc_partid_neighbour(std::string,int);
165
166 bool two_digis_from_same_strip(std::vector<TofData*> tofDataVec);
167
168
169
170
171
172 //special return function for mrpc rootfile
173 double mrpc_partid() {return m_partID;}
174 double mrpc_stripidentifier() {return m_stripidentifier;}
175 double mrpc_time_1() {return m_time_1;}
176 double mrpc_time_2() {return m_time_2;}
177 double mrpc_trans_time() {return m_trans_time;}
178 double mrpc_r_ext() {return m_r_ext;}
179 double mrpc_phi_ext() {return m_phi_ext;}
180 double mrpc_simulated_transtime(){return m_simulated_transtime;}
181 double mrpc_dbs(){return m_mrpc_dbs;}
182 double mrpc_extra(){return m_mrpc_extrap;}
183 double mrpc_aver(){return m_mrpc_ave;}
184
185
186
187
188 private:
189 int m_trackId;
190 int m_tofTrackId;
191 int m_id1, m_id2;
192 int m_tofId1, m_tofId2;
193 unsigned int m_barrel;
194 ExtTrackCase m_hitCase;
195 double m_momentum;
196 double m_path, m_path1, m_path2;
197 double m_zrhit1, m_errzr1, m_zrhit2, m_errzr2;
198 int m_kal[5];
199 double m_zr1[5], m_ezr1[5], m_zr2[5], m_ezr2[5];
200 std::vector<TofData*> m_tofData1;
201 std::vector<TofData*> m_tofData2;
202 std::vector<TofData*> m_tofData3;
203 std::vector<TofData*> m_tofData4;
204 unsigned int m_quality1, m_quality2;
205 unsigned int m_quality;
206 // quality introduction
207 // 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1
208 // neighbor>1 single end
209 // neighbor==1 lost TDC
210 // hit counter>1 lost ADC
211 // hit counter==1 Raw data
212 // calibration q t q t
213 // zAdc not match East West
214 // zTdc not match
215
216 double m_theta1, m_theta2, m_phi1, m_phi2;
217
218 double m_ph11, m_ph12, m_tof11[5], m_tof12[5];
219 double m_ph21, m_ph22, m_tof21[5], m_tof22[5];
220 double m_ph1, m_ph2, m_ph;
221 double m_tof1[5], m_tof2[5], m_tof[5];
222
223 double m_texp[5], m_texpInner[5], m_texpOuter[5];
224
225 double m_sigma11, m_sigma12, m_sigma21, m_sigma22;
226 double m_sigma_mrpc[5];
227 double m_sigma1, m_sigma2, m_sigma;
228
229 double m_qch1, m_qch2, m_qch3, m_qch4;
230 double m_adc1, m_adc2, m_adc3, m_adc4;
231 double m_tdc1, m_tdc2, m_tdc3, m_tdc4;
232
233 double m_ztdc1, m_ztdc2, m_zadc1, m_zadc2;
234
235 double m_estime, m_tdiff1, m_tdiff2;
236
237 int m_t0Stat;
238
239 double m_corresponding_time;
240 unsigned m_flag;
241 bool t_trans_with_extrap;//Do we have to determine the transitiontime with the extrapolated track information?
242 bool t_trans_with_dbs; //Can we determine the transitiontime with the information from both sides?
243
244
245 //Variables to produce MRPC rootfile
246 double m_partID;
247 double m_stripidentifier;
248 double m_time_1;
249 double m_time_2;
250 double m_trans_time;
251 double m_r_ext;
252 double m_phi_ext;
253 double m_simulated_transtime;
254 double m_mrpc_dbs;
255 double m_mrpc_extrap;
256 double m_mrpc_ave;
257
258
259
260
261};
262
263typedef std::vector<MrpcDBSTrack*> TofTrackVec;
264
265#endif
ObjectVector< RecTofTrack > RecTofTrackCol
void findTofDataEndcap(std::vector< TofData * > tofDataVec1, std::vector< TofData * > tofDataVec2, double zr1[5])
void setRecTofTrack(RecTofTrack *track, int layerorend)
TofData * compareTofData(TofData *tofData1, TofData *tofData2, double zrhit)
void getTofDataNohit(unsigned int iflag)
TofData * chooseTofData(std::vector< TofData * > tofDataVec, double zrhit)
void setExtTrack(RecExtTrack *extTrack, int kal[5], double t0, int t0Stat)
void getTofData(TofData *tof, unsigned int iflag)
void getTofDataWest(TofData *tof, unsigned int iflag)
void findTofDataMRPC(std::vector< TofData * > tofDataVec1, std::vector< TofData * > tofDataVec2, double zrhit, unsigned int iflag)
int get_mrpc_module_id_neighbour(string which, int stripid, int layer)
int get_strip_number_neighbour_base_12(string which, int strip_base_24)
void getMultiHit(MrpcDBSTrack *&)
TofData * compareTofDataMRPC(TofData *tofData1, TofData *tofData2)
void getTofDataEast(TofData *tof, unsigned int iflag)
void getTofDataMRPC(TofData *, unsigned int)
void tofDataStudy()
void buildRecTofTrack(RecTofTrack *track, int layerorend)
TofData * chooseTofDataMRPC(std::vector< TofData *, std::allocator< TofData * > >)
void setTofData(TofDataMap tofDataMap, int)
TofData * chooseTofDataEndcap(std::vector< TofData * > tofDataVec, double zr1[5])
void setCalibration()
void findTofDataBarrel(std::vector< TofData * > tofDataVec1, std::vector< TofData * > tofDataVec2, double zrhit, unsigned int iflag, std::vector< MrpcDBSTrack * > *&tofTrackVec)
void tofDataAnalysis(TofData *tof, unsigned int iflag)
int get_mrpc_partid_neighbour(std::string, int)
void match(std::vector< MrpcDBSTrack * > *&tofTrackVec)
void convert2RecTofTrackCol(RecTofTrackCol *recTofTrackCol)
bool two_digis_from_same_strip(std::vector< TofData * > tofDataVec)
TofData * compareTofDataEndcap(TofData *tofData1, TofData *tofData2)