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 chain_step = getattr(self, step)(flags, is_probe_leg=is_probe_leg)
68
69 chain_steps.append(chain_step)
70
71 return self.buildChain(chain_steps)
72
73
74 #--------------------------------------------------
75 # Step 1: CaloMVA reconstruction
76 #--------------------------------------------------
77 def getCaloMVA(self, flags, is_probe_leg=False):
78 stepName = 'CaloMVA_tau'
79 return self.getStep(flags, stepName, [tauCaloMVASequenceGenCfg], is_probe_leg=is_probe_leg)
80
81
82 #--------------------------------------------------
83 # Step 2: Calo+Hits reconstruction + preselection
84 #--------------------------------------------------
85 def getCaloHits(self, flags, is_probe_leg=False):
86 sequenceName = getChainCaloHitsSeqName(self.chainPart)
87 stepName = f'CaloHits_{sequenceName}_tau'
88 return self.getStep(
89 flags,
90 stepName,
91 [tauCaloHitsSequenceGenCfg],
92 seq_name=sequenceName,
93 precision_seq_name=getChainPrecisionSeqName(self.chainPart),
94 hitz_config=getHitZConfig(flags, self.chainPart),
95 is_probe_leg=is_probe_leg,
96 )
97
98 def getCaloHitsEmpty(self, flags):
99 stepName = 'CaloHitsEmpty_tau'
100 return self.getEmptyStep(stepName)
101
102
103 #--------------------------------------------------
104 # Step 3: 1st FTF stage (FTFCore/LRT)
105 #--------------------------------------------------
106 def getFTFCore(self, flags, is_probe_leg=False):
107 stepName = 'FTFCore'
108 if calohits_seq_name := getChainCaloHitsSeqName(self.chainPart):
109 stepName += f'_fromCaloHits_{calohits_seq_name}'
110 stepName += '_tau'
111
112 return self.getStep(
113 flags,
114 stepName,
115 [tauFTFCoreSequenceGenCfg],
116 calohits_seq_name=calohits_seq_name,
117 is_probe_leg=is_probe_leg,
118 )
119
120 def getFTFLRT(self, flags, is_probe_leg=False):
121 stepName = 'FTFLRT_tau'
122 return self.getStep(
123 flags,
124 stepName,
125 [tauFTFCoreSequenceGenCfg],
126 do_lrt=True,
127 is_probe_leg=is_probe_leg,
128 )
129
130 def getFTFCoreEmpty(self, flags):
131 stepName = 'FTFCoreEmpty_tau'
132 return self.getEmptyStep(stepName)
133
134
135 #--------------------------------------------------
136 # Step 4: 2nd FTF stage (FTFIso)
137 #--------------------------------------------------
138 def getFTFIso(self, flags, is_probe_leg=False):
139 stepName = 'FTFIso'
140 if calohits_seq_name := getChainCaloHitsSeqName(self.chainPart):
141 stepName += f'_fromCaloHits_{calohits_seq_name}'
142 stepName += '_tau'
143
144 return self.getStep(
145 flags,
146 stepName,
147 [tauFTFIsoSequenceGenCfg],
148 calohits_seq_name=calohits_seq_name,
149 is_probe_leg=is_probe_leg
150 )
151
152 def getFTFIsoEmpty(self, flags):
153 stepName = 'FTFIsoEmpty_tau'
154 return self.getEmptyStep(stepName)
155
156
157 #--------------------------------------------------
158 # Step 5: Precision tracking
159 #--------------------------------------------------
160 def getPrecTrackIso(self, flags, is_probe_leg=False):
161 stepName = 'PrecTrkIso'
162 if calohits_seq_name := getChainCaloHitsSeqName(self.chainPart):
163 stepName += f'_fromCaloHits_{calohits_seq_name}'
164 stepName += '_tau'
165
166 return self.getStep(
167 flags,
168 stepName,
169 [tauPrecTrackSequenceGenCfg],
170 calohits_seq_name=calohits_seq_name,
171 is_probe_leg=is_probe_leg
172 )
173
174 def getPrecTrackLRT(self, flags, is_probe_leg=False):
175 stepName = 'PrecTrkLRT_tau'
176 return self.getStep(
177 flags,
178 stepName,
179 [tauPrecTrackSequenceGenCfg],
180 do_lrt=True,
181 is_probe_leg=is_probe_leg
182 )
183
184 def getPrecTrackEmpty(self, flags):
185 stepName = 'PrecTrkEmpty_tau'
186 return self.getEmptyStep(stepName)
187
188
189 #--------------------------------------------------
190 # Step 6: Precision reconstruction + ID
191 #--------------------------------------------------
192 def getPrecision(self, flags, is_probe_leg=False):
193 sequenceName = getChainPrecisionSeqName(self.chainPart)
194 stepName = f'Precision_{sequenceName}'
195 if calohits_seq_name := getChainCaloHitsSeqName(self.chainPart):
196 stepName += f'_fromCaloHits_{calohits_seq_name}'
197 stepName += '_tau'
198
199 return self.getStep(
200 flags,
201 stepName,
202 [tauPrecisionSequenceGenCfg],
203 seq_name=sequenceName,
204 calohits_seq_name=calohits_seq_name,
205 do_lrt='LRT' in sequenceName,
206 is_probe_leg=is_probe_leg,
207 )
208
209 def getPrecisionEmpty(self, flags):
210 stepName = 'PrecisionEmpty_tau'
211 return self.getEmptyStep(stepName)