Geant4  10.02.p03
G4ErrorPropagatorManager Class Reference

#include <G4ErrorPropagatorManager.hh>

Collaboration diagram for G4ErrorPropagatorManager:

Public Member Functions

 G4ErrorPropagatorManager ()
 
 ~G4ErrorPropagatorManager ()
 
void EventTermination ()
 
void RunTermination ()
 
void InitGeant4e ()
 
void InitTrackPropagation ()
 
G4bool InitFieldForBackwards ()
 
G4int Propagate (G4ErrorTrajState *currentTS, const G4ErrorTarget *target, G4ErrorMode mode=G4ErrorMode_PropForwards)
 
G4int PropagateOneStep (G4ErrorTrajState *currentTS, G4ErrorMode mode=G4ErrorMode_PropForwards)
 
G4bool CloseGeometry ()
 
void SetUserInitialization (G4VUserDetectorConstruction *userInit)
 
void SetUserInitialization (G4VPhysicalVolume *userInit)
 
void SetUserInitialization (G4VUserPhysicsList *userInit)
 
void SetUserAction (G4UserTrackingAction *userAction)
 
void SetUserAction (G4UserSteppingAction *userAction)
 
G4String PrintG4ErrorState ()
 
G4String PrintG4ErrorState (G4ErrorState state)
 
G4String PrintG4State ()
 
G4String PrintG4State (G4ApplicationState state)
 
G4ErrorRunManagerHelperGetErrorRunManagerHelper () const
 
void SetSteppingManagerVerboseLevel ()
 
G4ErrorPropagationNavigatorGetErrorPropagationNavigator () const
 
G4ErrorPropagatorGetPropagator () const
 

Static Public Member Functions

static G4ErrorPropagatorManagerGetErrorPropagatorManager ()
 

Private Member Functions

void StartG4ErrorRunManagerHelper ()
 
void StartNavigator ()
 

Private Attributes

G4ErrorRunManagerHelpertheG4ErrorRunManagerHelper
 
G4ErrorPropagatorthePropagator
 
G4Mag_UsualEqRhstheEquationOfMotion
 
G4ErrorPropagationNavigatortheG4ErrorPropagationNavigator
 

Static Private Attributes

static G4ThreadLocal G4ErrorPropagatorManagertheG4ErrorPropagatorManager = 0
 

Detailed Description

Definition at line 63 of file G4ErrorPropagatorManager.hh.

Constructor & Destructor Documentation

◆ G4ErrorPropagatorManager()

G4ErrorPropagatorManager::G4ErrorPropagatorManager ( )

Definition at line 80 of file G4ErrorPropagatorManager.cc.

81 {
82  //----- Initialize a few things
83  //o theG4ErrorPropagatorManager = this;
84 
85  char* g4emverb = getenv("G4EVERBOSE");
86  if( !g4emverb ) {
88  } else {
90  }
91 
92  thePropagator = 0;
93 
95 
97 
99 
101 
102  StartNavigator(); //navigator has to be initialized at the beggining !?!?!
103 
104 
105 }
void SetState(G4ErrorState sta)
static void SetVerbose(G4int ver)
G4ErrorPropagationNavigator * theG4ErrorPropagationNavigator
static G4ErrorPropagatorData * GetErrorPropagatorData()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~G4ErrorPropagatorManager()

G4ErrorPropagatorManager::~G4ErrorPropagatorManager ( )

Definition at line 109 of file G4ErrorPropagatorManager.cc.

110 {
111  delete theEquationOfMotion;
113  delete thePropagator;
116 }
G4ErrorRunManagerHelper * theG4ErrorRunManagerHelper
G4ErrorPropagationNavigator * theG4ErrorPropagationNavigator
static G4ThreadLocal G4ErrorPropagatorManager * theG4ErrorPropagatorManager

Member Function Documentation

◆ CloseGeometry()

G4bool G4ErrorPropagatorManager::CloseGeometry ( )

Definition at line 305 of file G4ErrorPropagatorManager.cc.

306 {
308  geomManager->OpenGeometry();
309  if( G4StateManager::GetStateManager()->GetCurrentState() != G4State_GeomClosed) {
311  }
312 
313  return TRUE;
314 }
static G4StateManager * GetStateManager()
G4bool SetNewState(G4ApplicationState requestedState)
#define TRUE
Definition: globals.hh:55
static G4GeometryManager * GetInstance()
void OpenGeometry(G4VPhysicalVolume *vol=0)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ EventTermination()

void G4ErrorPropagatorManager::EventTermination ( )

Definition at line 361 of file G4ErrorPropagatorManager.cc.

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

◆ GetErrorPropagationNavigator()

G4ErrorPropagationNavigator* G4ErrorPropagatorManager::GetErrorPropagationNavigator ( ) const
inline

Definition at line 133 of file G4ErrorPropagatorManager.hh.

G4ErrorPropagationNavigator * theG4ErrorPropagationNavigator

◆ GetErrorPropagatorManager()

G4ErrorPropagatorManager * G4ErrorPropagatorManager::GetErrorPropagatorManager ( )
static

Definition at line 69 of file G4ErrorPropagatorManager.cc.

70 {
71  if( theG4ErrorPropagatorManager == NULL ) {
73  }
74 
76 }
static G4ThreadLocal G4ErrorPropagatorManager * theG4ErrorPropagatorManager
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetErrorRunManagerHelper()

G4ErrorRunManagerHelper* G4ErrorPropagatorManager::GetErrorRunManagerHelper ( ) const
inline

Definition at line 128 of file G4ErrorPropagatorManager.hh.

129  { return theG4ErrorRunManagerHelper; }
G4ErrorRunManagerHelper * theG4ErrorRunManagerHelper
Here is the call graph for this function:

◆ GetPropagator()

G4ErrorPropagator* G4ErrorPropagatorManager::GetPropagator ( ) const
inline

Definition at line 136 of file G4ErrorPropagatorManager.hh.

137  { return thePropagator; }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitFieldForBackwards()

G4bool G4ErrorPropagatorManager::InitFieldForBackwards ( )

Definition at line 229 of file G4ErrorPropagatorManager.cc.

230 {
231 
232  if( G4ErrorPropagatorData::verbose() >= 4 ) G4cout << " G4ErrorPropagatorManager::InitFieldForBackwards() " << G4endl;
233  //----- Gets the current equation of motion
235  // G4cout << " fieldMgr " << fieldMgr << G4endl;
236  if( !fieldMgr ) return 0;
237 
238  // G4Field* myfield = fieldMgr->GetDetectorField();
239  G4ChordFinder* cf = fieldMgr ->GetChordFinder();
240  if( !cf ) return 0;
242  if( !mid ) return 0;
243  G4MagIntegratorStepper* stepper = const_cast<G4MagIntegratorStepper*>(mid->GetStepper());
244  if( !stepper ) return 0;
245  G4EquationOfMotion* equation = stepper->GetEquationOfMotion();
246 
247  //----- Replaces the equation by a G4ErrorMag_UsualEqRhs to handle backwards tracking
248  if ( !dynamic_cast<G4ErrorMag_UsualEqRhs*>(equation) ) {
249 
250  G4MagneticField* myfield = (G4MagneticField*)fieldMgr->GetDetectorField();
251 
252  // G4Mag_UsualEqRhs* fEquation_usual = dynamic_cast<G4Mag_UsualEqRhs*>(equation);
254 
255  //---- Pass the equation of motion to the G4MagIntegratorStepper
257 
258  //--- change stepper for speed tests
260  // G4MagIntegratorStepper* g4eStepper = new G4ExactHelixStepper(theEquationOfMotion);
261 
262  //----
263  G4MagneticField* field = static_cast<G4MagneticField*>(const_cast<G4Field*>(fieldMgr->GetDetectorField()));
264  G4ChordFinder* pChordFinder = new G4ChordFinder(field, 1.0e-2*mm, g4eStepper);
265 
266  fieldMgr->SetChordFinder(pChordFinder);
267 
268  }
269 
270  return 1;
271 }
G4ChordFinder * GetChordFinder()
void SetEquationOfMotion(G4EquationOfMotion *newEquation)
void SetChordFinder(G4ChordFinder *aChordFinder)
G4EquationOfMotion * GetEquationOfMotion()
G4GLOB_DLL std::ostream G4cout
const G4MagIntegratorStepper * GetStepper() const
G4FieldManager * GetFieldManager() const
static G4TransportationManager * GetTransportationManager()
#define G4endl
Definition: G4ios.hh:61
G4MagInt_Driver * GetIntegrationDriver()
static const double mm
Definition: G4SIunits.hh:114
const G4Field * GetDetectorField() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitGeant4e()

void G4ErrorPropagatorManager::InitGeant4e ( )

Definition at line 172 of file G4ErrorPropagatorManager.cc.

173 {
174  if( G4ErrorPropagatorData::verbose() >= 1 ) G4cout << "InitGeant4e GEANT4e State= " << PrintG4ErrorState() << " GEANT4 State= " << PrintG4State() << G4endl;
176  //----- Initialize run
177  // if( G4StateManager::GetStateManager()->GetCurrentState() == G4State_PreInit) {
178 
180  if ( currentState == G4State_PreInit || currentState == G4State_Idle) {
181  // G4eRunManager::GetRunManager()->Initialize();
184  }
185 
187 
188  //- G4StateManager::GetStateManager()->SetNewState(G4State_Idle);
189 
190  if( G4ErrorPropagatorData::verbose() >= 4 ) G4cout << " bef theG4ErrorPropagatorManager->RunInitialization() " << G4StateManager::GetStateManager()->GetCurrentState() << G4endl;
192  if( G4ErrorPropagatorData::verbose() >= 4 ) G4cout << " aft theG4ErrorPropagatorManager->RunInitialization() " << G4StateManager::GetStateManager()->GetCurrentState() << G4endl;
193 
194  if( !thePropagator ) thePropagator = new G4ErrorPropagator(); // currently the only propagator possible
195 
197  } else {
198  std::ostringstream message;
199  message << "Illegal GEANT4e State= " << PrintG4ErrorState();
200  G4Exception("G4ErrorPropagatorManager::InitGeant4e()",
201  "IllegalState", JustWarning, message);
202  }
203 
204  //----- Set the tracking geometry for this propagation
205  //t SetTrackingGeometry();
206  //----- Set the physics list for this propagation
207  //t SetPhysicsList();
208  //----- Set the field propagation parameters for this propagation
209  //t SetFieldPropagationParameters();
211 
212  if( G4ErrorPropagatorData::verbose() >= 2 ) G4cout << "End InitGeant4e GEANT4e State= " << PrintG4ErrorState() << " GEANT4 State= " << PrintG4State() << G4endl;
213 
214 
215 }
void SetState(G4ErrorState sta)
static G4StateManager * GetStateManager()
G4GLOB_DLL std::ostream G4cout
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
G4ErrorRunManagerHelper * theG4ErrorRunManagerHelper
#define G4endl
Definition: G4ios.hh:61
static G4ErrorPropagatorData * GetErrorPropagatorData()
G4ApplicationState GetCurrentState() const
G4ApplicationState
Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitTrackPropagation()

void G4ErrorPropagatorManager::InitTrackPropagation ( )

Definition at line 219 of file G4ErrorPropagatorManager.cc.

220 {
221  thePropagator->SetStepN( 0 );
222 
224 
225 }
void SetState(G4ErrorState sta)
void SetStepN(const G4int sn)
static G4ErrorPropagatorData * GetErrorPropagatorData()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintG4ErrorState() [1/2]

G4String G4ErrorPropagatorManager::PrintG4ErrorState ( )

Definition at line 376 of file G4ErrorPropagatorManager.cc.

377 {
379 }
static G4ErrorPropagatorData * GetErrorPropagatorData()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintG4ErrorState() [2/2]

G4String G4ErrorPropagatorManager::PrintG4ErrorState ( G4ErrorState  state)

Definition at line 383 of file G4ErrorPropagatorManager.cc.

384 {
385  G4String nam = "";
386  switch (state){
387  case G4ErrorState_PreInit:
388  nam = "G4ErrorState_PreInit";
389  break;
390  case G4ErrorState_Init:
391  nam = "G4ErrorState_Init";
392  break;
394  nam = "G4ErrorState_Propagating";
395  break;
397  nam = "G4ErrorState_TargetCloserThanBoundary";
398  break;
400  nam = "G4ErrorState_StoppedAtTarget";
401  break;
402  }
403 
404  return nam;
405 }

◆ PrintG4State() [1/2]

G4String G4ErrorPropagatorManager::PrintG4State ( )

Definition at line 409 of file G4ErrorPropagatorManager.cc.

410 {
411  return PrintG4State(G4StateManager::GetStateManager()->GetCurrentState());
412 }
static G4StateManager * GetStateManager()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PrintG4State() [2/2]

G4String G4ErrorPropagatorManager::PrintG4State ( G4ApplicationState  state)

Definition at line 416 of file G4ErrorPropagatorManager.cc.

417 {
418  G4String nam = "";
419  switch ( state ){
420  case G4State_PreInit:
421  nam = "G4State_PreInit";
422  break;
423  case G4State_Init:
424  nam = "G4State_Init";
425  break;
426  case G4State_Idle:
427  nam = "G4State_Idle";
428  break;
429  case G4State_GeomClosed:
430  nam = "G4State_GeomClosed";
431  break;
432  case G4State_EventProc:
433  nam = "G4State_EventProc";
434  break;
435  case G4State_Quit:
436  nam = "G4State_Quit";
437  break;
438  case G4State_Abort:
439  nam = "G4State_Abort";
440  break;
441  }
442 
443  return nam;
444 
445 }

◆ Propagate()

G4int G4ErrorPropagatorManager::Propagate ( G4ErrorTrajState currentTS,
const G4ErrorTarget target,
G4ErrorMode  mode = G4ErrorMode_PropForwards 
)

Definition at line 275 of file G4ErrorPropagatorManager.cc.

276 {
278  if( !thePropagator ) thePropagator = new G4ErrorPropagator(); // currently the only propagator possible
279 
282 
283  G4int ierr = thePropagator->Propagate( currentTS, target, mode );
284 
286 
287  return ierr;
288 }
G4int Propagate(G4ErrorTrajState *currentTS, const G4ErrorTarget *target, G4ErrorMode mode=G4ErrorMode_PropForwards)
int G4int
Definition: G4Types.hh:78
void SetMode(G4ErrorMode mode)
static G4ErrorPropagatorData * GetErrorPropagatorData()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ PropagateOneStep()

G4int G4ErrorPropagatorManager::PropagateOneStep ( G4ErrorTrajState currentTS,
G4ErrorMode  mode = G4ErrorMode_PropForwards 
)

Definition at line 292 of file G4ErrorPropagatorManager.cc.

293 {
295 
296  if( !thePropagator ) thePropagator = new G4ErrorPropagator(); // currently the only propagator possible
297 
299 
300  return thePropagator->PropagateOneStep( currentTS );
301 }
G4int PropagateOneStep(G4ErrorTrajState *currentTS)
void SetMode(G4ErrorMode mode)
static G4ErrorPropagatorData * GetErrorPropagatorData()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ RunTermination()

void G4ErrorPropagatorManager::RunTermination ( )

Definition at line 368 of file G4ErrorPropagatorManager.cc.

Here is the call graph for this function:

◆ SetSteppingManagerVerboseLevel()

void G4ErrorPropagatorManager::SetSteppingManagerVerboseLevel ( )

Definition at line 353 of file G4ErrorPropagatorManager.cc.

354 {
356  trkmgr->GetSteppingManager()->SetVerboseLevel( trkmgr->GetVerboseLevel() );
357 }
G4int GetVerboseLevel() const
void SetVerboseLevel(G4int vLevel)
G4SteppingManager * GetSteppingManager() const
static G4EventManager * GetEventManager()
G4TrackingManager * GetTrackingManager() const
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetUserAction() [1/2]

void G4ErrorPropagatorManager::SetUserAction ( G4UserTrackingAction userAction)

Definition at line 339 of file G4ErrorPropagatorManager.cc.

340 {
342 }
void SetUserAction(G4UserEventAction *userAction)
static G4EventManager * GetEventManager()
Here is the call graph for this function:

◆ SetUserAction() [2/2]

void G4ErrorPropagatorManager::SetUserAction ( G4UserSteppingAction userAction)

Definition at line 346 of file G4ErrorPropagatorManager.cc.

347 {
349 }
void SetUserAction(G4UserEventAction *userAction)
static G4EventManager * GetEventManager()
Here is the call graph for this function:

◆ SetUserInitialization() [1/3]

void G4ErrorPropagatorManager::SetUserInitialization ( G4VUserDetectorConstruction userInit)

Definition at line 318 of file G4ErrorPropagatorManager.cc.

319 {
321 }
G4ErrorRunManagerHelper * theG4ErrorRunManagerHelper
void SetUserInitialization(G4VUserDetectorConstruction *userInit)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SetUserInitialization() [2/3]

void G4ErrorPropagatorManager::SetUserInitialization ( G4VPhysicalVolume userInit)

Definition at line 325 of file G4ErrorPropagatorManager.cc.

326 {
328 }
G4ErrorRunManagerHelper * theG4ErrorRunManagerHelper
void SetUserInitialization(G4VUserDetectorConstruction *userInit)
Here is the call graph for this function:

◆ SetUserInitialization() [3/3]

void G4ErrorPropagatorManager::SetUserInitialization ( G4VUserPhysicsList userInit)

Definition at line 332 of file G4ErrorPropagatorManager.cc.

333 {
335 }
G4ErrorRunManagerHelper * theG4ErrorRunManagerHelper
void SetUserInitialization(G4VUserDetectorConstruction *userInit)
Here is the call graph for this function:

◆ StartG4ErrorRunManagerHelper()

void G4ErrorPropagatorManager::StartG4ErrorRunManagerHelper ( )
private

Definition at line 120 of file G4ErrorPropagatorManager.cc.

121 {
122  //----- Initialize G4ErrorRunManagerHelper
124 
125  if( theG4ErrorRunManagerHelper == 0 ) {
127  }
128 
129  //----- User Initialization classes
130  //--- GEANT4e PhysicsList
131  if( G4ErrorPropagatorData::verbose() >= 4 ) G4cout << " G4ErrorPropagatorManager::StartG4eRunManager() done " << theG4ErrorRunManagerHelper << G4endl;
132  //- theG4eRunManager->SetUserInitialization(new G4ErrorPhysicsList);
133 
134 }
G4GLOB_DLL std::ostream G4cout
G4ErrorRunManagerHelper * theG4ErrorRunManagerHelper
#define G4endl
Definition: G4ios.hh:61
static G4ErrorRunManagerHelper * GetRunManagerKernel()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ StartNavigator()

void G4ErrorPropagatorManager::StartNavigator ( )
private

Definition at line 138 of file G4ErrorPropagatorManager.cc.

139 {
140  if( theG4ErrorPropagationNavigator == 0 ) {
142 
143  G4Navigator* g4navi = transportationManager->GetNavigatorForTracking();
144 
145  G4VPhysicalVolume* world = g4navi->GetWorldVolume();
146  G4int verb = g4navi->GetVerboseLevel();
147  delete g4navi;
148 
150 
151  if( world != 0 ) {
153  }
155 
157  transportationManager->GetPropagatorInField()->GetIntersectionLocator()
161  // G4ThreeVector center(0,0,0);
162  // theG4ErrorPropagationNavigator->LocateGlobalPointAndSetup(center,0,false);
163 
164  }
165 
166  if( G4ErrorPropagatorData::verbose() >= 2 ) G4cout << " theState at StartNavigator " << PrintG4ErrorState() << G4endl;
167 
168 }
void SetNavigator(G4Navigator *value)
G4SteppingManager * GetSteppingManager() const
int G4int
Definition: G4Types.hh:78
G4int GetVerboseLevel() const
void SetVerboseLevel(G4int level)
G4GLOB_DLL std::ostream G4cout
G4Navigator * GetNavigatorForTracking() const
static G4TransportationManager * GetTransportationManager()
G4ErrorPropagationNavigator * theG4ErrorPropagationNavigator
void SetWorldVolume(G4VPhysicalVolume *pWorld)
static G4EventManager * GetEventManager()
void SetNavigatorFor(G4Navigator *fNavigator)
#define G4endl
Definition: G4ios.hh:61
G4PropagatorInField * GetPropagatorInField() const
G4VIntersectionLocator * GetIntersectionLocator()
void SetNavigatorForTracking(G4Navigator *newNavigator)
G4TrackingManager * GetTrackingManager() const
G4VPhysicalVolume * GetWorldVolume() const
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ theEquationOfMotion

G4Mag_UsualEqRhs* G4ErrorPropagatorManager::theEquationOfMotion
private

Definition at line 156 of file G4ErrorPropagatorManager.hh.

◆ theG4ErrorPropagationNavigator

G4ErrorPropagationNavigator* G4ErrorPropagatorManager::theG4ErrorPropagationNavigator
private

Definition at line 158 of file G4ErrorPropagatorManager.hh.

◆ theG4ErrorPropagatorManager

G4ThreadLocal G4ErrorPropagatorManager * G4ErrorPropagatorManager::theG4ErrorPropagatorManager = 0
staticprivate

Definition at line 150 of file G4ErrorPropagatorManager.hh.

◆ theG4ErrorRunManagerHelper

G4ErrorRunManagerHelper* G4ErrorPropagatorManager::theG4ErrorRunManagerHelper
private

Definition at line 152 of file G4ErrorPropagatorManager.hh.

◆ thePropagator

G4ErrorPropagator* G4ErrorPropagatorManager::thePropagator
private

Definition at line 154 of file G4ErrorPropagatorManager.hh.


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