19 #include "G4Threading.hh"
20 #include "G4AutoLock.hh"
25 using namespace DD4hep::Simulation;
28 G4Mutex event_action_mutex=G4MUTEX_INITIALIZER;
32 Geant4EventAction::Geant4EventAction(
Geant4Context* ctxt,
const string& nam)
77 throw runtime_error(
"Geant4SharedEventAction: Attempt to use invalid actor!");
83 G4AutoLock protection_lock(&event_action_mutex); {
93 G4AutoLock protection_lock(&event_action_mutex); {
136 G4AutoLock protection_lock(&event_action_mutex);
141 throw runtime_error(
"Geant4EventActionSequence: Attempt to add invalid actor!");
Functor to access elements by name.
virtual void configureFiber(Geant4Context *thread_context)
Set or update client for the use in a new thread fiber.
long release()
Decrease reference count. Implicit destruction.
Geant4SharedEventAction()=default
Inhibit copy constructor.
virtual ~Geant4EventActionSequence()
Default destructor.
virtual void end(const G4Event *event)
End-of-event callback.
Geant4EventActionSequence()=default
Inhibit copy constructor.
static void decrement(T *)
Decrement count according to type information.
void adopt(const PropertyManager ©)
Export properties of another instance.
virtual void end(const G4Event *event)
End-of-event callback.
virtual ~Geant4SharedEventAction()
Default destructor.
virtual void updateContext(Geant4Context *ctxt)
Set or update client context.
Concrete basic implementation of the Geant4 event action.
Geant4Context * context() const
Access the context.
Geant4Context * m_context
Reference to the Geant4 context.
void releasePtr(T &p)
Helper to delete objects from heap and reset the pointer. Saves many many lines of code...
CallbackSequence m_end
Callback sequence for event finalization action.
void adopt(Geant4EventAction *action)
Add an actor responding to all callbacks. Sequence takes ownership.
PropertyManager & properties()
Access to the properties of the object.
virtual void configureFiber(Geant4Context *thread_context)
Set or update client for the use in a new thread fiber.
Geant4EventAction * m_action
Reference to the shared action.
long addRef()
Increase reference count.
void clear()
Clear the sequence and remove all callbacks.
CallbackSequence m_begin
Callback sequence for event initialization action.
virtual void end(const G4Event *event)
End-of-event callback.
Geant4EventAction * get(const std::string &name) const
Get an action by name.
virtual void begin(const G4Event *event)
Begin-of-event callback.
bool m_needsControl
Default property: Flag to create control instance.
virtual void configureFiber(Geant4Context *thread_context)
Set or update client for the use in a new thread fiber.
static void increment(T *)
Increment count according to type information.
virtual ~Geant4EventAction()
Default destructor.
Functor to update the context of a Geant4Action object.
static TypeName split(const std::string &type_name)
Split string pair according to default delimiter ('/')
Generic context to extend user, run and event information.
PropertyManager m_properties
Property pool.
static const double second
virtual void use(Geant4EventAction *action)
Underlying object to be used during the execution of this thread.
Default base class for all Geant 4 actions and derivates thereof.
CallbackSequence m_final
Callback sequence for event finalization action.
virtual void begin(const G4Event *event)
Begin-of-event callback.
virtual void begin(const G4Event *event)
Begin-of-event callback.
Actors< Geant4EventAction > m_actors
The list of action objects to be called.