13 : fNBins(theProbSize), fInterpolationType(intType) {
22 edm::LogError(
"RandArrayFunction") <<
"RandArrayFunction constructed with no bins - will use flat distribution";
30 for (ptn = 0; ptn <
fNBins; ++ptn) {
31 double weight = aProbFunc[ptn];
35 edm::LogWarning(
"RandArrayFunction") <<
"RandArrayFunction constructed with negative-weight bin " << ptn
36 <<
" == " << weight <<
" -- will substitute 0 weight";
44 <<
"RandArrayFunction constructed with nothing in bins - will use flat distribution";
49 for (ptn = 0; ptn < fNBins + 1; ++ptn)
56 edm::LogInfo(
"RandArrayFunction") <<
"RandArrayFunction does not recognize fInterpolationType "
79 while (nAbove > nBelow + 1) {
80 middle = (nAbove + nBelow + 1) >> 1;
81 rand >=
fIntegralPdf[middle] ? nBelow = middle : nAbove = middle;
104 double binFraction = (rand - fIntegralPdf[nBelow]) / binMeasure;
std::vector< double > fIntegralPdf
Log< level::Error, false > LogError
void PrepareTable(const double *aProbFunc)
void FireArray(int size, double *array) const
Log< level::Info, false > LogInfo
void UseFlatDistribution()
RandArrayFunction(const double *aProbFunc, int theProbSize, int interpolationType=0)
Log< level::Warning, false > LogWarning
tuple size
Write out results.
double MapRandom(double rand) const