ATLAS Offline Software
G4FieldManagerToolBase.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef G4ATLASTOOLS_G4FieldManagerToolBase_H
6 #define G4ATLASTOOLS_G4FieldManagerToolBase_H
7 
8 // Framework includes
9 #include "GaudiKernel/ServiceHandle.h"
10 #include "GaudiKernel/ToolHandle.h"
12 
13 // G4Atlas includes
17 
18 // Geant4 includes
19 #include "G4Version.hh"
20 
21 // Forward declarations
22 class G4VIntegrationDriver;
23 class G4MagIntegratorStepper;
24 
25 
33 class G4FieldManagerToolBase : public extends<AthAlgTool, IFieldManagerTool>
34 {
35 
36  public:
38  G4FieldManagerToolBase(const std::string& type, const std::string& name,
39  const IInterface* parent);
40 
43 
45  virtual StatusCode initialize( ) override;
46 
47  protected:
48 
49 #if G4VERSION_NUMBER >= 1040
50  G4VIntegrationDriver*
52  createDriverAndStepper(const std::string& stepperType, G4MagneticField* field) const;
53 #endif
54 
55 #if G4VERSION_NUMBER < 1040
56  G4MagIntegratorStepper*
58  getStepper(const std::string& stepperType, G4MagneticField* field) const;
59 #endif
60 
62  StatusCode setFieldParameters(G4FieldManager* fieldMgr) const;
63 
65  ServiceHandle<IG4FieldSvc> m_fieldSvc{this, "FieldSvc", "G4FieldSvc", "Service providing a G4MagneticField"};
66 
68  Gaudi::Property<bool> m_fieldOn{this, "FieldOn", true, "Toggles field on/off"};
69 
71  Gaudi::Property<std::string> m_integratorStepper{this, "IntegratorStepper", "AtlasRK4", "Integrator stepper name"};
72 
74  ToolHandle<IEquationOfMotionTool> m_equationOfMotion{this, "EquationOfMotion", "", ""};
75  //std::string m_equationOfMotion;
76 
79  Gaudi::Property<double> m_minEps{this, "MinimumEpsilonStep", -1.0, "Minimum epsilon (see G4 documentation)"};
80  Gaudi::Property<double> m_maxEps{this, "MaximumEpsilonStep", -1.0, "Maximum epsilon (see G4 documentation)"};
81  Gaudi::Property<double> m_deltaChord{this, "DeltaChord", -1.0, "Missing distance for the chord finder"};
82  Gaudi::Property<double> m_deltaOneStep{this, "DeltaOneStep", -1.0, "Delta(one-step)"};
83  Gaudi::Property<double> m_deltaIntersection{this, "DeltaIntersection", -1.0, "Accuracy for boundary intersection"};
84  Gaudi::Property<double> m_maxStep{this, "MaximumStep", -1.0, "Maximum step length in field (see G4 documentation)"};
85  Gaudi::Property<double> m_minStep{this, "MinimumStep",1e-2, "Minimum step length in field (see G4 documentation)"};
87 
88 };
89 
90 #endif // G4ATLASTOOLS_G4FieldManagerToolBase_H
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
G4FieldManagerToolBase::initialize
virtual StatusCode initialize() override
Initialize method.
Definition: G4FieldManagerToolBase.cxx:62
G4FieldManagerToolBase::setFieldParameters
StatusCode setFieldParameters(G4FieldManager *fieldMgr) const
Common method to apply configuredfield parameters.
Definition: G4FieldManagerToolBase.cxx:239
IFieldManagerTool.h
G4FieldManagerToolBase::m_equationOfMotion
ToolHandle< IEquationOfMotionTool > m_equationOfMotion
The type of equation of motion to use.
Definition: G4FieldManagerToolBase.h:74
G4FieldManagerToolBase::m_integratorStepper
Gaudi::Property< std::string > m_integratorStepper
The type of stepper to use.
Definition: G4FieldManagerToolBase.h:71
G4FieldManagerToolBase::m_maxStep
Gaudi::Property< double > m_maxStep
Definition: G4FieldManagerToolBase.h:84
G4FieldManagerToolBase::G4FieldManagerToolBase
G4FieldManagerToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
Definition: G4FieldManagerToolBase.cxx:52
G4FieldManagerToolBase
Definition: G4FieldManagerToolBase.h:34
G4FieldManagerToolBase::m_minEps
Gaudi::Property< double > m_minEps
Definition: G4FieldManagerToolBase.h:79
G4FieldManagerToolBase::m_fieldOn
Gaudi::Property< bool > m_fieldOn
Definition: G4FieldManagerToolBase.h:68
G4FieldManagerToolBase::m_fieldSvc
ServiceHandle< IG4FieldSvc > m_fieldSvc
Handle to the G4 field service.
Definition: G4FieldManagerToolBase.h:65
ReadOfcFromCool.field
field
Definition: ReadOfcFromCool.py:48
G4FieldManagerToolBase::m_deltaOneStep
Gaudi::Property< double > m_deltaOneStep
Definition: G4FieldManagerToolBase.h:82
G4FieldManagerToolBase::m_deltaChord
Gaudi::Property< double > m_deltaChord
Definition: G4FieldManagerToolBase.h:81
IEquationOfMotionTool.h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
IG4FieldSvc.h
G4FieldManagerToolBase::m_deltaIntersection
Gaudi::Property< double > m_deltaIntersection
Definition: G4FieldManagerToolBase.h:83
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
G4FieldManagerToolBase::~G4FieldManagerToolBase
virtual ~G4FieldManagerToolBase()
Destructor.
Definition: G4FieldManagerToolBase.h:42
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
G4FieldManagerToolBase::m_minStep
Gaudi::Property< double > m_minStep
Definition: G4FieldManagerToolBase.h:85
G4FieldManagerToolBase::m_maxEps
Gaudi::Property< double > m_maxEps
Definition: G4FieldManagerToolBase.h:80
G4FieldManagerToolBase::getStepper
G4MagIntegratorStepper * getStepper(const std::string &stepperType, G4MagneticField *field) const
Common method to construct a stepper of requested type.
Definition: G4FieldManagerToolBase.cxx:190
ServiceHandle< IG4FieldSvc >