3 from AthenaCommon.Logging
import logging
4 log = logging.getLogger(__name__)
16 '''Get the list of TauIDs for each HLT tau trigger sequence'''
18 'MVA': [
'DeepSet',
'MesonCuts'],
23 return tau_ids[precision_sequence]
31 rnn_wps = [
'verylooseRNN',
'looseRNN',
'mediumRNN',
'tightRNN']
32 noid_selections = [
'perf',
'idperf']
33 meson_selections = [
'kaonpi1',
'kaonpi2',
'dipion1',
'dipion2',
'dipion3',
'dipion4',
'dikaonmass',
'singlepion']
36 '''Clean the ID configuration for a chainPart dict'''
37 sel = chainPart[
'selection']
40 if chainPart[
'reconstruction'] ==
'tracktwoMVA':
43 elif sel
in meson_selections:
45 elif chainPart[
'reconstruction']
in [
'tracktwoLLP',
'trackLRT']
and sel
in rnn_wps:
50 if sel.startswith(
'veryloose'): sel = sel.removeprefix(
'veryloose')
51 if sel.startswith(
'loose'): sel = sel.removeprefix(
'loose')
52 if sel.startswith(
'medium'): sel = sel.removeprefix(
'medium')
53 if sel.startswith(
'tight'): sel = sel.removeprefix(
'tight')
56 name_mapping: dict[str, str] = {
'DS':
'DeepSet',
'GNT':
'GNTau'}
57 if sel
in name_mapping: sel = name_mapping[sel]
63 '''Get the HLT Tau signature sequence name (e.g. ptonly, tracktwo, trackLRT, etc...)'''
64 return chainPart[
'reconstruction']
69 Get the HLT Tau Precision sequence name suffix.
70 This is also used for the HLT_TrigTauRecMerged_... and HLT_tautrack_... EDM collection names.
72 ret = chainPart[
'reconstruction']
75 if ret ==
'tracktwoMVA':
return 'MVA'
76 elif ret ==
'tracktwoLLP':
return 'LLP'
77 elif ret ==
'trackLRT':
return 'LRT'
83 '''Check if the TauJet's built-in RNN score and WP variables have to be used, instead of the decorator-based variables'''
85 if (tau_id ==
'DeepSet' and precision_sequence ==
'MVA')
or (tau_id ==
'RNNLLP' and precision_sequence
in [
'LLP',
'LRT']):
92 '''Return the (score, score_sig_trans) variable name pair for a given TauID/Sequence configuration'''
95 return (
'RNNJetScore',
'RNNJetScoreSigTrans')
97 return (f
'{tau_id}_Score', f
'{tau_id}_ScoreSigTrans')