test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
LandauFluctuationGenerator.h
Go to the documentation of this file.
1 #ifndef FastSimulation_Utilities_LandauFluctuationGenerator_H
2 #define FastSimulation_Utilities_LandauFluctuationGenerator_H
3 
5 
6 #include <cmath>
7 
19 
21 {
22  public:
23 
27  initialize();
28  }
29 
32 
34  double landau(RandomEngineAndDistribution const* random) const { return generate(random); }
35 
37  virtual double function(double x) { return ersatzt(x); }
38 
39  private:
40 
42  double ersatzt(double x) {
43  return std::exp(-0.5 * ( x + std::exp(-x) )) / std::sqrt (2. *M_PI);
44  }
45 };
46 #endif
double generate(RandomEngineAndDistribution const *) const
The random generation according to function()
TRandom random
Definition: MVATrainer.cc:138
void initialize()
The initialization (numerical integarion, inversion)
double ersatzt(double x)
Ersatzt for Landau Fluctuations (very good approximation)
T sqrt(T t)
Definition: SSEVec.h:18
#define M_PI
double landau(RandomEngineAndDistribution const *random) const
Random generator of the dE/dX spread (Landau function)
virtual ~LandauFluctuationGenerator()
Default destructor.
LandauFluctuationGenerator()
Constructor : initialization of the Random Generator.