70 {
71 MsgStream log(
msgSvc(), name());
72
73
74 SmartDataPtr<EventNavigator> navigator (eventSvc(),"/Event/Navigator");
75 if( ! navigator )
76 {
77 log << MSG::ERROR << " Unable to retrieve EventNavigator" << endreq;
78 return StatusCode::FAILURE;
79 }
80
81 log << MSG::INFO << "EventNavigator object" << endreq;
82 navigator->Print();
83
84
85
86 log << MSG::INFO << "=======================================================================" << endreq;
87 log << MSG::INFO << "MC Particles ===============================================================" << endreq;
88
89
90 SmartDataPtr<McParticleCol> mcParticles(eventSvc(),"/Event/MC/McParticleCol");
91 if( ! mcParticles )
92 {
93 log << MSG::ERROR << " Unable to retrieve McParticleCol" << endreq;
94 return StatusCode::FAILURE;
95 }
96
97
98 for( McParticleCol::iterator it = mcParticles->begin(); it != mcParticles->end(); it++ )
99 {
100
101 int pdg_code = (*it)->particleProperty();
102
103
104 double true_mom = (*it)->initialFourMomentum().vect().mag();
105
106
107 m_histo[5]->Fill(true_mom);
108
109 log<<MSG::INFO<<"Retrieved McParticle # "<<(*it)->trackIndex()
110 << " PDG " << pdg_code << " of true momentum "
111 << true_mom <<" GeV/c " <<endreq;
112
113
116
117
118 m_histo[2]->Fill(tracks.size());
119
120 log << MSG::INFO << " Found " << tracks.size() << " tracks and " << ktracks.size() << " Kalman tracks" << endreq;
121
122
123 for(unsigned int i=0; i<ktracks.size(); i++)
124 {
125
127
128 log << MSG::INFO << "\t Track # " << i
129 << " id = " << ktracks[i]->trackId()
130 << " Pid " << ktracks[i]->getPidType()
131 <<
" Ptot " <<
momentum <<
" GeV/c" << endreq;
132
133
134 m_histo[0]->Fill(true_mom-
momentum);
135
136
137 m_histo2[0]->Fill(true_mom, fabs(true_mom-
momentum)/true_mom);
138 }
139
140
142
143 m_histo[8]->Fill(showers.size());
144
145 log << MSG::INFO << " Found " << showers.size() << " showers" << endreq;
146
147 for(unsigned int i=0; i<showers.size(); i++)
148 {
149 double true_energy = (*it)->initialFourMomentum().e();
150 double rec_energy = showers[i]->energy()*1000;
151
152 log << MSG::INFO << "\t Shower # " << i
153 << " Id = " << showers[i]->getShowerId().get_value()
154 << " E = " << showers[i]->energy()*1000 << " MeV " << endreq;
155
156 m_histo[12]->Fill(true_energy);
157 m_histo[13]->Fill(rec_energy);
158 }
159 }
160
161 log << MSG::INFO << "MDC Tracks ==============================================================" << endreq;
162
163
164 SmartDataPtr<RecMdcKalTrackCol> mdcKalTracks(eventSvc(),"/Event/Recon/RecMdcKalTrackCol");
165 if( ! mdcKalTracks )
166 {
167 log << MSG::ERROR << " Unable to retrieve MdcKalTrackCol" << endreq;
168 return StatusCode::SUCCESS;
169 }
170
171 for( RecMdcKalTrackCol::iterator it = mdcKalTracks->begin(); it != mdcKalTracks->end(); it++ )
172 {
174
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;
178
179
180 m_histo[6]->Fill((*it)->p());
181
182
183 m_histo[1]->Fill(particles.size());
184
185
186 for(unsigned int i=0; i<particles.size(); i++)
187 {
188 int pdg_code = particles[i]->particleProperty();
189
190
191 double true_mom = particles[i]->initialFourMomentum().vect().mag();
192
193
194 int relevance = navigator->getMcParticleRelevance(*it, particles[i]);
195
196
197 log << MSG::INFO << "\t" << pdg_code << " momentum "
198 << true_mom << " relevance " << relevance << endreq;
199 }
200 }
201
202
203 log << MSG::INFO << "EMC Showers ==============================================================" << endreq;
204 SmartDataPtr<RecEmcShowerCol> emcShowers(eventSvc(),"/Event/Recon/RecEmcShowerCol");
205 if( ! emcShowers )
206 {
207 log << MSG::ERROR << " Unable to retrieve EmcRecShowerCol" << endreq;
208 return StatusCode::SUCCESS;
209 }
210
211 int ij = 0;
212 for( RecEmcShowerCol::iterator it = emcShowers->begin(); it != emcShowers->end(); it++ )
213 {
215 log << MSG::INFO << "Retrieved McParticles for EmcShower # " << ij++
216 << " Id " << (*it)->getShowerId().get_value()
217 << " Energy = " << (*it)->energy() << endreq;
218
219 for(unsigned int i=0; i<particles.size(); i++)
220 {
221 int pdg_code = particles[i]->particleProperty();
222
223
224 double true_e = particles[i]->initialFourMomentum().e();
225
226
227 int relevance = navigator->getMcParticleRelevance(*it, particles[i]);
228
229 log << "\t Particle " << i << " PDG " << pdg_code << " E=" << true_e
230 << " Relevance " << relevance << endreq;
231 }
232
233
234 m_histo[7]->Fill(particles.size());
235 }
236
237 log << MSG::INFO << "=======================================================================" << endreq;
238
239 return StatusCode::SUCCESS;
240}
**********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