Skip to content

Commit 38b4032

Browse files
committed
trial2
1 parent 2eb7ce8 commit 38b4032

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

MC/config/PWGLF/pythia8/generator_pythia8_LF_rapidity.C

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "Generators/GeneratorPythia8Param.h"
2626
#include "Generators/DecayerPythia8Param.h"
2727
#endif
28+
#include "Generators/GeneratorPythia8.h"
2829
#include <nlohmann/json.hpp>
2930
#include "generator_pythia8_longlived.C"
3031

@@ -275,9 +276,9 @@ class GeneratorPythia8LFRapidity : public o2::eventgen::GeneratorPythia8
275276
const double phi = gRandom->Uniform(0, TMath::TwoPi());
276277
const double px{pt * std::cos(phi)};
277278
const double py{pt * std::sin(phi)};
278-
// Convert rapidity to pz using the relation: pz = pt * sinh(rapidity)
279-
const double pz{pt * std::sinh(rapidity)};
280-
const double et{std::hypot(std::hypot(pt, pz), cfg.mMass)};
279+
const double mT = std::sqrt(cfg.mMass * cfg.mMass + pt * pt);
280+
const double pz{mT * std::sinh(rapidity)};
281+
const double et{mT * std::cosh(rapidity)};
281282

282283
// TParticle::TParticle(Int_t pdg,
283284
// Int_t status,

0 commit comments

Comments
 (0)