#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.
References f, n, and sampling.
|
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 75 of file BaseNumericalRandomGenerator.cc.
References RandomEngineAndDistribution::flatShoot(), mps_fire::i, createfilelist::int, 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 83 of file BaseNumericalRandomGenerator.cc.
References a, b, JetChargeProducer_cfi::exp, f, RandomEngineAndDistribution::flatShoot(), mps_fire::i, createfilelist::int, dqm-mbProfile::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 98 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().
void BaseNumericalRandomGenerator::initialize | ( | ) |
The initialization (numerical integarion, inversion)
Definition at line 13 of file BaseNumericalRandomGenerator.cc.
References a, PVValHelper::dz, f, dqmMemoryStats::float, mps_fire::i, iter, dqmdumpme::k, m, n, alignCSCRings::r, rmin, sampling, xmax, xmin, y, and 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 113 of file BaseNumericalRandomGenerator.cc.
References rmin, sampling, createJobs::tmp, testProducerWithPsetDescEmpty_cfi::x1, testProducerWithPsetDescEmpty_cfi::x2, and xmax.
|
protected |
Definition at line 62 of file BaseNumericalRandomGenerator.h.
|
protected |
Definition at line 59 of file BaseNumericalRandomGenerator.h.
Referenced by BaseNumericalRandomGenerator(), generateExp(), generateLin(), and initialize().
|
protected |
Definition at line 61 of file BaseNumericalRandomGenerator.h.
Referenced by initialize().
|
private |
Definition at line 65 of file BaseNumericalRandomGenerator.h.
Referenced by initialize().
|
protected |
Definition at line 61 of file BaseNumericalRandomGenerator.h.
Referenced by BaseNumericalRandomGenerator(), output.OutputBranch::fill(), and initialize().
|
protected |
Definition at line 62 of file BaseNumericalRandomGenerator.h.
Referenced by generate(), generateExp(), generateLin(), initialize(), and setSubInterval().
|
protected |
Definition at line 58 of file BaseNumericalRandomGenerator.h.
Referenced by BaseNumericalRandomGenerator(), generate(), generateExp(), generateLin(), initialize(), and setSubInterval().
|
protected |
Definition at line 60 of file BaseNumericalRandomGenerator.h.
Referenced by svgfig.XAxis::__repr__(), HistogramGenerator::HistogramGenerator(), initialize(), and setSubInterval().
|
protected |
Definition at line 60 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().