CGEM BOSS 6.6.5.f
BESIII Offline Software System
Loading...
Searching...
No Matches
MrpcDBSCount.cxx
Go to the documentation of this file.
1#include "MrpcRecDBS/MrpcDBSTrack.h"
2#include "MrpcRecDBS/MrpcDBSCount.h"
3#include <iostream>
4#include <iomanip>
5
7 extTrkNum = 0;
8 barrelTrk = 0;
9 endcapTrk = 0;
10 inner1 = 0;
11 outer1 = 0;
12 double1 = 0;
13 east1 = 0;
14 west1 = 0;
15 nohit1 = 0;
16 unchanged1 = 0;
17 changed1 = 0;
18 inner2 = 0;
19 outer2 = 0;
20 double2 = 0;
21 east2 = 0;
22 west2 = 0;
23 nohit2 = 0;
24 unchanged2 = 0;
25 changed2 = 0;
26 inner3 = 0;
27 outer3 = 0;
28 double3 = 0;
29 east3 = 0;
30 west3 = 0;
31 nohit3 = 0;
32 unchanged3 = 0;
33 changed3 = 0;
34 inner4 = 0;
35 outer4 = 0;
36 double4 = 0;
37 east4 = 0;
38 west4 = 0;
39 nohit4 = 0;
40 unchanged4 = 0;
41 changed4 = 0;
42 mrpc_east1_1=0;
43 mrpc_east1_2=0;
44 mrpc_east1_3=0;
45 mrpc_east1_4=0;
46 mrpc_east2_1=0;
47 mrpc_east2_2=0;
48 mrpc_east2_3=0;
49 mrpc_east2_4=0;
50 mrpc_west1_1=0;
51 mrpc_west1_2=0;
52 mrpc_west1_3=0;
53 mrpc_west1_4=0;
54 mrpc_west2_1=0;
55 mrpc_west2_2=0;
56 mrpc_west2_3=0;
57 mrpc_west2_4=0;
58 mrpc_trans_with_ext_true_2=0;
59 mrpc_trans_with_ext_false_2=0;
60 mrpc_trans_with_dbs_true_2=0;
61 mrpc_trans_with_dbs_false_2=0;
62 mrpc_trans_with_ext_true_3=0;
63 mrpc_trans_with_ext_false_3=0;
64 mrpc_trans_with_dbs_true_3=0;
65 mrpc_trans_with_dbs_false_3=0;
66 mrpc_trans_with_ext_true_4=0;
67 mrpc_trans_with_ext_false_4=0;
68 mrpc_trans_with_dbs_true_4=0;
69 mrpc_trans_with_dbs_false_4=0;
70
71 return;
72}
73
74
76 extTrkNum = 0;
77 barrelTrk = 0;
78 endcapTrk = 0;
79 inner1 = 0;
80 outer1 = 0;
81 double1 = 0;
82 east1 = 0;
83 west1 = 0;
84 nohit1 = 0;
85 unchanged1 = 0;
86 changed1 = 0;
87 inner2 = 0;
88 outer2 = 0;
89 double2 = 0;
90 east2 = 0;
91 west2 = 0;
92 nohit2 = 0;
93 unchanged2 = 0;
94 changed2 = 0;
95 inner3 = 0;
96 outer3 = 0;
97 double3 = 0;
98 east3 = 0;
99 west3 = 0;
100 nohit3 = 0;
101 unchanged3 = 0;
102 changed3 = 0;
103 inner4 = 0;
104 outer4 = 0;
105 double4 = 0;
106 east4 = 0;
107 west4 = 0;
108 nohit4 = 0;
109 unchanged4 = 0;
110 changed4 = 0;
111 mrpc_east1_1=0;
112 mrpc_east1_2=0;
113 mrpc_east1_3=0;
114 mrpc_east1_4=0;
115
116 mrpc_east2_1=0;
117 mrpc_east2_2=0;
118 mrpc_east2_3=0;
119 mrpc_east2_4=0;
120 mrpc_west1_1=0;
121 mrpc_west1_2=0;
122 mrpc_west1_3=0;
123 mrpc_west1_4=0;
124 mrpc_west2_1=0;
125 mrpc_west2_2=0;
126 mrpc_west2_3=0;
127 mrpc_west2_4=0;
128
129 mrpc_trans_with_ext_true_2=0;
130 mrpc_trans_with_ext_false_2=0;
131 mrpc_trans_with_dbs_true_2=0;
132 mrpc_trans_with_dbs_false_2=0;
133
134 mrpc_trans_with_ext_true_3=0;
135 mrpc_trans_with_ext_false_3=0;
136 mrpc_trans_with_dbs_true_3=0;
137 mrpc_trans_with_dbs_false_3=0;
138
139 mrpc_trans_with_ext_true_4=0;
140 mrpc_trans_with_ext_false_4=0;
141 mrpc_trans_with_dbs_true_4=0;
142 mrpc_trans_with_dbs_false_4=0;
143 return;
144}
145
146
147void MrpcDBSCount::setExtTrackNum( unsigned int ntrk ) {
148 extTrkNum = extTrkNum + ntrk;
149 return;
150}
151
152
154 if( tof->hitCase() == InnerLayer ) inner1++;
155 else if( tof->hitCase() == OuterLayer ) outer1++;
156 else if( tof->hitCase() == DoubleLayer ) double1++;
157 else if( tof->hitCase() == EastEndcap ) east1++;
158 else if( tof->hitCase() == WestEndcap ) west1++;
159 else if( tof->hitCase() == eastendcap_1 ) mrpc_east1_1++;
160 else if( tof->hitCase() == eastendcap_2 ) mrpc_east2_1++;
161 else if( tof->hitCase() == westendcap_1 ) mrpc_west1_1++;
162 else if( tof->hitCase() == westendcap_2 ) mrpc_west2_1++;
163 else nohit1++;
164 return;
165}
166
167
168void MrpcDBSCount::setTrack1Col( std::vector<MrpcDBSTrack*>*& tofTrackVec ) {
169 TofTrackVec::iterator iter_tof = tofTrackVec->begin();
170 for( ; iter_tof!=tofTrackVec->end(); iter_tof++ ) {
171 setTrack1( *iter_tof );
172 }
173 return;
174}
175
176
178 if( tof->hitCase() == InnerLayer ) inner2++;
179 else if( tof->hitCase() == OuterLayer ) outer2++;
180 else if( tof->hitCase() == DoubleLayer ) double2++;
181 else if( tof->hitCase() == EastEndcap ) east2++;
182 else if( tof->hitCase() == WestEndcap ) west2++;
183 else if( tof->hitCase() == eastendcap_1 ) mrpc_east1_2++;
184 else if( tof->hitCase() == eastendcap_2 ) mrpc_east2_2++;
185 else if( tof->hitCase() == westendcap_1 ) mrpc_west1_2++;
186 else if( tof->hitCase() == westendcap_2 ) mrpc_west2_2++;
187 else nohit2++;
188 // if( tof->changed() ) changed2++;
189 // else unchanged2++;
190 return;
191}
192
193
195 if( tof->hitCase() == InnerLayer ) inner3++;
196 else if( tof->hitCase() == OuterLayer ) outer3++;
197 else if( tof->hitCase() == DoubleLayer ) double3++;
198 else if( tof->hitCase() == EastEndcap ) east3++;
199 else if( tof->hitCase() == WestEndcap ) west3++;
200 else if( tof->hitCase() == eastendcap_1 ) mrpc_east1_3++;
201 else if( tof->hitCase() == eastendcap_2 ) mrpc_east2_3++;
202 else if( tof->hitCase() == westendcap_1 ) mrpc_west1_3++;
203 else if( tof->hitCase() == westendcap_2 ) mrpc_west2_3++;
204 else nohit3++;
205 // if( tof->changed() ) changed3++;
206 // else unchanged3++;
207
208
209
210 if( ( tof->hitCase() == eastendcap_1 ) || ( tof->hitCase() == eastendcap_2 ) || ( tof->hitCase() == westendcap_1 ) || ( tof->hitCase() == westendcap_2 ))
211 {
212
213 if(tof->trans_with_extrap_track()) mrpc_trans_with_ext_true_3++;
214 else if(tof->trans_with_dbs_info() && !(tof->trans_with_extrap_track())) mrpc_trans_with_dbs_true_3++;
215 else mrpc_trans_with_dbs_false_3++;
216
217
218
219 }
220
221 return;
222}
223
224
226 if( tof->hitCase() == InnerLayer ) inner4++;
227 else if( tof->hitCase() == OuterLayer ) outer4++;
228 else if( tof->hitCase() == DoubleLayer ) double4++;
229 else if( tof->hitCase() == EastEndcap ) east4++;
230 else if( tof->hitCase() == WestEndcap ) west4++;
231 else if( tof->hitCase() == eastendcap_1 ) mrpc_east1_4++;
232 else if( tof->hitCase() == eastendcap_2 ) mrpc_east2_4++;
233 else if( tof->hitCase() == westendcap_1 ) mrpc_west1_4++;
234 else if( tof->hitCase() == westendcap_2 ) mrpc_west2_4++;
235 else nohit4++;
236
237
238
239
240 if( ( tof->hitCase() == eastendcap_1 ) || ( tof->hitCase() == eastendcap_2 ) || ( tof->hitCase() == westendcap_1 ) || ( tof->hitCase() == westendcap_2 ))
241 {
242
243 if(tof->trans_with_extrap_track()) mrpc_trans_with_ext_true_4++;
244 else if(tof->trans_with_dbs_info() && !(tof->trans_with_extrap_track())) mrpc_trans_with_dbs_true_4++;
245 else mrpc_trans_with_dbs_false_4++;
246
247
248
249 }
250
251 return;
252}
253
255 std::cout<<"############################# TofRec Summary #####################################" << std::endl;
256 std::cout<<" ===> Number of Extrapolated tracks: " << extTrkNum <<std::endl;
257 std::cout<<" ===> Number of valid Extraploated tracks: " << (inner1+outer1+double1+east1+west1+mrpc_east1_1+mrpc_east2_1+mrpc_west1_1+mrpc_west2_1) << " Barrel: " << (inner1+outer1+double1) << " Endcap: " << (east1+west1+mrpc_east1_1+mrpc_east2_1+mrpc_west1_1+mrpc_west2_1) << std::endl;
258 std::cout<<" ===> TofRec: number of barrel tracks: " << (inner3+outer3+double3) << " Efficiency: " << setprecision(4) << (inner3+outer3+double3)*100.0/((inner1+outer1+double1)*1.0) << "%" << std::endl;
259 std::cout<<" ===> Inner Layer hit only in total: " << inner1 << " \t" << inner2 << " \t" << inner3 << " \t" << inner4 << std::endl;
260 std::cout<<" ===> Outer Layer hit only in total: " << outer1 << "\t" << outer2 << " \t" << outer3 << " \t" << outer4 << std::endl;
261 std::cout<<" ===> Double Layer hit in total: " << double1 << " \t" << double2 << " \t" << double3 << " \t" << double4 << std::endl;
262 std::cout<<" ===> TofRec: number of endcap tracks: " << (east3+west3+mrpc_east1_3+mrpc_east2_3+mrpc_west1_3+mrpc_west2_3) << " Efficiency: " << setprecision(4) << (east3+west3+mrpc_east1_3+mrpc_east2_3+mrpc_west1_3+mrpc_west2_3)*100.0/((east1+west1+mrpc_east1_1+mrpc_east2_1+mrpc_west1_1+mrpc_west2_1)*1.0) << "%" << std::endl;
263 std::cout<<" ===> East endcap tracks in total: " << east1 << " \t" << east2 << " \t" << east3 << " \t" << east4 << std::endl;
264 std::cout<<" ===> West endcap tracks in total: " << west1 << " \t" << west2 << " \t" << west3 << " \t" << west4 << std::endl;
265 std::cout<<" ===> East 1 mrpc tracks in total: " << mrpc_east1_1 << " \t" << mrpc_east1_2 << " \t" << mrpc_east1_3 << " \t" << mrpc_east1_4 << std::endl;
266 std::cout<<" ===> West 1 mrpc tracks in total: " << mrpc_west1_1 << " \t" << mrpc_west1_2 << " \t" << mrpc_west1_3 << " \t" << mrpc_west1_4 << std::endl;
267 std::cout<<" ===> East 2 mrpc tracks in total: " << mrpc_east2_1 << " \t" << mrpc_east2_2 << " \t" << mrpc_east2_3 << " \t" << mrpc_east2_4 << std::endl;
268 std::cout<<" ===> West 2 mrpc tracks in total: " << mrpc_west2_1 << " \t" << mrpc_west2_2 << " \t" << mrpc_west2_3 << " \t" << mrpc_west2_4 << std::endl;
269
270 std::cout<<" ===> The invalid Extend tracks in total: "<< nohit1 << " \t" << nohit2 << " \t" << nohit3 << " \t" << nohit4 <<std::endl;
271
272 if((mrpc_east1_3+mrpc_east2_3+mrpc_west1_3+mrpc_west2_3) >0)
273 {
274 std::cout<<" ==> MRPC extrapolation (before calibration): " << endl;
275 std::cout<<" Determine transmision time without extrapolation : "<< setprecision(3) << (double)mrpc_trans_with_dbs_true_3*100.0/((double)(mrpc_east1_3+mrpc_east2_3+mrpc_west1_3+mrpc_west2_3)*1.0)<< " % "<<endl ;
276 std::cout<<" Determine transmision time with extrapolation : "<< setprecision(3) << (double)mrpc_trans_with_ext_true_3*100.0/((double)(mrpc_east1_3+mrpc_east2_3+mrpc_west1_3+mrpc_west2_3)*1.0)<< " % "<<endl ;
277 std::cout<<" Determine transmision time with average value : "<< setprecision(3) <<
278 ((double)(mrpc_east1_3+mrpc_east2_3+mrpc_west1_3+mrpc_west2_3)-mrpc_trans_with_dbs_true_3-mrpc_trans_with_ext_true_3)*100.0/((double)(mrpc_east1_3+mrpc_east2_3+mrpc_west1_3+mrpc_west2_3)*1.0)<< " % "<<endl ;
279 }
280 if((mrpc_east1_4+mrpc_east2_4+mrpc_west1_4+mrpc_west2_4) >0)
281 {
282 std::cout<<" ==> MRPC extrapolation (after calibration): " << endl;
283 std::cout<<" Determine transmision time without extrapolation : "<< setprecision(3) << (double)mrpc_trans_with_dbs_true_4*100.0/((double)(mrpc_east1_4+mrpc_east2_4+mrpc_west1_4+mrpc_west2_4)*1.0)<< " % "<<endl ;
284 std::cout<<" Determine transmision time with extrapolation : "<< setprecision(3) << (double)mrpc_trans_with_ext_true_4*100.0/((double)(mrpc_east1_4+mrpc_east2_4+mrpc_west1_4+mrpc_west2_4)*1.0)<< " % "<<endl ;
285 std::cout<<" Determine transmision time with average value : "<< setprecision(3) <<
286 ((double)(mrpc_east1_4+mrpc_east2_4+mrpc_west1_4+mrpc_west2_4)-mrpc_trans_with_dbs_true_4-mrpc_trans_with_ext_true_4)*100.0/((double)(mrpc_east1_4+mrpc_east2_4+mrpc_west1_4+mrpc_west2_4)*1.0)<< " % "<<endl ;
287 }
288
289
290
291 std::cout<<"############################# End Summary #######################################" <<std::endl;
292
293}
294
295
296
297
void setTrack1(MrpcDBSTrack *&tof)
void setTrack2(MrpcDBSTrack *&tof)
void setTrack1Col(std::vector< MrpcDBSTrack * > *&tofTrackVec)
void setExtTrackNum(unsigned int ntrk)
void setTrack3(MrpcDBSTrack *&tof)
void setTrack4(MrpcDBSTrack *&tof)