ATLAS Offline Software
G4FieldManagerHelper.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef G4FieldManagerHelper_H
6 #define G4FieldManagerHelper_H
7 
16 #include "G4FieldManager.hh"
17 
19 {
23  inline G4bool SetMinAndMaxEpsilonStep( G4FieldManager *fieldMgr, double eps_min, double eps_max )
24  {
25  if( fieldMgr == nullptr ) { return false; }
26 
27  if( eps_min > fieldMgr->GetMaximumEpsilonStep() )
28  {
29  fieldMgr->SetMaximumEpsilonStep( eps_max );
30  fieldMgr->SetMinimumEpsilonStep( eps_min );
31  }
32  else
33  {
34  fieldMgr->SetMinimumEpsilonStep( eps_min );
35  fieldMgr->SetMaximumEpsilonStep( eps_max );
36  }
37  return eps_min <= eps_max;
38  }
39 }
40 
41 #endif
G4FieldManagerHelper
Definition: G4FieldManagerHelper.h:19
G4FieldManagerHelper::SetMinAndMaxEpsilonStep
G4bool SetMinAndMaxEpsilonStep(G4FieldManager *fieldMgr, double eps_min, double eps_max)
Set epsilon step range for a G4FieldManager instance accounting for Geant4 sanity checks.
Definition: G4FieldManagerHelper.h:23