71 MsgStream log(
msgSvc(), name());
74 SmartDataPtr<EventNavigator> navigator (eventSvc(),
"/Event/Navigator");
77 log << MSG::ERROR <<
" Unable to retrieve EventNavigator" << endreq;
78 return StatusCode::FAILURE;
81 log << MSG::INFO <<
"EventNavigator object" << endreq;
86 log << MSG::INFO <<
"=======================================================================" << endreq;
87 log << MSG::INFO <<
"MC Particles ===============================================================" << endreq;
90 SmartDataPtr<McParticleCol> mcParticles(eventSvc(),
"/Event/MC/McParticleCol");
93 log << MSG::ERROR <<
" Unable to retrieve McParticleCol" << endreq;
94 return StatusCode::FAILURE;
98 for( McParticleCol::iterator it = mcParticles->begin(); it != mcParticles->end(); it++ )
101 int pdg_code = (*it)->particleProperty();
104 double true_mom = (*it)->initialFourMomentum().vect().mag();
107 m_histo[5]->Fill(true_mom);
109 log<<MSG::INFO<<
"Retrieved McParticle # "<<(*it)->trackIndex()
110 <<
" PDG " << pdg_code <<
" of true momentum "
111 << true_mom <<
" GeV/c " <<endreq;
118 m_histo[2]->Fill(tracks.size());
120 log << MSG::INFO <<
" Found " << tracks.size() <<
" tracks and " << ktracks.size() <<
" Kalman tracks" << endreq;
123 for(
unsigned int i=0; i<ktracks.size(); i++)
128 log << MSG::INFO <<
"\t Track # " << i
129 <<
" id = " << ktracks[i]->trackId()
130 <<
" Pid " << ktracks[i]->getPidType()
131 <<
" Ptot " <<
momentum <<
" GeV/c" << endreq;
134 m_histo[0]->Fill(true_mom-
momentum);
137 m_histo2[0]->Fill(true_mom, fabs(true_mom-
momentum)/true_mom);
143 m_histo[8]->Fill(showers.size());
145 log << MSG::INFO <<
" Found " << showers.size() <<
" showers" << endreq;
147 for(
unsigned int i=0; i<showers.size(); i++)
149 double true_energy = (*it)->initialFourMomentum().e();
150 double rec_energy = showers[i]->energy()*1000;
152 log << MSG::INFO <<
"\t Shower # " << i
153 <<
" Id = " << showers[i]->getShowerId().get_value()
154 <<
" E = " << showers[i]->energy()*1000 <<
" MeV " << endreq;
156 m_histo[12]->Fill(true_energy);
157 m_histo[13]->Fill(rec_energy);
161 log << MSG::INFO <<
"MDC Tracks ==============================================================" << endreq;
164 SmartDataPtr<RecMdcKalTrackCol> mdcKalTracks(eventSvc(),
"/Event/Recon/RecMdcKalTrackCol");
167 log << MSG::ERROR <<
" Unable to retrieve MdcKalTrackCol" << endreq;
168 return StatusCode::SUCCESS;
171 for( RecMdcKalTrackCol::iterator it = mdcKalTracks->begin(); it != mdcKalTracks->end(); it++ )
175 log << MSG::INFO <<
"Retrieved " << particles.size() <<
" McParticles for for MdcKalTrack # "
176 << (*it)->trackId() <<
" of reconstructed momentum " << (*it)->p() <<
" GeV/c (PID="
177 << (*it)->getPidType() <<
")" << endreq;
180 m_histo[6]->Fill((*it)->p());
183 m_histo[1]->Fill(particles.size());
186 for(
unsigned int i=0; i<particles.size(); i++)
188 int pdg_code = particles[i]->particleProperty();
191 double true_mom = particles[i]->initialFourMomentum().vect().mag();
194 int relevance = navigator->getMcParticleRelevance(*it, particles[i]);
197 log << MSG::INFO <<
"\t" << pdg_code <<
" momentum "
198 << true_mom <<
" relevance " << relevance << endreq;
203 log << MSG::INFO <<
"EMC Showers ==============================================================" << endreq;
204 SmartDataPtr<RecEmcShowerCol> emcShowers(eventSvc(),
"/Event/Recon/RecEmcShowerCol");
207 log << MSG::ERROR <<
" Unable to retrieve EmcRecShowerCol" << endreq;
208 return StatusCode::SUCCESS;
212 for( RecEmcShowerCol::iterator it = emcShowers->begin(); it != emcShowers->end(); it++ )
215 log << MSG::INFO <<
"Retrieved McParticles for EmcShower # " << ij++
216 <<
" Id " << (*it)->getShowerId().get_value()
217 <<
" Energy = " << (*it)->energy() << endreq;
219 for(
unsigned int i=0; i<particles.size(); i++)
221 int pdg_code = particles[i]->particleProperty();
224 double true_e = particles[i]->initialFourMomentum().e();
227 int relevance = navigator->getMcParticleRelevance(*it, particles[i]);
229 log <<
"\t Particle " << i <<
" PDG " << pdg_code <<
" E=" << true_e
230 <<
" Relevance " << relevance << endreq;
234 m_histo[7]->Fill(particles.size());
237 log << MSG::INFO <<
"=======================================================================" << endreq;
239 return StatusCode::SUCCESS;