19 #include "G4Threading.hh"
20 #include "G4AutoLock.hh"
25 using namespace DD4hep::Simulation;
27 G4Mutex action_mutex=G4MUTEX_INITIALIZER;
31 Geant4SteppingAction::Geant4SteppingAction(
Geant4Context* ctxt,
const string& nam)
66 throw runtime_error(
"Geant4SharedSteppingAction: Attempt to use invalid actor!");
77 G4AutoLock protection_lock(&action_mutex); {
117 m_actors(&Geant4SteppingAction::operator(), step, mgr);
124 G4AutoLock protection_lock(&action_mutex);
129 throw runtime_error(
"Geant4SteppingActionSequence: Attempt to add invalid actor!");
Functor to access elements by name.
long release()
Decrease reference count. Implicit destruction.
Geant4SharedSteppingAction(const Geant4SteppingAction ©)=delete
Inhibit copy constructor.
virtual ~Geant4SteppingAction()
Default destructor.
static void decrement(T *)
Decrement count according to type information.
virtual ~Geant4SharedSteppingAction()
Default destructor.
void adopt(const PropertyManager ©)
Export properties of another instance.
CallbackSequence m_calls
Callback sequence for user stepping action calls.
virtual void updateContext(Geant4Context *ctxt)
Set or update client context.
Geant4Context * context() const
Access the context.
Geant4Context * m_context
Reference to the Geant4 context.
Concrete implementation of the Geant4 stepping action sequence.
void releasePtr(T &p)
Helper to delete objects from heap and reset the pointer. Saves many many lines of code...
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.
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.
long addRef()
Increase reference count.
void clear()
Clear the sequence and remove all callbacks.
Geant4SteppingAction * get(const std::string &name) const
Get an action by name.
virtual ~Geant4SteppingActionSequence()
Default destructor.
virtual void operator()(const G4Step *step, G4SteppingManager *mgr)
User stepping callback.
void adopt(Geant4SteppingAction *action)
Add an actor responding to all callbacks. Sequence takes ownership.
Geant4SteppingActionSequence(const Geant4SteppingAction ©)=delete
Inhibit copy constructor.
Geant4SteppingAction * 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.
virtual void use(Geant4SteppingAction *action)
Underlying object to be used during the execution of this thread.
Functor to update the context of a Geant4Action object.
static TypeName split(const std::string &type_name)
Split string pair according to default delimiter ('/')
Actors< Geant4SteppingAction > m_actors
The list of action objects to be called.
Generic context to extend user, run and event information.
PropertyManager m_properties
Property pool.
virtual void operator()(const G4Step *step, G4SteppingManager *mgr)
User stepping callback.
static const double second
Default base class for all Geant 4 actions and derivates thereof.
virtual void operator()(const G4Step *step, G4SteppingManager *mgr)
User stepping callback.