1#ifndef SIMCORE_PTRRETRIEVAL_H
2#define SIMCORE_PTRRETRIEVAL_H
14#include "G4LogicalVolume.hh"
15#include "G4LogicalVolumeStore.hh"
16#include "G4ParticleDefinition.hh"
17#include "G4PhysicalVolumeStore.hh"
18#include "G4ProcessManager.hh"
20#include "G4RegionStore.hh"
21#include "G4VPhysicalVolume.hh"
25namespace ptrretrieval {
33inline const G4VProcess* getProcess(
const G4ParticleDefinition* particle,
34 const std::string& processName) {
35 if (!particle)
return nullptr;
37 const auto manager = particle->GetProcessManager();
38 if (!manager)
return nullptr;
40 const auto processes = manager->GetProcessList();
41 for (
int i = 0; i < processes->size(); ++i) {
42 const auto process = (*processes)[i];
43 if (process->GetProcessName().find(processName) != std::string::npos) {
54inline const G4VProcess* getPhotonuclearProcess() {
55 return getProcess(G4Gamma::Definition(),
"photonNuclear");
73inline G4Region* getRegion(
const std::string& name) {
74 G4Region* region = G4RegionStore::GetInstance()->GetRegion(name);
86inline G4VPhysicalVolume* getPhysicalVolume(
const std::string& name) {
87 auto* volume = G4PhysicalVolumeStore::GetInstance()->GetVolume(name);
99inline G4LogicalVolume* getLogicalVolume(
const std::string& name) {
100 auto* volume = G4LogicalVolumeStore::GetInstance()->GetVolume(name);
This namespace is meant to contain all the standard user actions that allow a Geant4 user to interfac...