CMS 3D CMS Logo

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 public:
24 
27 
29  double landau(RandomEngineAndDistribution const* random) const { return generate(random); }
30 
32  double function(double x) override { return ersatzt(x); }
33 
34 private:
36  double ersatzt(double x) { return std::exp(-0.5 * (x + std::exp(-x))) / std::sqrt(2. * M_PI); }
37 };
38 #endif
double generate(RandomEngineAndDistribution const *) const
The random generation according to function()
~LandauFluctuationGenerator() override
Default destructor.
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:19
#define M_PI
double landau(RandomEngineAndDistribution const *random) const
Random generator of the dE/dX spread (Landau function)
LandauFluctuationGenerator()
Constructor : initialization of the Random Generator.