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 37 of file TrigTauHypoTool.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 38 of file TrigTauHypoTool.py.

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

Member Function Documentation

◆ highpt_id_wp_decor()

int TrigTauHypoTool.TauCuts.highpt_id_wp_decor ( self)

Definition at line 107 of file TrigTauHypoTool.py.

107 def highpt_id_wp_decor(self) -> int:
108 if not self._highpt_id_wp: return ''
109 if self._use_rnn_selection: return self._highpt_id_wp
110 return f'{self._id}_{self._highpt_id_wp}'
111
112

◆ id_wp_decor()

str TrigTauHypoTool.TauCuts.id_wp_decor ( self)

Definition at line 101 of file TrigTauHypoTool.py.

101 def id_wp_decor(self) -> str:
102 if not self._id_wp: return ''
103 if self._use_rnn_selection: return self._id_wp
104 return f'{self._id}_{self._id_wp}'
105

◆ n_iso_track_max()

int TrigTauHypoTool.TauCuts.n_iso_track_max ( self)

Definition at line 94 of file TrigTauHypoTool.py.

94 def n_iso_track_max(self) -> int:
95 return 1 if self._do_perfiso else 999
96

◆ n_track_max()

int TrigTauHypoTool.TauCuts.n_track_max ( self)

Definition at line 90 of file TrigTauHypoTool.py.

90 def n_track_max(self) -> int:
91 return 3 if self._do_perfcore else 999
92

◆ pt_min()

float TrigTauHypoTool.TauCuts.pt_min ( self)

Definition at line 98 of file TrigTauHypoTool.py.

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

Member Data Documentation

◆ _chain_part

TrigTauHypoTool.TauCuts._chain_part = chain_part
protected

Definition at line 40 of file TrigTauHypoTool.py.

◆ _do_perfcore

bool TrigTauHypoTool.TauCuts._do_perfcore = True
protected

Definition at line 44 of file TrigTauHypoTool.py.

◆ _do_perfiso

bool TrigTauHypoTool.TauCuts._do_perfiso = True
protected

Definition at line 45 of file TrigTauHypoTool.py.

◆ _highpt_id_wp

str TrigTauHypoTool.TauCuts._highpt_id_wp = ''
protected

Definition at line 43 of file TrigTauHypoTool.py.

◆ _id

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

Definition at line 39 of file TrigTauHypoTool.py.

◆ _id_wp

str TrigTauHypoTool.TauCuts._id_wp = ''
protected

Definition at line 42 of file TrigTauHypoTool.py.

◆ _use_rnn_selection

bool TrigTauHypoTool.TauCuts._use_rnn_selection = False
protected

Definition at line 47 of file TrigTauHypoTool.py.


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