#include <SimpleHistogramGenerator.h>
Public Member Functions | |
int | binarySearch (const int &n, const std::vector< float > &array, const double &value) const |
double | generate (RandomEngineAndDistribution const *) const |
The random generation. More... | |
SimpleHistogramGenerator (TH1 *histo) | |
virtual | ~SimpleHistogramGenerator () |
Default destructor. More... | |
Private Attributes | |
double | binWidth |
std::vector< float > | integral |
Integral. More... | |
int | nBins |
Pointer to the histogram. More... | |
double | nEntries |
Number of entries. More... | |
double | xMax |
double | xMin |
Definition at line 21 of file SimpleHistogramGenerator.h.
SimpleHistogramGenerator::SimpleHistogramGenerator | ( | TH1 * | histo | ) |
Constructor that perform the necessary integration and inversion steps xmin and xmax are the generation bounds, n is the internal table size and iter is the number of iterations for the numerical part.
Definition at line 8 of file SimpleHistogramGenerator.cc.
References mps_fire::i, integral, nBins, and nEntries.
|
inlinevirtual |
Default destructor.
Definition at line 31 of file SimpleHistogramGenerator.h.
References mps_check::array, binarySearch(), generate(), and gen::n.
int SimpleHistogramGenerator::binarySearch | ( | const int & | n, |
const std::vector< float > & | array, | ||
const double & | value | ||
) | const |
Definition at line 44 of file SimpleHistogramGenerator.cc.
Referenced by generate(), and ~SimpleHistogramGenerator().
double SimpleHistogramGenerator::generate | ( | RandomEngineAndDistribution const * | random | ) | const |
The random generation.
Definition at line 29 of file SimpleHistogramGenerator.cc.
References binarySearch(), binWidth, RandomEngineAndDistribution::flatShoot(), integral, nBins, diffTwoXMLs::r1, x, and xMin.
Referenced by PixelTemplateSmearerBase::smearHit(), PixelTemplateSmearerBase::smearMergeGroup(), and ~SimpleHistogramGenerator().
|
private |
Definition at line 55 of file SimpleHistogramGenerator.h.
Referenced by generate().
|
private |
Integral.
Definition at line 58 of file SimpleHistogramGenerator.h.
Referenced by generate(), and SimpleHistogramGenerator().
|
private |
Pointer to the histogram.
the axis Number of bins
Definition at line 49 of file SimpleHistogramGenerator.h.
Referenced by generate(), and SimpleHistogramGenerator().
|
private |
Number of entries.
Definition at line 61 of file SimpleHistogramGenerator.h.
Referenced by SimpleHistogramGenerator().
|
private |
Definition at line 52 of file SimpleHistogramGenerator.h.
|
private |
Definition at line 52 of file SimpleHistogramGenerator.h.
Referenced by generate().