Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-03-13 08:20:18

0001 //==========================================================================
0002 //  AIDA Detector description implementation 
0003 //--------------------------------------------------------------------------
0004 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 // All rights reserved.
0006 //
0007 // For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0009 //
0010 // Author     : M.Frank
0011 //
0012 //==========================================================================
0013 
0014 // Framework include files
0015 #include <DD4hep/Printout.h>
0016 #include <DD4hep/InstanceCount.h>
0017 #include <DDG4/Geant4ParticleHandler.h>
0018 #include <DDG4/Geant4UserParticleHandler.h>
0019 #include <CLHEP/Units/SystemOfUnits.h>
0020 
0021 using namespace dd4hep::sim;
0022 
0023 /// Standard constructor
0024 Geant4UserParticleHandler::Geant4UserParticleHandler(Geant4Context* ctxt, const std::string& nam)
0025 : Geant4Action(ctxt,nam)
0026 {
0027   InstanceCount::increment(this);
0028   declareProperty("MinimalKineticEnergy",m_kinEnergyCut = 100e0*CLHEP::MeV);
0029   m_needsControl = true;
0030 }
0031 
0032 /// Default destructor
0033 Geant4UserParticleHandler::~Geant4UserParticleHandler()  {
0034   InstanceCount::decrement(this);
0035 }
0036 
0037 /// Event generation action callback
0038 void Geant4UserParticleHandler::generate(G4Event* /* event */, Geant4ParticleHandler* /* handler */)   {
0039   //printout(INFO,name(),"+++ Generate event");
0040 }
0041 
0042 /// Pre-event action callback
0043 void Geant4UserParticleHandler::begin(const G4Event* /* event */)  {
0044 }
0045 
0046 /// Post-event action callback
0047 void Geant4UserParticleHandler::end(const G4Event* /* event */)   {
0048   //printout(INFO,name(),"+++ End event");
0049 }
0050 
0051 /// User stepping callback
0052 void Geant4UserParticleHandler::step(const G4Step* /* step */, G4SteppingManager* /* mgr */, Particle& /* particle */)  {
0053 }
0054 
0055 /// Pre-track action callback
0056 void Geant4UserParticleHandler::begin(const G4Track* /* track */, Particle& /* particle */)  {
0057 }
0058 
0059 /// Post-track action callback
0060 void Geant4UserParticleHandler::end(const G4Track* /* track */, Particle& /* particle */)  {
0061 }
0062 
0063 /// Callback when parent should be combined
0064 void Geant4UserParticleHandler::combine(Particle& /* to_be_deleted */, Particle& /* remaining_parent */)  {
0065 }
0066 
0067 /// Callback to be answered if the particle MUST be kept during recombination step
0068 bool Geant4UserParticleHandler::keepParticle(Particle& particle)   {
0069   return Geant4ParticleHandler::defaultKeepParticle(particle);
0070 }