LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
#include "G4Helper.h"
Public Member Functions | |
G4Helper () | |
Standard constructor and destructor for an FMWK module. More... | |
G4Helper (std::string const &g4macropath, std::string const &g4physicslist="QGSP_BERT", std::string const &gdmlFile="") | |
virtual | ~G4Helper () |
void | SetParallelWorlds (std::vector< G4VUserParallelWorld * > pworlds) |
void | SetVolumeStepLimit (std::string const &volumeName, double maxStepSize) |
void | SetOverlapCheck (bool check) |
void | SetValidateGDMLSchema (bool validate) |
void | ConstructDetector (std::string const &gdmlFile) |
void | InitPhysics () |
Initialization for the Geant4 Monte Carlo. More... | |
void | SetUserAction () |
Initialization for the Geant4 Monte Carlo. More... | |
bool | G4Run (std::vector< const simb::MCTruth * > &primaries) |
bool | G4Run (art::Ptr< simb::MCTruth > &primary) |
bool | G4Run (const simb::MCTruth *primary) |
G4RunManager * | GetRunManager () |
Protected Member Functions | |
void | SetPhysicsList (std::string physicsList) |
Protected Attributes | |
std::string | fG4MacroPath |
to be executed before main MC processing. More... | |
std::string | fG4PhysListName |
Name of physics list to use. More... | |
std::string | fGDMLFile |
Name of the gdml file containing the detector Geometry. More... | |
bool | fCheckOverlaps |
Have G4GDML check for overlaps? More... | |
bool | fValidateGDMLSchema |
Have G4GDML validate geometry schema? More... | |
bool | fUseStepLimits |
Set in SetVolumeStepLimit. More... | |
G4RunManager * | fRunManager |
Geant4's run manager. More... | |
G4UImanager * | fUIManager |
Geant4's user-interface manager. More... | |
ConvertMCTruthToG4 * | fConvertMCTruth |
Geant4 event generator. More... | |
DetectorConstruction * | fDetector |
DetectorConstruction object. More... | |
std::vector< G4VUserParallelWorld * > | fParallelWorlds |
list of parallel worlds More... | |
Definition at line 47 of file G4Helper.h.
g4b::G4Helper::G4Helper | ( | ) |
Standard constructor and destructor for an FMWK module.
Definition at line 51 of file G4Helper.cxx.
References fParallelWorlds.
g4b::G4Helper::G4Helper | ( | std::string const & | g4macropath, |
std::string const & | g4physicslist = "QGSP_BERT" , |
||
std::string const & | gdmlFile = "" |
||
) |
Definition at line 64 of file G4Helper.cxx.
References fParallelWorlds, fRunManager, and fUIManager.
|
virtual |
Definition at line 89 of file G4Helper.cxx.
References g4b::UserActionManager::Close(), g4b::UserActionManager::DoesAnyActionProvideStacking(), fParallelWorlds, fRunManager, g4b::UserActionManager::Instance(), MF_LOG_ERROR, and g4b::vm_.
void g4b::G4Helper::ConstructDetector | ( | std::string const & | gdmlFile | ) |
Definition at line 342 of file G4Helper.cxx.
References fCheckOverlaps, fDetector, and fValidateGDMLSchema.
Referenced by InitPhysics().
bool g4b::G4Helper::G4Run | ( | std::vector< const simb::MCTruth * > & | primaries | ) |
Definition at line 477 of file G4Helper.cxx.
References g4b::ConvertMCTruthToG4::Append(), fConvertMCTruth, fUIManager, and g4b::ConvertMCTruthToG4::Reset().
Referenced by G4Run().
bool g4b::G4Helper::G4Run | ( | art::Ptr< simb::MCTruth > & | primary | ) |
Definition at line 453 of file G4Helper.cxx.
References G4Run(), and art::Ptr< T >::get().
bool g4b::G4Helper::G4Run | ( | const simb::MCTruth * | primary | ) |
Definition at line 459 of file G4Helper.cxx.
References g4b::ConvertMCTruthToG4::Append(), fConvertMCTruth, fUIManager, and g4b::ConvertMCTruthToG4::Reset().
|
inline |
Definition at line 100 of file G4Helper.h.
void g4b::G4Helper::InitPhysics | ( | ) |
Initialization for the Geant4 Monte Carlo.
Definition at line 381 of file G4Helper.cxx.
References ConstructDetector(), fConvertMCTruth, fDetector, fG4PhysListName, fGDMLFile, fParallelWorlds, fRunManager, and SetPhysicsList().
|
inline |
Definition at line 128 of file G4Helper.h.
void g4b::G4Helper::SetParallelWorlds | ( | std::vector< G4VUserParallelWorld * > | pworlds | ) |
Definition at line 331 of file G4Helper.cxx.
References fParallelWorlds, and MF_LOG_DEBUG.
|
protected |
Set up the physics list for Geant4, and pass it to Geant4's run manager. Without a physics list, Geant4 won't do anything. G4 comes with a number of pre-constructed lists, and for now I plan to use "QGSP_BERT". It has the following properties:
if we decide that QGSP_BERT is not what we want, then we will have to write a new physics list class that derives from G4VUserPhysicsList that does what we want.
Definition at line 138 of file G4Helper.cxx.
References fRunManager, fUIManager, fUseStepLimits, MF_LOG_ERROR, MF_LOG_VERBATIM, and MF_LOG_WARNING.
Referenced by InitPhysics().
void g4b::G4Helper::SetUserAction | ( | ) |
Initialization for the Geant4 Monte Carlo.
Tell Geant4 to initialize the run manager. We're ready to simulate events in the detector.
Definition at line 406 of file G4Helper.cxx.
References g4b::UserActionManager::DoesAnyActionProvideStacking(), fG4MacroPath, fRunManager, fUIManager, and g4b::UserActionManager::Instance().
|
inline |
Definition at line 129 of file G4Helper.h.
void g4b::G4Helper::SetVolumeStepLimit | ( | std::string const & | volumeName, |
double | maxStepSize | ||
) |
Definition at line 355 of file G4Helper.cxx.
References fUseStepLimits, and MF_LOG_WARNING.
|
protected |
Have G4GDML check for overlaps?
Definition at line 113 of file G4Helper.h.
Referenced by ConstructDetector().
|
protected |
Geant4 event generator.
Converts MCTruth objects;
Definition at line 119 of file G4Helper.h.
Referenced by G4Run(), and InitPhysics().
|
protected |
DetectorConstruction object.
Definition at line 121 of file G4Helper.h.
Referenced by ConstructDetector(), and InitPhysics().
|
protected |
to be executed before main MC processing.
Full directory path for Geant4 macro file
Definition at line 109 of file G4Helper.h.
Referenced by SetUserAction().
|
protected |
Name of physics list to use.
Definition at line 111 of file G4Helper.h.
Referenced by InitPhysics().
|
protected |
Name of the gdml file containing the detector Geometry.
Definition at line 112 of file G4Helper.h.
Referenced by InitPhysics().
|
protected |
list of parallel worlds
Definition at line 122 of file G4Helper.h.
Referenced by G4Helper(), InitPhysics(), SetParallelWorlds(), and ~G4Helper().
|
protected |
Geant4's run manager.
Definition at line 117 of file G4Helper.h.
Referenced by G4Helper(), InitPhysics(), SetPhysicsList(), SetUserAction(), and ~G4Helper().
|
protected |
Geant4's user-interface manager.
Definition at line 118 of file G4Helper.h.
Referenced by G4Helper(), G4Run(), SetPhysicsList(), and SetUserAction().
|
protected |
Set in SetVolumeStepLimit.
Definition at line 115 of file G4Helper.h.
Referenced by SetPhysicsList(), and SetVolumeStepLimit().
|
protected |
Have G4GDML validate geometry schema?
Definition at line 114 of file G4Helper.h.
Referenced by ConstructDetector().