20 #include <gsl/gsl_randist.h>
21 #include <gsl/gsl_rng.h>
51 std::cout <<
"not setting eta bc etamin " << min <<
" > etamax: " << max << std::endl;
65 std::cout << __PRETTY_FUNCTION__ <<
" thetamin " << min <<
" > thetamax: " << max << std::endl;
68 if (min < 0 || max >
M_PI)
70 std::cout << __PRETTY_FUNCTION__ <<
" min or max outside range (range is 0 to pi) min: " << min <<
", max: " << max << std::endl;
84 std::cout << __PRETTY_FUNCTION__ <<
" phimin " << min <<
" > phimax: " << max << std::endl;
88 if (min < -M_PI || max >
M_PI)
90 std::cout << __PRETTY_FUNCTION__ <<
"min or max outside range (range is -pi to pi), min: " << min <<
", max: " << max << std::endl;
108 std::cout << __PRETTY_FUNCTION__ <<
" ptmin " << min <<
" > ptmax: " << max << std::endl;
111 if (min < 0 || max < 0 || pt_gaus_width < 0)
113 std::cout << __PRETTY_FUNCTION__ <<
" values need to be >= 0, min: " << min
114 <<
", max: " << max <<
", pt_gaus_width: " << pt_gaus_width << std::endl;
131 std::cout << __PRETTY_FUNCTION__ <<
" pmin " << min <<
" > pmax: " << max << std::endl;
134 if (min < 0 || max < 0 || p_gaus_width < 0)
136 std::cout << __PRETTY_FUNCTION__ <<
" values need to be >= 0, min: " << min
137 <<
", max: " << max <<
", p_gaus_width: " << p_gaus_width << std::endl;
192 std::cout <<
PHWHERE <<
"::Error - unknown x vertex distribution function requested" << std::endl;
197 std::cout <<
PHWHERE <<
"::Error - unknown y vertex distribution function requested" << std::endl;
202 std::cout <<
PHWHERE <<
"::Error - unknown z vertex distribution function requested" << std::endl;
206 m_InEvent = findNode::getClass<PHG4InEvent>(topNode,
"PHG4INEVENT");
220 std::cout <<
"================ PHG4SimpleEventGenerator::InitRun() ======================" << std::endl;
221 std::cout <<
" Random seed = " <<
get_seed() << std::endl;
222 std::cout <<
" Particles:" << std::endl;
233 std::cout <<
" Vertex Distribution: Set to reuse a previously generated sim vertex" << std::endl;
238 std::cout <<
" Vertex Distribution Function (x,y,z) = ("
246 std::cout <<
" Vertex size function (r) = ("
249 std::cout <<
" Vertex size (mean) = (" <<
m_VertexSizeMean <<
")" << std::endl;
250 std::cout <<
" Vertex size (width) = (" <<
m_VertexSizeWidth <<
")" << std::endl;
268 std::cout <<
" p range = " <<
m_P_Min <<
" - " <<
m_P_Max << std::endl;
270 std::cout <<
" t0 = " <<
get_t0() << std::endl;
271 std::cout <<
"===========================================================================" << std::endl;
290 std::cout <<
"====================== PHG4SimpleEventGenerator::process_event() =====================" << std::endl;
291 std::cout <<
"PHG4SimpleEventGenerator::process_event - reuse_existing_vertex = " <<
get_reuse_existing_vertex() << std::endl;
320 for (
unsigned int j = 0; j < nparticles; ++j)
336 else if ((i == 0) && (j == 0))
355 std::cout <<
PHWHERE <<
"Error: neither eta range or theta range was specified" << std::endl;
356 std::cout <<
"That should not happen, please inform the software group howthis happened" << std::endl;
389 std::cout <<
PHWHERE <<
"Error: neither a p range or pt range was specified" << std::endl;
393 double px = pt * cos(phi);
394 double py = pt * sin(phi);
395 double pz = pt * sinh(eta);
397 double e = sqrt(px * px + py * py + pz * pz + m * m);
418 std::cout <<
"======================================================================================" << std::endl;
430 res = (position - width) + 2 * gsl_rng_uniform_pos(
RandomGenerator()) * width;
432 else if (dist ==
Gaus)
438 std::cout << __PRETTY_FUNCTION__ <<
" invalid distribution function " << dist