diff --git a/AtlasGeometryCommon/SubDetectorEnvelopes/python/SubDetectorEnvelopesConfigNew.py b/AtlasGeometryCommon/SubDetectorEnvelopes/python/SubDetectorEnvelopesConfigNew.py index 27c4db9169780354fbd3296c0c286115b6bd2d30..38cd6ae3541edc145d942463bc3258f738b912d0 100644 --- a/AtlasGeometryCommon/SubDetectorEnvelopes/python/SubDetectorEnvelopesConfigNew.py +++ b/AtlasGeometryCommon/SubDetectorEnvelopes/python/SubDetectorEnvelopesConfigNew.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration """ SubDetectorEnvelopes configurations for AtlasGeometryCommon @@ -13,8 +13,8 @@ DetDescrDBEnvelopeSvc=CompFactory.DetDescrDBEnvelopeSvc def EnvelopeDefSvcCfg(ConfigFlags, name="AtlasGeometry_EnvelopeDefSvc", **kwargs): result = ComponentAccumulator() - kwargs.setdefault("DBInDetNode" , 'InDetEnvelope' ) kwargs.setdefault("DBBeamPipeNode" , 'BeamPipeEnvelope' ) + kwargs.setdefault("DBInDetNode" , 'InDetEnvelope' if ConfigFlags.GeoModel.Run in ['RUN1', 'RUN2', 'RUN3'] else 'ITkEnvelope' ) kwargs.setdefault("DBCaloNode" , 'CaloEnvelope' ) kwargs.setdefault("DBMSNode" , 'MuonEnvelope' ) kwargs.setdefault("DBCavernNode" , 'CavernEnvelope' ) diff --git a/Simulation/G4Atlas/G4AtlasServices/python/G4AtlasUserActionConfigNew.py b/Simulation/G4Atlas/G4AtlasServices/python/G4AtlasUserActionConfigNew.py index e41234e5ee0f5bb7cb2147c634c459d01190ebf8..ca856e7bb7e8b508e0b8d5ecafe88ff426844ea3 100644 --- a/Simulation/G4Atlas/G4AtlasServices/python/G4AtlasUserActionConfigNew.py +++ b/Simulation/G4Atlas/G4AtlasServices/python/G4AtlasUserActionConfigNew.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory @@ -31,6 +31,7 @@ def FullG4TrackProcessorUserActionToolCfg(flags, name="FullG4TrackProcessorUserA kwargs.setdefault("GeoIDSvc", result.getService("ISF_GeoIDSvc")) if flags.Detector.GeometryCavern: kwargs.setdefault("TruthVolumeLevel", 2) + kwargs.setdefault("IsITkGeometry", flags.GeoModel.Run not in ['RUN1', 'RUN2', 'RUN3']) result.setPrivateTools(CompFactory.G4UA.iGeant4.TrackProcessorUserActionFullG4Tool(name, **kwargs)) return result diff --git a/Simulation/G4Atlas/G4AtlasTools/python/G4FieldConfigNew.py b/Simulation/G4Atlas/G4AtlasTools/python/G4FieldConfigNew.py index 72a9ef731d0a255395da2a6232d3a5b58eff1de5..5f04528e1f9f330247c94d00ca4400ea82b672ea 100644 --- a/Simulation/G4Atlas/G4AtlasTools/python/G4FieldConfigNew.py +++ b/Simulation/G4Atlas/G4AtlasTools/python/G4FieldConfigNew.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration # ComponentAccumulator based configuration from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator @@ -62,6 +62,15 @@ def InDetFieldManagerToolCfg(ConfigFlags, name='InDetFieldManager', **kwargs): kwargs.setdefault('MinimumEpsilonStep', 0.00001) return BasicDetectorFieldManagerToolCfg(ConfigFlags, name, **kwargs) +def ITkFieldManagerToolCfg(ConfigFlags, name='ITkFieldManager', **kwargs): + kwargs.setdefault("LogicalVolumes", ['ITK::ITK']) + #kwargs.setdefault('DeltaChord', 0.00001) + kwargs.setdefault('DeltaIntersection', 0.00001) + kwargs.setdefault('DeltaOneStep', 0.0001) + kwargs.setdefault('MaximumEpsilonStep', 0.001) + kwargs.setdefault('MinimumEpsilonStep', 0.00001) + return BasicDetectorFieldManagerToolCfg(ConfigFlags, name, **kwargs) + def MuonsOnlyInCaloFieldManagerToolCfg(ConfigFlags, name='MuonsOnlyInCaloFieldManager', **kwargs): kwargs.setdefault("LogicalVolumes", ['CALO::CALO']) #kwargs.setdefault('DeltaChord', 0.00000002) diff --git a/Simulation/G4Atlas/G4AtlasTools/python/G4GeometryConfig.py b/Simulation/G4Atlas/G4AtlasTools/python/G4GeometryConfig.py index 541f0219f311e48374734a01e52fa87e815b1a92..05b49921bf917b789345770ce62b9da497754029 100644 --- a/Simulation/G4Atlas/G4AtlasTools/python/G4GeometryConfig.py +++ b/Simulation/G4Atlas/G4AtlasTools/python/G4GeometryConfig.py @@ -65,7 +65,6 @@ def getCavernInfraGeoDetectorTool(name='CavernInfra', **kwargs): def getIDETEnvelope(name="IDET", **kwargs): from AtlasGeoModel.CommonGMJobProperties import CommonGeometryFlags as commonGeoFlags from AtlasGeoModel.InDetGMJobProperties import InDetGeometryFlags as geoFlags - isUpgrade = commonGeoFlags.Run()=="RUN4" or (commonGeoFlags.Run()=="UNDEFINED" and geoFlags.isSLHC()) isRUN2 = (commonGeoFlags.Run() in ["RUN2", "RUN3"]) or (commonGeoFlags.Run()=="UNDEFINED" and geoFlags.isIBL()) #isRUN1 = not (isRUN2 or isUpgrade) @@ -73,8 +72,6 @@ def getIDETEnvelope(name="IDET", **kwargs): innerRadius = 37.*mm # RUN1 default if isRUN2: innerRadius = 28.9*mm #29.15*mm - if isUpgrade: - innerRadius = 32.15*mm kwargs.setdefault("InnerRadius", innerRadius) kwargs.setdefault("OuterRadius", 1.148*m) kwargs.setdefault("dZ", 347.5*cm) @@ -84,7 +81,7 @@ def getIDETEnvelope(name="IDET", **kwargs): SubDetectorList += ['Pixel'] if DetFlags.geometry.SCT_on(): SubDetectorList += ['SCT'] - if DetFlags.geometry.TRT_on() and not isUpgrade: + if DetFlags.geometry.TRT_on(): SubDetectorList += ['TRT'] SubDetectorList += ['IDetServicesMat'] kwargs.setdefault("SubDetectors", SubDetectorList) diff --git a/Simulation/G4Atlas/G4AtlasTools/python/G4GeometryToolConfig.py b/Simulation/G4Atlas/G4AtlasTools/python/G4GeometryToolConfig.py index f6ccbe12ebd3569d4157cd63a8e32a5a55a8f484..4ec431ec8fd254728c6cbe1c644ca8404d09cc1c 100644 --- a/Simulation/G4Atlas/G4AtlasTools/python/G4GeometryToolConfig.py +++ b/Simulation/G4Atlas/G4AtlasTools/python/G4GeometryToolConfig.py @@ -11,7 +11,7 @@ from G4AtlasTools.G4PhysicsRegionConfigNew import SX1PhysicsRegionToolCfg, Bedro from G4AtlasTools.G4PhysicsRegionConfigNew import DriftWallPhysicsRegionToolCfg, DriftWall1PhysicsRegionToolCfg, DriftWall2PhysicsRegionToolCfg, MuonSystemFastPhysicsRegionToolCfg #the field config tools -from G4AtlasTools.G4FieldConfigNew import ATLASFieldManagerToolCfg, TightMuonsATLASFieldManagerToolCfg, BeamPipeFieldManagerToolCfg, InDetFieldManagerToolCfg, MuonsOnlyInCaloFieldManagerToolCfg, MuonFieldManagerToolCfg, Q1FwdFieldManagerToolCfg, Q2FwdFieldManagerToolCfg, Q3FwdFieldManagerToolCfg, D1FwdFieldManagerToolCfg, D2FwdFieldManagerToolCfg, Q4FwdFieldManagerToolCfg, Q5FwdFieldManagerToolCfg, Q6FwdFieldManagerToolCfg, Q7FwdFieldManagerToolCfg, Q1HKickFwdFieldManagerToolCfg, Q1VKickFwdFieldManagerToolCfg, Q2HKickFwdFieldManagerToolCfg, Q2VKickFwdFieldManagerToolCfg, Q3HKickFwdFieldManagerToolCfg, Q3VKickFwdFieldManagerToolCfg, Q4VKickAFwdFieldManagerToolCfg, Q4HKickFwdFieldManagerToolCfg, Q4VKickBFwdFieldManagerToolCfg, Q5HKickFwdFieldManagerToolCfg, Q6VKickFwdFieldManagerToolCfg, FwdRegionFieldManagerToolCfg +from G4AtlasTools.G4FieldConfigNew import ATLASFieldManagerToolCfg, TightMuonsATLASFieldManagerToolCfg, BeamPipeFieldManagerToolCfg, InDetFieldManagerToolCfg, ITkFieldManagerToolCfg, MuonsOnlyInCaloFieldManagerToolCfg, MuonFieldManagerToolCfg, Q1FwdFieldManagerToolCfg, Q2FwdFieldManagerToolCfg, Q3FwdFieldManagerToolCfg, D1FwdFieldManagerToolCfg, D2FwdFieldManagerToolCfg, Q4FwdFieldManagerToolCfg, Q5FwdFieldManagerToolCfg, Q6FwdFieldManagerToolCfg, Q7FwdFieldManagerToolCfg, Q1HKickFwdFieldManagerToolCfg, Q1VKickFwdFieldManagerToolCfg, Q2HKickFwdFieldManagerToolCfg, Q2VKickFwdFieldManagerToolCfg, Q3HKickFwdFieldManagerToolCfg, Q3VKickFwdFieldManagerToolCfg, Q4VKickAFwdFieldManagerToolCfg, Q4HKickFwdFieldManagerToolCfg, Q4VKickBFwdFieldManagerToolCfg, Q5HKickFwdFieldManagerToolCfg, Q6VKickFwdFieldManagerToolCfg, FwdRegionFieldManagerToolCfg from G4AtlasTools.G4AtlasToolsConfigNew import SensitiveDetectorMasterToolCfg @@ -623,6 +623,10 @@ def ATLAS_FieldMgrListCfg(ConfigFlags): acc = InDetFieldManagerToolCfg(ConfigFlags) tool = result.popToolsAndMerge(acc) fieldMgrList += [tool] + if ConfigFlags.Detector.GeometryITk: + acc = ITkFieldManagerToolCfg(ConfigFlags) + tool = result.popToolsAndMerge(acc) + fieldMgrList += [tool] #if ConfigFlags.Detector.GeometryCalo and simFlags.MuonFieldOnlyInCalo.statusOn and simFlags.MuonFieldOnlyInCalo(): if False: acc = MuonsOnlyInCaloFieldManagerToolCfg(ConfigFlags) diff --git a/Simulation/G4Atlas/G4AtlasTools/python/G4PhysicsRegionConfigNew.py b/Simulation/G4Atlas/G4AtlasTools/python/G4PhysicsRegionConfigNew.py index f795c0f2e9efd4ff7aab83ccf70a025994157509..32ec5769d1f7c46e6a26fa46967151d931310c64 100644 --- a/Simulation/G4Atlas/G4AtlasTools/python/G4PhysicsRegionConfigNew.py +++ b/Simulation/G4Atlas/G4AtlasTools/python/G4PhysicsRegionConfigNew.py @@ -274,7 +274,10 @@ def MuonSystemFastPhysicsRegionToolCfg(ConfigFlags, name='MuonSystemFastPhysicsR kwargs.setdefault("RegionName", 'MuonSystemFastRegion') volumeList = [] if ConfigFlags.Sim.CavernBG == 'World': - volumeList += ['BeamPipe::BeamPipe', 'IDET::IDET'] + if ConfigFlags.GeoModel.Run in ['RUN1', 'RUN2', 'RUN3']: + volumeList += ['BeamPipe::BeamPipe', 'IDET::IDET'] + else: + volumeList += ['BeamPipe::BeamPipe', 'ITK::ITK'] volumeList = ['Muon::MuonSys'] kwargs.setdefault("VolumeList", volumeList) kwargs.setdefault("ElectronCut", 1.0) diff --git a/Simulation/G4Sim/MCTruthBase/python/MCTruthBaseConfigNew.py b/Simulation/G4Sim/MCTruthBase/python/MCTruthBaseConfigNew.py index 59d32a72dcbd2a8cfc4cf061bd794c66ead20622..b06629360c86062fb5a78e14a372de3e8b29e91d 100644 --- a/Simulation/G4Sim/MCTruthBase/python/MCTruthBaseConfigNew.py +++ b/Simulation/G4Sim/MCTruthBase/python/MCTruthBaseConfigNew.py @@ -40,6 +40,8 @@ def getEnvelopeMap(ConfigFlags): if not ConfigFlags.Sim.ISFRun: if ConfigFlags.Detector.GeometryID: envelopeMap['IDET::IDET'] = 'CaloEntryLayer' + if ConfigFlags.Detector.GeometryITk: + envelopeMap['ITK::ITK'] = 'CaloEntryLayer' if ConfigFlags.Detector.GeometryCalo: envelopeMap['CALO::CALO'] = 'MuonEntryLayer' if ConfigFlags.Detector.GeometryMuon: #was geometry in old style, should it be? diff --git a/Simulation/G4Utilities/G4DebuggingTools/src/helper/G4DebuggingHelper.cxx b/Simulation/G4Utilities/G4DebuggingTools/src/helper/G4DebuggingHelper.cxx index 60c9cd2bc17570ab5df28956573335a0f4da01aa..fbdf6a98d150487acecf106028644c22d288b998 100644 --- a/Simulation/G4Utilities/G4DebuggingTools/src/helper/G4DebuggingHelper.cxx +++ b/Simulation/G4Utilities/G4DebuggingTools/src/helper/G4DebuggingHelper.cxx @@ -101,6 +101,12 @@ namespace G4DebuggingHelpers { || nom.contains("station") ) { return "Muon"; } + else if ( nom.length() >= 8 && nom.substr(0, 8) == "ITkPixel" ) { + return "ITkPixel"; + } + else if ( nom.length() >= 8 && nom.substr(0, 8) == "ITkStrip" ) { + return "ITkStrip"; + } else if ( ( nom.length() >= 5 && nom.substr(0, 5) == "Pixel" ) || nom == "Outside Barrel Service") { return "Pixel"; @@ -119,9 +125,11 @@ namespace G4DebuggingHelpers { return "Section"; else if ( ( nom.length() >= 12 && nom.substr(0, 12) == "InDetServMat" ) || ( nom.length() >= 4 && nom.substr(0, 4) == "IDET" ) + || ( nom.length() >= 3 && nom.substr(0, 3) == "ITK" ) || ( nom.length() >= 8 && nom.substr(0, 8) == "BeamPipe" ) || ( nom.length() >= 3 && - ( nom.substr(0, 3) == "BLM" || nom.substr(0, 3) == "BCM" ) ) ) { + ( nom.substr(0, 3) == "BLM" || nom.substr(0, 3) == "BCM" || nom.substr(0, 3) == "PLR" ) ) + || ( nom.length() >= 8 && nom.substr(0, 8) == "BCMPrime") ) { return "Service"; } return "other"; diff --git a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimer.cxx b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimer.cxx index 2879b8e28161ab9946c8cd56748b2aa10b4b90bc..56978d37d49ce2851ed2ebca08073b4ba62c0fd6 100644 --- a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimer.cxx +++ b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimer.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ ////////////////////////////////////////////////////////////////// @@ -60,6 +60,8 @@ namespace G4UA m_report.timeName[eCry] = "Cry"; m_report.timeName[eLAr] = "LAr"; m_report.timeName[eHCB] = "HCB"; + m_report.timeName[eITkPix] = "ITkPixel"; + m_report.timeName[eITkStrip] = "ITkStrip"; m_report.timeName[ePre] = "Pre"; m_report.timeName[eMu] = "Mu"; m_report.timeName[ePx] = "Px"; @@ -304,6 +306,14 @@ namespace G4UA nom.contains("station") ){ return eMu; } + else if ( nom.length() >= 8 && + nom(0,8) == "ITkPixel" ){ + return eITkPix; + } + else if ( nom.length() >= 8 && + nom(0,8) == "ITkStrip" ){ + return eITkStrip; + } else if ((nom.length() >= 5 && nom(0,5) == "Pixel") || nom == "Outside Barrel Service"){ @@ -326,13 +336,18 @@ namespace G4UA nom(0,12) == "InDetServMat" ) || ( nom.length() >= 4 && nom(0,4) == "IDET" ) || + ( nom.length() >= 3 && + nom(0,3) == "ITK" ) || ( nom.length() >= 8 && nom(0,8) == "BeamPipe" ) || ( nom.length() >= 7 && nom(0,7) == "Section" ) || ( nom.length() >= 3 && ( nom(0,3) == "BLM" || - nom(0,3) == "BCM" ) ) ){ + nom(0,3) == "BCM" || + nom(0,3) == "PLR" ) ) || + ( nom.length() >= 8 && + nom(0,8) == "BCMPrime" ) ){ return eSev; } return eOther; diff --git a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimer.h b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimer.h index 750afde193d58f5fb7b73d176f6f5d0f7d6b6c08..21b2d3abbff35d307f2655957cf58cfd35377553 100644 --- a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimer.h +++ b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimer.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ ////////////////////////////////////////////////////////////////// @@ -92,7 +92,7 @@ namespace G4UA First timers are by subdetector, second few are by particle These are not straightforward for the non-expert to interpret*/ enum { eEMB, eEMEC, eFC1, eFC23, eFCO, eHEC, eCry, eLAr, eHCB, - ePre, eMu, ePx, eSct, eSev, eTrt, eOther, + ePre, eMu, ePx, eSct, eITkPix, eITkStrip, eSev, eTrt, eOther, eElec, ePos, eGam, eNeut, eMax }; private: diff --git a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimerTool.cxx b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimerTool.cxx index 221106200076aa1cd1ffbc90677286f57668dd3c..22e827354f8407005b06f696a957f3ee90379722 100644 --- a/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimerTool.cxx +++ b/Simulation/G4Utilities/G4ProfilingTools/src/TestActionTimerTool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "TestActionTimerTool.h" @@ -71,7 +71,7 @@ namespace G4UA ATH_MSG_INFO("FCAL\t" << (report.time[TestActionTimer::eFC1]+report.time[TestActionTimer::eFC23]+report.time[TestActionTimer::eFCO])/report.nev); ATH_MSG_INFO("HEC\t" << (report.time[TestActionTimer::eHEC])/report.nev); ATH_MSG_INFO("Tile\t" << (report.time[TestActionTimer::eHCB])/report.nev); - ATH_MSG_INFO("Tracker\t" << (report.time[TestActionTimer::ePx]+report.time[TestActionTimer::eSct]+report.time[TestActionTimer::eTrt]+report.time[TestActionTimer::eSev])/report.nev); + ATH_MSG_INFO("Tracker\t" << (report.time[TestActionTimer::ePx]+report.time[TestActionTimer::eSct]+report.time[TestActionTimer::eITkPix]+report.time[TestActionTimer::eITkStrip]+report.time[TestActionTimer::eTrt]+report.time[TestActionTimer::eSev])/report.nev); ATH_MSG_INFO("Muons\t" << (report.time[TestActionTimer::eMu])/report.nev); ATH_MSG_INFO("Oth.LAr\t" << (report.time[TestActionTimer::ePre]+report.time[TestActionTimer::TestActionTimer::eCry]+report.time[TestActionTimer::eLAr])/report.nev); ATH_MSG_INFO("Other\t" << (report.time[TestActionTimer::eOther])/report.nev); @@ -82,7 +82,7 @@ namespace G4UA ATH_MSG_INFO("FCAL\t" << (report.time[TestActionTimer::eFC1]+report.time[TestActionTimer::eFC23]+report.time[TestActionTimer::eFCO])/report.runTime*100.); ATH_MSG_INFO("HEC\t" << (report.time[TestActionTimer::eHEC])/report.runTime*100.); ATH_MSG_INFO("Tile\t" << (report.time[TestActionTimer::eHCB])/report.runTime*100.); - ATH_MSG_INFO("Tracker\t" << (report.time[TestActionTimer::ePx]+report.time[TestActionTimer::eSct]+report.time[TestActionTimer::eTrt]+report.time[TestActionTimer::eSev])/report.runTime*100.); + ATH_MSG_INFO("Tracker\t" << (report.time[TestActionTimer::ePx]+report.time[TestActionTimer::eSct]+report.time[TestActionTimer::eITkPix]+report.time[TestActionTimer::eITkStrip]+report.time[TestActionTimer::eTrt]+report.time[TestActionTimer::eSev])/report.runTime*100.); ATH_MSG_INFO("Muons\t" << (report.time[TestActionTimer::eMu])/report.runTime*100.); ATH_MSG_INFO("Oth.LAr\t" << (report.time[TestActionTimer::ePre]+report.time[TestActionTimer::eCry]+report.time[TestActionTimer::eLAr])/report.runTime*100.); ATH_MSG_INFO("Other\t" << (report.time[TestActionTimer::eOther])/report.runTime*100.); diff --git a/Simulation/G4Utilities/G4ProfilingTools/src/VolumeTreeNavigator.cxx b/Simulation/G4Utilities/G4ProfilingTools/src/VolumeTreeNavigator.cxx index 2c3f60ce3d7366cdbb24934cc36e9393adcb024d..7414237b90850d62ca8e298ab2153364ced38408 100644 --- a/Simulation/G4Utilities/G4ProfilingTools/src/VolumeTreeNavigator.cxx +++ b/Simulation/G4Utilities/G4ProfilingTools/src/VolumeTreeNavigator.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ ////////////////////////////////////////////////////////////////// @@ -74,7 +74,7 @@ void VolumeTreeNavigator::SetDepthCutSimple(const int CALO, const int BeamPipe, string name = stringify(m_history[1].first->GetName()); if (name == "CALO::CALO") cut = CALO+1; else if (name == "BeamPipe::BeamPipe") cut = BeamPipe+1; - else if (name == "IDET::IDET") cut = IDET+1; + else if (name == "IDET::IDET" || name == "ITK::ITK") cut = IDET+1; else if (name == "MUONQ02::MUONQ02") cut = MUONQ02+1; else { log<< MSG::INFO <<"Level 1 volume not found, output default depth"<< endmsg; } } diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4CommonTools/python/ISF_Geant4CommonToolsConfigNew.py b/Simulation/ISF/ISF_Geant4/ISF_Geant4CommonTools/python/ISF_Geant4CommonToolsConfigNew.py index 2b0f8fb50f314f2bfcd4291f7ef5c8e72aa2bf00..930cf06cec80b3d35db1e72cbbfaf54c0f23f68f 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4CommonTools/python/ISF_Geant4CommonToolsConfigNew.py +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4CommonTools/python/ISF_Geant4CommonToolsConfigNew.py @@ -1,6 +1,6 @@ """ComponentAccumulator Geant4 tools config for ISF -Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration """ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory @@ -17,6 +17,11 @@ def EntryLayerToolCfg(flags, name="ISF_EntryLayerTool", **kwargs): filt = acc.popToolsAndMerge(EntryLayerFilterCfg(flags)) kwargs.setdefault("ParticleFilters", [filt]) + if flags.GeoModel.Run in ['RUN1', 'RUN2', 'RUN3']: + kwargs.setdefault("CaloEntryVolumeString", "IDET::IDET") + else: + kwargs.setdefault("CaloEntryVolumeString", "ITK::ITK") + if flags.Sim.DoFullChain: OEsvc = CompFactory.StoreGateSvc("OriginalEvent_SG") acc.addService(OEsvc) @@ -35,6 +40,11 @@ def EntryLayerToolMTCfg(flags, name="ISF_EntryLayerToolMT", **kwargs): filt = acc.popToolsAndMerge(EntryLayerFilterCfg(flags)) kwargs.setdefault("ParticleFilters", [filt]) + if flags.GeoModel.Run in ['RUN1', 'RUN2', 'RUN3']: + kwargs.setdefault("CaloEntryVolumeString", "IDET::IDET") + else: + kwargs.setdefault("CaloEntryVolumeString", "ITK::ITK") + if flags.Sim.DoFullChain: OEsvc = CompFactory.StoreGateSvc("OriginalEvent_SG") acc.addService(OEsvc) @@ -53,6 +63,11 @@ def AFIIEntryLayerToolCfg(flags, name="ISF_AFIIEntryLayerTool", **kwargs): filt = acc.popToolsAndMerge(EntryLayerFilterCfg(flags)) kwargs.setdefault("ParticleFilters", [filt]) + if flags.GeoModel.Run in ['RUN1', 'RUN2', 'RUN3']: + kwargs.setdefault("CaloEntryVolumeString", "IDET::IDET") + else: + kwargs.setdefault("CaloEntryVolumeString", "ITK::ITK") + if flags.Sim.DoFullChain: OEsvc = CompFactory.StoreGateSvc("OriginalEvent_SG") acc.addService(OEsvc) @@ -71,6 +86,11 @@ def AFIIEntryLayerToolMTCfg(flags, name="ISF_AFIIEntryLayerToolMT", **kwargs): filt = acc.popToolsAndMerge(EntryLayerFilterCfg(flags)) kwargs.setdefault("ParticleFilters", [filt]) + if flags.GeoModel.Run in ['RUN1', 'RUN2', 'RUN3']: + kwargs.setdefault("CaloEntryVolumeString", "IDET::IDET") + else: + kwargs.setdefault("CaloEntryVolumeString", "ITK::ITK") + if flags.Sim.DoFullChain: OEsvc = CompFactory.StoreGateSvc("OriginalEvent_SG") acc.addService(OEsvc) diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/src/ISFG4GeoHelper.cxx b/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/src/ISFG4GeoHelper.cxx index 4763d95f710f7faa2fa1790959cb4a1c851c24ce..b1cf73fee5f32e2e9e14e52556eb47d112655104 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/src/ISFG4GeoHelper.cxx +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Event/src/ISFG4GeoHelper.cxx @@ -31,7 +31,7 @@ iGeant4::ISFG4GeoHelper::nextGeoId(const G4Step* aStep, int truthVolLevel, ISF:: if ( !(*lvs)[i] ) { continue; } if ( (*lvs)[i]->GetName() == "BeamPipe::BeamPipe" ) { BPholder = (*lvs)[i]; } - else if ( (*lvs)[i]->GetName() == "IDET::IDET" ) { IDholder = (*lvs)[i]; } + else if ( (*lvs)[i]->GetName() == "IDET::IDET" || (*lvs)[i]->GetName() == "ITK::ITK" ) { IDholder = (*lvs)[i]; } else if ( (*lvs)[i]->GetName() == "CALO::CALO" ) { CALOholder = (*lvs)[i]; } else if ( (*lvs)[i]->GetName() == "MUONQ02::MUONQ02" ) { MUholder = (*lvs)[i]; } else if ( (*lvs)[i]->GetName() == "TTR_BARREL::TTR_BARREL" ) {TTRholder = (*lvs)[i]; } @@ -116,6 +116,7 @@ bool iGeant4::ISFG4GeoHelper::checkVolumeDepth(G4LogicalVolume* lv, int volLevel if ( lv->GetName() == "BeamPipe::BeamPipe" || lv->GetName() == "IDET::IDET" || + lv->GetName() == "ITK::ITK" || lv->GetName() == "CALO::CALO" || lv->GetName() == "MUONQ02::MUONQ02" || lv->GetName() == "TTR_BARREL::TTR_BARREL" ) { diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Services/python/ISF_Geant4ServicesConfigNew.py b/Simulation/ISF/ISF_Geant4/ISF_Geant4Services/python/ISF_Geant4ServicesConfigNew.py index 4aa7376992c2157e172be7f53edb85b5116d049b..8d7a985c2d334e346ba0e08b05058cbf6989ac81 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Services/python/ISF_Geant4ServicesConfigNew.py +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Services/python/ISF_Geant4ServicesConfigNew.py @@ -1,6 +1,6 @@ """Geant4 services config for ISF with ComponentAccumulator -Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration +Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration """ from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator from AthenaConfiguration.ComponentFactory import CompFactory @@ -15,7 +15,7 @@ def Geant4SimCfg(flags, name="ISFG4SimSvc", **kwargs): G4_DDDBEnvelopeDefSvc = CompFactory.DetDescrDBEnvelopeSvc("G4EnvelopeDefSvc") G4_DDDBEnvelopeDefSvc.DBBeamPipeNode = "BPipeEnvelopeG4" - G4_DDDBEnvelopeDefSvc.DBInDetNode = "InDetEnvelopeG4" + G4_DDDBEnvelopeDefSvc.DBInDetNode = "InDetEnvelopeG4" if flags.GeoModel.Run in ['RUN1', 'RUN2', 'RUN3'] else "ITkEnvelopeG4" G4_DDDBEnvelopeDefSvc.DBCaloNode = "CaloEnvelopeG4" G4_DDDBEnvelopeDefSvc.DBMSNode = "MuonEnvelopeG4" G4_DDDBEnvelopeDefSvc.DBCavernNode = "CavernEnvelopeG4" diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4.cxx b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4.cxx index 145e6d775531f5f1e4d0db7bcd8e1c309a85d09e..31e69527687e1d69362b4d2a2cbcc7edff31f975 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4.cxx +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ // class header @@ -73,7 +73,7 @@ namespace G4UA{ m_entryLayerMap["CALO::CALO"] = m_config.truthVolLevel+1; m_entryLayerMap["MUONQ02::MUONQ02"] = m_config.truthVolLevel+1; - m_entryLayerMap["IDET::IDET"] = m_config.truthVolLevel+1; + m_entryLayerMap[m_config.isITkGeometry ? "ITK::ITK" : "IDET::IDET"] = m_config.truthVolLevel+1; } @@ -207,7 +207,8 @@ namespace G4UA{ ISF::EntryLayer layer=ISF::fUnsetEntryLayer; if (pass) { - if (vname1=="IDET::IDET") layer=ISF::fAtlasCaloEntry; + if (!m_config.isITkGeometry && vname1=="IDET::IDET") layer=ISF::fAtlasCaloEntry; + else if ( m_config.isITkGeometry && vname1=="ITK::ITK") layer=ISF::fAtlasCaloEntry; else if (vname1=="CALO::CALO") layer=ISF::fAtlasMuonEntry; else if (vname1=="MUONQ02::MUONQ02") layer=ISF::fAtlasMuonExit; } diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4.h b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4.h index 91088c41fefd4ae46e86e9931c8184919a08dabe..0848f2c9d5e220959c67e2d7d7a42fac59657815 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4.h +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ @@ -38,15 +38,15 @@ namespace G4UA{ Config() = delete; Config(const std::string& name): entryLayerTool(""), - geoIDSvc("",name), - truthVolLevel(1) + geoIDSvc("",name) {} /** access to the ISF Entry Layer tool which is used to record entry-layer collections */ ToolHandle<ISF::IEntryLayerTool> entryLayerTool; /** access to the central ISF GeoID service*/ ServiceHandle<ISF::IGeoIDSvc> geoIDSvc; - int truthVolLevel; + int truthVolLevel{1}; unsigned int verboseLevel=0; + bool isITkGeometry{}; }; TrackProcessorUserActionFullG4(const Config& config); diff --git a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4Tool.cxx b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4Tool.cxx index 768cc48873ed951355dedeb070be037144858c56..f339ba775bdf541d34661d582dd249c3eca3d99f 100644 --- a/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4Tool.cxx +++ b/Simulation/ISF/ISF_Geant4/ISF_Geant4Tools/src/TrackProcessorUserActionFullG4Tool.cxx @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration */ #include "TrackProcessorUserActionFullG4Tool.h" @@ -20,6 +20,7 @@ namespace G4UA declareProperty("EntryLayerTool", m_config.entryLayerTool, "ISF Entry Layer Tool"); declareProperty("GeoIDSvc", m_config.geoIDSvc, "ISF GeoIDService" ); declareProperty("TruthVolumeLevel", m_config.truthVolLevel, "Level in geo hierarchy for the truth volumes"); + declareProperty("IsITkGeometry", m_config.isITkGeometry, "toggle for ITk"); } std::unique_ptr<TrackProcessorUserActionFullG4>