Newer
Older
//==========================================================================
//--------------------------------------------------------------------------
// Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
// All rights reserved.
//
// For the licensing terms see $DD4hepINSTALL/LICENSE.
// For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
//
// Author : M.Frank
//
//==========================================================================
/** \addtogroup Geant4PhysicsConstructor
*
* @{
* \package Geant4RangeCut
*
* \brief PhysicsConstructor to change the global range cut
This plugin allows one to change the global geant4 range cut for producing secondaries.
*
* @}
*/
#ifndef DDG4_Geant4DefaultRangeCut_h
#define DDG4_Geant4DefaultRangeCut_h 1
// Framework include files
#include "DDG4/Geant4PhysicsList.h"
// geant4
#include "G4VUserPhysicsList.hh"
/// Namespace for the AIDA detector description toolkit
/// Namespace for the Geant4 based simulation part of the AIDA detector description toolkit
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
/// Geant4 physics list action to set global range cuts for secondary productions
/**
* \author M.Frank
* \version 1.0
* \ingroup DD4HEP_SIMULATION
*/
class Geant4DefaultRangeCut : public Geant4PhysicsList {
public:
Geant4DefaultRangeCut(Geant4Context* ctxt, const std::string& nam)
: Geant4PhysicsList(ctxt, nam), m_rangeCut(0.7*CLHEP::mm)
{
declareProperty("RangeCut", m_rangeCut);
}
virtual ~Geant4DefaultRangeCut() {
}
/// Callback to construct processes (uses the G4 particle table)
virtual void constructProcesses(G4VUserPhysicsList* physics_list) {
if ( physics_list ) {
info("+++ Set PhysicsList RangeCut to %f mm",m_rangeCut/CLHEP::mm);
physics_list->SetDefaultCutValue(m_rangeCut);
physics_list->SetCuts();
if( DEBUG == printLevel() ) physics_list->DumpCutValuesTable();
return;
}
except("No valid reference to a G4VUserPhysicsList instance!");
}
private:
/// global range cut for secondary productions
double m_rangeCut;
};
}
}
#endif // DDG4_Geant4DefaultRangeCut_h
#include "DDG4/Factories.h"
DECLARE_GEANT4ACTION(Geant4DefaultRangeCut)