CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
MrpcCount.cxx
Go to the documentation of this file.
1#include "MrpcRec/MrpcTrack.h"
2#include "MrpcRec/MrpcCount.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_extrapolation_good_3=0;
59 mrpc_extrapolation_false_3=0;
60 return;
61}
62
63
65 extTrkNum = 0;
66 barrelTrk = 0;
67 endcapTrk = 0;
68 inner1 = 0;
69 outer1 = 0;
70 double1 = 0;
71 east1 = 0;
72 west1 = 0;
73 nohit1 = 0;
74 unchanged1 = 0;
75 changed1 = 0;
76 inner2 = 0;
77 outer2 = 0;
78 double2 = 0;
79 east2 = 0;
80 west2 = 0;
81 nohit2 = 0;
82 unchanged2 = 0;
83 changed2 = 0;
84 inner3 = 0;
85 outer3 = 0;
86 double3 = 0;
87 east3 = 0;
88 west3 = 0;
89 nohit3 = 0;
90 unchanged3 = 0;
91 changed3 = 0;
92 inner4 = 0;
93 outer4 = 0;
94 double4 = 0;
95 east4 = 0;
96 west4 = 0;
97 nohit4 = 0;
98 unchanged4 = 0;
99 changed4 = 0;
100 mrpc_east1_1=0;
101 mrpc_east1_2=0;
102 mrpc_east1_3=0;
103 mrpc_east1_4=0;
104 mrpc_east2_1=0;
105 mrpc_east2_2=0;
106 mrpc_east2_3=0;
107 mrpc_east2_4=0;
108 mrpc_west1_1=0;
109 mrpc_west1_2=0;
110 mrpc_west1_3=0;
111 mrpc_west1_4=0;
112 mrpc_west2_1=0;
113 mrpc_west2_2=0;
114 mrpc_west2_3=0;
115 mrpc_west2_4=0;
116 mrpc_extrapolation_good_3=0;
117 mrpc_extrapolation_false_3=0;
118 return;
119}
120
121
122void MrpcCount::setExtTrackNum( unsigned int ntrk ) {
123 extTrkNum = extTrkNum + ntrk;
124 return;
125}
126
127
129 if( tof->hitCase() == InnerLayer ) inner1++;
130 else if( tof->hitCase() == OuterLayer ) outer1++;
131 else if( tof->hitCase() == DoubleLayer ) double1++;
132 else if( tof->hitCase() == EastEndcap ) east1++;
133 else if( tof->hitCase() == WestEndcap ) west1++;
134 else if( tof->hitCase() == eastendcap_1 ) mrpc_east1_1++;
135 else if( tof->hitCase() == eastendcap_2 ) mrpc_east2_1++;
136 else if( tof->hitCase() == westendcap_1 ) mrpc_west1_1++;
137 else if( tof->hitCase() == westendcap_2 ) mrpc_west2_1++;
138 else nohit1++;
139 return;
140}
141
142
143void MrpcCount::setTrack1Col( std::vector<MrpcTrack*>*& tofTrackVec ) {
144 TofTrackVec::iterator iter_tof = tofTrackVec->begin();
145 for( ; iter_tof!=tofTrackVec->end(); iter_tof++ ) {
146 setTrack1( *iter_tof );
147 }
148 return;
149}
150
151
153 if( tof->hitCase() == InnerLayer ) inner2++;
154 else if( tof->hitCase() == OuterLayer ) outer2++;
155 else if( tof->hitCase() == DoubleLayer ) double2++;
156 else if( tof->hitCase() == EastEndcap ) east2++;
157 else if( tof->hitCase() == WestEndcap ) west2++;
158 else if( tof->hitCase() == eastendcap_1 ) mrpc_east1_2++;
159 else if( tof->hitCase() == eastendcap_2 ) mrpc_east2_2++;
160 else if( tof->hitCase() == westendcap_1 ) mrpc_west1_2++;
161 else if( tof->hitCase() == westendcap_2 ) mrpc_west2_2++;
162 else nohit2++;
163 // if( tof->changed() ) changed2++;
164 // else unchanged2++;
165 return;
166}
167
168
170 if( tof->hitCase() == InnerLayer ) inner3++;
171 else if( tof->hitCase() == OuterLayer ) outer3++;
172 else if( tof->hitCase() == DoubleLayer ) double3++;
173 else if( tof->hitCase() == EastEndcap ) east3++;
174 else if( tof->hitCase() == WestEndcap ) west3++;
175 else if( tof->hitCase() == eastendcap_1 ) mrpc_east1_3++;
176 else if( tof->hitCase() == eastendcap_2 ) mrpc_east2_3++;
177 else if( tof->hitCase() == westendcap_1 ) mrpc_west1_3++;
178 else if( tof->hitCase() == westendcap_2 ) mrpc_west2_3++;
179 else nohit3++;
180 // if( tof->changed() ) changed3++;
181 // else unchanged3++;
182
183
184
185 if( ( tof->hitCase() == eastendcap_1 ) || ( tof->hitCase() == eastendcap_2 ) || ( tof->hitCase() == westendcap_1 ) || ( tof->hitCase() == westendcap_2 ))
186 {
187 if(tof->is_mrpc_extrapolation_good()==true) mrpc_extrapolation_good_3++;
188 else mrpc_extrapolation_false_3++;
189 }
190
191 return;
192}
193
194
196 if( tof->hitCase() == InnerLayer ) inner4++;
197 else if( tof->hitCase() == OuterLayer ) outer4++;
198 else if( tof->hitCase() == DoubleLayer ) double4++;
199 else if( tof->hitCase() == EastEndcap ) east4++;
200 else if( tof->hitCase() == WestEndcap ) west4++;
201 else if( tof->hitCase() == eastendcap_1 ) mrpc_east1_4++;
202 else if( tof->hitCase() == eastendcap_2 ) mrpc_east2_4++;
203 else if( tof->hitCase() == westendcap_1 ) mrpc_west1_4++;
204 else if( tof->hitCase() == westendcap_2 ) mrpc_west2_4++;
205 else nohit4++;
206 // if( tof->changed() ) changed4++;
207 // else unchanged4++;
208 return;
209}
210
211/*
212void TofCount::final() {
213 std::cout<<"############################# TofRec Summary #####################################" << std::endl;
214 std::cout<<" ===> The Extend tracks in total: " << extTrkNum <<std::endl;
215 std::cout<<" ===> The valid Extend tracks in total: "<< (inner4+outer4+double4+east4+west4) <<std::endl;
216 std::cout<<" ===> The TofRec barrel tracks in total: " << (inner4+outer4+double4) <<std::endl;
217 std::cout<<" ===> The Inner Layer hit only in total: " << inner1 << " " << inner2 << " " << inner3 << " " << inner4 << std::endl;
218 std::cout<<" ===> The Outer Layer hit only in total: " << outer1 << " " << outer2 << " " << outer3 << " " << outer4 << std::endl;
219 std::cout<<" ===> The Double Layer hit in total: " << double1 << " " << double2 << " " << double3 << " " << double4 << std::endl;
220 std::cout<<" ===> The TofRec endcap tracks in total: " << (east4+west4) <<std::endl;
221 std::cout<<" ===> The TofRec East endcap tracks in total: " << east1 << " " << east2 << " " << east3 << " " << east4 << std::endl;
222 std::cout<<" ===> The TofRec West endcap tracks in total: " << west1 << " " << west2 << " " << west3 << " " << west4 << std::endl;
223 std::cout<<" ===> The invalid Extend tracks in total: "<< nohit1 << " " << nohit2 << " " << nohit3 << " " << nohit4 <<std::endl;
224 std::cout<<"############################# End Summary #######################################" <<std::endl;
225
226}
227*/
228
230 std::cout<<"############################# TofRec Summary #####################################" << std::endl;
231 std::cout<<" ===> Number of Extrapolated tracks: " << extTrkNum <<std::endl;
232 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;
233 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;
234 std::cout<<" ===> Inner Layer hit only in total: " << inner1 << " \t" << inner2 << " \t" << inner3 << " \t" << inner4 << std::endl;
235 std::cout<<" ===> Outer Layer hit only in total: " << outer1 << "\t" << outer2 << " \t" << outer3 << " \t" << outer4 << std::endl;
236 std::cout<<" ===> Double Layer hit in total: " << double1 << " \t" << double2 << " \t" << double3 << " \t" << double4 << std::endl;
237 if((east1+west1+mrpc_east1_1+mrpc_east2_1+mrpc_west1_1+mrpc_west2_1)!=0) 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;
238 std::cout<<" ===> East endcap tracks in total: " << east1 << " \t" << east2 << " \t" << east3 << " \t" << east4 << std::endl;
239 std::cout<<" ===> West endcap tracks in total: " << west1 << " \t" << west2 << " \t" << west3 << " \t" << west4 << std::endl;
240 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;
241 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;
242 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;
243 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;
244
245 std::cout<<" ===> The invalid Extend tracks in total: "<< nohit1 << " \t" << nohit2 << " \t" << nohit3 << " \t" << nohit4 <<std::endl;
246
247 if((mrpc_extrapolation_good_3+mrpc_extrapolation_false_3)!=0)std::cout<<" ==> Correct MRPC extrapolation: " << (mrpc_extrapolation_good_3*100.0)/((mrpc_extrapolation_good_3+mrpc_extrapolation_false_3)*1.0)<< "%" << std::endl;
248
249 std::cout<<"############################# End Summary #######################################" <<std::endl;
250
251}
252
253
@ WestEndcap
Definition MrpcTrack.h:20
@ westendcap_2
Definition MrpcTrack.h:20
@ OuterLayer
Definition MrpcTrack.h:20
@ westendcap_1
Definition MrpcTrack.h:20
@ InnerLayer
Definition MrpcTrack.h:20
@ eastendcap_2
Definition MrpcTrack.h:20
@ EastEndcap
Definition MrpcTrack.h:20
@ DoubleLayer
Definition MrpcTrack.h:20
@ eastendcap_1
Definition MrpcTrack.h:20
void setExtTrackNum(unsigned int ntrk)
void init()
Definition MrpcCount.cxx:64
void setTrack4(MrpcTrack *&tof)
void setTrack1(MrpcTrack *&tof)
void setTrack3(MrpcTrack *&tof)
void setTrack2(MrpcTrack *&tof)
void final()
void setTrack1Col(std::vector< MrpcTrack * > *&tofTrackVec)
ExtTrackCase hitCase() const
Definition MrpcTrack.h:33
bool is_mrpc_extrapolation_good()
Definition MrpcTrack.h:110