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