Geant4_10
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 76690 2013-11-14 08:45:07Z 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  virtual ~F04GlobalField();
77 
78  F04GlobalField& operator=(const F04GlobalField&);
79 
80  void SetupArray();
81 
82 public:
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 UpdateField();
114 
116  void SetStepperType( G4int i ) { fStepperType = i; }
117 
119  void SetStepper();
120 
122  void SetMinStep(G4double stp) { fMinStep = stp; }
123 
125  void SetDeltaChord(G4double dcr) { fDeltaChord = dcr; }
126 
128  void SetDeltaOneStep(G4double stp) { fDeltaOneStep = stp; }
129 
131  void SetDeltaIntersection(G4double its) { fDeltaIntersection = its; }
132 
134  void SetEpsMin(G4double eps) { fEpsMin = eps; }
135 
137  void SetEpsMax(G4double eps) { fEpsMax = eps; }
138 
140  FieldList* GetFields() { return fFields; }
141 
142 protected:
143 
146 
147 private:
148 
149  static G4ThreadLocal F04GlobalField* fObject;
150 
151  G4int fNfp;
152  G4bool fFirst;
153 
154  FieldList* fFields;
155 
156  const F04ElementField **fFp;
157 
158 private:
159 
160  G4int fStepperType;
161 
162  G4double fMinStep;
163  G4double fDeltaChord;
164  G4double fDeltaOneStep;
165  G4double fDeltaIntersection;
166  G4double fEpsMin;
167  G4double fEpsMax;
168 
169 // G4Mag_EqRhs* fEquation;
170 // G4Mag_SpinEqRhs* fEquation;
171 
172 // G4EqMagElectricField* fEquation;
173  G4EqEMFieldWithSpin* fEquation;
174 
175  G4FieldManager* fFieldManager;
176  G4PropagatorInField* fFieldPropagator;
177  G4MagIntegratorStepper* fStepper;
178  G4ChordFinder* fChordFinder;
179 
180  F04FieldMessenger* fFieldMessenger;
181 
182  F04DetectorConstruction* fDetectorConstruction;
183 
184 };
185 
186 #endif
void SetDeltaIntersection(G4double its)
Set the delta intersection length.
void SetEpsMax(G4double eps)
Set the maximum eps length.
Definition of the F04FieldMessenger class.
void SetEpsMin(G4double eps)
Set the minimum eps length.
void UpdateField()
updates all field tracking objects and Clear()
Definition of the F04ElementField class.
virtual void GetFieldValue(const G4double *point, G4double *field) const
#define G4ThreadLocal
Definition: tls.hh:52
int G4int
Definition: G4Types.hh:78
TFile f
Definition: plotHisto.C:6
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.