6 #include <Pythia8/Pythia.h>
7 #include "Pythia8Plugins/HepMC2.h"
13 pythia_->settings.flag(
"ProcessLevel:all",
false);
14 pythia_->settings.flag(
"PartonLevel:FSRinResonances",
false);
15 pythia_->settings.flag(
"ProcessLevel:resonanceDecays",
false);
22 while (pdt.nextId(pid) > pid) {
23 pid = pdt.nextId(pid);
24 pdt.mayDecay(pid,
false);
29 std::vector<std::unique_ptr<fastsim::Particle> >& secondaries,
30 CLHEP::HepRandomEngine& engine)
const {
35 int pid = particle.
pdgId();
36 pythia_->event.reset();
39 Pythia8::Particle pythiaParticle(pid,
54 pythia_->event.append(pythiaParticle);
56 int nentries_before = pythia_->event.size();
58 pythia_->particleData.mayDecay(pid,
true);
62 pythia_->particleData.mayDecay(pid,
false);
63 int nentries_after = pythia_->event.size();
65 if (nentries_after <= nentries_before)
69 for (
int ipart = nentries_before; ipart < nentries_after; ipart++) {
70 Pythia8::Particle& daughter = pythia_->event[ipart];
79 secondaries.back()->setMotherDeltaR(particle.
momentum());
82 secondaries.back()->setMotherSimTrackIndex(particle.
simTrackIndex());