A package to compare cutflow histograms from ROOT files.
Project description
cutflow_compare
Overview
cutflow_compare is a Python package designed to compare cutflow histograms from ROOT files. It provides a straightforward command-line interface for users to analyze and visualize differences in cutflow data across different regions.
Features
- Compare cutflow histograms from multiple ROOT files.
- Custom labels for each file using the
--labelsargument. - Generate separate CSV reports for each region.
- Calculate relative errors and standard deviations across all files for each selection.
- Easy to use with command-line arguments for file input and region selection.
Installation
You can install the package using pip:
pip install cutflow_compare
Usage
After installation, you can use the command-line tool directly:
cutflow_compare --files histoOut-compared.root histoOut-reference.root -r region1 region2 region3 --labels Compared Reference
Or, if running from source:
python cutflow_compare.py --files histoOut-compared.root histoOut-reference.root -r region1 region2 region3 --labels Compared Reference
Note:
Make sure the same regions are present in all files with the same name.
Arguments
--files: List of input ROOT files to compare. Required.--regions: List of regions to compare within the cutflow histograms. Required.--labels: Custom labels for each file, used in the output CSV. Optional.--separate-selections: Optional flag to keep selections separate instead of merging them.--relative-error: Optional flag to include relative error calculations in the output.
Output
The tool generates separate CSV files for each region named cutflow_comparison_{region}.csv.
Each CSV contains the comparison results for that specific region, with columns for each file and calculated relative errors when multiple files are compared.
Example
cutflow_compare --files histoOut-compared.root histoOut-reference.root histoOut-third.root -r WZ ttbar --labels Compared Reference Third --relative-error
This command compares the specified regions (WZ, ttbar) in the three provided ROOT files. It outputs separate results to:
cutflow_comparison_WZ.csvcutflow_comparison_ttbar.csv
Each file includes relative error and standard deviation calculations for each selection.
Requirements
- Python 3.6+
- ROOT (must be installed separately, e.g., via conda:
conda install -c conda-forge root) - pandas (automatically installed with the package)
- uncertainties (automatically installed with the package)
License
This project is licensed under the MIT License. See the LICENSE file for more details.
Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue for any enhancements or bug fixes.
Acknowledgments
This package utilizes the ROOT framework for data analysis and visualization.
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cutflow_compare-2.0.2.tar.gz.
File metadata
- Download URL: cutflow_compare-2.0.2.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0038ccf115b0b830715d8022a15c6881d96106d6a10a508b408b75c920b82244
|
|
| MD5 |
5c1259f073ac8135d6f38c37339c2d27
|
|
| BLAKE2b-256 |
301e7845583aa02c9acde065b022d3aac77ec607cbb34ae697a65b6070797226
|
File details
Details for the file cutflow_compare-2.0.2-py3-none-any.whl.
File metadata
- Download URL: cutflow_compare-2.0.2-py3-none-any.whl
- Upload date:
- Size: 6.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2eb41e5d3e2f3cd006e4a4afe893b69bf1467ad46629f70f27cc0bc1e549f8f7
|
|
| MD5 |
3f8523e28aad71b3bfaced8bf1f4d937
|
|
| BLAKE2b-256 |
1aaaa6b2356af1115ae6c2a64561edef93954fe780c8a03ed5cf3755fbce37d0
|