BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TofCount.cxx
Go to the documentation of this file.
1#include "TofCount.h"
2#include "TofTrack.h"
3#include <iomanip>
4#include <iostream>
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
43 for ( unsigned int i = 0; i < nParBhabha; i++ ) { nbb[i] = 0; }
44
45 return;
46}
47
49 extTrkNum = 0;
50 barrelTrk = 0;
51 endcapTrk = 0;
52 inner1 = 0;
53 outer1 = 0;
54 double1 = 0;
55 east1 = 0;
56 west1 = 0;
57 nohit1 = 0;
58 unchanged1 = 0;
59 changed1 = 0;
60 inner2 = 0;
61 outer2 = 0;
62 double2 = 0;
63 east2 = 0;
64 west2 = 0;
65 nohit2 = 0;
66 unchanged2 = 0;
67 changed2 = 0;
68 inner3 = 0;
69 outer3 = 0;
70 double3 = 0;
71 east3 = 0;
72 west3 = 0;
73 nohit3 = 0;
74 unchanged3 = 0;
75 changed3 = 0;
76 inner4 = 0;
77 outer4 = 0;
78 double4 = 0;
79 east4 = 0;
80 west4 = 0;
81 nohit4 = 0;
82 unchanged4 = 0;
83 changed4 = 0;
84
85 return;
86}
87
88void TofCount::setExtTrackNum( unsigned int ntrk ) {
89 extTrkNum = extTrkNum + ntrk;
90 return;
91}
92
94 if ( tof->hitCase() == InnerLayer ) inner1++;
95 else if ( tof->hitCase() == OuterLayer ) outer1++;
96 else if ( tof->hitCase() == DoubleLayer ) double1++;
97 else if ( tof->hitCase() == EastEndcap ) east1++;
98 else if ( tof->hitCase() == WestEndcap ) west1++;
99 else if ( tof->hitCase() == EastEndcapMRPC ) east1++;
100 else if ( tof->hitCase() == WestEndcapMRPC ) west1++;
101 else nohit1++;
102 return;
103}
104
105void TofCount::setTrack1Col( std::vector<TofTrack*>*& tofTrackVec ) {
106 TofTrackVec::iterator iter_tof = tofTrackVec->begin();
107 for ( ; iter_tof != tofTrackVec->end(); iter_tof++ ) { setTrack1( *iter_tof ); }
108 return;
109}
110
112 if ( tof->hitCase() == InnerLayer ) inner2++;
113 else if ( tof->hitCase() == OuterLayer ) outer2++;
114 else if ( tof->hitCase() == DoubleLayer ) double2++;
115 else if ( tof->hitCase() == EastEndcap ) east2++;
116 else if ( tof->hitCase() == WestEndcap ) west2++;
117 else if ( tof->hitCase() == EastEndcapMRPC ) east2++;
118 else if ( tof->hitCase() == WestEndcapMRPC ) west2++;
119 else nohit2++;
120 // if( tof->changed() ) changed2++;
121 // else unchanged2++;
122 return;
123}
124
126 if ( tof->hitCase() == InnerLayer ) inner3++;
127 else if ( tof->hitCase() == OuterLayer ) outer3++;
128 else if ( tof->hitCase() == DoubleLayer ) double3++;
129 else if ( tof->hitCase() == EastEndcap ) east3++;
130 else if ( tof->hitCase() == WestEndcap ) west3++;
131 else if ( tof->hitCase() == EastEndcapMRPC ) east3++;
132 else if ( tof->hitCase() == WestEndcapMRPC ) west3++;
133 else nohit3++;
134 // if( tof->changed() ) changed3++;
135 // else unchanged3++;
136 return;
137}
138
140 if ( tof->hitCase() == InnerLayer ) inner4++;
141 else if ( tof->hitCase() == OuterLayer ) outer4++;
142 else if ( tof->hitCase() == DoubleLayer ) double4++;
143 else if ( tof->hitCase() == EastEndcap ) east4++;
144 else if ( tof->hitCase() == WestEndcap ) west4++;
145 else if ( tof->hitCase() == EastEndcapMRPC ) east4++;
146 else if ( tof->hitCase() == WestEndcapMRPC ) west4++;
147 else nohit4++;
148 // if( tof->changed() ) changed4++;
149 // else unchanged4++;
150 return;
151}
152
153/*
154void TofCount::final() {
155 std::cout<<"############################# TofRec Summary
156#####################################" << std::endl; std::cout<<" ===> The Extend tracks in
157total: " << extTrkNum <<std::endl; std::cout<<" ===> The valid Extend tracks in total: "<<
158(inner4+outer4+double4+east4+west4) <<std::endl; std::cout<<" ===> The TofRec barrel
159tracks in total: " << (inner4+outer4+double4) <<std::endl; std::cout<<" ===> The
160Inner Layer hit only in total: " << inner1 << " " << inner2 << " " << inner3 << " " <<
161inner4 << std::endl; std::cout<<" ===> The Outer Layer hit only in total: " <<
162outer1 << " " << outer2 << " " << outer3 << " " << outer4 << std::endl; std::cout<<" ===>
163The Double Layer hit in total: " << double1 << " " << double2 << " " << double3 << "
164" << double4 << std::endl; std::cout<<" ===> The TofRec endcap tracks in total: " <<
165(east4+west4) <<std::endl; std::cout<<" ===> The TofRec East endcap tracks in
166total: " << east1 << " " << east2 << " " << east3 << " " << east4 << std::endl;
167 std::cout<<" ===> The TofRec West endcap tracks in total: " << west1 << " "
168<< west2 << " " << west3 << " " << west4 << std::endl; std::cout<<" ===> The invalid
169Extend tracks in total: "<< nohit1 << " " << nohit2 << " " << nohit3 << " " << nohit4
170<<std::endl; std::cout<<"############################# End Summary
171#######################################" <<std::endl;
172
173}
174*/
175
177 std::cout
178 << "############################# TofRec Summary #####################################"
179 << std::endl;
180 std::cout << " ===> Number of Extrapolated tracks: " << extTrkNum << std::endl;
181 std::cout << " ===> Number of valid Extraploated tracks: "
182 << ( inner1 + outer1 + double1 + east1 + west1 )
183 << " Barrel: " << ( inner1 + outer1 + double1 )
184 << " Endcap: " << ( east1 + west1 ) << std::endl;
185 std::cout << " ===> TofRec: number of barrel tracks: " << ( inner3 + outer3 + double3 )
186 << " Efficiency: " << setprecision( 4 )
187 << ( inner3 + outer3 + double3 ) * 100.0 / ( ( inner1 + outer1 + double1 ) * 1.0 )
188 << "%" << std::endl;
189 std::cout << " ===> Inner Layer hit only in total: " << inner1 << " \t" << inner2
190 << " \t" << inner3 << " \t" << inner4 << std::endl;
191 std::cout << " ===> Outer Layer hit only in total: " << outer1 << "\t" << outer2
192 << " \t" << outer3 << " \t" << outer4 << std::endl;
193 std::cout << " ===> Double Layer hit in total: " << double1 << " \t" << double2
194 << " \t" << double3 << " \t" << double4 << std::endl;
195 std::cout << " ===> TofRec: number of endcap tracks: " << ( east3 + west3 )
196 << " Efficiency: " << setprecision( 4 )
197 << ( east3 + west3 ) * 100.0 / ( ( east1 + west1 ) * 1.0 ) << "%" << std::endl;
198 std::cout << " ===> East endcap tracks in total: " << east1 << " \t" << east2 << " \t"
199 << east3 << " \t" << east4 << std::endl;
200 std::cout << " ===> West endcap tracks in total: " << west1 << " \t" << west2 << " \t"
201 << west3 << " \t" << west4 << std::endl;
202 std::cout << " ===> The invalid Extend tracks in total: " << nohit1 << " \t" << nohit2
203 << " \t" << nohit3 << " \t" << nohit4 << std::endl;
204 std::cout
205 << "############################# End Summary #######################################"
206 << std::endl;
207}
208
210 for ( unsigned int i = 0; i < nParBhabha; i++ ) { nbb[i] = 0; }
211 return;
212}
213
214void TofCount::addNumber( unsigned int i ) {
215 if ( i < nParBhabha ) { nbb[i]++; }
216 return;
217}
218
219void TofCount::finalBhabha( std::string calibData ) {
220 std::cout << "$$$$$$$ Summary of Bhabha Selection Criteria $$$$$$$$$$$$$$$$$$$$$"
221 << std::endl;
222 std::cout << "0 Total umber of events: " << nbb[0] << "\t"
223 << "Ratio1: " << setprecision( 4 ) << double( nbb[0] ) * 100.0 / double( nbb[0] )
224 << "%"
225 << "\t"
226 << "Ratio2: " << setprecision( 4 ) << double( nbb[0] ) * 100.0 / double( nbb[0] )
227 << "%" << std::endl;
228 std::cout << "1 Event Start Time: " << nbb[1] << "\t"
229 << "Ratio1: " << setprecision( 4 ) << double( nbb[1] ) * 100.0 / double( nbb[0] )
230 << "%"
231 << "\t"
232 << "Ratio2: " << setprecision( 4 ) << double( nbb[1] ) * 100.0 / double( nbb[0] )
233 << "%" << std::endl;
234 std::cout << "2 N_ext_track = 2: " << nbb[2] << "\t"
235 << "Ratio1: " << setprecision( 4 ) << double( nbb[2] ) * 100.0 / double( nbb[1] )
236 << "%"
237 << "\t"
238 << "Ratio2: " << setprecision( 4 ) << double( nbb[2] ) * 100.0 / double( nbb[0] )
239 << "%" << std::endl;
240 std::cout << "3 N_mdc_track = 2: " << nbb[3] << "\t"
241 << "Ratio1: " << setprecision( 4 ) << double( nbb[3] ) * 100.0 / double( nbb[2] )
242 << "%"
243 << "\t"
244 << "Ratio2: " << setprecision( 4 ) << double( nbb[3] ) * 100.0 / double( nbb[0] )
245 << "%" << std::endl;
246 std::cout << "4 EMC reconstructed: " << nbb[4] << "\t"
247 << "Ratio1: " << setprecision( 4 ) << double( nbb[4] ) * 100.0 / double( nbb[3] )
248 << "%"
249 << "\t"
250 << "Ratio2: " << setprecision( 4 ) << double( nbb[4] ) * 100.0 / double( nbb[0] )
251 << "%" << std::endl;
252 std::cout << "5 N_shower >= 2: " << nbb[5] << "\t"
253 << "Ratio1: " << setprecision( 4 ) << double( nbb[5] ) * 100.0 / double( nbb[4] )
254 << "%"
255 << "\t"
256 << "Ratio2: " << setprecision( 4 ) << double( nbb[5] ) * 100.0 / double( nbb[0] )
257 << "%" << std::endl;
258 std::cout << "6 Total charge = 0: " << nbb[6] << "\t"
259 << "Ratio1: " << setprecision( 4 ) << double( nbb[6] ) * 100.0 / double( nbb[5] )
260 << "%"
261 << "\t"
262 << "Ratio2: " << setprecision( 4 ) << double( nbb[6] ) * 100.0 / double( nbb[0] )
263 << "%" << std::endl;
264 std::cout << "7 Back to back: " << nbb[7] << "\t"
265 << "Ratio1: " << setprecision( 4 ) << double( nbb[7] ) * 100.0 / double( nbb[6] )
266 << "%"
267 << "\t"
268 << "Ratio2: " << setprecision( 4 ) << double( nbb[7] ) * 100.0 / double( nbb[0] )
269 << "%" << std::endl;
270 std::cout << "8 Kalman Filter: " << nbb[8] << "\t"
271 << "Ratio1: " << setprecision( 4 ) << double( nbb[8] ) * 100.0 / double( nbb[7] )
272 << "%"
273 << "\t"
274 << "Ratio2: " << setprecision( 4 ) << double( nbb[8] ) * 100.0 / double( nbb[0] )
275 << "%" << std::endl;
276 std::cout << "9 Distance of ext-shower: " << nbb[9] << "\t"
277 << "Ratio1: " << setprecision( 4 ) << double( nbb[9] ) * 100.0 / double( nbb[8] )
278 << "%"
279 << "\t"
280 << "Ratio2: " << setprecision( 4 ) << double( nbb[9] ) * 100.0 / double( nbb[0] )
281 << "%" << std::endl;
282 std::cout << "10 Vertex cut of 1st trk: " << nbb[10] << "\t"
283 << "Ratio1: " << setprecision( 4 ) << double( nbb[10] ) * 100.0 / double( nbb[9] )
284 << "%"
285 << "\t"
286 << "Ratio2: " << setprecision( 4 ) << double( nbb[10] ) * 100.0 / double( nbb[0] )
287 << "%" << std::endl;
288 std::cout << "11 Vertex cut of 2nd trk: " << nbb[11] << "\t"
289 << "Ratio1: " << setprecision( 4 ) << double( nbb[11] ) * 100.0 / double( nbb[10] )
290 << "%"
291 << "\t"
292 << "Ratio2: " << setprecision( 4 ) << double( nbb[11] ) * 100.0 / double( nbb[0] )
293 << "%" << std::endl;
294 std::cout << "12 Delta phi: " << nbb[12] << "\t"
295 << "Ratio1: " << setprecision( 4 ) << double( nbb[12] ) * 100.0 / double( nbb[11] )
296 << "%"
297 << "\t"
298 << "Ratio2: " << setprecision( 4 ) << double( nbb[12] ) * 100.0 / double( nbb[0] )
299 << "%" << std::endl;
300 std::cout << "13 Energy of Shower: " << nbb[13] << "\t"
301 << "Ratio1: " << setprecision( 4 ) << double( nbb[13] ) * 100.0 / double( nbb[12] )
302 << "%"
303 << "\t"
304 << "Ratio2: " << setprecision( 4 ) << double( nbb[13] ) * 100.0 / double( nbb[0] )
305 << "%" << std::endl;
306 if ( calibData == "Bhabha" )
307 {
308 std::cout << "14 Energy of others: " << nbb[14] << "\t"
309 << "Ratio1: " << setprecision( 4 )
310 << double( nbb[14] ) * 100.0 / double( nbb[13] ) << "%"
311 << "\t"
312 << "Ratio2: " << setprecision( 4 )
313 << double( nbb[14] ) * 100.0 / double( nbb[0] ) << "%" << std::endl;
314 }
315 else if ( calibData == "Dimu" ) {}
316 std::cout << "$$$$$$$ End of Summary $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"
317 << std::endl;
318 return;
319}
const unsigned int nParBhabha
Definition TofCount.h:6
@ WestEndcap
Definition TofTrack.h:26
@ OuterLayer
Definition TofTrack.h:23
@ EastEndcapMRPC
Definition TofTrack.h:27
@ InnerLayer
Definition TofTrack.h:22
@ EastEndcap
Definition TofTrack.h:25
@ DoubleLayer
Definition TofTrack.h:24
@ WestEndcapMRPC
Definition TofTrack.h:28
void finalBhabha(std::string calibData)
Definition TofCount.cxx:219
void setExtTrackNum(unsigned int ntrk)
Definition TofCount.cxx:88
void final()
Definition TofCount.cxx:176
void setTrack1Col(std::vector< TofTrack * > *&tofTrackVec)
Definition TofCount.cxx:105
void initBhabha()
Definition TofCount.cxx:209
void setTrack1(TofTrack *&tof)
Definition TofCount.cxx:93
void addNumber(unsigned int i)
Definition TofCount.cxx:214
void setTrack3(TofTrack *&tof)
Definition TofCount.cxx:125
void setTrack2(TofTrack *&tof)
Definition TofCount.cxx:111
void init()
Definition TofCount.cxx:48
void setTrack4(TofTrack *&tof)
Definition TofCount.cxx:139
ExtTrackCase hitCase() const
Definition TofTrack.h:46