83 {
84 MsgStream log(
msgSvc(), name() );
85
86
87 SmartDataPtr<EventNavigator> navigator( eventSvc(), "/Event/Navigator" );
88 if ( !navigator )
89 {
90 log << MSG::ERROR << " Unable to retrieve EventNavigator" << endmsg;
91 return StatusCode::FAILURE;
92 }
93
94 log << MSG::INFO << "EventNavigator object" << endmsg;
95 navigator->Print();
96
97
98 log << MSG::INFO
99 << "=======================================================================" << endmsg;
100 log << MSG::INFO
101 << "MC Particles ==============================================================="
102 << endmsg;
103
104
105 SmartDataPtr<McParticleCol> mcParticles( eventSvc(), "/Event/MC/McParticleCol" );
106 if ( !mcParticles )
107 {
108 log << MSG::ERROR << " Unable to retrieve McParticleCol" << endmsg;
109 return StatusCode::FAILURE;
110 }
111
112
113 for ( McParticleCol::iterator it = mcParticles->begin(); it != mcParticles->end(); it++ )
114 {
115
116 int pdg_code = ( *it )->particleProperty();
117
118
119 double true_mom = ( *it )->initialFourMomentum().vect().mag();
120
121
122 m_histo[5]->Fill( true_mom );
123
124 log << MSG::INFO << "Retrieved McParticle # " << ( *it )->trackIndex() << " PDG "
125 << pdg_code << " of true momentum " << true_mom << " GeV/c " << endmsg;
126
127
128
131
132
133 m_histo[2]->Fill( tracks.size() );
134
135 log << MSG::INFO << " Found " << tracks.size() << " tracks and " << ktracks.size()
136 << " Kalman tracks" << endmsg;
137
138
139 for ( unsigned int i = 0; i < ktracks.size(); i++ )
140 {
141
143
144 log << MSG::INFO << "\t Track # " << i << " id = " << ktracks[i]->trackId() << " Pid "
145 << ktracks[i]->getPidType() <<
" Ptot " <<
momentum <<
" GeV/c" << endmsg;
146
147
148 m_histo[0]->Fill( true_mom -
momentum );
149
150
151 m_histo2[0]->Fill( true_mom, fabs( true_mom -
momentum ) / true_mom );
152 }
153
154
155
157
158 m_histo[8]->Fill( showers.size() );
159
160 log << MSG::INFO << " Found " << showers.size() << " showers" << endmsg;
161
162 for ( unsigned int i = 0; i < showers.size(); i++ )
163 {
164 double true_energy = ( *it )->initialFourMomentum().e();
165 double rec_energy = showers[i]->energy() * 1000;
166
167 log << MSG::INFO << "\t Shower # " << i
168 << " Id = " << showers[i]->getShowerId().get_value()
169 << " E = " << showers[i]->energy() * 1000 << " MeV " << endmsg;
170
171 m_histo[12]->Fill( true_energy );
172 m_histo[13]->Fill( rec_energy );
173 }
174 }
175
176 log << MSG::INFO
177 << "MDC Tracks ==============================================================" << endmsg;
178
179
180 SmartDataPtr<RecMdcKalTrackCol> mdcKalTracks( eventSvc(), "/Event/Recon/RecMdcKalTrackCol" );
181 if ( !mdcKalTracks )
182 {
183 log << MSG::ERROR << " Unable to retrieve MdcKalTrackCol" << endmsg;
184 return StatusCode::SUCCESS;
185 }
186
187 for ( RecMdcKalTrackCol::iterator it = mdcKalTracks->begin(); it != mdcKalTracks->end();
188 it++ )
189 {
191
192 log << MSG::INFO << "Retrieved " << particles.size()
193 << " McParticles for for MdcKalTrack # " << ( *it )->trackId()
194 << " of reconstructed momentum " << ( *it )->p()
195 << " GeV/c (PID=" << ( *it )->getPidType() << ")" << endmsg;
196
197
198 m_histo[6]->Fill( ( *it )->p() );
199
200
201 m_histo[1]->Fill( particles.size() );
202
203
204 for ( unsigned int i = 0; i < particles.size(); i++ )
205 {
206 int pdg_code = particles[i]->particleProperty();
207
208
209 double true_mom = particles[i]->initialFourMomentum().vect().mag();
210
211
212 int relevance = navigator->getMcParticleRelevance( *it, particles[i] );
213
214
215 log << MSG::INFO << "\t" << pdg_code << " momentum " << true_mom << " relevance "
216 << relevance << endmsg;
217 }
218 }
219
220
221 log << MSG::INFO
222 << "EMC Showers =============================================================="
223 << endmsg;
224 SmartDataPtr<RecEmcShowerCol> emcShowers( eventSvc(), "/Event/Recon/RecEmcShowerCol" );
225 if ( !emcShowers )
226 {
227 log << MSG::ERROR << " Unable to retrieve EmcRecShowerCol" << endmsg;
228 return StatusCode::SUCCESS;
229 }
230
231 int ij = 0;
232 for ( RecEmcShowerCol::iterator it = emcShowers->begin(); it != emcShowers->end(); it++ )
233 {
235 log << MSG::INFO << "Retrieved McParticles for EmcShower # " << ij++ << " Id "
236 << ( *it )->getShowerId().get_value() << " Energy = " << ( *it )->energy() << endmsg;
237
238 for ( unsigned int i = 0; i < particles.size(); i++ )
239 {
240 int pdg_code = particles[i]->particleProperty();
241
242
243 double true_e = particles[i]->initialFourMomentum().e();
244
245
246 int relevance = navigator->getMcParticleRelevance( *it, particles[i] );
247
248 log << "\t Particle " << i << " PDG " << pdg_code << " E=" << true_e << " Relevance "
249 << relevance << endmsg;
250 }
251
252
253 m_histo[7]->Fill( particles.size() );
254 }
255
256 log << MSG::INFO
257 << "=======================================================================" << endmsg;
258
259 return StatusCode::SUCCESS;
260}
**********INTEGER nmxhep !maximum number of particles DOUBLE PRECISION vhep INTEGER jdahep COMMON hepevt $ !serial number $ !number of particles $ !status code $ !particle ident KF $ !parent particles $ !childreen particles $ !four momentum
std::vector< const RecMdcTrack * > RecMdcTrackVector
std::vector< const Event::McParticle * > McParticleVector
std::vector< const RecMdcKalTrack * > RecMdcKalTrackVector
std::vector< const RecEmcShower * > RecEmcShowerVector