177 SmartDataPtr<Event::McParticleCol> mcParticleCol(m_evtSvc,
"/Event/MC/McParticleCol");
179 std::cout<<
"Could not retrieve McParticelCol"<<std::endl;
183 double px,py,pz,E,
mass;
185 Event::McParticleCol::iterator iter_mc = mcParticleCol->begin();
186 for (;iter_mc != mcParticleCol->end(); iter_mc++)
189 pdgcode = (*iter_mc)->particleProperty();
190 if((*iter_mc)->trackIndex()<0)
191 std::cout<<
"ERROR! trackIndex<0"<<std::endl;
192 px=(*iter_mc)->initialFourMomentum().x();
193 py=(*iter_mc)->initialFourMomentum().y();
194 pz=(*iter_mc)->initialFourMomentum().z();
195 E=(*iter_mc)->initialFourMomentum().t();
196 if(E*E-px*px-py*py-pz*pz>=0)
197 mass=sqrt(E*E-px*px-py*py-pz*pz);
201 if(m_particleRootFlag)
205 tupleParticle->write();
207 if(
abs(pdgcode)==2212||
abs(pdgcode)==211)
211 std::cout<<
"nflag!=4"<<std::endl;
240 SmartDataPtr<Event::MdcMcHitCol> aMcHitCol(m_evtSvc,
"/Event/MC/MdcMcHitCol");
242 std::cout<<
"Could not retrieve MDC McTruth collection"<<std::endl;
245 Event::MdcMcHitCol::iterator iMcHitCol;
246 for(iMcHitCol=aMcHitCol->begin(); iMcHitCol!=aMcHitCol->end(); iMcHitCol++)
248 const Identifier ident = (*iMcHitCol)->identify();
261 truthMdcIndex = (*iMcHitCol)->getTrackIndex();
264 truthMdcEdep = (*iMcHitCol)->getDepositEnergy();
265 truthMdcDriftD = (*iMcHitCol)->getDriftDistance();
266 truthMdcX = (*iMcHitCol)->getPositionX();
267 truthMdcY = (*iMcHitCol)->getPositionY();
268 truthMdcZ = (*iMcHitCol)->getPositionZ();
277 SmartDataPtr<MdcDigiCol> aDigiCol(m_evtSvc,
"/Event/Digi/MdcDigiCol");
279 std::cout<<
"Could not retrieve MDC digi collection"<<std::endl;
283 MdcDigiCol::iterator iDigiCol;
284 for(iDigiCol=aDigiCol->begin(); iDigiCol!=aDigiCol->end(); iDigiCol++)
286 const Identifier ident = (*iDigiCol)->identify();
289 std::cout<<
" charge: "<<(*iDigiCol)->getChargeChannel();
290 std::cout<<
" time: "<<(*iDigiCol)->getTimeChannel()<<std::endl;
295 m_charge = (*iDigiCol)->getChargeChannel()/1.0e6;
296 m_time = (*iDigiCol)->getTimeChannel()/1.0e5;
323 int partId,layer,scinNb,end;
325 partId = layer = scinNb = end = -9;
331 SmartDataPtr<Event::TofMcHitCol> aMcHitCol(m_evtSvc,
"/Event/MC/TofMcHitCol");
333 std::cout<<
"Could not retrieve TOF McTruth collection"<<std::endl;
336 Event::TofMcHitCol::iterator iMcHitCol;
337 for(iMcHitCol=aMcHitCol->begin(); iMcHitCol!=aMcHitCol->end(); iMcHitCol++)
339 const Identifier ident = (*iMcHitCol)->identify();
355 truthIndex = (*iMcHitCol)->getTrackIndex();
359 truthX = (*iMcHitCol)->getPositionX();
360 truthY = (*iMcHitCol)->getPositionY();
361 truthZ = (*iMcHitCol)->getPositionZ();
368 SmartDataPtr<TofDigiCol> aDigiCol(m_evtSvc,
"/Event/Digi/TofDigiCol");
370 std::cout<<
"Could not retrieve TOF digi collection"<<std::endl;
373 TofDigiCol::iterator iDigiCol;
374 for(iDigiCol=aDigiCol->begin(); iDigiCol!=aDigiCol->end(); iDigiCol++)
376 const Identifier ident = (*iDigiCol)->identify();
390 charge = (*iDigiCol)->getChargeChannel()/1.0e6;
391 time = (*iDigiCol)->getTimeChannel()/1.0e6;
394 if(truthPartId==partId && truthLayer==layer && truthScinNb==scinNb)
401 std::cout<<
"digi doesn't match"<<std::endl;
406 if(tleft>0&&tright>0&&qleft>0&&qright>0)
409 std::cout<<
"no digi match MCtruth"<<std::endl;
419 SmartDataPtr<Event::EmcMcHitCol> aMcHitCol(m_evtSvc,
"/Event/MC/EmcMcHitCol");
421 std::cout<<
"Could not retrieve EMC McTruth collection"<<std::endl;
424 Event::EmcMcHitCol::iterator iMcHitCol;
425 for(iMcHitCol=aMcHitCol->begin(); iMcHitCol!=aMcHitCol->end(); iMcHitCol++)
427 const Identifier ident = (*iMcHitCol)->identify();
445 SmartDataPtr<EmcDigiCol> aDigiCol(m_evtSvc,
"/Event/Digi/EmcDigiCol");
447 std::cout<<
"Could not retrieve EMC digi collection"<<std::endl;
451 EmcDigiCol::iterator iDigiCol;
452 for(iDigiCol=aDigiCol->begin(); iDigiCol!=aDigiCol->end(); iDigiCol++)
454 const Identifier ident = (*iDigiCol)->identify();
468 SmartDataPtr<Event::MucMcHitCol> aMcHitCol(m_evtSvc,
"/Event/MC/MucMcHitCol");
470 std::cout<<
"Could not retrieve MUC McTruth collection"<<std::endl;
473 Event::MucMcHitCol::iterator iMcHitCol;
474 for(iMcHitCol=aMcHitCol->begin(); iMcHitCol!=aMcHitCol->end(); iMcHitCol++)
476 const Identifier ident = (*iMcHitCol)->identify();
494 SmartDataPtr<MucDigiCol> aDigiCol(m_evtSvc,
"/Event/Digi/MucDigiCol");
496 std::cout<<
"Could not retrieve MUC digi collection"<<std::endl;
500 MucDigiCol::iterator iDigiCol;
501 for(iDigiCol=aDigiCol->begin(); iDigiCol!=aDigiCol->end(); iDigiCol++)
503 const Identifier ident = (*iDigiCol)->identify();