Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
F03FieldSetup Class Reference

#include <F03FieldSetup.hh>

Collaboration diagram for F03FieldSetup:

Public Member Functions

 F03FieldSetup ()
 
virtual ~F03FieldSetup ()
 
void SetStepperType (G4int i)
 
void SetStepper ()
 
void SetMinStep (G4double s)
 
void SetFieldValue (G4ThreeVector fieldVector)
 
void SetFieldValue (G4double fieldValue)
 
G4ThreeVector GetConstantFieldValue ()
 
void UpdateField ()
 
G4FieldManagerGetLocalFieldManager ()
 

Protected Member Functions

G4FieldManagerGetGlobalFieldManager ()
 

Protected Attributes

G4FieldManagerfFieldManager
 
G4FieldManagerfLocalFieldManager
 
G4ChordFinderfChordFinder
 
G4ChordFinderfLocalChordFinder
 
G4Mag_UsualEqRhsfEquation
 
G4Mag_UsualEqRhsfLocalEquation
 
G4MagneticFieldfMagneticField
 
G4MagneticFieldfLocalMagneticField
 
G4MagIntegratorStepperfStepper
 
G4MagIntegratorStepperfLocalStepper
 
G4int fStepperType
 
G4double fMinStep
 
F03FieldMessengerfFieldMessenger
 

Detailed Description

A class for setting up the Magnetic Field

It also creates the necessary classes to control accuracy of propagation. In this example

  • There is a global field for most of the setup;
  • A local field overides it for some volume(s) and it assumed to be uniform.

Definition at line 56 of file F03FieldSetup.hh.

Constructor & Destructor Documentation

F03FieldSetup::F03FieldSetup ( )

Definition at line 66 of file F03FieldSetup.cc.

67  : fFieldManager(0),
69  fChordFinder(0),
71  fEquation(0),
72  fLocalEquation(0),
73  fMagneticField(0),
75  fStepper(0),
76  fLocalStepper(0),
78 {
80  0.0, // 0.5*tesla,
81  0.0));
83  0.0, // 0.5*tesla,
84  0.0));
85 
87 
90 
91  fMinStep = 0.25*mm ; // minimal step of 1 mm is default
92  fStepperType = 4 ; // ClassicalRK4 is default stepper
93 
96 
97  UpdateField();
98 }
static constexpr double tesla
Definition: G4SIunits.hh:268
static constexpr double mm
Definition: G4SIunits.hh:115
CLHEP::Hep3Vector G4ThreeVector
G4MagIntegratorStepper * fStepper
G4ChordFinder * fChordFinder
G4Mag_UsualEqRhs * fLocalEquation
G4MagIntegratorStepper * fLocalStepper
G4MagneticField * fLocalMagneticField
F03FieldMessenger * fFieldMessenger
G4FieldManager * GetGlobalFieldManager()
G4ChordFinder * fLocalChordFinder
G4double fMinStep
G4FieldManager * fLocalFieldManager
G4Mag_UsualEqRhs * fEquation
G4MagneticField * fMagneticField
G4FieldManager * fFieldManager

Here is the call graph for this function:

F03FieldSetup::~F03FieldSetup ( )
virtual

Definition at line 102 of file F03FieldSetup.cc.

103 {
104  delete fMagneticField;
105  delete fChordFinder;
106  delete fStepper;
107  delete fFieldMessenger;
108 }
G4MagIntegratorStepper * fStepper
G4ChordFinder * fChordFinder
F03FieldMessenger * fFieldMessenger
G4MagneticField * fMagneticField

Member Function Documentation

G4ThreeVector F03FieldSetup::GetConstantFieldValue ( )

Definition at line 239 of file F03FieldSetup.cc.

240 {
241  static G4double fieldValue[6], position[4];
242  position[0] = position[1] = position[2] = position[3] = 0.0;
243 
244  fMagneticField->GetFieldValue( position, fieldValue);
245  G4ThreeVector fieldVec(fieldValue[0], fieldValue[1], fieldValue[2]);
246 
247  return fieldVec;
248 }
virtual void GetFieldValue(const G4double Point[4], G4double *Bfield) const =0
double G4double
Definition: G4Types.hh:76
G4MagneticField * fMagneticField

Here is the call graph for this function:

Here is the caller graph for this function:

G4FieldManager * F03FieldSetup::GetGlobalFieldManager ( )
protected

Definition at line 231 of file F03FieldSetup.cc.

232 {
234  ->GetFieldManager();
235 }
static G4TransportationManager * GetTransportationManager()
G4FieldManager * GetFieldManager() const

Here is the call graph for this function:

Here is the caller graph for this function:

G4FieldManager* F03FieldSetup::GetLocalFieldManager ( )
inline

Definition at line 74 of file F03FieldSetup.hh.

74 { return fLocalFieldManager;}
G4FieldManager * fLocalFieldManager

Here is the caller graph for this function:

void F03FieldSetup::SetFieldValue ( G4ThreeVector  fieldVector)

Definition at line 203 of file F03FieldSetup.cc.

204 {
205  if(fMagneticField) delete fMagneticField;
206 
207  if(fieldVector != G4ThreeVector(0.,0.,0.))
208  {
209  fMagneticField = new G4UniformMagField(fieldVector);
210  }
211  else
212  {
213  // If the new field's value is Zero, then
214  // setting the pointer to zero ensures
215  // that it is not used for propagation.
216  fMagneticField = 0;
217  }
218 
219  // Either
220  // - UpdateField() to reset all (ChordFinder, Equation);
221  // UpdateField();
222  // or simply update the field manager & equation of motion
223  // with pointer to new field
226 
227 }
CLHEP::Hep3Vector G4ThreeVector
G4bool SetDetectorField(G4Field *detectorField)
G4FieldManager * GetGlobalFieldManager()
void SetFieldObj(G4Field *pField)
G4Mag_UsualEqRhs * fEquation
G4MagneticField * fMagneticField

Here is the call graph for this function:

Here is the caller graph for this function:

void F03FieldSetup::SetFieldValue ( G4double  fieldValue)

Definition at line 195 of file F03FieldSetup.cc.

196 {
197  G4ThreeVector fieldSetVec(0.0, 0.0, fieldStrength);
198  SetFieldValue( fieldSetVec );
199 }
void SetFieldValue(G4ThreeVector fieldVector)

Here is the call graph for this function:

void F03FieldSetup::SetMinStep ( G4double  s)
inline

Definition at line 66 of file F03FieldSetup.hh.

66 { fMinStep = s; }
const XML_Char * s
Definition: expat.h:262
G4double fMinStep

Here is the caller graph for this function:

void F03FieldSetup::SetStepper ( )

Definition at line 133 of file F03FieldSetup.cc.

134 {
135  if (fStepper) delete fStepper;
136 
137  switch ( fStepperType )
138  {
139  case 0:
142  G4cout<<"G4ExplicitEuler is called"<<G4endl;
143  break;
144  case 1:
147  G4cout<<"G4ImplicitEuler is called"<<G4endl;
148  break;
149  case 2:
152  G4cout<<"G4SimpleRunge is called"<<G4endl;
153  break;
154  case 3:
157  G4cout<<"G4SimpleHeum is called"<<G4endl;
158  break;
159  case 4:
162  G4cout<<"G4ClassicalRK4 (default) is called"<<G4endl;
163  break;
164  case 5:
167  G4cout<<"G4HelixExplicitEuler is called"<<G4endl;
168  break;
169  case 6:
172  G4cout<<"G4HelixImplicitEuler is called"<<G4endl;
173  break;
174  case 7:
177  G4cout<<"G4HelixSimpleRunge is called"<<G4endl;
178  break;
179  case 8:
182  G4cout<<"G4CashKarpRKF45 is called"<<G4endl;
183  break;
184  case 9:
187  G4cout<<"G4RKG3_Stepper is called"<<G4endl;
188  break;
189  default: fStepper = 0;
190  }
191 }
G4MagIntegratorStepper * fStepper
G4Mag_UsualEqRhs * fLocalEquation
G4GLOB_DLL std::ostream G4cout
G4MagIntegratorStepper * fLocalStepper
#define G4endl
Definition: G4ios.hh:61
G4Mag_UsualEqRhs * fEquation

Here is the caller graph for this function:

void F03FieldSetup::SetStepperType ( G4int  i)
inline

Definition at line 62 of file F03FieldSetup.hh.

62 { fStepperType = i; }

Here is the caller graph for this function:

void F03FieldSetup::UpdateField ( )

Definition at line 112 of file F03FieldSetup.cc.

113 {
114  SetStepper();
115  G4cout<<"The minimal step is equal to "<<fMinStep/mm<<" mm"<<G4endl;
116 
119 
120  if (fChordFinder) delete fChordFinder;
122 
126 
129 }
static constexpr double mm
Definition: G4SIunits.hh:115
G4bool SetDetectorField(G4Field *detectorField)
G4MagIntegratorStepper * fStepper
G4ChordFinder * fChordFinder
void SetChordFinder(G4ChordFinder *aChordFinder)
G4GLOB_DLL std::ostream G4cout
G4MagIntegratorStepper * fLocalStepper
G4MagneticField * fLocalMagneticField
G4ChordFinder * fLocalChordFinder
G4double fMinStep
G4FieldManager * fLocalFieldManager
#define G4endl
Definition: G4ios.hh:61
G4MagneticField * fMagneticField
G4FieldManager * fFieldManager

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

G4ChordFinder* F03FieldSetup::fChordFinder
protected

Definition at line 84 of file F03FieldSetup.hh.

G4Mag_UsualEqRhs* F03FieldSetup::fEquation
protected

Definition at line 86 of file F03FieldSetup.hh.

G4FieldManager* F03FieldSetup::fFieldManager
protected

Definition at line 82 of file F03FieldSetup.hh.

F03FieldMessenger* F03FieldSetup::fFieldMessenger
protected

Definition at line 97 of file F03FieldSetup.hh.

G4ChordFinder* F03FieldSetup::fLocalChordFinder
protected

Definition at line 85 of file F03FieldSetup.hh.

G4Mag_UsualEqRhs* F03FieldSetup::fLocalEquation
protected

Definition at line 87 of file F03FieldSetup.hh.

G4FieldManager* F03FieldSetup::fLocalFieldManager
protected

Definition at line 83 of file F03FieldSetup.hh.

G4MagneticField* F03FieldSetup::fLocalMagneticField
protected

Definition at line 89 of file F03FieldSetup.hh.

G4MagIntegratorStepper* F03FieldSetup::fLocalStepper
protected

Definition at line 92 of file F03FieldSetup.hh.

G4MagneticField* F03FieldSetup::fMagneticField
protected

Definition at line 88 of file F03FieldSetup.hh.

G4double F03FieldSetup::fMinStep
protected

Definition at line 95 of file F03FieldSetup.hh.

G4MagIntegratorStepper* F03FieldSetup::fStepper
protected

Definition at line 91 of file F03FieldSetup.hh.

G4int F03FieldSetup::fStepperType
protected

Definition at line 93 of file F03FieldSetup.hh.


The documentation for this class was generated from the following files: