diff --git a/Simulation/G4Atlas/G4AtlasAlg/G4AtlasAlg/G4AtlasMTRunManager.h b/Simulation/G4Atlas/G4AtlasAlg/G4AtlasAlg/G4AtlasMTRunManager.h index 26fcbc1405602cd1811073a9912d1cb5702edf5d..41d25bce1fdd025ec725c498053b3c1abcbe9c5e 100644 --- a/Simulation/G4Atlas/G4AtlasAlg/G4AtlasAlg/G4AtlasMTRunManager.h +++ b/Simulation/G4Atlas/G4AtlasAlg/G4AtlasAlg/G4AtlasMTRunManager.h @@ -18,7 +18,7 @@ #include "AthenaKernel/MsgStreamMember.h" // G4Atlas includes -#include "G4AtlasInterfaces/IPhysicsListTool.h" +#include "G4AtlasInterfaces/IPhysicsListSvc.h" #include "G4AtlasInterfaces/IDetectorGeometrySvc.h" #include "G4AtlasInterfaces/IFastSimulationMasterTool.h" @@ -87,7 +87,7 @@ private: /// Handle to the physics list tool. /// Not ideal, because we can't configure this. - ToolHandle<IPhysicsListTool> m_physListTool; + ServiceHandle<IPhysicsListSvc> m_physListSvc; /// Handle to the fast sim tool. /// Not ideal, because we can't configure this. diff --git a/Simulation/G4Atlas/G4AtlasAlg/G4AtlasAlg/G4AtlasRunManager.h b/Simulation/G4Atlas/G4AtlasAlg/G4AtlasAlg/G4AtlasRunManager.h index 1e101ec2c7adbe01ac357b00d20483649f4973e0..b5a1ff6923913e26199b5ad95eec65d105e66a30 100644 --- a/Simulation/G4Atlas/G4AtlasAlg/G4AtlasAlg/G4AtlasRunManager.h +++ b/Simulation/G4Atlas/G4AtlasAlg/G4AtlasAlg/G4AtlasRunManager.h @@ -16,7 +16,7 @@ #include "AthenaKernel/MsgStreamMember.h" #include "G4AtlasInterfaces/ISensitiveDetectorMasterTool.h" #include "G4AtlasInterfaces/IFastSimulationMasterTool.h" -#include "G4AtlasInterfaces/IPhysicsListTool.h" +#include "G4AtlasInterfaces/IPhysicsListSvc.h" #include "G4AtlasInterfaces/IUserActionSvc.h" #include "G4AtlasInterfaces/IDetectorGeometrySvc.h" #include "G4AtlasInterfaces/IFluxRecorder.h" @@ -65,8 +65,8 @@ public: } /// Configure the Physics List Tool handle - void SetPhysListTool(const std::string& typeAndName) { - m_physListTool.setTypeAndName(typeAndName); + void SetPhysListSvc(const std::string& typeAndName) { + m_physListSvc.setTypeAndName(typeAndName); } void SetRecordFlux(bool b, std::unique_ptr<IFluxRecorder> f) { m_recordFlux = b; m_fluxRecorder=std::move(f);} @@ -101,7 +101,7 @@ private: ToolHandle<ISensitiveDetectorMasterTool> m_senDetTool; ToolHandle<IFastSimulationMasterTool> m_fastSimTool; - ToolHandle<IPhysicsListTool> m_physListTool; + ServiceHandle<IPhysicsListSvc> m_physListSvc; /// Handle to the user action service ServiceHandle<G4UA::IUserActionSvc> m_userActionSvc; diff --git a/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasAlg.cxx b/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasAlg.cxx index 6a5c481c75f9c03ece913e148bfe2c29e23f976d..96768d3729272ff4a605772e98b906d0dadb5c82 100644 --- a/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasAlg.cxx +++ b/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasAlg.cxx @@ -120,15 +120,15 @@ StatusCode G4AtlasAlg::initialize() void G4AtlasAlg::initializeOnce() { // Assign physics list - if(m_physListTool.retrieve().isFailure()) { - throw std::runtime_error("Could not initialize ATLAS PhysicsListTool!"); + if(m_physListSvc.retrieve().isFailure()) { + throw std::runtime_error("Could not initialize ATLAS PhysicsListSvc!"); } // Create the (master) run manager if(m_useMT) { #ifdef G4MULTITHREADED auto* runMgr = G4AtlasMTRunManager::GetG4AtlasMTRunManager(); - m_physListTool->SetPhysicsList(); + m_physListSvc->SetPhysicsList(); // Worker Thread initialization used to create worker run manager on demand. // @TODO use this class to pass any configuration to worker run manager. runMgr->SetUserInitialization( new G4AtlasUserWorkerThreadInitialization ); @@ -140,14 +140,14 @@ void G4AtlasAlg::initializeOnce() // Single-threaded run manager else { auto* runMgr = G4AtlasRunManager::GetG4AtlasRunManager(); - m_physListTool->SetPhysicsList(); + m_physListSvc->SetPhysicsList(); runMgr->SetRecordFlux( m_recordFlux, std::make_unique<G4AtlasFluxRecorder>() ); runMgr->SetLogLevel( int(msg().level()) ); // Synch log levels runMgr->SetUserActionSvc( m_userActionSvc.typeAndName() ); runMgr->SetDetGeoSvc( m_detGeoSvc.typeAndName() ); runMgr->SetSDMasterTool(m_senDetTool.typeAndName() ); runMgr->SetFastSimMasterTool(m_fastSimTool.typeAndName() ); - runMgr->SetPhysListTool(m_physListTool.typeAndName() ); + runMgr->SetPhysListSvc(m_physListSvc.typeAndName() ); } // G4 user interface commands diff --git a/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasAlg.h b/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasAlg.h index 36b5e4646db01c1b04c26f3a2c802671f7373a4b..416ea22cd7f8d1e8b09bca46cb38e46689152a79 100644 --- a/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasAlg.h +++ b/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasAlg.h @@ -24,7 +24,7 @@ #include "G4AtlasInterfaces/IDetectorGeometrySvc.h" #include "G4AtlasInterfaces/ISensitiveDetectorMasterTool.h" #include "G4AtlasInterfaces/IFastSimulationMasterTool.h" -#include "G4AtlasInterfaces/IPhysicsListTool.h" +#include "G4AtlasInterfaces/IPhysicsListSvc.h" #include "G4AtlasInterfaces/IG4AtlasSvc.h" #include "GeneratorObjects/McEventCollection.h" @@ -130,7 +130,7 @@ private: /// Service to convert ISF_Particles into a G4Event ServiceHandle<ISF::IInputConverter> m_inputConverter{this, "InputConverter", "ISF_InputConverter", ""}; /// Physics List Tool - PublicToolHandle<IPhysicsListTool> m_physListTool{this, "PhysicsListTool", "PhysicsListToolBase", ""}; + ServiceHandle<IPhysicsListSvc> m_physListSvc{this, "PhysicsListSvc", "PhysicsListSvc", ""}; /// Sensitive Detector Master Tool PublicToolHandle<ISensitiveDetectorMasterTool> m_senDetTool{this, "SenDetMasterTool", "SensitiveDetectorMasterTool", ""}; /// Fast Simulation Master Tool diff --git a/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasMTRunManager.cxx b/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasMTRunManager.cxx index eaa395e812f04a4750e057b42f071b3f9c3e3d29..48a624cc12e2356731e6b3189f5380e4db94442e 100644 --- a/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasMTRunManager.cxx +++ b/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasMTRunManager.cxx @@ -28,7 +28,7 @@ G4AtlasMTRunManager::G4AtlasMTRunManager() : G4MTRunManager() , m_msg("G4AtlasMTRunManager") , m_detGeoSvc("DetectorGeometrySvc", "G4AtlasMTRunManager") - , m_physListTool("PhysicsListToolBase") + , m_physListSvc("PhysicsListSvc", "G4AtlasMTRunManager") , m_fastSimTool("FastSimulationMasterTool") {} @@ -128,15 +128,15 @@ void G4AtlasMTRunManager::InitializePhysics() physicsInitialized = true; // Grab the physics list tool and set the extra options - if (m_physListTool.retrieve().isFailure()) { + if (m_physListSvc.retrieve().isFailure()) { ATH_MSG_ERROR("Could not retrieve the physics list tool"); G4ExceptionDescription description; - description << "InitializePhysics: Failed to retrieve IPhysicsListTool."; + description << "InitializePhysics: Failed to retrieve IPhysicsListSvc."; G4Exception("G4AtlasMTRunManager", "CouldNotRetrievePLTool", FatalException, description); abort(); // to keep Coverity happy } - m_physListTool->SetPhysicsOptions(); + m_physListSvc->SetPhysicsOptions(); // Setup the fast simulations const std::string methodName = "G4AtlasMTRunManager::InitializePhysics"; diff --git a/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasRunManager.cxx b/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasRunManager.cxx index 5b8e81a3348fc03c229d491fec1cac6515c94e51..399ce45aaf84e05a3353da8a68c38670e1f114c3 100644 --- a/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasRunManager.cxx +++ b/Simulation/G4Atlas/G4AtlasAlg/src/G4AtlasRunManager.cxx @@ -26,7 +26,7 @@ G4AtlasRunManager::G4AtlasRunManager() , m_recordFlux(false) , m_senDetTool("SensitiveDetectorMasterTool") , m_fastSimTool("FastSimulationMasterTool") - , m_physListTool("PhysicsListToolBase") + , m_physListSvc("PhysicsListSvc", "G4AtlasRunManager") , m_userActionSvc("G4UA::UserActionSvc", "G4AtlasRunManager") , m_detGeoSvc("DetectorGeometrySvc", "G4AtlasRunManager") { } @@ -143,14 +143,14 @@ void G4AtlasRunManager::InitializePhysics() physicsInitialized = true; // Grab the physics list tool and set the extra options - if (m_physListTool.retrieve().isFailure()) { + if (m_physListSvc.retrieve().isFailure()) { ATH_MSG_ERROR ( "Could not retrieve the physics list tool" ); G4ExceptionDescription description; - description << "InitializePhysics: Failed to retrieve IPhysicsListTool."; + description << "InitializePhysics: Failed to retrieve IPhysicsListSvc."; G4Exception("G4AtlasRunManager", "CouldNotRetrievePLTool", FatalException, description); abort(); // to keep Coverity happy } - m_physListTool->SetPhysicsOptions(); + m_physListSvc->SetPhysicsOptions(); // Fast simulations last if (m_fastSimTool.retrieve().isFailure()) { diff --git a/Simulation/G4Atlas/G4AtlasApps/python/SimCtbKernel.py b/Simulation/G4Atlas/G4AtlasApps/python/SimCtbKernel.py index 9e3e6e42e2dc60fd63b92e29ac217a3e7bb86e9a..8b002ebe37e92a58c65be0f23acd4995df61975a 100644 --- a/Simulation/G4Atlas/G4AtlasApps/python/SimCtbKernel.py +++ b/Simulation/G4Atlas/G4AtlasApps/python/SimCtbKernel.py @@ -226,10 +226,10 @@ class CtbSim(TBSimSkeleton): TBDetDescrLoader.OutputLevel = 5 # ## Explicitly create DetectorGeometrySvc - temporary fix - from AthenaCommon.CfgGetter import getService, getPublicTool + from AthenaCommon.CfgGetter import getService from AthenaCommon.AppMgr import ServiceMgr ServiceMgr += getService('DetectorGeometrySvc') - ServiceMgr.ToolSvc += getPublicTool('PhysicsListToolBase') + ServiceMgr += getService('PhysicsListSvc') AtlasG4Eng.G4Eng.log.info('SimSkeleton :: _do_external '+\ 'done') @@ -374,10 +374,10 @@ class Tile2000_2003(TBSimSkeleton): TBDetDescrLoader.OutputLevel = 5 ## Explicitly create DetectorGeometrySvc - temporary fix - from AthenaCommon.CfgGetter import getService, getPublicTool + from AthenaCommon.CfgGetter import getService from AthenaCommon.AppMgr import ServiceMgr ServiceMgr += getService('DetectorGeometrySvc') - ServiceMgr.ToolSvc += getPublicTool('PhysicsListToolBase') + ServiceMgr += getService('PhysicsListSvc') AtlasG4Eng.G4Eng.log.info('SimSkeleton :: _do_external '+\ 'done') @@ -504,10 +504,10 @@ class LArH6_TB(TBSimSkeleton): include( "CaloIdCnv/CaloIdCnv_joboptions.py" ) ## Explicitly create DetectorGeometrySvc - temporary fix - from AthenaCommon.CfgGetter import getService, getPublicTool + from AthenaCommon.CfgGetter import getService from AthenaCommon.AppMgr import ServiceMgr ServiceMgr += getService('DetectorGeometrySvc') - ServiceMgr.ToolSvc += getPublicTool('PhysicsListToolBase') + ServiceMgr += getService('PhysicsListSvc') AtlasG4Eng.G4Eng.log.info('SimSkeleton :: _do_external '+\ 'done') diff --git a/Simulation/G4Atlas/G4AtlasApps/share/Tile2000_2003.flat.configuration.py b/Simulation/G4Atlas/G4AtlasApps/share/Tile2000_2003.flat.configuration.py index c26cfff953ad91b93fe4d48e0d072d0bdaab3ab6..26dd41cc28c168e989fd2d7a023c8f3fd46dfce7 100644 --- a/Simulation/G4Atlas/G4AtlasApps/share/Tile2000_2003.flat.configuration.py +++ b/Simulation/G4Atlas/G4AtlasApps/share/Tile2000_2003.flat.configuration.py @@ -118,10 +118,10 @@ if jobproperties.AthenaCommonFlags.PoolHitsOutput.statusOn : TBDetDescrLoader.OutputLevel = 5 ## Explicitly create DetectorGeometrySvc - temporary fix -from AthenaCommon.CfgGetter import getService, getPublicTool +from AthenaCommon.CfgGetter import getService from AthenaCommon.AppMgr import ServiceMgr ServiceMgr += getService('DetectorGeometrySvc') -ServiceMgr.ToolSvc += getPublicTool('PhysicsListToolBase') +ServiceMgr += getService('PhysicsListSvc') ## TBSimSkeleton._do_metadata from G4AtlasApps.G4Atlas_Metadata import createTBSimulationParametersMetadata diff --git a/Simulation/G4Atlas/G4AtlasApps/test/test_AtlasG4_cosmics_configuration.py b/Simulation/G4Atlas/G4AtlasApps/test/test_AtlasG4_cosmics_configuration.py index ab9b4fd001164bcb3562f53652b41c4732f21338..55260b5f47ef60be690bfd5ab6b60a19204a0c0c 100755 --- a/Simulation/G4Atlas/G4AtlasApps/test/test_AtlasG4_cosmics_configuration.py +++ b/Simulation/G4Atlas/G4AtlasApps/test/test_AtlasG4_cosmics_configuration.py @@ -238,7 +238,7 @@ class TestAtlasG4Cosmics(unittest.TestCase): def test___G4AtlasAlg_ListOfSetProperties(self): - expected_list = ['AtRndmGenSvc', 'DetGeoSvc', 'DetStore', 'EvtStore', 'ExtraInputs', 'ExtraOutputs', 'FastSimMasterTool', 'FlagAbortedEvents', 'G4AtlasSvc', 'G4Commands', 'GeoIDSvc', 'InputConverter', 'InputTruthCollection', 'KillAbortedEvents', 'MultiThreading', 'NeededResources', 'OutputTruthCollection', 'PhysicsListTool', 'RandomGenerator', 'RecordFlux', 'ReleaseGeoModel', 'SenDetMasterTool', 'TruthRecordService', 'UserActionSvc', 'Verbosities'] + expected_list = ['AtRndmGenSvc', 'DetGeoSvc', 'DetStore', 'EvtStore', 'ExtraInputs', 'ExtraOutputs', 'FastSimMasterTool', 'FlagAbortedEvents', 'G4AtlasSvc', 'G4Commands', 'GeoIDSvc', 'InputConverter', 'InputTruthCollection', 'KillAbortedEvents', 'MultiThreading', 'NeededResources', 'OutputTruthCollection', 'PhysicsListSvc', 'RandomGenerator', 'RecordFlux', 'ReleaseGeoModel', 'SenDetMasterTool', 'TruthRecordService', 'UserActionSvc', 'Verbosities'] g4atlasalg = self._job_config_dict['G4AtlasAlg'] actual_list = g4atlasalg.keys() expected_property_value_sorted = sorted(expected_list) @@ -272,9 +272,9 @@ class TestAtlasG4Cosmics(unittest.TestCase): self._assert_Algorithm_property_equal('G4AtlasAlg', 'FastSimMasterTool', expected_tool_name) - def test___G4AtlasAlg_PhysicsListTool_setCorrectly(self): - expected_tool_name = 'PhysicsListToolBase/PhysicsListToolBase' - self._assert_Algorithm_property_equal('G4AtlasAlg', 'PhysicsListTool', expected_tool_name) + def test___G4AtlasAlg_PhysicsListSvc_setCorrectly(self): + expected_tool_name = 'PhysicsListSvc' + self._assert_Algorithm_property_equal('G4AtlasAlg', 'PhysicsListSvc', expected_tool_name) def test___G4AtlasAlg_SenDetMasterTool_setCorrectly(self): diff --git a/Simulation/G4Atlas/G4AtlasApps/test/test_AtlasG4_tf_configuration.py b/Simulation/G4Atlas/G4AtlasApps/test/test_AtlasG4_tf_configuration.py index 6b1c8a2c3d27e42a3eaf5e08f682d2f5d4ee40ce..6fc74c7b3c67af02231c506473f4dd8e4b9f296a 100755 --- a/Simulation/G4Atlas/G4AtlasApps/test/test_AtlasG4_tf_configuration.py +++ b/Simulation/G4Atlas/G4AtlasApps/test/test_AtlasG4_tf_configuration.py @@ -154,7 +154,7 @@ class TestAtlasG4(unittest.TestCase): def test___G4AtlasAlg_ListOfSetProperties(self): - expected_list = ['AtRndmGenSvc', 'DetGeoSvc', 'DetStore', 'EvtStore', 'ExtraInputs', 'ExtraOutputs', 'FastSimMasterTool', 'FlagAbortedEvents', 'G4AtlasSvc', 'G4Commands', 'GeoIDSvc', 'InputConverter', 'InputTruthCollection', 'KillAbortedEvents', 'MultiThreading', 'NeededResources', 'OutputTruthCollection', 'PhysicsListTool', 'RandomGenerator', 'RecordFlux', 'ReleaseGeoModel', 'SenDetMasterTool', 'TruthRecordService', 'UserActionSvc', 'Verbosities'] + expected_list = ['AtRndmGenSvc', 'DetGeoSvc', 'DetStore', 'EvtStore', 'ExtraInputs', 'ExtraOutputs', 'FastSimMasterTool', 'FlagAbortedEvents', 'G4AtlasSvc', 'G4Commands', 'GeoIDSvc', 'InputConverter', 'InputTruthCollection', 'KillAbortedEvents', 'MultiThreading', 'NeededResources', 'OutputTruthCollection', 'PhysicsListSvc', 'RandomGenerator', 'RecordFlux', 'ReleaseGeoModel', 'SenDetMasterTool', 'TruthRecordService', 'UserActionSvc', 'Verbosities'] g4atlasalg = self._job_config_dict['G4AtlasAlg'] actual_list = g4atlasalg.keys() expected_property_value_sorted = sorted(expected_list) @@ -188,9 +188,9 @@ class TestAtlasG4(unittest.TestCase): self._assert_Algorithm_property_equal('G4AtlasAlg', 'FastSimMasterTool', expected_tool_name) - def test___G4AtlasAlg_PhysicsListTool_setCorrectly(self): - expected_tool_name = 'PhysicsListToolBase/PhysicsListToolBase' - self._assert_Algorithm_property_equal('G4AtlasAlg', 'PhysicsListTool', expected_tool_name) + def test___G4AtlasAlg_PhysicsListSvc_setCorrectly(self): + expected_tool_name = 'PhysicsListSvc' + self._assert_Algorithm_property_equal('G4AtlasAlg', 'PhysicsListSvc', expected_tool_name) def test___G4AtlasAlg_SenDetMasterTool_setCorrectly(self): diff --git a/Simulation/G4Atlas/G4AtlasApps/test/test_TestBeam_tf_configuration.py b/Simulation/G4Atlas/G4AtlasApps/test/test_TestBeam_tf_configuration.py index c10a9a28aecac564e8614ea8b245e208a2c403ed..7f50108358f495dee92189a93fd0cb93d01ea643 100755 --- a/Simulation/G4Atlas/G4AtlasApps/test/test_TestBeam_tf_configuration.py +++ b/Simulation/G4Atlas/G4AtlasApps/test/test_TestBeam_tf_configuration.py @@ -174,7 +174,7 @@ class TestTestBeam(unittest.TestCase): def test___G4AtlasAlg_ListOfSetProperties(self): - expected_list = ['AtRndmGenSvc', 'DetGeoSvc', 'DetStore', 'EvtStore', 'ExtraInputs', 'ExtraOutputs', 'FastSimMasterTool', 'G4AtlasSvc', 'G4Commands', 'GeoIDSvc', 'InputConverter', 'InputTruthCollection', 'MultiThreading', 'NeededResources', 'OutputTruthCollection', 'PhysicsListTool', 'RandomGenerator', 'RecordFlux', 'ReleaseGeoModel', 'SenDetMasterTool', 'TruthRecordService', 'UserActionSvc', 'Verbosities'] + expected_list = ['AtRndmGenSvc', 'DetGeoSvc', 'DetStore', 'EvtStore', 'ExtraInputs', 'ExtraOutputs', 'FastSimMasterTool', 'G4AtlasSvc', 'G4Commands', 'GeoIDSvc', 'InputConverter', 'InputTruthCollection', 'MultiThreading', 'NeededResources', 'OutputTruthCollection', 'PhysicsListSvc', 'RandomGenerator', 'RecordFlux', 'ReleaseGeoModel', 'SenDetMasterTool', 'TruthRecordService', 'UserActionSvc', 'Verbosities'] g4atlasalg = self._job_config_dict['G4AtlasAlg'] actual_list = g4atlasalg.keys() expected_property_value_sorted = sorted(expected_list) @@ -208,9 +208,9 @@ class TestTestBeam(unittest.TestCase): self._assert_Algorithm_property_equal('G4AtlasAlg', 'FastSimMasterTool', expected_tool_name) - def test___G4AtlasAlg_PhysicsListTool_setCorrectly(self): - expected_tool_name = 'PhysicsListToolBase/PhysicsListToolBase' - self._assert_Algorithm_property_equal('G4AtlasAlg', 'PhysicsListTool', expected_tool_name) + def test___G4AtlasAlg_PhysicsListSvc_setCorrectly(self): + expected_tool_name = 'PhysicsListSvc' + self._assert_Algorithm_property_equal('G4AtlasAlg', 'PhysicsListSvc', expected_tool_name) def test___G4AtlasAlg_SenDetMasterTool_setCorrectly(self): diff --git a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IPhysicsListTool.h b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IPhysicsListSvc.h similarity index 66% rename from Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IPhysicsListTool.h rename to Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IPhysicsListSvc.h index 6399b808aa1cc2490e8b77e58beba1566e9c8a78..c2bf2c1b3d13bc342236899592a7efcb0122f100 100644 --- a/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IPhysicsListTool.h +++ b/Simulation/G4Atlas/G4AtlasInterfaces/G4AtlasInterfaces/IPhysicsListSvc.h @@ -1,15 +1,15 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ -#ifndef G4ATLASINTERFACES_IPHYSICSLISTTOOL_H -#define G4ATLASINTERFACES_IPHYSICSLISTTOOL_H +#ifndef G4ATLASINTERFACES_IPHYSICSLISTSVC_H +#define G4ATLASINTERFACES_IPHYSICSLISTSVC_H -#include "GaudiKernel/IAlgTool.h" +#include "GaudiKernel/IService.h" class G4VUserPhysicsList; -/** @class IPhysicsListTool IPhysicsListTool.h "G4AtlasInterfaces/IPhysicsListTool.h" +/** @class IPhysicsListSvc IPhysicsListSvc.h "G4AtlasInterfaces/IPhysicsListSvc.h" * * Abstract interface to Geant4 Physics list classes * @@ -17,13 +17,13 @@ class G4VUserPhysicsList; * @date 2014-10-01 */ -class IPhysicsListTool : virtual public IAlgTool +class IPhysicsListSvc : virtual public IService { public: - IPhysicsListTool() {} - virtual ~IPhysicsListTool() {} + IPhysicsListSvc() {} + virtual ~IPhysicsListSvc() {} /// Creates the InterfaceID and interfaceID() method - DeclareInterfaceID(IPhysicsListTool, 1, 0); + DeclareInterfaceID(IPhysicsListSvc, 1, 0); /** Build the physics list. This method should be called when G4 is ready for the initialization of the physics list */ @@ -42,4 +42,4 @@ public: virtual void SetPhysicsOptions() = 0 ; }; -#endif +#endif // G4ATLASINTERFACES_IPHYSICSLISTSVC_H diff --git a/Simulation/G4Atlas/G4AtlasServices/CMakeLists.txt b/Simulation/G4Atlas/G4AtlasServices/CMakeLists.txt index 71622fe7f75b3c47e622816b56bd759d58aeebc4..b9cd3ad96ce2b6f1b46cbcdf95b167629257f595 100644 --- a/Simulation/G4Atlas/G4AtlasServices/CMakeLists.txt +++ b/Simulation/G4Atlas/G4AtlasServices/CMakeLists.txt @@ -12,7 +12,8 @@ atlas_depends_on_subdirs( PUBLIC Control/AthenaBaseComps MagneticField/MagFieldInterfaces Simulation/G4Atlas/G4AtlasInterfaces - Simulation/G4Atlas/G4AtlasTools ) + Simulation/G4Atlas/G4AtlasTools + Simulation/G4Utilities/G4PhysicsLists ) # External dependencies: find_package( CLHEP ) @@ -25,8 +26,8 @@ atlas_add_component( G4AtlasServices src/*.cxx src/components/*.cxx INCLUDE_DIRS ${GEANT4_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS} - LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} ${TBB_LIBRARIES} GaudiKernel AthenaBaseComps G4AtlasInterfaces G4AtlasToolsLib MagFieldInterfaces) - + LINK_LIBRARIES ${GEANT4_LIBRARIES} ${XERCESC_LIBRARIES} ${CLHEP_LIBRARIES} ${TBB_LIBRARIES} GaudiKernel AthenaBaseComps G4AtlasInterfaces G4AtlasToolsLib G4PhysicsLists MagFieldInterfaces) + #test G4AtlasFieldServices atlas_add_test( G4AtlasFieldServices_test SCRIPT test/G4AtlasFieldServices_test.py diff --git a/Simulation/G4Atlas/G4AtlasServices/python/G4AtlasServicesConfig.py b/Simulation/G4Atlas/G4AtlasServices/python/G4AtlasServicesConfig.py index 03643d6a869d6e04a0e58bc0f2f56c3ac55dca63..7a8b63f3d959176490ad45c9f763e8ca81ee5da6 100644 --- a/Simulation/G4Atlas/G4AtlasServices/python/G4AtlasServicesConfig.py +++ b/Simulation/G4Atlas/G4AtlasServices/python/G4AtlasServicesConfig.py @@ -28,6 +28,42 @@ def getReducedStepSizeUserLimitsSvc(name="ReducedStepSizeUserLimitsSvc", **kwarg return CfgMgr.UserLimitsSvc(name, **kwargs) +def getPhysicsListSvc(name="PhysicsListSvc", **kwargs): + PhysOptionList = ["G4StepLimitationTool"] + from G4AtlasApps.SimFlags import simFlags + PhysOptionList += simFlags.PhysicsOptions.get_Value() + PhysDecaysList = [] + from AthenaCommon.DetFlags import DetFlags + if DetFlags.simulate.TRT_on(): + PhysOptionList +=["TRTPhysicsTool"] + if DetFlags.simulate.Lucid_on() or DetFlags.simulate.AFP_on(): + PhysOptionList +=["LucidPhysicsTool"] + kwargs.setdefault("PhysOption", PhysOptionList) + kwargs.setdefault("PhysicsDecay", PhysDecaysList) + from G4AtlasApps.SimFlags import simFlags + kwargs.setdefault("PhysicsList", simFlags.PhysicsList.get_Value()) + if 'PhysicsList' in kwargs: + if kwargs['PhysicsList'].endswith('_EMV') or kwargs['PhysicsList'].endswith('_EMX'): + raise RuntimeError( 'PhysicsList not allowed: '+kwargs['PhysicsList'] ) + kwargs.setdefault("GeneralCut", 1.) + if hasattr(simFlags, 'NeutronTimeCut') and simFlags.NeutronTimeCut.statusOn: + kwargs.setdefault("NeutronTimeCut", simFlags.NeutronTimeCut.get_Value()) + if hasattr(simFlags, 'NeutronEnergyCut') and simFlags.NeutronEnergyCut.statusOn: + kwargs.setdefault("NeutronEnergyCut", simFlags.NeutronEnergyCut.get_Value()) + if hasattr(simFlags, 'ApplyEMCuts') and simFlags.ApplyEMCuts.statusOn: + kwargs.setdefault("ApplyEMCuts", simFlags.ApplyEMCuts.get_Value()) + ## from AthenaCommon.SystemOfUnits import eV, TeV + ## kwargs.setdefault("EMMaxEnergy" , 7*TeV) + ## kwargs.setdefault("EMMinEnergy" , 100*eV) + """ --- ATLASSIM-3967 --- + these two options are replaced by SetNumberOfBinsPerDecade + which now controls both values. + """ + ## kwargs.setdefault("EMDEDXBinning" , 77) + ## kwargs.setdefault("EMLambdaBinning" , 77) + return CfgMgr.PhysicsListSvc(name, **kwargs) + + def getATLAS_RegionCreatorList(): regionCreatorList = [] from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as commonGeoFlags diff --git a/Simulation/G4Atlas/G4AtlasServices/python/G4AtlasServicesConfigDb.py b/Simulation/G4Atlas/G4AtlasServices/python/G4AtlasServicesConfigDb.py index 05c83e354726edce87cf8bd16d665d27df0923ae..3902f29884e9d7641fcec9c56b27da9a96dc5562 100644 --- a/Simulation/G4Atlas/G4AtlasServices/python/G4AtlasServicesConfigDb.py +++ b/Simulation/G4Atlas/G4AtlasServices/python/G4AtlasServicesConfigDb.py @@ -2,6 +2,7 @@ from AthenaCommon.CfgGetter import addService +addService("G4AtlasServices.G4AtlasServicesConfig.getPhysicsListSvc","PhysicsListSvc") addService("G4AtlasServices.G4AtlasServicesConfig.getReducedStepSizeUserLimitsSvc","ReducedStepSizeUserLimitsSvc") addService("G4AtlasServices.G4AtlasServicesConfig.getDetectorGeometrySvc","DetectorGeometrySvc") diff --git a/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasSvc.cxx b/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasSvc.cxx index 3cc3efc400296742508429a6d4720a5ea891eeb9..d1734623dcd425486da2dd860894a73fe20df29f 100644 --- a/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasSvc.cxx +++ b/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasSvc.cxx @@ -14,7 +14,7 @@ G4AtlasSvc::G4AtlasSvc( const std::string& name, ISvcLocator* pSvcLocator ) : base_class(name,pSvcLocator) , m_detGeoSvc("DetectorGeometrySvc",name) - , m_physicsListTool("PhysicsListToolBase") + , m_physicsListSvc("PhysicsListSvc",name) , m_userLimitsSvc("UserLimitsSvc", name) , m_isMT(false) , m_activateParallelGeometries(false) @@ -22,7 +22,7 @@ G4AtlasSvc::G4AtlasSvc( const std::string& name, ISvcLocator* pSvcLocator ) ATH_MSG_DEBUG( "G4AtlasSvc being created!" ); declareProperty("ActivateParallelWorlds",m_activateParallelGeometries,"Toggle on/off the G4 parallel geometry system"); declareProperty("DetectorGeometrySvc", m_detGeoSvc ); - declareProperty("PhysicsListTool", m_physicsListTool); + declareProperty("PhysicsListSvc", m_physicsListSvc); declareProperty("UserLimitsSvc", m_userLimitsSvc); declareProperty("isMT", m_isMT); } @@ -51,12 +51,12 @@ StatusCode G4AtlasSvc::initialize(){ CHECK(m_detGeoSvc.retrieve()); ATH_MSG_INFO( "retrieving the Physics List Tool" ); - CHECK(m_physicsListTool.retrieve()); + CHECK(m_physicsListSvc.retrieve()); CHECK(m_userLimitsSvc.retrieve()); if (m_activateParallelGeometries) { - G4VModularPhysicsList* thePhysicsList=dynamic_cast<G4VModularPhysicsList*>(m_physicsListTool->GetPhysicsList()); + G4VModularPhysicsList* thePhysicsList=dynamic_cast<G4VModularPhysicsList*>(m_physicsListSvc->GetPhysicsList()); if (!thePhysicsList) { ATH_MSG_FATAL("Failed dynamic_cast!! this is not a G4VModularPhysicsList!"); diff --git a/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasSvc.h b/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasSvc.h index 6aeaa5775f80d289fad2f50754f454a11f761e60..2580f47772bdb92a59de06b21cb327c5be4ffd80 100644 --- a/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasSvc.h +++ b/Simulation/G4Atlas/G4AtlasServices/src/G4AtlasSvc.h @@ -9,12 +9,11 @@ #include "AthenaBaseComps/AthService.h" #include "G4AtlasInterfaces/IG4AtlasSvc.h" #include "G4AtlasInterfaces/IDetectorGeometrySvc.h" -#include "G4AtlasInterfaces/IPhysicsListTool.h" +#include "G4AtlasInterfaces/IPhysicsListSvc.h" #include "G4AtlasInterfaces/IUserLimitsSvc.h" // Member #include "GaudiKernel/ServiceHandle.h" -#include "GaudiKernel/ToolHandle.h" class G4AtlasSvc : public extends<AthService , IG4AtlasSvc> { public: @@ -30,7 +29,7 @@ class G4AtlasSvc : public extends<AthService , IG4AtlasSvc> { ServiceHandle<IDetectorGeometrySvc> m_detGeoSvc; - ToolHandle<IPhysicsListTool> m_physicsListTool; + ServiceHandle<IPhysicsListSvc> m_physicsListSvc; ServiceHandle<IUserLimitsSvc> m_userLimitsSvc; bool m_isMT; bool m_activateParallelGeometries; diff --git a/Simulation/G4Atlas/G4AtlasTools/src/PhysicsListToolBase.cxx b/Simulation/G4Atlas/G4AtlasServices/src/PhysicsListSvc.cxx similarity index 89% rename from Simulation/G4Atlas/G4AtlasTools/src/PhysicsListToolBase.cxx rename to Simulation/G4Atlas/G4AtlasServices/src/PhysicsListSvc.cxx index 7040ce5e48aec5713cffc9f9c2946b372551959e..1659393eb3f4cc7a038337d995f3c15dd7a2b1b8 100644 --- a/Simulation/G4Atlas/G4AtlasTools/src/PhysicsListToolBase.cxx +++ b/Simulation/G4Atlas/G4AtlasServices/src/PhysicsListSvc.cxx @@ -1,8 +1,8 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ -#include "G4AtlasTools/PhysicsListToolBase.h" +#include "PhysicsListSvc.h" #include "G4VUserPhysicsList.hh" #include "G4StateManager.hh" @@ -17,8 +17,8 @@ #include <limits> -PhysicsListToolBase::PhysicsListToolBase(const std::string& type, const std::string& name, const IInterface* parent) - : base_class(type,name,parent) +PhysicsListSvc::PhysicsListSvc(const std::string& name, ISvcLocator* pSvcLocator) + : base_class(name,pSvcLocator) , m_phys_option(this) , m_phys_decay(this) , m_physicsList(nullptr) @@ -42,8 +42,9 @@ PhysicsListToolBase::PhysicsListToolBase(const std::string& type, const std::str } -StatusCode PhysicsListToolBase::initialize( ) +StatusCode PhysicsListSvc::initialize( ) { + ATH_MSG_DEBUG("PhysicsListSvc::initialize()"); if (m_phys_option.size()) { ATH_MSG_INFO( "Initializing list of " << m_phys_option.size() << " physics options" ); @@ -60,9 +61,9 @@ StatusCode PhysicsListToolBase::initialize( ) } -void PhysicsListToolBase::CreatePhysicsList() +void PhysicsListSvc::CreatePhysicsList() { - ATH_MSG_DEBUG("PhysicsListToolBase::CreatePhysicsList()"); + ATH_MSG_DEBUG("PhysicsListSvc::CreatePhysicsList()"); if (m_physicsListName != ""){ G4PhysListFactory factory; AtlasPhysListFactory Atlasfactory; @@ -75,7 +76,7 @@ void PhysicsListToolBase::CreatePhysicsList() m_physicsList = Atlasfactory.GetReferencePhysList(m_physicsListName); } } - + if (!m_physicsList) { ATH_MSG_ERROR("Unable to initialize physics List: " << m_physicsList); @@ -97,10 +98,10 @@ void PhysicsListToolBase::CreatePhysicsList() } //ConstructProcess(); - ATH_MSG_DEBUG("end of PhysicsListToolBase::CreatePhysicsList()"); + ATH_MSG_DEBUG("end of PhysicsListSvc::CreatePhysicsList()"); } -G4VUserPhysicsList* PhysicsListToolBase::GetPhysicsList() +G4VUserPhysicsList* PhysicsListSvc::GetPhysicsList() { if (!m_physicsList) { this->CreatePhysicsList(); @@ -108,7 +109,7 @@ G4VUserPhysicsList* PhysicsListToolBase::GetPhysicsList() return m_physicsList; } -void PhysicsListToolBase::SetPhysicsList() +void PhysicsListSvc::SetPhysicsList() { if(!m_physicsList) { this->CreatePhysicsList(); @@ -116,7 +117,7 @@ void PhysicsListToolBase::SetPhysicsList() G4RunManager::GetRunManager()->SetUserInitialization(m_physicsList); } -void PhysicsListToolBase::SetPhysicsOptions() +void PhysicsListSvc::SetPhysicsOptions() { if (!m_physicsList) { @@ -165,7 +166,7 @@ void PhysicsListToolBase::SetPhysicsOptions() return; } -void PhysicsListToolBase::CommandLog(int returnCode, const std::string& commandString) const +void PhysicsListSvc::CommandLog(int returnCode, const std::string& commandString) const { switch(returnCode) { case 0: { ATH_MSG_DEBUG("G4 Command: " << commandString << " - Command Succeeded"); } break; diff --git a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/PhysicsListToolBase.h b/Simulation/G4Atlas/G4AtlasServices/src/PhysicsListSvc.h similarity index 77% rename from Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/PhysicsListToolBase.h rename to Simulation/G4Atlas/G4AtlasServices/src/PhysicsListSvc.h index 9c35d8acb551f8c56a30521d89b6dfd82445bb86..2982f72ef4bcad53c6d08ab967c6fd7d6c844e13 100644 --- a/Simulation/G4Atlas/G4AtlasTools/G4AtlasTools/PhysicsListToolBase.h +++ b/Simulation/G4Atlas/G4AtlasServices/src/PhysicsListSvc.h @@ -1,13 +1,13 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration */ -#ifndef G4ATLASTOOLS_PHYSICSLISTTOOLBASE_H -#define G4ATLASTOOLS_PHYSICSLISTTOOLBASE_H +#ifndef G4ATLASTOOLS_PHYSICSLISTSVC_H +#define G4ATLASTOOLS_PHYSICSLISTSVC_H // Base classes -#include "G4AtlasInterfaces/IPhysicsListTool.h" -#include "AthenaBaseComps/AthAlgTool.h" +#include "G4AtlasInterfaces/IPhysicsListSvc.h" +#include "AthenaBaseComps/AthService.h" #include "G4AtlasInterfaces/IPhysicsOptionTool.h" @@ -20,16 +20,16 @@ class G4VUserPhysicsList; // STL library #include <string> -class PhysicsListToolBase : public extends<AthAlgTool, IPhysicsListTool> +class PhysicsListSvc : public extends<AthService, IPhysicsListSvc> { public: // Standard constructor and destructor - PhysicsListToolBase(const std::string& type, const std::string& name, const IInterface *parent); - ~PhysicsListToolBase() {} + PhysicsListSvc(const std::string& name, ISvcLocator* pSvcLocator); + virtual ~PhysicsListSvc() = default; virtual StatusCode initialize( ) override; - // Base class methods from IPhysicsListTool + // Base class methods from IPhysicsListSvc virtual void CreatePhysicsList() override; virtual G4VUserPhysicsList* GetPhysicsList() override; virtual void SetPhysicsList() override; diff --git a/Simulation/G4Atlas/G4AtlasServices/src/components/G4AtlasServices_entries.cxx b/Simulation/G4Atlas/G4AtlasServices/src/components/G4AtlasServices_entries.cxx index 8b5e068c95174bff5bc0a8bfc8cfd7d7ccdd8260..24bd99bd8b5c9f85cb9e648ac4284cdfb92c921a 100644 --- a/Simulation/G4Atlas/G4AtlasServices/src/components/G4AtlasServices_entries.cxx +++ b/Simulation/G4Atlas/G4AtlasServices/src/components/G4AtlasServices_entries.cxx @@ -1,3 +1,4 @@ +#include "../PhysicsListSvc.h" #include "../UserLimitsSvc.h" #include "../G4AtlasSvc.h" #include "../G4GeometryNotifierSvc.h" @@ -6,6 +7,7 @@ #include "../ConstantFieldSvc.h" #include "../StandardFieldSvc.h" +DECLARE_COMPONENT( PhysicsListSvc ) DECLARE_COMPONENT( UserLimitsSvc ) DECLARE_COMPONENT( G4AtlasSvc ) DECLARE_COMPONENT( G4GeometryNotifierSvc ) diff --git a/Simulation/G4Atlas/G4AtlasTools/CMakeLists.txt b/Simulation/G4Atlas/G4AtlasTools/CMakeLists.txt index 089e5713aa6c26b371bb0da3e92b7081fcc64dff..5c0bf5ef21e009f52c83848847bf114d16fe25f5 100644 --- a/Simulation/G4Atlas/G4AtlasTools/CMakeLists.txt +++ b/Simulation/G4Atlas/G4AtlasTools/CMakeLists.txt @@ -11,8 +11,7 @@ atlas_depends_on_subdirs( PUBLIC Control/AthenaBaseComps Simulation/G4Atlas/G4AtlasInterfaces PRIVATE - GaudiKernel - Simulation/G4Utilities/G4PhysicsLists ) + GaudiKernel ) # External dependencies: find_package( Boost COMPONENTS filesystem thread system ) @@ -30,12 +29,12 @@ atlas_add_library( G4AtlasToolsLib PRIVATE_INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} LINK_LIBRARIES ${XERCESC_LIBRARIES} ${GEANT4_LIBRARIES} ${TBB_LIBRARIES} AthenaBaseComps G4AtlasInterfaces - PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} GaudiKernel G4PhysicsLists ) + PRIVATE_LINK_LIBRARIES ${Boost_LIBRARIES} ${CLHEP_LIBRARIES} GaudiKernel ) atlas_add_component( G4AtlasTools src/components/*.cxx INCLUDE_DIRS ${Boost_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${GEANT4_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${TBB_INCLUDE_DIRS} - LINK_LIBRARIES ${Boost_LIBRARIES} ${XERCESC_LIBRARIES} ${GEANT4_LIBRARIES} ${CLHEP_LIBRARIES} ${TBB_LIBRARIES} AthenaBaseComps G4AtlasInterfaces GaudiKernel G4PhysicsLists G4AtlasToolsLib ) + LINK_LIBRARIES ${Boost_LIBRARIES} ${XERCESC_LIBRARIES} ${GEANT4_LIBRARIES} ${CLHEP_LIBRARIES} ${TBB_LIBRARIES} AthenaBaseComps G4AtlasInterfaces GaudiKernel G4AtlasToolsLib ) #testing just the simulation parts, no forward detectors or region diff --git a/Simulation/G4Atlas/G4AtlasTools/python/G4AtlasToolsConfig.py b/Simulation/G4Atlas/G4AtlasTools/python/G4AtlasToolsConfig.py index 2865fae01720a7008ab45061c293dc2bdacd246a..71c8be6a5bf0e0aa001e3264fa87a7e62172928b 100644 --- a/Simulation/G4Atlas/G4AtlasTools/python/G4AtlasToolsConfig.py +++ b/Simulation/G4Atlas/G4AtlasTools/python/G4AtlasToolsConfig.py @@ -209,38 +209,3 @@ def getSensitiveDetectorMasterTool(name="SensitiveDetectorMasterTool", **kwargs) def getEmptySensitiveDetectorMasterTool(name="EmptySensitiveDetectorMasterTool", **kwargs): return CfgMgr.SensitiveDetectorMasterTool(name, **kwargs) - -def getPhysicsListToolBase(name="PhysicsListToolBase", **kwargs): - PhysOptionList = ["G4StepLimitationTool"] - from G4AtlasApps.SimFlags import simFlags - PhysOptionList += simFlags.PhysicsOptions.get_Value() - PhysDecaysList = [] - from AthenaCommon.DetFlags import DetFlags - if DetFlags.simulate.TRT_on(): - PhysOptionList +=["TRTPhysicsTool"] - if DetFlags.simulate.Lucid_on() or DetFlags.simulate.AFP_on(): - PhysOptionList +=["LucidPhysicsTool"] - kwargs.setdefault("PhysOption", PhysOptionList) - kwargs.setdefault("PhysicsDecay", PhysDecaysList) - from G4AtlasApps.SimFlags import simFlags - kwargs.setdefault("PhysicsList", simFlags.PhysicsList.get_Value()) - if 'PhysicsList' in kwargs: - if kwargs['PhysicsList'].endswith('_EMV') or kwargs['PhysicsList'].endswith('_EMX'): - raise RuntimeError( 'PhysicsList not allowed: '+kwargs['PhysicsList'] ) - kwargs.setdefault("GeneralCut", 1.) - if hasattr(simFlags, 'NeutronTimeCut') and simFlags.NeutronTimeCut.statusOn: - kwargs.setdefault("NeutronTimeCut", simFlags.NeutronTimeCut.get_Value()) - if hasattr(simFlags, 'NeutronEnergyCut') and simFlags.NeutronEnergyCut.statusOn: - kwargs.setdefault("NeutronEnergyCut", simFlags.NeutronEnergyCut.get_Value()) - if hasattr(simFlags, 'ApplyEMCuts') and simFlags.ApplyEMCuts.statusOn: - kwargs.setdefault("ApplyEMCuts", simFlags.ApplyEMCuts.get_Value()) - ## from AthenaCommon.SystemOfUnits import eV, TeV - ## kwargs.setdefault("EMMaxEnergy" , 7*TeV) - ## kwargs.setdefault("EMMinEnergy" , 100*eV) - """ --- ATLASSIM-3967 --- - these two options are replaced by SetNumberOfBinsPerDecade - which now controls both values. - """ - ## kwargs.setdefault("EMDEDXBinning" , 77) - ## kwargs.setdefault("EMLambdaBinning" , 77) - return CfgMgr.PhysicsListToolBase(name, **kwargs) diff --git a/Simulation/G4Atlas/G4AtlasTools/python/G4AtlasToolsConfigDb.py b/Simulation/G4Atlas/G4AtlasTools/python/G4AtlasToolsConfigDb.py index 33743efcdb8254ca1a16cbd14600d3c720e5c6d4..d1868accc5650b5920f2acfc4778b8bbe9fbfe77 100644 --- a/Simulation/G4Atlas/G4AtlasTools/python/G4AtlasToolsConfigDb.py +++ b/Simulation/G4Atlas/G4AtlasTools/python/G4AtlasToolsConfigDb.py @@ -5,7 +5,6 @@ addTool("G4AtlasTools.G4AtlasToolsConfig.getFastSimulationMasterTool","FastSimul addTool("G4AtlasTools.G4AtlasToolsConfig.getEmptyFastSimulationMasterTool","EmptyFastSimulationMasterTool") addTool("G4AtlasTools.G4AtlasToolsConfig.getEmptySensitiveDetectorMasterTool","EmptySensitiveDetectorMasterTool") addTool("G4AtlasTools.G4AtlasToolsConfig.getSensitiveDetectorMasterTool","SensitiveDetectorMasterTool") -addTool("G4AtlasTools.G4AtlasToolsConfig.getPhysicsListToolBase","PhysicsListToolBase") addTool("G4AtlasTools.G4GeometryConfig.getBeamPipeGeoDetectorTool", 'BeamPipe') addTool("G4AtlasTools.G4GeometryConfig.getPixelGeoDetectorTool", 'Pixel') diff --git a/Simulation/G4Atlas/G4AtlasTools/src/components/G4AtlasTools_entries.cxx b/Simulation/G4Atlas/G4AtlasTools/src/components/G4AtlasTools_entries.cxx index 284301723c9aeed750bfb2bc4db238f10c4d0de1..398adc287669e2909b9ca012f49c9f16dc812cd8 100644 --- a/Simulation/G4Atlas/G4AtlasTools/src/components/G4AtlasTools_entries.cxx +++ b/Simulation/G4Atlas/G4AtlasTools/src/components/G4AtlasTools_entries.cxx @@ -1,4 +1,3 @@ -#include "G4AtlasTools/PhysicsListToolBase.h" #include "G4AtlasTools/DetectorGeometryBase.h" #include "G4AtlasTools/CylindricalEnvelope.h" #include "G4AtlasTools/BoxEnvelope.h" @@ -14,7 +13,6 @@ #include "../G4ThreadInitTool.h" #include "../MaterialDescriptionTool.h" -DECLARE_COMPONENT( PhysicsListToolBase ) DECLARE_COMPONENT( DetectorGeometryBase ) DECLARE_COMPONENT( CylindricalEnvelope ) DECLARE_COMPONENT( BoxEnvelope ) diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TransportTool.cxx b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TransportTool.cxx index 3b75b1d0415ce4ec85745d36d420a8654c5a0d64..45b164a2b6d64d94ba5b4c582361b01e502760ee 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TransportTool.cxx +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TransportTool.cxx @@ -125,10 +125,10 @@ void iGeant4::G4TransportTool::initializeOnce() throw std::runtime_error("G4RunManagerHelper::g4RunManager() returned nullptr."); } - if(m_physListTool.retrieve().isFailure()) { - throw std::runtime_error("Could not initialize ATLAS PhysicsListTool!"); + if(m_physListSvc.retrieve().isFailure()) { + throw std::runtime_error("Could not initialize ATLAS PhysicsListSvc!"); } - m_physListTool->SetPhysicsList(); + m_physListSvc->SetPhysicsList(); m_pRunMgr->SetRecordFlux( m_recordFlux, std::make_unique<ISFFluxRecorder>() ); m_pRunMgr->SetLogLevel( int(msg().level()) ); // Synch log levels @@ -136,7 +136,7 @@ void iGeant4::G4TransportTool::initializeOnce() m_pRunMgr->SetDetGeoSvc( m_detGeoSvc.typeAndName() ); m_pRunMgr->SetSDMasterTool(m_senDetTool.typeAndName() ); m_pRunMgr->SetFastSimMasterTool(m_fastSimTool.typeAndName() ); - m_pRunMgr->SetPhysListTool(m_physListTool.typeAndName() ); + m_pRunMgr->SetPhysListSvc(m_physListSvc.typeAndName() ); G4UImanager *ui = G4UImanager::GetUIpointer(); diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TransportTool.h b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TransportTool.h index 4a2648677def9ccd2e3f6b601a4a46a3865d207d..df0871742452a50565d491bae26a083051299d59 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TransportTool.h +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TransportTool.h @@ -24,7 +24,7 @@ #include "G4AtlasInterfaces/IDetectorGeometrySvc.h" #include "G4AtlasInterfaces/ISensitiveDetectorMasterTool.h" #include "G4AtlasInterfaces/IFastSimulationMasterTool.h" -#include "G4AtlasInterfaces/IPhysicsListTool.h" +#include "G4AtlasInterfaces/IPhysicsListSvc.h" #include "CxxUtils/checker_macros.h" // ISF includes @@ -144,8 +144,8 @@ namespace iGeant4 ServiceHandle<IDetectorGeometrySvc> m_detGeoSvc{this, "DetGeoSvc", "DetectorGeometrySvc", ""}; /// Service to convert ISF_Particles into a G4Event ServiceHandle<ISF::IInputConverter> m_inputConverter{this, "InputConverter", "ISF_InputConverter", ""}; - /// Physics List Tool - PublicToolHandle<IPhysicsListTool> m_physListTool{this, "PhysicsListTool", "PhysicsListToolBase", ""}; + /// Physics List Service + ServiceHandle<IPhysicsListSvc> m_physListSvc{this, "PhysicsListSvc", "PhysicsListSvc", ""}; /// Sensitive Detector Master Tool PublicToolHandle<ISensitiveDetectorMasterTool> m_senDetTool{this, "SenDetMasterTool", "SensitiveDetectorMasterTool", ""}; /// Fast Simulation Master Tool