EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pythiadecayer.cpp
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file pythiadecayer.cpp
1 #include "pythiadecayer.h"
2 #include "reportingUtils.h"
3 #include "starlightconfig.h"
4 using namespace Pythia8;
5 
6 
7 
9  _pythia(PYTHIA8_SETTINGS_DIR)
10 {}
12 {}
14 {
15  _pythia.readString("ProcessLevel:all = off");
16 // _pythia.readString("Standalone:allowResDec = on");//Option removed from Pythia8 JB05192015
17  _pythia.readString("Next:numberShowEvent = 0");
18  _pythia.init();
19  _pythia.event.reset();
20 }
21 
23 {
24 
25  Event &pyEvent = _pythia.event;
26  int status = 23; // Outgoing particle from the hardest sub-process
27  int col = 0;
28  int acol = 0;
29  int code = p.getPdgCode();
30 
31  pyEvent.append(code, status, col, acol, p.GetPx(), p.GetPy(), p.GetPz(), p.GetE(), p.M());
32 
33 }
34 
36 {
37  eXEvent slEvent;
38 
39  Event &pyEvent = _pythia.event;
40  _pythia.forceTimeShower(1, 2, 100000.0);
41  if(!_pythia.next())
42  {
43  printWarn << "Pythia::next() failed" << std::endl;
44  return eXEvent();
45  }
46 
47  for(int i = 0; i < pyEvent.size(); ++i)
48  {
49 
50  Particle p = pyEvent[i];
51  starlightParticle slPart(p.px(), p.py(), p.pz(), p.e(), p.m(), p.idAbs()*(p.charge()<0?-1:1), p.charge(),
52  p.xProd(), p.yProd(), p.zProd(), p.tProd(),
53  p.mother1(), p.mother2(), p.daughter1(), p.daughter2(), p.status());
54  slEvent.addParticle(slPart);
55  }
56  pyEvent.clear();
57  pyEvent.reset();
58  return slEvent;
59 
60 }