#include <SimpleHistogramGenerator.h>
Public Member Functions | |
int | binarySearch (const int &n, const std::vector< double > &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< double > | integral |
Integral. More... | |
TH1 * | myHisto |
Pointer to the histogram. More... | |
int | nBins |
Number of bins. More... | |
double | nEntries |
Number of entries. More... | |
TAxis * | theXaxis |
the axis 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 i, integral, nBins, and nEntries.
|
inlinevirtual |
int SimpleHistogramGenerator::binarySearch | ( | const int & | n, |
const std::vector< double > & | array, | ||
const double & | value | ||
) | const |
double SimpleHistogramGenerator::generate | ( | RandomEngineAndDistribution const * | random | ) | const |
The random generation.
Definition at line 28 of file SimpleHistogramGenerator.cc.
References binarySearch(), binWidth, RandomEngineAndDistribution::flatShoot(), integral, nBins, diffTwoXMLs::r1, x, and xMin.
|
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.
Definition at line 43 of file SimpleHistogramGenerator.h.
|
private |
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 |
the axis
Definition at line 46 of file SimpleHistogramGenerator.h.
|
private |
Definition at line 52 of file SimpleHistogramGenerator.h.
|
private |
Definition at line 52 of file SimpleHistogramGenerator.h.
Referenced by generate().