9 #include "CLHEP/Random/RandGeneral.h" 17 double ptmax = 100,
double ptmin = 0,
19 int ptbins = 1000,
int ybins = 50)
20 : ptmax_(ptmax),ptmin_(
ptmin),ymax_(
ymax),ymin_(
ymin), ptbins_(ptbins), ybins_(ybins)
25 std::cout<<
" File from "<<fDataFile <<std::endl;
26 TFile
f(fDataFile.c_str(),
"READ");
27 TGraph* yfunc = (TGraph*)
f.Get(
"rapidity");
28 TGraph* ptfunc = (TGraph*)
f.Get(
"pt");
32 <<
"Rapidity distribution could not be found in file "<<fDataFile;
36 <<
"Pt distribution could not be found in file "<<fDataFile;
46 double aProbFunc1[100000];
47 double aProbFunc2[100000];
51 double yy = yfunc->Eval(xy);
55 for(
int ip = 0; ip <
ptbins_; ++ip){
57 double ypt = ptfunc->Eval(xpt);
61 fYGenerator =
new CLHEP::RandGeneral(
nullptr,aProbFunc1,ybins_);
62 fPtGenerator =
new CLHEP::RandGeneral(
nullptr,aProbFunc2,ptbins_);
84 while(y < ymin || y > ymax)
88 <<
"Random y requested but Random Number Generator for y not Initialized!";
99 while(pt < ptmin || pt > ptmax)
103 <<
"Random pt requested but Random Number Generator for pt not Initialized!";
double firePt(CLHEP::HepRandomEngine *)
double fireY(CLHEP::HepRandomEngine *)
CLHEP::RandGeneral * fYGenerator
CLHEP::RandGeneral * fPtGenerator
std::string fullPath() const