1 #ifndef IOMC_RandomEngine_RandomNumberGeneratorService_h
2 #define IOMC_RandomEngine_RandomNumberGeneratorService_h
17 #include "boost/shared_ptr.hpp"
28 class HepRandomEngine;
37 class ModuleDescription;
53 virtual CLHEP::HepRandomEngine&
getEngine()
const;
56 virtual uint32_t
mySeed()
const;
98 virtual std::vector<RandomEngineState>
const&
getLumiCache()
const;
99 virtual std::vector<RandomEngineState>
const&
getEventCache()
const;
102 virtual void print();
116 void push(std::string
const& iLabel);
123 void snapShot(std::vector<RandomEngineState>& cache);
127 std::string
const& typeFromEvent,
128 std::string
const& engineLabel);
131 void writeStates(std::vector<RandomEngineState>
const&
v,
140 std::vector<RandomEngineState>& cache,
141 std::string
const& whichStates);
143 std::vector<RandomEngineState>& cache,
144 std::string
const& whichStates,
146 void readVector(std::istream& is,
unsigned numItems, std::vector<uint32_t>&
v);
156 typedef std::map<std::string, boost::shared_ptr<CLHEP::HepRandomEngine> >
EngineMap;
void writeStates(std::vector< RandomEngineState > const &v, std::ofstream &outFile)
static uint32_t maxSeedHepJames
void restoreFromCache(std::vector< RandomEngineState > const &cache)
std::string currentLabel_
void postModuleEndJob(ModuleDescription const &description)
void preModuleEndLumi(ModuleDescription const &description)
bool backwardCompatibilityRead(Event const &event)
void readFromEvent(Event const &event)
virtual void print()
For debugging purposes only.
std::vector< std::vector< unsigned long > > engineStateStack_
static uint32_t maxSeedTRandom3
virtual void postEventRead(Event const &event)
void preModuleConstruction(ModuleDescription const &description)
void postModuleEndLumi(ModuleDescription const &description)
void preModule(ModuleDescription const &description)
void postBeginLumi(LuminosityBlock const &lumi, EventSetup const &es)
static size_t const maxStates
void postModule(ModuleDescription const &description)
void preModuleBeginJob(ModuleDescription const &description)
void readFromLuminosityBlock(LuminosityBlock const &lumi)
void readLumiStatesFromTextFile(std::string const &fileName)
std::map< std::string, std::string > engineNameMap_
void checkEngineType(std::string const &typeFromConfig, std::string const &typeFromEvent, std::string const &engineLabel)
edm::InputTag restoreStateTag_
void oldStyleConfig(ParameterSet const &pset)
void preModuleBeginLumi(ModuleDescription const &description)
std::string saveFileName_
void saveStatesToFile(std::string const &fileName)
void postModuleBeginRun(ModuleDescription const &description)
virtual CLHEP::HepRandomEngine & getEngine() const
Use this to get the random number engine, this is the only function most users should call...
RandomNumberGeneratorService(ParameterSet const &pset, ActivityRegistry &activityRegistry)
virtual std::vector< RandomEngineState > const & getEventCache() const
void postModuleEndRun(ModuleDescription const &description)
bool readEngineState(std::istream &is, std::vector< RandomEngineState > &cache, std::string const &whichStates, bool &saveToCache)
virtual uint32_t mySeed() const
Exists for backward compatibility.
static size_t const maxSeeds
void readEventStatesFromTextFile(std::string const &fileName)
virtual void preBeginLumi(LuminosityBlock const &lumi)
bool failedToFindStatesInLumi_
std::vector< RandomEngineState > eventCache_
void readStatesFromFile(std::string const &fileName, std::vector< RandomEngineState > &cache, std::string const &whichStates)
void snapShot(std::vector< RandomEngineState > &cache)
static void fillDescriptions(ConfigurationDescriptions &descriptions)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
void push(std::string const &iLabel)
void postModuleBeginJob(ModuleDescription const &description)
std::vector< EngineMap::const_iterator > engineStack_
virtual std::vector< RandomEngineState > const & getLumiCache() const
void preModuleEndRun(ModuleDescription const &description)
void startNewSequencesForEvents()
std::vector< RandomEngineState > lumiCache_
std::map< std::string, VUint32 > seedMap_
void postModuleBeginLumi(ModuleDescription const &description)
void preModuleEndJob(ModuleDescription const &description)
std::vector< std::string > VString
edm::InputTag restoreStateBeginLumiTag_
void postForkReacquireResources(unsigned childIndex, unsigned kMaxChildren)
void readVector(std::istream &is, unsigned numItems, std::vector< uint32_t > &v)
void postModuleConstruction(ModuleDescription const &description)
static uint32_t maxSeedRanecu
RandomNumberGeneratorService const & operator=(RandomNumberGeneratorService const &)
virtual ~RandomNumberGeneratorService()
EngineMap::const_iterator currentEngine_
void writeVector(VUint32 const &v, std::ofstream &outFile)
std::string restoreFileName_
std::map< std::string, boost::shared_ptr< CLHEP::HepRandomEngine > > EngineMap
void preModuleBeginRun(ModuleDescription const &description)
std::vector< uint32_t > VUint32
uint32_t eventSeedOffset_
std::string constructSaveFileName()
bool saveFileNameRecorded_