Geant4Manager.h
Go to the documentation of this file.
1 #ifndef _tls_Geant4Manager_h_
2 #define _tls_Geant4Manager_h_
3 
4 #include <utl/Singleton.h>
5 #include <tls/Geant4Customization.h>
6 #include <tls/GlobalPhysicsList.h>
7 #include <vector>
8 
9 
10 class G4RunManager;
11 class G4VUserDetectorConstruction;
12 class G4VUserPhysicsList;
13 class G4VisManager;
14 
15 namespace tls {
16 
17  class G4VPhysicsListCustomization;
18 
19 
52  class Geant4Manager : public utl::Singleton<Geant4Manager> {
53 
54  public:
55  G4RunManager* GetRunManager() { return fRunManager; }
56 
58  void SetDefaultPhysicsList(G4VUserPhysicsList* physicsList);
59 
61  void AddVisManager(G4VisManager* visManager);
62 
68 
72  void Customize(const std::string& name);
73 
75  void Reset();
76 
78  void NotifyDelete();
79 
80  void DumpProcesses();
81 
82  private:
83  Geant4Manager();
85 
86  // disable these two
89 
90  void InitPhysics();
91 
92  void SetVerbosity(int verbosity);
93 
94  G4RunManager* fRunManager = nullptr;
95 
97  G4VisManager* fVisManager = nullptr;
98  bool fPhysicsInitialized = false;
99  unsigned int fClosedModules = 0;
100  unsigned int fVerboseLevel = 0;
101 
102  std::map<std::string, Geant4Customization> fCustomizations;
103 
105 
107 
108  };
109 
110 }
111 
112 
113 #endif
G4VUserPhysicsList to aggregate physics lists to be used by multiple Geant4 modules in one offline se...
G4VisManager * fVisManager
Definition: Geant4Manager.h:97
class that handles multiple Geant4 runs in one offline session
Definition: Geant4Manager.h:52
Geant4Manager & operator=(const Geant4Manager &)
void Reset()
Undo the customizations introduced by the current configuration.
void AddCustomization(Geant4Customization &custom)
unsigned int fClosedModules
Definition: Geant4Manager.h:99
void AddVisManager(G4VisManager *visManager)
Add a visualization manager. Only one visualization manager is accepted.
GlobalPhysicsList * fMasterPhysicsList
Definition: Geant4Manager.h:96
G4RunManager * fRunManager
Definition: Geant4Manager.h:94
void NotifyDelete()
Book-keeping method. Call this to let the manager know your module does not need Geant4 anymore...
std::map< std::string, Geant4Customization > fCustomizations
Data structure to hold the different Geant4 global objects required to run a single module...
void SetVerbosity(int verbosity)
std::string fCurrentCustomization
unsigned int fVerboseLevel
void Customize(const std::string &name)
void SetDefaultPhysicsList(G4VUserPhysicsList *physicsList)
Set the default physics list. This will throw an exception if the run manager has been initialized al...
G4RunManager * GetRunManager()
Definition: Geant4Manager.h:55
Curiously Recurring Template Pattern (CRTP) for Meyers singleton.
Definition: Singleton.h:36

, generated on Tue Sep 26 2023.