TCut selection for ROOT TTree to Qastle wrapper for ServiceX xAOD and Uproot transformer
Project description
Introduction
TCut selection for ROOT TTree to Qastle wrapper for ServiceX xAOD and Uproot transformer.
Supported operations
- Arithmetic operators:
+, -, *, /
- Logical operators:
!, &&, ||
- Relational and comparison operators:
==, !=, >, <, >=, <=
Usage
import tcut_to_qastle
# Get Qastle query
query = tcut_to_qastle.translate(<TCut selection>, <Columns to deliver>)
# Get the list of columns in the TCut selection
columns_in_selection = tcut_to_qastle.get_list_of_columns_in_selection(<TCut selection>)
Example
>>> import tcut_to_qastle
>>> query = tcut_to_qastle.translate("A && B * C>0", "A,B")
>>> query
"(Select (Where (call EventDataset) (lambda (list event) (and (> (attr event 'A') 0) (> (* (attr event 'B') (attr event 'C')) 0)))) (lambda (list event) (dict (list 'A' 'B') (list (attr event 'A') (attr event 'B')))))"
>>> columns_in_selection = tcut_to_qastle.get_list_of_columns_in_selection("A && B * C>0")
>>> columns_in_selection
['A', 'B', 'C']
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
tcut_to_qastle-0.2.tar.gz
(3.2 kB
view hashes)
Built Distribution
Close
Hashes for tcut_to_qastle-0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 300e8c9d97a96253bd5ff58e48fab3c9bcd8b6a0dcd1c65292ec63c3f330bc13 |
|
MD5 | fd2ddb2cf53bd86e49d12eb1061e10a1 |
|
BLAKE2b-256 | 9173326f98e369e5159ba9f0df3f966d24a86e8641c32483e9dc8bd68bd48547 |