Skip to content

Commit b8cfbc7

Browse files
preghenellasawenzel
authored andcommitted
Temporary patch Pythia8 to force particle vertex to (0,0,0,0)
1 parent c4f7253 commit b8cfbc7

1 file changed

Lines changed: 29 additions & 1 deletion

File tree

Generators/src/GeneratorPythia8.cxx

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,9 @@ Bool_t GeneratorPythia8::Init()
6767
mPythia.setUserHooksPtr(hooks);
6868
}
6969

70+
/** inhibit hadron decays **/
71+
mPythia.readString("HadronLevel:Decay off");
72+
7073
/** initialise **/
7174
if (!mPythia.init()) {
7275
LOG(FATAL) << "Failed to init \'Pythia8\': init returned with error";
@@ -84,7 +87,32 @@ Bool_t
8487
{
8588
/** generate event **/
8689

87-
return mPythia.next();
90+
/** As we have inhibited all hadron decays before init,
91+
the event generation stops after hadronisation.
92+
We then pick all particles from here and force their
93+
production vertex to be (0,0,0,0).
94+
Afterwards we process the decays. **/
95+
96+
/** generate event **/
97+
if (!mPythia.next())
98+
return false;
99+
100+
/** force production vertices to (0,0,0,0) **/
101+
auto nParticles = mPythia.event.size();
102+
for (int iparticle = 0; iparticle < nParticles; iparticle++) {
103+
auto& aParticle = mPythia.event[iparticle];
104+
aParticle.xProd(0.);
105+
aParticle.yProd(0.);
106+
aParticle.zProd(0.);
107+
aParticle.tProd(0.);
108+
}
109+
110+
/** proceed with decays **/
111+
if (!mPythia.moreDecays())
112+
return false;
113+
114+
/** success **/
115+
return true;
88116
}
89117

90118
/*****************************************************************/

0 commit comments

Comments
 (0)