ATLAS Offline Software
Loading...
Searching...
No Matches
TauChainConfiguration.py
Go to the documentation of this file.
1# Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2
3
8
9from AthenaCommon.Logging import logging
10logging.getLogger().info(f'Importing {__name__}')
11log = logging.getLogger(__name__)
12
13from TriggerMenuMT.HLT.Config.ChainConfigurationBase import ChainConfigurationBase
14
15from .TauMenuSequences import (
16 tauCaloMVASequenceGenCfg,
17 tauCaloHitsSequenceGenCfg,
18 tauFTFCoreSequenceGenCfg,
19 tauFTFIsoSequenceGenCfg,
20 tauPrecTrackSequenceGenCfg,
21 tauPrecisionSequenceGenCfg,
22)
23
24from .TauConfigurationTools import (
25 getChainSequenceConfigName,
26 getChainCaloHitsSeqName, getHitZConfig,
27 getChainPrecisionSeqName,
28)
29
30
31
32
35
36class TauChainConfiguration(ChainConfigurationBase):
37 def __init__(self, chainDict):
38 ChainConfigurationBase.__init__(self, chainDict)
39
40 def assembleChainImpl(self, flags):
41 log.debug(f'Assembling chain for {self.chainName}')
42
43 chain_steps = []
44
45 # Overall Tau Trigger sequences steps:
46 step_dictionary = {
47 # BRT calibration chains
48 'ptonly' : ['getCaloMVA', 'getCaloHitsEmpty', 'getFTFCoreEmpty', 'getFTFIsoEmpty', 'getPrecTrackEmpty', 'getPrecisionEmpty'],
49
50 # 2-step tracking + ID chains
51 'tracktwoMVA' : ['getCaloMVA', 'getCaloHitsEmpty', 'getFTFCore' , 'getFTFIso' , 'getPrecTrackIso' , 'getPrecision' ],
52 'tracktwoLLP' : ['getCaloMVA', 'getCaloHitsEmpty', 'getFTFCore' , 'getFTFIso' , 'getPrecTrackIso' , 'getPrecision' ],
53
54 # CaloHits + 2-step tracking + ID chains
55 'CaloHits_tracktwoMVA' : ['getCaloMVA', 'getCaloHits' , 'getFTFCore' , 'getFTFIso' , 'getPrecTrackIso' , 'getPrecision' ],
56
57 # LRT chains
58 'trackLRT' : ['getCaloMVA', 'getCaloHitsEmpty', 'getFTFLRT' , 'getFTFIsoEmpty', 'getPrecTrackLRT' , 'getPrecision' ],
59 }
60
61 steps = step_dictionary[getChainSequenceConfigName(self.chainPart)]
62 for step in steps:
63 if 'Empty' in step:
64 chain_step = getattr(self, step)(flags)
65 else:
66 is_probe_leg = self.chainPart['tnpInfo']=='probe'
67 jet = self.chainPart['jet']
68 chain_step = getattr(self, step)(flags, is_probe_leg=is_probe_leg, jet=jet)
69
70 chain_steps.append(chain_step)
71
72 return self.buildChain(chain_steps)
73
74
75 #--------------------------------------------------
76 # Step 1: CaloMVA reconstruction
77 #--------------------------------------------------
78 def getCaloMVA(self, flags, is_probe_leg=False, jet='lc'):
79 stepName = f'Calo{jet.upper()}MVA_tau'
80 return self.getStep(flags, stepName, [tauCaloMVASequenceGenCfg], is_probe_leg=is_probe_leg, jet=jet)
81
82
83 #--------------------------------------------------
84 # Step 2: Calo+Hits reconstruction + preselection
85 #--------------------------------------------------
86 def getCaloHits(self, flags, is_probe_leg=False, jet='lc'):
87 sequenceName = getChainCaloHitsSeqName(self.chainPart)
88 stepName = f'CaloHits_{sequenceName}_tau'
89 return self.getStep(
90 flags,
91 stepName,
92 [tauCaloHitsSequenceGenCfg],
93 seq_name=sequenceName,
94 precision_seq_name=getChainPrecisionSeqName(self.chainPart),
95 hitz_config=getHitZConfig(flags, self.chainPart),
96 is_probe_leg=is_probe_leg,
97 jet=jet
98 )
99
100 def getCaloHitsEmpty(self, flags):
101 stepName = 'CaloHitsEmpty_tau'
102 return self.getEmptyStep(stepName)
103
104
105 #--------------------------------------------------
106 # Step 3: 1st FTF stage (FTFCore/LRT)
107 #--------------------------------------------------
108 def getFTFCore(self, flags, is_probe_leg=False, jet='lc'):
109 stepName = f'FTFCore_{jet.upper()}'
110 if calohits_seq_name := getChainCaloHitsSeqName(self.chainPart):
111 stepName += f'_fromCaloHits_{calohits_seq_name}'
112 stepName += '_tau'
113
114 return self.getStep(
115 flags,
116 stepName,
117 [tauFTFCoreSequenceGenCfg],
118 calohits_seq_name=calohits_seq_name,
119 is_probe_leg=is_probe_leg,
120 jet=jet
121 )
122
123 def getFTFLRT(self, flags, is_probe_leg=False, jet='lc'):
124 stepName = f'FTFLRT_{jet.upper()}_tau'
125 return self.getStep(
126 flags,
127 stepName,
128 [tauFTFCoreSequenceGenCfg],
129 do_lrt=True,
130 is_probe_leg=is_probe_leg,
131 jet=jet
132 )
133
134 def getFTFCoreEmpty(self, flags):
135 stepName = 'FTFCoreEmpty_tau'
136 return self.getEmptyStep(stepName)
137
138
139 #--------------------------------------------------
140 # Step 4: 2nd FTF stage (FTFIso)
141 #--------------------------------------------------
142 def getFTFIso(self, flags, is_probe_leg=False, jet='lc'):
143 stepName = f'FTFIso_{jet.upper()}'
144 if calohits_seq_name := getChainCaloHitsSeqName(self.chainPart):
145 stepName += f'_fromCaloHits_{calohits_seq_name}'
146 stepName += '_tau'
147
148 return self.getStep(
149 flags,
150 stepName,
151 [tauFTFIsoSequenceGenCfg],
152 calohits_seq_name=calohits_seq_name,
153 is_probe_leg=is_probe_leg,
154 jet=jet
155 )
156
157 def getFTFIsoEmpty(self, flags):
158 stepName = 'FTFIsoEmpty_tau'
159 return self.getEmptyStep(stepName)
160
161
162 #--------------------------------------------------
163 # Step 5: Precision tracking
164 #--------------------------------------------------
165 def getPrecTrackIso(self, flags, is_probe_leg=False, jet='lc'):
166 stepName = f'PrecTrkIso_{jet.upper()}'
167 if calohits_seq_name := getChainCaloHitsSeqName(self.chainPart):
168 stepName += f'_fromCaloHits_{calohits_seq_name}'
169 stepName += '_tau'
170
171 return self.getStep(
172 flags,
173 stepName,
174 [tauPrecTrackSequenceGenCfg],
175 calohits_seq_name=calohits_seq_name,
176 is_probe_leg=is_probe_leg,
177 jet=jet
178 )
179
180 def getPrecTrackLRT(self, flags, is_probe_leg=False, jet='lc'):
181 stepName = f'PrecTrkLRT_{jet.upper()}_tau'
182 return self.getStep(
183 flags,
184 stepName,
185 [tauPrecTrackSequenceGenCfg],
186 do_lrt=True,
187 is_probe_leg=is_probe_leg,
188 jet=jet
189 )
190
191 def getPrecTrackEmpty(self, flags):
192 stepName = 'PrecTrkEmpty_tau'
193 return self.getEmptyStep(stepName)
194
195
196 #--------------------------------------------------
197 # Step 6: Precision reconstruction + ID
198 #--------------------------------------------------
199 def getPrecision(self, flags, is_probe_leg=False, jet='lc'):
200 sequenceName = getChainPrecisionSeqName(self.chainPart)
201 stepName = f'Precision_{sequenceName}_{jet.upper()}'
202 if calohits_seq_name := getChainCaloHitsSeqName(self.chainPart):
203 stepName += f'_fromCaloHits_{calohits_seq_name}'
204 stepName += '_tau'
205
206 return self.getStep(
207 flags,
208 stepName,
209 [tauPrecisionSequenceGenCfg],
210 seq_name=sequenceName,
211 calohits_seq_name=calohits_seq_name,
212 do_lrt='LRT' in sequenceName,
213 is_probe_leg=is_probe_leg,
214 jet=jet
215 )
216
217 def getPrecisionEmpty(self, flags):
218 stepName = 'PrecisionEmpty_tau'
219 return self.getEmptyStep(stepName)
getPrecTrackLRT(self, flags, is_probe_leg=False, jet='lc')
getCaloMVA(self, flags, is_probe_leg=False, jet='lc')
getPrecision(self, flags, is_probe_leg=False, jet='lc')
getCaloHits(self, flags, is_probe_leg=False, jet='lc')
getPrecTrackIso(self, flags, is_probe_leg=False, jet='lc')