CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/FWCore/Utilities/interface/RandomNumberGenerator.h

Go to the documentation of this file.
00001 #ifndef FWCore_Utilities_RandomNumberGenerator_h
00002 #define FWCore_Utilities_RandomNumberGenerator_h
00003 
00092 #include <vector>
00093 #include <stdint.h>
00094 
00095 class RandomEngineState;
00096 
00097 namespace CLHEP {
00098   class HepRandomEngine;
00099 }
00100 
00101 namespace edm {
00102 
00103   class LuminosityBlock;
00104   class Event;
00105 
00106   class RandomNumberGenerator
00107   {
00108   public:
00109 
00110     RandomNumberGenerator() {}
00111     virtual ~RandomNumberGenerator();
00112 
00114     virtual CLHEP::HepRandomEngine& getEngine() const = 0;    
00115 
00117     virtual uint32_t mySeed() const = 0;
00118 
00119     // The following functions should not be used by general users.  They
00120     // should only be called by Framework code designed to work with the
00121     // service while it is saving the engine states or restoring them.
00122     // The first two are called by the InputSource base class.
00123     // The next two are called by a dedicated producer module (RandomEngineStateProducer).
00124 
00125     virtual void preBeginLumi(LuminosityBlock const& lumi) = 0;
00126     virtual void postEventRead(Event const& event) = 0;
00127 
00128     virtual std::vector<RandomEngineState> const& getLumiCache() const = 0;
00129     virtual std::vector<RandomEngineState> const& getEventCache() const = 0;
00130  
00132     virtual void print() = 0;
00133 
00134   private:
00135 
00136     RandomNumberGenerator(RandomNumberGenerator const&); // stop default
00137     RandomNumberGenerator const& operator=(RandomNumberGenerator const&); // stop default
00138   };
00139 }
00140 #endif