7 #include <Pythia8/Pythia.h>
8 #include "Pythia8Plugins/HepMC2.h"
14 pythia_->settings.flag(
"ProcessLevel:all",
false);
15 pythia_->settings.flag(
"PartonLevel:FSRinResonances",
false);
16 pythia_->settings.flag(
"ProcessLevel:resonanceDecays",
false);
23 while (pdt.nextId(pid) > pid) {
24 pid = pdt.nextId(pid);
25 pdt.mayDecay(pid,
false);
30 std::vector<std::unique_ptr<fastsim::Particle> >& secondaries,
31 CLHEP::HepRandomEngine& engine)
const {
36 int pid = particle.
pdgId();
44 pythia_->event.reset();
47 Pythia8::Particle pythiaParticle(pid,
62 pythia_->event.append(pythiaParticle);
64 int nentries_before = pythia_->event.size();
66 pythia_->particleData.mayDecay(pid,
true);
70 pythia_->particleData.mayDecay(pid,
false);
71 int nentries_after = pythia_->event.size();
73 if (nentries_after <= nentries_before)
77 for (
int ipart = nentries_before; ipart < nentries_after; ipart++) {
78 Pythia8::Particle& daughter = pythia_->event[ipart];
87 secondaries.back()->setMotherDeltaR(particle.
momentum());
90 secondaries.back()->setMotherSimTrackIndex(particle.
simTrackIndex());