DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Geant4DefaultRangeCut.cpp
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 
27 #ifndef DDG4_Geant4DefaultRangeCut_h
28 #define DDG4_Geant4DefaultRangeCut_h 1
29 
30 // Framework include files
31 #include <DDG4/Geant4PhysicsList.h>
32 
33 // geant4
34 #include <G4VUserPhysicsList.hh>
35 
36 
38 namespace dd4hep {
39 
41  namespace sim {
42 
44 
50  public:
51  Geant4DefaultRangeCut(Geant4Context* ctxt, const std::string& nam)
52  : Geant4PhysicsList(ctxt, nam), m_rangeCut(0.7*CLHEP::mm)
53  {
54  declareProperty("RangeCut", m_rangeCut);
55  }
57  }
59  virtual void constructProcesses(G4VUserPhysicsList* physics_list) {
60  if ( physics_list ) {
61  info("+++ Set PhysicsList RangeCut to %f mm",m_rangeCut/CLHEP::mm);
62  physics_list->SetDefaultCutValue(m_rangeCut);
63  physics_list->SetCuts();
64  if( DEBUG == printLevel() ) physics_list->DumpCutValuesTable();
65  return;
66  }
67  except("No valid reference to a G4VUserPhysicsList instance!");
68  }
69 
70  private:
72  double m_rangeCut;
73  };
74  }
75 }
76 #endif // DDG4_Geant4DefaultRangeCut_h
77 
78 #include <DDG4/Factories.h>
79 using namespace dd4hep::sim;
dd4hep::sim::Geant4DefaultRangeCut::~Geant4DefaultRangeCut
virtual ~Geant4DefaultRangeCut()
Definition: Geant4DefaultRangeCut.cpp:56
Geant4PhysicsList.h
DECLARE_GEANT4ACTION
#define DECLARE_GEANT4ACTION(name)
Plugin defintion to create Geant4Action objects.
Definition: Factories.h:210
dd4hep::sim::Geant4DefaultRangeCut::constructProcesses
virtual void constructProcesses(G4VUserPhysicsList *physics_list)
Callback to construct processes (uses the G4 particle table)
Definition: Geant4DefaultRangeCut.cpp:59
dd4hep::sim::Geant4Action::info
void info(const char *fmt,...) const
Support of info messages.
Definition: Geant4Action.cpp:215
dd4hep::sim::Geant4Action::except
void except(const char *fmt,...) const
Support of exceptions: Print fatal message and throw runtime_error.
Definition: Geant4Action.cpp:256
dd4hep::sim::Geant4DefaultRangeCut::m_rangeCut
double m_rangeCut
global range cut for secondary productions
Definition: Geant4DefaultRangeCut.cpp:72
CLHEP
CLHEP namespace.
Definition: Geant4Random.h:26
dd4hep::sim::Geant4Action::declareProperty
Geant4Action & declareProperty(const std::string &nam, T &val)
Declare property.
Definition: Geant4Action.h:366
dd4hep::sim::Geant4PhysicsList
Concrete basic implementation of a Geant4 physics list action.
Definition: Geant4PhysicsList.h:41
dd4hep::sim::Geant4DefaultRangeCut::Geant4DefaultRangeCut
Geant4DefaultRangeCut(Geant4Context *ctxt, const std::string &nam)
Definition: Geant4DefaultRangeCut.cpp:51
Factories.h
dd4hep::sim
Namespace for the Geant4 based simulation part of the AIDA detector description toolkit.
Definition: Geant4Output2EDM4hep.cpp:49
dd4hep::sim::Geant4DefaultRangeCut
Geant4 physics list action to set global range cuts for secondary productions.
Definition: Geant4DefaultRangeCut.cpp:49
dd4hep
Namespace for the AIDA detector description toolkit.
Definition: AlignmentsCalib.h:28
dd4hep::sim::Geant4Context
Generic context to extend user, run and event information.
Definition: Geant4Context.h:201