#include "utl/RandomSamplerFromCDF.h"
Public Member Functions | |
engine | flatArray (size, rand) |
double | GetInverseCDF (const double y) const |
double | GetMaxX () const |
double | GetMinX () const |
RandomSamplerFromCDF (const std::vector< double > &x, const std::vector< double > &y) | |
Construct using a CDF defined by X and Y vectors. More... | |
RandomSamplerFromCDF (const TabulatedFunction &cdf) | |
Construct using a CDF defined by a Tabulated Function. More... | |
RandomSamplerFromCDF (const std::vector< double > &cdf) | |
Construct using a CDF defined by an std::vector<double>, the old CLHEP behaviour. More... | |
RandomSamplerFromCDF (const std::map< double, double > &cdf) | |
RandomSamplerFromCDF (const std::string &function, const std::string &independentVariableName, const double min, const double max, const int bins) | |
Construct the CDF from a function defined by a string. More... | |
RandomSamplerFromCDF (const std::string &function, const double min, const double max, const int bins) | |
double | shoot (HepEngine &engine) const |
Method to shoot random values using a given engine by-passing the static generator. More... | |
virtual | ~RandomSamplerFromCDF () |
Public Attributes | |
void | const |
Method to shoot random values using a given engine by-passing the static generator. More... | |
vect [i] = MapRandom(rand[i]) | |
Protected Member Functions | |
const std::vector< double > & | GetCDFX () const |
const std::vector< double > & | GetCDFY () const |
virtual double | MapRandom (const double rand) const |
Private Member Functions | |
void | CheckAndNormalize () |
void | Dump () const |
int | GetIndex (const double y) const |
void | SetFunction (const std::string &function, const std::string &independentVariableName, const double min, const double max, const int bins) |
Private Attributes | |
std::vector< double > | fX |
std::vector< double > | fY |
Friends | |
class | RandomSamplerFromPDF |
Input requirements: CDF has to start with zero, does not have to be normalized.
Definition at line 28 of file RandomSamplerFromCDF.h.
|
inline |
Construct using a CDF defined by X and Y vectors.
Definition at line 32 of file RandomSamplerFromCDF.h.
References CheckAndNormalize().
RandomSamplerFromCDF::RandomSamplerFromCDF | ( | const TabulatedFunction & | cdf | ) |
Construct using a CDF defined by a Tabulated Function.
Definition at line 15 of file RandomSamplerFromCDF.cc.
References CheckAndNormalize().
RandomSamplerFromCDF::RandomSamplerFromCDF | ( | const std::vector< double > & | cdf | ) |
Construct using a CDF defined by an std::vector<double>, the old CLHEP behaviour.
Definition at line 23 of file RandomSamplerFromCDF.cc.
References CheckAndNormalize(), and fX.
utl::RandomSamplerFromCDF::RandomSamplerFromCDF | ( | const std::map< double, double > & | cdf | ) |
|
inline |
Construct the CDF from a function defined by a string.
Definition at line 44 of file RandomSamplerFromCDF.h.
References SetFunction().
|
inline |
Definition at line 49 of file RandomSamplerFromCDF.h.
References SetFunction().
|
inlinevirtual |
Definition at line 53 of file RandomSamplerFromCDF.h.
|
private |
Definition at line 83 of file RandomSamplerFromCDF.cc.
References Dump(), fX, and fY.
Referenced by RandomSamplerFromCDF(), and SetFunction().
|
private |
Definition at line 113 of file RandomSamplerFromCDF.cc.
Referenced by CheckAndNormalize().
|
inherited |
|
inlineprotected |
Definition at line 65 of file RandomSamplerFromCDF.h.
References fX.
|
inlineprotected |
Definition at line 67 of file RandomSamplerFromCDF.h.
References fY.
|
inlineprivate |
double RandomSamplerFromCDF::GetInverseCDF | ( | const double | y | ) | const |
Definition at line 47 of file RandomSamplerFromCDF.cc.
References fX, fY, and GetIndex().
Referenced by MapRandom(), TestRandomSamplerFromCDF::TestFunction(), and TestRandomSamplerFromCDF::TestTabulatedFunction().
|
inline |
Definition at line 59 of file RandomSamplerFromCDF.h.
References fX.
|
inline |
Definition at line 57 of file RandomSamplerFromCDF.h.
References fX.
|
inlineprotectedvirtual |
Implements utl::VRandomSampler.
Definition at line 62 of file RandomSamplerFromCDF.h.
References GetInverseCDF().
|
private |
Definition at line 64 of file RandomSamplerFromCDF.cc.
References CheckAndNormalize(), fX, and fY.
Referenced by RandomSamplerFromCDF().
|
inlineinherited |
Method to shoot random values using a given engine by-passing the static generator.
Definition at line 38 of file VRandomSampler.h.
References utl::VRandomSampler::MapRandom().
Referenced by ParticleInjectorNEU::ParticleInjector::GenerateAzimuth(), ParticleInjectorNEU::ParticleInjector::GenerateEnergy(), ParticleInjectorNEU::ParticleInjector::GeneratePosition(), ParticleInjectorNEU::ParticleInjector::GenerateZenith(), utl::MuonTimeModel::GetFirstAndMeanTime(), utl::MuonTimeModel::GetFirstTime(), utl::MuonTimeModel::GetLastTime(), utl::MuonTimeModel::GetMeanTime(), utl::MuonTimeModel::GetTimes(), ShowerPhotonGeneratorOG::ShowerPhotonGenerator::LateralDistributionScatteredCherenkov(), ShowerPhotonGeneratorOG::ShowerPhotonGenerator::Run(), TestRandomSamplerFromCDF::TestFunction(), TestRandomSamplerFromCDF::TestMap(), TestRandomSamplerFromCDF::TestTabulatedFunction(), TestRandomSamplerFromPDF::TestTabulatedFunction(), TestRandomSamplerFromCDF::TestVectorAndNormalization(), and TestRandomSamplerFromCDF::TestVectors().
|
friend |
Definition at line 84 of file RandomSamplerFromCDF.h.
|
inherited |
Method to shoot random values using a given engine by-passing the static generator.
Definition at line 45 of file VRandomSampler.h.
|
private |
Definition at line 81 of file RandomSamplerFromCDF.h.
Referenced by CheckAndNormalize(), Dump(), GetCDFX(), GetInverseCDF(), GetMaxX(), GetMinX(), RandomSamplerFromCDF(), and SetFunction().
|
private |
Definition at line 82 of file RandomSamplerFromCDF.h.
Referenced by CheckAndNormalize(), Dump(), GetCDFY(), GetIndex(), GetInverseCDF(), and SetFunction().
|
inherited |
Definition at line 49 of file VRandomSampler.h.