19 #include "Pythia8/Pythia.h"
21 using namespace Jetscape;
38 JSDEBUG <<
"Initialize PGun Brick (Test) ...";
42 JSDEBUG << s <<
" to be initialized ...";
53 VERBOSE(2) <<
"Run Hard Process : " <<
GetId() <<
" ...";
57 double pT, rapidity,
phi, pseudorapidity;
60 const double maxN = 1.0 * RAND_MAX;
61 const double PI = 3.1415926;
63 double ppx, ppy, ppz, pp0,
mass;
81 phi = 2.0 * PI * (rand() /
maxN);
87 p[3] = sqrt(pT * pT + mass * mass) * sinh(rapidity);
88 p[0] = sqrt(pT * pT + mass * mass) * cosh(rapidity);
90 double p_abs = std::sqrt(pT*pT + p[3]*p[3]);
92 pseudorapidity = 0.5 * std::log((p_abs + p[3]) / (p_abs - p[3]));
94 JSWARN <<
"Particle in PGun has infinite pseudorapidity.";
99 for (
int i = 0;
i <= 3;
i++) {
105 <<
"No initial state module, setting the starting location to 0. ";
108 ini->SampleABinaryCollisionPoint(x, y);
116 auto ptn = make_shared<Parton>(0,
parID, 0,
pT, pseudorapidity,
phi, p[0], xLoc);
117 ptn->set_color((parID > 0) ? 100 : 0);
118 ptn->set_anti_color(((parID > 0) || (parID == 21)) ? 0 : 101);
119 ptn->set_max_color(102);