13 : fNBins(theProbSize),
14 fInterpolationType(intType)
27 edm::LogError(
"RandArrayFunction") <<
"RandArrayFunction constructed with no bins - will use flat distribution";
35 for (ptn = 0; ptn <
fNBins; ++ptn ) {
36 double weight = aProbFunc[ptn];
40 edm::LogWarning(
"RandArrayFunction") <<
"RandArrayFunction constructed with negative-weight bin "<< ptn <<
" == " << weight <<
" -- will substitute 0 weight";
47 edm::LogWarning(
"RandArrayFunction") <<
"RandArrayFunction constructed with nothing in bins - will use flat distribution";
52 for (ptn = 0; ptn < fNBins + 1; ++ptn)
59 edm::LogInfo(
"RandArrayFunction") <<
"RandArrayFunction does not recognize fInterpolationType "<<
fInterpolationType <<
" Will use type 0 (continuous linear interpolation)";
81 while (nAbove > nBelow+1) {
82 middle = (nAbove + nBelow+1)>>1;
83 rand >=
fIntegralPdf[middle] ? nBelow = middle : nAbove = middle;
107 double binFraction = (rand - fIntegralPdf[nBelow]) / binMeasure;
std::vector< double > fIntegralPdf
void PrepareTable(const double *aProbFunc)
void FireArray(int size, double *array) const
void UseFlatDistribution()
RandArrayFunction(const double *aProbFunc, int theProbSize, int interpolationType=0)
double MapRandom(double rand) const