6 #include <Pythia8/Pythia.h> 7 #include "Pythia8Plugins/HepMC2.h" 16 pythia_->settings.flag(
"ProcessLevel:all",
false);
17 pythia_->settings.flag(
"PartonLevel:FSRinResonances",
false);
18 pythia_->settings.flag(
"ProcessLevel:resonanceDecays",
false);
25 while(pdt.nextId(pid) >
pid)
27 pid = pdt.nextId(pid);
28 pdt.mayDecay(pid,
false);
43 Pythia8::Particle pythiaParticle( pid , 93, 0, 0, 0, 0, 0, 0,
50 pythia_->event.append(pythiaParticle);
52 int nentries_before =
pythia_->event.size();
54 pythia_->particleData.mayDecay(pid,
true);
58 pythia_->particleData.mayDecay(pid,
false);
59 int nentries_after =
pythia_->event.size();
61 if(nentries_after <= nentries_before)
return;
64 for(
int ipart=nentries_before; ipart<nentries_after; ipart++)
66 Pythia8::Particle& daughter =
pythia_->event[ipart];
74 secondaries.back()->setMotherDeltaR(particle.
momentum());
76 secondaries.back()->setMotherSimTrackIndex(particle.
simTrackIndex());
std::unique_ptr< gen::P8RndmEngine > pythiaRandomEngine_
Instance of pythia Random Engine.
const math::XYZTLorentzVector & position() const
Return position of the particle.
int getMotherPdgId() const
Get pdgIdto mother particle (only makes sense if mother and daughter charged).
int pdgId() const
Return pdgId of the particle.
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
~Decayer()
Default destructor.
Abs< T >::type abs(const T &t)
HepPDT::ParticleData ParticleData
void decay(const Particle &particle, std::vector< std::unique_ptr< Particle > > &secondaries, CLHEP::HepRandomEngine &engine) const
Decay particle using pythia.
int simTrackIndex() const
Return index of the SimTrack.
double getMotherDeltaR() const
Get delta R to mother particle (only makes sense if mother and daughter charged). ...
double charge() const
Return charge of the particle.
Decayer()
Default Constructor.
const math::XYZTLorentzVector & momentum() const
Return momentum of the particle.
Definition of a generic FastSim Particle which can be propagated through the detector (formerly Parti...
std::unique_ptr< Pythia8::Pythia > pythia_
Instance of pythia.