BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
EventNavigator.cxx
Go to the documentation of this file.
1#include <iostream>
2
4
5using namespace std;
6using namespace Event;
7
8// methods to retrieve physics objects corresponding given detector id
9
11{
13 multimap <unsigned int, const RecEmcShower*>::iterator it;
14 for (it=m_emcRecShowerId.equal_range(id).first;
15 it != m_emcRecShowerId.equal_range(id).second;
16 it++)
17 tmp.push_back((*it).second);
18 return tmp;
19}
20
22{
23 cout << "EventNavigator object:" << std::endl;
24 cout << " Mdc hits: " << m_mcMdcMcHitsIdx.size() << endl;
25 cout << " Mdc tracks: " << m_mcMdcTracksIdx.size() << endl;
26 cout << " Emc hits: " << m_mcEmcMcHitsIdx.size() << endl;
27 cout << " Emc showers: " << m_mcEmcRecShowersIdx.size() << endl;
28 cout << " TABLES:" << endl;
29 cout << " m_mdcTracksWrtMcParticle "
30 << m_mdcTracksWrtMcParticle.size() << endl;
31 cout << " m_mcParticlesWrtMdcTrack "
32 << m_mcParticlesWrtMdcTrack.size() << endl;
33 cout << " m_mdcKalTracksWrtMcParticle "
34 << m_mdcKalTracksWrtMcParticle.size() << endl;
35 cout << " m_mcParticlesWrtMdcKalTrack "
36 << m_mcParticlesWrtMdcKalTrack.size() << endl;
37 cout << " m_mdcTracksWrtMcParticleP "
38 << m_mdcTracksWrtMcParticleP.size() << endl;
39 cout << " m_mcParticlesWrtMdcTrackP "
40 << m_mcParticlesWrtMdcTrackP.size() << endl;
41 cout << " m_mdcKalTracksWrtMcParticle "
42 << m_mdcKalTracksWrtMcParticleP.size() << endl;
43 cout << " m_mcParticlesWrtMdcKalTrack "
44 << m_mcParticlesWrtMdcKalTrackP.size() << endl;
45 cout << " m_mcParticlesWrtRecShower "
46 << m_mcParticlesWrtRecShower.size() << endl;
47 cout << " m_emcRecShowersWrtMcParticle "
48 << m_emcRecShowersWrtMcParticle.size() << endl;
49 cout << " m_mcParticlesWrtEmcShowerP "
50 << m_mcParticlesWrtRecEmcShowerP.size() << endl;
51 cout << " m_emcRecShowersWrtMcParticle "
52 << m_emcRecShowersWrtMcParticleP.size() << endl;
53}
54
55
56//=====================================
57// MDC
58
60{
61 return m_mcParticlesWrtMdcTrack[key->trackId()];
62}
63
65{
66 return m_mcParticlesWrtMdcKalTrack[key->trackId()];
67}
68
70{
71 return m_mcParticlesWrtRecShower[key->getShowerId().get_value()];
72}
73
74
76{
77 return m_mdcTracksWrtMcParticle[key->trackIndex()];
78}
79
81{
82 return m_mdcKalTracksWrtMcParticle[key->trackIndex()];
83}
84
85// Return number of hits contributed by the McParticle to given MdcTrack
87{
88 McParticleVectorP& vpair = m_mcParticlesWrtMdcTrackP[key->trackId()];
89 McParticleVectorP::iterator it;
90 for (it=vpair.begin(); it!=vpair.end(); it++)
91 {
92 if ( (*it).first == value )
93 {
94 return (*it).second;
95 }
96 }
97}
98
100{
101 McParticleVectorP& vpair = m_mcParticlesWrtMdcKalTrackP[key->trackId()];
102 McParticleVectorP::iterator it;
103 for (it=vpair.begin(); it!=vpair.end(); it++)
104 {
105 if ( (*it).first == value )
106 {
107 return (*it).second;
108 }
109 }
110}
111
113{
114 McParticleVectorP& vpair = m_mcParticlesWrtRecEmcShowerP[key->getShowerId().get_value()];
115 McParticleVectorP::iterator it;
116 for (it=vpair.begin(); it!=vpair.end(); it++)
117 {
118 if ( (*it).first == value )
119 {
120 return (*it).second;
121 }
122 }
123}
124
126{
127 return m_emcRecShowersWrtMcParticle[key->trackIndex()];
128}
129
130// ==== Methods to store relations ====
131// store list of MdcTracks corresponding given McParticle
133{
134 RecMdcTrackVectorP& vpair = m_mdcTracksWrtMcParticleP[key->trackIndex()];
135 RecMdcTrackVectorP::iterator it;
136 bool found = false;
137 for (it=vpair.begin(); it!=vpair.end(); it++)
138 {
139 if ( (*it).first == value )
140 {
141 (*it).second++;
142 found = true;
143 break;
144 }
145 }
146
147 if( ! found )
148 vpair.push_back( pair<const RecMdcTrack*,int>(value,1));
149
150 RecMdcTrackVector& tmp = m_mdcTracksWrtMcParticle[key->trackIndex()];
151 for (it=vpair.begin(); it!=vpair.end(); it++)
152 {
153 if((*it).second > m_mdcCut)
154 {
155 if (find(tmp.begin(),tmp.end(),(*it).first) == tmp.end() )
156 {
157 tmp.push_back((*it).first);
158 }
159 }
160 }
161}
162
163// store list of MdcKalTracks corresponding given McParticle
165{
166 RecMdcKalTrackVectorP& vpair = m_mdcKalTracksWrtMcParticleP[key->trackIndex()];
167 RecMdcKalTrackVectorP::iterator it;
168 bool found = false;
169 for (it=vpair.begin(); it!=vpair.end(); it++)
170 {
171 if ( (*it).first == value )
172 {
173 (*it).second++;
174 found = true;
175 break;
176 }
177 }
178
179 if( ! found )
180 vpair.push_back( pair<const RecMdcKalTrack*,int>(value,1));
181
182 RecMdcKalTrackVector& tmp = m_mdcKalTracksWrtMcParticle[key->trackIndex()];
183 for (it=vpair.begin(); it!=vpair.end(); it++)
184 {
185 if((*it).second > m_mdcCut)
186 {
187 if (find(tmp.begin(),tmp.end(),(*it).first) == tmp.end() )
188 {
189 tmp.push_back((*it).first);
190 }
191 }
192 }
193}
194
195// store list of McParticles corresponding given MdcTrack
197{
198 McParticleVectorP& vpair = m_mcParticlesWrtMdcTrackP[key->trackId()];
199 McParticleVectorP::iterator it;
200 bool found = false;
201 for (it=vpair.begin(); it!=vpair.end(); it++)
202 {
203 if ( (*it).first == value )
204 {
205 (*it).second++;
206 found = true;
207 break;
208 }
209 }
210
211 if( ! found )
212 vpair.push_back( pair<const McParticle*,int>(value,1));
213
214 McParticleVector& tmp = m_mcParticlesWrtMdcTrack[key->trackId()];
215 for (it=vpair.begin(); it!=vpair.end(); it++)
216 {
217 if((*it).second > m_mdcCut)
218 {
219 if (find(tmp.begin(),tmp.end(),(*it).first) == tmp.end() )
220 {
221 tmp.push_back((*it).first);
222 }
223 }
224 }
225}
226
227
228// store list of McParticles corresponding given MdcKalTrack
230{
231 McParticleVectorP& vpair = m_mcParticlesWrtMdcKalTrackP[key->trackId()];
232 McParticleVectorP::iterator it;
233 bool found = false;
234 for (it=vpair.begin(); it!=vpair.end(); it++)
235 {
236 if ( (*it).first == value )
237 {
238 (*it).second++;
239 found = true;
240 break;
241 }
242 }
243
244 if( ! found )
245 vpair.push_back( pair<const McParticle*,int>(value,1));
246
247 McParticleVector& tmp = m_mcParticlesWrtMdcKalTrack[key->trackId()];
248 for (it=vpair.begin(); it!=vpair.end(); it++)
249 {
250 if((*it).second > m_mdcCut)
251 {
252 if (find(tmp.begin(),tmp.end(),(*it).first) == tmp.end() )
253 {
254 tmp.push_back((*it).first);
255 }
256 }
257 }
258}
259
260// store list of McParticles corresponding given EmcRecShower
262{
263// McParticleVector& tmp = m_mcParticlesWrtRecShower[((RecEmcShower*)key)->getShowerId().get_value()];
264// if (find(tmp.begin(),tmp.end(),value) == tmp.end() )
265// tmp.push_back(value);
266
267 McParticleVectorP& vpair = m_mcParticlesWrtRecEmcShowerP[((RecEmcShower*)key)->getShowerId().get_value()];
268 McParticleVectorP::iterator it;
269 bool found = false;
270 for (it=vpair.begin(); it!=vpair.end(); it++)
271 {
272 if ( (*it).first == value )
273 {
274 (*it).second++;
275 found = true;
276 break;
277 }
278 }
279
280 if( ! found )
281 vpair.push_back( pair<const McParticle*,int>(value,1));
282
283 McParticleVector& tmp = m_mcParticlesWrtRecShower[((RecEmcShower*)key)->getShowerId().get_value()];
284 for (it=vpair.begin(); it!=vpair.end(); it++)
285 {
286 if (find(tmp.begin(),tmp.end(),(*it).first) == tmp.end() )
287 {
288 tmp.push_back((*it).first);
289 }
290 }
291}
292
293// store list of EmcRecShowers corresponding given McParticle
295{
296// RecEmcShowerVector& tmp = m_emcRecShowersWrtMcParticle[key->trackIndex()];
297// if (find(tmp.begin(),tmp.end(),value) == tmp.end() )
298// tmp.push_back(value);
299 RecEmcShowerVectorP& vpair = m_emcRecShowersWrtMcParticleP[key->trackIndex()];
300 RecEmcShowerVectorP::iterator it;
301 bool found = false;
302 for (it=vpair.begin(); it!=vpair.end(); it++)
303 {
304 if ( (*it).first == value )
305 {
306 (*it).second++;
307 found = true;
308 break;
309 }
310 }
311
312 if( ! found )
313 vpair.push_back( pair<const RecEmcShower*,int>(value,1));
314
315 RecEmcShowerVector& tmp = m_emcRecShowersWrtMcParticle[key->trackIndex()];
316 for (it=vpair.begin(); it!=vpair.end(); it++)
317 {
318 if (find(tmp.begin(),tmp.end(),(*it).first) == tmp.end() )
319 {
320 tmp.push_back((*it).first);
321 }
322 }
323}
324
std::vector< const RecMdcTrack * > RecMdcTrackVector
std::vector< const Event::McParticle * > McParticleVector
std::vector< pair< const Event::McParticle *, int > > McParticleVectorP
std::vector< pair< const RecMdcKalTrack *, int > > RecMdcKalTrackVectorP
std::vector< const RecMdcKalTrack * > RecMdcKalTrackVector
std::vector< const RecEmcShower * > RecEmcShowerVector
std::vector< pair< const RecMdcTrack *, int > > RecMdcTrackVectorP
std::vector< pair< const RecEmcShower *, int > > RecEmcShowerVectorP
*************DOUBLE PRECISION m_pi *DOUBLE PRECISION m_HvecTau2 DOUBLE PRECISION m_HvClone2 DOUBLE PRECISION m_gamma1 DOUBLE PRECISION m_gamma2 DOUBLE PRECISION m_thet1 DOUBLE PRECISION m_thet2 INTEGER m_IFPHOT *COMMON c_Taupair $ !Spin Polarimeter vector first Tau $ !Spin Polarimeter vector second Tau $ !Clone Spin Polarimeter vector first Tau $ !Clone Spin Polarimeter vector second Tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !phi of HvecTau1 $ !theta of HvecTau1 $ !phi of HvecTau2 $ !theta of HvecTau2 $ !super key
Definition Taupair.h:42
RecMdcKalTrackVector & getMdcKalTracks(const Event::McParticle *key)
void addLink(const Event::McParticle *key, const RecMdcTrack *value)
int getMcParticleRelevance(const RecMdcTrack *key, const Event::McParticle *value)
McParticleVector & getMcParticles(const RecMdcTrack *key)
RecMdcTrackVector & getMdcTracks(const Event::McParticle *key)
RecEmcShowerVector getEmcRecShowers(int id)
Definition Event.h:21