DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Geant4Action to collect the MC particle information. More...
#include <Geant4ParticleHandler.h>
Public Types | |
typedef Geant4ParticleMap::Particle | Particle |
typedef Geant4ParticleMap::ParticleMap | ParticleMap |
typedef Geant4ParticleMap::TrackEquivalents | TrackEquivalents |
typedef std::vector< std::string > | Processes |
Public Types inherited from dd4hep::sim::Geant4GeneratorAction | |
typedef Geant4SharedGeneratorAction | shared_type |
Public Member Functions | |
Geant4ParticleHandler (Geant4Context *context, const std::string &nam) | |
Standard constructor. More... | |
virtual | ~Geant4ParticleHandler () |
Default destructor. More... | |
bool | adopt (Geant4Action *action) |
Adopt the user particle handler. More... | |
virtual void | operator() (G4Event *event) override |
Event generation action callback. More... | |
virtual void | step (const G4Step *step, G4SteppingManager *mgr) |
User stepping callback. More... | |
virtual void | beginEvent (const G4Event *event) |
Pre-event action callback. More... | |
virtual void | endEvent (const G4Event *event) |
Post-event action callback. More... | |
virtual void | begin (const G4Track *track) |
Pre-track action callback. More... | |
virtual void | end (const G4Track *track) |
Post-track action callback. More... | |
virtual void | mark (const G4Track *track) override |
Mark a Geant4 track to be kept for later MC truth analysis. Default flag: CREATED_HIT. More... | |
virtual void | mark (const G4Track *track, int reason) override |
Store a track. More... | |
virtual void | mark (const G4Step *step) override |
Mark a Geant4 track of the step to be kept for later MC truth analysis. Default flag: CREATED_HIT. More... | |
virtual void | mark (const G4Step *step, int reason) override |
Store a track produced in a step to be kept for later MC truth analysis. More... | |
Public Member Functions inherited from dd4hep::sim::Geant4GeneratorAction | |
Geant4GeneratorAction (Geant4Context *context, const std::string &name) | |
Standard constructor. More... | |
virtual | ~Geant4GeneratorAction () |
Default destructor. 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... | |
Geant4Context * | context () 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... | |
PropertyManager & | properties () |
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... | |
Geant4UIMessenger * | control () const |
Access to the UI messenger. More... | |
virtual void | enableUI () |
Enable and install UI messenger. More... | |
template<typename T > | |
Geant4Action & | declareProperty (const std::string &nam, T &val) |
Declare property. More... | |
template<typename T > | |
Geant4Action & | declareProperty (const char *nam, T &val) |
Declare property. More... | |
bool | hasProperty (const std::string &name) const |
Check property for existence. More... | |
Property & | property (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... | |
Geant4RunActionSequence & | runAction () const |
Access to the main run action sequence from the kernel object. More... | |
Geant4EventActionSequence & | eventAction () const |
Access to the main event action sequence from the kernel object. More... | |
Geant4SteppingActionSequence & | steppingAction () const |
Access to the main stepping action sequence from the kernel object. More... | |
Geant4TrackingActionSequence & | trackingAction () const |
Access to the main tracking action sequence from the kernel object. More... | |
Geant4StackingActionSequence & | stackingAction () const |
Access to the main stacking action sequence from the kernel object. More... | |
Geant4GeneratorActionSequence & | generatorAction () const |
Access to the main generator action sequence from the kernel object. More... | |
Public Member Functions inherited from dd4hep::sim::Geant4MonteCarloTruth | |
virtual | ~Geant4MonteCarloTruth () |
Default destructor. More... | |
Static Public Member Functions | |
static bool | defaultKeepParticle (Particle &particle) |
Default callback to be answered if the particle should be kept if NO user handler is installed. More... | |
Protected Member Functions | |
int | recombineParents () |
Recombine particles and associate the to parents with cleanup. More... | |
void | clear () |
Clear particle maps. More... | |
void | checkConsistency () const |
Check the record consistency. More... | |
void | rebaseSimulatedTracks (int base) |
Rebase the simulated tracks, so that they fit to the generator particles. More... | |
void | dumpMap (const char *tag) const |
Debugging: Dump Geant4 particle map. More... | |
void | setVertexEndpointBit () |
set the endpointIsNotVertexOfParentFlag at the end of the event More... | |
Protected Member Functions inherited from dd4hep::sim::Geant4GeneratorAction | |
DDG4_DEFINE_ACTION_CONSTRUCTORS (Geant4GeneratorAction) | |
Define standard assignments and constructors. More... | |
Protected Member Functions inherited from dd4hep::sim::Geant4Action | |
DDG4_DEFINE_ACTION_CONSTRUCTORS (Geant4Action) | |
Define standard assignments and constructors. More... | |
virtual | ~Geant4Action () |
Default destructor. More... | |
Protected Member Functions inherited from dd4hep::sim::Geant4MonteCarloTruth | |
Geant4MonteCarloTruth () | |
Standard constructor. More... | |
Protected Attributes | |
bool | m_printStartTracking |
Property: Steer printout at tracking action begin. More... | |
bool | m_printEndTracking |
Property: Steer printout at tracking action end. More... | |
bool | m_keepAll |
Property: Flag to keep all particles generated. More... | |
bool | m_ownsParticles |
Property: Flag if the handler is executed in standalone mode and hence must manage particles. More... | |
double | m_kinEnergyCut |
Property: Energy cut below which particles are not collected, but assigned to the parent. More... | |
double | m_minDistToParentVertex |
Property: Minimal distance after which the vertexIsNotEndpointOfParent flag is set. More... | |
Processes | m_processNames |
Property: All the processes of which the decay products will be explicitly stored. More... | |
Geant4UserParticleHandler * | m_userHandler |
User action pointer. More... | |
int | m_globalParticleID |
Global particle identifier. Obtained at the begin of the event. More... | |
Geant4PrimaryMap * | m_primaryMap |
Primary map. More... | |
Particle | m_currTrack |
Local buffer about the 'current' G4Track. More... | |
ParticleMap | m_particleMap |
Map with stored MC Particles. More... | |
ParticleMap | m_suspendedPM |
Map with stored MC Particles that were suspended by the stepping action. More... | |
bool | m_haveSuspended = false |
TrackEquivalents | m_equivalentTracks |
Map associating the G4Track identifiers with identifiers of existing MCParticles. More... | |
Protected Attributes inherited from dd4hep::sim::Geant4GeneratorAction | |
Callback | m_calls |
Protected Attributes inherited from dd4hep::sim::Geant4Action | |
Geant4Context * | m_context { nullptr } |
Reference to the Geant4 context. More... | |
Geant4UIMessenger * | m_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... | |
Private Member Functions | |
Geant4ParticleHandler () | |
No default constructor. More... | |
Geant4ParticleHandler & | operator= (const Geant4ParticleHandler &c) |
No assignment operator. More... | |
Geant4Action to collect the MC particle information.
Extract the relevant particle information during the simulation step.
This procedure works as follows:
Any of these actions may be intercepted by a {\tt{Geant4UserParticleHandler}} attached to the particle handler. See class {\tt{Geant4UserParticleHandler}} for details.
Definition at line 72 of file Geant4ParticleHandler.h.
Definition at line 74 of file Geant4ParticleHandler.h.
Definition at line 75 of file Geant4ParticleHandler.h.
typedef std::vector<std::string> dd4hep::sim::Geant4ParticleHandler::Processes |
Definition at line 89 of file Geant4ParticleHandler.h.
Definition at line 76 of file Geant4ParticleHandler.h.
|
private |
No default constructor.
dd4hep::sim::Geant4ParticleHandler::Geant4ParticleHandler | ( | Geant4Context * | context, |
const std::string & | nam | ||
) |
Standard constructor.
|
virtual |
Default destructor.
bool dd4hep::sim::Geant4ParticleHandler::adopt | ( | Geant4Action * | action | ) |
Adopt the user particle handler.
|
virtual |
Pre-track action callback.
|
virtual |
Pre-event action callback.
|
protected |
Check the record consistency.
|
protected |
Clear particle maps.
|
static |
Default callback to be answered if the particle should be kept if NO user handler is installed.
|
protected |
Debugging: Dump Geant4 particle map.
|
virtual |
Post-track action callback.
|
virtual |
Post-event action callback.
|
overridevirtual |
Mark a Geant4 track of the step to be kept for later MC truth analysis. Default flag: CREATED_HIT.
Implements dd4hep::sim::Geant4MonteCarloTruth.
|
overridevirtual |
Store a track produced in a step to be kept for later MC truth analysis.
Implements dd4hep::sim::Geant4MonteCarloTruth.
|
overridevirtual |
Mark a Geant4 track to be kept for later MC truth analysis. Default flag: CREATED_HIT.
Implements dd4hep::sim::Geant4MonteCarloTruth.
|
overridevirtual |
Store a track.
Implements dd4hep::sim::Geant4MonteCarloTruth.
|
overridevirtual |
Event generation action callback.
Reimplemented from dd4hep::sim::Geant4GeneratorAction.
|
private |
No assignment operator.
|
protected |
Rebase the simulated tracks, so that they fit to the generator particles.
|
protected |
Recombine particles and associate the to parents with cleanup.
|
protected |
set the endpointIsNotVertexOfParentFlag at the end of the event
|
virtual |
User stepping callback.
|
protected |
Local buffer about the 'current' G4Track.
Definition at line 119 of file Geant4ParticleHandler.h.
|
protected |
Map associating the G4Track identifiers with identifiers of existing MCParticles.
Definition at line 126 of file Geant4ParticleHandler.h.
|
protected |
Global particle identifier. Obtained at the begin of the event.
EVENT DEPENDENT: variables containing data depending on the current event.
Definition at line 115 of file Geant4ParticleHandler.h.
|
protected |
Definition at line 124 of file Geant4ParticleHandler.h.
|
protected |
Property: Flag to keep all particles generated.
Definition at line 99 of file Geant4ParticleHandler.h.
|
protected |
Property: Energy cut below which particles are not collected, but assigned to the parent.
Definition at line 103 of file Geant4ParticleHandler.h.
|
protected |
Property: Minimal distance after which the vertexIsNotEndpointOfParent flag is set.
Definition at line 105 of file Geant4ParticleHandler.h.
|
protected |
Property: Flag if the handler is executed in standalone mode and hence must manage particles.
Definition at line 101 of file Geant4ParticleHandler.h.
|
protected |
Map with stored MC Particles.
Definition at line 121 of file Geant4ParticleHandler.h.
|
protected |
Primary map.
Definition at line 117 of file Geant4ParticleHandler.h.
|
protected |
Property: Steer printout at tracking action end.
Definition at line 97 of file Geant4ParticleHandler.h.
|
protected |
Property: Steer printout at tracking action begin.
Property variables used to configure the object
Definition at line 95 of file Geant4ParticleHandler.h.
|
protected |
Property: All the processes of which the decay products will be explicitly stored.
Definition at line 107 of file Geant4ParticleHandler.h.
|
protected |
Map with stored MC Particles that were suspended by the stepping action.
Definition at line 123 of file Geant4ParticleHandler.h.
|
protected |
User action pointer.
Object variables, which are constant after initialization
Definition at line 111 of file Geant4ParticleHandler.h.