Skip to main content

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)

Uploaded Source

Built Distribution

tcut_to_qastle-0.1-py3-none-any.whl (4.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page