ServiceX data management using a configuration file
Project description
ServiceX DataBinder
Release v0.1.5
ServiceX DataBinder is a Python package for making multiple ServiceX requests and managing ServiceX delivered data from a configuration file.
Installation
pip install servicex-databinder
Configuration file
The configuration file is a yaml file containing all the information. An example configuration file is shown below:
General:
ServiceXBackendName: uproot
OutputDirectory: /path/to/output
OutputFormat: parquet
Sample:
- Name: ttH
GridDID: user.kchoi:user.kchoi.sampleA,
user.kchoi:user.kchoi.sampleB
Tree: nominal
FuncADL: "Select(lambda event: {'jet_e': event.jet_e, 'jet_pt': event.jet_pt})"
- Name: ttW
GridDID: user.kchoi:user.kchoi.sampleC
Tree: nominal
Filter: n_jet > 5
Columns: jet_e, jet_pt
ServiceX query can be constructed with either TCut syntax or func-adl.
- Options for TCut expression:
Filter
andColumns
- Option for Func-adl expression:
FuncADL
The following settings are available options:
Option for General |
Description | DataType |
---|---|---|
ServiceXBackendName |
ServiceX backend name (uproot or xAOD ) |
String |
OutputDirectory |
Path to the directory for ServiceX delivered files | String |
OutputFormat |
Output file format of ServiceX delivered data (parquet for uproot or root for xaod ) |
String |
WriteOutputDict |
Name of an ouput yaml file containing Python nested dictionary of output file paths (located in the OutputDirectory ) |
String |
IgnoreServiceXCache |
Ignore the existing ServiceX cache and force to make ServiceX requests | Boolean |
Option for Sample |
Description | DataType |
---|---|---|
Name |
sample name defined by a user | String |
GridDID |
Rucio Dataset Id (DID) for a given sample; Can be multiple DIDs separated by comma | String |
Tree |
Name of the input ROOT TTree (uproot ONLY) |
String |
Filter |
Selection in the TCut syntax, e.g. jet_pt > 10e3 && jet_eta < 2.0 (TCut ONLY) |
String |
Columns |
List of columns (or branches) to be delivered; multiple columns separately by comma (TCut ONLY) | String |
FuncADL |
func-adl expression for a given sample (func adl ONLY) | String |
Deliver data
from servicex_databinder import DataBinder
sx_db = DataBinder('<CONFIG>.yml')
out = sx_db.deliver()
The function deliver()
returns a Python nested dictionary:
- for
uproot
backend:out['<SAMPLE>']['<TREE>'] = [ List of output files ]
- for
xAOD
backend:out['<SAMPLE>'] = [ List of output files ]
Acknowledgements
Support for this work was provided by the the U.S. Department of Energy, Office of High Energy Physics under Grant No. DE-SC0007890
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for servicex_databinder-0.1.5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c6ceecf41c60de2a933a636743795398563eed502f3966184d1f772d5391bbd2 |
|
MD5 | 81099ead771ca756fad75a432617e63c |
|
BLAKE2b-256 | bbfb93058efd2776c06a43eef0d7966f82465b36f2a06c539b965057b84456e1 |
Close
Hashes for servicex_databinder-0.1.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2d504ed896fe4a327e104af22edc1bf209e14bb98bead6d932c77370fd61bd4 |
|
MD5 | 47481329859097f8e8ce8e6f4aebef40 |
|
BLAKE2b-256 | 7a71f14650fdfcb54c053825f2195515ad8286ea1526b05e0a94f8df8208d92b |