From dd62e9cf760b4bb9b71569dc839cbd5655396043 Mon Sep 17 00:00:00 2001 From: "Vincent R. Pascuzzi" <vrpascuzzi@lbl.gov> Date: Fri, 26 Mar 2021 13:19:33 -0700 Subject: [PATCH] Refactor ISF_Acts packages; support only SimKernelMT for ActsFatras As we will use Acts-Fatras exclusively for the Inner Detector, only a single simulator/processor is needed. We are not supporting SimKernel algorithms with Acts-Fatras tools, so ISF_ActsFatrasServices/ActsSimTool codes were moved into ISF_ActsFatrasTools/ActsFatrasSimTool, the latter becoming a BaseSimulatorTool that also implements the processing of particles. Supporting only SimKernelMT, ISF_ActsFatrasServices has been removed altogether. Other general clean-up of comments and formatting. --- .../ISF_Acts/ISF_ActsServices/CMakeLists.txt | 20 ----- .../python/ISF_ActsServicesConfig.py | 22 ------ .../python/ISF_ActsServicesConfigDb.py | 7 -- .../ISF_ActsServices/src/ActsSimTool.cxx | 64 --------------- .../ISF_ActsServices/src/ActsSimTool.h | 56 -------------- .../components/ISF_ActsServices_entries.cxx | 3 - .../ISF_ActsTools/src/ActsFatrasSimTool.cxx | 56 +++++++++++--- .../ISF_ActsTools/src/ActsFatrasSimTool.h | 77 +++++++++---------- .../ISF/ISF_Config/python/ISF_MainConfig.py | 18 +++-- .../python/ISF_Geant4ToolsConfig.py | 4 +- .../python/ISF_SimulationSelectorsConfig.py | 5 +- 11 files changed, 98 insertions(+), 234 deletions(-) delete mode 100644 Simulation/ISF/ISF_Acts/ISF_ActsServices/CMakeLists.txt delete mode 100644 Simulation/ISF/ISF_Acts/ISF_ActsServices/python/ISF_ActsServicesConfig.py delete mode 100644 Simulation/ISF/ISF_Acts/ISF_ActsServices/python/ISF_ActsServicesConfigDb.py delete mode 100644 Simulation/ISF/ISF_Acts/ISF_ActsServices/src/ActsSimTool.cxx delete mode 100644 Simulation/ISF/ISF_Acts/ISF_ActsServices/src/ActsSimTool.h delete mode 100644 Simulation/ISF/ISF_Acts/ISF_ActsServices/src/components/ISF_ActsServices_entries.cxx diff --git a/Simulation/ISF/ISF_Acts/ISF_ActsServices/CMakeLists.txt b/Simulation/ISF/ISF_Acts/ISF_ActsServices/CMakeLists.txt deleted file mode 100644 index f325c83aa3d..00000000000 --- a/Simulation/ISF/ISF_Acts/ISF_ActsServices/CMakeLists.txt +++ /dev/null @@ -1,20 +0,0 @@ -################################################################################ -# Package: ISF_ActsServices -################################################################################ - -# Declare the package name: -atlas_subdir( ISF_ActsServices ) - -find_package( Acts COMPONENTS Core PluginJson ) - -# Component(s) in the package: -atlas_add_component( ISF_ActsServices - src/*.cxx - src/components/*.cxx - LINK_LIBRARIES AthenaBaseComps AtlasDetDescr GaudiKernel - ISF_InterfacesLib TrkTrack ISF_Event ActsCore - ActsPluginJson) - -# Install files from the package: -atlas_install_python_modules( python/*.py ) - diff --git a/Simulation/ISF/ISF_Acts/ISF_ActsServices/python/ISF_ActsServicesConfig.py b/Simulation/ISF/ISF_Acts/ISF_ActsServices/python/ISF_ActsServicesConfig.py deleted file mode 100644 index 29e3540ccbd..00000000000 --- a/Simulation/ISF/ISF_Acts/ISF_ActsServices/python/ISF_ActsServicesConfig.py +++ /dev/null @@ -1,22 +0,0 @@ -# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration - -from AthenaCommon.CfgGetter import getPublicTool - - -def getActsSimServiceID(name="ISF_ActsSimSvc", **kwargs): - kwargs.setdefault("Identifier", "Fatras") - kwargs.setdefault("SimulatorTool", "ISF_ActsSimulatorToolST") - from AthenaCommon import CfgMgr - return CfgMgr.ISF__LegacySimSvc(name, **kwargs ) - - -def getActsSimulatorToolST(name="ISF_ActsSimulatorToolST", **kwargs): - kwargs.setdefault("IDSimulationTool", getPublicTool('ISF_ActsFatrasSimTool')) - kwargs.setdefault("SimulationTool", getPublicTool('ISF_ActsFatrasSimTool')) - # register Fatras random number stream if not already registered - from G4AtlasApps.SimFlags import simFlags - if not simFlags.RandomSeedList.checkForExistingSeed( "FatrasRnd" ): - simFlags.RandomSeedList.addSeed( "FatrasRnd", 81234740, 23474923 ) - from AthenaCommon import CfgMgr - return CfgMgr.ISF__ActsSimTool(name, **kwargs ) - diff --git a/Simulation/ISF/ISF_Acts/ISF_ActsServices/python/ISF_ActsServicesConfigDb.py b/Simulation/ISF/ISF_Acts/ISF_ActsServices/python/ISF_ActsServicesConfigDb.py deleted file mode 100644 index 05a49efa619..00000000000 --- a/Simulation/ISF/ISF_Acts/ISF_ActsServices/python/ISF_ActsServicesConfigDb.py +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration - - -from AthenaCommon.CfgGetter import addTool - -addTool("ISF_ActsServices.ISF_ActsServicesConfig.getActsSimServiceID", "ISF_ActsSimSvc") -addTool("ISF_ActsServices.ISF_ActsServicesConfig.getActsSimulatorToolST", "ISF_ActsSimulatorToolST") diff --git a/Simulation/ISF/ISF_Acts/ISF_ActsServices/src/ActsSimTool.cxx b/Simulation/ISF/ISF_Acts/ISF_ActsServices/src/ActsSimTool.cxx deleted file mode 100644 index 5b4fc8927db..00000000000 --- a/Simulation/ISF/ISF_Acts/ISF_ActsServices/src/ActsSimTool.cxx +++ /dev/null @@ -1,64 +0,0 @@ -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#include "./ActsSimTool.h" - -ISF::ActsSimTool::ActsSimTool(const std::string& type, const std::string& name, - const IInterface* parent) - : BaseSimulatorTool(type, name, parent) { - declareProperty("UseSimulationTool", m_useExtrapolator); -} - -ISF::ActsSimTool::~ActsSimTool() {} - -StatusCode ISF::ActsSimTool::initialize() { - ATH_CHECK(BaseSimulatorTool::initialize()); - - // retrieve simulation tool - ATH_CHECK(m_IDsimulationTool.retrieve()); - - // retrieve simulation tool - if (m_useExtrapolator) { - ATH_CHECK(m_simulationTool.retrieve()); - } else { - m_simulationTool.disable(); - ATH_MSG_INFO("Using only Extrapolation Engine Tools..."); - } - - // retrieve particle filter - if (!m_particleFilter.empty()) { - ATH_CHECK(m_particleFilter.retrieve()); - } - return StatusCode::SUCCESS; -} - -StatusCode ISF::ActsSimTool::simulate(const ISFParticle& isp, - ISFParticleContainer& secondaries, - McEventCollection*) const { - // same step as Fatras sim tool - // give a screen output that you entered ActsSimSvc - ATH_MSG_VERBOSE("Particle " << isp << " received for simulation."); - - // now decide what to do with the particle - if (!m_particleFilter.empty() && !m_particleFilter->passFilter(isp)) { - ATH_MSG_VERBOSE("YIFEI ISFParticle " - << isp << " does not pass selection. Ignore."); - return StatusCode::SUCCESS; - } - /** Process Particle from particle broker */ - ISF::ISFParticle* newIsp = (isp.nextGeoID() == AtlasDetDescr::fAtlasID || - isp.nextGeoID() == AtlasDetDescr::fAtlasForward) - ? m_IDsimulationTool->process(isp) - : m_simulationTool->process(isp); - ATH_MSG_VERBOSE("Simulation created : " << (newIsp ? "" : "no") - << " new particle"); - - if (newIsp) { - // new particle into the stack - secondaries.push_back(newIsp); - } - - // Acts call done - return StatusCode::SUCCESS; -} diff --git a/Simulation/ISF/ISF_Acts/ISF_ActsServices/src/ActsSimTool.h b/Simulation/ISF/ISF_Acts/ISF_ActsServices/src/ActsSimTool.h deleted file mode 100644 index 65a5fb2274e..00000000000 --- a/Simulation/ISF/ISF_Acts/ISF_ActsServices/src/ActsSimTool.h +++ /dev/null @@ -1,56 +0,0 @@ -// -*- c++ -*- - -/* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef ISF_ACTSSIMTOOL_h -#define ISF_ACTSSIMTOOL_h - -// Gaudi -#include "GaudiKernel/ServiceHandle.h" -#include "GaudiKernel/ToolHandle.h" // for ToolHandleArray - -// ISF -#include "ISF_Interfaces/BaseSimulatorTool.h" -#include "ISF_Interfaces/IParticleFilter.h" -#include "ISF_Interfaces/IParticleProcessor.h" - -namespace ISF { - -class ActsSimTool : public BaseSimulatorTool { - public: - ActsSimTool(const std::string& type, const std::string& name, - const IInterface* parent); - - ~ActsSimTool(); - - virtual StatusCode initialize() override; - - virtual StatusCode simulate(const ISFParticle& isp, ISFParticleContainer&, - McEventCollection*) const override; - - virtual StatusCode setupEvent() override { return StatusCode::SUCCESS; }; - - virtual StatusCode releaseEvent() override { return StatusCode::SUCCESS; }; - - virtual ISF::SimulationFlavor simFlavor() const override { - return ISF::Fatras; - }; - - private: - /** Track Creation & transport */ - PublicToolHandle<ISF::IParticleProcessor> m_IDsimulationTool{ - this, "IDSimulationTool", "", ""}; //!< Pointer to the transport AlgTool - bool m_useExtrapolator{ - true}; //!< Boolean used to run with the old extrapolator setup - PublicToolHandle<ISF::IParticleProcessor> m_simulationTool{ - this, "SimulationTool", "", ""}; //!< Pointer to the transport AlgTool - PublicToolHandle<ISF::IParticleFilter> m_particleFilter{ - this, "ParticleFilter", "", - ""}; //!< the particle filter concerning kinematic cuts, etc. -}; - -} // namespace ISF - -#endif diff --git a/Simulation/ISF/ISF_Acts/ISF_ActsServices/src/components/ISF_ActsServices_entries.cxx b/Simulation/ISF/ISF_Acts/ISF_ActsServices/src/components/ISF_ActsServices_entries.cxx deleted file mode 100644 index 652baee1f6d..00000000000 --- a/Simulation/ISF/ISF_Acts/ISF_ActsServices/src/components/ISF_ActsServices_entries.cxx +++ /dev/null @@ -1,3 +0,0 @@ -#include "../ActsSimTool.h" - -DECLARE_COMPONENT(ISF::ActsSimTool) \ No newline at end of file diff --git a/Simulation/ISF/ISF_Acts/ISF_ActsTools/src/ActsFatrasSimTool.cxx b/Simulation/ISF/ISF_Acts/ISF_ActsTools/src/ActsFatrasSimTool.cxx index 654c6c48a96..1832b3e44ff 100644 --- a/Simulation/ISF/ISF_Acts/ISF_ActsTools/src/ActsFatrasSimTool.cxx +++ b/Simulation/ISF/ISF_Acts/ISF_ActsTools/src/ActsFatrasSimTool.cxx @@ -10,8 +10,6 @@ #include "ActsGeometry/ActsTrackingGeometryTool.h" #include "ActsGeometryInterfaces/IActsTrackingGeometryTool.h" #include "ActsInterop/Logger.h" -#include "ISF_Event/ISFParticle.h" -#include "ISF_FatrasInterfaces/ISimHitCreator.h" // ACTS #include "Acts/EventData/SingleCurvilinearTrackParameters.hpp" @@ -36,17 +34,30 @@ using namespace Acts::UnitLiterals; ISF::ActsFatrasSimTool::ActsFatrasSimTool(const std::string& type, const std::string& name, const IInterface* parent) - : base_class(type, name, parent) { + : BaseSimulatorTool(type, name, parent) { // declareProperty("TrackingGeometryTool", m_trackingGeometryTool); // declareProperty("ActsExtrapolationTool", m_actsExtrapolationTool); - // hit creation tools declareProperty("SimHitCreatorID", m_simHitCreatorID); - // declareProperty( "SimHitCreatorMS", m_simHitCreatorMS); } ISF::ActsFatrasSimTool::~ActsFatrasSimTool() {} StatusCode ISF::ActsFatrasSimTool::initialize() { + ATH_CHECK(BaseSimulatorTool::initialize()); + + // retrieve simulation tool + // if (m_useExtrapolator) { + // ATH_CHECK(m_simulationTool.retrieve()); + // } else { + // m_simulationTool.disable(); + // ATH_MSG_INFO("Using only Extrapolation Engine Tools..."); + // } + + // retrieve particle filter + if (!m_particleFilter.empty()) { + ATH_CHECK(m_particleFilter.retrieve()); + } + ATH_CHECK(m_trackingGeometryTool.retrieve()); ATH_CHECK(m_actsExtrapolationTool.retrieve()); @@ -55,17 +66,42 @@ StatusCode ISF::ActsFatrasSimTool::initialize() { m_logger = makeActsAthenaLogger(this, "ActsFatrasSimTool", "ActsFatrasSimTool"); - // retreive hit creators + // retreive HitCreators if (retrieveTool<iFatras::ISimHitCreator>(m_simHitCreatorID).isFailure()) return StatusCode::FAILURE; return StatusCode::SUCCESS; } -StatusCode ISF::ActsFatrasSimTool::finalize() { return StatusCode::SUCCESS; } +StatusCode ISF::ActsFatrasSimTool::simulate(const ISFParticle& isp, + ISFParticleContainer& secondaries, + McEventCollection*) const { + // same step as Fatras sim tool + // give a screen output that you entered ActsSimSvc + ATH_MSG_VERBOSE("Particle " << isp << " received for simulation."); + + // now decide what to do with the particle + if (!m_particleFilter.empty() && !m_particleFilter->passFilter(isp)) { + ATH_MSG_VERBOSE("ISFParticle " + << isp << " does not pass selection. Ignoring."); + return StatusCode::SUCCESS; + } + /** Process Particle from particle broker */ + ISF::ISFParticle* newIsp = this->process(isp); + ATH_MSG_VERBOSE("ISFParicle created : " << (newIsp ? "" : "no") + << " new particle"); + + if (newIsp) { + // new particle into the stack + secondaries.push_back(newIsp); + } + + // Acts call done + return StatusCode::SUCCESS; +} ISF::ISFParticle* ISF::ActsFatrasSimTool::process( - const ISFParticle& isp, CLHEP::HepRandomEngine*) const { + const ISFParticle& isp) const { // copy the current particle onto the particle clipboard // ISF::ParticleClipboard::getInstance().setParticle(isp); @@ -78,8 +114,8 @@ ISF::ISFParticle* ISF::ActsFatrasSimTool::process( Generator generator; // input/ output particle and hits containers std::vector<ActsFatras::Particle> input; - std::vector<ActsFatras::Particle> simulatedInitial; - std::vector<ActsFatras::Particle> simulatedFinal; + // std::vector<ActsFatras::Particle> simulatedInitial; + // std::vector<ActsFatras::Particle> simulatedFinal; std::vector<ActsFatras::Hit> hits; // create input particles. particle number should ne non-zero. diff --git a/Simulation/ISF/ISF_Acts/ISF_ActsTools/src/ActsFatrasSimTool.h b/Simulation/ISF/ISF_Acts/ISF_ActsTools/src/ActsFatrasSimTool.h index f1633dfcb5d..12c5719c7ef 100644 --- a/Simulation/ISF/ISF_Acts/ISF_ActsTools/src/ActsFatrasSimTool.h +++ b/Simulation/ISF/ISF_Acts/ISF_ActsTools/src/ActsFatrasSimTool.h @@ -11,12 +11,13 @@ // Gaudi #include "GaudiKernel/ServiceHandle.h" -#include "GaudiKernel/ToolHandle.h" // for ToolHandleArray +#include "GaudiKernel/ToolHandle.h" // ISF +#include "ISF_Event/ISFParticle.h" +#include "ISF_FatrasInterfaces/ISimHitCreator.h" #include "ISF_Interfaces/BaseSimulatorTool.h" #include "ISF_Interfaces/IParticleFilter.h" -#include "ISF_Interfaces/IParticleProcessor.h" // ACTS #include "Acts/EventData/NeutralTrackParameters.hpp" @@ -30,7 +31,6 @@ #include "ActsGeometry/ActsTrackingGeometryTool.h" #include "ActsGeometryInterfaces/IActsExtrapolationTool.h" #include "ActsGeometryInterfaces/IActsTrackingGeometryTool.h" -//#include "Acts/Tests/CommonHelpers/CylindricalTrackingGeometry.hpp" #include "Acts/Utilities/UnitVectors.hpp" #include "ActsFatras/Kernel/PhysicsList.hpp" #include "ActsFatras/Kernel/Simulator.hpp" @@ -39,7 +39,6 @@ #include "ActsFatras/Selectors/SurfaceSelectors.hpp" #include "ActsFatras/Utilities/ParticleData.hpp" #include "ActsInterop/Logger.h" -//#include "Acts/Utilities/Logger.hpp" class AtlasDetectorID; using namespace Acts::UnitLiterals; @@ -47,8 +46,7 @@ namespace iFatras { class ISimHitCreator; } -namespace ISF { // use fatras namespace for now, to be replaced to ACTS - // namespace TODO +namespace ISF { struct SplitEnergyLoss { double splitMomentumMin = 5_GeV; @@ -71,13 +69,13 @@ struct SplitEnergyLoss { /** @class ACTSFATRASSIMTOOL - Standard ATLAS hit creator, with ACTS-fatras simulation + Standard ATLAS hit creator, with Acts-fatras simulation @author yi.fei.han at cern.ch @author vrpascuzzi at lbl.gov */ -class ActsFatrasSimTool : public extends<AthAlgTool, ISF::IParticleProcessor> { +class ActsFatrasSimTool : public BaseSimulatorTool { public: using Navigator = Acts::Navigator; using MagneticField = Acts::ConstantBField; @@ -102,28 +100,19 @@ class ActsFatrasSimTool : public extends<AthAlgTool, ISF::IParticleProcessor> { using Simulator = ActsFatras::Simulator<ChargedSelector, ChargedSimulator, NeutralSelector, NeutralSimulator>; - /**Constructor */ - ActsFatrasSimTool(const std::string&, const std::string&, const IInterface*); - /**Destructor*/ + ActsFatrasSimTool(const std::string& type, const std::string& name, + const IInterface* parent); virtual ~ActsFatrasSimTool(); - /** AlgTool initailize method.*/ + // Interface methods virtual StatusCode initialize() override; - /** AlgTool finalize method */ - virtual StatusCode finalize() override; + virtual StatusCode simulate(const ISFParticle& isp, ISFParticleContainer&, + McEventCollection*) const override; + virtual StatusCode setupEvent() { return StatusCode::SUCCESS; }; + virtual StatusCode releaseEvent() { return StatusCode::SUCCESS; }; + virtual ISF::SimulationFlavor simFlavor() const override { return ISF::Fatras; }; - virtual ISF::ISFParticle* process(const ISFParticle& isp, - CLHEP::HepRandomEngine*) const override; - - virtual StatusCode setupEvent() { return StatusCode::SUCCESS; }; // override - - virtual StatusCode releaseEvent() { - return StatusCode::SUCCESS; - }; // override - - virtual ISF::SimulationFlavor simFlavor() const { - return ISF::Fatras; - }; // override + virtual ISF::ISFParticle* process(const ISFParticle& isp) const; private: /** templated Tool retrieval - gives unique handling & look and feel */ @@ -138,9 +127,11 @@ class ActsFatrasSimTool : public extends<AthAlgTool, ISF::IParticleProcessor> { return StatusCode::SUCCESS; } - std::string m_idHelperName; + // Tracking geometry tools ToolHandle<IActsTrackingGeometryTool> m_trackingGeometryTool{ this, "ActsTrackingGeometryTool", "ActsTrackingGeometryTool"}; + std::shared_ptr<const Acts::TrackingGeometry> m_trackingGeometry; + // Acts extrapolator ToolHandle<IActsExtrapolationTool> m_actsExtrapolationTool{ this, "ActsExtrapolationTool", "ActsExtrapolationTool"}; @@ -148,17 +139,15 @@ class ActsFatrasSimTool : public extends<AthAlgTool, ISF::IParticleProcessor> { Acts::MagneticFieldContext m_magCtx; std::unique_ptr<const Acts::Logger> m_logger{nullptr}; - // construct the example detector - std::shared_ptr<const Acts::TrackingGeometry> m_trackingGeometry; - // construct the propagators + // Acts propagators Navigator m_navigator{std::move(m_trackingGeometry)}; ChargedStepper m_chargedStepper{Acts::ConstantBField(0, 0, 1_T)}; ChargedPropagator m_chargedPropagator{std::move(m_chargedStepper), m_navigator}; NeutralPropagator m_neutralPropagator{NeutralStepper(), m_navigator}; - // construct the simulator + // Acts simulators ChargedSimulator m_chargedSimulator{std::move(m_chargedPropagator), Acts::Logging::Level::VERBOSE}; NeutralSimulator m_neutralSimulator{std::move(m_neutralPropagator), @@ -166,18 +155,14 @@ class ActsFatrasSimTool : public extends<AthAlgTool, ISF::IParticleProcessor> { Simulator m_simulator{std::move(m_chargedSimulator), std::move(m_neutralSimulator)}; - // Sim Hit Creators + // SimHit creator for Inner Detector ToolHandle<iFatras::ISimHitCreator> m_simHitCreatorID; - // ToolHandle<ISimHitCreator> m_simHitCreatorMS; - Gaudi::Property<double> m_ptLoopers{ - this, "PtLoopers", 300, - "pT loop protection threshold, converted to Acts MeV unit"}; - Gaudi::Property<double> m_maxStepSize{this, "MaxStepSize", 10, - "Max step size in Acts m unit"}; - Gaudi::Property<double> m_maxStep{this, "MaxSteps", 4000, - "Max number of steps"}; + + // Particle filtering + PublicToolHandle<ISF::IParticleFilter> m_particleFilter{ + this, "ParticleFilter", "", "Particle filter kinematic cuts, etc."}; - // Material inteaction option + // Properties Gaudi::Property<bool> m_interactionMultiScatering{ this, "InteractionMultiScatering", false, "Whether to consider multiple scattering in the interactor"}; @@ -187,7 +172,15 @@ class ActsFatrasSimTool : public extends<AthAlgTool, ISF::IParticleProcessor> { Gaudi::Property<bool> m_interactionRecord{ this, "InteractionRecord", false, "Whether to record all material interactions"}; + Gaudi::Property<double> m_maxStepSize{this, "MaxStepSize", 10, + "Max step size in Acts m unit"}; + Gaudi::Property<double> m_maxStep{this, "MaxSteps", 4000, + "Max number of steps"}; + Gaudi::Property<double> m_ptLoopers{ + this, "PtLoopers", 300, + "pT loop protection threshold, converted to Acts MeV unit"}; }; -} // namespace ISF + +} // namespace ISF #endif diff --git a/Simulation/ISF/ISF_Config/python/ISF_MainConfig.py b/Simulation/ISF/ISF_Config/python/ISF_MainConfig.py index fea89b136df..7874d633118 100644 --- a/Simulation/ISF/ISF_Config/python/ISF_MainConfig.py +++ b/Simulation/ISF/ISF_Config/python/ISF_MainConfig.py @@ -548,17 +548,23 @@ def getKernel_ATLFASTIIF_G4MS(name="ISF_Kernel_ATLFASTIIF_G4MS", **kwargs): ############## Simulator: ATLFASTIIF_ACTS ############### def getKernel_ATLFASTIIF_ACTS(name="ISF_Kernel_ATLFASTIIF_ACTS", **kwargs): - kwargs.setdefault("BeamPipeSimulationSelectors" , [ 'ISF_DefaultParticleKillerSelector' ] ) - kwargs.setdefault("IDSimulationSelectors" , [ 'ISF_DefaultActsSelector' ] ) + kwargs.setdefault("SimulationTools", ["ISF_ParticleKillerTool", + "ISF_FastCaloTool", + "ISF_ActsFatrasSimTool", + "ISF_AFIIGeant4Tool"]) + kwargs.setdefault("ParticleOrderingTool" , 'ISF_ParticleOrderingTool') + kwargs.setdefault('EntryLayerTool' , 'ISF_AFIIEntryLayerToolMT') + kwargs.setdefault("BeamPipeSimulationSelectors" , [ 'ISF_DefaultParticleKillerSelector' ]) + kwargs.setdefault("IDSimulationSelectors" , [ 'ISF_DefaultActsSelector', 'ISF_DefaultParticleKillerSelector' ]) kwargs.setdefault("CaloSimulationSelectors" , [ 'ISF_MuonAFIIGeant4Selector', 'ISF_EtaGreater5ParticleKillerSimSelector', - 'ISF_DefaultFastCaloSimSelector' ] ) - kwargs.setdefault("MSSimulationSelectors" , [ 'ISF_DefaultAFIIGeant4Selector' ] ) - kwargs.setdefault("CavernSimulationSelectors" , [ 'ISF_DefaultParticleKillerSelector' ] ) + 'ISF_DefaultFastCaloSimSelector' ]) + kwargs.setdefault("MSSimulationSelectors" , [ 'ISF_DefaultAFIIGeant4Selector' ]) + kwargs.setdefault("CavernSimulationSelectors" , [ 'ISF_DefaultParticleKillerSelector' ]) # set the simFlags accordingly (TODO: is this even needed?) from G4AtlasApps.SimFlags import simFlags simFlags.SimulationFlavour = "ATLFASTIIF_ACTS" - return getKernel_GenericSimulator(name, **kwargs) + return getKernel_GenericSimulatorMT(name, **kwargs) ############## Simulator: ATLFASTIIFMT ############### def getKernel_ATLFASTIIFMT(name="ISF_Kernel_ATLFASTIIFMT", **kwargs): diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/python/ISF_Geant4ToolsConfig.py b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/python/ISF_Geant4ToolsConfig.py index c6e444e14f1..43bd7d3cde9 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/python/ISF_Geant4ToolsConfig.py +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/python/ISF_Geant4ToolsConfig.py @@ -47,7 +47,7 @@ def getPassBackG4TrackProcessorUserActionTool(name='PassBackG4TrackProcessorUser def getAFII_G4TrackProcessorUserActionTool(name='AFII_G4TrackProcessorUserActionTool', **kwargs): from ISF_Config.ISF_jobProperties import ISF_Flags - if ISF_Flags.Simulator.get_Value() in ['PassBackG4MT', 'ATLFASTIIMT', 'G4FastCaloMT', 'G4FastCaloMTEnergyOrdered']: + if ISF_Flags.Simulator.get_Value() in ['PassBackG4MT', 'ATLFASTIIMT', 'G4FastCaloMT', 'G4FastCaloMTEnergyOrdered', 'ATLFASTIIF_ACTS']: kwargs.setdefault('ParticleBroker', '') from AthenaCommon.SystemOfUnits import MeV kwargs.setdefault('GeoIDSvc' , 'ISF_AFIIGeoIDSvc' ) @@ -80,7 +80,7 @@ def getGeant4Tool(name="ISF_Geant4Tool", **kwargs): kwargs.setdefault('FastSimMasterTool', 'FastSimulationMasterTool') from AthenaCommon import CfgMgr # Workaround to keep other simulation flavours working while we migrate everything to be AthenaMT-compatible. - if ISF_Flags.Simulator.get_Value() in ['FullG4', 'FullG4MT', 'PassBackG4', 'PassBackG4MT', 'G4FastCalo', 'G4FastCaloMT', 'G4FastCaloEnergyOrdered', 'G4FastCaloMTEnergyOrdered']: + if ISF_Flags.Simulator.get_Value() in ['FullG4', 'FullG4MT', 'PassBackG4', 'PassBackG4MT', 'G4FastCalo', 'G4FastCaloMT', 'G4FastCaloEnergyOrdered', 'G4FastCaloMTEnergyOrdered', 'ATLFASTIIF_ACTS']: return CfgMgr.iGeant4__G4TransportTool(name, **kwargs) else: return CfgMgr.iGeant4__G4LegacyTransportTool(name, **kwargs) diff --git a/Simulation/ISF/ISF_SimulationSelectors/python/ISF_SimulationSelectorsConfig.py b/Simulation/ISF/ISF_SimulationSelectors/python/ISF_SimulationSelectorsConfig.py index d51da26170a..332fdc918a4 100644 --- a/Simulation/ISF/ISF_SimulationSelectors/python/ISF_SimulationSelectorsConfig.py +++ b/Simulation/ISF/ISF_SimulationSelectors/python/ISF_SimulationSelectorsConfig.py @@ -10,7 +10,7 @@ from ISF_SimulationSelectors import SimulationFlavor def usesSimKernelMT(): from ISF_Config.ISF_jobProperties import ISF_Flags - return (ISF_Flags.Simulator.get_Value() in ['FullG4MT', 'PassBackG4MT', 'ATLFASTIIMT', 'G4FastCaloMT', 'FullG4MT_LongLived']) + return (ISF_Flags.Simulator.get_Value() in ['FullG4MT', 'PassBackG4MT', 'ATLFASTIIMT', 'G4FastCaloMT', 'FullG4MT_LongLived', 'ATLFASTIIF_ACTS']) def getDefaultSimSelector(name="ISF_DefaultSimSelector", **kwargs): return CfgMgr.ISF__DefaultSimSelector(name, **kwargs ) @@ -125,7 +125,8 @@ def getDefaultFatrasNewExtrapolationSelector(name="ISF_DefaultFatrasNewExtrapola return getDefaultSimSelector(name, **kwargs ) def getDefaultActsSelector(name="ISF_DefaultActsSelector", **kwargs): - kwargs.setdefault("Simulator" , 'ISF_ActsSimSvc') + if not usesSimKernelMT(): + raise RuntimeError("SimulationSelector '%s' does not support running with SimKernel." % name) kwargs.setdefault('SimulationFlavor', SimulationFlavor.Fatras) return getDefaultSimSelector(name, **kwargs) -- GitLab