1 #include "pythiadecayer.h"
2 #include "reportingUtils.h"
3 #include "starlightconfig.h"
4 using namespace Pythia8;
8 pythiaDecayer::pythiaDecayer() :
9 _pythia(PYTHIA8_SETTINGS_DIR)
12 pythiaDecayer::pythiaDecayer(const pythiaDecayer &obj) :
16 pythiaDecayer::~pythiaDecayer()
19 pythiaDecayer& pythiaDecayer::operator=(const pythiaDecayer &other)
23 _pythia = other._pythia;
28 void pythiaDecayer::init()
30 _pythia.readString("ProcessLevel:all = off");
31 _pythia.readString("Standalone:allowResDec = on");
32 _pythia.readString("Next:numberShowEvent = 0");
34 _pythia.event.reset();
37 void pythiaDecayer::addParticle(const starlightParticle &p)
40 Event &pyEvent = _pythia.event;
41 int status = 23; // Outgoing particle from the hardest sub-process
44 int code = p.getPdgCode();
46 pyEvent.append(code, status, col, acol, p.GetPx(), p.GetPy(), p.GetPz(), p.GetE(), p.M());
50 upcEvent pythiaDecayer::execute()
54 Event &pyEvent = _pythia.event;
55 _pythia.forceTimeShower(1, 2, 100000.0);
59 printWarn << "Pythia::next() failed" << std::endl;
63 for(int i = 0; i < pyEvent.size(); ++i)
66 Particle p = pyEvent[i];
67 starlightParticle slPart(p.px(), p.py(), p.pz(), p.e(), p.mass(), p.idAbs()*(p.charge()<0?-1:1), p.charge(),
68 p.xProd(), p.yProd(), p.zProd(), p.tProd(),
69 p.mother1(), p.mother2(), p.daughter1(), p.daughter2(), p.status());
70 slEvent.addParticle(slPart);