1 #ifndef _utl_RandomSamplerFromPDF_h_
2 #define _utl_RandomSamplerFromPDF_h_
8 #include <utl/VRandomSampler.h>
9 #include <utl/ShadowPtr.h>
14 class TabulatedFunction;
15 class RandomSamplerFromCDF;
67 {
Init(x, y, intType); }
76 {
Init(pdf, intType); }
83 const std::string& independentVariableName,
84 const double min,
const double max,
const int bins = 100)
85 {
SetFunction(
function, independentVariableName, min, max, bins); }
89 const double min,
const double max,
const int bins = 100)
102 const std::string& independentVariableName,
103 const double min,
const double max,
const int bins);
105 void Init(
const std::vector<double>& x,
const std::vector<double>& y,
108 void Init(
const std::vector<double>& y,
111 void InitDiscrete(
const std::vector<double>& x,
const std::vector<double>& y);
113 void InitStep(
const std::vector<double>& x,
const std::vector<double>& y);
115 void InitLinear(
const std::vector<double>& x,
const std::vector<double>& y);
pointer with built-in initialization, deletion, deep copying
RandomSamplerFromCDF * fCDF
RandomSamplerFromPDF(const std::string &function, const double min, const double max, const int bins=100)
Construct the PDF from a function defined by a string.
Class to hold collection (x,y) points and provide interpolation between them.
void InitDiscrete(const std::vector< double > &x, const std::vector< double > &y)
RandomSamplerFromPDF(const std::vector< double > &x, const std::vector< double > &y, const InterpolationType intType=eStep)
Construct using a PDF defined by an X and Y vectors.
double GetInverseCDF(const double y) const
void InitLinear(const std::vector< double > &x, const std::vector< double > &y)
void Init(const std::vector< double > &x, const std::vector< double > &y, const InterpolationType intType)
RandomSamplerFromPDF(const std::string &function, const std::string &independentVariableName, const double min, const double max, const int bins=100)
Construct the PDF from a function defined by a string.
RandomSamplerFromPDF(const std::vector< double > &pdf, const InterpolationType intType=eStep)
Construct using a PDF defined by an std::vector<double>, the old CLHEP behaviour. ...
void InitStep(const std::vector< double > &x, const std::vector< double > &y)
ShadowPtr< std::vector< double > > fPDF
virtual ~RandomSamplerFromPDF()
void SetFunction(const std::string &function, const std::string &independentVariableName, const double min, const double max, const int bins)
Class to shoot random numbers given by a user-defined distribution function.
virtual double MapRandom(const double rand) const