Geant4  10.03.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 78551 2014-01-07 09:45:08Z 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 
76  F04GlobalField& operator=(const F04GlobalField&);
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 
125  void SetDeltaOneStep(G4double stp) { fDeltaOneStep = stp; }
126 
128  void SetDeltaIntersection(G4double its) { fDeltaIntersection = its; }
129 
131  void SetEpsMin(G4double eps) { fEpsMin = eps; }
132 
134  void SetEpsMax(G4double eps) { fEpsMax = eps; }
135 
137  FieldList* GetFields() { return fFields; }
138 
139 protected:
140 
143 
144 private:
145 
146  static G4ThreadLocal F04GlobalField* fObject;
147 
148  G4int fNfp;
149  G4bool fFirst;
150 
151  FieldList* fFields;
152 
153  const F04ElementField **fFp;
154 
155 private:
156 
157  G4int fStepperType;
158 
159  G4double fMinStep;
160  G4double fDeltaChord;
161  G4double fDeltaOneStep;
162  G4double fDeltaIntersection;
163  G4double fEpsMin;
164  G4double fEpsMax;
165 
166 // G4Mag_EqRhs* fEquation;
167 // G4Mag_SpinEqRhs* fEquation;
168 
169 // G4EqMagElectricField* fEquation;
170  G4EqEMFieldWithSpin* fEquation;
171 
172  G4FieldManager* fFieldManager;
173  G4PropagatorInField* fFieldPropagator;
174  G4MagIntegratorStepper* fStepper;
175  G4ChordFinder* fChordFinder;
176 
177  F04FieldMessenger* fFieldMessenger;
178 
179  F04DetectorConstruction* fDetectorConstruction;
180 
181 };
182 
183 #endif
void SetDeltaIntersection(G4double its)
Set the delta intersection length.
void SetEpsMax(G4double eps)
Set the maximum eps length.
virtual ~F04GlobalField()
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
#define G4ThreadLocal
Definition: tls.hh:89
int G4int
Definition: G4Types.hh:78
static F04GlobalField * GetObject()
Definition of the F04DetectorConstruction class.
std::vector< F04ElementField * > FieldList
bool G4bool
Definition: G4Types.hh:79
G4FieldManager * GetGlobalFieldManager()
Get the global field manager.
void SetDeltaChord(G4double dcr)
Set the delta chord length.
void SetDeltaOneStep(G4double stp)
Set the delta one step length.
void ConstructField()
constructs all field tracking objects
void SetMinStep(G4double stp)
Set the minimum step length.
double G4double
Definition: G4Types.hh:76
void SetStepper()
Set the Stepper.
virtual G4bool DoesFieldChangeEnergy() const
DoesFieldChangeEnergy() returns true.
void AddElementField(F04ElementField *f)
FieldList * GetFields()
Return the list of Element Fields.
void SetStepperType(G4int i)
Set the Stepper types.