CGEM BOSS 6.6.5.f
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 nohit1++;
105 return;
106}
107
108
109void TofCount::setTrack1Col( std::vector<TofTrack*>*& tofTrackVec ) {
110 TofTrackVec::iterator iter_tof = tofTrackVec->begin();
111 for( ; iter_tof!=tofTrackVec->end(); iter_tof++ ) {
112 setTrack1( *iter_tof );
113 }
114 return;
115}
116
117
119 if( tof->hitCase() == InnerLayer ) inner2++;
120 else if( tof->hitCase() == OuterLayer ) outer2++;
121 else if( tof->hitCase() == DoubleLayer ) double2++;
122 else if( tof->hitCase() == EastEndcap ) east2++;
123 else if( tof->hitCase() == WestEndcap ) west2++;
124 else nohit2++;
125 // if( tof->changed() ) changed2++;
126 // else unchanged2++;
127 return;
128}
129
130
132 if( tof->hitCase() == InnerLayer ) inner3++;
133 else if( tof->hitCase() == OuterLayer ) outer3++;
134 else if( tof->hitCase() == DoubleLayer ) double3++;
135 else if( tof->hitCase() == EastEndcap ) east3++;
136 else if( tof->hitCase() == WestEndcap ) west3++;
137 else nohit3++;
138 // if( tof->changed() ) changed3++;
139 // else unchanged3++;
140 return;
141}
142
143
145 if( tof->hitCase() == InnerLayer ) inner4++;
146 else if( tof->hitCase() == OuterLayer ) outer4++;
147 else if( tof->hitCase() == DoubleLayer ) double4++;
148 else if( tof->hitCase() == EastEndcap ) east4++;
149 else if( tof->hitCase() == WestEndcap ) west4++;
150 else nohit4++;
151 // if( tof->changed() ) changed4++;
152 // else unchanged4++;
153 return;
154}
155
156/*
157void TofCount::final() {
158 std::cout<<"############################# TofRec Summary #####################################" << std::endl;
159 std::cout<<" ===> The Extend tracks in total: " << extTrkNum <<std::endl;
160 std::cout<<" ===> The valid Extend tracks in total: "<< (inner4+outer4+double4+east4+west4) <<std::endl;
161 std::cout<<" ===> The TofRec barrel tracks in total: " << (inner4+outer4+double4) <<std::endl;
162 std::cout<<" ===> The Inner Layer hit only in total: " << inner1 << " " << inner2 << " " << inner3 << " " << inner4 << std::endl;
163 std::cout<<" ===> The Outer Layer hit only in total: " << outer1 << " " << outer2 << " " << outer3 << " " << outer4 << std::endl;
164 std::cout<<" ===> The Double Layer hit in total: " << double1 << " " << double2 << " " << double3 << " " << double4 << std::endl;
165 std::cout<<" ===> The TofRec endcap tracks in total: " << (east4+west4) <<std::endl;
166 std::cout<<" ===> The TofRec East endcap tracks in total: " << east1 << " " << east2 << " " << east3 << " " << east4 << std::endl;
167 std::cout<<" ===> The TofRec West endcap tracks in total: " << west1 << " " << west2 << " " << west3 << " " << west4 << std::endl;
168 std::cout<<" ===> The invalid Extend tracks in total: "<< nohit1 << " " << nohit2 << " " << nohit3 << " " << nohit4 <<std::endl;
169 std::cout<<"############################# End Summary #######################################" <<std::endl;
170
171}
172*/
173
175 std::cout<<"############################# TofRec Summary #####################################" << std::endl;
176 std::cout<<" ===> Number of Extrapolated tracks: " << extTrkNum <<std::endl;
177 std::cout<<" ===> Number of valid Extraploated tracks: " << (inner1+outer1+double1+east1+west1) << " Barrel: " << (inner1+outer1+double1) << " Endcap: " << (east1+west1) << std::endl;
178 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;
179 std::cout<<" ===> Inner Layer hit only in total: " << inner1 << " \t" << inner2 << " \t" << inner3 << " \t" << inner4 << std::endl;
180 std::cout<<" ===> Outer Layer hit only in total: " << outer1 << "\t" << outer2 << " \t" << outer3 << " \t" << outer4 << std::endl;
181 std::cout<<" ===> Double Layer hit in total: " << double1 << " \t" << double2 << " \t" << double3 << " \t" << double4 << std::endl;
182 std::cout<<" ===> TofRec: number of endcap tracks: " << (east3+west3) << " Efficiency: " << setprecision(4) << (east3+west3)*100.0/((east1+west1)*1.0) << "%" << std::endl;
183 std::cout<<" ===> East endcap tracks in total: " << east1 << " \t" << east2 << " \t" << east3 << " \t" << east4 << std::endl;
184 std::cout<<" ===> West endcap tracks in total: " << west1 << " \t" << west2 << " \t" << west3 << " \t" << west4 << std::endl;
185 std::cout<<" ===> The invalid Extend tracks in total: "<< nohit1 << " \t" << nohit2 << " \t" << nohit3 << " \t" << nohit4 <<std::endl;
186 std::cout<<"############################# End Summary #######################################" <<std::endl;
187
188}
189
190
192 for( unsigned int i=0; i<nParBhabha; i++ ) {
193 nbb[i] = 0;
194 }
195 return;
196}
197
198
199void TofCount::addNumber(unsigned int i) {
200 if( i<nParBhabha ) {
201 nbb[i]++;
202 }
203 return;
204}
205
206
207void TofCount::finalBhabha( std::string calibData ) {
208 std::cout<<"$$$$$$$ Summary of Bhabha Selection Criteria $$$$$$$$$$$$$$$$$$$$$"<<std::endl;
209 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;
210 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;
211 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;
212 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;
213 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;
214 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;
215 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;
216 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;
217 if( calibData=="Bhabha" ) {
218 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;
219 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;
220 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;
221 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;
222 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;
223 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;
224 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;
225 }
226 else if( calibData=="Dimu") {
227 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;
228 std::cout <<"9 Energy of Showers: "<<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;
229 }
230 std::cout<<"$$$$$$$ End of Summary $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$"<<std::endl;
231 return;
232}
void finalBhabha(std::string calibData)
Definition: TofCount.cxx:207
void setExtTrackNum(unsigned int ntrk)
Definition: TofCount.cxx:92
void final()
Definition: TofCount.cxx:174
void setTrack1Col(std::vector< TofTrack * > *&tofTrackVec)
Definition: TofCount.cxx:109
void initBhabha()
Definition: TofCount.cxx:191
TofCount()
Definition: TofCount.cxx:6
void setTrack1(TofTrack *&tof)
Definition: TofCount.cxx:98
void addNumber(unsigned int i)
Definition: TofCount.cxx:199
void setTrack3(TofTrack *&tof)
Definition: TofCount.cxx:131
void setTrack2(TofTrack *&tof)
Definition: TofCount.cxx:118
void init()
Definition: TofCount.cxx:51
void setTrack4(TofTrack *&tof)
Definition: TofCount.cxx:144