ATLAS Offline Software
Loading...
Searching...
No Matches
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
22class G4VIntegrationDriver;
23class G4MagIntegratorStepper;
24
25
33class 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
51 G4VIntegrationDriver*
52 createDriverAndStepper(const std::string& stepperType, G4MagneticField* field) const;
53#endif
54
55#if G4VERSION_NUMBER < 1040
57 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
StatusCode setFieldParameters(G4FieldManager *fieldMgr) const
Common method to apply configuredfield parameters.
Gaudi::Property< double > m_deltaChord
G4MagIntegratorStepper * getStepper(const std::string &stepperType, G4MagneticField *field) const
Common method to construct a stepper of requested type.
virtual ~G4FieldManagerToolBase()
Destructor.
ToolHandle< IEquationOfMotionTool > m_equationOfMotion
The type of equation of motion to use.
Gaudi::Property< double > m_maxStep
virtual StatusCode initialize() override
Initialize method.
Gaudi::Property< double > m_maxEps
Gaudi::Property< double > m_deltaIntersection
ServiceHandle< IG4FieldSvc > m_fieldSvc
Handle to the G4 field service.
Gaudi::Property< bool > m_fieldOn
Gaudi::Property< double > m_deltaOneStep
G4FieldManagerToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
Gaudi::Property< double > m_minStep
Gaudi::Property< double > m_minEps
Gaudi::Property< std::string > m_integratorStepper
The type of stepper to use.