k4SimGeant4
Loading...
Searching...
No Matches
SimG4ConstantMagneticFieldTool.h
Go to the documentation of this file.
1#ifndef SIMG4COMPONENTS_G4CONSTANTMAGNETICFIELDTOOL_H
2#define SIMG4COMPONENTS_G4CONSTANTMAGNETICFIELDTOOL_H
3
4// Gaudi
5#include "GaudiKernel/AlgTool.h"
6
7// FCCSW
9
10// Geant4
11#include "G4SystemOfUnits.hh"
12
13// Forward declarations:
14// Geant 4 classes
15class G4MagIntegratorStepper;
16
17// FCCSW
18namespace sim {
19class ConstantField;
20}
21
31class SimG4ConstantMagneticFieldTool : public AlgTool, virtual public ISimG4MagneticFieldTool {
32public:
34 SimG4ConstantMagneticFieldTool(const std::string& type, const std::string& name, const IInterface* parent);
35
38
40 virtual StatusCode initialize() final;
41
43 virtual StatusCode finalize() final;
44
47 virtual const G4MagneticField* field() const final;
48
51 G4MagIntegratorStepper* stepper(const std::string&, G4MagneticField*) const;
52
53private:
57 Gaudi::Property<bool> m_fieldOn{this, "FieldOn", false, "Switch to turn field off"};
60 Gaudi::Property<double> m_minEps{this, "MinimumEpsilon", 0, "Minimum epsilon (see G4 documentation)"};
63 Gaudi::Property<double> m_maxEps{this, "MaximumEpsilon", 0, "Maximum epsilon (see G4 documentation)"};
65 Gaudi::Property<double> m_deltaChord{this, "DeltaChord", 0, "Missing distance for the chord finder"};
68 Gaudi::Property<double> m_deltaOneStep{this, "DeltaOneStep", 0, "Delta(one-step)"};
70 Gaudi::Property<double> m_maxStep{this, "MaximumStep", 1. * m, "Maximum step length in field (see G4 documentation)"};
72 Gaudi::Property<double> m_minStep{this, "MinimumStep", 0.01 * mm, "Minimum step length in field (see G4 documentation)"};
74 Gaudi::Property<std::string> m_integratorStepper{this, "IntegratorStepper", "NystromRK4", "Integrator stepper name"};
75
77 Gaudi::Property<double> m_fieldComponentX{this, "FieldComponentX", 0, "Field X component"};
79 Gaudi::Property<double> m_fieldComponentY{this, "FieldComponentY", 0, "Field Y component"};
81 Gaudi::Property<double> m_fieldComponentZ{this, "FieldComponentZ", -4 * tesla, "Field Z component"};
83 Gaudi::Property<double> m_fieldRadMax{this, "FieldRMax", 6 * m, "Field max radius"};
85 Gaudi::Property<double> m_fieldZMax{this, "FieldZMax", 20. * m, "Field max Z"};
86};
87
88#endif
Abstract interface to Geant4 field classes.
Definition ISimG4MagneticFieldTool.h:20
SimG4ConstantMagneticFieldTool.h.
Definition SimG4ConstantMagneticFieldTool.h:31
virtual StatusCode initialize() final
Initialize method.
Definition SimG4ConstantMagneticFieldTool.cpp:38
Gaudi::Property< double > m_fieldRadMax
Size of the field in radial direction. Set with property FieldRMax.
Definition SimG4ConstantMagneticFieldTool.h:83
Gaudi::Property< double > m_deltaOneStep
This parameter is roughly the position error which is acceptable in an integration step,...
Definition SimG4ConstantMagneticFieldTool.h:68
Gaudi::Property< double > m_fieldComponentY
Field component in Y direction. Set with property FieldComponentY.
Definition SimG4ConstantMagneticFieldTool.h:79
sim::ConstantField * m_field
Pointer to the actual Geant 4 magnetic field.
Definition SimG4ConstantMagneticFieldTool.h:55
virtual const G4MagneticField * field() const final
Get the magnetic field.
Definition SimG4ConstantMagneticFieldTool.cpp:71
virtual ~SimG4ConstantMagneticFieldTool()
Destructor.
Definition SimG4ConstantMagneticFieldTool.cpp:34
Gaudi::Property< double > m_minEps
Minimum epsilon (relative error of position / momentum, see G4 doc for more details).
Definition SimG4ConstantMagneticFieldTool.h:60
Gaudi::Property< std::string > m_integratorStepper
Name of the integration stepper, defaults to NystromRK4.
Definition SimG4ConstantMagneticFieldTool.h:74
Gaudi::Property< double > m_deltaChord
This parameter governs accuracy of volume intersection, see G4 doc for more details....
Definition SimG4ConstantMagneticFieldTool.h:65
Gaudi::Property< double > m_maxStep
Upper limit of the step size, see G4 doc for more details. Set with property MaximumStep.
Definition SimG4ConstantMagneticFieldTool.h:70
Gaudi::Property< bool > m_fieldOn
Switch to turn field on or off (default is off). Set with property FieldOn.
Definition SimG4ConstantMagneticFieldTool.h:57
Gaudi::Property< double > m_fieldComponentZ
Field component in Z direction. Set with property FieldComponentZ.
Definition SimG4ConstantMagneticFieldTool.h:81
Gaudi::Property< double > m_maxEps
Maximum epsilon (relative error of position / momentum, see G4 doc for more details).
Definition SimG4ConstantMagneticFieldTool.h:63
virtual StatusCode finalize() final
Finalize method.
Definition SimG4ConstantMagneticFieldTool.cpp:66
SimG4ConstantMagneticFieldTool(const std::string &type, const std::string &name, const IInterface *parent)
Standard constructor.
Definition SimG4ConstantMagneticFieldTool.cpp:28
Gaudi::Property< double > m_minStep
Lower limit of the step size, see G4 doc for more details. Set with property MaximumStep.
Definition SimG4ConstantMagneticFieldTool.h:72
Gaudi::Property< double > m_fieldComponentX
Field component in X direction. Set with property FieldComponentX.
Definition SimG4ConstantMagneticFieldTool.h:77
G4MagIntegratorStepper * stepper(const std::string &, G4MagneticField *) const
Get the stepper.
Definition SimG4ConstantMagneticFieldTool.cpp:73
Gaudi::Property< double > m_fieldZMax
Size of the field along the beam line. Set with property FieldZMax.
Definition SimG4ConstantMagneticFieldTool.h:85
Constant magnetic field inside the cylinder.
Definition ConstantField.h:15
Conversion between units.
Definition ConstantField.h:14