ATLAS Offline Software
Loading...
Searching...
No Matches
python.JetTriggerAnalysisConfig.JetTriggerMatchingBlock Class Reference
Inheritance diagram for python.JetTriggerAnalysisConfig.JetTriggerMatchingBlock:
Collaboration diagram for python.JetTriggerAnalysisConfig.JetTriggerMatchingBlock:

Public Member Functions

 __init__ (self)
 instanceName (self)
 makeAlgs (self, config)

Public Attributes

 runHLTMatching
 runL1Matching
 containerName

Detailed Description

Definition at line 48 of file JetTriggerAnalysisConfig.py.

Constructor & Destructor Documentation

◆ __init__()

python.JetTriggerAnalysisConfig.JetTriggerMatchingBlock.__init__ ( self)

Definition at line 50 of file JetTriggerAnalysisConfig.py.

50 def __init__ (self) :
51 super().__init__()
52 self.addOption ('triggerChainsPerYear', {}, type=dict,
53 info="a dictionary with key (string) the year and value (list of "
54 "strings) the trigger chains.")
55 self.addOption ('includeAllYearsPerRun', False, type=bool,
56 info="all configured years in the LHC run will "
57 "be included in all jobs.")
58 self.addOption ('removeHLTPrefix', True, type=bool,
59 info="remove the HLT prefix from trigger chain names.")
60 self.addOption ('containerName', '', type=str,
61 info="the input jet container, with a possible selection, in "
62 "the format `container` or `container.selection`.",
63 meta={'role':'containerRef'})
64 self.addOption ('runL1Matching', True, type=bool,
65 info="Add L1 matching decorations")
66 self.addOption ('runHLTMatching', True, type=bool,
67 info="Add HLT matching decorations")
68 self.addOption ('l1dR', 0.4, type=float,
69 info="ΔR cone for the L1 (jFEX) trigger matching "
70 "(sets CP::JetTriggerDecoratorAlg.l1dR_cut). Default 0.4 "
71 "matches the algorithm's own default.")
72 self.addOption ('hltDR', 0.4, type=float,
73 info="ΔR cone for the HLT trigger matching "
74 "(sets CP::JetTriggerDecoratorAlg.hltDR_cut). Default 0.4 "
75 "matches the algorithm's own default.")
76

Member Function Documentation

◆ instanceName()

python.JetTriggerAnalysisConfig.JetTriggerMatchingBlock.instanceName ( self)
Return the instance name for this block

Definition at line 77 of file JetTriggerAnalysisConfig.py.

77 def instanceName (self) :
78 """Return the instance name for this block"""
79 return self.containerName
80
81

◆ makeAlgs()

python.JetTriggerAnalysisConfig.JetTriggerMatchingBlock.makeAlgs ( self,
config )

Definition at line 82 of file JetTriggerAnalysisConfig.py.

82 def makeAlgs (self, config) :
83
84 triggers = trigger_set(config, self.triggerChainsPerYear,
85 self.includeAllYearsPerRun)
86 decisionTool = TriggerAnalysisBlock.makeTriggerDecisionTool(config)
87
88 for chain in triggers:
89 chain_noHLT = chain.replace("HLT_", "")
90 chain_out = chain_noHLT if self.removeHLTPrefix else chain
91 chain_out = chain_out.replace("-","_").replace(".","p")
92
93 alg = config.createAlgorithm( 'CP::JetTriggerDecoratorAlg',
94 'JetTriggerDecoratorAlg_' + chain_out )
95
96 alg.trigger = chain
97
98 # To add missing HLT jets -- only for buggy triggers
99 # These extra jets are added because of bug in trigger navigation
100 # Will be removed once bug fixed at DAOD level
101 alg.triggerBugList = [
102 "HLT_j80c_020jvt_j55c_020jvt_j28c_020jvt_j20c_020jvt_SHARED_2j20c_020jvt_bdl1d77_pf_ftf_presel2c20XX2c20b85_L1J45p0ETA21_3J15p0ETA25",
103 "HLT_j75c_020jvt_j50c_020jvt_j25c_020jvt_j20c_020jvt_SHARED_2j20c_020jvt_bgn177_pf_ftf_presel2c20XX2c20b85_L1J45p0ETA21_3J15p0ETA25"
104 ]
105
106 alg.TrigDecisionTool = f"{decisionTool.getType()}/{decisionTool.getName()}"
107
108 alg.doL1Matching = self.runL1Matching
109 alg.doHLTMatching = self.runHLTMatching
110 alg.jets = config.readName (self.containerName)
111
112 # Phase-I L1Calo (jFEX) vs legacy L1Calo is not a user choice — it is
113 # fixed by the data-taking year (data 2024+) and the MC campaign
114 # (mc23e/mc23g). Determine it automatically from the config metadata.
115 if config.dataType() is DataType.Data:
116 usePhaseIL1 = config.dataYear() >= 2024
117 else:
118 usePhaseIL1 = config.campaign() in (Campaign.MC23e, Campaign.MC23g)
119 alg.usePhaseIL1 = usePhaseIL1
120 alg.l1dR_cut = self.l1dR
121 alg.hltDR_cut = self.hltDR
122
123 if config.geometry() is LHCPeriod.Run2 and self.runHLTMatching:
124
125 alg.useEmulationTool = True
126 configure_emulationTool(alg, config, [chain])
127
128 decorations = []
129 if self.runL1Matching:
130 decorations += [('L1Et', 'L1et'), ('L1Eta', 'L1eta'),
131 ('L1Phi', 'L1phi'), ('L1DR', 'L1dr'),
132 ('L1Threshold', 'L1thresholds')]
133 if self.runHLTMatching:
134 decorations += [('HLTPt', 'HLTpt'), ('HLTEta', 'HLTeta'),
135 ('HLTPhi', 'HLTphi'), ('HLTDR', 'HLTdr'),
136 ('HLTThreshold', 'HLTthresholds')]
137 for prop, var in decorations:
138 outputName = "match_" + chain_out + "_" + var
139 setattr(alg, prop, outputName + "_%SYS%")
140 config.addOutputVar (self.containerName,
141 outputName + "_%SYS%",
142 outputName, noSys=True)
std::string replace(std::string s, const std::string &s2, const std::string &s3)
Definition hcg.cxx:312

Member Data Documentation

◆ containerName

python.JetTriggerAnalysisConfig.JetTriggerMatchingBlock.containerName

Definition at line 140 of file JetTriggerAnalysisConfig.py.

◆ runHLTMatching

python.JetTriggerAnalysisConfig.JetTriggerMatchingBlock.runHLTMatching

Definition at line 123 of file JetTriggerAnalysisConfig.py.

◆ runL1Matching

python.JetTriggerAnalysisConfig.JetTriggerMatchingBlock.runL1Matching

Definition at line 129 of file JetTriggerAnalysisConfig.py.


The documentation for this class was generated from the following file: