CMS 3D CMS Logo

RandomNumberGeneratorService.h
Go to the documentation of this file.
1 #ifndef IOMC_RandomEngine_RandomNumberGeneratorService_h
2 #define IOMC_RandomEngine_RandomNumberGeneratorService_h
3 
17 
18 #include <atomic>
19 #include <cstdint>
20 #include <fstream>
21 #include <iosfwd>
22 #include <istream>
23 #include <limits>
24 #include <map>
25 #include <memory>
26 #include <string>
27 #include <vector>
28 
29 class RandomEngineState;
30 
31 namespace CLHEP {
32  class HepRandomEngine;
33 }
34 
35 namespace edm {
36  class ActivityRegistry;
38  class ConsumesCollector;
39  class Event;
40  class LuminosityBlock;
41  class LuminosityBlockIndex;
42  class ModuleCallingContext;
43  class ModuleDescription;
44  class ParameterSet;
45  class StreamContext;
46  class StreamID;
47 
48  namespace service {
49 
50  class SystemBounds;
51 
53  public:
56 
59 
61  CLHEP::HepRandomEngine& getEngine(StreamID const& streamID) override;
62 
64  CLHEP::HepRandomEngine& getEngine(LuminosityBlockIndex const& luminosityBlockIndex) override;
65 
66  std::unique_ptr<CLHEP::HepRandomEngine> cloneEngine(LuminosityBlockIndex const&) override;
67 
68  // This returns the seed from the configuration. In the unusual case where an
69  // an engine type takes multiple seeds to initialize a sequence, this function
70  // only returns the first. As a general rule, this function should not be used,
71  // but is available for backward compatibility and debugging. It might be useful
72  // for some types of tests. Using this to seed engines constructed in modules is
73  // not recommended because (unless done very carefully) it will create duplicate
74  // sequences in different threads and/or data races. Also, if engines are created
75  // by modules the replay mechanism will be broken.
76  // Because it is dangerous and could be misused, this function might be deleted
77  // someday if we ever find time to delete all uses of it in CMSSW. There are of
78  // order 10 last time I checked ...
79  std::uint32_t mySeed() const override;
80 
81  static void fillDescriptions(ConfigurationDescriptions& descriptions);
82 
84  void preallocate(SystemBounds const&);
85 
86  void preBeginLumi(LuminosityBlock const& lumi) override;
87  void postEventRead(Event const& event) override;
88  void setLumiCache(LuminosityBlockIndex, std::vector<RandomEngineState> const& iStates) override;
89  void setEventCache(StreamID, std::vector<RandomEngineState> const& iStates) override;
90 
93  void preModuleBeginStream(StreamContext const& sc, ModuleCallingContext const& mcc);
94  void postModuleBeginStream(StreamContext const& sc, ModuleCallingContext const& mcc);
95 
96  void preModuleEndStream(StreamContext const& sc, ModuleCallingContext const& mcc);
97  void postModuleEndStream(StreamContext const& sc, ModuleCallingContext const& mcc);
98 
100  void postModuleStreamBeginRun(StreamContext const& sc, ModuleCallingContext const& mcc);
101 
102  void preModuleStreamEndRun(StreamContext const& sc, ModuleCallingContext const& mcc);
103  void postModuleStreamEndRun(StreamContext const& sc, ModuleCallingContext const& mcc);
104 
105  void preModuleStreamBeginLumi(StreamContext const& sc, ModuleCallingContext const& mcc);
107 
108  void preModuleStreamEndLumi(StreamContext const& sc, ModuleCallingContext const& mcc);
109  void postModuleStreamEndLumi(StreamContext const& sc, ModuleCallingContext const& mcc);
110 
112  std::vector<RandomEngineState> const& getLumiCache(LuminosityBlockIndex const&) const override;
113  std::vector<RandomEngineState> const& getEventCache(StreamID const&) const override;
114 
115  void consumes(ConsumesCollector&& iC) const override;
116 
118  void print(std::ostream& os) const override;
119 
120  private:
121  typedef std::vector<std::uint32_t> VUint32;
122 
124  public:
125  LabelAndEngine(std::string const& theLabel,
126  VUint32 const& theSeeds,
127  std::shared_ptr<CLHEP::HepRandomEngine> const& theEngine)
128  : label_(theLabel), seeds_(theSeeds), engine_(theEngine) {}
129  std::string const& label() const { return label_; }
130  VUint32 const& seeds() const { return seeds_; }
131  std::shared_ptr<CLHEP::HepRandomEngine const> engine() const { return get_underlying_safe(engine_); }
132  std::shared_ptr<CLHEP::HepRandomEngine>& engine() { return get_underlying_safe(engine_); }
133  void setSeed(std::uint32_t v, unsigned int index) { seeds_.at(index) = v; }
134 
135  private:
139  };
140 
141  // This class exists because it is faster to lookup a module using
142  // the moduleID (an integer) than the label (a string). There is a
143  // one to one association between LabelAndEngine objects and ModuleIDToEngine objects.
145  public:
146  ModuleIDToEngine(LabelAndEngine* theLabelAndEngine, unsigned int theModuleID)
147  : engineState_(), labelAndEngine_(theLabelAndEngine), moduleID_(theModuleID) {}
148 
149  std::vector<unsigned long> const& engineState() const { return engineState_; }
152  unsigned int moduleID() const { return moduleID_; }
153  void setEngineState(std::vector<unsigned long> const& v) { engineState_ = v; }
154  // Used to sort so binary lookup can be used on a container of these.
155  bool operator<(ModuleIDToEngine const& r) const { return moduleID() < r.moduleID(); }
156 
157  private:
158  std::vector<unsigned long> engineState_; // Used only for check in stream transitions
160  unsigned int moduleID_;
161  };
162 
165 
166  void preModuleStreamCheck(StreamContext const& sc, ModuleCallingContext const& mcc);
167  void postModuleStreamCheck(StreamContext const& sc, ModuleCallingContext const& mcc);
168 
170  void readFromEvent(Event const& event);
171 
172  void snapShot(std::vector<LabelAndEngine> const& engines, std::vector<RandomEngineState>& cache);
173  void restoreFromCache(std::vector<RandomEngineState> const& cache, std::vector<LabelAndEngine>& engines);
174 
175  void checkEngineType(std::string const& typeFromConfig,
176  std::string const& typeFromEvent,
177  std::string const& engineLabel) const;
178 
180  StreamID const& streamID,
182  void writeStates(std::vector<RandomEngineState> const& v, std::ofstream& outFile);
183  void writeVector(VUint32 const& v, std::ofstream& outFile);
185 
186  void readEventStatesFromTextFile(std::string const& fileName, std::vector<RandomEngineState>& cache);
187  void readLumiStatesFromTextFile(std::string const& fileName, std::vector<RandomEngineState>& cache);
189  std::vector<RandomEngineState>& cache,
190  std::string const& whichStates);
191  bool readEngineState(std::istream& is,
192  std::vector<RandomEngineState>& cache,
193  std::string const& whichStates,
194  bool& saveToCache);
195  void readVector(std::istream& is, unsigned numItems, std::vector<std::uint32_t>& v);
196 
197  void createEnginesInVector(std::vector<LabelAndEngine>& engines,
198  unsigned int seedOffset,
199  unsigned int eventSeedOffset,
200  std::vector<ModuleIDToEngine>& moduleIDVector);
201 
202  void resetEngineSeeds(LabelAndEngine& labelAndEngine,
203  std::string const& engineName,
204  VUint32 const& seeds,
205  std::uint32_t offset1,
206  std::uint32_t offset2);
207 
208  // ---------- member data --------------------------------
209 
210  unsigned int nStreams_;
211 
212  // This exists because we can look things up faster using the moduleID
213  // than using string comparisons with the moduleLabel
214  std::vector<std::vector<ModuleIDToEngine>> streamModuleIDToEngine_; // streamID, sorted by moduleID
215  std::vector<std::vector<ModuleIDToEngine>> lumiModuleIDToEngine_; // luminosityBlockIndex, sortedByModuleID
216 
217  // Holds the engines, plus the seeds and module label also
218  std::vector<std::vector<LabelAndEngine>> streamEngines_; // streamID, sorted by label
219  std::vector<std::vector<LabelAndEngine>> lumiEngines_; // luminosityBlockIndex, sorted by label
220 
221  // These hold the input tags needed to retrieve the states
222  // of the random number engines stored in a previous process.
223  // If the label in the tag is the empty string (the default),
224  // then the service does not try to restore the random numbers.
227 
228  std::vector<std::vector<RandomEngineState>> eventCache_; // streamID, sorted by module label
229  std::vector<std::vector<RandomEngineState>> lumiCache_; // luminosityBlockIndex, sorted by module label
230 
231  // This is used to keep track of the seeds and engine name from
232  // the configuration. The map key is the module label.
233  // The module ID is filled in as modules are constructed.
234  // It is left as max unsigned if the module is never constructed and not in the process
235  class SeedsAndName {
236  public:
237  SeedsAndName(VUint32 const& theSeeds, std::string const& theEngineName)
238  : seeds_(theSeeds), engineName_(theEngineName), moduleID_(std::numeric_limits<unsigned int>::max()) {}
239  VUint32 const& seeds() const { return seeds_; }
240  std::string const& engineName() const { return engineName_; }
241  unsigned int moduleID() const { return moduleID_; }
242  void setModuleID(unsigned int v) { moduleID_ = v; }
243 
244  private:
247  unsigned int moduleID_;
248  };
249  std::map<std::string, SeedsAndName> seedsAndNameMap_;
250 
251  // Keep the name of the file where we want to save the state
252  // of all declared engines at the end of each event. A blank
253  // name means don't bother. Also, keep a record of whether
254  // the save file name has been recorded in the job report.
256  std::atomic<bool> saveFileNameRecorded_;
257  std::vector<edm::propagate_const<std::shared_ptr<std::ofstream>>> outFiles_; // streamID
258 
259  // Keep the name of the file from which we restore the state
260  // of all declared engines at the beginning of a run. A
261  // blank name means there isn't one.
263 
264  // This turns on or off the checks that ensure no random
265  // numbers are generated in a module during stream
266  // beginStream, beginRun, endLuminosityBlock, or endRun.
268 
269  std::uint32_t eventSeedOffset_;
270 
271  bool verbose_;
272 
275  static const std::uint32_t maxSeedRanecu;
276  static const std::uint32_t maxSeedHepJames;
277  static const std::uint32_t maxSeedTRandom3;
278  };
279  } // namespace service
280 } // namespace edm
281 #endif
edm::StreamID
Definition: StreamID.h:30
edm::service::RandomNumberGeneratorService::VUint32
std::vector< std::uint32_t > VUint32
Definition: RandomNumberGeneratorService.h:121
edm::service::RandomNumberGeneratorService::LabelAndEngine::LabelAndEngine
LabelAndEngine(std::string const &theLabel, VUint32 const &theSeeds, std::shared_ptr< CLHEP::HepRandomEngine > const &theEngine)
Definition: RandomNumberGeneratorService.h:125
edm::service::RandomNumberGeneratorService::lumiCache_
std::vector< std::vector< RandomEngineState > > lumiCache_
Definition: RandomNumberGeneratorService.h:229
service
Definition: service.py:1
edm::service::RandomNumberGeneratorService::LabelAndEngine::seeds
VUint32 const & seeds() const
Definition: RandomNumberGeneratorService.h:130
edm::service::RandomNumberGeneratorService::readEventStatesFromTextFile
void readEventStatesFromTextFile(std::string const &fileName, std::vector< RandomEngineState > &cache)
Definition: RandomNumberGeneratorService.cc:895
edm::service::RandomNumberGeneratorService::ModuleIDToEngine::labelAndEngine
LabelAndEngine *& labelAndEngine()
Definition: RandomNumberGeneratorService.h:151
edm::service::RandomNumberGeneratorService::saveStatesToFile
void saveStatesToFile(std::string const &fileName, StreamID const &streamID, LuminosityBlockIndex const &lumiIndex)
Definition: RandomNumberGeneratorService.cc:820
edm::service::RandomNumberGeneratorService::maxStates
static const std::vector< std::uint32_t >::size_type maxStates
Definition: RandomNumberGeneratorService.h:274
edm::service::RandomNumberGeneratorService::streamEngines_
std::vector< std::vector< LabelAndEngine > > streamEngines_
Definition: RandomNumberGeneratorService.h:218
edm::service::RandomNumberGeneratorService::print
void print(std::ostream &os) const override
For debugging.
Definition: RandomNumberGeneratorService.cc:548
edm::service::RandomNumberGeneratorService::eventCache_
std::vector< std::vector< RandomEngineState > > eventCache_
Definition: RandomNumberGeneratorService.h:228
edm::service::RandomNumberGeneratorService::consumes
void consumes(ConsumesCollector &&iC) const override
Definition: RandomNumberGeneratorService.cc:216
ActivityRegistry
edm::service::RandomNumberGeneratorService::fillDescriptions
static void fillDescriptions(ConfigurationDescriptions &descriptions)
Definition: RandomNumberGeneratorService.cc:351
edm::service::RandomNumberGeneratorService::mySeed
std::uint32_t mySeed() const override
Definition: RandomNumberGeneratorService.cc:318
edm::service::RandomNumberGeneratorService::preallocate
void preallocate(SystemBounds const &)
Definition: RandomNumberGeneratorService.cc:385
edm::service::RandomNumberGeneratorService::createEnginesInVector
void createEnginesInVector(std::vector< LabelAndEngine > &engines, unsigned int seedOffset, unsigned int eventSeedOffset, std::vector< ModuleIDToEngine > &moduleIDVector)
Definition: RandomNumberGeneratorService.cc:1070
edm::service::RandomNumberGeneratorService::readEngineState
bool readEngineState(std::istream &is, std::vector< RandomEngineState > &cache, std::string const &whichStates, bool &saveToCache)
Definition: RandomNumberGeneratorService.cc:930
edm::LuminosityBlock
Definition: LuminosityBlock.h:50
SiStripMonitorTrack_RawStandAlone_cff.engineName
engineName
Definition: SiStripMonitorTrack_RawStandAlone_cff.py:33
edm::service::RandomNumberGeneratorService::constructSaveFileName
std::string constructSaveFileName() const
Definition: RandomNumberGeneratorService.cc:888
edm::service::RandomNumberGeneratorService::postModuleStreamEndLumi
void postModuleStreamEndLumi(StreamContext const &sc, ModuleCallingContext const &mcc)
Definition: RandomNumberGeneratorService.cc:534
edm
HLT enums.
Definition: AlignableModifier.h:19
RandomNumberGenerator.h
edm::max
EventID const & max(EventID const &lh, EventID const &rh)
Definition: EventID.h:118
edm::service::RandomNumberGeneratorService::SeedsAndName::setModuleID
void setModuleID(unsigned int v)
Definition: RandomNumberGeneratorService.h:242
edm::service::RandomNumberGeneratorService::SeedsAndName::seeds_
VUint32 seeds_
Definition: RandomNumberGeneratorService.h:245
edmLumisInFiles.description
description
Definition: edmLumisInFiles.py:11
edm::service::RandomNumberGeneratorService::SeedsAndName::moduleID_
unsigned int moduleID_
Definition: RandomNumberGeneratorService.h:247
edm::service::RandomNumberGeneratorService::eventSeedOffset_
std::uint32_t eventSeedOffset_
Definition: RandomNumberGeneratorService.h:269
edm::service::RandomNumberGeneratorService::ModuleIDToEngine::labelAndEngine
LabelAndEngine const * labelAndEngine() const
Definition: RandomNumberGeneratorService.h:150
edm::service::RandomNumberGeneratorService::getEventCache
std::vector< RandomEngineState > const & getEventCache(StreamID const &) const override
Definition: RandomNumberGeneratorService.cc:544
edm::service::RandomNumberGeneratorService::readStatesFromFile
void readStatesFromFile(std::string const &fileName, std::vector< RandomEngineState > &cache, std::string const &whichStates)
Definition: RandomNumberGeneratorService.cc:907
edm::service::RandomNumberGeneratorService::SeedsAndName
Definition: RandomNumberGeneratorService.h:235
edm::service::RandomNumberGeneratorService::ModuleIDToEngine::labelAndEngine_
edm::propagate_const< LabelAndEngine * > labelAndEngine_
Definition: RandomNumberGeneratorService.h:159
edm::service::RandomNumberGeneratorService::cloneEngine
std::unique_ptr< CLHEP::HepRandomEngine > cloneEngine(LuminosityBlockIndex const &) override
Definition: RandomNumberGeneratorService.cc:289
edm::service::RandomNumberGeneratorService::setEventCache
void setEventCache(StreamID, std::vector< RandomEngineState > const &iStates) override
Definition: RandomNumberGeneratorService.cc:478
edm::get_underlying_safe
constexpr std::shared_ptr< T > & get_underlying_safe(propagate_const< std::shared_ptr< T >> &iP)
Definition: get_underlying_safe.h:41
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
findQualityFiles.v
v
Definition: findQualityFiles.py:179
edm::service::RandomNumberGeneratorService::SeedsAndName::SeedsAndName
SeedsAndName(VUint32 const &theSeeds, std::string const &theEngineName)
Definition: RandomNumberGeneratorService.h:237
edm::service::RandomNumberGeneratorService::checkEngineType
void checkEngineType(std::string const &typeFromConfig, std::string const &typeFromEvent, std::string const &engineLabel) const
Definition: RandomNumberGeneratorService.cc:801
edm::service::RandomNumberGeneratorService::ModuleIDToEngine::setEngineState
void setEngineState(std::vector< unsigned long > const &v)
Definition: RandomNumberGeneratorService.h:153
edm::service::RandomNumberGeneratorService::SeedsAndName::seeds
VUint32 const & seeds() const
Definition: RandomNumberGeneratorService.h:239
edm::service::RandomNumberGeneratorService::SeedsAndName::engineName
std::string const & engineName() const
Definition: RandomNumberGeneratorService.h:240
edm::ModuleDescription
Definition: ModuleDescription.h:21
edm::service::RandomNumberGeneratorService::readLumiStatesFromTextFile
void readLumiStatesFromTextFile(std::string const &fileName, std::vector< RandomEngineState > &cache)
Definition: RandomNumberGeneratorService.cc:901
edm::service::RandomNumberGeneratorService::restoreFromCache
void restoreFromCache(std::vector< RandomEngineState > const &cache, std::vector< LabelAndEngine > &engines)
Definition: RandomNumberGeneratorService.cc:717
edm::RandomNumberGenerator
Definition: RandomNumberGenerator.h:147
RandomEngineState
Definition: RandomEngineState.h:26
edm::service::RandomNumberGeneratorService::LabelAndEngine::engine
std::shared_ptr< CLHEP::HepRandomEngine > & engine()
Definition: RandomNumberGeneratorService.h:132
edm::service::RandomNumberGeneratorService::postEventRead
void postEventRead(Event const &event) override
Definition: RandomNumberGeneratorService.cc:444
edm::propagate_const
Definition: propagate_const.h:32
edm::service::RandomNumberGeneratorService
Definition: RandomNumberGeneratorService.h:52
edm::service::RandomNumberGeneratorService::restoreStateBeginLumiTag_
edm::InputTag restoreStateBeginLumiTag_
Definition: RandomNumberGeneratorService.h:226
edm::service::RandomNumberGeneratorService::writeVector
void writeVector(VUint32 const &v, std::ofstream &outFile)
Definition: RandomNumberGeneratorService.cc:876
edm::service::RandomNumberGeneratorService::LabelAndEngine::engine
std::shared_ptr< CLHEP::HepRandomEngine const > engine() const
Definition: RandomNumberGeneratorService.h:131
trigger::size_type
uint16_t size_type
Definition: TriggerTypeDefs.h:18
edm::service::RandomNumberGeneratorService::maxSeeds
static const std::vector< std::uint32_t >::size_type maxSeeds
Definition: RandomNumberGeneratorService.h:273
edm::LuminosityBlockIndex
Definition: LuminosityBlockIndex.h:33
edm::service::RandomNumberGeneratorService::lumiModuleIDToEngine_
std::vector< std::vector< ModuleIDToEngine > > lumiModuleIDToEngine_
Definition: RandomNumberGeneratorService.h:215
edm::StreamContext
Definition: StreamContext.h:31
edm::service::RandomNumberGeneratorService::LabelAndEngine::label
std::string const & label() const
Definition: RandomNumberGeneratorService.h:129
edm::service::RandomNumberGeneratorService::maxSeedHepJames
static const std::uint32_t maxSeedHepJames
Definition: RandomNumberGeneratorService.h:276
edm::service::RandomNumberGeneratorService::preModuleStreamCheck
void preModuleStreamCheck(StreamContext const &sc, ModuleCallingContext const &mcc)
Definition: RandomNumberGeneratorService.cc:613
edm::service::RandomNumberGeneratorService::readVector
void readVector(std::istream &is, unsigned numItems, std::vector< std::uint32_t > &v)
Definition: RandomNumberGeneratorService.cc:1055
edm::service::RandomNumberGeneratorService::postModuleStreamBeginLumi
void postModuleStreamBeginLumi(StreamContext const &sc, ModuleCallingContext const &mcc)
Definition: RandomNumberGeneratorService.cc:524
edm::service::RandomNumberGeneratorService::verbose_
bool verbose_
Definition: RandomNumberGeneratorService.h:271
edm::ActivityRegistry
Definition: ActivityRegistry.h:133
edm::service::RandomNumberGeneratorService::lumiEngines_
std::vector< std::vector< LabelAndEngine > > lumiEngines_
Definition: RandomNumberGeneratorService.h:219
LuminosityBlock
Event
edm::service::RandomNumberGeneratorService::LabelAndEngine
Definition: RandomNumberGeneratorService.h:123
edm::service::RandomNumberGeneratorService::postModuleBeginStream
void postModuleBeginStream(StreamContext const &sc, ModuleCallingContext const &mcc)
Definition: RandomNumberGeneratorService.cc:488
edm::service::RandomNumberGeneratorService::restoreFileName_
std::string restoreFileName_
Definition: RandomNumberGeneratorService.h:262
edm::service::RandomNumberGeneratorService::LabelAndEngine::engine_
edm::propagate_const< std::shared_ptr< CLHEP::HepRandomEngine > > engine_
Definition: RandomNumberGeneratorService.h:138
edm::service::RandomNumberGeneratorService::writeStates
void writeStates(std::vector< RandomEngineState > const &v, std::ofstream &outFile)
Definition: RandomNumberGeneratorService.cc:855
edm::service::RandomNumberGeneratorService::preModuleStreamEndLumi
void preModuleStreamEndLumi(StreamContext const &sc, ModuleCallingContext const &mcc)
Definition: RandomNumberGeneratorService.cc:529
csv2json.lumiIndex
lumiIndex
Definition: csv2json.py:29
utilities.cache
def cache(function)
Definition: utilities.py:3
edm::service::RandomNumberGeneratorService::preBeginLumi
void preBeginLumi(LuminosityBlock const &lumi) override
Definition: RandomNumberGeneratorService.cc:435
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
L1TdeCSCTF_cfi.outFile
outFile
Definition: L1TdeCSCTF_cfi.py:5
CLHEP
Definition: CocoaGlobals.h:27
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::service::RandomNumberGeneratorService::SeedsAndName::engineName_
std::string engineName_
Definition: RandomNumberGeneratorService.h:246
InitialStep_cff.seeds
seeds
Definition: InitialStep_cff.py:230
edm::service::RandomNumberGeneratorService::getEngine
CLHEP::HepRandomEngine & getEngine(StreamID const &streamID) override
Use this engine in event methods.
Definition: RandomNumberGeneratorService.cc:221
edm::service::SystemBounds
Definition: SystemBounds.h:29
edm::service::RandomNumberGeneratorService::saveFileNameRecorded_
std::atomic< bool > saveFileNameRecorded_
Definition: RandomNumberGeneratorService.h:256
edm::ParameterSet
Definition: ParameterSet.h:47
edm::service::RandomNumberGeneratorService::ModuleIDToEngine
Definition: RandomNumberGeneratorService.h:144
ParameterSet
Definition: Functions.h:16
edm::service::RandomNumberGeneratorService::seedsAndNameMap_
std::map< std::string, SeedsAndName > seedsAndNameMap_
Definition: RandomNumberGeneratorService.h:249
createfilelist.int
int
Definition: createfilelist.py:10
edm::service::RandomNumberGeneratorService::LabelAndEngine::setSeed
void setSeed(std::uint32_t v, unsigned int index)
Definition: RandomNumberGeneratorService.h:133
edm::service::RandomNumberGeneratorService::LabelAndEngine::seeds_
VUint32 seeds_
Definition: RandomNumberGeneratorService.h:137
edm::service::RandomNumberGeneratorService::ModuleIDToEngine::moduleID_
unsigned int moduleID_
Definition: RandomNumberGeneratorService.h:160
edm::service::RandomNumberGeneratorService::readFromLuminosityBlock
void readFromLuminosityBlock(LuminosityBlock const &lumi)
Definition: RandomNumberGeneratorService.cc:651
edm::service::RandomNumberGeneratorService::maxSeedRanecu
static const std::uint32_t maxSeedRanecu
Definition: RandomNumberGeneratorService.h:275
edm::service::RandomNumberGeneratorService::operator=
RandomNumberGeneratorService const & operator=(RandomNumberGeneratorService const &)=delete
edm::service::RandomNumberGeneratorService::readFromEvent
void readFromEvent(Event const &event)
Definition: RandomNumberGeneratorService.cc:680
edm::service::RandomNumberGeneratorService::ModuleIDToEngine::moduleID
unsigned int moduleID() const
Definition: RandomNumberGeneratorService.h:152
edm::service::RandomNumberGeneratorService::preModuleConstruction
void preModuleConstruction(ModuleDescription const &description)
Definition: RandomNumberGeneratorService.cc:378
InputTag.h
alignCSCRings.r
r
Definition: alignCSCRings.py:93
edm::service::RandomNumberGeneratorService::ModuleIDToEngine::engineState_
std::vector< unsigned long > engineState_
Definition: RandomNumberGeneratorService.h:158
edm::service::RandomNumberGeneratorService::streamModuleIDToEngine_
std::vector< std::vector< ModuleIDToEngine > > streamModuleIDToEngine_
Definition: RandomNumberGeneratorService.h:214
std
Definition: JetResolutionObject.h:76
ConfigurationDescriptions
edm::service::RandomNumberGeneratorService::preModuleEndStream
void preModuleEndStream(StreamContext const &sc, ModuleCallingContext const &mcc)
Definition: RandomNumberGeneratorService.cc:492
edm::service::RandomNumberGeneratorService::preModuleStreamBeginLumi
void preModuleStreamBeginLumi(StreamContext const &sc, ModuleCallingContext const &mcc)
Definition: RandomNumberGeneratorService.cc:519
edm::service::RandomNumberGeneratorService::restoreStateTag_
edm::InputTag restoreStateTag_
Definition: RandomNumberGeneratorService.h:225
edm::service::RandomNumberGeneratorService::outFiles_
std::vector< edm::propagate_const< std::shared_ptr< std::ofstream > > > outFiles_
Definition: RandomNumberGeneratorService.h:257
edm::service::RandomNumberGeneratorService::~RandomNumberGeneratorService
~RandomNumberGeneratorService() override
Definition: RandomNumberGeneratorService.cc:214
edm::service::RandomNumberGeneratorService::ModuleIDToEngine::operator<
bool operator<(ModuleIDToEngine const &r) const
Definition: RandomNumberGeneratorService.h:155
edm::service::RandomNumberGeneratorService::postModuleStreamCheck
void postModuleStreamCheck(StreamContext const &sc, ModuleCallingContext const &mcc)
Definition: RandomNumberGeneratorService.cc:627
edm::service::RandomNumberGeneratorService::postModuleStreamEndRun
void postModuleStreamEndRun(StreamContext const &sc, ModuleCallingContext const &mcc)
Definition: RandomNumberGeneratorService.cc:514
edm::service::RandomNumberGeneratorService::saveFileName_
std::string saveFileName_
Definition: RandomNumberGeneratorService.h:255
edm::service::RandomNumberGeneratorService::ModuleIDToEngine::ModuleIDToEngine
ModuleIDToEngine(LabelAndEngine *theLabelAndEngine, unsigned int theModuleID)
Definition: RandomNumberGeneratorService.h:146
edm::service::RandomNumberGeneratorService::SeedsAndName::moduleID
unsigned int moduleID() const
Definition: RandomNumberGeneratorService.h:241
edm::service::RandomNumberGeneratorService::preModuleStreamBeginRun
void preModuleStreamBeginRun(StreamContext const &sc, ModuleCallingContext const &mcc)
Definition: RandomNumberGeneratorService.cc:500
edm::service::RandomNumberGeneratorService::resetEngineSeeds
void resetEngineSeeds(LabelAndEngine &labelAndEngine, std::string const &engineName, VUint32 const &seeds, std::uint32_t offset1, std::uint32_t offset2)
Definition: RandomNumberGeneratorService.cc:1132
edm::service::RandomNumberGeneratorService::ModuleIDToEngine::engineState
std::vector< unsigned long > const & engineState() const
Definition: RandomNumberGeneratorService.h:149
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
edm::service::RandomNumberGeneratorService::LabelAndEngine::label_
std::string label_
Definition: RandomNumberGeneratorService.h:136
edm::service::RandomNumberGeneratorService::maxSeedTRandom3
static const std::uint32_t maxSeedTRandom3
Definition: RandomNumberGeneratorService.h:277
edm::service::RandomNumberGeneratorService::postModuleStreamBeginRun
void postModuleStreamBeginRun(StreamContext const &sc, ModuleCallingContext const &mcc)
Definition: RandomNumberGeneratorService.cc:505
edm::service::RandomNumberGeneratorService::postModuleEndStream
void postModuleEndStream(StreamContext const &sc, ModuleCallingContext const &mcc)
Definition: RandomNumberGeneratorService.cc:496
event
Definition: event.py:1
edm::Event
Definition: Event.h:73
get_underlying_safe.h
SystemBounds
lumi
Definition: LumiSectionData.h:20
edm::InputTag
Definition: InputTag.h:15
edm::service::RandomNumberGeneratorService::getLumiCache
std::vector< RandomEngineState > const & getLumiCache(LuminosityBlockIndex const &) const override
These two are used by the RandomEngineStateProducer.
Definition: RandomNumberGeneratorService.cc:539
edm::service::RandomNumberGeneratorService::preModuleBeginStream
void preModuleBeginStream(StreamContext const &sc, ModuleCallingContext const &mcc)
Definition: RandomNumberGeneratorService.cc:484
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
edm::service::RandomNumberGeneratorService::RandomNumberGeneratorService
RandomNumberGeneratorService(ParameterSet const &pset, ActivityRegistry &activityRegistry)
Definition: RandomNumberGeneratorService.cc:61
edm::service::RandomNumberGeneratorService::enableChecking_
bool enableChecking_
Definition: RandomNumberGeneratorService.h:267
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
edm::service::RandomNumberGeneratorService::snapShot
void snapShot(std::vector< LabelAndEngine > const &engines, std::vector< RandomEngineState > &cache)
Definition: RandomNumberGeneratorService.cc:698
edm::service::RandomNumberGeneratorService::preModuleStreamEndRun
void preModuleStreamEndRun(StreamContext const &sc, ModuleCallingContext const &mcc)
Definition: RandomNumberGeneratorService.cc:510
edm::service::RandomNumberGeneratorService::setLumiCache
void setLumiCache(LuminosityBlockIndex, std::vector< RandomEngineState > const &iStates) override
Definition: RandomNumberGeneratorService.cc:472
edm::ModuleCallingContext
Definition: ModuleCallingContext.h:29
edm::service::RandomNumberGeneratorService::nStreams_
unsigned int nStreams_
Definition: RandomNumberGeneratorService.h:210