Skip to content

Commit

Permalink
replicate standalone pythia8 behaviour for lhe energy-momentum treatment
Browse files Browse the repository at this point in the history
  • Loading branch information
bendavid committed Oct 14, 2014
1 parent e1c2b45 commit 3635b8b
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions GeneratorInterface/Pythia8Interface/plugins/LHAupLesHouches.cc
Expand Up @@ -65,6 +65,8 @@ bool LHAupLesHouches::setEvent(int inProcId, double mRecalculate)

const std::vector<float> &scales = event->scales();

bool doRecalculate = (mRecalculate > 0.);

unsigned int iscale = 0;
for(int i = 0; i < hepeup.NUP; i++) {
//retrieve scale corresponding to each particle
Expand All @@ -81,12 +83,25 @@ bool LHAupLesHouches::setEvent(int inProcId, double mRecalculate)
scalein = scales[iscale];
++iscale;
}

double energy = hepeup.PUP[i][3];
double mass = hepeup.PUP[i][4];

// Optionally recalculate mass from four-momentum.
if (doRecalculate && mass > mRecalculate) {
mass = sqrtpos( energy*energy - hepeup.PUP[i][0]*hepeup.PUP[i][0] - hepeup.PUP[i][1]*hepeup.PUP[i][1] - hepeup.PUP[i][2]*hepeup.PUP[i][2]);
}
// If not, recalculate energy from three-momentum and mass.
else {
energy = sqrt( hepeup.PUP[i][0]*hepeup.PUP[i][0] + hepeup.PUP[i][1]*hepeup.PUP[i][1] + hepeup.PUP[i][2]*hepeup.PUP[i][2] + mass*mass);
}

addParticle(hepeup.IDUP[i], hepeup.ISTUP[i],
hepeup.MOTHUP[i].first, hepeup.MOTHUP[i].second,
hepeup.ICOLUP[i].first, hepeup.ICOLUP[i].second,
hepeup.PUP[i][0], hepeup.PUP[i][1],
hepeup.PUP[i][2], hepeup.PUP[i][3],
hepeup.PUP[i][4], hepeup.VTIMUP[i],
hepeup.PUP[i][2], energy,
mass, hepeup.VTIMUP[i],
hepeup.SPINUP[i],scalein);
}

Expand Down

0 comments on commit 3635b8b

Please sign in to comment.