Lines
- class DecisionLine(name, algs, prescale=1.0, postscale=1.0)[source]
Object fully qualifying an HLT line.
The control flow of the line, a
PyConf.control_flow.CompositeNode
, is exposed as thenode
property. It will run the givenalgs
prepended with aDeterministicPrescaler
(even if the prescale is 1), all combined withPyConf.control_flow.NodeLogic.LAZY_AND
logic.The attributes of this object should be considered immutable.
- Parameters
name (str) – name of the line
algs (iterable of
Algorithm
) – control flow of the lineprescale (float) – accept fraction of the prescaler
postscale (float) – accept fraction of the postscaler
- name
name of the line
- Type
str
- node
full control flow of the line; if this CF node is positive, the line is said to have ‘fired’
- output_producer
the last algorithm in the line’s control flow. On a positive CF decision the application may wish to use this output, e.g. to fill selection reports or luminosity banks
- Type
Algorithm
- property decision_name
Decision name.
- property produces_output
Return True if this line produces output.
- class Hlt2Line(name, algs, prescale=1.0, postscale=1.0, extra_outputs=None, persistreco=False, tagging_particles=False, calo_digits=False, calo_clusters=False, pv_tracks=False, track_ancestors=False, raw_banks=None, hlt1_filter_code='', monitoring_variables=('pt', 'eta', 'm', 'vchi2', 'ipchi2', 'n_candidates'))[source]
Object fully qualifying an HLT2 line.
Extends
DecisionLine
with control flow that ensures additional objects are created for later persistence on a positive decision. This supports extra outputs (TurboSP) and reconstruction persistence (Turbo++/PersistReco).- Parameters
name (str) – name of the line; must begin with
Hlt2
.algs (iterable of
Algorithm
) – control flow of the lineprescale (float) – accept fraction of the prescaler
postscale (float) – accept fraction of the postscaler
extra_outputs (iterable of 2-tuple) – List of
(name, DataHandle)
pairs.persistreco (bool) – If True, request HLT2 reconstruction persistence.
hlt1_filter_code (list(str)) – string used to define a HLT1 filter.
- objects_to_persist
Objects which this lines requests to be persisted on a positive decision. The control flow of the line will guarantee that these objects will exist in that case.
- Type
list of DataHandle
- extra_outputs
List of
(name, DataHandle)
pairs which this line requests are persisted on a positive decision. The name is just an identifier, which can be used by the application to construct a TES path when persisting each extra output- Type
iterable of 2-tuple
- persistreco
If True, this line requests HLT2 reconstruction persistence on a positive decision. The CF of the line (the
node
attribute) will ensure that the reconstruction algorithms that produce the reconstruction objects will run when the line fires- Type
bool
- locations_to_move
Dictionary of TES paths, which the persistence code will need to move (keys) and the paths they should be moved to (values). This is currently on filled in case a FlavourTag object is found in extra_outputs.
- Type
dict of strings
- hlt1_filter_code
If not empty, the string is used to define a HLT1 filter that is prepended to the control flow defined by
algs
. If empty, a default filter according to ‘get_default_hlt1_filter_code_for_hlt2’ is applied. ThOr DECREPORTS_RE_FILTER is used. Note that this parameter should look like “[‘Hlt1ADecision’, ‘Hlt1.*Decision’]”.- Type
list(str)
- monitoring_variables
Variables to create default monitoring plots for. These variables need to be implemented in .monitoring.py
- Type
tuple(str)
- property produces_output
Return True if this line produces output OR requests reconstruction OR requests extra_outputs.
- register_line_builder(registry)[source]
Decorator to register a named HLT line.
The decorated function must have keyword parameter
name
. Its default value is used as the key inregistry
, under which the line builder (maker) is registered.Usage:
>>> from PyConf.tonic import configurable ... >>> all_lines = {} >>> @register_line_builder(all_lines) ... @configurable ... def the_line_definition(name='Hlt2LineName'): ... # ... ... return DecisionLine(name=name, algs=[]) # filled with control flow ... >>> 'Hlt2LineName' in all_lines True