Go to the documentation of this file.
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;
Log< level::Info, false > LogInfo
Log< level::Warning, false > LogWarning
std::vector< double > fIntegralPdf
void PrepareTable(const double *aProbFunc)
Log< level::Error, false > LogError
void UseFlatDistribution()
RandArrayFunction(const double *aProbFunc, int theProbSize, int interpolationType=0)
double MapRandom(double rand) const
void FireArray(int size, double *array) const