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