|
Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
|
G4FieldManager is a manager (store) for a pointer to the Field subclass that describes the field of a detector (magnetic, electric or other). It also stores a reference to the chord finder. A field manager can be set to a logical volume (or to more than one), in order to vary its field from that of the world volume. In this manner a zero or constant field can override a global field, a more or less exact version can override the external approximation, lower or higher precision for tracking can be specified, a different stepper can be chosen for different volumes, etc... The Chord Finder must be created either by calling CreateChordFinder() for a Magnetic Field or by the user creating a Chord Finder object "manually" and setting the pointer. The current design envisions that one Field manager is valid for each detector region. It is expected that a particular geometrical region has a Field manager. By default a Field Manager is created for the world volume, and will be utilised for all volumes unless it is overridden by a 'local' field manager. Note also that a region with both electric E and magnetic B field will have these treated as one field. Similarly it could be extended to treat other fields as additional components of a single field type. More...
#include <G4FieldManager.hh>
Static Public Member Functions | |
| static void | SetGlobalFieldManager (G4FieldManager *fieldManager) |
| static G4FieldManager * | GetGlobalFieldManager () |
| static G4double | GetMaxAcceptedEpsilon () |
| static G4bool | SetMaxAcceptedEpsilon (G4double maxEps, G4bool softFail=false) |
Protected Member Functions | |
| void | ReportBadEpsilonValue (G4ExceptionDescription &erm, G4double value, const G4String &name) const |
Static Protected Attributes | |
| static G4double | fMaxAcceptedEpsilon = 0.01 |
| static constexpr G4double | fMinAcceptedEpsilon = 1000.0 * std::numeric_limits<G4double>::epsilon() |
| static constexpr G4double | fMaxWarningEpsilon = 0.001 |
| static constexpr G4double | fMaxFinalEpsilon = 0.02 |
| static G4bool | fVerboseConstruction = false |
G4FieldManager is a manager (store) for a pointer to the Field subclass that describes the field of a detector (magnetic, electric or other). It also stores a reference to the chord finder. A field manager can be set to a logical volume (or to more than one), in order to vary its field from that of the world volume. In this manner a zero or constant field can override a global field, a more or less exact version can override the external approximation, lower or higher precision for tracking can be specified, a different stepper can be chosen for different volumes, etc... The Chord Finder must be created either by calling CreateChordFinder() for a Magnetic Field or by the user creating a Chord Finder object "manually" and setting the pointer. The current design envisions that one Field manager is valid for each detector region. It is expected that a particular geometrical region has a Field manager. By default a Field Manager is created for the world volume, and will be utilised for all volumes unless it is overridden by a 'local' field manager. Note also that a region with both electric E and magnetic B field will have these treated as one field. Similarly it could be extended to treat other fields as additional components of a single field type.
Definition at line 108 of file G4FieldManager.hh.
| G4FieldManager::G4FieldManager | ( | G4Field * | detectorField = nullptr, |
| G4ChordFinder * | pChordFinder = nullptr, | ||
| G4bool | b = true ) |
General Constructor for any field. Must be set with field and chord finder for use.
| [in] | detectorField | Pointer to the field. |
| [in] | pChordFinder | Pointer to the chord finder object. |
| [in] | b | Flag to indicate if the field changes the energy; it is taken from the provided field, if specified. |
Definition at line 50 of file G4FieldManager.cc.
Referenced by Clone(), G4FieldManager(), GetGlobalFieldManager(), operator=(), SetFieldChangesEnergy(), and SetGlobalFieldManager().
| G4FieldManager::G4FieldManager | ( | G4MagneticField * | detectorMagneticField | ) |
Constructor creating the chord finder. It assumes pure magnetic field, so energy constant.
| [in] | detectorMagneticField | Pointer to the magnetic field. |
Definition at line 75 of file G4FieldManager.cc.
|
virtual |
Virtual Destructor.
Definition at line 89 of file G4FieldManager.cc.
|
delete |
Copy constructor and assignment operator not allowed.
|
inline |
Pushes the field to the equation and keeps its address. Can be used only once the equation, stepper, driver and chord finder have all been created; else it is an error.
| [in] | detectorField | Pointer to the field. |
|
virtual |
Needed for multi-threading, create and returns an allocated clone of this object.
Definition at line 98 of file G4FieldManager.cc.
Referenced by G4VUserDetectorConstruction::CloneF().
|
virtual |
Setups the choice of the configurable parameters, relying on the current track's energy, particle identity... Note: in addition to the values of member variables, a user can use this to change the ChordFinder, the field, etc.
| [in] | pTrack | Pointer to a track. |
Definition at line 156 of file G4FieldManager.cc.
Referenced by G4CoupledTransportation::AlongStepGetPhysicalInteractionLength(), and G4ITTransportation::AlongStepGetPhysicalInteractionLength().
| void G4FieldManager::CreateChordFinder | ( | G4MagneticField * | detectorMagField | ) |
Methods to create, set or get the associated Chord Finder.
Definition at line 162 of file G4FieldManager.cc.
Referenced by Clone().
|
inline |
Methods to set/get flag for field changing energy. For electric field this should be true; for magnetic field this should be false.
|
inline |
Referenced by G4VFieldModel::DescribeYourselfTo(), and G4ITTransportation::DoesGlobalFieldExist().
|
inline |
Referenced by G4ErrorPropagatorManager::InitFieldForBackwards().
|
inline |
|
inline |
Returns the accuracy for boundary intersection.
|
inline |
Returns the accuracy for one tracking/physics step.
|
inline |
Methods to get and check (existance of) the field object.
Referenced by G4CoupledTransportation::AlongStepGetPhysicalInteractionLength(), G4ITTransportation::AlongStepGetPhysicalInteractionLength(), G4DecayWithSpin::AtRestDoIt(), G4ErrorSurfaceTrajState::BuildErrorMatrix(), G4PathFinder::ComputeStep(), G4VFieldModel::DescribeYourselfTo(), G4ErrorFreeTrajState::G4ErrorFreeTrajState(), G4SynchrotronRadiation::GetMeanFreePath(), G4SynchrotronRadiationInMat::GetMeanFreePath(), G4SynchrotronRadiationInMat::GetPhotonEnergy(), G4ErrorPropagatorManager::InitFieldForBackwards(), G4SynchrotronRadiation::PostStepDoIt(), G4SynchrotronRadiationInMat::PostStepDoIt(), G4ErrorMagFieldLimitProcess::PostStepGetPhysicalInteractionLength(), and G4ErrorFreeTrajState::PropagateError().
|
static |
Referenced by G4FieldSetup::G4FieldSetup().
|
static |
Static methods to set/get the maximum accepted epsilon. If setting fails, with softFail=true it gives Warning, else a FatalException.
Definition at line 336 of file G4FieldManager.cc.
|
inline |
Methods to set/get the maximum for Relative accuracy of a Step.
|
inline |
Methods to set/get the minimum for Relative accuracy of a Step.
|
delete |
|
inline |
Pushes the field to this class only – no further. Should be used to initialise this field, only before creating the chord finder and its dependent classes. User is then responsible to ensure that: i) an equation, stepper, driver and chord finder are created; ii) this field is used by the equation.
| [in] | detectorField | Pointer to the field. |
|
protected |
Logger for reporting on correctness of the proposed epsilon value.
Definition at line 415 of file G4FieldManager.cc.
Referenced by SetMaximumEpsilonStep(), and SetMinimumEpsilonStep().
|
inline |
Sets both accuracies, maintaining a fixed ratio for accuracies of volume Intersection and Integration (in One Step).
|
inline |
Referenced by G4ErrorPropagatorManager::InitFieldForBackwards().
|
inline |
Sets the accuracy of intersection of a volume (only).
|
inline |
Sets the accuracy for integration of one step (only).
Pushes the field to the equation. Failure to push the field (due to absence of a chord finder, driver, stepper or equation) is
| [in] | detectorField | Pointer to the field. |
| [in] | failMode | Flag (0/1/2) for selected failure mode. |
Definition at line 193 of file G4FieldManager.cc.
|
inline |
|
static |
Static methods to set/get the global field.
Referenced by G4TransportationManager::SetFieldManager().
Definition at line 343 of file G4FieldManager.cc.
Definition at line 251 of file G4FieldManager.cc.
Definition at line 296 of file G4FieldManager.cc.
|
staticprotected |
Epsilon_min/max values must be smaller than this for robust integration.
Definition at line 272 of file G4FieldManager.hh.
Referenced by GetMaxAcceptedEpsilon(), ReportBadEpsilonValue(), SetMaxAcceptedEpsilon(), SetMaximumEpsilonStep(), and SetMinimumEpsilonStep().
|
staticconstexprprotected |
Will not accept larger values.
Definition at line 279 of file G4FieldManager.hh.
Referenced by SetMaxAcceptedEpsilon().
|
staticconstexprprotected |
Setting larger value will give warning.
Definition at line 276 of file G4FieldManager.hh.
Referenced by SetMaxAcceptedEpsilon().
|
staticconstexprprotected |
Definition at line 273 of file G4FieldManager.hh.
Referenced by ReportBadEpsilonValue(), SetMaximumEpsilonStep(), and SetMinimumEpsilonStep().
|
staticprotected |
Controls verbosity of constructors.
Definition at line 282 of file G4FieldManager.hh.
Referenced by G4FieldManager(), G4FieldManager(), SetMaximumEpsilonStep(), and SetMinimumEpsilonStep().