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