15 #ifndef DD4HEP_DDG4_GEANT4PARTICLEHANDLER_H
16 #define DD4HEP_DDG4_GEANT4PARTICLEHANDLER_H
27 class G4SteppingManager;
33 namespace Simulation {
36 class Geant4UserParticleHandler;
68 #if defined(__CINT__) || defined(__MAKECINT__) || defined(G__DICTIONARY)
126 void dumpMap(
const char* tag)
const;
141 virtual void step(
const G4Step*
step, G4SteppingManager* mgr);
143 virtual void beginEvent(
const G4Event* event);
145 virtual void endEvent(
const G4Event* event);
147 virtual void begin(
const G4Track* track);
149 virtual void end(
const G4Track* track);
152 virtual void mark(
const G4Track* track);
154 virtual void mark(
const G4Track* track,
int reason);
156 virtual void mark(
const G4Step*
step);
158 virtual void mark(
const G4Step*
step,
int reason);
167 #endif // DD4HEP_DDG4_GEANT4PARTICLEHANDLER_H
std::vector< std::string > Processes
void clear()
Clear particle maps.
Geant4ParticleMap::ParticleMap ParticleMap
TrackEquivalents m_equivalentTracks
Map associating the G4Track identifiers with identifiers of existing MCParticles. ...
virtual ~Geant4ParticleHandler()
Default destructor.
std::map< int, Particle * > ParticleMap
Processes m_processNames
Property: All the processes of which the decay products will be explicitly stored.
double m_kinEnergyCut
Property: Energy cut below which particles are not collected, but assigned to the parent...
Data structure to store the MC particle information.
bool m_ownsParticles
Property: Flag if the handler is executed in standalone mode and hence must manage particles...
Default Interface class to handle monte carlo truth records.
bool m_printStartTracking
Property: Steer printout at tracking action begin.
ParticleMap m_particleMap
Map with stored MC Particles.
void rebaseSimulatedTracks(int base)
Rebase the simulated tracks, so that they fit to the generator particles.
Geant4ParticleMap::TrackEquivalents TrackEquivalents
void dumpMap(const char *tag) const
Debugging: Dump Geant4 particle map.
virtual void beginEvent(const G4Event *event)
Pre-event action callback.
void checkConsistency() const
Check the record consistency.
Geant4ParticleHandler user extension action called by the particle handler.
Geant4Context * context() const
Access the context.
Data structure to map primaries to particles.
Geant4ParticleHandler()
No default constructor.
virtual void mark(const G4Track *track)
Mark a Geant4 track to be kept for later MC truth analysis. Default flag: CREATED_HIT.
void setVertexEndpointBit()
set the endpointIsNotVertexOfParentFlag at the end of the event
Geant4PrimaryMap * m_primaryMap
Primary map.
double m_minDistToParentVertex
Property: Minimal distance after which the vertexIsNotEndpointOfParent flag is set.
virtual void end(const G4Track *track)
Post-track action callback.
Geant4Action to collect the MC particle information.
virtual void begin(const G4Track *track)
Pre-track action callback.
Particle m_currTrack
Local buffer about the 'current' G4Track.
Concrete implementation of the Geant4 generator action base class.
bool m_keepAll
Property: Flag to keep all particles generated.
int recombineParents()
Recombine particles and associate the to parents with cleanup.
Geant4ParticleHandler & operator=(const Geant4ParticleHandler &c)
No assignment operator.
Geant4ParticleMap::Particle Particle
virtual void step(const G4Step *step, G4SteppingManager *mgr)
User stepping callback.
static bool defaultKeepParticle(Particle &particle)
Default callback to be answered if the particle should be kept if NO user handler is installed...
Generic context to extend user, run and event information.
bool m_printEndTracking
Property: Steer printout at tracking action end.
int m_globalParticleID
Global particle identifier. Obtained at the begin of the event.
bool adopt(Geant4Action *action)
Adopt the user particle handler.
virtual void operator()(G4Event *event)
Event generation action callback.
Geant4UserParticleHandler * m_userHandler
User action pointer.
std::map< int, int > TrackEquivalents
virtual void endEvent(const G4Event *event)
Post-event action callback.
Default base class for all Geant 4 actions and derivates thereof.