File indexing completed on 2025-01-18 09:14:18
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 #ifndef DDG4_Geant4DefaultRangeCut_h
0028 #define DDG4_Geant4DefaultRangeCut_h 1
0029
0030
0031 #include <DDG4/Geant4PhysicsList.h>
0032
0033
0034 #include <G4VUserPhysicsList.hh>
0035
0036
0037
0038 namespace dd4hep {
0039
0040
0041 namespace sim {
0042
0043
0044
0045
0046
0047
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
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
0072 double m_rangeCut;
0073 };
0074 }
0075 }
0076 #endif
0077
0078 #include <DDG4/Factories.h>
0079 using namespace dd4hep::sim;
0080 DECLARE_GEANT4ACTION(Geant4DefaultRangeCut)