diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/FullListOfSmartContainers.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/FullListOfSmartContainers.py index 6f68949c505fc18319ca695fb1b1af96db1c7dbb..6ffee26d94e2dd0eaf705d67824d01a1ad9b2213 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/FullListOfSmartContainers.py +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/FullListOfSmartContainers.py @@ -68,7 +68,8 @@ def FullListOfSmartContainers(flags=None): "HLT_AntiKt4EMPFlowJets_subresjesgscIS_ftf", "HLT_IDVertex_FS", "HLT_IDTrack_FS_FTF", - "HLT_TrigTauRecMerged_MVA" + "HLT_TrigTauRecMerged_MVA", + "HLT_BJetTriggerByYearContent", ] if flags is not None and flags.Tracking.doPseudoTracking: diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/SlimmingHelper.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/SlimmingHelper.py index c8e4a89a575e2aea603064c66cb4a75636af7fe0..a5c0c1ff47d1e1a09654e753672723cb26c8784b 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/SlimmingHelper.py +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkCore/python/SlimmingHelper.py @@ -96,6 +96,7 @@ class SlimmingHelper: self.IncludeTauTriggerContent = False self.IncludeEtMissTriggerContent = False self.IncludeBJetTriggerContent = False + self.IncludeBJetTriggerByYearContent = False self.IncludeBPhysTriggerContent = False self.IncludeMinBiasTriggerContent = False self.OverrideJetTriggerContentWithTLAContent = False @@ -208,6 +209,10 @@ class SlimmingHelper: triggerContent = True self.SmartCollections.append("HLT_xAOD__BTaggingContainer_HLTBjetFex") + if (self.IncludeBJetTriggerByYearContent is True): + triggerContent = True + self.SmartCollections.append("HLT_BJetTriggerByYearContent") + if (self.IncludeBPhysTriggerContent is True): triggerContent = True self.SmartCollections.append("HLT_xAOD__TrigBphysContainer_EFBMuMuFex") @@ -631,6 +636,9 @@ class SlimmingHelper: items.extend(JetTriggerContentRun3) else: items.extend(JetTriggerContentRun3TLA) + elif collectionName=="HLT_BJetTriggerByYearContent": + from DerivationFrameworkTrigger.BJetTriggerByYearContent import getBJetTriggerContent + items.extend(getBJetTriggerContent(self.flags)) else: raise RuntimeError("Smart slimming container "+collectionName+" does not exist or does not have a smart slimming list") diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/python/PHYS.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/python/PHYS.py index f416f3a39acacb80834390b136a485cf9cbeb98b..c7b2256d2b3c922a5a00c8cbf3041cd1075f4ed5 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/python/PHYS.py +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkPhys/python/PHYS.py @@ -173,6 +173,8 @@ def PHYSCoreCfg(flags, name_tag='PHYS', StreamName='StreamDAOD_PHYS', TriggerLis PHYSSlimmingHelper.IncludeBJetTriggerContent = False PHYSSlimmingHelper.IncludeBPhysTriggerContent = False PHYSSlimmingHelper.IncludeMinBiasTriggerContent = False + # Compact b-jet trigger matching info + PHYSSlimmingHelper.IncludeBJetTriggerByYearContent = True # Trigger matching # Run 2 diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTrigger/python/BJetTriggerByYearContent.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTrigger/python/BJetTriggerByYearContent.py new file mode 100644 index 0000000000000000000000000000000000000000..fed012be4855402bdffd737d9f8ad64327ace90e --- /dev/null +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkTrigger/python/BJetTriggerByYearContent.py @@ -0,0 +1,89 @@ +# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration + +from Campaigns.Utils import getMCCampaign, Campaign +from PyUtils.Logging import logging +msg = logging.getLogger('BJetTriggerByYearContent') +msg.setLevel(logging.INFO) + +def getDataYear(flags): + if flags.Input.isMC: + campaign = getMCCampaign(flags.Input.Files) + dataYear = { + Campaign.MC20a: 2016, # prefer over 2015 + Campaign.MC20d: 2017, + Campaign.MC20e: 2018, + Campaign.MC21a: 2022, # prefer over 2015 + Campaign.MC23a: 2022, # prefer over 2015 + Campaign.MC23d: 2023, + Campaign.MC23e: 2024, + Campaign.PhaseII: 2030, + }[campaign] + else: + dataYear = flags.Input.DataYear + return dataYear + + +def getBJetTriggerContent(flags): + if flags.Trigger.EDMVersion == 2: + triggerContent = [ + "HLT_xAOD__BTaggingContainer_HLTBjetFex", + "HLT_xAOD__BTaggingContainer_HLTBjetFexAux.MV2c00_discriminant.MV2c10_discriminant.MV2c20_discriminant", + ] + jetCollections = { + 2016: [ + # Jet collections needed for HLT jet matching + "HLT_xAOD__JetContainer_a4tcemsubjesFS", + "HLT_xAOD__JetContainer_a4tcemsubjesFSAux.pt.eta.phi.m", + # B-jet collections needed for HLT jet matching + "HLT_xAOD__JetContainer_EFJet", # 2015 + "HLT_xAOD__JetContainer_EFJetAux.pt.eta.phi.m", + "HLT_xAOD__JetContainer_SplitJet", + "HLT_xAOD__JetContainer_SplitJetAux.pt.eta.phi.m", + ], + 2017: [ + # Jet collections needed for HLT jet matching + "HLT_xAOD__JetContainer_a4tcemsubjesISFS", + "HLT_xAOD__JetContainer_a4tcemsubjesISFSAux.pt.eta.phi.m", + # B-jet collections needed for HLT jet matching + "HLT_xAOD__JetContainer_SplitJet", # Mainly for low-pt 2b2j in 2018 + "HLT_xAOD__JetContainer_SplitJetAux.pt.eta.phi.m", + "HLT_xAOD__JetContainer_GSCJet", + "HLT_xAOD__JetContainer_GSCJetAux.pt.eta.phi.m", + ], + } + jetCollections[2015] = jetCollections[2016] + jetCollections[2018] = jetCollections[2017] + + year = getDataYear(flags) + msg.debug(f'Configured b-jet trigger content for {year}') + + triggerContent += jetCollections[year] + return triggerContent + elif flags.Trigger.EDMVersion == 3: + triggerContent = [ + "HLT_AntiKt4EMPFlowJets_subresjesgscIS_ftf_bJets", + "HLT_AntiKt4EMPFlowJets_subresjesgscIS_ftf_bJetsAux.pt.eta.phi.m", + "HLT_AntiKt4EMPFlowJets_subresjesgscIS_ftf_BTagging", + ] + + year = getDataYear(flags) + msg.debug(f'Configured b-jet trigger content for {year}') + + btagstrs = [] + btaggers = { + 2022: ['DL1d20211216'], + 2023: ['GN120220813'], + 2024: ['GN220240122'], + 2030: [], # Some day we'll have something amazing here + }[year] + for btagger in btaggers: + btagstrs.append('.'.join([f'{btagger}_{p}' for p in ['pb','pc','pu']])) + btagvars = '.'.join(btagstrs) + triggerContent.append(f"HLT_AntiKt4EMPFlowJets_subresjesgscIS_ftf_BTaggingAux.{btagvars}") + return triggerContent + elif flags.Trigger.EDMVersion == -1: + # Allow for undefined trigger content -- no RDOtoRDOTrigger run + msg.debug('Received EDMVersion=-1: no trigger info available. Returning empty b-jet trigger content') + return [] + + raise ValueError(f"Unsupported EDM version {flags.Trigger.EDMVersion} determined") diff --git a/Tools/WorkflowTestRunner/python/References.py b/Tools/WorkflowTestRunner/python/References.py index 063de4bc5ceec8626b2fb4f04a867519eb14d1ef..c0b7a9106dbbc90cdb1009e63da042e65b7b8e58 100644 --- a/Tools/WorkflowTestRunner/python/References.py +++ b/Tools/WorkflowTestRunner/python/References.py @@ -29,14 +29,14 @@ references_map = { "q452": "v21", "q454": "v31", # Derivations - "data_PHYS_Run2": "v30", + "data_PHYS_Run2": "v31", "data_PHYSLITE_Run2": "v17", - "data_PHYS_Run3": "v29", + "data_PHYS_Run3": "v30", "data_PHYSLITE_Run3": "v17", - "mc_PHYS_Run2": "v40", + "mc_PHYS_Run2": "v41", "mc_PHYSLITE_Run2": "v19", - "mc_PHYS_Run3": "v40", + "mc_PHYS_Run3": "v41", "mc_PHYSLITE_Run3": "v21", - "af3_PHYS_Run3": "v21", + "af3_PHYS_Run3": "v22", "af3_PHYSLITE_Run3": "v22", }