12 #include "HepMC/GenEvent.h"
13 #include "HepMC/IO_HEPEVT.h"
14 #include "HepMC/HEPEVT_Wrapper.h"
29 for(
int i = 0;
i < *lenv;
i++)
53 : fIsInitialized(
false)
87 fPDGs.push_back( 15 ) ;
90 cout <<
"----------------------------------------------" << endl;
91 cout <<
"Initializing Tauola" << endl;
94 cout <<
"Tauola: Polarization disabled" << endl;
98 cout <<
"Tauola: Polarization enabled" << endl;
134 HepMC::IO_HEPEVT
conv;
157 int numPartBeforeTauola = HepMC::HEPEVT_Wrapper::number_entries();
164 int numPartAfterTauola = HepMC::HEPEVT_Wrapper::number_entries();
175 bool foundTau =
false;
176 for (
int ip=1; ip<=numPartAfterTauola; ip++ )
178 if (
std::abs( HepMC::HEPEVT_Wrapper::id( ip ) ) == 15
191 return conv.read_next_event();
194 std::vector<int> PrntIndx;
196 for (
int ip=numPartAfterTauola; ip>numPartBeforeTauola; ip-- )
202 int Prnt = HepMC::HEPEVT_Wrapper::first_parent(ip);
203 ip -= (HepMC::HEPEVT_Wrapper::number_children(Prnt)-1);
204 PrntIndx.push_back( Prnt );
205 while (
abs( HepMC::HEPEVT_Wrapper::id(Prnt) ) != 15 )
207 int Prnt1 = HepMC::HEPEVT_Wrapper::first_parent( Prnt );
210 PrntIndx.insert( PrntIndx.begin(), Prnt );
211 ip -= HepMC::HEPEVT_Wrapper::number_children(Prnt);
213 for (
size_t iprt=0; iprt<PrntIndx.size(); iprt++ )
215 int Indx = PrntIndx[iprt];
216 int PartID = HepMC::HEPEVT_Wrapper::id( Indx );
225 double lifetime = PData->lifetime().value();
230 double ct = -lifetime *
std::log(prob);
232 double ee = HepMC::HEPEVT_Wrapper::e( Indx );
233 double px = HepMC::HEPEVT_Wrapper::px( Indx );
234 double py = HepMC::HEPEVT_Wrapper::py( Indx );
235 double pz = HepMC::HEPEVT_Wrapper::pz( Indx );
243 VxDec += ct * (px/mass);
245 VyDec += ct * (py/mass);
247 VzDec += ct * (pz/mass);
249 VtDec += ct * (ee/mass);
250 for (
int idau=HepMC::HEPEVT_Wrapper::first_child( Indx );
251 idau<=HepMC::HEPEVT_Wrapper::last_child( Indx ); idau++ )
253 HepMC::HEPEVT_Wrapper::set_position( idau, VxDec, VyDec, VzDec, VtDec );
258 return conv.read_next_event();
T getParameter(std::string const &) const
HepMC::GenEvent * decay(HepMC::GenEvent *)
static HepMC::IO_HEPEVT conv
TauolaInterface(const edm::ParameterSet &)
void getData(T &iHolder) const
void tauola_srs_(int *, int *)
edm::ESHandle< HepPDT::ParticleDataTable > fPDGTable
void ranmar_(float *, int *)
void rmarin_(int *, int *, int *)
HepPDT::ParticleData ParticleData
Log< T >::type log(const T &t)
Pythia6Service * fPy6Service
void init(const edm::EventSetup &)
CLHEP::HepRandomEngine * decayRandomEngine