![]() |
ATLAS Offline Software
|
Public Member Functions | |
| __init__ (self, type_and_name, properties=None, rename_containers=None, link_target_names=None) | |
| properties (self) | |
| columns (self) | |
| input_columns (self) | |
| output_columns (self) | |
| required_input_branch_names (self) | |
| recommended_systematics (self) | |
| apply_systematic_variation (self, sys_name) | |
| __call__ (self, events, systematic=None) | |
Public Attributes | |
| input_columns | |
Protected Attributes | |
| _handle = PythonToolHandle() | |
| _properties = dict(properties) if properties else {} | |
| _classified = classify_columns(self._handle.columns) | |
High-level wrapper around PythonToolHandle.
Handles the boilerplate of classifying columns, extracting awkward-array
buffers, allocating outputs, setting columns on the handle, calling the
tool, and reconstructing the output awkward array.
Parameters
----------
type_and_name:
Tool type and instance name, e.g. "CP::MuonEfficiencyScaleFactors/myTool".
properties:
Optional dict of tool properties to set before initialization.
rename_containers:
Optional mapping from canonical container names (e.g. "Muons") to the
branch-name prefix used in the input arrays (e.g. "AnalysisMuonsAuxDyn").
This is passed to PythonToolHandle.rename_containers *after* initialize
so that ColumnInfo.name values match input array fields.
link_target_names:
Optional mapping from container names, after ``rename_containers`` is
applied, to the names used to calculate the keys of links pointing to
them, e.g.
``{"AnalysisMuonsAuxDyn": "AnalysisMuons"}``. By default that is the
canonical name, independent of ``rename_containers``. The result is
reported in ``ColumnInfo.name_for_links``.
| python.tool.Tool.__init__ | ( | self, | |
| type_and_name, | |||
| properties = None, | |||
| rename_containers = None, | |||
| link_target_names = None ) |
Definition at line 51 of file tool.py.
| python.tool.Tool.__call__ | ( | self, | |
| events, | |||
| systematic = None ) |
Run the tool on events and return output columns as an ak.Array.
Parameters
----------
events:
An ak.Array with fields matching the tool's input column names
(after any rename_containers mapping).
systematic:
Optional systematic variation name (e.g. "MUON_EFF_RECO_SYS__1up").
If provided, applied before running the tool and reset to nominal
after execution.
Returns
-------
ak.Array
Record array with one field per output column, each a
variable-length list over the per-particle values.
Definition at line 143 of file tool.py.
| python.tool.Tool.apply_systematic_variation | ( | self, | |
| sys_name ) |
Apply a systematic variation by name.
Parameters
----------
sys_name:
Systematic variation name, e.g. ``"MUON_EFF_RECO_SYS__1up"``.
Pass ``""`` to reset to the nominal.
Definition at line 132 of file tool.py.
| python.tool.Tool.columns | ( | self | ) |
| python.tool.Tool.input_columns | ( | self | ) |
Input (non-offset) ColumnInfo objects, including nested-vector data columns.
Definition at line 81 of file tool.py.
| python.tool.Tool.output_columns | ( | self | ) |
Output ColumnInfo objects, including nested-vector outputs (currently unsupported).
Definition at line 91 of file tool.py.
| python.tool.Tool.properties | ( | self | ) |
| python.tool.Tool.recommended_systematics | ( | self | ) |
| python.tool.Tool.required_input_branch_names | ( | self | ) |
Deduplicated uproot branch names needed to fill non-optional inputs. For nested-vector inputs, the trailing ``.data`` suffix is stripped so the returned name matches the actual ROOT branch (e.g. ``"Particles.NumTrkPt500"`` instead of ``"Particles.NumTrkPt500.data"``). Key and index columns of links inside a vector map to the branch of the link itself. For one link per object they keep their names, as those are the actual ROOT branches: the branch of the link is a grouping branch, which ``uproot.iterate`` can't read directly. Optional inputs are excluded.
Definition at line 101 of file tool.py.
|
protected |
|
protected |