Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:14: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 /** \addtogroup Geant4PhysicsConstructor
0015  *
0016  * @{
0017  * \package Geant4RangeCut
0018  *
0019  * \brief PhysicsConstructor to change the global range cut
0020 
0021  This plugin allows one to change the global geant4 range cut for producing secondaries.
0022 
0023  *
0024  * @}
0025  */
0026 
0027 #ifndef DDG4_Geant4DefaultRangeCut_h
0028 #define DDG4_Geant4DefaultRangeCut_h 1
0029 
0030 // Framework include files
0031 #include <DDG4/Geant4PhysicsList.h>
0032 
0033 // geant4
0034 #include <G4VUserPhysicsList.hh>
0035 
0036 
0037 /// Namespace for the AIDA detector description toolkit
0038 namespace dd4hep {
0039 
0040   /// Namespace for the Geant4 based simulation part of the AIDA detector description toolkit
0041   namespace sim {
0042 
0043     /// Geant4 physics list action to set global range cuts for secondary productions
0044     /**
0045      *  \author  M.Frank
0046      *  \version 1.0
0047      *  \ingroup DD4HEP_SIMULATION
0048      */
0049     class Geant4DefaultRangeCut : public Geant4PhysicsList    {
0050     public:
0051       Geant4DefaultRangeCut(Geant4Context* ctxt, const std::string& nam)
0052         : Geant4PhysicsList(ctxt, nam), m_rangeCut(0.7*CLHEP::mm)
0053       {
0054         declareProperty("RangeCut", m_rangeCut);
0055       }
0056       virtual ~Geant4DefaultRangeCut()   {
0057       }
0058       /// Callback to construct processes (uses the G4 particle table)
0059       virtual void constructProcesses(G4VUserPhysicsList* physics_list)   { 
0060         if ( physics_list )  {
0061           info("+++ Set PhysicsList RangeCut to %f mm",m_rangeCut/CLHEP::mm);
0062           physics_list->SetDefaultCutValue(m_rangeCut);
0063           physics_list->SetCuts();
0064           if( DEBUG == printLevel() ) physics_list->DumpCutValuesTable();
0065           return;
0066         }
0067         except("No valid reference to a G4VUserPhysicsList instance!");
0068       }
0069 
0070     private:
0071       /// global range cut for secondary productions
0072       double m_rangeCut;
0073     };
0074   }
0075 }
0076 #endif   // DDG4_Geant4DefaultRangeCut_h
0077 
0078 #include <DDG4/Factories.h>
0079 using namespace dd4hep::sim;
0080 DECLARE_GEANT4ACTION(Geant4DefaultRangeCut)