1 #include "TauolaHepMCEvent.h"
13 m_momentum_unit =
"GEV";
16 if(m_event->momentum_unit() != HepMC::Units::GEV) m_momentum_unit =
"MEV";
17 if(m_event->length_unit() != HepMC::Units::MM ) m_length_unit =
"CM";
20 if( m_event->momentum_unit() != HepMC::Units::GEV ||
21 m_event->length_unit() != HepMC::Units::MM )
23 m_event->
use_units(HepMC::Units::GEV,HepMC::Units::MM);
27 TauolaHepMCEvent::~TauolaHepMCEvent(){
29 while(m_tau_list.size()!=0){
31 m_tau_list.pop_back();
41 std::vector<TauolaParticle*> TauolaHepMCEvent::findParticles(
int pdg_id){
43 if(m_tau_list.size()==0){
47 for( ; part_itr!=m_event->particles_end(); part_itr++){
48 if(abs((*part_itr)->pdg_id())==pdg_id)
55 std::vector<TauolaParticle*> TauolaHepMCEvent::findStableParticles(
int pdg_id){
70 std::vector<TauolaParticle*> tau_list = findParticles(pdg_id);
71 std::vector<TauolaParticle*> stable_tau_list;
73 for(
int i=0; i<(int) tau_list.size(); i++){
75 if(!tau_list.at(i)->hasDaughters())
76 stable_tau_list.push_back(tau_list.at(i));
79 std::vector<TauolaParticle*> t = tau_list.at(i)->getDaughters();
81 if(t.size()==1)
continue;
82 if(t.size()==2 && (abs(t[0]->getPdgID())==15 || abs(t[1]->getPdgID())==15) )
continue;
83 Log::Warning()<<
"Particle with pdg code "<<tau_list.at(i)->getPdgID()
84 <<
" already has daughters" <<endl;
88 return stable_tau_list;
92 void TauolaHepMCEvent::eventEndgame(){
95 string momentum(
"GEV"),length(
"MM");
97 switch(Tauola::momentumUnit)
106 momentum = m_momentum_unit;
109 switch(Tauola::lengthUnit)
118 length = m_length_unit;
121 m_event->use_units(momentum,length);
The GenEvent class is the core of HepMC.
void use_units(Units::MomentumUnit, Units::LengthUnit)