#include <BaseNumericalRandomGenerator.h>
Public Member Functions | |
BaseNumericalRandomGenerator (double xmin=0., double xmax=1., int n=1000, int iter=6) | |
virtual double | function (double x)=0 |
double | generate (RandomEngineAndDistribution const *) const |
The random generation according to function() More... | |
double | generateExp (RandomEngineAndDistribution const *) const |
double | generateLin (RandomEngineAndDistribution const *) const |
void | initialize () |
The initialization (numerical integarion, inversion) More... | |
bool | setSubInterval (double x1, double x2) |
To shoot in a given interval. More... | |
virtual | ~BaseNumericalRandomGenerator () |
Default destructor. More... | |
Protected Attributes | |
double | deltar |
std::vector< double > | f |
int | iter |
int | n |
double | rmin |
std::vector< double > | sampling |
double | xmax |
double | xmin |
Private Attributes | |
int | m |
Definition at line 27 of file BaseNumericalRandomGenerator.h.
BaseNumericalRandomGenerator::BaseNumericalRandomGenerator | ( | double | xmin = 0. , |
double | xmax = 1. , |
||
int | n = 1000 , |
||
int | iter = 6 |
||
) |
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 7 of file BaseNumericalRandomGenerator.cc.
|
inlinevirtual |
|
pure virtual |
Implemented in HistogramGenerator, GammaNumericalGenerator, and LandauFluctuationGenerator.
double BaseNumericalRandomGenerator::generate | ( | RandomEngineAndDistribution const * | random | ) | const |
The random generation according to function()
Definition at line 82 of file BaseNumericalRandomGenerator.cc.
References deltar, RandomEngineAndDistribution::flatShoot(), i, alignCSCRings::r, rmin, alignCSCRings::s, and sampling.
Referenced by GammaNumericalGenerator::gamma(), and LandauFluctuationGenerator::landau().
double BaseNumericalRandomGenerator::generateExp | ( | RandomEngineAndDistribution const * | random | ) | const |
The random generation according to function(), refined to generate as an exponential in each of the intervals
Definition at line 93 of file BaseNumericalRandomGenerator.cc.
References a, b, deltar, create_public_lumi_plots::exp, f, RandomEngineAndDistribution::flatShoot(), i, create_public_lumi_plots::log, alignCSCRings::r, rmin, and sampling.
Referenced by GammaNumericalGenerator::gamma_exp().
double BaseNumericalRandomGenerator::generateLin | ( | RandomEngineAndDistribution const * | random | ) | const |
The random generation according to function(), refined to generate as a linear function in each of the intervals
Definition at line 111 of file BaseNumericalRandomGenerator.cc.
References a, b, deltar, f, RandomEngineAndDistribution::flatShoot(), i, alignCSCRings::r, rmin, sampling, and mathSSE::sqrt().
Referenced by GammaNumericalGenerator::gamma_lin().
void BaseNumericalRandomGenerator::initialize | ( | ) |
The initialization (numerical integarion, inversion)
Definition at line 16 of file BaseNumericalRandomGenerator.cc.
References a, deltar, f, i, iter, relval_steps::k, m, n, alignCSCRings::r, rmin, sampling, xmax, xmin, detailsBasic3DVector::y, and detailsBasic3DVector::z.
Referenced by GammaNumericalGenerator::GammaNumericalGenerator(), HistogramGenerator::HistogramGenerator(), and LandauFluctuationGenerator::LandauFluctuationGenerator().
bool BaseNumericalRandomGenerator::setSubInterval | ( | double | x1, |
double | x2 | ||
) |
To shoot in a given interval.
Definition at line 129 of file BaseNumericalRandomGenerator.cc.
References deltar, rmin, sampling, tmp, and xmax.
|
protected |
Definition at line 68 of file BaseNumericalRandomGenerator.h.
Referenced by generate(), generateExp(), generateLin(), initialize(), and setSubInterval().
|
protected |
Definition at line 65 of file BaseNumericalRandomGenerator.h.
Referenced by BaseNumericalRandomGenerator(), Vispa.Views.RootCanvasView.RootCanvasView::createGraph(), Vispa.Views.RootCanvasView.RootCanvasView::createLegoPlot(), generateExp(), generateLin(), and initialize().
|
protected |
Definition at line 67 of file BaseNumericalRandomGenerator.h.
Referenced by initialize().
|
private |
Definition at line 72 of file BaseNumericalRandomGenerator.h.
Referenced by initialize().
|
protected |
Definition at line 67 of file BaseNumericalRandomGenerator.h.
Referenced by initialize().
|
protected |
Definition at line 68 of file BaseNumericalRandomGenerator.h.
Referenced by generate(), generateExp(), generateLin(), initialize(), and setSubInterval().
|
protected |
Definition at line 64 of file BaseNumericalRandomGenerator.h.
Referenced by BaseNumericalRandomGenerator(), generate(), generateExp(), generateLin(), initialize(), and setSubInterval().
|
protected |
Definition at line 66 of file BaseNumericalRandomGenerator.h.
Referenced by svgfig.XAxis::__repr__(), HistogramGenerator::HistogramGenerator(), initialize(), and setSubInterval().
|
protected |
Definition at line 66 of file BaseNumericalRandomGenerator.h.
Referenced by svgfig.XAxis::__repr__(), svgfig.Axes::__repr__(), svgfig.HGrid::__repr__(), svgfig.Grid::__repr__(), HistogramGenerator::HistogramGenerator(), initialize(), and svgfig.Axes::SVG().