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
# Load
tq = tcut_to_qastle.Translate(<TCut selection>, <Columns to deliver>)
# Get Qastle query
query = tq.to_qastle()
# Get the list of columns in the TCut selection
columns_in_selection = tq.list_of_columns_in_selection
Example
>>> import tcut_to_qastle
>>> tq = tcut_to_qastle.Translate("A && B * C>0", "A,B")
>>> tq.to_qastle()
"(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')))))"
>>> tq.list_of_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.1.tar.gz
(3.3 kB
view hashes)
Built Distribution
Close
Hashes for tcut_to_qastle-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a680bfa744161d4a5c2841f33f8880cd0f18e4e1030f3d34fe3372edbc1918f |
|
MD5 | 29d386847c83a707e78d5dc00dfd8edf |
|
BLAKE2b-256 | 677578ab4fefb2de766717dee2a88e133bf8424b5295cc5eccf817f7ccf814c1 |