

Public Member Functions | |
| RMGHardware () | |
Constructor based on calling the macro commands (with DefineCommands ). | |
| RMGHardware (RMGHardware const &)=delete | |
| RMGHardware & | operator= (RMGHardware const &)=delete |
| RMGHardware (RMGHardware &&)=delete | |
| RMGHardware & | operator= (RMGHardware &&)=delete |
| G4VPhysicalVolume * | Construct () override |
| Construct the detector. | |
| void | ConstructSDandField () override |
| Setup thread-local geometry data. | |
| void | RegisterDetector (RMGDetectorType type, const std::string &pv_name, int uid, int copy_nr=0, bool allow_uid_reuse=false, const std::string &ntuple_name="") |
| Register a physical volume as sensitive detector. | |
| void | StageDetector (RMGDetectorType type, const std::string &pv_name, int uid, const std::string ©_nr="0", bool allow_uid_reuse=false, const std::string &ntuple_name="") |
| Stage a detector for later registration. | |
| const auto & | GetDetectorMetadataMap () |
| Extract a map of the detector metadata, one element for each sensitive detector physical volume and copy_nr. | |
| const auto & | GetDetectorMetadata (const std::pair< std::string, int > &det) |
| Extract the detector metadata for a given detector. | |
| const auto & | GetActiveDetectorList () |
| const auto & | GetAllActiveOutputSchemes () |
| void | IncludeGDMLFile (std::string filename) |
| Add a GDML file to the geometry. | |
| const G4VPhysicalVolume * | GetDefinedWorldVolume () const |
| Get the instance of the world volume, after Construct had been called once. | |
| G4VPhysicalVolume * | GetDefinedWorldVolume () |
| Get the instance of the world volume, after Construct had been called once. | |
| void | SetMaxStepLimit (double max_step, std::string name) |
| Set the maximum step size. | |
| void | SetEminLimitForParticle (double ekin_min, std::string name, std::string particle_name) |
| Set a minimum kinetic energy cut for one selected particle in a volume. | |
| void | PrintListOfLogicalVolumes () |
| void | PrintListOfPhysicalVolumes () |
Static Public Member Functions | |
| static bool | IsEminLimitParticleSelected (const G4LogicalVolume *logical, const std::string &particle_name) |
| Check if selective EkinMin should be applied for the current track context. | |
Protected Member Functions | |
| virtual G4VPhysicalVolume * | DefineGeometry () |
| Method to define geometry directly, the user must reimplement the base class method. | |
|
override |
Construct the detector.
Detector geometry can be based on GDML files, parsed with G4GDMLParser . Alternatively geometry can be defined directly by overriding the DefineGeometry() method.
This function defines the geometry and checks for overlaps, if using GDML defined geometry and check are not disabled. It also assigns physical volumes to Geant4 regions and sets user step limits. This must not modify thread-local state, because it is only called once globally.
This function will call RegisterDetector() to register detectors staged with StageDetector() and register all detector types specified with the RegisterDetectorsFromGDML macro command from the GDML.
|
override |
Setup thread-local geometry data.
This is called once for the master thread and once for each worker thread. Can be used to setup sensitive detectors, which have to be constructed per thread.
|
inline |
Extract the detector metadata for a given detector.
| det | the detector identifier, a pair of the physical volume name and the copy number. |
|
inline |
Add a GDML file to the geometry.
| filename | file name to add. |
| void RMGHardware::RegisterDetector | ( | RMGDetectorType | type, |
| const std::string & | pv_name, | ||
| int | uid, | ||
| int | copy_nr = 0, | ||
| bool | allow_uid_reuse = false, | ||
| const std::string & | ntuple_name = "" ) |
Register a physical volume as sensitive detector.
The uid is a unique identifier for the detector. It is mostly used to label the detector in the simulation output. This function also informs the run action to automatically activate output schemes for all registered detector types. This function is called during Construct() method to register detectors from the GDML and to register detectors staged with StageDetector() method.
| type | The type of detector. |
| pv_name | The name of the physical volume to be registered. |
| uid | A unique integer identifier for the sensitive volume. |
| copy_nr | The copy number of the physical volume. |
| allow_uid_reuse | Flag to allow assigning the same uid to different detectors. |
| ntuple_name | Ntuple name override. |
| void RMGHardware::SetEminLimitForParticle | ( | double | ekin_min, |
| std::string | name, | ||
| std::string | particle_name ) |
Set a minimum kinetic energy cut for one selected particle in a volume.
This sets G4UserLimits::SetUserMinEkine on matching logical volumes, but the corresponding cut process is applied only to registered particles.
| ekin_min | Minimum kinetic energy. |
| name | Physical volume name or regex. |
| particle_name | Geant4 particle name. |
| void RMGHardware::SetMaxStepLimit | ( | double | max_step, |
| std::string | name ) |
Set the maximum step size.
This is used as a G4UserLimit to limit step sizes to being no larger than the chosen value. This requires the G4StepLimiter process to be activated in the physics list.
| max_step | The maximum step size. |
| name | Name of the physical volume. |
| void RMGHardware::StageDetector | ( | RMGDetectorType | type, |
| const std::string & | pv_name, | ||
| int | uid, | ||
| const std::string & | copy_nr = "0", | ||
| bool | allow_uid_reuse = false, | ||
| const std::string & | ntuple_name = "" ) |
Stage a detector for later registration.
This function is used to stage detectors following a regex name pattern, which will be registered later during the Construct() method. This function will be called by the /RegisterDetector macro command instead of the RegisterDetector() function directly. If multiple volumes match a regex by given uid, depending on the allow_uid_reuse flag, the uid will be reused or incremented for each detector.
| type | The type of detector. |
| pv_name | The name of the physical volume to be registered. |
| uid | A unique integer identifier for the sensitive volume. |
| copy_nr | The copy number of the physical volume. |
| allow_uid_reuse | Flag to allow assigning the same uid to different detectors. |
| ntuple_name | Ntuple name override. |