10#include "G4LogicalVolume.hh"
11#include "G4LogicalVolumeStore.hh"
13#include "G4ProductionCuts.hh"
16 : base_class(
type,name,parent)
35 return StatusCode::SUCCESS;
45 G4LogicalVolumeStore* logStore=G4LogicalVolumeStore::GetInstance();
47 size_t nVolumesCurrent{0};
48 for (
auto* it: *logStore)
51 if (vol ==
static_cast<const std::string&
>(it->GetName()))
54 it->SetRegion(theRegion);
55 theRegion->AddRootLogicalVolume(it);
58 if (nVolumesCurrent==0) {
59 ATH_MSG_WARNING(
"No volumes matching \"" << vol <<
"\" found in G4 LogicalVolumeStore. " <<
m_regionName.value() <<
" G4PhysicsRegion may not behave as intended.");
61 nVolumes += nVolumesCurrent;
67 G4ProductionCuts* cuts=
new G4ProductionCuts();
74 theRegion->SetProductionCuts(cuts);
81 ATH_MSG_INFO(
"+----------------------------------------------------+");
96 ATH_MSG_INFO(
"+----------------------------------------------------+");
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
void Construct() override
Gaudi::Property< std::string > m_regionName
Gaudi::Property< double > m_electronCut
virtual StatusCode initialize() override
Gaudi::Property< std::vector< std::string > > m_logicalVolumes
Gaudi::Property< double > m_protonCut
Gaudi::Property< double > m_gammaCut
BooleanProperty m_dumpRegion
RegionCreator(const std::string &type, const std::string &name, const IInterface *parent)
Gaudi::Property< double > m_positronCut