CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
RandomNumberGenerator.h
Go to the documentation of this file.
1 #ifndef FWCore_Utilities_RandomNumberGenerator_h
2 #define FWCore_Utilities_RandomNumberGenerator_h
3 
128 #include <cstdint>
129 #include <iosfwd>
130 #include <memory>
131 #include <vector>
132 
133 class RandomEngineState;
134 
135 namespace CLHEP {
136  class HepRandomEngine;
137 }
138 
139 namespace edm {
140 
141  class ConsumesCollector;
142  class Event;
143  class LuminosityBlock;
144  class LuminosityBlockIndex;
145  class StreamID;
146 
148  public:
151  RandomNumberGenerator const& operator=(RandomNumberGenerator const&) = delete;
152  virtual ~RandomNumberGenerator();
153 
156 
158  virtual CLHEP::HepRandomEngine& getEngine(StreamID const&) = 0;
159 
161  virtual CLHEP::HepRandomEngine& getEngine(LuminosityBlockIndex const&) = 0;
162 
174  virtual std::unique_ptr<CLHEP::HepRandomEngine> cloneEngine(LuminosityBlockIndex const&) = 0;
175 
187  virtual std::uint32_t mySeed() const = 0;
188 
189  // The following functions should not be used by general users. They
190  // should only be called by Framework code designed to work with the
191  // service while it is saving the engine states or restoring them.
192  // The first two are called by the EventProcessor at special times.
193  // The next two are called by a dedicated producer module (RandomEngineStateProducer).
194 
195  virtual void preBeginLumi(LuminosityBlock const& lumi) = 0;
196  virtual void postEventRead(Event const& event) = 0;
197 
198  virtual void setLumiCache(LuminosityBlockIndex, std::vector<RandomEngineState> const& iStates) = 0;
199  virtual void setEventCache(StreamID, std::vector<RandomEngineState> const& iStates) = 0;
200 
201  virtual std::vector<RandomEngineState> const& getEventCache(StreamID const&) const = 0;
202  virtual std::vector<RandomEngineState> const& getLumiCache(LuminosityBlockIndex const&) const = 0;
203 
204  virtual void consumes(ConsumesCollector&& iC) const = 0;
205 
207  virtual void print(std::ostream& os) const = 0;
208  };
209 } // namespace edm
210 #endif
virtual void print(std::ostream &os) const =0
For debugging purposes only.
virtual void consumes(ConsumesCollector &&iC) const =0
virtual std::vector< RandomEngineState > const & getLumiCache(LuminosityBlockIndex const &) const =0
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
virtual void setEventCache(StreamID, std::vector< RandomEngineState > const &iStates)=0
virtual std::uint32_t mySeed() const =0
virtual std::vector< RandomEngineState > const & getEventCache(StreamID const &) const =0
virtual void postEventRead(Event const &event)=0
RandomNumberGenerator const & operator=(RandomNumberGenerator const &)=delete
list lumi
Definition: dqmdumpme.py:53
virtual void setLumiCache(LuminosityBlockIndex, std::vector< RandomEngineState > const &iStates)=0
virtual void preBeginLumi(LuminosityBlock const &lumi)=0
virtual std::unique_ptr< CLHEP::HepRandomEngine > cloneEngine(LuminosityBlockIndex const &)=0