Geant4  10.00.p01
F04GlobalField.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 // $Id: F04GlobalField.hh 79251 2014-02-20 16:16:23Z gcosmo $
27 //
30 //
31 
32 #ifndef F04GlobalField_h
33 #define F04GlobalField_h 1
34 
35 #include <vector>
36 
37 #include "G4FieldManager.hh"
38 #include "G4PropagatorInField.hh"
40 #include "G4ChordFinder.hh"
41 
42 #include "G4MagneticField.hh"
44 
45 #include "G4Mag_EqRhs.hh"
46 #include "G4Mag_SpinEqRhs.hh"
47 
48 #include "G4EqMagElectricField.hh"
49 #include "G4EqEMFieldWithSpin.hh"
50 
51 #include "F04FieldMessenger.hh"
52 #include "F04ElementField.hh"
53 
55 
56 // F04GlobalField - handles the global ElectroMagnetic field
57 //
58 // There is a single G04GlobalField object.
59 //
60 // The field from each individual beamline element is given by a
61 // ElementField object. Any number of overlapping ElementField
62 // objects can be added to the global field. Any element that
63 // represents an element with an EM field must add the appropriate
64 // ElementField to the global GlobalField object.
65 
66 typedef std::vector<F04ElementField*> FieldList;
67 
69 //class F04GlobalField : public G4MagneticField {
70 
71 private:
72 
75 
77 
78  void SetupArray();
79 
80 public:
81 
82  virtual ~F04GlobalField();
83 
87  static F04GlobalField* GetObject();
88 
92  virtual void GetFieldValue(const G4double* point, G4double* field) const;
93 
95  virtual G4bool DoesFieldChangeEnergy() const { return true; }
96 
100  {
101  if (fFields) fFields->push_back(f);
102  }
103 
107  void Clear();
108 
110  void ConstructField();
111 
113  void SetStepperType( G4int i ) { fStepperType = i; }
114 
116  void SetStepper();
117 
119  void SetMinStep(G4double stp) { fMinStep = stp; }
120 
122  void SetDeltaChord(G4double dcr) { fDeltaChord = dcr; }
123 
126 
129 
132 
135 
137  FieldList* GetFields() { return fFields; }
138 
139 protected:
140 
143 
144 private:
145 
147 
150 
152 
154 
155 private:
156 
158 
165 
166 // G4Mag_EqRhs* fEquation;
167 // G4Mag_SpinEqRhs* fEquation;
168 
169 // G4EqMagElectricField* fEquation;
171 
176 
178 
180 
181 };
182 
183 #endif
void SetDeltaIntersection(G4double its)
Set the delta intersection length.
G4PropagatorInField * fFieldPropagator
void SetEpsMax(G4double eps)
Set the maximum eps length.
F04GlobalField & operator=(const F04GlobalField &)
virtual ~F04GlobalField()
F04DetectorConstruction * fDetectorConstruction
Definition of the F04FieldMessenger class.
void SetEpsMin(G4double eps)
Set the minimum eps length.
static const G4double eps
Definition of the F04ElementField class.
virtual void GetFieldValue(const G4double *point, G4double *field) const
GetFieldValue() returns the field value at a given point[]. field is really field[6]: Bx...
#define G4ThreadLocal
Definition: tls.hh:52
static G4ThreadLocal F04GlobalField * fObject
int G4int
Definition: G4Types.hh:78
G4MagIntegratorStepper * fStepper
static F04GlobalField * GetObject()
Definition of the F04DetectorConstruction class.
std::vector< F04ElementField * > FieldList
G4double fDeltaOneStep
bool G4bool
Definition: G4Types.hh:79
G4FieldManager * GetGlobalFieldManager()
Get the global field manager.
void SetDeltaChord(G4double dcr)
Set the delta chord length.
G4ChordFinder * fChordFinder
F04FieldMessenger * fFieldMessenger
void SetDeltaOneStep(G4double stp)
Set the delta one step length.
G4EqEMFieldWithSpin * fEquation
void ConstructField()
constructs all field tracking objects
void SetMinStep(G4double stp)
Set the minimum step length.
F04GlobalField(F04DetectorConstruction *const)
const F04ElementField ** fFp
FieldList * fFields
G4double fDeltaChord
double G4double
Definition: G4Types.hh:76
void SetStepper()
Set the Stepper.
virtual G4bool DoesFieldChangeEnergy() const
DoesFieldChangeEnergy() returns true.
G4double fDeltaIntersection
void AddElementField(F04ElementField *f)
AddElementField() adds the ElementField object for a single element to the global field...
void Clear()
Clear() removes all ElementField-s from the global object, and destroys them. Used before the geometr...
FieldList * GetFields()
Return the list of Element Fields.
void SetStepperType(G4int i)
Set the Stepper types.
G4FieldManager * fFieldManager