ATLAS Offline Software
TauChainConfiguration.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 
8 
9 from typing import List
10 
11 from AthenaCommon.Logging import logging
12 logging.getLogger().info(f'Importing {__name__}')
13 log = logging.getLogger(__name__)
14 
15 from TriggerMenuMT.HLT.Config.ChainConfigurationBase import ChainConfigurationBase
16 
17 from .TauMenuSequences import (
18  tauCaloMVAMenuSequenceGenCfg,
19  tauFTFTauCoreSequenceGenCfg, tauFTFTauLRTSequenceGenCfg,
20  tauFTFTauIsoSequenceGenCfg,
21  tauPrecTrackIsoSequenceGenCfg, tauPrecTrackLRTSequenceGenCfg,
22  tauPrecisionSequenceGenCfg, tauPrecisionLRTSequenceGenCfg)
23 
24 from .TauConfigurationTools import getChainSequenceConfigName, getChainPrecisionSeqName
25 
26 
27 
30 
32  def __init__(self, chainDict):
33  ChainConfigurationBase.__init__(self, chainDict)
34 
35  def assembleChainImpl(self, flags):
36  log.debug(f'Assembling chain for {self.chainName}')
37 
38  chain_steps = []
39 
40  # Overall Tau Trigger sequences steps:
41  step_dictionary = {
42  # BRT calibration chains
43  'ptonly' : ['getCaloMVA', 'getFTFCoreEmpty', 'getFTFIsoEmpty', 'getPrecTrackEmpty', 'getPrecisionEmpty'],
44 
45  # 2-step tracking + ID chains
46  'tracktwoMVA' : ['getCaloMVA', 'getFTFCore' , 'getFTFIso' , 'getPrecTrackIso' , 'getPrecision' ],
47  'tracktwoLLP' : ['getCaloMVA', 'getFTFCore' , 'getFTFIso' , 'getPrecTrackIso' , 'getPrecision' ],
48 
49  # LRT chains
50  'trackLRT' : ['getCaloMVA', 'getFTFLRT' , 'getFTFIsoEmpty', 'getPrecTrackLRT' , 'getPrecisionLRT' ],
51  }
52 
53  steps = step_dictionary[getChainSequenceConfigName(self.chainPart)]
54  for step in steps:
55  if 'Empty' in step:
56  chain_step = getattr(self, step)(flags)
57  else:
58  is_probe_leg = self.chainPart['tnpInfo']=='probe'
59  chain_step = getattr(self, step)(flags, is_probe_leg=is_probe_leg)
60 
61  chain_steps.append(chain_step)
62 
63  return self.buildChain(chain_steps)
64 
65 
66  #--------------------------------------------------
67  # Step 1: CaloMVA reconstruction
68  #--------------------------------------------------
69  def getCaloMVA(self, flags, is_probe_leg=False):
70  stepName = 'CaloMVA_tau'
71  return self.getStep(flags, stepName, [tauCaloMVAMenuSequenceGenCfg], is_probe_leg=is_probe_leg)
72 
73 
74  #--------------------------------------------------
75  # Step 2: 1st FTF stage (FTFCore/LRT)
76  #--------------------------------------------------
77  def getFTFCore(self, flags, is_probe_leg=False):
78  stepName = 'FTFCore_tau'
79  return self.getStep(flags, stepName, [tauFTFTauCoreSequenceGenCfg], is_probe_leg=is_probe_leg)
80 
81  def getFTFLRT(self, flags, is_probe_leg=False):
82  stepName = 'FTFLRT_tau'
83  return self.getStep(flags, stepName, [tauFTFTauLRTSequenceGenCfg], is_probe_leg=is_probe_leg)
84 
85  def getFTFCoreEmpty(self, flags):
86  stepName = 'FTFCoreEmpty_tau'
87  return self.getEmptyStep(2, stepName)
88 
89 
90  #--------------------------------------------------
91  # Step 3: 2nd FTF stage (FTFIso)
92  #--------------------------------------------------
93  def getFTFIso(self, flags, is_probe_leg=False):
94  stepName = 'FTFIso_tau'
95  return self.getStep(flags, stepName, [tauFTFTauIsoSequenceGenCfg], is_probe_leg=is_probe_leg)
96 
97  def getFTFIsoEmpty(self, flags):
98  stepName = 'FTFIsoEmpty_tau'
99  return self.getEmptyStep(3, stepName)
100 
101 
102  #--------------------------------------------------
103  # Step 4: Precision tracking
104  #--------------------------------------------------
105  def getPrecTrackIso(self, flags, is_probe_leg=False):
106  stepName = 'PrecTrkIso_tau'
107  return self.getStep(flags, stepName, [tauPrecTrackIsoSequenceGenCfg], is_probe_leg=is_probe_leg)
108 
109  def getPrecTrackLRT(self, flags, is_probe_leg=False):
110  stepName = 'PrecTrkLRT_tau'
111  return self.getStep(flags, stepName, [tauPrecTrackLRTSequenceGenCfg], is_probe_leg=is_probe_leg)
112 
113  def getPrecTrackEmpty(self, flags):
114  stepName = 'PrecTrkEmpty_tau'
115  return self.getEmptyStep(4, stepName)
116 
117 
118  #--------------------------------------------------
119  # Step 5: Precision reconstruction + ID
120  #--------------------------------------------------
121  def getPrecision(self, flags, is_probe_leg=False):
122  sequenceName = getChainPrecisionSeqName(self.chainPart)
123  stepName = f'Precision_{sequenceName}_tau'
124  return self.getStep(
125  flags,
126  stepName,
127  [tauPrecisionSequenceGenCfg],
128  seq_name=sequenceName,
129  is_probe_leg=is_probe_leg,
130  )
131 
132  def getPrecisionLRT(self, flags, is_probe_leg=False):
133  sequenceName = getChainPrecisionSeqName(self.chainPart)
134  stepName = f'Precision_{sequenceName}_tau'
135  return self.getStep(
136  flags,
137  stepName,
138  [tauPrecisionLRTSequenceGenCfg],
139  seq_name=sequenceName,
140  is_probe_leg=is_probe_leg,
141  )
142 
143  def getPrecisionEmpty(self, flags):
144  stepName = 'PrecisionEmpty_tau'
145  return self.getEmptyStep(5, stepName)
grepfile.info
info
Definition: grepfile.py:38
python.HLT.Tau.TauChainConfiguration.TauChainConfiguration
Class to configure tau chains.
Definition: TauChainConfiguration.py:31
python.HLT.Tau.TauChainConfiguration.TauChainConfiguration.getPrecisionEmpty
def getPrecisionEmpty(self, flags)
Definition: TauChainConfiguration.py:143
ChainConfigurationBase
Definition: ChainConfigurationBase.py:1
python.HLT.Tau.TauChainConfiguration.TauChainConfiguration.getPrecision
def getPrecision(self, flags, is_probe_leg=False)
Definition: TauChainConfiguration.py:121
python.HLT.Tau.TauChainConfiguration.TauChainConfiguration.getPrecisionLRT
def getPrecisionLRT(self, flags, is_probe_leg=False)
Definition: TauChainConfiguration.py:132
python.HLT.Tau.TauChainConfiguration.TauChainConfiguration.getPrecTrackEmpty
def getPrecTrackEmpty(self, flags)
Definition: TauChainConfiguration.py:113
python.HLT.Tau.TauChainConfiguration.TauChainConfiguration.getFTFIso
def getFTFIso(self, flags, is_probe_leg=False)
Definition: TauChainConfiguration.py:93
python.HLT.Tau.TauChainConfiguration.TauChainConfiguration.getFTFCoreEmpty
def getFTFCoreEmpty(self, flags)
Definition: TauChainConfiguration.py:85
python.HLT.Tau.TauChainConfiguration.TauChainConfiguration.getFTFCore
def getFTFCore(self, flags, is_probe_leg=False)
Definition: TauChainConfiguration.py:77
python.HLT.Tau.TauChainConfiguration.TauChainConfiguration.getPrecTrackLRT
def getPrecTrackLRT(self, flags, is_probe_leg=False)
Definition: TauChainConfiguration.py:109
python.HLT.Tau.TauChainConfiguration.TauChainConfiguration.getFTFLRT
def getFTFLRT(self, flags, is_probe_leg=False)
Definition: TauChainConfiguration.py:81
python.HLT.Tau.TauChainConfiguration.TauChainConfiguration.getFTFIsoEmpty
def getFTFIsoEmpty(self, flags)
Definition: TauChainConfiguration.py:97
python.HLT.Tau.TauConfigurationTools.getChainPrecisionSeqName
str getChainPrecisionSeqName(chainPart)
Definition: TauConfigurationTools.py:67
python.HLT.Tau.TauChainConfiguration.TauChainConfiguration.getPrecTrackIso
def getPrecTrackIso(self, flags, is_probe_leg=False)
Definition: TauChainConfiguration.py:105
python.HLT.Tau.TauChainConfiguration.TauChainConfiguration.assembleChainImpl
def assembleChainImpl(self, flags)
Definition: TauChainConfiguration.py:35
python.HLT.Tau.TauChainConfiguration.TauChainConfiguration.__init__
def __init__(self, chainDict)
Definition: TauChainConfiguration.py:32
python.HLT.Tau.TauConfigurationTools.getChainSequenceConfigName
str getChainSequenceConfigName(chainPart)
Definition: TauConfigurationTools.py:62
python.HLT.Tau.TauChainConfiguration.TauChainConfiguration.getCaloMVA
def getCaloMVA(self, flags, is_probe_leg=False)
Definition: TauChainConfiguration.py:69