Commit 75e4d95c authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'digi/presampling' into 'master'

Add PileUpPresampling ProductionStep

See merge request !44522
parents 2f899ea6 bfa09ad3
......@@ -6,4 +6,5 @@ class ProductionStep(Enum):
# steps should be added when needed
Default = 'Default'
Simulation = 'Simulation'
PileUpPresampling = 'PileUpPresampling'
Overlay = 'Overlay'
......@@ -2,8 +2,10 @@
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator, ConfigurationError
from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaConfiguration.Enums import ProductionStep
from AthenaCommon.Logging import logging
def OutputStreamCfg(configFlags, streamName, ItemList=[], MetadataItemList=[],
disableEventTag=False, trigNavThinningSvc=None):
MakeEventStreamInfo=CompFactory.MakeEventStreamInfo
......@@ -12,7 +14,7 @@ def OutputStreamCfg(configFlags, streamName, ItemList=[], MetadataItemList=[],
StoreGateSvc=CompFactory.StoreGateSvc
eventInfoKey = "EventInfo"
if configFlags.Digitization.PileUpPresampling:
if configFlags.Common.ProductionStep == ProductionStep.PileUpPresampling:
eventInfoKey = configFlags.Overlay.BkgPrefix + "EventInfo"
msg = logging.getLogger("OutputStreamCfg")
......
......@@ -39,7 +39,7 @@ def BCM_DigitizationToolCommonCfg(flags, name="BCM_DigitizationTool", **kwargs):
acc = RNG(flags.Random.Engine)
kwargs.setdefault("RndmSvc", "AthRNGSvc")
kwargs.setdefault("HitCollName", "BCMHits")
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("OutputRDOKey", flags.Overlay.BkgPrefix + "BCM_RDOs")
kwargs.setdefault("OutputSDOKey", flags.Overlay.BkgPrefix + "BCM_SDO_Map")
elif flags.Common.ProductionStep == ProductionStep.Overlay:
......
......@@ -4,6 +4,7 @@ Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
"""
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaConfiguration.Enums import ProductionStep
from Digitization.PileUpMergeSvcConfigNew import PileUpMergeSvcCfg, PileUpXingFolderCfg
from Digitization.PileUpToolsConfig import PileUpToolsCfg
from Digitization.TruthDigitizationOutputConfig import TruthDigitizationOutputCfg
......@@ -143,7 +144,7 @@ def ITkPixelDigitizationToolCfg(flags, name="ITkPixelDigitizationTool", **kwargs
rangetool = acc.popToolsAndMerge(ITkPixelRangeCfg(flags))
acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
kwargs.setdefault("HardScatterSplittingMode", 0)
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("RDOCollName", flags.Overlay.BkgPrefix + "ITkPixelRDOs")
kwargs.setdefault("SDOCollName", flags.Overlay.BkgPrefix + "ITkPixelSDO_Map")
else:
......
......@@ -4,6 +4,7 @@ Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
"""
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaConfiguration.Enums import ProductionStep
from Digitization.PileUpMergeSvcConfigNew import PileUpMergeSvcCfg, PileUpXingFolderCfg
from Digitization.PileUpToolsConfig import PileUpToolsCfg
from Digitization.TruthDigitizationOutputConfig import TruthDigitizationOutputCfg
......@@ -191,7 +192,7 @@ def PixelDigitizationToolCfg(flags, name="PixelDigitizationTool", **kwargs):
rangetool = acc.popToolsAndMerge(PixelRangeCfg(flags))
acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
kwargs.setdefault("HardScatterSplittingMode", 0)
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("RDOCollName", flags.Overlay.BkgPrefix + "PixelRDOs")
kwargs.setdefault("SDOCollName", flags.Overlay.BkgPrefix + "PixelSDO_Map")
else:
......
......@@ -59,7 +59,7 @@ def SCT_DigitizationToolCfg(flags, name="SCT_DigitizationTool", **kwargs):
acc = ComponentAccumulator()
rangetool = acc.popToolsAndMerge(SCT_RangeCfg(flags))
acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("OutputObjectName", flags.Overlay.BkgPrefix + "SCT_RDOs")
kwargs.setdefault("OutputSDOName", flags.Overlay.BkgPrefix + "SCT_SDO_Map")
else:
......@@ -208,7 +208,7 @@ def SCT_FrontEndCfg(flags, name="SCT_FrontEnd", **kwargs):
acc = SCT_ReadCalibChipDataCfg(flags)
kwargs.setdefault("SCT_ReadCalibChipDataTool", acc.popPrivateTools())
# DataCompressionMode: 1 is level mode X1X (default), 2 is edge mode 01X, 3 is any hit mode (1XX|X1X|XX1)
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("DataCompressionMode", 3)
elif flags.Common.ProductionStep == ProductionStep.Overlay and flags.Input.isMC:
kwargs.setdefault("DataCompressionMode", 2)
......
......@@ -61,7 +61,7 @@ def ITkStripDigitizationToolCfg(flags, name="ITkStripDigitizationTool", **kwargs
acc = ComponentAccumulator()
rangetool = acc.popToolsAndMerge(ITkStripRangeCfg(flags))
acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("OutputObjectName", flags.Overlay.BkgPrefix + "ITkStripRDOs")
kwargs.setdefault("OutputSDOName", flags.Overlay.BkgPrefix + "ITkStripSDO_Map")
else:
......@@ -217,7 +217,7 @@ def ITkStripFrontEndCfg(flags, name="ITkStripFrontEnd", **kwargs):
acc = ComponentAccumulator()
# DataCompressionMode: 1 is level mode X1X (default), 2 is edge mode 01X, 3 is any hit mode (1XX|X1X|XX1)
#if flags.Digitization.PileUpPresampling:
#if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
# kwargs.setdefault("DataCompressionMode", 3)
#elif flags.Common.ProductionStep == ProductionStep.Overlay and flags.Input.isMC:
# kwargs.setdefault("DataCompressionMode", 2)
......
......@@ -77,7 +77,7 @@ def TRT_DigitizationToolCfg(flags, name="TRTDigitizationTool", **kwargs):
acc = ComponentAccumulator()
rangetool = acc.popToolsAndMerge(TRT_RangeCfg(flags))
acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("OutputObjectName", flags.Overlay.BkgPrefix + "TRT_RDOs")
kwargs.setdefault("OutputSDOName", flags.Overlay.BkgPrefix + "TRT_SDO_Map")
else:
......
......@@ -108,7 +108,7 @@ def LArPileUpToolCfg(flags, name="LArPileUpTool", **kwargs):
if (not flags.Digitization.HighGainEMECIW) and (flags.Common.ProductionStep != ProductionStep.Overlay):
kwargs.setdefault("HighGainThreshEMECIW", 0)
kwargs.setdefault("RndmEvtOverlay", flags.Common.ProductionStep == ProductionStep.Overlay)
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("DigitContainer", flags.Overlay.BkgPrefix + "LArDigitContainer_MC")
else:
kwargs.setdefault("DigitContainer", "LArDigitContainer_MC") # FIXME - should not be hard-coded
......@@ -153,11 +153,11 @@ def LArOutputCfg(flags):
ItemList = []
if flags.Digitization.AddCaloDigi:
ItemList.append("LArDigitContainer#*")
elif flags.Digitization.PileUpPresampling:
elif flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
ItemList.append("LArDigitContainer#" + flags.Overlay.BkgPrefix + "LArDigitContainer_MC")
elif flags.Digitization.AddCaloDigiThinned:
ItemList.append("LArDigitContainer#LArDigitContainer_MC_Thinned")
if not flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep != ProductionStep.PileUpPresampling:
ItemList.append("LArRawChannelContainer#LArRawChannels")
if flags.Digitization.TruthOutput:
ItemList.append("CaloCalibrationHitContainer#*")
......@@ -223,7 +223,7 @@ def LArTriggerDigitizationBasicCfg(flags, **kwargs):
kwargs.setdefault("NoiseOnOff", flags.Digitization.DoCaloNoise)
kwargs.setdefault("PileUp", flags.Digitization.PileUp)
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("EmTTL1ContainerName", flags.Overlay.BkgPrefix + "LArTTL1EM")
kwargs.setdefault("HadTTL1ContainerName", flags.Overlay.BkgPrefix + "LArTTL1HAD")
LArTTL1Maker = CompFactory.LArTTL1Maker
......
# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaConfiguration.Enums import ProductionStep
LArRawChannelBuilderAlg=CompFactory.LArRawChannelBuilderAlg
from LArRecUtils.LArADC2MeVCondAlgConfig import LArADC2MeVCondAlgCfg
from LArConfiguration.LArElecCalibDBConfig import LArElecCalibDbCfg
......@@ -29,7 +30,7 @@ def LArRawChannelBuilderAlgCfg(configFlags, **kwargs):
dbInstance="LAR_OFL"
acc.merge(addFolders(configFlags,fld, dbInstance, className=obj, db=dbString))
if configFlags.Digitization.PileUpPresampling:
if configFlags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("LArDigitKey", configFlags.Overlay.BkgPrefix + "LArDigitContainer_MC")
else:
kwargs.setdefault("LArDigitKey", "LArDigitContainer_MC")
......
......@@ -4,6 +4,7 @@ Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
"""
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaConfiguration.Enums import ProductionStep
from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
from MuonConfig.MuonCondAlgConfig import CscCondDbAlgCfg
......@@ -63,7 +64,7 @@ def CSC_DigitizationToolCfg(flags, name="CscDigitizationTool", **kwargs):
acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
kwargs.setdefault("InputObjectName", "CSC_Hits")
kwargs.setdefault("OutputObjectName", "CSC_DIGITS")
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("CSCSimDataCollectionOutputName", flags.Overlay.BkgPrefix + "CSC_SDO")
else:
kwargs.setdefault("CSCSimDataCollectionOutputName", "CSC_SDO")
......
......@@ -4,6 +4,7 @@ Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
"""
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaConfiguration.Enums import ProductionStep
from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
from MuonConfig.MuonByteStreamCnvTestConfig import MdtDigitToMdtRDOCfg
......@@ -83,7 +84,7 @@ def MDT_DigitizationToolCfg(flags, name="MdtDigitizationTool", **kwargs):
rangetool = acc.popToolsAndMerge(MDT_RangeCfg(flags))
acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
kwargs.setdefault("OutputObjectName", "MDT_DIGITS")
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("OutputSDOName", flags.Overlay.BkgPrefix + "MDT_SDO")
else:
kwargs.setdefault("OutputSDOName", "MDT_SDO")
......
......@@ -81,7 +81,7 @@ def MM_RdoToDigitCfg(flags, name="MM_RdoToDigitAlg", **kwargs):
def MdtDigitToMdtRDOCfg(flags, name="MdtDigitToMdtRDO", **kwargs):
"""Return ComponentAccumulator with configured MdtDigitToMdtRDO algorithm"""
acc = ComponentAccumulator()
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("OutputObjectName", flags.Overlay.BkgPrefix + "MDTCSM")
else:
kwargs.setdefault("OutputObjectName", "MDTCSM")
......@@ -93,7 +93,7 @@ def MdtDigitToMdtRDOCfg(flags, name="MdtDigitToMdtRDO", **kwargs):
def RpcDigitToRpcRDOCfg(flags, name="RpcDigitToRpcRDO", **kwargs):
"""Return ComponentAccumulator with configured RpcDigitToRpcRDO algorithm"""
acc = ComponentAccumulator()
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("OutputObjectName", flags.Overlay.BkgPrefix + "RPCPAD")
else:
kwargs.setdefault("OutputObjectName", "RPCPAD")
......@@ -105,7 +105,7 @@ def RpcDigitToRpcRDOCfg(flags, name="RpcDigitToRpcRDO", **kwargs):
def TgcDigitToTgcRDOCfg(flags, name="TgcDigitToTgcRDO", **kwargs):
"""Return ComponentAccumulator with configured TgcDigitToTgcRDO algorithm"""
acc = ComponentAccumulator()
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("OutputObjectName", flags.Overlay.BkgPrefix + "TGCRDO")
else:
kwargs.setdefault("OutputObjectName", "TGCRDO")
......@@ -129,7 +129,7 @@ def CscDigitToCscRDOCfg(flags, name="CscDigitToCscRDO", **kwargs):
if flags.Common.ProductionStep == ProductionStep.Overlay:
kwargs.setdefault("InputObjectName", flags.Overlay.SigPrefix + "CSC_DIGITS")
kwargs.setdefault("OutputObjectName", flags.Overlay.SigPrefix + "CSCRDO")
elif flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("OutputObjectName", flags.Overlay.BkgPrefix + "CSCRDO")
else:
kwargs.setdefault("OutputObjectName", "CSCRDO")
......@@ -148,7 +148,7 @@ def CscDigitToCscRDOCfg(flags, name="CscDigitToCscRDO", **kwargs):
def STGC_DigitToRDOCfg(flags, name="STGC_DigitToRDO", **kwargs):
"""Return ComponentAccumulator with configured STGC_DigitToRDO algorithm"""
acc = ComponentAccumulator()
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("OutputObjectName", flags.Overlay.BkgPrefix + "sTGCRDO")
else:
kwargs.setdefault("OutputObjectName", "sTGCRDO")
......@@ -160,7 +160,7 @@ def STGC_DigitToRDOCfg(flags, name="STGC_DigitToRDO", **kwargs):
def MM_DigitToRDOCfg(flags, name="MM_DigitToRDO", **kwargs):
"""Return ComponentAccumulator with configured MM_DigitToRDO algorithm"""
acc = ComponentAccumulator()
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("OutputObjectName", flags.Overlay.BkgPrefix + "MMRDO")
else:
kwargs.setdefault("OutputObjectName", "MMRDO")
......
......@@ -4,6 +4,7 @@ Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
"""
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaConfiguration.Enums import ProductionStep
from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
from MuonConfig.MuonByteStreamCnvTestConfig import RpcDigitToRpcRDOCfg
......@@ -40,7 +41,7 @@ def RPC_DigitizationToolCommonCfg(flags, name="RpcDigitizationTool", **kwargs):
kwargs.setdefault("FirstXing", RPC_FirstXing())
kwargs.setdefault("LastXing", RPC_LastXing())
kwargs.setdefault("OutputObjectName", "RPC_DIGITS")
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("OutputSDOName", flags.Overlay.BkgPrefix + "RPC_SDO")
else:
kwargs.setdefault("OutputSDOName", "RPC_SDO")
......@@ -88,7 +89,7 @@ def RPC_DigitizationToolCfg(flags, name="RpcDigitizationTool", **kwargs):
rangetool = acc.popToolsAndMerge(RPC_RangeCfg(flags))
acc.merge(PileUpMergeSvcCfg(flags, Intervals=rangetool))
kwargs.setdefault("OutputObjectName", "RPC_DIGITS")
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("OutputSDOName", flags.Overlay.BkgPrefix + "RPC_SDO")
else:
kwargs.setdefault("OutputSDOName", "RPC_SDO")
......
......@@ -4,6 +4,7 @@ Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
"""
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaConfiguration.Enums import ProductionStep
from OutputStreamAthenaPool.OutputStreamConfig import OutputStreamCfg
from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
from MuonConfig.MuonByteStreamCnvTestConfig import TgcDigitToTgcRDOCfg
......@@ -41,7 +42,7 @@ def TGC_DigitizationToolCfg(flags, name="TgcDigitizationTool", **kwargs):
kwargs.setdefault("FirstXing", TGC_FirstXing())
kwargs.setdefault("LastXing", TGC_LastXing())
kwargs.setdefault("OutputObjectName", "TGC_DIGITS")
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("OutputSDOName", flags.Overlay.BkgPrefix + "TGC_SDO")
else:
kwargs.setdefault("OutputSDOName", "TGC_SDO")
......
......@@ -5,6 +5,7 @@
"""Define methods to configure beam effects with the ComponentAccumulator"""
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaConfiguration.Enums import ProductionStep
# Compiled beam effects methods
# for documentation of method X, see Simulation__X._propertyDocDct
Simulation__GenEventValidityChecker=CompFactory.Simulation.GenEventValidityChecker
......@@ -139,7 +140,7 @@ def BeamSpotFixerAlgCfg(ConfigFlags, **kwargs):
kwargs.setdefault('InputKey', 'Input_EventInfo')
if ConfigFlags.Digitization.PileUpPresampling:
if ConfigFlags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault('OutputKey', ConfigFlags.Overlay.BkgPrefix + 'EventInfo')
else:
kwargs.setdefault('OutputKey', 'EventInfo')
......
......@@ -4,6 +4,7 @@ Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
"""
from AthenaConfiguration.AthConfigFlags import AthConfigFlags
from AthenaConfiguration.AutoConfigFlags import GetFileMD
from AthenaConfiguration.Enums import ProductionStep
from AthenaCommon.Logging import log
from PyUtils import AthFile
......@@ -72,8 +73,6 @@ def createDigitizationCfgFlags():
flags.addFlag("Digitization.DoInnerDetectorNoise", True)
# Run pile-up digitization on one bunch crossing at a time?
flags.addFlag("Digitization.DoXingByXingPileUp", False)
# Run pile-up presampling
flags.addFlag("Digitization.PileUpPresampling", False)
# Special configuration read from flags.Input.Files
flags.addFlag("Digitization.SpecialConfiguration", getSpecialConfiguration)
# Run Calorimeter noise simulation
......@@ -116,7 +115,7 @@ def createDigitizationCfgFlags():
flags.addFlag("Digitization.PU.ProfileConfig", "")
# Force sequential event numbers
flags.addFlag("Digitization.PU.ForceSequentialEventNumbers",
lambda prevFlags: prevFlags.Digitization.PileUpPresampling)
lambda prevFlags: prevFlags.Common.ProductionStep == ProductionStep.PileUpPresampling)
# Beam Halo input collections
flags.addFlag("Digitization.PU.BeamHaloInputCols", [])
# LHC Bunch Structure (list of non-negative floats)
......@@ -174,7 +173,7 @@ def digitizationRunArgsToFlags(runArgs, flags):
flags.Digitization.JobNumber = runArgs.jobNumber
if hasattr(runArgs, "PileUpPresampling"):
flags.Digitization.PileUpPresampling = runArgs.PileUpPresampling
flags.Common.ProductionStep = ProductionStep.PileUpPresampling
if hasattr(runArgs, "doAllNoise"):
flags.Digitization.DoInnerDetectorNoise = runArgs.doAllNoise
......
......@@ -6,6 +6,7 @@ Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaConfiguration.Enums import ProductionStep
from AthenaConfiguration.MainServicesConfig import MainServicesCfg
from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
from AthenaPoolCnvSvc.PoolWriteConfig import PoolWriteCfg
......@@ -90,7 +91,7 @@ def DigitizationMainCfg(flags):
acc.merge(TruthDigitizationOutputCfg(flags))
# Beam spot reweighting
if not flags.Digitization.PileUpPresampling and flags.Digitization.InputBeamSigmaZ > 0:
if flags.Common.ProductionStep != ProductionStep.PileUpPresampling and flags.Digitization.InputBeamSigmaZ > 0:
from BeamEffects.BeamEffectsAlgConfig import BeamSpotReweightingAlgCfg
acc.merge(BeamSpotReweightingAlgCfg(flags))
......
......@@ -4,6 +4,7 @@ Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
"""
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaConfiguration.Enums import ProductionStep
PileUpToolsAlg, DigitizationAlg=CompFactory.getComps("PileUpToolsAlg","DigitizationAlg")
......@@ -30,7 +31,7 @@ def PileUpToolsCfg(flags, **kwargs):
Alg = DigitizationAlg
# setup EventInfo
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs["EventInfoKey"] = flags.Overlay.BkgPrefix + 'EventInfo'
acc.addEventAlgo(Alg(flags.Digitization.DigiSteeringConf, **kwargs))
......
......@@ -4,6 +4,7 @@ Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
"""
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
from AthenaConfiguration.ComponentFactory import CompFactory
from AthenaConfiguration.Enums import ProductionStep
from Digitization.PileUpToolsConfig import PileUpToolsCfg
from Digitization.PileUpMergeSvcConfigNew import PileUpMergeSvcCfg, PileUpXingFolderCfg
......@@ -12,7 +13,7 @@ from Digitization.PileUpMergeSvcConfigNew import PileUpMergeSvcCfg, PileUpXingFo
def GenericMergeMcEventCollCfg(flags, name="MergeMcEventCollTool", **kwargs):
acc = ComponentAccumulator()
kwargs.setdefault("TruthCollInputKey", "TruthEvent")
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("TruthCollOutputKey", flags.Overlay.BkgPrefix + "TruthEvent")
else:
kwargs.setdefault("TruthCollOutputKey", "TruthEvent")
......@@ -96,7 +97,7 @@ def MergeAntiKt4TruthJetsCfg(flags, name="MergeAntiKt4TruthJetsTool", **kwargs):
if flags.Digitization.DoXingByXingPileUp: # PileUpTool approach
kwargs.setdefault("FirstXing", TruthJet_FirstXing())
kwargs.setdefault("LastXing", TruthJet_LastXing())
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("InTimeOutputTruthJetCollKey", flags.Overlay.BkgPrefix + "InTimeAntiKt4TruthJets")
kwargs.setdefault("OutOfTimeTruthJetCollKey", flags.Overlay.BkgPrefix + "OutOfTimeAntiKt4TruthJets")
else:
......@@ -114,7 +115,7 @@ def MergeAntiKt6TruthJetsCfg(flags, name="MergeAntiKt6TruthJetsTool", **kwargs):
if flags.Digitization.DoXingByXingPileUp: # PileUpTool approach
kwargs.setdefault("FirstXing", TruthJet_FirstXing())
kwargs.setdefault("LastXing", TruthJet_LastXing())
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("InTimeOutputTruthJetCollKey", flags.Overlay.BkgPrefix + "InTimeAntiKt6TruthJets")
kwargs.setdefault("OutOfTimeTruthJetCollKey", flags.Overlay.BkgPrefix + "OutOfTimeAntiKt6TruthJets")
else:
......@@ -161,7 +162,7 @@ def MergeTruthParticlesCfg(flags, name="MergeTruthParticlesTool", **kwargs):
if flags.Digitization.DoXingByXingPileUp: # PileUpTool approach
kwargs.setdefault("FirstXing", TruthParticle_FirstXing())
kwargs.setdefault("LastXing", TruthParticle_LastXing())
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("InTimeOutputTruthParticleCollKey", flags.Overlay.BkgPrefix + "TruthPileupParticles")
else:
kwargs.setdefault("InTimeOutputTruthParticleCollKey", "TruthPileupParticles")
......@@ -206,7 +207,7 @@ def MergeTrackRecordCollCfg(flags, name="MergeTrackRecordCollTool", **kwargs):
def MergeCaloEntryLayerCfg(flags, name="MergeCaloEntryLayerTool", **kwargs):
acc = ComponentAccumulator()
kwargs.setdefault("TrackRecordCollKey", "CaloEntryLayer")
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("TrackRecordCollOutputKey", flags.Overlay.BkgPrefix + "CaloEntryLayer")
else:
kwargs.setdefault("TrackRecordCollOutputKey", "CaloEntryLayer")
......@@ -217,7 +218,7 @@ def MergeCaloEntryLayerCfg(flags, name="MergeCaloEntryLayerTool", **kwargs):
def MergeMuonEntryLayerCfg(flags, name="MergeMuonEntryLayerTool", **kwargs):
acc = ComponentAccumulator()
kwargs.setdefault("TrackRecordCollKey", "MuonEntryLayer")
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("TrackRecordCollOutputKey", flags.Overlay.BkgPrefix + "MuonEntryLayer")
else:
kwargs.setdefault("TrackRecordCollOutputKey", "MuonEntryLayer")
......@@ -228,7 +229,7 @@ def MergeMuonEntryLayerCfg(flags, name="MergeMuonEntryLayerTool", **kwargs):
def MergeMuonExitLayerCfg(flags, name="MergeMuonExitLayerTool", **kwargs):
acc = ComponentAccumulator()
kwargs.setdefault("TrackRecordCollKey", "MuonExitLayer")
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("TrackRecordCollOutputKey", flags.Overlay.BkgPrefix + "MuonExitLayer")
else:
kwargs.setdefault("TrackRecordCollOutputKey", "MuonExitLayer")
......@@ -315,7 +316,7 @@ def MergeRecoTimingObjCfg(flags, name="MergeRecoTimingObjTool", **kwargs):
kwargs.setdefault("FirstXing", TimingObj_FirstXing())
kwargs.setdefault("LastXing", TimingObj_LastXing())
kwargs.setdefault("RecoTimingObjInputKey", "EVNTtoHITS_timings")
if flags.Digitization.PileUpPresampling:
if flags.Common.ProductionStep == ProductionStep.PileUpPresampling:
kwargs.setdefault("RecoTimingObjInputKey", flags.Overlay.BkgPrefix + "EVNTtoHITS_timings")
else:
kwargs.setdefault("RecoTimingObjInputKey", "EVNTtoHITS_timings")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment