14 #ifndef DD4HEP_DDG4_GEANT4TRACKINGACTION_H
15 #define DD4HEP_DDG4_GEANT4TRACKINGACTION_H
19 #include "G4VUserTrackInformation.hh"
21 class G4TrackingManager;
28 namespace Simulation {
31 class Geant4TrackInformation;
32 class Geant4TrackingAction;
33 class Geant4SharedTrackingAction;
34 class Geant4TrackingActionSequence;
57 void mark(
const G4Track* track)
const;
59 virtual void begin(
const G4Track* track);
61 virtual void end(
const G4Track* track);
93 virtual void begin(
const G4Track* track);
95 virtual void end(
const G4Track* track);
139 template <
typename Q,
typename T>
145 template <
typename Q,
typename T>
151 template <
typename Q,
typename T>
157 template <
typename Q,
typename T>
165 virtual void begin(
const G4Track* track);
167 virtual void end(
const G4Track* track);
172 #endif // DD4HEP_DDG4_GEANT4TRACKINGACTION_H
CallbackSequence m_front
Callback sequence for pre tracking action.
virtual void use(Geant4TrackingAction *action)
Underlying object to be used during the execution of this thread.
void callAtEnd(Q *p, void(T::*f)(const G4Track *), CallbackSequence::Location where=CallbackSequence::END)
Register Post-track action callback.
Geant4SharedTrackingAction shared_type
G4TrackingManager * trackMgr() const
Access the Geant4 tracking manager. Only use between tracking pre- and post action.
G4TrackingManager * trackMgr() const
Access the tracking manager.
Geant4TrackingAction * m_action
Reference to the shared action.
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.
void callAtBegin(Q *p, void(T::*f)(const G4Track *), CallbackSequence::Location where=CallbackSequence::END)
Register Pre-track action callback.
Default base class for all geant 4 tracking actions used in DDG4.
virtual void configureFiber(Geant4Context *thread_context)
Set or update client for the use in a new thread fiber.
virtual void end(const G4Track *track)
Post-tracking action callback.
void add(const Callback &cb, Location where)
Generically Add a new callback to the sequence depending on the location arguments.
void mark(const G4Track *track) const
Mark the track to be kept for MC truth propagation.
Actors< Geant4TrackingAction > m_actors
The list of action objects to be called.
Definition of an actor on sequences of callbacks.
Geant4Context * context() const
Access the context.
CallbackSequence m_final
Callback sequence for pre tracking action.
Concrete implementation of the Geant4 tracking action sequence.
const std::string & name() const
Access name of the action.
virtual void begin(const G4Track *track)
Pre-track action callback.
Geant4Context * m_context
Reference to the Geant4 context.
virtual void end(const G4Track *track)
End-of-track callback.
virtual ~Geant4TrackingActionSequence()
Default destructor.
CallbackSequence m_end
Callback sequence for post tracking action.
CallbackSequence m_begin
Callback sequence for pre tracking action.
void callUpFront(Q *p, void(T::*f)(const G4Track *), CallbackSequence::Location where=CallbackSequence::END)
Register Pre-track action callback before anything else.
void callAtFinal(Q *p, void(T::*f)(const G4Track *), CallbackSequence::Location where=CallbackSequence::END)
Register Post-track action callback.
Geant4TrackingActionSequence(const Geant4TrackingAction ©)=delete
Inhibit copy constructor.
Geant4SharedTrackingAction(const Geant4TrackingAction ©)=delete
Inhibit copy constructor.
virtual void updateContext(Geant4Context *ctxt)
Set or update client context.
Generic context to extend user, run and event information.
Implementation of the Geant4 shared track action.
virtual void begin(const G4Track *track)
Begin-of-track callback.
virtual void end(const G4Track *track)
Post-track action callback.
virtual ~Geant4TrackingAction()
Default destructor.
Geant4TrackingAction(const Geant4TrackingAction ©)=delete
Inhibit copy constructor.
virtual ~Geant4SharedTrackingAction()
Default destructor.
Default base class for all Geant 4 actions and derivates thereof.
virtual void begin(const G4Track *track)
Pre-tracking action callback.
Actor class to manipulate action groups.