|
DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Go to the documentation of this file.
22 #include <G4Threading.hh>
23 #include <G4AutoLock.hh>
24 #include <G4TrackingManager.hh>
25 #include <G4VUserTrackInformation.hh>
30 class G4TouchableHistory;
32 G4Mutex action_mutex=G4MUTEX_INITIALIZER;
72 G4AutoLock protection_lock(&action_mutex);
77 throw std::runtime_error(
"Geant4TrackingActionSequence: Attempt to add invalid actor!");
116 if ( truth ) truth->
mark(track,
true);
145 except(
"Attempt to use invalid actor!");
151 G4AutoLock protection_lock(&action_mutex); {
161 G4AutoLock protection_lock(&action_mutex); {
Geant4TrackingAction * m_action
Reference to the shared action.
bool m_needsControl
Default property: Flag to create control instance.
virtual void end(const G4Track *track)
Post-tracking action callback.
void adopt(Geant4TrackingAction *action)
Add an actor responding to all callbacks. Sequence takes ownership.
virtual void configureFiber(Geant4Context *thread_context)
Set or update client for the use in a new thread fiber.
virtual void begin(const G4Track *track)
Pre-track action callback.
Functor to access elements by name.
Geant4Context * m_context
Reference to the Geant4 context.
static void increment(T *)
Increment count according to type information.
Geant4Event & event() const
Access the geant4 event – valid only between BeginEvent() and EndEvent()!
virtual void begin(const G4Track *track)
Pre-tracking action callback.
Functor to update the context of a Geant4Action object.
PropertyManager m_properties
Property pool.
Geant4TrackingAction * get(const std::string &name) const
Get an action by name.
virtual void end(const G4Track *track)
Post-track action callback.
T * extension(bool alert=true)
Access to type safe extension object. Exception is thrown if the object is invalid.
void except(const char *fmt,...) const
Support of exceptions: Print fatal message and throw runtime_error.
virtual void configureFiber(Geant4Context *thread_context) override
Set or update client for the use in a new thread fiber.
virtual void end(const G4Track *track) override
End-of-track callback.
void adopt(const PropertyManager ©)
Import properties of another instance.
Geant4TrackingAction(Geant4Context *context, const std::string &name="")
Standard constructor.
virtual ~Geant4SharedTrackingAction()
Default destructor.
Geant4SharedTrackingAction(Geant4Context *context, const std::string &nam)
Standard constructor.
static void decrement(T *)
Decrement count according to type information.
Default Interface class to handle monte carlo truth records.
virtual void use(Geant4TrackingAction *action)
Underlying object to be used during the execution of this thread.
Default base class for all Geant 4 actions and derivates thereof.
long release()
Decrease reference count. Implicit destruction.
virtual ~Geant4TrackingAction()
Default destructor.
void clear()
Clear the sequence and remove all callbacks.
static TypeName split(const std::string &type_name)
Split string pair according to default delimiter ('/')
PropertyManager & properties()
Access to the properties of the object.
virtual void configureFiber(Geant4Context *thread_context) override
Set or update client for the use in a new thread fiber.
virtual ~Geant4TrackingActionSequence()
Default destructor.
long addRef()
Increase reference count.
virtual void begin(const G4Track *track) override
Begin-of-track callback.
Namespace for the Geant4 based simulation part of the AIDA detector description toolkit.
Default base class for all geant 4 tracking actions used in DDG4.
CallbackSequence m_begin
Callback sequence for pre tracking action.
CallbackSequence m_front
Callback sequence for pre tracking action.
CallbackSequence m_end
Callback sequence for post tracking action.
Actors< Geant4TrackingAction > m_actors
The list of action objects to be called.
CallbackSequence m_final
Callback sequence for pre tracking action.
Geant4TrackingActionSequence(Geant4Context *context, const std::string &name)
Standard constructor.
virtual void updateContext(Geant4Context *ctxt) override
Set or update client context.
virtual void mark(const G4Track *track)=0
Mark a Geant4 track to be kept for later MC truth analysis.
Generic context to extend user, run and event information.
Geant4Context * context() const
Access the context.
void mark(const G4Track *track) const
Mark the track to be kept for MC truth propagation.