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
double generate(RandomEngineAndDistribution const *) const
The random generation according to function()
double generateLin(RandomEngineAndDistribution const *) const
BaseNumericalRandomGenerator(double xmin=0., double xmax=1., int n=1000, int iter=6)
void initialize()
The initialization (numerical integarion, inversion)
double generateExp(RandomEngineAndDistribution const *) const
virtual ~BaseNumericalRandomGenerator()
Default destructor.
bool setSubInterval(double x1, double x2)
To shoot in a given interval.