CMS 3D CMS Logo

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:
150  virtual ~RandomNumberGenerator();
151 
154 
156  virtual CLHEP::HepRandomEngine& getEngine(StreamID const&) = 0;
157 
159  virtual CLHEP::HepRandomEngine& getEngine(LuminosityBlockIndex const&) = 0;
160 
172  virtual std::unique_ptr<CLHEP::HepRandomEngine> cloneEngine(LuminosityBlockIndex const&) = 0;
173 
185  virtual std::uint32_t mySeed() const = 0;
186 
187  // The following functions should not be used by general users. They
188  // should only be called by Framework code designed to work with the
189  // service while it is saving the engine states or restoring them.
190  // The first two are called by the EventProcessor at special times.
191  // The next two are called by a dedicated producer module (RandomEngineStateProducer).
192 
193  virtual void preBeginLumi(LuminosityBlock const& lumi) = 0;
194  virtual void postEventRead(Event const& event) = 0;
195 
196  virtual void setLumiCache(LuminosityBlockIndex, std::vector<RandomEngineState> const& iStates) = 0;
197  virtual void setEventCache(StreamID, std::vector<RandomEngineState> const& iStates) = 0;
198 
199  virtual std::vector<RandomEngineState> const& getEventCache(StreamID const&) const = 0;
200  virtual std::vector<RandomEngineState> const& getLumiCache(LuminosityBlockIndex const&) const = 0;
201 
202  virtual void consumes(ConsumesCollector&& iC) const = 0;
203 
205  virtual void print(std::ostream& os) const = 0;
206 
207  private:
209  RandomNumberGenerator const& operator=(RandomNumberGenerator const&) = delete;
210  };
211 } // namespace edm
212 #endif
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
HLT enums.
Definition: event.py:1