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

#include <F02ElectricFieldSetup.hh>

Public Member Functions

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

Protected Member Functions

G4FieldManagerGetGlobalFieldManager ()
 

Detailed Description

A class for control of the Electric Field of the detector.

The field for this case is uniform. It is simply a 'setup' class that creates the field and necessary other parts

Definition at line 57 of file F02ElectricFieldSetup.hh.

Constructor & Destructor Documentation

F02ElectricFieldSetup::F02ElectricFieldSetup ( G4ThreeVector  fieldVector)

Definition at line 93 of file F02ElectricFieldSetup.cc.

94  : fFieldManager(0),
95  fChordFinder(0),
96  fEquation(0),
97  fEMfield(0),
98  fElFieldValue(),
99  fStepper(0),
100  fIntgrDriver(0),
101  fStepperType(4), // ClassicalRK4 -- the default stepper
102  fMinStep(0.010*mm) // minimal step of 10 microns
103 {
104  fEMfield = new G4UniformElectricField(fieldVector);
105  fEquation = new G4EqMagElectricField(fEMfield);
106 
107  fFieldManager = GetGlobalFieldManager();
108  fFieldMessenger = new F02FieldMessenger(this);
109 
110  UpdateField();
111 }
static constexpr double mm
Definition: G4SIunits.hh:115
G4FieldManager * GetGlobalFieldManager()
#define fMinStep

Here is the call graph for this function:

F02ElectricFieldSetup::F02ElectricFieldSetup ( )

Definition at line 71 of file F02ElectricFieldSetup.cc.

72  : fFieldManager(0),
73  fChordFinder(0),
74  fEquation(0),
75  fEMfield(0),
76  fElFieldValue(),
77  fStepper(0),
78  fIntgrDriver(0),
79  fStepperType(4), // ClassicalRK4 -- the default stepper
80  fMinStep(0.010*mm) // minimal step of 10 microns
81 {
82  fEMfield = new G4UniformElectricField(
83  G4ThreeVector(0.0,100000.0*kilovolt/cm,0.0));
84  fEquation = new G4EqMagElectricField(fEMfield);
85 
86  fFieldManager = GetGlobalFieldManager();
87  fFieldMessenger = new F02FieldMessenger(this);
88  UpdateField();
89 }
static constexpr double mm
Definition: G4SIunits.hh:115
static constexpr double kilovolt
Definition: G4SIunits.hh:243
CLHEP::Hep3Vector G4ThreeVector
G4FieldManager * GetGlobalFieldManager()
static constexpr double cm
Definition: G4SIunits.hh:119
#define fMinStep

Here is the call graph for this function:

F02ElectricFieldSetup::~F02ElectricFieldSetup ( )
virtual

Definition at line 115 of file F02ElectricFieldSetup.cc.

116 {
117  delete fChordFinder;
118  delete fStepper;
119  delete fEquation;
120  delete fEMfield;
121  delete fFieldMessenger;
122 }

Member Function Documentation

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

Definition at line 243 of file F02ElectricFieldSetup.cc.

244 {
245 // Utility method
246 
248  ->GetFieldManager();
249 }
static G4TransportationManager * GetTransportationManager()
G4FieldManager * GetFieldManager() const

Here is the call graph for this function:

Here is the caller graph for this function:

void F02ElectricFieldSetup::SetFieldValue ( G4ThreeVector  fieldVector)

Definition at line 218 of file F02ElectricFieldSetup.cc.

219 {
220  if (fEMfield) delete fEMfield;
221 
222  // Set the value of the Global Field value to fieldVector
223 
224  // Find the Field Manager for the global field
226 
227  if (fieldVector != G4ThreeVector(0.,0.,0.))
228  {
229  fEMfield = new G4UniformElectricField(fieldVector);
230  }
231  else
232  {
233  // If the new field's value is Zero, then it is best to
234  // insure that it is not used for propagation.
235  fEMfield = 0;
236  }
237  fieldMgr->SetDetectorField(fEMfield);
238  fEquation->SetFieldObj(fEMfield); // must now point to the new field
239 }
CLHEP::Hep3Vector G4ThreeVector
G4bool SetDetectorField(G4Field *detectorField)
G4FieldManager * GetGlobalFieldManager()
void SetFieldObj(G4Field *pField)

Here is the call graph for this function:

Here is the caller graph for this function:

void F02ElectricFieldSetup::SetFieldValue ( G4double  fieldValue)

Definition at line 207 of file F02ElectricFieldSetup.cc.

208 {
209  // Set the value of the Global Field to fieldValue along Z
210 
211  G4ThreeVector fieldVector( 0.0, 0.0, fieldValue );
212 
213  SetFieldValue( fieldVector );
214 }
void SetFieldValue(G4ThreeVector fieldVector)

Here is the call graph for this function:

void F02ElectricFieldSetup::SetMinStep ( G4double  s)
inline

Definition at line 69 of file F02ElectricFieldSetup.hh.

69 { fMinStep = s ; }
const XML_Char * s
Definition: expat.h:262
#define fMinStep

Here is the caller graph for this function:

void F02ElectricFieldSetup::SetStepper ( )

Definition at line 150 of file F02ElectricFieldSetup.cc.

151 {
152 // Set stepper according to the stepper type
153 
154  G4int nvar = 8;
155 
156  if (fStepper) delete fStepper;
157 
158  switch ( fStepperType )
159  {
160  case 0:
161  fStepper = new G4ExplicitEuler( fEquation, nvar );
162  G4cout<<"G4ExplicitEuler is calledS"<<G4endl;
163  break;
164  case 1:
165  fStepper = new G4ImplicitEuler( fEquation, nvar );
166  G4cout<<"G4ImplicitEuler is called"<<G4endl;
167  break;
168  case 2:
169  fStepper = new G4SimpleRunge( fEquation, nvar );
170  G4cout<<"G4SimpleRunge is called"<<G4endl;
171  break;
172  case 3:
173  fStepper = new G4SimpleHeum( fEquation, nvar );
174  G4cout<<"G4SimpleHeum is called"<<G4endl;
175  break;
176  case 4:
177  fStepper = new G4ClassicalRK4( fEquation, nvar );
178  G4cout<<"G4ClassicalRK4 (default) is called"<<G4endl;
179  break;
180  case 5:
181  fStepper = new G4CashKarpRKF45( fEquation, nvar );
182  G4cout<<"G4CashKarpRKF45 is called"<<G4endl;
183  break;
184  case 6:
185  fStepper = 0; // new G4RKG3_Stepper( fEquation, nvar );
186  G4cout<<"G4RKG3_Stepper is not currently working for Electric Field"
187  <<G4endl;
188  break;
189  case 7:
190  fStepper = 0; // new G4HelixExplicitEuler( fEquation );
191  G4cout<<"G4HelixExplicitEuler is not valid for Electric Field"<<G4endl;
192  break;
193  case 8:
194  fStepper = 0; // new G4HelixImplicitEuler( fEquation );
195  G4cout<<"G4HelixImplicitEuler is not valid for Electric Field"<<G4endl;
196  break;
197  case 9:
198  fStepper = 0; // new G4HelixSimpleRunge( fEquation );
199  G4cout<<"G4HelixSimpleRunge is not valid for Electric Field"<<G4endl;
200  break;
201  default: fStepper = 0;
202  }
203 }
int G4int
Definition: G4Types.hh:78
G4GLOB_DLL std::ostream G4cout
#define G4endl
Definition: G4ios.hh:61

Here is the caller graph for this function:

void F02ElectricFieldSetup::SetStepperType ( G4int  i)
inline

Definition at line 65 of file F02ElectricFieldSetup.hh.

65 { fStepperType = i ; }

Here is the caller graph for this function:

void F02ElectricFieldSetup::UpdateField ( )

Definition at line 126 of file F02ElectricFieldSetup.cc.

127 {
128 // Register this field to 'global' Field Manager and
129 // Create Stepper and Chord Finder with predefined type, minstep (resp.)
130 
131  SetStepper();
132 
133  G4cout<<"The minimal step is equal to "<<fMinStep/mm<<" mm"<<G4endl;
134 
135  fFieldManager->SetDetectorField(fEMfield);
136 
137  if (fChordFinder) delete fChordFinder;
138 
139  fIntgrDriver = new G4MagInt_Driver(fMinStep,
140  fStepper,
141  fStepper->GetNumberOfVariables());
142 
143  fChordFinder = new G4ChordFinder(fIntgrDriver);
144 
145  fFieldManager->SetChordFinder(fChordFinder);
146 }
static constexpr double mm
Definition: G4SIunits.hh:115
G4bool SetDetectorField(G4Field *detectorField)
void SetChordFinder(G4ChordFinder *aChordFinder)
G4int GetNumberOfVariables() const
G4GLOB_DLL std::ostream G4cout
#define fMinStep
#define G4endl
Definition: G4ios.hh:61

Here is the call graph for this function:

Here is the caller graph for this function:


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