1 #include "TauolaHEPEVTEvent.h"
10 for(
unsigned int i=0;i<particle_list.size();i++)
delete particle_list[i];
20 particle_list.push_back(p);
25 if( i<0 || i>=(
int)particle_list.size() )
return NULL;
26 return particle_list[i];
31 return particle_list.size();
37 std::vector<TauolaParticle*> list;
41 for(
unsigned int i=0; i<particle_list.size(); i++)
43 if( abs(particle_list[i]->getPdgID() ) == pdg_id)
44 list.push_back(particle_list[i]);
53 std::vector<TauolaParticle*> tau_list =
findParticles(pdg_id);
54 std::vector<TauolaParticle*> stable_tau_list;
56 for(
int i=0; i<(int) tau_list.size(); i++){
58 if(!tau_list.at(i)->hasDaughters())
59 stable_tau_list.push_back(tau_list[i]);
62 std::vector<TauolaParticle*> t = tau_list[i]->getDaughters();
64 if(t.size()==1)
continue;
65 if(t.size()==2 && (abs(t[0]->getPdgID())==15 || abs(t[1]->getPdgID())==15) )
continue;
66 Log::Warning()<<
"Particle with pdg code "<<tau_list.at(i)->getPdgID()
67 <<
" already has daughters" <<endl;
71 return stable_tau_list;
77 printf(
"TauolaHEPEVTEvent\n-----------------\n");
78 for(
unsigned int i=0;i<particle_list.size();i++) particle_list[i]->
print();
83 for(
unsigned int i=0;i<particle_list.size();i++)
delete particle_list[i];
84 particle_list.clear();
87 #ifdef USE_HEPEVT_INTERFACE
93 for(
int i=0; i<hepevt_.nhep; i++)
104 hepevt_.jmohep[i][0]-1,
105 hepevt_.jmohep[i][1]-1,
106 hepevt_.jdahep[i][0]-1,
107 hepevt_.jdahep[i][1]-1
113 void TauolaHEPEVTEvent::write_event_to_HEPEVT(TauolaHEPEVTEvent *evt)
115 if(evt==NULL)
return;
117 hepevt_.nhep = evt->getParticleCount();
119 for(
int i=0; i<hepevt_.nhep; i++)
123 hepevt_.idhep [i] =p->getPdgID();
124 hepevt_.isthep[i] =p->getStatus();
125 hepevt_.phep [i][0]=p->getPx();
126 hepevt_.phep [i][1]=p->getPy();
127 hepevt_.phep [i][2]=p->getPz();
128 hepevt_.phep [i][3]=p->getE();
129 hepevt_.phep [i][4]=p->getMass();
130 hepevt_.jmohep[i][0]=p->getFirstMotherIndex() +1;
131 hepevt_.jmohep[i][1]=p->getSecondMotherIndex() +1;
132 hepevt_.jdahep[i][0]=p->getDaughterRangeStart()+1;
133 hepevt_.jdahep[i][1]=p->getDaughterRangeEnd() +1;
134 hepevt_.vhep [i][0]=0.0;
135 hepevt_.vhep [i][1]=0.0;
136 hepevt_.vhep [i][2]=0.0;
137 hepevt_.vhep [i][3]=0.0;
void setBarcode(int barcode)
std::vector< TauolaParticle * > findParticles(int pdgID)
void addParticle(TauolaHEPEVTParticle *p)
TauolaHEPEVTParticle * getParticle(int i)
void setEvent(TauolaHEPEVTEvent *event)
Single particle of HEPEVT event record.
std::vector< TauolaParticle * > findStableParticles(int pdgID)