19 #include "G4Threading.hh"
20 #include "G4AutoLock.hh"
26 using namespace DD4hep::Simulation;
28 G4Mutex action_mutex=G4MUTEX_INITIALIZER;
32 Geant4StackingAction::Geant4StackingAction(
Geant4Context* ctxt,
const string& nam)
68 throw runtime_error(
"Geant4SharedStackingAction: Attempt to use invalid actor!");
74 G4AutoLock protection_lock(&action_mutex); {
84 G4AutoLock protection_lock(&action_mutex); {
114 throw runtime_error(
"Geant4StackingActionSequence: Attempt to add invalid actor!");
Functor to access elements by name.
virtual void prepare()
Preparation callback.
virtual void prepare()
Preparation callback.
long release()
Decrease reference count. Implicit destruction.
virtual void prepare()
Preparation callback.
virtual void configureFiber(Geant4Context *thread_context)
Set or update client for the use in a new thread fiber.
virtual void configureFiber(Geant4Context *thread_context)
Set or update client for the use in a new thread fiber.
CallbackSequence m_newStage
Callback sequence for the newStage call.
static void decrement(T *)
Decrement count according to type information.
virtual void newStage()
New-stage callback.
void adopt(const PropertyManager ©)
Export properties of another instance.
Concrete implementation of the Geant4 stacking action base class.
Geant4SharedStackingAction(Geant4Context *context, const std::string &nam)
Standard constructor.
virtual void use(Geant4StackingAction *action)
Underlying object to be used during the execution of this thread.
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_prepare
PropertyManager & properties()
Access to the properties of the object.
Geant4StackingActionSequence(Geant4Context *ctxt, const std::string &name)
Standard constructor.
virtual void configureFiber(Geant4Context *thread_context)
Set or update client for the use in a new thread fiber.
Actors< Geant4StackingAction > m_actors
The list of action objects to be called.
long addRef()
Increase reference count.
void clear()
Clear the sequence and remove all callbacks.
virtual void newStage()
New-stage callback.
Geant4StackingAction * m_action
Reference to the shared action.
bool m_needsControl
Default property: Flag to create control instance.
static void increment(T *)
Increment count according to type information.
Functor to update the context of a Geant4Action object.
static TypeName split(const std::string &type_name)
Split string pair according to default delimiter ('/')
Geant4StackingAction * get(const std::string &name) const
Get an action by name.
Generic context to extend user, run and event information.
PropertyManager m_properties
Property pool.
virtual ~Geant4StackingActionSequence()
Default destructor.
static const double second
virtual void updateContext(Geant4Context *ctxt)
Set or update client context.
virtual ~Geant4SharedStackingAction()
Default destructor.
virtual void newStage()
New-stage callback.
void adopt(Geant4StackingAction *action)
Add an actor responding to all callbacks. Sequence takes ownership.
Default base class for all Geant 4 actions and derivates thereof.
virtual ~Geant4StackingAction()
Default destructor.