ATLAS Offline Software
Loading...
Searching...
No Matches
TrigTauHypoTool.TauCuts Class Reference
Collaboration diagram for TrigTauHypoTool.TauCuts:

Public Member Functions

 __init__ (self, flags, dict[str, Any] chain_part)
int n_track_max (self)
int n_iso_track_max (self)
float pt_min (self)
str id_wp_decor (self)
int highpt_id_wp_decor (self)

Protected Attributes

 _id = getChainIDConfigName(flags, chain_part)
 _chain_part = chain_part
str _id_wp = ''
str _highpt_id_wp = ''
bool _do_perfcore = True
bool _do_perfiso = True
bool _use_rnn_selection = False

Detailed Description

Definition at line 34 of file TrigTauHypoTool.py.

Constructor & Destructor Documentation

◆ __init__()

TrigTauHypoTool.TauCuts.__init__ ( self,
flags,
dict[str, Any] chain_part )

Definition at line 35 of file TrigTauHypoTool.py.

35 def __init__(self, flags, chain_part: dict[str, Any]):
36 self._id = getChainIDConfigName(flags, chain_part)
37 self._chain_part = chain_part
38
39 self._id_wp = ''
40 self._highpt_id_wp = ''
41 self._do_perfcore = True
42 self._do_perfiso = True
43
44 self._use_rnn_selection = False
45
46 if self._id in ['idperf', 'noperf', 'perfcore', 'perfiso', 'perf']:
47 self._do_perfcore = self._id in ['perfcore', 'perf']
48 self._do_perfiso = self._id in ['perfiso', 'perf']
49
50 else:
51 if self._id in ['DeepSet', 'RNNLLP'] and self._chain_part['selection'].endswith('RNN'):
52 # Support for the legacy triggers
53 self._use_rnn_selection = True
54 self._id_wp = self._chain_part['selection'][:-3] # Remove the "RNN" suffix
55 if self._id_wp in ['medium', 'tight']: self._highpt_id_wp = 'loose'
56
57 else:
58 id_wp = self._chain_part['selection'].removesuffix(self._id).lower()
59
60 # Check for a perf selection specifier
61 sfx = id_wp[-2:]
62 if sfx in ['np', 'pc', 'pi']: id_wp = id_wp[:-2]
63 if sfx in ['np', 'pi']: self._do_perfcore = False
64 if sfx in ['np', 'pc']: self._do_perfiso = False
65
66 # Find the matching WP with the correct casing
67 def find_wp(wp: str, fail: bool = True) -> str:
68 for twp in getattr(flags.Trigger.Offline.Tau, self._id).TargetWPs.keys():
69 if twp.lower() == wp: return twp
70 else:
71 if fail: ValueError(f'Cannot find the "{self._id}" WP "{wp}"')
72 else: return ''
73
74 # Standard ID WP
75 self._id_wp = find_wp(id_wp)
76
77 # High-pT ID WP
78 if id_wp.startswith('medium'): self._highpt_id_wp = find_wp(f'loose{id_wp[6:]}', True)
79 elif id_wp.startswith('tight'): self._highpt_id_wp = find_wp(f'loose{id_wp[5:]}', True)
80

Member Function Documentation

◆ highpt_id_wp_decor()

int TrigTauHypoTool.TauCuts.highpt_id_wp_decor ( self)

Definition at line 99 of file TrigTauHypoTool.py.

99 def highpt_id_wp_decor(self) -> int:
100 if not self._highpt_id_wp: return ''
101 if self._use_rnn_selection: return self._highpt_id_wp
102 return f'{self._id}_{self._highpt_id_wp}'
103
104

◆ id_wp_decor()

str TrigTauHypoTool.TauCuts.id_wp_decor ( self)

Definition at line 93 of file TrigTauHypoTool.py.

93 def id_wp_decor(self) -> str:
94 if not self._id_wp: return ''
95 if self._use_rnn_selection: return self._id_wp
96 return f'{self._id}_{self._id_wp}'
97

◆ n_iso_track_max()

int TrigTauHypoTool.TauCuts.n_iso_track_max ( self)

Definition at line 86 of file TrigTauHypoTool.py.

86 def n_iso_track_max(self) -> int:
87 return 1 if self._do_perfiso else 999
88

◆ n_track_max()

int TrigTauHypoTool.TauCuts.n_track_max ( self)

Definition at line 82 of file TrigTauHypoTool.py.

82 def n_track_max(self) -> int:
83 return 3 if self._do_perfcore else 999
84

◆ pt_min()

float TrigTauHypoTool.TauCuts.pt_min ( self)

Definition at line 90 of file TrigTauHypoTool.py.

90 def pt_min(self) -> float: return float(self._chain_part['threshold']) * GeV
91

Member Data Documentation

◆ _chain_part

TrigTauHypoTool.TauCuts._chain_part = chain_part
protected

Definition at line 37 of file TrigTauHypoTool.py.

◆ _do_perfcore

bool TrigTauHypoTool.TauCuts._do_perfcore = True
protected

Definition at line 41 of file TrigTauHypoTool.py.

◆ _do_perfiso

bool TrigTauHypoTool.TauCuts._do_perfiso = True
protected

Definition at line 42 of file TrigTauHypoTool.py.

◆ _highpt_id_wp

str TrigTauHypoTool.TauCuts._highpt_id_wp = ''
protected

Definition at line 40 of file TrigTauHypoTool.py.

◆ _id

TrigTauHypoTool.TauCuts._id = getChainIDConfigName(flags, chain_part)
protected

Definition at line 36 of file TrigTauHypoTool.py.

◆ _id_wp

str TrigTauHypoTool.TauCuts._id_wp = ''
protected

Definition at line 39 of file TrigTauHypoTool.py.

◆ _use_rnn_selection

bool TrigTauHypoTool.TauCuts._use_rnn_selection = False
protected

Definition at line 44 of file TrigTauHypoTool.py.


The documentation for this class was generated from the following file: