diff --git a/Simulation/DetSimFastModel/src/DummyFastSimG4Tool.cpp b/Simulation/DetSimFastModel/src/DummyFastSimG4Tool.cpp index 47420ae38d180150f29e5ed9f65edfb4ccf1d612..6fa049f8c45e5754d3e833c2fcdaf1322bc0ac50 100644 --- a/Simulation/DetSimFastModel/src/DummyFastSimG4Tool.cpp +++ b/Simulation/DetSimFastModel/src/DummyFastSimG4Tool.cpp @@ -27,14 +27,15 @@ bool DummyFastSimG4Tool::CreateFastSimulationModel() { // * Associate model and region G4String model_name = "DummyFastSimG4Model"; - G4String region_name = "DriftChamberRegion"; - G4Region* aEnvelope = G4RegionStore::GetInstance()->GetRegion(region_name); - if (!aEnvelope) { - error() << "Failed to find G4Region '" << region_name << "'" << endmsg; - return false; + for (auto region_name: m_regions.value()) { + G4Region* aEnvelope = G4RegionStore::GetInstance()->GetRegion(region_name); + if (!aEnvelope) { + error() << "Failed to find G4Region '" << region_name << "'" << endmsg; + return false; + } + + DummyFastSimG4Model* model = new DummyFastSimG4Model(model_name+region_name, aEnvelope); + info() << "Create Model " << model_name << " for G4Region " << region_name << endmsg; } - - DummyFastSimG4Model* model = new DummyFastSimG4Model(model_name, aEnvelope); - info() << "Create Model " << model_name << " for G4Region " << region_name << endmsg; return true; } diff --git a/Simulation/DetSimFastModel/src/DummyFastSimG4Tool.h b/Simulation/DetSimFastModel/src/DummyFastSimG4Tool.h index 2254d892cacce2110bf5ed61ebf4cde234480acb..54c09dbeb904fa9015f9b8ffe913fafb14eca3c2 100644 --- a/Simulation/DetSimFastModel/src/DummyFastSimG4Tool.h +++ b/Simulation/DetSimFastModel/src/DummyFastSimG4Tool.h @@ -14,7 +14,8 @@ public: bool CreateFastSimulationModel() override; private: - + // the regions will be associated with the fast sim model + Gaudi::Property<std::vector<std::string>> m_regions{this, "Regions"}; }; #endif