#include <SimpleHistogramGenerator.h>
Public Member Functions | |
int | binarySearch (const int &n, const std::vector< double > &array, const double &value) const |
double | generate () const |
The random generation. More... | |
SimpleHistogramGenerator (TH1 *histo, const RandomEngine *engine) | |
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... | |
const RandomEngine * | random |
TAxis * | theXaxis |
the axis More... | |
double | xMax |
double | xMin |
Definition at line 21 of file SimpleHistogramGenerator.h.
SimpleHistogramGenerator::SimpleHistogramGenerator | ( | TH1 * | histo, |
const RandomEngine * | engine | ||
) |
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 | ( | ) | const |
The random generation.
Definition at line 29 of file SimpleHistogramGenerator.cc.
References binarySearch(), binWidth, RandomEngine::flatShoot(), integral, nBins, random, x, and xMin.
|
private |
Definition at line 57 of file SimpleHistogramGenerator.h.
Referenced by generate().
|
private |
Integral.
Definition at line 60 of file SimpleHistogramGenerator.h.
Referenced by generate(), and SimpleHistogramGenerator().
|
private |
Pointer to the histogram.
Definition at line 45 of file SimpleHistogramGenerator.h.
|
private |
Number of bins.
Definition at line 51 of file SimpleHistogramGenerator.h.
Referenced by generate(), and SimpleHistogramGenerator().
|
private |
Number of entries.
Definition at line 63 of file SimpleHistogramGenerator.h.
Referenced by SimpleHistogramGenerator().
|
private |
Definition at line 42 of file SimpleHistogramGenerator.h.
Referenced by generate().
|
private |
the axis
Definition at line 48 of file SimpleHistogramGenerator.h.
|
private |
Definition at line 54 of file SimpleHistogramGenerator.h.
|
private |
Definition at line 54 of file SimpleHistogramGenerator.h.
Referenced by generate().