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 } // namespace edm
17 
19 public:
22 
24 
25  CLHEP::HepRandomEngine& theEngine() const { return *engine_; }
26 
27  inline double flatShoot(double xmin = 0.0, double xmax = 1.0) const { return xmin + (xmax - xmin) * engine_->flat(); }
28 
29  inline double gaussShoot(double mean = 0.0, double sigma = 1.0) const {
30  return CLHEP::RandGauss::shoot(engine_, mean, sigma);
31  }
32 
33  inline unsigned int poissonShoot(double mean) const { return CLHEP::RandPoissonQ::shoot(engine_, mean); }
34 
35 private:
36  CLHEP::HepRandomEngine* engine_;
37 };
38 #endif // FastSimulation_Utilities_RandomEngineAndDistribution_H
RandomEngineAndDistribution(edm::StreamID const &)
CLHEP::HepRandomEngine & theEngine() const
double gaussShoot(double mean=0.0, double sigma=1.0) const
unsigned int poissonShoot(double mean) const
HLT enums.
double flatShoot(double xmin=0.0, double xmax=1.0) const