Loading...
Searching...
No Matches
F01FieldSetup.hh
Go to the documentation of this file.
1//
2// ********************************************************************
3// * License and Disclaimer *
4// * *
5// * The Geant4 software is copyright of the Copyright Holders of *
6// * the Geant4 Collaboration. It is provided under the terms and *
7// * conditions of the Geant4 Software License, included in the file *
8// * LICENSE and available at http://cern.ch/geant4/license . These *
9// * include a list of copyright holders. *
10// * *
11// * Neither the authors of this software system, nor their employing *
12// * institutes,nor the agencies providing financial support for this *
13// * work make any representation or warranty, express or implied, *
14// * regarding this software system or assume any liability for its *
15// * use. Please see the license in the file LICENSE and URL above *
16// * for the full disclaimer and the limitation of liability. *
17// * *
18// * This code implementation is the result of the scientific and *
19// * technical work of the GEANT4 collaboration. *
20// * By using, copying, modifying or distributing the software (or *
21// * any work based on the software) you agree to acknowledge its *
22// * use in resulting scientific publications, and indicate your *
23// * acceptance of all terms of the Geant4 Software license. *
24// ********************************************************************
25//
26/// \file field/field01/include/F01FieldSetup.hh
27/// \brief Definition of the F01FieldSetup class
28//
29//
30//
31//
32// A class for control of the Magnetic Field of the detector.
33// The field is assumed to be uniform.
34//
35// Should this be a:
36// i) a messenger class
37// ii) user class that creates the field ( Current choice )
38// iii) a field manager that creates/updates field
39//
40//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
41//....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo......
42
43#ifndef F01FieldSetup_h
44#define F01FieldSetup_h 1
45
46#include "G4MagneticField.hh"
47#include "G4UniformMagField.hh"
48
49class G4FieldManager;
50class G4ChordFinder;
55
56class F01FieldSetup
57{
58public:
59 F01FieldSetup(G4ThreeVector, // The value of the field
60 G4int stepperNum = -1000, // -ive = fsal, +ive = old.
61 // default (-1000) uses next flag
62 G4bool useFSALstepper= false );
63
64 F01FieldSetup(); // A zero field
66
67 virtual ~F01FieldSetup();
68
71
72 void SetStepper();
73
74 void SetMinStep(G4double s) { fMinStep = s; }
75
76 void InitialiseAll(); // Set parameters and call method below
77
78 // Original method
80
81 // Create FSAL stepper and driver
83
84 // Create Boris driver ( 2nd order Symplectic integration )
86
87 void SetUseFSALstepper(G4bool val= true) { fUseFSALstepper = val; }
89
90 // Parameters for integration accuracy : get / control
91 // -------------------------------------------------------
92 G4double GetEpsilonMin(){ return fDesiredEpsilonMin; }
93 G4double GetEpsilonMax(){ return fDesiredEpsilonMax; }
94
95 void SetEpsilonMin(G4double val){ fDesiredEpsilonMin= val; }
96 void SetEpsilonMax(G4double val){ fDesiredEpsilonMax= val; }
97
98 void SetDeltaOneStep(G4double val){ fDeltaOneStep= val; }
99
100 // Special for this setup only
101 // ----------------------------
102 void SetFieldValue(G4ThreeVector fieldVector);
103 void SetFieldZValue(G4double fieldValue);
104 G4ThreeVector GetConstantFieldValue();
105
106protected:
107 // Implementation methods
109
110 // Find the global Field Manager
112
113protected:
114
119
121 G4bool fUseFSALstepper = false;
122 G4VIntegrationDriver* fDriver = nullptr; // If non-null, its new type (FSAL)
123 G4int fStepperType = -1;
125
126 // Parameters / Invariant during tracking loop
127 G4double fMinStep = -1.0;
128 G4double fDeltaOneStep= -1.0;
129 G4double fDesiredEpsilonMin = 1.0e-05; // tight: 1.0e-8 std: 1.0e-5 to 1.e-6 loose: 1.0e-4
130 G4double fDesiredEpsilonMax = 0.005; // tight: 1.0e-5 std: 1.0e-4 to 5.e-3 loose: 1.0e-3+
131};
132
133#endif
G4double fDesiredEpsilonMin
G4MagneticField * fMagneticField
void SetMinStep(G4double s)
G4double GetEpsilonMin()
void CreateStepperAndChordFinder()
G4FieldManager * fFieldManager
G4double fDeltaOneStep
G4VIntegrationDriver * fDriver
void CreateFSALStepperAndChordFinder()
virtual ~F01FieldSetup()
G4FieldManager * GetGlobalFieldManager()
G4ThreeVector GetConstantFieldValue()
void SetFieldZValue(G4double fieldValue)
G4Mag_UsualEqRhs * fEquation
G4MagIntegratorStepper * fStepper
G4VIntegrationDriver * CreateFSALStepperAndDriver()
void CreateAndSetupBorisDriver()
void SetStepperType(G4int i)
void SetEpsilonMax(G4double val)
G4double GetEpsilonMax()
void SetDeltaOneStep(G4double val)
G4ChordFinder * fChordFinder
void SetFieldValue(G4ThreeVector fieldVector)
G4double fDesiredEpsilonMax
void SetEpsilonMin(G4double val)
F01FieldSetup(F01FieldSetup &)=delete
void SetUseFSALstepper(G4bool val=true)
G4bool GetUseFSALstepper()
F01FieldMessenger * fFieldMessenger

Applications | User Support | Publications | Collaboration