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 
26 
28 {
29  public:
30 
35  double xmax=1.,
36  int n=1000,
37  int iter=6);
38 
41 
43  void initialize();
44 
46  double generate(RandomEngineAndDistribution const*) const;
47 
50  double generateExp(RandomEngineAndDistribution const*) const;
51 
54  double generateLin(RandomEngineAndDistribution const*) const;
55 
56  // The probability density function, to be implemented in the real class
57  virtual double function(double x)=0;
58 
60  bool setSubInterval(double x1,double x2);
61 
62  protected:
63 
64  std::vector<double> sampling;
65  std::vector<double> f;
66  double xmin, xmax;
67  int n, iter;
68  double rmin, deltar;
69 
70  private:
71 
72  int m;
73 
74 };
75 #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.