Belle II Software  release-05-02-19
ExtManager.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Leo Piilonen *
7  * Derived from: G4ErrorPropagatorManager *
8  * *
9  * This software is provided "as is" without any warranty. *
10  **************************************************************************/
11 
12 // It is the main interface for the user to define the setup and
13 // start the propagation. Initializes GEANT4 for the propagation.
14 
15 #ifndef EXTMANAGER_H
16 #define EXTMANAGER_H
17 
18 #include <globals.hh>
19 #include <G4ApplicationState.hh>
20 #include <G4ErrorPropagatorData.hh>
21 #include <G4ErrorPropagator.hh>
22 
23 class G4ErrorTarget;
24 class G4ErrorTrajState;
25 class G4RunManager;
26 class G4VUserDetectorConstruction;
27 class G4VPhysicalVolume;
28 class G4VUserPhysicsList;
29 class G4UserRunAction;
30 class G4UserEventAction;
31 class G4UserStackingAction;
32 class G4UserTrackingAction;
33 class G4UserSteppingAction;
34 class G4MagneticField;
35 class G4MagIntegratorStepper;
36 class G4EquationOfMotion;
37 class G4ChordFinder;
38 class G4Mag_UsualEqRhs;
39 class G4VisManager;
40 class G4Track;
41 class G4VExceptionHandler;
42 
43 namespace Belle2 {
49  namespace Simulation {
50 
53  class ExtManager {
54 
55  public:
56 
58  ~ExtManager();
59 
61  static ExtManager* GetManager();
62 
64  void EventTermination(G4ErrorMode);
65 
67  void RunTermination();
68 
70  void Initialize(const char [], const std::string&, double, double, bool, int, const std::vector<std::string>&);
71 
73  void InitTrackPropagation(G4ErrorMode);
74 
76  G4int PropagateOneStep(G4ErrorTrajState* currentTS, G4ErrorMode mode = G4ErrorMode_PropForwards);
77 
79  inline G4ErrorPropagator* GetPropagator() const { return m_Propagator; }
80 
81  private:
82 
84  ExtManager();
85 
87  ExtManager(ExtManager&) = delete;
88 
90  ExtManager& operator=(ExtManager&) = delete;
91 
92  private:
93 
96 
98  G4ApplicationState m_G4State;
99 
101  G4ErrorPropagator* m_Propagator;
102 
104  G4RunManager* m_G4RunMgr;
105 
107  G4UserTrackingAction* m_TrackingAction;
108 
110  G4UserSteppingAction* m_SteppingAction;
111 
113  G4VExceptionHandler* m_StepExceptionHandler;
114 
116  G4MagneticField* m_MagneticField;
117 
119  G4MagneticField* m_UncachedField;
120 
122  G4Mag_UsualEqRhs* m_MagFldEquation;
123 
125  G4MagIntegratorStepper* m_Stepper;
126 
128  G4ChordFinder* m_ChordFinder;
129 
131  G4MagIntegratorStepper* m_StdStepper;
132 
134  G4EquationOfMotion* m_ForwardEquationOfMotion;
135 
137  G4EquationOfMotion* m_BackwardEquationOfMotion;
138 
140  G4VisManager* m_VisManager;
141 
142  };
143 
144  } // end of namespace Simulation
145 
147 } // end of namespace Belle2
148 
149 #endif // EXTMANAGER_H
Belle2::Simulation::ExtManager::m_VisManager
G4VisManager * m_VisManager
Pointer to the visualization manager (if used)
Definition: ExtManager.h:140
Belle2::Simulation::ExtManager::InitTrackPropagation
void InitTrackPropagation(G4ErrorMode)
Initialize for propagation of a track and set state to G4ErrorState_Propagating.
Definition: ExtManager.cc:109
Belle2::Simulation::ExtManager::m_StepExceptionHandler
G4VExceptionHandler * m_StepExceptionHandler
Pointer to the G4VExceptionHandler used in PropagateOneStep()
Definition: ExtManager.h:113
Belle2::Simulation::ExtManager::m_ChordFinder
G4ChordFinder * m_ChordFinder
Pointer to the equation-of-motion chord finder (if not the default)
Definition: ExtManager.h:128
Belle2::Simulation::ExtManager::EventTermination
void EventTermination(G4ErrorMode)
Terminate an event and set state to G4ErrorState_Init.
Definition: ExtManager.cc:139
Belle2::Simulation::ExtManager
It is the main interface for the user to define the setup and start the propagation.
Definition: ExtManager.h:53
Belle2::Simulation::ExtManager::PropagateOneStep
G4int PropagateOneStep(G4ErrorTrajState *currentTS, G4ErrorMode mode=G4ErrorMode_PropForwards)
Propagate a track by one step.
Definition: ExtManager.cc:125
Belle2::Simulation::ExtManager::m_G4RunMgr
G4RunManager * m_G4RunMgr
Pointer to the simulation's G4RunManager (if any)
Definition: ExtManager.h:104
Belle2::Simulation::ExtManager::m_TrackingAction
G4UserTrackingAction * m_TrackingAction
Pointer to the simulation's TrackingAction (if any)
Definition: ExtManager.h:107
Belle2::Simulation::ExtManager::ExtManager
ExtManager()
constructor is hidden: user calls ExtManager::GetManager() instead
Definition: ExtManager.cc:81
Belle2::Simulation::ExtManager::m_G4State
G4ApplicationState m_G4State
Initial state of the G4RunManager (=PreInitif FullSimModule not present)
Definition: ExtManager.h:98
Belle2::Simulation::ExtManager::RunTermination
void RunTermination()
Terminate a run and set state to G4ErrorState_Init.
Definition: ExtManager.cc:153
Belle2::Simulation::ExtManager::GetManager
static ExtManager * GetManager()
Get pointer to the instance of this singleton class (create if needed)
Definition: ExtManager.cc:75
Belle2::Simulation::ExtManager::m_StdStepper
G4MagIntegratorStepper * m_StdStepper
Pointer to the standard equation-of-motion stepper.
Definition: ExtManager.h:131
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::Simulation::ExtManager::m_SteppingAction
G4UserSteppingAction * m_SteppingAction
Pointer to the simulation's SteppingAction (if any)
Definition: ExtManager.h:110
Belle2::Simulation::ExtManager::m_Manager
static ExtManager * m_Manager
Stores pointer to the singleton class.
Definition: ExtManager.h:95
Belle2::Simulation::ExtManager::GetPropagator
G4ErrorPropagator * GetPropagator() const
Get the propagator.
Definition: ExtManager.h:79
Belle2::Simulation::ExtManager::m_BackwardEquationOfMotion
G4EquationOfMotion * m_BackwardEquationOfMotion
Pointer to the equation of motion that accommodates back-propagation.
Definition: ExtManager.h:137
Belle2::Simulation::ExtManager::m_MagFldEquation
G4Mag_UsualEqRhs * m_MagFldEquation
Pointer to the equation of motion in the magnetic field (if not the default)
Definition: ExtManager.h:122
Belle2::Simulation::ExtManager::m_Propagator
G4ErrorPropagator * m_Propagator
Stores pointer to the propagator.
Definition: ExtManager.h:101
Belle2::Simulation::ExtManager::operator=
ExtManager & operator=(ExtManager &)=delete
Assignment operator is undefined for singleton; user calls ExtManager::GetManager() instead.
Belle2::Simulation::ExtManager::Initialize
void Initialize(const char[], const std::string &, double, double, bool, int, const std::vector< std::string > &)
Initialize Geant4 and Geant4e.
Definition: ExtManager.cc:179
Belle2::Simulation::ExtManager::~ExtManager
~ExtManager()
destructor
Definition: ExtManager.cc:103
Belle2::Simulation::ExtManager::m_Stepper
G4MagIntegratorStepper * m_Stepper
Pointer to the equation-of-motion stepper (if not the default)
Definition: ExtManager.h:125
Belle2::Simulation::ExtManager::m_MagneticField
G4MagneticField * m_MagneticField
Pointer to the (un)cached magnetic field.
Definition: ExtManager.h:116
Belle2::Simulation::ExtManager::m_UncachedField
G4MagneticField * m_UncachedField
Pointer to the uncached magnetic field (might be superseded by its cached version)
Definition: ExtManager.h:119
Belle2::Simulation::ExtManager::m_ForwardEquationOfMotion
G4EquationOfMotion * m_ForwardEquationOfMotion
Pointer to the forward-propagation equation of motion.
Definition: ExtManager.h:134