|
DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Go to the documentation of this file.
13 #ifndef DDG4_GEANT4GENERATORACTION_H
14 #define DDG4_GEANT4GENERATORACTION_H
29 class Geant4GeneratorAction;
30 class Geant4SharedGeneratorAction;
31 class Geant4GeneratorActionSequence;
95 virtual void operator()(G4Event* event)
override;
136 template <
typename Q,
typename T>
137 void call(Q* p,
void (T::*f)(G4Event*)) {
149 #endif // DDG4_GEANT4GENERATORACTION_H
CallbackSequence m_calls
Callback sequence to generate primary particles.
Actors< Geant4GeneratorAction > m_actors
The list of action objects to be called.
virtual void operator()(G4Event *)
Callback to generate primary particles.
virtual ~Geant4GeneratorActionSequence()
Default destructor.
Geant4GeneratorAction(Geant4Context *context, const std::string &name)
Standard constructor.
void add(const Callback &cb, Location where)
Generically Add a new callback to the sequence depending on the location arguments.
virtual void configureFiber(Geant4Context *thread_context) override
Set or update client for the use in a new thread fiber.
Geant4GeneratorActionSequence(Geant4Context *context, const std::string &name)
Standard constructor.
Definition of an actor on sequences of callbacks.
Concrete implementation of the Geant4 generator action sequence.
void call(Q *p, void(T::*f)(G4Event *))
Register primary particle generation callback. Types Q and T must be polymorph!
Definition of the generic callback structure for member functions.
DDG4_DEFINE_ACTION_CONSTRUCTORS(Geant4GeneratorAction)
Define standard assignments and constructors.
Concrete implementation of the Geant4 generator action base class.
Geant4GeneratorAction * get(const std::string &name) const
Get an action by name.
Default base class for all Geant 4 actions and derivates thereof.
virtual void operator()(G4Event *event)
Callback to generate primary particles.
const std::string & name() const
Access name of the action.
Geant4GeneratorAction * m_action
Reference to the shared action.
virtual void configureFiber(Geant4Context *thread_context) override
Set or update client for the use in a new thread fiber.
DDG4_DEFINE_ACTION_CONSTRUCTORS(Geant4GeneratorActionSequence)
Define standard assignments and constructors.
virtual ~Geant4GeneratorAction()
Default destructor.
Namespace for the AIDA detector description toolkit.
virtual ~Geant4SharedGeneratorAction()
Default destructor.
virtual void use(Geant4GeneratorAction *action)
Underlying object to be used during the execution of this thread.
Geant4SharedGeneratorAction(Geant4Context *context, const std::string &nam)
Standard constructor.
virtual void updateContext(Geant4Context *ctxt) override
Set or update client context.
Implementation of the Geant4 shared generator action.
Geant4SharedGeneratorAction shared_type
virtual void operator()(G4Event *event) override
User generator callback.
Generic context to extend user, run and event information.
void adopt(Geant4GeneratorAction *action)
Add an actor responding to all callbacks. Sequence takes ownership.
Geant4Context * context() const
Access the context.
DDG4_DEFINE_ACTION_CONSTRUCTORS(Geant4SharedGeneratorAction)
Define standard assignments and constructors.