ATLAS Offline Software
Loading...
Searching...
No Matches
BJetTriggerByYearContent.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3from Campaigns.Utils import getDataYear
4import logging
5msg = logging.getLogger('BJetTriggerByYearContent')
6msg.setLevel(logging.INFO)
7
8run3_year_tagger_map = {
9 2022: 'bdl1d',
10 2023: 'bgn1',
11 2024: 'bgn2',
12 2025: 'bgn2',
13 2026: 'bgn2',
14 2030: 'bgn2', # Some day we'll have something amazing here
15}
16
17run3_tagger_deco_map = {
18 "bdl1r": ["DL1r"],
19 "bdl1d": ["DL1d20211216"],
20 "bgn1" : ["GN120220813"],
21 "bgn2" : ["GN220240122"],
22}
23
24def getDecoByTrigName(trigName):
25 decoration_list = []
26 for tagger, deco in run3_tagger_deco_map.items():
27 if tagger in trigName:
28 decoration_list += deco
29 if len(decoration_list) == 0:
30 raise ValueError(f"Could not find decorations for trigger name {trigName}, avaialable sub-strings: {list(run3_tagger_deco_map.keys())}")
31 # deduplicate
32 return list(set(decoration_list))
33
34def getBJetTriggerContent(flags):
35 if flags.Trigger.EDMVersion == 2:
36 triggerContent = [
37 "HLT_xAOD__BTaggingContainer_HLTBjetFex",
38 "HLT_xAOD__BTaggingContainer_HLTBjetFexAux.MV2c00_discriminant.MV2c10_discriminant.MV2c20_discriminant.BTagBtagToJetAssociator",
39 ]
40 jetCollections = {
41 2016: [
42 # Jet collections needed for HLT jet matching
43 "HLT_xAOD__JetContainer_a4tcemsubjesFS",
44 "HLT_xAOD__JetContainer_a4tcemsubjesFSAux.pt.eta.phi.m",
45 # B-jet collections needed for HLT jet matching
46 "HLT_xAOD__JetContainer_EFJet", # 2015
47 "HLT_xAOD__JetContainer_EFJetAux.pt.eta.phi.m",
48 "HLT_xAOD__JetContainer_SplitJet",
49 "HLT_xAOD__JetContainer_SplitJetAux.pt.eta.phi.m",
50 ],
51 2017: [
52 # Jet collections needed for HLT jet matching
53 "HLT_xAOD__JetContainer_a4tcemsubjesISFS",
54 "HLT_xAOD__JetContainer_a4tcemsubjesISFSAux.pt.eta.phi.m",
55 # B-jet collections needed for HLT jet matching
56 "HLT_xAOD__JetContainer_SplitJet", # For Btag->Split->GSC matching in 2017 and 2018, and low-pt 2b2j in 2018
57 "HLT_xAOD__JetContainer_SplitJetAux.pt.eta.phi.m",
58 "HLT_xAOD__JetContainer_GSCJet",
59 "HLT_xAOD__JetContainer_GSCJetAux.pt.eta.phi.m",
60 ],
61 }
62 jetCollections[2015] = jetCollections[2016]
63 jetCollections[2018] = jetCollections[2017]
64
65 year = getDataYear(flags)
66 msg.debug(f'Configured b-jet trigger content for {year}')
67
68 triggerContent += jetCollections[year]
69 return triggerContent
70 elif flags.Trigger.EDMVersion >= 3: # currently Run 3 and 4 shares the same code block
71 year = getDataYear(flags)
72 msg.debug(f'Configured Run 3 / Run 4 b-jet trigger content for {year}')
73
74 ftagstrs = []
75 ftaggers = run3_tagger_deco_map.get(run3_year_tagger_map[year])
76 for ftagger in ftaggers:
77 ftagstrs.append('.'.join([f'{ftagger}_{p}' for p in ['pb','pc','pu']]))
78 jetstrs = ftagstrs + ['pt', 'eta', 'phi', 'm']
79 jetvars = '.'.join(jetstrs)
80 triggerContent = [
81 "HLT_AntiKt4EMPFlowJets_subresjesgscIS_ftf_bJets",
82 f"HLT_AntiKt4EMPFlowJets_subresjesgscIS_ftf_bJetsAux.{jetvars}",
83 ]
84 return triggerContent
85
86 elif flags.Trigger.EDMVersion == -1:
87 # Allow for undefined trigger content -- no RDOtoRDOTrigger run
88 msg.debug('Received EDMVersion=-1: no trigger info available. Returning empty b-jet trigger content')
89 return []
90
91 raise ValueError(f"Unsupported EDM version {flags.Trigger.EDMVersion} determined")
STL class.