73 MsgStream log(
msgSvc(), name());
76 SmartDataPtr<EventNavigator> navigator (eventSvc(),
"/Event/Navigator");
79 log << MSG::ERROR <<
" Unable to retrieve EventNavigator" << endreq;
80 return StatusCode::FAILURE;
83 log << MSG::INFO <<
"EventNavigator object" << endreq;
88 log << MSG::INFO <<
"=======================================================================" << endreq;
89 log << MSG::INFO <<
"MC Particles ===============================================================" << endreq;
92 SmartDataPtr<McParticleCol> mcParticles(eventSvc(),
"/Event/MC/McParticleCol");
95 log << MSG::ERROR <<
" Unable to retrieve McParticleCol" << endreq;
96 return StatusCode::FAILURE;
100 for( McParticleCol::iterator it = mcParticles->begin(); it != mcParticles->end(); it++ )
103 int pdg_code = (*it)->particleProperty();
106 double true_mom = (*it)->initialFourMomentum().vect().mag();
109 m_histo[5]->Fill(true_mom);
111 log<<MSG::INFO<<
"Retrieved McParticle # "<<(*it)->trackIndex()
112 <<
" PDG " << pdg_code <<
" of true momentum "
113 << true_mom <<
" GeV/c " <<endreq;
120 m_histo[2]->Fill(tracks.size());
122 log << MSG::INFO <<
" Found " << tracks.size() <<
" tracks and " << ktracks.size() <<
" Kalman tracks" << endreq;
125 for(
unsigned int i=0; i<ktracks.size(); i++)
130 log << MSG::INFO <<
"\t Track # " << i
131 <<
" id = " << ktracks[i]->trackId()
132 <<
" Pid " << ktracks[i]->getPidType()
133 <<
" Ptot " <<
momentum <<
" GeV/c" << endreq;
136 m_histo[0]->Fill(true_mom-
momentum);
139 m_histo2[0]->Fill(true_mom, fabs(true_mom-
momentum)/true_mom);
145 m_histo[8]->Fill(showers.size());
147 log << MSG::INFO <<
" Found " << showers.size() <<
" showers" << endreq;
149 for(
unsigned int i=0; i<showers.size(); i++)
151 double true_energy = (*it)->initialFourMomentum().e();
152 double rec_energy = showers[i]->energy()*1000;
154 log << MSG::INFO <<
"\t Shower # " << i
155 <<
" Id = " << showers[i]->getShowerId().get_value()
156 <<
" E = " << showers[i]->energy()*1000 <<
" MeV " << endreq;
158 m_histo[12]->Fill(true_energy);
159 m_histo[13]->Fill(rec_energy);
163 log << MSG::INFO <<
"MDC Tracks ==============================================================" << endreq;
166 SmartDataPtr<RecMdcKalTrackCol> mdcKalTracks(eventSvc(),
"/Event/Recon/RecMdcKalTrackCol");
169 log << MSG::ERROR <<
" Unable to retrieve MdcKalTrackCol" << endreq;
170 return StatusCode::SUCCESS;
173 for( RecMdcKalTrackCol::iterator it = mdcKalTracks->begin(); it != mdcKalTracks->end(); it++ )
177 log << MSG::INFO <<
"Retrieved " << particles.size() <<
" McParticles for for MdcKalTrack # "
178 << (*it)->trackId() <<
" of reconstructed momentum " << (*it)->p() <<
" GeV/c (PID="
179 << (*it)->getPidType() <<
")" << endreq;
182 m_histo[6]->Fill((*it)->p());
185 m_histo[1]->Fill(particles.size());
188 for(
unsigned int i=0; i<particles.size(); i++)
190 int pdg_code = particles[i]->particleProperty();
193 double true_mom = particles[i]->initialFourMomentum().vect().mag();
196 int relevance = navigator->getMcParticleRelevance(*it, particles[i]);
199 log << MSG::INFO <<
"\t" << pdg_code <<
" momentum "
200 << true_mom <<
" relevance " << relevance << endreq;
205 log << MSG::INFO <<
"EMC Showers ==============================================================" << endreq;
206 SmartDataPtr<RecEmcShowerCol> emcShowers(eventSvc(),
"/Event/Recon/RecEmcShowerCol");
209 log << MSG::ERROR <<
" Unable to retrieve EmcRecShowerCol" << endreq;
210 return StatusCode::SUCCESS;
214 for( RecEmcShowerCol::iterator it = emcShowers->begin(); it != emcShowers->end(); it++ )
217 log << MSG::INFO <<
"Retrieved McParticles for EmcShower # " << ij++
218 <<
" Id " << (*it)->getShowerId().get_value()
219 <<
" Energy = " << (*it)->energy() << endreq;
221 for(
unsigned int i=0; i<particles.size(); i++)
223 int pdg_code = particles[i]->particleProperty();
226 double true_e = particles[i]->initialFourMomentum().e();
229 int relevance = navigator->getMcParticleRelevance(*it, particles[i]);
231 log <<
"\t Particle " << i <<
" PDG " << pdg_code <<
" E=" << true_e
232 <<
" Relevance " << relevance << endreq;
236 m_histo[7]->Fill(particles.size());
239 log << MSG::INFO <<
"=======================================================================" << endreq;
241 return StatusCode::SUCCESS;