Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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::F01FieldSetup ( G4ThreeVector  fieldVector)

Definition at line 76 of file F01FieldSetup.cc.

77  : fFieldManager(0),
78  fChordFinder(0),
79  fEquation(0),
80  fMagneticField(new G4UniformMagField(fieldVector)),
81  fStepper(0),
82  fStepperType(0),
83  fMinStep(0.),
85 {
86  G4cout << " F01FieldSetup: magnetic field set to Uniform( "
87  << fieldVector << " ) " << G4endl;
88  InitialiseAll();
89 }
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::F01FieldSetup ( )

Definition at line 93 of file F01FieldSetup.cc.

94  : fFieldManager(0),
95  fChordFinder(0),
96  fEquation(0),
98  fStepper(0),
99  fStepperType(0),
100  fMinStep(0.),
101  fFieldMessenger(0)
102 {
103  G4cout << " F01FieldSetup: magnetic field set to Uniform( 0.0, 0, 0 ) "
104  << G4endl;
105  InitialiseAll();
106 }
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 ( )
virtual

Definition at line 127 of file F01FieldSetup.cc.

128 {
129  delete fMagneticField;
130  delete fChordFinder;
131  delete fStepper;
132  delete fFieldMessenger;
133 }
G4ChordFinder * fChordFinder
G4MagIntegratorStepper * fStepper
F01FieldMessenger * fFieldMessenger
G4MagneticField * fMagneticField

Member Function Documentation

void F01FieldSetup::CreateStepperAndChordFinder ( )

Definition at line 137 of file F01FieldSetup.cc.

138 {
139  // Update field
140 
141  G4cout<< " F01FieldSetup::CreateStepperAndChordFinder() called "
142  << " to reset Stepper." << G4endl;
143 
144  SetStepper();
145  G4cout<<"The minimal step is equal to "<<fMinStep/mm<<" mm"<<G4endl;
146 
148 
149  if (fChordFinder) delete fChordFinder;
150 
152 
154 }
static constexpr double mm
Definition: G4SIunits.hh:115
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

Here is the call graph for this function:

Here is the caller graph for this function:

G4ThreeVector F01FieldSetup::GetConstantFieldValue ( )
G4FieldManager * F01FieldSetup::GetGlobalFieldManager ( )
protected

Definition at line 310 of file F01FieldSetup.cc.

311 {
312  // Utility method
313 
315  ->GetFieldManager();
316 }
static G4TransportationManager * GetTransportationManager()
G4FieldManager * GetFieldManager() const

Here is the call graph for this function:

Here is the caller graph for this function:

void F01FieldSetup::InitialiseAll ( )

Definition at line 110 of file F01FieldSetup.cc.

111 {
113 
115 
116  fMinStep = 1.0*mm; // minimal step of 1 mm is default
117 
118  fStepperType = 4; // ClassicalRK4 is default stepper
119 
121  ->GetFieldManager();
123 }
static constexpr double mm
Definition: G4SIunits.hh:115
G4double fMinStep
G4Mag_UsualEqRhs * fEquation
G4FieldManager * fFieldManager
F01FieldMessenger * fFieldMessenger
static G4TransportationManager * GetTransportationManager()
G4FieldManager * GetFieldManager() const
void CreateStepperAndChordFinder()
G4MagneticField * fMagneticField

Here is the call graph for this function:

Here is the caller graph for this function:

void F01FieldSetup::SetFieldValue ( G4ThreeVector  fieldVector)

Definition at line 283 of file F01FieldSetup.cc.

284 {
285  // Set the value of the Global Field
286 
287  if (fMagneticField) delete fMagneticField;
288 
289  if (fieldVector != G4ThreeVector(0.,0.,0.))
290  {
291  fMagneticField = new G4UniformMagField(fieldVector);
292  }
293  else
294  {
295  // If the new field's value is Zero, signal it as below
296  // so that it is not used for propagation.
297  fMagneticField = 0;
298  }
299 
300  // Set this as the field of the global Field Manager
302 
303  // Now notify equation of new field
305 
306 }
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:

void F01FieldSetup::SetFieldValue ( G4double  fieldValue)

Definition at line 248 of file F01FieldSetup.cc.

249 {
250  // Set the value of the Global Field to fieldValue along Z
251 
252 #ifdef G4VERBOSE
253  G4cout << "Setting Field strength to "
254  << fieldStrength / gauss << " Gauss."; // << G4endl;
255 #endif
256 
257  G4ThreeVector fieldSetVec(0.0, 0.0, fieldStrength);
258  this->SetFieldValue( fieldSetVec );
259 
260 #ifdef G4VERBOSE
261  G4double fieldValue[6], position[4];
262  position[0] = position[1] = position[2] = position[3] = 0.0;
263  if ( fieldStrength != 0.0 ) {
264  fMagneticField->GetFieldValue( position, fieldValue);
265  G4ThreeVector fieldVec(fieldValue[0], fieldValue[1], fieldValue[2]);
266  // G4cout << " fMagneticField is now " << fMagneticField
267  G4cout << " Magnetic field vector is "
268  << fieldVec / gauss << " G " << G4endl;
269  } else {
270  if ( fMagneticField == 0 )
271  G4cout << " Magnetic field pointer is null." << G4endl;
272  else
273  G4Exception("F01FieldSetup::SetFieldValue(double)",
274  "IncorrectForZeroField",
276  "fMagneticField ptr should be set to 0 for no field.");
277  }
278 #endif
279 }
virtual void GetFieldValue(const G4double Point[4], G4double *Bfield) const =0
G4GLOB_DLL std::ostream G4cout
static constexpr double gauss
Definition: G4SIunits.hh:270
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
#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:

void F01FieldSetup::SetMinStep ( G4double  s)
inline

Definition at line 70 of file F01FieldSetup.hh.

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

Here is the caller graph for this function:

void F01FieldSetup::SetStepper ( )

Definition at line 158 of file F01FieldSetup.cc.

159 {
160 // Set stepper according to the stepper type
161 
162  if (fStepper) delete fStepper;
163 
164  switch ( fStepperType )
165  {
166  case 0:
168  G4cout<<"G4ExplicitEuler is chosen."<<G4endl;
169  break;
170  case 1:
172  G4cout<<"G4ImplicitEuler is chosen"<<G4endl;
173  break;
174  case 2:
176  G4cout<<"G4SimpleRunge is chosen"<<G4endl;
177  break;
178  case 3:
180  G4cout<<"G4SimpleHeum is chosen"<<G4endl;
181  break;
182  case 4:
184  G4cout<<"G4ClassicalRK4 (default) is chosen"<<G4endl;
185  break;
186  case 5:
188  G4cout<<"G4HelixExplicitEuler is chosen"<<G4endl;
189  break;
190  case 6:
192  G4cout<<"G4HelixImplicitEuler is chosen"<<G4endl;
193  break;
194  case 7:
196  G4cout<<"G4HelixSimpleRunge is chosen"<<G4endl;
197  break;
198  case 8:
200  G4cout<<"G4CashKarpRKF45 is chosen"<<G4endl;
201  break;
202  case 9:
204  G4cout<<"G4RKG3_Stepper is chosen"<<G4endl;
205  break;
206  case 10:
208  G4cout<<"G4ExactHelixStepper is chosen"<<G4endl;
209  break;
210  case 11:
212  G4cout<<"G4HelixMixedStepper is chosen"<<G4endl;
213  break;
214  case 12:
215  fStepper = new G4ConstRK4( fEquation );
216  G4cout<<"G4ConstRK4 Stepper is chosen"<<G4endl;
217  break;
218  case 13:
220  G4cout<<" G4NystromRK4 Stepper is chosen"<<G4endl;
221  break;
222  case 14:
223  case 23:
225  G4cout<<"G4BogackiShampine23 Stepper is chosen"<<G4endl;
226  break;
227  case 15:
228  case 45:
230  G4cout<<"G4BogackiShampine45 Stepper is chosen"<<G4endl;
231  break;
232  case 457:
233  case 745:
235  G4cout<<"G4DormandPrince745 Stepper is chosen"<<G4endl;
236  break;
237  default:
239  G4cout<<"G4ClassicalRK4 Stepper (default) is chosen"<<G4endl;
240  // fStepper = new G4DormandPrince745( fEquation );
241  // G4cout<<"G4DormandPrince745 (default) Stepper is chosen"<<G4endl;
242  break;
243  }
244 }
G4Mag_UsualEqRhs * fEquation
G4GLOB_DLL std::ostream G4cout
G4MagIntegratorStepper * fStepper
#define G4endl
Definition: G4ios.hh:61

Here is the caller graph for this function:

void F01FieldSetup::SetStepperType ( G4int  i)
inline

Definition at line 65 of file F01FieldSetup.hh.

void CreateStepperAndChordFinder()

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

G4ChordFinder* F01FieldSetup::fChordFinder
protected

Definition at line 86 of file F01FieldSetup.hh.

G4Mag_UsualEqRhs* F01FieldSetup::fEquation
protected

Definition at line 87 of file F01FieldSetup.hh.

G4FieldManager* F01FieldSetup::fFieldManager
protected

Definition at line 85 of file F01FieldSetup.hh.

F01FieldMessenger* F01FieldSetup::fFieldMessenger
protected

Definition at line 95 of file F01FieldSetup.hh.

G4MagneticField* F01FieldSetup::fMagneticField
protected

Definition at line 88 of file F01FieldSetup.hh.

G4double F01FieldSetup::fMinStep
protected

Definition at line 93 of file F01FieldSetup.hh.

G4MagIntegratorStepper* F01FieldSetup::fStepper
protected

Definition at line 90 of file F01FieldSetup.hh.

G4int F01FieldSetup::fStepperType
protected

Definition at line 91 of file F01FieldSetup.hh.


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