8 #include <CLHEP/Random/RandomEngine.h>
9 #include <CLHEP/Random/JamesRandom.h>
31 CLHEP::HepRandomEngine *rnd,
54 cmin_in = -TMath::Cos(thetamin_in);
55 cmax_in = -TMath::Cos(thetamax_in);
70 if (pmin_in < pmin_min || pmin_in >
pmin_max) {
71 std::cout <<
" >>> CMSCGEN.initialize <<< warning: illegal pmin_in =" << pmin_in;
73 }
else if (pmax_in >
pmax) {
74 std::cout <<
" >>> CMSCGEN.initialize <<< warning: illegal pmax_in =" << pmax_in;
84 if (cmax_in < cmax_min || cmax_in >
cmax_max) {
85 std::cout <<
" >>> CMSCGEN.initialize <<< warning: illegal cmax_in =" <<
cmax_in;
153 double integral_here, integral_ref;
158 for (
int k = 1;
k <= 100;
k++) {
174 c_cut = -0.42 +
L * 0.35;
180 b0 * (c_cut -
c1) +
b1 / 2. * (c_cut * c_cut -
c1 *
c1) +
b2 / 3. * (c_cut * c_cut * c_cut -
c1 *
c1 *
c1);
185 integral_here =
b0 * (c_cut -
cmin) +
b1 / 2. * (c_cut * c_cut -
cmin *
cmin) +
188 corr[
k] = integral_here / integral_ref;
210 std::cout <<
" >>> CMSCGEN.initialize <<< "
211 <<
" Integrated flux = " <<
integrated_flux <<
" /m**2/s " << std::endl;
218 ce = (((((((
pe[8] * 2. +
pe[7]) * 2. +
pe[6]) * 2. +
pe[5]) * 2. +
pe[4]) * 2. +
pe[3]) * 2. +
pe[2]) * 2. +
pe[1]) *
226 for (
int k = 0;
k < 9;
k++) {
242 CLHEP::HepRandomEngine *rnd =
new CLHEP::HepJamesRandom;
244 rnd->setSeed(RanSeed, 0);
251 std::cout <<
" >>> CMSCGEN <<< warning: not initialized" << std::endl;
270 double xe,
e, ce,
L,
L2;
285 if ((1. /
sqrt(xe) < 3) &&
300 if (
r2 < (
e *
e *
e * ce / (
cemax * 3. * 3. * 3.)))
303 }
else if ((1. /
sqrt(xe) < 3) &&
318 if (
r2 < (
e *
e *
e *
e * ce / (
cemax * 3. * 3. * 3. * 3.)))
392 c_max = -0.5 *
b1 /
b2;
399 z_max =
b0 +
b1 * c_max +
b2 * c_max * c_max;
402 double c_cut = -0.42 +
L * 0.35;
426 std::cout <<
" >>> CMSCGEN <<< warning: not initialized" << std::endl;
436 std::cout <<
" >>> CMSCGEN <<< warning: not initialized" << std::endl;
445 std::cout <<
" >>> CMSCGEN <<< warning: not initialized" << std::endl;
459 CLHEP::HepRandomEngine *rnd) {
476 cmin = TMath::Cos(thetamin_in);
477 cmax = TMath::Cos(thetamax_in);
478 enumin = (Enumin_in < 10.) ? 10. : Enumin_in;
487 for (
int i = 0;
i < trials; ++
i) {
507 std::cout <<
"CMSCGEN::initializeNuMu: After " << trials <<
" trials:" << std::endl;
518 std::cout <<
" >>> CMSCGEN.initializeNuMu <<< "
519 <<
" Integrated flux = " <<
integrated_flux <<
" units??? " << std::endl;
536 CLHEP::HepRandomEngine *rnd =
new CLHEP::HepJamesRandom;
538 rnd->setSeed(RanSeed, 0);
541 pmin_in, pmax_in, thetamin_in, thetamax_in, Enumin_in, Enumax_in, Phimin_in, Phimax_in, ProdAlt_in, rnd);
545 double cthetaNu = 1. + ctheta;
547 double costhetas =
cos(thetas);
549 0.0286 *
pow(Enu, -2.7) *
550 (1. / (1. + (6. * Enu * costhetas) / 115.) + 0.213 / (1. + (1.44 * Enu * costhetas) / 850.));
552 (Enu - Emu +
AR / 3 * (Enu * Enu * Enu - Emu * Emu * Emu) / (Enu * Enu));
558 std::cout <<
" >>> CMSCGEN <<< warning: not initialized" << std::endl;