DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Public Types | Public Member Functions | Protected Attributes | List of all members
dd4hep::sim::Geant4ActionPhase Class Reference

Action phase definition. Client callback at various stage of the simulation processing. More...

#include <Geant4ActionPhase.h>

Inheritance diagram for dd4hep::sim::Geant4ActionPhase:
dd4hep::sim::Geant4Action

Public Types

typedef std::vector< std::pair< Geant4Action *, Callback > > Members
 

Public Member Functions

 Geant4ActionPhase (Geant4Context *context, const std::string &name, const std::type_info &arg_type0, const std::type_info &arg_type1, const std::type_info &arg_type2)
 Standard constructor. More...
 
virtual ~Geant4ActionPhase ()
 Default destructor. More...
 
const Membersmembers () const
 Access phase members. More...
 
const std::type_info *const * argTypes () const
 Type of the first phase callback-argument. More...
 
void execute (void *argument)
 Execute all members in the phase context. More...
 
virtual bool add (Geant4Action *action, Callback callback)
 Add a new member to the phase. More...
 
virtual bool remove (Geant4Action *action, Callback callback)
 Remove an existing member from the phase. If not existing returns false. More...
 
template<typename TYPE , typename IF_TYPE , typename A0 , typename R >
bool add (TYPE *member, R(IF_TYPE::*callback)(A0 arg))
 Add a new member to the phase. More...
 
template<typename TYPE , typename IF_TYPE , typename A0 , typename A1 , typename R >
bool add (TYPE *member, R(IF_TYPE::*callback)(A0 arg0, A1 arg1))
 Add a new member to the phase. More...
 
template<typename TYPE , typename IF_TYPE , typename A0 , typename A1 , typename A2 , typename R >
bool add (TYPE *member, R(IF_TYPE::*callback)(A0 arg0, A1 arg1))
 Add a new member to the phase. More...
 
template<typename TYPE , typename PMF >
bool remove (TYPE *member)
 Remove all member callbacks from the phase. If not existing returns false. More...
 
template<typename TYPE , typename PMF >
bool remove (TYPE *member, PMF callback)
 Remove an existing member callback from the phase. If not existing returns false. More...
 
void call ()
 Create action to execute phase members. More...
 
template<typename A0 >
void call (A0 a0)
 
template<typename A0 , typename A1 >
void call (A0 a0, A1 a1)
 
template<typename A0 , typename A1 , typename A2 >
void call (A0 a0, A1 a1, A2 a2)
 
template<>
void call (G4StackManager *stackManager)
 Callback in Begin stacking action. More...
 
template<>
void call (const G4Run *run)
 Callback in BeginRun/EndRun. More...
 
template<>
void call (G4Event *event)
 Callback in prepare primaries. More...
 
template<>
void call (const G4Event *event)
 Callback in BeginEvent/EndEvent. More...
 
template<>
void call (const G4Track *track)
 Callback in Begin/End tracking action. More...
 
template<>
void call (const G4Step *step)
 Callback in Begin/End stepping action. More...
 
template<>
void call (const G4Step *step, G4SteppingManager *mgr)
 Callback for user stepping action. More...
 
template<>
void call (G4HCofThisEvent *hce)
 Callback for sensitives begin/end/clear. More...
 
template<>
void call (G4Step *step, G4TouchableHistory *history)
 Callback for sensitives. More...
 
- Public Member Functions inherited from dd4hep::sim::Geant4Action
 Geant4Action (Geant4Context *context, const std::string &nam)
 Standard constructor. More...
 
long addRef ()
 Increase reference count. More...
 
long release ()
 Decrease reference count. Implicit destruction. More...
 
Geant4Contextcontext () const
 Access the context. More...
 
virtual void updateContext (Geant4Context *ctxt)
 Set or update client context. More...
 
virtual void configureFiber (Geant4Context *thread_context)
 Set or update client for the use in a new thread fiber. More...
 
const std::string & name () const
 Access name of the action. More...
 
const char * c_name () const
 Access name of the action. More...
 
void setName (const std::string &new_name)
 Set the object name. More...
 
PropertyManagerproperties ()
 Access to the properties of the object. More...
 
PrintLevel outputLevel () const
 Access the output level. More...
 
PrintLevel setOutputLevel (PrintLevel new_level)
 Set the output level; returns previous value. More...
 
Geant4UIMessengercontrol () const
 Access to the UI messenger. More...
 
virtual void enableUI ()
 Enable and install UI messenger. More...
 
template<typename T >
Geant4ActiondeclareProperty (const std::string &nam, T &val)
 Declare property. More...
 
template<typename T >
Geant4ActiondeclareProperty (const char *nam, T &val)
 Declare property. More...
 
bool hasProperty (const std::string &name) const
 Check property for existence. More...
 
Propertyproperty (const std::string &name)
 Access single property. More...
 
virtual void installMessengers ()
 Install property control messenger if wanted. More...
 
virtual void installCommandMessenger ()
 Install command control messenger if wanted. More...
 
virtual void installPropertyMessenger ()
 Install property control messenger if wanted. More...
 
void print (const char *fmt,...) const
 Support for messages with variable output level using output level. More...
 
void printM1 (const char *fmt,...) const
 Support for messages with variable output level using output level-1. More...
 
void printM2 (const char *fmt,...) const
 Support for messages with variable output level using output level-2. More...
 
void printP1 (const char *fmt,...) const
 Support for messages with variable output level using output level+1. More...
 
void printP2 (const char *fmt,...) const
 Support for messages with variable output level using output level+2. More...
 
void always (const char *fmt,...) const
 Support of always printed messages. More...
 
void debug (const char *fmt,...) const
 Support of debug messages. More...
 
void info (const char *fmt,...) const
 Support of info messages. More...
 
void warning (const char *fmt,...) const
 Support of warning messages. More...
 
void error (const char *fmt,...) const
 Support of error messages. More...
 
bool return_error (bool return_value, const char *fmt,...) const
 Action to support error messages. More...
 
void fatal (const char *fmt,...) const
 Support of fatal messages. Throws exception. More...
 
void except (const char *fmt,...) const
 Support of exceptions: Print fatal message and throw runtime_error. More...
 
void abortRun (const std::string &exception, const char *fmt,...) const
 Abort Geant4 Run by throwing a G4Exception with type RunMustBeAborted. More...
 
Geant4RunActionSequencerunAction () const
 Access to the main run action sequence from the kernel object. More...
 
Geant4EventActionSequenceeventAction () const
 Access to the main event action sequence from the kernel object. More...
 
Geant4SteppingActionSequencesteppingAction () const
 Access to the main stepping action sequence from the kernel object. More...
 
Geant4TrackingActionSequencetrackingAction () const
 Access to the main tracking action sequence from the kernel object. More...
 
Geant4StackingActionSequencestackingAction () const
 Access to the main stacking action sequence from the kernel object. More...
 
Geant4GeneratorActionSequencegeneratorAction () const
 Access to the main generator action sequence from the kernel object. More...
 

Protected Attributes

Members m_members { }
 Phase members (actions) being called for a particular phase. More...
 
const std::type_info * m_argTypes [3] = { nullptr, nullptr, nullptr }
 Type information of the argument type of the callback. More...
 
- Protected Attributes inherited from dd4hep::sim::Geant4Action
Geant4Contextm_context { nullptr }
 Reference to the Geant4 context. More...
 
Geant4UIMessengerm_control { nullptr }
 Control directory of this action. More...
 
int m_outputLevel { 3 }
 Default property: Output level. More...
 
bool m_needsControl { false }
 Default property: Flag to create control instance. More...
 
std::string m_name { }
 Action name. More...
 
PropertyManager m_properties { }
 Property pool. More...
 
long m_refCount { 1 }
 Reference count. Initial value: 1. More...
 

Additional Inherited Members

- Protected Member Functions inherited from dd4hep::sim::Geant4Action
 DDG4_DEFINE_ACTION_CONSTRUCTORS (Geant4Action)
 Define standard assignments and constructors. More...
 
virtual ~Geant4Action ()
 Default destructor. More...
 

Detailed Description

Action phase definition. Client callback at various stage of the simulation processing.

Author
M.Frank
Version
1.0

Definition at line 68 of file Geant4ActionPhase.h.

Member Typedef Documentation

◆ Members

Definition at line 70 of file Geant4ActionPhase.h.

Constructor & Destructor Documentation

◆ Geant4ActionPhase()

Geant4ActionPhase::Geant4ActionPhase ( Geant4Context context,
const std::string &  name,
const std::type_info &  arg_type0,
const std::type_info &  arg_type1,
const std::type_info &  arg_type2 
)

Standard constructor.

Definition at line 39 of file Geant4ActionPhase.cpp.

◆ ~Geant4ActionPhase()

Geant4ActionPhase::~Geant4ActionPhase ( )
virtual

Default destructor.

Definition at line 49 of file Geant4ActionPhase.cpp.

Member Function Documentation

◆ add() [1/4]

bool Geant4ActionPhase::add ( Geant4Action action,
Callback  callback 
)
virtual

Add a new member to the phase.

Definition at line 57 of file Geant4ActionPhase.cpp.

◆ add() [2/4]

template<typename TYPE , typename IF_TYPE , typename A0 , typename R >
bool dd4hep::sim::Geant4ActionPhase::add ( TYPE *  member,
R(IF_TYPE::*)(A0 arg)  callback 
)
inline

Add a new member to the phase.

Definition at line 99 of file Geant4ActionPhase.h.

◆ add() [3/4]

template<typename TYPE , typename IF_TYPE , typename A0 , typename A1 , typename R >
bool dd4hep::sim::Geant4ActionPhase::add ( TYPE *  member,
R(IF_TYPE::*)(A0 arg0, A1 arg1)  callback 
)
inline

Add a new member to the phase.

Definition at line 108 of file Geant4ActionPhase.h.

◆ add() [4/4]

template<typename TYPE , typename IF_TYPE , typename A0 , typename A1 , typename A2 , typename R >
bool dd4hep::sim::Geant4ActionPhase::add ( TYPE *  member,
R(IF_TYPE::*)(A0 arg0, A1 arg1)  callback 
)
inline

Add a new member to the phase.

Definition at line 118 of file Geant4ActionPhase.h.

◆ argTypes()

const std::type_info* const* dd4hep::sim::Geant4ActionPhase::argTypes ( ) const
inline

Type of the first phase callback-argument.

Definition at line 88 of file Geant4ActionPhase.h.

◆ call() [1/13]

void dd4hep::sim::Geant4ActionPhase::call ( )

Create action to execute phase members.

Callback in Begin stacking action.

Definition at line 103 of file Geant4ActionPhase.cpp.

◆ call() [2/13]

template<typename A0 >
void dd4hep::sim::Geant4ActionPhase::call ( A0  a0)

◆ call() [3/13]

template<typename A0 , typename A1 >
void dd4hep::sim::Geant4ActionPhase::call ( A0  a0,
A1  a1 
)

◆ call() [4/13]

template<typename A0 , typename A1 , typename A2 >
void dd4hep::sim::Geant4ActionPhase::call ( A0  a0,
A1  a1,
A2  a2 
)

◆ call() [5/13]

template<>
void dd4hep::sim::Geant4ActionPhase::call ( const G4Event *  event)

Callback in BeginEvent/EndEvent.

Definition at line 119 of file Geant4ActionPhase.cpp.

◆ call() [6/13]

template<>
void dd4hep::sim::Geant4ActionPhase::call ( const G4Run *  run)

Callback in BeginRun/EndRun.

Definition at line 111 of file Geant4ActionPhase.cpp.

◆ call() [7/13]

template<>
void dd4hep::sim::Geant4ActionPhase::call ( const G4Step *  step)

Callback in Begin/End stepping action.

Definition at line 127 of file Geant4ActionPhase.cpp.

◆ call() [8/13]

template<>
void dd4hep::sim::Geant4ActionPhase::call ( const G4Step *  step,
G4SteppingManager *  mgr 
)

Callback for user stepping action.

Definition at line 131 of file Geant4ActionPhase.cpp.

◆ call() [9/13]

template<>
void dd4hep::sim::Geant4ActionPhase::call ( const G4Track *  track)

Callback in Begin/End tracking action.

Definition at line 123 of file Geant4ActionPhase.cpp.

◆ call() [10/13]

template<>
void dd4hep::sim::Geant4ActionPhase::call ( G4Event *  event)

Callback in prepare primaries.

Definition at line 115 of file Geant4ActionPhase.cpp.

◆ call() [11/13]

template<>
void dd4hep::sim::Geant4ActionPhase::call ( G4HCofThisEvent *  hce)

Callback for sensitives begin/end/clear.

Definition at line 136 of file Geant4ActionPhase.cpp.

◆ call() [12/13]

template<>
void dd4hep::sim::Geant4ActionPhase::call ( G4StackManager *  stackManager)

Callback in Begin stacking action.

Definition at line 107 of file Geant4ActionPhase.cpp.

◆ call() [13/13]

template<>
void dd4hep::sim::Geant4ActionPhase::call ( G4Step *  step,
G4TouchableHistory *  history 
)

Callback for sensitives.

Definition at line 140 of file Geant4ActionPhase.cpp.

◆ execute()

void Geant4ActionPhase::execute ( void *  argument)

Execute all members in the phase context.

Definition at line 86 of file Geant4ActionPhase.cpp.

◆ members()

const Members& dd4hep::sim::Geant4ActionPhase::members ( ) const
inline

Access phase members.

Definition at line 84 of file Geant4ActionPhase.h.

◆ remove() [1/3]

bool Geant4ActionPhase::remove ( Geant4Action action,
Callback  callback 
)
virtual

Remove an existing member from the phase. If not existing returns false.

Definition at line 64 of file Geant4ActionPhase.cpp.

◆ remove() [2/3]

template<typename TYPE , typename PMF >
bool dd4hep::sim::Geant4ActionPhase::remove ( TYPE *  member)
inline

Remove all member callbacks from the phase. If not existing returns false.

Definition at line 129 of file Geant4ActionPhase.h.

◆ remove() [3/3]

template<typename TYPE , typename PMF >
bool dd4hep::sim::Geant4ActionPhase::remove ( TYPE *  member,
PMF  callback 
)
inline

Remove an existing member callback from the phase. If not existing returns false.

Definition at line 133 of file Geant4ActionPhase.h.

Member Data Documentation

◆ m_argTypes

const std::type_info* dd4hep::sim::Geant4ActionPhase::m_argTypes[3] = { nullptr, nullptr, nullptr }
protected

Type information of the argument type of the callback.

Definition at line 75 of file Geant4ActionPhase.h.

◆ m_members

Members dd4hep::sim::Geant4ActionPhase::m_members { }
protected

Phase members (actions) being called for a particular phase.

Definition at line 73 of file Geant4ActionPhase.h.


The documentation for this class was generated from the following files: