7 from .TrigTauHypoMonitoring
import getTrigTauPrecisionIDHypoToolMonitoring, getTrigTauPrecisionDiKaonHypoToolMonitoring
9 from AthenaCommon.Logging
import logging
10 log = logging.getLogger(
'TrigHLTTauHypoTool')
16 chainPart = chainDict[
'chainParts'][0]
18 from TriggerMenuMT.HLT.Tau.TauConfigurationTools
import getChainIDConfigName
21 if identification ==
'MesonCuts':
32 def __init__(self, chain_part: dict[str, Any]):
48 if sel ==
'perf' or sel ==
'idperf':
return -1
49 elif sel.startswith(
'veryloose'):
return 0
50 elif sel.startswith(
'loose'):
return 1
51 elif sel.startswith(
'medium'):
return 2
52 elif sel.startswith(
'tight'):
return 3
54 raise ValueError(f
'Invalid selection: {sel}')
57 '''TrigTauPrecisionIDHypoTool configuration for the standard Tau triggers'''
58 name = chainDict[
'chainName']
59 chainPart = chainDict[
'chainParts'][0]
63 from AthenaConfiguration.ComponentFactory
import CompFactory
64 currentHypo = CompFactory.TrigTauPrecisionIDHypoTool(
67 NTracksMax=cuts.n_track_max,
68 NIsoTracksMax=cuts.n_iso_track_max,
72 from TriggerMenuMT.HLT.Tau.TauConfigurationTools
import getChainIDConfigName, getChainPrecisionSeqName, useBuiltInTauJetRNNScore, getPrecisionSequenceTauIDs, getTauIDScoreVariables
74 id_score_monitoring = {}
78 if identification
in [
'perf',
'idperf']:
79 if identification ==
'idperf':
80 currentHypo.AcceptAll =
True
83 used_builtin_rnnscore =
False
86 if tau_id
in [
'MesonCuts']:
continue
90 if used_builtin_rnnscore:
91 raise ValueError(
'Cannot have two TauID algorithms with scores stored in the built-in TauJet RNN score variables')
92 used_builtin_rnnscore =
True
100 currentHypo.IDMethod = 1
103 currentHypo.IDMethod = 2
104 currentHypo.IDWPNames = [f
'{identification}_{wp}' for wp
in getattr(flags.Trigger.Offline.Tau, identification).WPNames]
110 if chainPart[
'reconstruction'] ==
'tracktwoMVA':
111 currentHypo.TrackPtCut = 1.5*GeV
112 currentHypo.HighPtSelectionLooseIDThr = 200*GeV
113 currentHypo.HighPtSelectionJetThr = 430*GeV
116 if 'tauMon:online' in chainDict[
'monGroups']:
120 currentHypo.MonitoredIDScores = id_score_monitoring
128 from collections
import namedtuple
130 DiKaonCuts = namedtuple(
'DiKaonCuts',
'massTrkSysMin massTrkSysMax massTrkSysKaonMin massTrkSysKaonMax massTrkSysKaonPiMin massTrkSysKaonPiMax targetMassTrkSysKaonPi leadTrkPtMin PtMin EMPOverTrkSysPMax')
131 thresholds_dikaon = {
132 (
'dikaonmass', 25):
DiKaonCuts(0.0*GeV, 1000.0*GeV, 0.987*GeV, 1.060*GeV, 0.0*GeV, 1000.0*GeV, 0.0*GeV, 15.0*GeV, 25.0*GeV, 1.5),
133 (
'dikaonmass', 35):
DiKaonCuts(0.0*GeV, 1000.0*GeV, 0.987*GeV, 1.060*GeV, 0.0*GeV, 1000.0*GeV, 0.0*GeV, 25.0*GeV, 35.0*GeV, 1.5),
135 (
'kaonpi1', 25):
DiKaonCuts(0.0*GeV, 1000.0*GeV, 0.0*GeV, 1000.0*GeV, 0.79*GeV, 0.99*GeV, 0.89*GeV, 15.0*GeV, 25.0*GeV, 1.0),
136 (
'kaonpi1', 35):
DiKaonCuts(0.0*GeV, 1000.0*GeV, 0.0*GeV, 1000.0*GeV, 0.79*GeV, 0.99*GeV, 0.89*GeV, 25.0*GeV, 35.0*GeV, 1.0),
138 (
'kaonpi2', 25):
DiKaonCuts(0.0*GeV, 1000.0*GeV, 0.0*GeV, 1000.0*GeV, 1.8*GeV, 1.93*GeV, 1.865*GeV, 15.0*GeV, 25.0*GeV, 1.0),
139 (
'kaonpi2', 35):
DiKaonCuts(0.0*GeV, 1000.0*GeV, 0.0*GeV, 1000.0*GeV, 1.8*GeV, 1.93*GeV, 1.865*GeV, 25.0*GeV, 35.0*GeV, 1.0),
141 (
'dipion1', 25):
DiKaonCuts(0.475*GeV, 1.075*GeV, 0.0*GeV, 1000.0*GeV, 0.0*GeV, 1000.0*GeV, 0.0*GeV, 15.0*GeV, 25.0*GeV, 1.0),
142 (
'dipion2', 25):
DiKaonCuts(0.460*GeV, 0.538*GeV, 0.0*GeV, 1000.0*GeV, 0.0*GeV, 1000.0*GeV, 0.0*GeV, 15.0*GeV, 25.0*GeV, 1.0),
143 (
'dipion3', 25):
DiKaonCuts(0.279*GeV, 0.648*GeV, 0.0*GeV, 1000.0*GeV, 0.0*GeV, 1000.0*GeV, 0.0*GeV, 25.0*GeV, 25.0*GeV, 2.2),
144 (
'dipion4', 25):
DiKaonCuts(0.460*GeV, 1.075*GeV, 0.0*GeV, 1000.0*GeV, 0.0*GeV, 1000.0*GeV, 0.0*GeV, 15.0*GeV, 25.0*GeV, 1.0),
147 SinglePionCuts = namedtuple(
'SinglePionCuts',
'leadTrkPtMin PtMin NTracksMax NIsoTracksMax dRmaxMax etOverPtLeadTrkMin etOverPtLeadTrkMax')
148 thresholds_singlepion = {
149 (
'singlepion', 25):
SinglePionCuts(30.0*GeV, 25.0*GeV, 1, 0, 0.06, 0.4, 0.85),
153 '''TrigTauPrecisionDiKaonHypoTool configuration for the meson cut-based Tau triggers (ATR-22644)'''
154 name = chainDict[
'chainName']
155 chainPart = chainDict[
'chainParts'][0]
158 from AthenaConfiguration.ComponentFactory
import CompFactory
159 currentHypo = CompFactory.TrigTauPrecisionDiKaonHypoTool(name)
161 key = (chainPart[
'selection'],
int(chainPart[
'threshold']))
162 if key
in thresholds_dikaon:
163 thr = thresholds_dikaon[key]
164 currentHypo.PtMin = thr.PtMin
165 currentHypo.leadTrkPtMin = thr.leadTrkPtMin
166 currentHypo.massTrkSysMin = thr.massTrkSysMin
167 currentHypo.massTrkSysMax = thr.massTrkSysMax
168 currentHypo.massTrkSysKaonMin = thr.massTrkSysKaonMin
169 currentHypo.massTrkSysKaonMax = thr.massTrkSysKaonMax
170 currentHypo.massTrkSysKaonPiMin = thr.massTrkSysKaonPiMin
171 currentHypo.massTrkSysKaonPiMax = thr.massTrkSysKaonPiMax
172 currentHypo.targetMassTrkSysKaonPi = thr.targetMassTrkSysKaonPi
173 currentHypo.EMPOverTrkSysPMax = thr.EMPOverTrkSysPMax
175 elif key
in thresholds_singlepion:
176 thr = thresholds_singlepion[key]
177 currentHypo.PtMin = thr.PtMin
178 currentHypo.NTracksMax = thr.NTracksMax
179 currentHypo.NIsoTracksMax = thr.NIsoTracksMax
180 currentHypo.leadTrkPtMin = thr.leadTrkPtMin
181 currentHypo.dRmaxMax = thr.dRmaxMax
182 currentHypo.etOverPtLeadTrkMin = thr.etOverPtLeadTrkMin
183 currentHypo.etOverPtLeadTrkMax = thr.etOverPtLeadTrkMax
195 name = chainDict[
'chainName']
197 from AthenaConfiguration.ComponentFactory
import CompFactory
198 currentHypo = CompFactory.TrigTauPrecTrackHypoTool(name)
208 name = chainDict[
'chainName']
210 from AthenaConfiguration.ComponentFactory
import CompFactory
211 currentHypo = CompFactory.TrigTauFastTrackHypoTool(name)
221 name = chainDict[
'chainName']
222 threshold =
float(chainDict[
'chainParts'][0][
'threshold'])
224 from AthenaConfiguration.ComponentFactory
import CompFactory
225 currentHypo = CompFactory.TrigTauCaloHypoTool(name)
226 currentHypo.PtMin = threshold * GeV