Geant4  10.02.p03
F01FieldSetup Class Reference

#include <F01FieldSetup.hh>

Collaboration diagram for F01FieldSetup:

Public Member Functions

 F01FieldSetup (G4ThreeVector)
 
 F01FieldSetup ()
 
virtual ~F01FieldSetup ()
 
void SetStepperType (G4int i)
 
void SetStepper ()
 
void SetMinStep (G4double s)
 
void InitialiseAll ()
 
void CreateStepperAndChordFinder ()
 
void SetFieldValue (G4ThreeVector fieldVector)
 
void SetFieldValue (G4double fieldValue)
 
G4ThreeVector GetConstantFieldValue ()
 

Protected Member Functions

G4FieldManagerGetGlobalFieldManager ()
 

Protected Attributes

G4FieldManagerfFieldManager
 
G4ChordFinderfChordFinder
 
G4Mag_UsualEqRhsfEquation
 
G4MagneticFieldfMagneticField
 
G4MagIntegratorStepperfStepper
 
G4int fStepperType
 
G4double fMinStep
 
F01FieldMessengerfFieldMessenger
 

Detailed Description

Definition at line 57 of file F01FieldSetup.hh.

Constructor & Destructor Documentation

◆ F01FieldSetup() [1/2]

F01FieldSetup::F01FieldSetup ( G4ThreeVector  fieldVector)

Definition at line 71 of file F01FieldSetup.cc.

72  : fFieldManager(0),
73  fChordFinder(0),
74  fEquation(0),
75  fMagneticField(new G4UniformMagField(fieldVector)),
76  fStepper(0),
77  fStepperType(0),
78  fMinStep(0.),
80 {
81  G4cout << " F01FieldSetup: magnetic field set to Uniform( "
82  << fieldVector << " ) " << G4endl;
83  InitialiseAll();
84 }
G4double fMinStep
G4Mag_UsualEqRhs * fEquation
G4FieldManager * fFieldManager
G4ChordFinder * fChordFinder
G4GLOB_DLL std::ostream G4cout
G4MagIntegratorStepper * fStepper
F01FieldMessenger * fFieldMessenger
#define G4endl
Definition: G4ios.hh:61
G4MagneticField * fMagneticField
void InitialiseAll()
Here is the call graph for this function:

◆ F01FieldSetup() [2/2]

F01FieldSetup::F01FieldSetup ( )

Definition at line 88 of file F01FieldSetup.cc.

89  : fFieldManager(0),
90  fChordFinder(0),
91  fEquation(0),
93  fStepper(0),
94  fStepperType(0),
95  fMinStep(0.),
97 {
98  G4cout << " F01FieldSetup: magnetic field set to Uniform( 0.0, 0, 0 ) "
99  << G4endl;
100  InitialiseAll();
101 }
G4double fMinStep
CLHEP::Hep3Vector G4ThreeVector
G4Mag_UsualEqRhs * fEquation
G4FieldManager * fFieldManager
G4ChordFinder * fChordFinder
G4GLOB_DLL std::ostream G4cout
G4MagIntegratorStepper * fStepper
F01FieldMessenger * fFieldMessenger
#define G4endl
Definition: G4ios.hh:61
G4MagneticField * fMagneticField
void InitialiseAll()
Here is the call graph for this function:

◆ ~F01FieldSetup()

F01FieldSetup::~F01FieldSetup ( )
virtual

Definition at line 122 of file F01FieldSetup.cc.

123 {
124  delete fMagneticField;
125  delete fChordFinder;
126  delete fStepper;
127  delete fFieldMessenger;
128 }
G4ChordFinder * fChordFinder
G4MagIntegratorStepper * fStepper
F01FieldMessenger * fFieldMessenger
G4MagneticField * fMagneticField

Member Function Documentation

◆ CreateStepperAndChordFinder()

void F01FieldSetup::CreateStepperAndChordFinder ( )

Definition at line 132 of file F01FieldSetup.cc.

133 {
134  // Update field
135 
136  G4cout<< " F01FieldSetup::CreateStepperAndChordFinder() called "
137  << " to reset Stepper." << G4endl;
138 
139  SetStepper();
140  G4cout<<"The minimal step is equal to "<<fMinStep/mm<<" mm"<<G4endl;
141 
143 
144  if (fChordFinder) delete fChordFinder;
145 
147 
149 }
G4double fMinStep
G4bool SetDetectorField(G4Field *detectorField)
G4FieldManager * fFieldManager
G4ChordFinder * fChordFinder
void SetChordFinder(G4ChordFinder *aChordFinder)
G4GLOB_DLL std::ostream G4cout
G4MagIntegratorStepper * fStepper
#define G4endl
Definition: G4ios.hh:61
G4MagneticField * fMagneticField
static const double mm
Definition: G4SIunits.hh:114
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetConstantFieldValue()

G4ThreeVector F01FieldSetup::GetConstantFieldValue ( )
Here is the caller graph for this function:

◆ GetGlobalFieldManager()

G4FieldManager * F01FieldSetup::GetGlobalFieldManager ( )
protected

Definition at line 288 of file F01FieldSetup.cc.

289 {
290  // Utility method
291 
293  ->GetFieldManager();
294 }
G4FieldManager * GetFieldManager() const
static G4TransportationManager * GetTransportationManager()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitialiseAll()

void F01FieldSetup::InitialiseAll ( )

Definition at line 105 of file F01FieldSetup.cc.

106 {
108 
110 
111  fMinStep = 1.0*mm; // minimal step of 1 mm is default
112 
113  fStepperType = 4; // ClassicalRK4 is default stepper
114 
116  ->GetFieldManager();
118 }
G4double fMinStep
G4Mag_UsualEqRhs * fEquation
G4FieldManager * fFieldManager
F01FieldMessenger * fFieldMessenger
G4FieldManager * GetFieldManager() const
static G4TransportationManager * GetTransportationManager()
void CreateStepperAndChordFinder()
G4MagneticField * fMagneticField
static const double mm
Definition: G4SIunits.hh:114
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetFieldValue() [1/2]

void F01FieldSetup::SetFieldValue ( G4ThreeVector  fieldVector)

Definition at line 261 of file F01FieldSetup.cc.

262 {
263  // Set the value of the Global Field
264 
265  if (fMagneticField) delete fMagneticField;
266 
267  if (fieldVector != G4ThreeVector(0.,0.,0.))
268  {
269  fMagneticField = new G4UniformMagField(fieldVector);
270  }
271  else
272  {
273  // If the new field's value is Zero, signal it as below
274  // so that it is not used for propagation.
275  fMagneticField = 0;
276  }
277 
278  // Set this as the field of the global Field Manager
280 
281  // Now notify equation of new field
283 
284 }
G4FieldManager * GetGlobalFieldManager()
CLHEP::Hep3Vector G4ThreeVector
G4bool SetDetectorField(G4Field *detectorField)
G4Mag_UsualEqRhs * fEquation
void SetFieldObj(G4Field *pField)
G4MagneticField * fMagneticField
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetFieldValue() [2/2]

void F01FieldSetup::SetFieldValue ( G4double  fieldValue)

Definition at line 226 of file F01FieldSetup.cc.

227 {
228  // Set the value of the Global Field to fieldValue along Z
229 
230 #ifdef G4VERBOSE
231  G4cout << "Setting Field strength to "
232  << fieldStrength / gauss << " Gauss."; // << G4endl;
233 #endif
234 
235  G4ThreeVector fieldSetVec(0.0, 0.0, fieldStrength);
236  this->SetFieldValue( fieldSetVec );
237 
238 #ifdef G4VERBOSE
239  G4double fieldValue[6], position[4];
240  position[0] = position[1] = position[2] = position[3] = 0.0;
241  if ( fieldStrength != 0.0 ) {
242  fMagneticField->GetFieldValue( position, fieldValue);
243  G4ThreeVector fieldVec(fieldValue[0], fieldValue[1], fieldValue[2]);
244  // G4cout << " fMagneticField is now " << fMagneticField
245  G4cout << " Magnetic field vector is "
246  << fieldVec / gauss << " G " << G4endl;
247  } else {
248  if ( fMagneticField == 0 )
249  G4cout << " Magnetic field pointer is null." << G4endl;
250  else
251  G4Exception("F01FieldSetup::SetFieldValue(double)",
252  "IncorrectForZeroField",
254  "fMagneticField ptr should be set to 0 for no field.");
255  }
256 #endif
257 }
virtual void GetFieldValue(const G4double Point[4], G4double *Bfield) const =0
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
static const double gauss
Definition: G4SIunits.hh:267
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
void SetFieldValue(G4ThreeVector fieldVector)
G4MagneticField * fMagneticField
Here is the call graph for this function:

◆ SetMinStep()

void F01FieldSetup::SetMinStep ( G4double  s)
inline

Definition at line 70 of file F01FieldSetup.hh.

70 { fMinStep = s; }
G4double fMinStep
static const double s
Definition: G4SIunits.hh:168
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetStepper()

void F01FieldSetup::SetStepper ( )

Definition at line 153 of file F01FieldSetup.cc.

154 {
155 // Set stepper according to the stepper type
156 
157  if (fStepper) delete fStepper;
158 
159  switch ( fStepperType )
160  {
161  case 0:
163  G4cout<<"G4ExplicitEuler is chosen."<<G4endl;
164  break;
165  case 1:
167  G4cout<<"G4ImplicitEuler is chosen"<<G4endl;
168  break;
169  case 2:
171  G4cout<<"G4SimpleRunge is chosen"<<G4endl;
172  break;
173  case 3:
175  G4cout<<"G4SimpleHeum is chosen"<<G4endl;
176  break;
177  case 4:
179  G4cout<<"G4ClassicalRK4 (default) is chosen"<<G4endl;
180  break;
181  case 5:
183  G4cout<<"G4HelixExplicitEuler is chosen"<<G4endl;
184  break;
185  case 6:
187  G4cout<<"G4HelixImplicitEuler is chosen"<<G4endl;
188  break;
189  case 7:
191  G4cout<<"G4HelixSimpleRunge is chosen"<<G4endl;
192  break;
193  case 8:
195  G4cout<<"G4CashKarpRKF45 is chosen"<<G4endl;
196  break;
197  case 9:
199  G4cout<<"G4RKG3_Stepper is chosen"<<G4endl;
200  break;
201  case 10:
203  G4cout<<"G4ExactHelixStepper is chosen"<<G4endl;
204  break;
205  case 11:
207  G4cout<<"G4HelixMixedStepper is chosen"<<G4endl;
208  break;
209  case 12:
210  fStepper = new G4ConstRK4( fEquation );
211  G4cout<<"G4ConstRK4 Stepper is chosen"<<G4endl;
212  break;
213  case 13:
215  G4cout<<" G4NystromRK4 Stepper is chosen"<<G4endl;
216  break;
217  default: // fStepper = 4;
219  G4cout<<"G4ClassicalRK4 Stepper (default) is chosen"<<G4endl;
220  break;
221  }
222 }
G4Mag_UsualEqRhs * fEquation
G4GLOB_DLL std::ostream G4cout
G4MagIntegratorStepper * fStepper
#define G4endl
Definition: G4ios.hh:61
Here is the caller graph for this function:

◆ SetStepperType()

void F01FieldSetup::SetStepperType ( G4int  i)
inline

Definition at line 65 of file F01FieldSetup.hh.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ fChordFinder

G4ChordFinder* F01FieldSetup::fChordFinder
protected

Definition at line 86 of file F01FieldSetup.hh.

◆ fEquation

G4Mag_UsualEqRhs* F01FieldSetup::fEquation
protected

Definition at line 87 of file F01FieldSetup.hh.

◆ fFieldManager

G4FieldManager* F01FieldSetup::fFieldManager
protected

Definition at line 85 of file F01FieldSetup.hh.

◆ fFieldMessenger

F01FieldMessenger* F01FieldSetup::fFieldMessenger
protected

Definition at line 95 of file F01FieldSetup.hh.

◆ fMagneticField

G4MagneticField* F01FieldSetup::fMagneticField
protected

Definition at line 88 of file F01FieldSetup.hh.

◆ fMinStep

G4double F01FieldSetup::fMinStep
protected

Definition at line 93 of file F01FieldSetup.hh.

◆ fStepper

G4MagIntegratorStepper* F01FieldSetup::fStepper
protected

Definition at line 90 of file F01FieldSetup.hh.

◆ fStepperType

G4int F01FieldSetup::fStepperType
protected

Definition at line 91 of file F01FieldSetup.hh.


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