#include "Tauola/TauolaHepMC3Event.h" #include "Tauola/Log.h" namespace Tauolapp { using namespace std; TauolaHepMC3Event::TauolaHepMC3Event(GenEvent * event){ m_event=event; /* NO UNITS YET // Default units m_momentum_unit = "GEV"; m_length_unit = "MM"; if(m_event->momentum_unit() != Units::GEV) m_momentum_unit = "MEV"; if(m_event->length_unit() != Units::MM ) m_length_unit = "CM"; // If needed - change units used by HepMC to GEV and MM if( m_event->momentum_unit() != Units::GEV || m_event->length_unit() != Units::MM ) { m_event->use_units(Units::GEV,Units::MM); } */ } TauolaHepMC3Event::~TauolaHepMC3Event(){ while(m_tau_list.size()!=0){ TauolaParticle * temp = m_tau_list.back(); m_tau_list.pop_back(); delete temp; } } GenEvent * TauolaHepMC3Event::getEvent(){ return m_event; } std::vector TauolaHepMC3Event::findParticles(int pdg_id){ if(m_tau_list.size()==0){ //loop over all particle in the event looking for taus (or other) for( unsigned int i=0; iparticles().size(); ++i) { if(abs((m_event->particles()[i])->pid())==pdg_id) m_tau_list.push_back(new TauolaHepMC3Particle(m_event->particles()[i])); } } return m_tau_list; } std::vector TauolaHepMC3Event::findStableParticles(int pdg_id){ /** GenEvent::particle_const_iterator part_itr = m_event->particles_begin(); //loop over all particle in the event looking for taus (or other) for( ; part_itr!=m_event->particles_end(); part_itr++){ if(fabs((*part_itr)->pdg_id())==pdg_id){ if((*part_itr)->end_vertex()){ cout << "WARNING: Particle with pdg code " << (*part_itr)->pdg_id() << " has end vertex" < tau_list = findParticles(pdg_id); std::vector stable_tau_list; for(int i=0; i<(int) tau_list.size(); i++){ if(!tau_list.at(i)->hasDaughters()) stable_tau_list.push_back(tau_list.at(i)); else { std::vector t = tau_list.at(i)->getDaughters(); //Ignore taus that we won't be decaying anyway if(t.size()==1) continue; if(t.size()==2 && (abs(t[0]->getPdgID())==15 || abs(t[1]->getPdgID())==15) ) continue; Log::Warning()<<"Particle with pdg code "<getPdgID() <<" already has daughters" <use_units(momentum,length); */ } } // namespace Tauolapp