DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Geant4UserParticleHandler.h
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : M.Frank
11 //
12 //==========================================================================
13 
25 #ifndef DDG4_GEANT4USERPARTICLEHANDLER_H
26 #define DDG4_GEANT4USERPARTICLEHANDLER_H
27 
28 // Framework include files
29 #include <DDG4/Geant4Data.h>
30 #include <DDG4/Geant4Action.h>
31 
32 // Forward declarations
33 class G4Step;
34 class G4Track;
35 class G4Event;
36 class G4SteppingManager;
37 
38 
40 namespace dd4hep {
41 
43  namespace sim {
44 
45  // Forward declarations
46  class Geant4Particle;
48 
50 
61  public:
63 
64  protected:
67 
68  public:
70  Geant4UserParticleHandler(Geant4Context* context, const std::string& nam);
74  virtual void generate(G4Event* event, Geant4ParticleHandler* handler);
76  virtual void begin(const G4Event* event);
78  virtual void end(const G4Event* event);
79 
81 
86  virtual void step(const G4Step* step, G4SteppingManager* mgr, Particle& particle);
87 
89 
95  virtual void begin(const G4Track* track, Particle& particle);
96 
98 
106  virtual void end(const G4Track* track, Particle& particle);
107 
109 
125  virtual bool keepParticle(Particle& particle);
126 
128 
132  virtual void combine(Particle& to_be_deleted, Particle& remaining_parent);
133  };
134  } // End namespace sim
135 } // End namespace dd4hep
136 
137 #endif // DDG4_GEANT4USERPARTICLEHANDLER_H
dd4hep::sim::Geant4UserParticleHandler::keepParticle
virtual bool keepParticle(Particle &particle)
Callback to be answered if the particle MUST be kept during recombination step.
Geant4ParticleHandler
Geant4Action to collect the MC particle information.
dd4hep::sim::Geant4UserParticleHandler::generate
virtual void generate(G4Event *event, Geant4ParticleHandler *handler)
Event generation action callback.
dd4hep::sim::Geant4UserParticleHandler::m_kinEnergyCut
double m_kinEnergyCut
Property: Energy cut below which particles are not collected, but assigned to the parent.
Definition: Geant4UserParticleHandler.h:66
dd4hep::sim::Geant4UserParticleHandler::~Geant4UserParticleHandler
virtual ~Geant4UserParticleHandler()
Default destructor.
dd4hep::sim::Geant4UserParticleHandler::Geant4UserParticleHandler
Geant4UserParticleHandler(Geant4Context *context, const std::string &nam)
Standard constructor.
Geant4Data.h
dd4hep::sim::Geant4UserParticleHandler::step
virtual void step(const G4Step *step, G4SteppingManager *mgr, Particle &particle)
User stepping callback.
Geant4UserParticleHandler
Geant4ParticleHandler user extension action called by the particle handler.
dd4hep::sim::Geant4UserParticleHandler::begin
virtual void begin(const G4Track *track, Particle &particle)
Pre-track action callback.
dd4hep::sim::Geant4UserParticleHandler::combine
virtual void combine(Particle &to_be_deleted, Particle &remaining_parent)
Callback when parent should be combined.
dd4hep::sim::Geant4UserParticleHandler::end
virtual void end(const G4Event *event)
Post-event action callback.
dd4hep::sim::Geant4Action
Default base class for all Geant 4 actions and derivates thereof.
Definition: Geant4Action.h:113
dd4hep::sim::Geant4UserParticleHandler::begin
virtual void begin(const G4Event *event)
Pre-event action callback.
dd4hep::sim::Geant4UserParticleHandler::end
virtual void end(const G4Track *track, Particle &particle)
Post-track action callback.
dd4hep::sim::Geant4UserParticleHandler::Particle
Geant4Particle Particle
Definition: Geant4UserParticleHandler.h:62
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::sim::Geant4Particle
Data structure to store the MC particle information.
Definition: Geant4Particle.h:103
Geant4Action.h
dd4hep::sim::Geant4Context
Generic context to extend user, run and event information.
Definition: Geant4Context.h:201
dd4hep::sim::Geant4Action::context
Geant4Context * context() const
Access the context.
Definition: Geant4Action.h:270