diff --git a/InnerDetector/InDetRecTools/InDetHardScatterSelectionTool/InDetHardScatterSelectionTool/InDetHardScatterSelectionTool.h b/InnerDetector/InDetRecTools/InDetHardScatterSelectionTool/InDetHardScatterSelectionTool/InDetHardScatterSelectionTool.h index 905f75e76a7e10dc2b0573bb682fa9dfa60b88d6..a90a0ae02a06bd79bd8e88616bd8e37dec79eef5 100644 --- a/InnerDetector/InDetRecTools/InDetHardScatterSelectionTool/InDetHardScatterSelectionTool/InDetHardScatterSelectionTool.h +++ b/InnerDetector/InDetRecTools/InDetHardScatterSelectionTool/InDetHardScatterSelectionTool/InDetHardScatterSelectionTool.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration + Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration */ #ifndef INDETHARDSCATTERSELECTIONTOOL_INDETHARDSCATTERSELECTIONTOOL_H diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValDecoration.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValDecoration.py index 74343e672ab82b83ca141493f9978a88e8eb4155..6771efa88142b27e85b6afdf06f78a9b649cbe4d 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValDecoration.py +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValDecoration.py @@ -1,4 +1,4 @@ -# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration from __future__ import print_function import InDetPhysValMonitoring.InDetPhysValMonitoringConf @@ -177,6 +177,7 @@ def getInDetTruthSelectionTool(**kwargs): def getHardScatterSelectionTool(**kwargs): from InDetHardScatterSelectionTool.InDetHardScatterSelectionToolConf import InDet__InDetHardScatterSelectionTool kwargs = setDefaults(kwargs, name="InDetHardScatterSelectionTool") + kwargs = setDefaults(kwargs, JetContainer="AntiKt4EMTopoJets") return InDet__InDetHardScatterSelectionTool(**kwargs) diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValMonitoringConfig.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValMonitoringConfig.py index f17195c5db3217595357c322e7821899ca1c65b5..41f21a6b23c46751c20bf7adeb7da393ae52daac 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValMonitoringConfig.py +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValMonitoringConfig.py @@ -1,5 +1,5 @@ # -# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration # '''@file InDetPhysValMonitoringConfig.py @@ -66,6 +66,14 @@ def InDetPhysValMonitoringToolCfg(flags, **kwargs): acc.merge(HistogramDefinitionSvcCfg(flags)) + jets_name_for_HardScatter = 'AntiKt4EMTopoJets' + # if we are running with sumpT(w) hard scatter selection, we need to schedule jet finding + if flags.IDPVM.hardScatterStrategy == 2: + + from InDetPhysValMonitoring.addRecoJetsConfig import AddRecoJetsIfNotExistingCfg + acc.merge(AddRecoJetsIfNotExistingCfg(flags, jets_name_for_HardScatter)) + + if flags.Input.isMC: kwargs.setdefault("TruthParticleContainerName", "TruthParticles") if 'TruthSelectionTool' not in kwargs: @@ -75,6 +83,9 @@ def InDetPhysValMonitoringToolCfg(flags, **kwargs): if 'hardScatterSelectionTool' not in kwargs: hardScatterSelectionTool = acc.popToolsAndMerge(HardScatterSelectionToolCfg(flags)) hardScatterSelectionTool.RedoHardScatter=True + # for sumpt(w), make sure the HS selection tool picks up the correct jets + if flags.IDPVM.hardScatterStrategy == 2: + hardScatterSelectionTool.JetContainer = jets_name_for_HardScatter hardScatterSelectionTool.SelectionMode = flags.IDPVM.hardScatterStrategy kwargs.setdefault("hardScatterSelectionTool", hardScatterSelectionTool) diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/addRecoJetsConfig.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/addRecoJetsConfig.py new file mode 100644 index 0000000000000000000000000000000000000000..011511ff2e0ff4158b06c5d806706f96f25d97c6 --- /dev/null +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/addRecoJetsConfig.py @@ -0,0 +1,22 @@ +# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + +def AddRecoJetsIfNotExistingCfg(flags, jetCollection): + ''' + Add algorithm to create the Reco jets collection unless the + collection exists already, or a Reco jet finder is already running + ''' + + # the jet collection name does not exist in the input file + # add a jet finder algorithm in front of the monitoring if the algorithm + # does not yet exist. + if "xAOD::JetContainer#"+jetCollection not in flags.Input.TypedCollections: + from AthenaCommon.Logging import logging + log = logging.getLogger('InDetPhysValMonitoring/addRecoJets.py') + + log.info('DEBUG addRecoJetsIfNotExising {} not in {} [file_type={}]'.format(jetCollection, flags.Input.TypedCollections, flags.Input.Format)) + + from JetRecConfig import StandardSmallRJets + theCollectionCfg = getattr(StandardSmallRJets, jetCollection.split("Jets")[0]) + from JetRecConfig.JetRecConfig import JetRecCfg + + return JetRecCfg(flags, theCollectionCfg)