CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
BaseNumericalRandomGenerator.h
Go to the documentation of this file.
1 #ifndef BaseNumericalRandomGenerator_H
2 #define BaseNumericalRandomGenerator_H
3 
23 #include <vector>
24 
25 class RandomEngine;
26 
28 {
29  public:
30 
35  double xmin=0.,
36  double xmax=1.,
37  int n=1000,
38  int iter=6);
39 
42 
44  void initialize();
45 
47  double generate() const;
48 
51  double generateExp() const;
52 
55  double generateLin() const;
56 
57  // The probability density function, to be implemented in the real class
58  virtual double function(double x)=0;
59 
61  bool setSubInterval(double x1,double x2);
62 
63  protected:
64 
66 
67  std::vector<double> sampling;
68  std::vector<double> f;
69  double xmin, xmax;
70  int n, iter;
71  double rmin, deltar;
72 
73  private:
74 
75  int m;
76 
77 };
78 #endif
void initialize()
The initialization (numerical integarion, inversion)
double generate() const
The random generation according to function()
BaseNumericalRandomGenerator(const RandomEngine *engine, double xmin=0., double xmax=1., int n=1000, int iter=6)
virtual ~BaseNumericalRandomGenerator()
Default destructor.
Definition: DDAxes.h:10
bool setSubInterval(double x1, double x2)
To shoot in a given interval.