11 double ptmax = 100,
double ptmin = 0,
12 double ymax = 10,
double ymin = -10,
13 int ptbins = 1000,
int ybins = 50)
14 : ptmax_(ptmax),ptmin_(
ptmin),ymax_(ymax),ymin_(ymin), ptbins_(ptbins), ybins_(ybins)
17 std::string fDataFile = fip.
fullPath();
19 std::cout<<
" File from "<<fDataFile <<std::endl;
20 TFile
f(fDataFile.c_str(),
"READ");
21 TGraph* yfunc = (TGraph*)
f.Get(
"rapidity");
22 TGraph* ptfunc = (TGraph*)
f.Get(
"pt");
26 <<
"Rapidity distribution could not be found in file "<<fDataFile;
30 <<
"Pt distribution could not be found in file "<<fDataFile;
40 double aProbFunc1[100000];
41 double aProbFunc2[100000];
45 double yy = yfunc->Eval(xy);
49 for(
int ip = 0; ip <
ptbins_; ++ip){
51 double ypt = ptfunc->Eval(xpt);
55 fYGenerator =
new CLHEP::RandGeneral(fRandomEngine,aProbFunc1,ybins_);
56 fPtGenerator =
new CLHEP::RandGeneral(fRandomEngine,aProbFunc2,ptbins_);
78 while(y < ymin || y > ymax)
82 <<
"Random y requested but Random Number Generator for y not Initialized!";
93 while(pt < ptmin || pt > ptmax)
97 <<
"Random pt requested but Random Number Generator for pt not Initialized!";
CLHEP::RandGeneral * fYGenerator
CLHEP::RandGeneral * fPtGenerator
std::string fullPath() const