Analysis Software
Documentation for sPHENIX simulation software
|
#include <acts/blob/sPHENIX/Examples/Algorithms/Geant4/include/ActsExamples/Geant4/Geant4Manager.hpp>
Public Member Functions | |
Geant4Handle (int logLevel, std::unique_ptr< G4RunManager > runManager, std::unique_ptr< G4VUserPhysicsList > physicsList, std::string physicsListName) | |
Geant4Handle (const Geant4Handle &)=delete | |
Geant4Handle & | operator= (const Geant4Handle &)=delete |
~Geant4Handle () | |
void | tweakLogging (int level) const |
Public Attributes | |
std::mutex | mutex |
int | logLevel {} |
std::unique_ptr< G4RunManager > | runManager |
G4VUserPhysicsList * | physicsList |
std::string | physicsListName |
Manages the life time of G4RunManager and G4VUserPhysicsList.
G4RunManager must only be instantiated once and must be deleted at a later point before main ends.
In principle it should be possible to use multiple G4VUserPhysicsList objects during one G4RunManager lifecycle. But Geant4 does not provide a single way to achieve this and the user has to modify the correct state variables themselves. In this case we would bind much thighter on the API and future changes could potentially break our Geant4 state assumption. This is why the current interface only allows for a single G4VUserPhysicsList.
TODO A way out of this Geant4 lifecycle mess might be dynamically unloading and loading the Geant4 library which should reset it to its original state.
Definition at line 38 of file Geant4Manager.hpp.
View newest version in sPHENIX GitHub at line 38 of file Geant4Manager.hpp
ActsExamples::Geant4Handle::Geant4Handle | ( | int | logLevel, |
std::unique_ptr< G4RunManager > | runManager, | ||
std::unique_ptr< G4VUserPhysicsList > | physicsList, | ||
std::string | physicsListName | ||
) |
Definition at line 35 of file Geant4Manager.cpp.
View newest version in sPHENIX GitHub at line 35 of file Geant4Manager.cpp
References physicsList, and runManager.
|
delete |
|
default |
|
delete |
void ActsExamples::Geant4Handle::tweakLogging | ( | int | level | ) | const |
Set logging consistently across common Geant4 modules
Convenience method which calls into Geant4Manager
Definition at line 56 of file Geant4Manager.cpp.
View newest version in sPHENIX GitHub at line 56 of file Geant4Manager.cpp
References runManager, and ActsExamples::Geant4Manager::tweakLogging().
int ActsExamples::Geant4Handle::logLevel {} |
Definition at line 40 of file Geant4Manager.hpp.
View newest version in sPHENIX GitHub at line 40 of file Geant4Manager.hpp
std::mutex ActsExamples::Geant4Handle::mutex |
Definition at line 39 of file Geant4Manager.hpp.
View newest version in sPHENIX GitHub at line 39 of file Geant4Manager.hpp
G4VUserPhysicsList* ActsExamples::Geant4Handle::physicsList |
Definition at line 42 of file Geant4Manager.hpp.
View newest version in sPHENIX GitHub at line 42 of file Geant4Manager.hpp
Referenced by Geant4Handle().
std::string ActsExamples::Geant4Handle::physicsListName |
Definition at line 43 of file Geant4Manager.hpp.
View newest version in sPHENIX GitHub at line 43 of file Geant4Manager.hpp
std::unique_ptr<G4RunManager> ActsExamples::Geant4Handle::runManager |
Definition at line 41 of file Geant4Manager.hpp.
View newest version in sPHENIX GitHub at line 41 of file Geant4Manager.hpp
Referenced by Geant4Handle(), and tweakLogging().