]>
Commit | Line | Data |
---|---|---|
da32329d AM |
1 | #include "pythiadecayer.h" |
2 | #include "reportingUtils.h" | |
3 | #include "starlightconfig.h" | |
4 | using namespace Pythia8; | |
5 | ||
6 | ||
7 | ||
8 | pythiaDecayer::pythiaDecayer() : | |
9 | _pythia(PYTHIA8_SETTINGS_DIR) | |
10 | {} | |
11 | /* | |
12 | pythiaDecayer::pythiaDecayer(const pythiaDecayer &obj) : | |
13 | _pythia(obj._pythia) | |
14 | {} | |
15 | */ | |
16 | pythiaDecayer::~pythiaDecayer() | |
17 | {} | |
18 | /* | |
19 | pythiaDecayer& pythiaDecayer::operator=(const pythiaDecayer &other) | |
20 | { | |
21 | if (this != &other) | |
22 | { | |
23 | _pythia = other._pythia; | |
24 | } | |
25 | return *this; | |
26 | } | |
27 | */ | |
28 | void pythiaDecayer::init() | |
29 | { | |
30 | _pythia.readString("ProcessLevel:all = off"); | |
31 | _pythia.readString("Standalone:allowResDec = on"); | |
32 | _pythia.readString("Next:numberShowEvent = 0"); | |
33 | _pythia.init(); | |
34 | _pythia.event.reset(); | |
35 | } | |
36 | ||
37 | void pythiaDecayer::addParticle(const starlightParticle &p) | |
38 | { | |
39 | ||
40 | Event &pyEvent = _pythia.event; | |
41 | int status = 23; // Outgoing particle from the hardest sub-process | |
42 | int col = 0; | |
43 | int acol = 0; | |
44 | int code = p.getPdgCode(); | |
45 | ||
46 | pyEvent.append(code, status, col, acol, p.GetPx(), p.GetPy(), p.GetPz(), p.GetE(), p.M()); | |
47 | ||
48 | } | |
49 | ||
50 | upcEvent pythiaDecayer::execute() | |
51 | { | |
52 | upcEvent slEvent; | |
53 | ||
54 | Event &pyEvent = _pythia.event; | |
55 | _pythia.forceTimeShower(1, 2, 100000.0); | |
56 | // pyEvent.list(); | |
57 | if(!_pythia.next()) | |
58 | { | |
59 | printWarn << "Pythia::next() failed" << std::endl; | |
60 | return upcEvent(); | |
61 | } | |
62 | ||
63 | for(int i = 0; i < pyEvent.size(); ++i) | |
64 | { | |
65 | ||
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); | |
71 | } | |
72 | pyEvent.clear(); | |
73 | pyEvent.reset(); | |
74 | return slEvent; | |
75 | ||
76 | } |