#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 |
Default destructor.
Definition at line 40 of file BaseNumericalRandomGenerator.h.
References generate(), generateExp(), generateLin(), initialize(), setSubInterval(), and x.
|
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 RandomEngineAndDistribution::flatShoot(), mps_fire::i, createfilelist::int, alignCSCRings::r, rmin, alignCSCRings::s, and sampling.
Referenced by GammaNumericalGenerator::gamma(), LandauFluctuationGenerator::landau(), and ~BaseNumericalRandomGenerator().
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, JetChargeProducer_cfi::exp, f, RandomEngineAndDistribution::flatShoot(), mps_fire::i, createfilelist::int, cmsBatch::log, alignCSCRings::r, rmin, and sampling.
Referenced by GammaNumericalGenerator::gamma_exp(), and ~BaseNumericalRandomGenerator().
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, f, RandomEngineAndDistribution::flatShoot(), mps_fire::i, createfilelist::int, alignCSCRings::r, rmin, sampling, and mathSSE::sqrt().
Referenced by GammaNumericalGenerator::gamma_lin(), and ~BaseNumericalRandomGenerator().
void BaseNumericalRandomGenerator::initialize | ( | ) |
The initialization (numerical integarion, inversion)
Definition at line 16 of file BaseNumericalRandomGenerator.cc.
References a, allConversions_cfi::dz, f, objects.autophobj::float, mps_fire::i, iter, gen::k, m, n, alignCSCRings::r, rmin, sampling, xmax, xmin, y, and z.
Referenced by GammaNumericalGenerator::GammaNumericalGenerator(), HistogramGenerator::HistogramGenerator(), LandauFluctuationGenerator::LandauFluctuationGenerator(), and ~BaseNumericalRandomGenerator().
bool BaseNumericalRandomGenerator::setSubInterval | ( | double | x1, |
double | x2 | ||
) |
To shoot in a given interval.
Definition at line 129 of file BaseNumericalRandomGenerator.cc.
References rmin, sampling, tmp, and xmax.
Referenced by ~BaseNumericalRandomGenerator().
|
protected |
Definition at line 68 of file BaseNumericalRandomGenerator.h.
|
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().