CMS 3D CMS Logo

RandomEngineAndDistribution.h
Go to the documentation of this file.
1 #ifndef FastSimulation_Utilities_RandomEngineAndDistribution_H
2 #define FastSimulation_Utilities_RandomEngineAndDistribution_H
3 
4 #include "CLHEP/Random/RandFlat.h"
5 #include "CLHEP/Random/RandGaussQ.h"
6 #include "CLHEP/Random/RandPoissonQ.h"
7 #include "TRandom3.h"
8 
9 namespace CLHEP {
10  class HepRandomEngine;
11 }
12 
13 namespace edm {
14  class LuminosityBlockIndex;
15  class StreamID;
16 }
17 
19 
20  public:
21 
24 
26 
27  CLHEP::HepRandomEngine& theEngine() const { return *engine_; }
28 
29  inline double flatShoot(double xmin=0.0, double xmax=1.0) const {
30  return xmin + (xmax - xmin) * engine_->flat();
31  }
32 
33  inline double gaussShoot(double mean=0.0, double sigma=1.0) const {
34  return CLHEP::RandGauss::shoot(engine_, mean, sigma);
35  }
36 
37  inline unsigned int poissonShoot(double mean) const{
38  return CLHEP::RandPoissonQ::shoot(engine_, mean);
39  }
40 
41  private:
42 
43  CLHEP::HepRandomEngine* engine_;
44 };
45 #endif // FastSimulation_Utilities_RandomEngineAndDistribution_H
double flatShoot(double xmin=0.0, double xmax=1.0) const
CLHEP::HepRandomEngine & theEngine() const
HLT enums.
double gaussShoot(double mean=0.0, double sigma=1.0) const
unsigned int poissonShoot(double mean) const