CMS 3D CMS Logo

BaseNumericalRandomGenerator.h
Go to the documentation of this file.
1 #ifndef BaseNumericalRandomGenerator_H
2 #define BaseNumericalRandomGenerator_H
3 
23 #include <vector>
24 
26 
28 public:
32  BaseNumericalRandomGenerator(double xmin = 0., double xmax = 1., int n = 1000, int iter = 6);
33 
36 
38  void initialize();
39 
41  double generate(RandomEngineAndDistribution const*) const;
42 
45  double generateExp(RandomEngineAndDistribution const*) const;
46 
49  double generateLin(RandomEngineAndDistribution const*) const;
50 
51  // The probability density function, to be implemented in the real class
52  virtual double function(double x) = 0;
53 
55  bool setSubInterval(double x1, double x2);
56 
57 protected:
58  std::vector<double> sampling;
59  std::vector<double> f;
60  double xmin, xmax;
61  int n, iter;
62  double rmin, deltar;
63 
64 private:
65  int m;
66 };
67 #endif
BaseNumericalRandomGenerator::setSubInterval
bool setSubInterval(double x1, double x2)
To shoot in a given interval.
Definition: BaseNumericalRandomGenerator.cc:113
BaseNumericalRandomGenerator::f
std::vector< double > f
Definition: BaseNumericalRandomGenerator.h:59
BaseNumericalRandomGenerator::generateExp
double generateExp(RandomEngineAndDistribution const *) const
Definition: BaseNumericalRandomGenerator.cc:83
testProducerWithPsetDescEmpty_cfi.x2
x2
Definition: testProducerWithPsetDescEmpty_cfi.py:28
BaseNumericalRandomGenerator::generateLin
double generateLin(RandomEngineAndDistribution const *) const
Definition: BaseNumericalRandomGenerator.cc:98
DDAxes::x
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
BaseNumericalRandomGenerator::initialize
void initialize()
The initialization (numerical integarion, inversion)
Definition: BaseNumericalRandomGenerator.cc:13
BaseNumericalRandomGenerator::generate
double generate(RandomEngineAndDistribution const *) const
The random generation according to function()
Definition: BaseNumericalRandomGenerator.cc:75
BaseNumericalRandomGenerator::~BaseNumericalRandomGenerator
virtual ~BaseNumericalRandomGenerator()
Default destructor.
Definition: BaseNumericalRandomGenerator.h:35
BaseNumericalRandomGenerator::xmin
double xmin
Definition: BaseNumericalRandomGenerator.h:60
BaseNumericalRandomGenerator::rmin
double rmin
Definition: BaseNumericalRandomGenerator.h:62
BaseNumericalRandomGenerator::n
int n
Definition: BaseNumericalRandomGenerator.h:61
BaseNumericalRandomGenerator::sampling
std::vector< double > sampling
Definition: BaseNumericalRandomGenerator.h:58
BaseNumericalRandomGenerator::iter
int iter
Definition: BaseNumericalRandomGenerator.h:61
BaseNumericalRandomGenerator::xmax
double xmax
Definition: BaseNumericalRandomGenerator.h:60
BaseNumericalRandomGenerator::m
int m
Definition: BaseNumericalRandomGenerator.h:65
BaseNumericalRandomGenerator::BaseNumericalRandomGenerator
BaseNumericalRandomGenerator(double xmin=0., double xmax=1., int n=1000, int iter=6)
Definition: BaseNumericalRandomGenerator.cc:7
BaseNumericalRandomGenerator
Definition: BaseNumericalRandomGenerator.h:27
BaseNumericalRandomGenerator::deltar
double deltar
Definition: BaseNumericalRandomGenerator.h:62
RandomEngineAndDistribution
Definition: RandomEngineAndDistribution.h:18