175 SmartDataPtr<Event::McParticleCol> mcParticleCol(m_evtSvc,
"/Event/MC/McParticleCol");
177 std::cout<<
"Could not retrieve McParticelCol"<<std::endl;
181 double px,py,pz,E,
mass;
183 Event::McParticleCol::iterator iter_mc = mcParticleCol->begin();
184 for (;iter_mc != mcParticleCol->end(); iter_mc++)
187 pdgcode = (*iter_mc)->particleProperty();
188 if((*iter_mc)->trackIndex()<0)
189 std::cout<<
"ERROR! trackIndex<0"<<std::endl;
190 px=(*iter_mc)->initialFourMomentum().x();
191 py=(*iter_mc)->initialFourMomentum().y();
192 pz=(*iter_mc)->initialFourMomentum().z();
193 E=(*iter_mc)->initialFourMomentum().t();
194 if(E*E-px*px-py*py-pz*pz>=0)
195 mass=sqrt(E*E-px*px-py*py-pz*pz);
199 if(m_particleRootFlag)
203 tupleParticle->write();
205 if(
abs(pdgcode)==2212||
abs(pdgcode)==211)
209 std::cout<<
"nflag!=4"<<std::endl;
238 SmartDataPtr<Event::MdcMcHitCol> aMcHitCol(m_evtSvc,
"/Event/MC/MdcMcHitCol");
240 std::cout<<
"Could not retrieve MDC McTruth collection"<<std::endl;
243 Event::MdcMcHitCol::iterator iMcHitCol;
244 for(iMcHitCol=aMcHitCol->begin(); iMcHitCol!=aMcHitCol->end(); iMcHitCol++)
246 const Identifier ident = (*iMcHitCol)->identify();
259 truthMdcIndex = (*iMcHitCol)->getTrackIndex();
262 truthMdcEdep = (*iMcHitCol)->getDepositEnergy();
263 truthMdcDriftD = (*iMcHitCol)->getDriftDistance();
264 truthMdcX = (*iMcHitCol)->getPositionX();
265 truthMdcY = (*iMcHitCol)->getPositionY();
266 truthMdcZ = (*iMcHitCol)->getPositionZ();
275 SmartDataPtr<MdcDigiCol> aDigiCol(m_evtSvc,
"/Event/Digi/MdcDigiCol");
277 std::cout<<
"Could not retrieve MDC digi collection"<<std::endl;
281 MdcDigiCol::iterator iDigiCol;
282 for(iDigiCol=aDigiCol->begin(); iDigiCol!=aDigiCol->end(); iDigiCol++)
284 const Identifier ident = (*iDigiCol)->identify();
293 m_charge = (*iDigiCol)->getChargeChannel()/1.0e6;
294 m_time = (*iDigiCol)->getTimeChannel()/1.0e5;
321 int partId,layer,scinNb,end;
323 partId = layer = scinNb = end = -9;
329 SmartDataPtr<Event::TofMcHitCol> aMcHitCol(m_evtSvc,
"/Event/MC/TofMcHitCol");
331 std::cout<<
"Could not retrieve TOF McTruth collection"<<std::endl;
334 Event::TofMcHitCol::iterator iMcHitCol;
335 for(iMcHitCol=aMcHitCol->begin(); iMcHitCol!=aMcHitCol->end(); iMcHitCol++)
337 const Identifier ident = (*iMcHitCol)->identify();
353 truthIndex = (*iMcHitCol)->getTrackIndex();
357 truthX = (*iMcHitCol)->getPositionX();
358 truthY = (*iMcHitCol)->getPositionY();
359 truthZ = (*iMcHitCol)->getPositionZ();
366 SmartDataPtr<TofDigiCol> aDigiCol(m_evtSvc,
"/Event/Digi/TofDigiCol");
368 std::cout<<
"Could not retrieve TOF digi collection"<<std::endl;
371 TofDigiCol::iterator iDigiCol;
372 for(iDigiCol=aDigiCol->begin(); iDigiCol!=aDigiCol->end(); iDigiCol++)
374 const Identifier ident = (*iDigiCol)->identify();
388 charge = (*iDigiCol)->getChargeChannel()/1.0e6;
389 time = (*iDigiCol)->getTimeChannel()/1.0e6;
392 if(truthPartId==partId && truthLayer==layer && truthScinNb==scinNb)
394 if(end==0) {qright = charge; tright=
time;}
395 else {qleft = charge; tleft =
time;}
399 std::cout<<
"digi doesn't match"<<std::endl;
404 if(tleft>0&&tright>0&&qleft>0&&qright>0)
407 std::cout<<
"no digi match MCtruth"<<std::endl;
417 SmartDataPtr<Event::EmcMcHitCol> aMcHitCol(m_evtSvc,
"/Event/MC/EmcMcHitCol");
419 std::cout<<
"Could not retrieve EMC McTruth collection"<<std::endl;
422 Event::EmcMcHitCol::iterator iMcHitCol;
423 for(iMcHitCol=aMcHitCol->begin(); iMcHitCol!=aMcHitCol->end(); iMcHitCol++)
425 const Identifier ident = (*iMcHitCol)->identify();
443 SmartDataPtr<EmcDigiCol> aDigiCol(m_evtSvc,
"/Event/Digi/EmcDigiCol");
445 std::cout<<
"Could not retrieve EMC digi collection"<<std::endl;
449 EmcDigiCol::iterator iDigiCol;
450 for(iDigiCol=aDigiCol->begin(); iDigiCol!=aDigiCol->end(); iDigiCol++)
452 const Identifier ident = (*iDigiCol)->identify();
466 SmartDataPtr<Event::MucMcHitCol> aMcHitCol(m_evtSvc,
"/Event/MC/MucMcHitCol");
468 std::cout<<
"Could not retrieve MUC McTruth collection"<<std::endl;
471 Event::MucMcHitCol::iterator iMcHitCol;
472 for(iMcHitCol=aMcHitCol->begin(); iMcHitCol!=aMcHitCol->end(); iMcHitCol++)
474 const Identifier ident = (*iMcHitCol)->identify();
492 SmartDataPtr<MucDigiCol> aDigiCol(m_evtSvc,
"/Event/Digi/MucDigiCol");
494 std::cout<<
"Could not retrieve MUC digi collection"<<std::endl;
498 MucDigiCol::iterator iDigiCol;
499 for(iDigiCol=aDigiCol->begin(); iDigiCol!=aDigiCol->end(); iDigiCol++)
501 const Identifier ident = (*iDigiCol)->identify();