DD4hep  1.35.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  class Geant4SensDetActionSequence;
49 
51 
62  public:
64 
65  protected:
68 
69  public:
71  Geant4UserParticleHandler(Geant4Context* context, const std::string& nam);
75  virtual void generate(G4Event* event, Geant4ParticleHandler* handler);
77  virtual void begin(const G4Event* event);
79  virtual void end(const G4Event* event);
80 
82 
87  virtual void step(const G4Step* step, G4SteppingManager* mgr, Particle& particle);
88 
90 
96  virtual void begin(const G4Track* track, Particle& particle);
97 
99 
107  virtual void end(const G4Track* track, Particle& particle);
108 
110 
126  virtual bool keepParticle(Particle& particle);
127 
129 
133  virtual void combine(Particle& to_be_deleted, Particle& remaining_parent);
134 
136 
140  virtual void mark_track(const G4Track* track, Particle* current_track);
141 
142  };
143  } // End namespace sim
144 } // End namespace dd4hep
145 
146 #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:67
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::mark_track
virtual void mark_track(const G4Track *track, Particle *current_track)
User overload to handle particle settings when processing the track in the Geant4ParticleHandler.
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:63
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