14 #ifndef DD4HEP_DDG4_GEANT4RUNACTION_H
15 #define DD4HEP_DDG4_GEANT4RUNACTION_H
27 namespace Simulation {
30 class Geant4RunAction;
31 class Geant4SharedRunAction;
32 class Geant4RunActionSequence;
63 virtual void begin(
const G4Run* run);
65 virtual void end(
const G4Run* run);
105 virtual void begin(
const G4Run* run);
107 virtual void end(
const G4Run* run);
155 template <
typename Q,
typename T>
160 template <
typename Q,
typename T>
167 virtual void begin(
const G4Run* run);
169 virtual void end(
const G4Run* run);
175 #endif // DD4HEP_DDG4_GEANT4RUNACTION_H
virtual ~Geant4SharedRunAction()
Default destructor.
Geant4RunAction & operator=(const Geant4RunAction ©)=delete
Inhibit assignment operator.
Geant4SharedRunAction()=default
Inhibit default constructor.
virtual void end(const G4Run *run)
End-of-run callback.
virtual void configureFiber(Geant4Context *thread_context)
Set or update client for the use in a new thread fiber.
void callAtEnd(Q *p, void(T::*f)(const G4Run *))
Register end-of-run callback. Types Q and T must be polymorph!
Geant4SharedRunAction shared_type
void add(const Callback &cb, Location where)
Generically Add a new callback to the sequence depending on the location arguments.
Concrete basic implementation of the Geant4 run action base class.
Definition of an actor on sequences of callbacks.
Geant4Context * context() const
Access the context.
virtual void begin(const G4Run *run)
Begin-of-run callback.
const std::string & name() const
Access name of the action.
virtual void updateContext(Geant4Context *ctxt)
Set or update client context.
virtual void configureFiber(Geant4Context *thread_context)
Set or update client for the use in a new thread fiber.
Geant4RunAction()=default
Inhibit default constructor.
CallbackSequence m_begin
Callback sequence for begin-run action.
virtual ~Geant4RunAction()
Default destructor.
void callAtBegin(Q *p, void(T::*f)(const G4Run *))
Register begin-of-run callback. Types Q and T must be polymorph!
virtual void use(Geant4RunAction *action)
Underlying object to be used during the execution of this thread.
Implementation of the Geant4 shared run action.
virtual ~Geant4RunActionSequence()
Default destructor.
Actors< Geant4RunAction > m_actors
The list of action objects to be called.
Concrete basic implementation of the Geant4 run action sequencer.
virtual void end(const G4Run *run)
End-of-run callback.
CallbackSequence m_end
Callback sequence for end-run action.
Geant4RunAction * m_action
Reference to the shared action.
Geant4SharedRunAction & operator=(const Geant4SharedRunAction ©)=delete
Inhibit assignment operator.
virtual void end(const G4Run *run)
End-of-run callback.
Generic context to extend user, run and event information.
void adopt(Geant4RunAction *action)
Add an actor responding to all callbacks. Sequence takes ownership.
Geant4RunActionSequence & operator=(const Geant4RunActionSequence ©)=delete
Inhibit assignment operator.
Geant4RunActionSequence()=default
Inhibit default constructor.
Default base class for all Geant 4 actions and derivates thereof.
virtual void begin(const G4Run *run)
Begin-of-run callback.
virtual void begin(const G4Run *run)
Begin-of-run callback.