Decay particle using pythia.
40 int pid = particle.pdgId();
50 Pythia8::Particle pythiaParticle( pid , 93, 0, 0, 0, 0, 0, 0,
51 particle.momentum().
X(),
52 particle.momentum().
Y(),
53 particle.momentum().
Z(),
54 particle.momentum().
E(),
55 particle.momentum().M() );
56 pythiaParticle.vProd(particle.position().
X(), particle.position().
Y(), particle.position().
Z(), particle.position().
T());
57 pythia_->event.append(pythiaParticle);
60 int nentries_before =
pythia_->event.size();
62 pythia_->particleData.mayDecay(pid,
true);
66 pythia_->particleData.mayDecay(pid,
false);
67 int nentries_after =
pythia_->event.size();
69 if(nentries_after <= nentries_before)
return;
72 for(
int ipart=nentries_before; ipart<nentries_after; ipart++)
74 Pythia8::Particle& daughter =
pythia_->event[ipart];
81 if(particle.charge() != 0 &&
std::abs(particle.charge()-daughter.charge()) < 1E-10){
82 secondaries.back()->setMotherDeltaR(particle.momentum());
83 secondaries.back()->setMotherPdgId(particle.getMotherDeltaR() == -1 ? particle.pdgId() : particle.getMotherPdgId());
84 secondaries.back()->setMotherSimTrackIndex(particle.simTrackIndex());
std::unique_ptr< gen::P8RndmEngine > pythiaRandomEngine_
Instance of pythia Random Engine.
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Abs< T >::type abs(const T &t)
bool isExotic(bool fixLongLivedBug, int pdgid_)
Definition of a generic FastSim Particle which can be propagated through the detector (formerly Parti...
std::unique_ptr< Pythia8::Pythia > pythia_
Instance of pythia.