 |
DD4hep
1.37.0
Detector Description Toolkit for High Energy Physics
|
Go to the documentation of this file.
27 #include <CLHEP/Random/EngineFactory.h>
32 #include <G4EventManager.hh>
33 #include <G4StackManager.hh>
66 dd4hep::printout( dd4hep::INFO,
m_type,
"Get RunID: runID=%u",
m_runID );
72 dd4hep::printout(dd4hep::DEBUG,
m_type,
"EventSeed:: At beginEvent");
78 dd4hep::printout(dd4hep::DEBUG,
m_type,
"EventSeed:: At generatePrimaries");
91 unsigned int eventID = evt->GetEventID();
94 if(checkForEventParameters) {
100 dd4hep::printout(dd4hep::DEBUG,
m_type,
101 "EventSeed::setSeed: eventParameters have unset eventNumber=%d, keeping eventID=%u",
107 dd4hep::printout(dd4hep::DEBUG,
m_type,
108 "EventSeed::setSeed: eventParameters have unset runNumber=%d, keeping runID=%u",
113 dd4hep::printout(dd4hep::DEBUG,
m_type,
114 "EventSeed::setSeed: Found eventParameters: eventID=%u, runID=%u",
117 dd4hep::printout(dd4hep::DEBUG,
m_type,
118 "EventSeed::setSeed: Did not find eventParameters");
123 dd4hep::printout(dd4hep::INFO,
m_type,
124 "EventSeed::setSeed: eventID=%u, runID=%u initialSeed=%u, newSeed=%u",
129 if (dd4hep::printLevel() <= dd4hep::DEBUG) {
static Geant4Random * instance(bool throw_exception=true)
Access the main Geant4 random generator instance. Must be created before used!
CLHEP::HepRandomEngine * engine()
CLHEP random number engine (valid after initialization only)
Geant4GeneratorActionSequence & generatorAction() const
Access to the main generator action sequence from the kernel object.
void begin(const G4Run *)
begin-of-run callback
virtual ~Geant4EventSeed()
Default destructor.
void callAtBegin(Q *p, void(T::*f)(const G4Run *))
Register begin-of-run callback. Types Q and T must be polymorph!
static void increment(T *)
Increment count according to type information.
void setSeedForPrimaries(const G4Event *)
generatePrimaries callback
Geant4Event & event() const
Access the geant4 event – valid only between BeginEvent() and EndEvent()!
Plugin class to set the event seed for each event.
#define DECLARE_GEANT4ACTION(name)
Plugin defintion to create Geant4Action objects.
Geant4EventSeed(Geant4Context *, const std::string &)
Standard constructor with initializing arguments.
virtual void setSeed(long seed)
Should initialise the status of the algorithm according to seed.
T * extension(bool alert=true)
Access to type safe extension object. Exception is thrown if the object is invalid.
void callAtBegin(Q *p, void(T::*f)(const G4Event *))
Register callback to happen before primary particle. Types Q and T must be polymorph!
Geant4EventActionSequence & eventAction() const
Access to the main event action sequence from the kernel object.
unsigned int m_initialSeed
void setSeed(const G4Event *, bool checkForParameters=true)
set the seed function, called from other callbacks)
void callAtBegin(Q *p, void(T::*f)(const G4Event *))
Register begin-of-event callback.
virtual void showStatus() const
Should dump the current engine status on the screen.
static void decrement(T *)
Decrement count according to type information.
void beginEvent(const G4Event *)
begin-of-event callback: seeds based on pre-assigned Geant4 event ID
Mini interface to THE random generator of the application.
Geant4RunActionSequence & runAction() const
Access to the main run action sequence from the kernel object.
Namespace for the Geant4 based simulation part of the AIDA detector description toolkit.
Event extension to pass input event data to output event.
Concrete basic implementation of the Geant4 run action base class.
unsigned int hash(unsigned int initialSeed, unsigned int eventNumber, unsigned int runNumber)
calculate hash from initialSeed, eventID and runID
int eventNumber() const
Get the event number.
int runNumber() const
Get the run number.
Generic context to extend user, run and event information.
Geant4Context * context() const
Access the context.