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#pragma once
13
14#include <globals.hh>
15#include <G4ApplicationState.hh>
16#include <G4ErrorPropagator.hh>
17
18class G4ErrorTarget;
19class G4ErrorTrajState;
20class G4RunManager;
21class G4VUserDetectorConstruction;
22class G4VPhysicalVolume;
23class G4VUserPhysicsList;
24class G4UserRunAction;
25class G4UserEventAction;
26class G4UserStackingAction;
27class G4UserTrackingAction;
28class G4UserSteppingAction;
29class G4MagneticField;
30class G4MagIntegratorStepper;
31class G4EquationOfMotion;
32class G4ChordFinder;
33class G4Mag_UsualEqRhs;
34class G4VisManager;
35class G4Track;
36class G4VExceptionHandler;
37
38namespace Belle2 {
43
44 namespace Simulation {
45
48 class ExtManager {
49
50 public:
51
54
56 static ExtManager* GetManager();
57
59 void EventTermination(G4ErrorMode);
60
62 void RunTermination();
63
65 void Initialize(const char [], const std::string&, double, double, bool, int, const std::vector<std::string>&);
66
68 void InitTrackPropagation(G4ErrorMode);
69
71 G4int PropagateOneStep(G4ErrorTrajState* currentTS, G4ErrorMode mode = G4ErrorMode_PropForwards);
72
74 inline G4ErrorPropagator* GetPropagator() const { return m_Propagator; }
75
76 private:
77
79 ExtManager();
80
83
86
87 private:
88
91
93 G4ApplicationState m_G4State;
94
96 G4ErrorPropagator* m_Propagator;
97
99 G4RunManager* m_G4RunMgr;
100
102 G4UserTrackingAction* m_TrackingAction;
103
105 G4UserSteppingAction* m_SteppingAction;
106
108 G4VExceptionHandler* m_StepExceptionHandler;
109
111 G4MagneticField* m_MagneticField;
112
114 G4MagneticField* m_UncachedField;
115
117 G4Mag_UsualEqRhs* m_MagFldEquation;
118
120 G4MagIntegratorStepper* m_Stepper;
121
123 G4ChordFinder* m_ChordFinder;
124
126 G4MagIntegratorStepper* m_StdStepper;
127
129 G4EquationOfMotion* m_ForwardEquationOfMotion;
130
132 G4EquationOfMotion* m_BackwardEquationOfMotion;
133
135 G4VisManager* m_VisManager;
136
137 };
138
139 } // end of namespace Simulation
140
142} // end of namespace Belle2
G4VisManager * m_VisManager
Pointer to the visualization manager (if used)
Definition ExtManager.h:135
G4RunManager * m_G4RunMgr
Pointer to the simulation's G4RunManager (if any)
Definition ExtManager.h:99
G4MagIntegratorStepper * m_Stepper
Pointer to the equation-of-motion stepper (if not the default)
Definition ExtManager.h:120
G4VExceptionHandler * m_StepExceptionHandler
Pointer to the G4VExceptionHandler used in PropagateOneStep()
Definition ExtManager.h:108
static ExtManager * GetManager()
Get pointer to the instance of this singleton class (create if needed)
Definition ExtManager.cc:71
G4MagIntegratorStepper * m_StdStepper
Pointer to the standard equation-of-motion stepper.
Definition ExtManager.h:126
void RunTermination()
Terminate a run and set state to G4ErrorState_Init.
void EventTermination(G4ErrorMode)
Terminate an event and set state to G4ErrorState_Init.
G4ErrorPropagator * GetPropagator() const
Get the propagator.
Definition ExtManager.h:74
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:90
G4MagneticField * m_UncachedField
Pointer to the uncached magnetic field (might be superseded by its cached version)
Definition ExtManager.h:114
G4Mag_UsualEqRhs * m_MagFldEquation
Pointer to the equation of motion in the magnetic field (if not the default)
Definition ExtManager.h:117
G4MagneticField * m_MagneticField
Pointer to the (un)cached magnetic field.
Definition ExtManager.h:111
G4UserTrackingAction * m_TrackingAction
Pointer to the simulation's TrackingAction (if any)
Definition ExtManager.h:102
G4EquationOfMotion * m_ForwardEquationOfMotion
Pointer to the forward-propagation equation of motion.
Definition ExtManager.h:129
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:93
G4UserSteppingAction * m_SteppingAction
Pointer to the simulation's SteppingAction (if any)
Definition ExtManager.h:105
void InitTrackPropagation(G4ErrorMode)
Initialize for propagation of a track and set state to G4ErrorState_Propagating.
ExtManager()
constructor is hidden: user calls ExtManager::GetManager() instead
Definition ExtManager.cc:77
G4EquationOfMotion * m_BackwardEquationOfMotion
Pointer to the equation of motion that accommodates back-propagation.
Definition ExtManager.h:132
void Initialize(const char[], const std::string &, double, double, bool, int, const std::vector< std::string > &)
Initialize Geant4 and Geant4e.
G4int PropagateOneStep(G4ErrorTrajState *currentTS, G4ErrorMode mode=G4ErrorMode_PropForwards)
Propagate a track by one step.
G4ChordFinder * m_ChordFinder
Pointer to the equation-of-motion chord finder (if not the default)
Definition ExtManager.h:123
G4ErrorPropagator * m_Propagator
Stores pointer to the propagator.
Definition ExtManager.h:96
Abstract base class for different kinds of events.