6#include "GaudiKernel/ISvcLocator.h"
7#include "GaudiKernel/DataSvc.h"
8#include "GaudiKernel/Incident.h"
10#include "CLHEP/Random/RandomEngine.h"
30 return StatusCode::SUCCESS;
35 const EventContext& ctx)
const
38 std::string rngName = name()+streamName;
39 rngWrapper->
setSeed( rngName, ctx );
45 const EventContext& ctx)
const
48 rngWrapper->
setSeed( streamName, ctx.slot(), randomSeedOffset, ctx.eventID().run_number() );
58 ctx.setEventID (EventIDBase (conditionsRun,
59 EventIDBase::UNDEFEVT,
60 EventIDBase::UNDEFNUM,
61 EventIDBase::UNDEFNUM,
97 if (
m_isAfterburner.value() || name() ==
"Tauola" || name() ==
"Photos") {
101 events()->push_back(evt);
105 if (name() ==
"ParticleDecayer") {
106 events()->pop_back();
111 m_incidentSvc->fireIncident( Incident(name(),
"McEventGenerated") );
112 return StatusCode::SUCCESS;
#define CHECK(...)
Evaluate an expression and check for errors.
A wrapper class for event-slot-local random engines.
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
ServiceHandle< StoreGateSvc > & evtStore()
virtual StatusCode initialize() override
GenBase(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
BooleanProperty m_mkMcEvent
Flag to determine if a new MC event collection should be made if it doesn't exist.
ServiceHandle< IIncidentSvc > m_incidentSvc
Handle on the incident service.
virtual StatusCode callGenerator()
For calling the generator on each iteration of the event loop.
GenModule(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
virtual StatusCode fillEvt(HepMC::GenEvent *evt)=0
For filling the HepMC event object.
ServiceHandle< IAthRNGSvc > m_rndmSvc
Data members.
CLHEP::HepRandomEngine * getRandomEngine(const std::string &streamName, const EventContext &ctx) const
CLHEP::HepRandomEngine * getRandomEngineDuringInitialize(const std::string &streamName, unsigned long int randomSeedOffset, unsigned int conditionsRun=1, unsigned int lbn=1) const
virtual StatusCode genuserInitialize()
For initialization of user code, if required. Called after genInitialize.
virtual StatusCode genInitialize()
For initializing the generator, if required.
BooleanProperty m_isAfterburner
Flag for normal vs. afterburner generators.
void setExtendedEventContext(EventContext &ctx, ExtendedEventContext &&ectx)
Move an extended context into a context object.
void fillBarcodesAttribute(GenEvent *)
GenEvent * newGenEvent(const int a, const int b)