Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/Snowmass21-software/analysis-example-python
Example analysis with histogramming using only python
https://github.com/Snowmass21-software/analysis-example-python
Last synced: 3 months ago
JSON representation
Example analysis with histogramming using only python
- Host: GitHub
- URL: https://github.com/Snowmass21-software/analysis-example-python
- Owner: Snowmass21-software
- Created: 2021-09-09T18:53:03.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2021-09-09T23:02:07.000Z (about 3 years ago)
- Last Synced: 2024-07-04T00:55:05.410Z (4 months ago)
- Language: Python
- Size: 2.93 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pure-Python Analysis Example
This repository provides an example analysis script for processing the Delphes outputs produced by the Snowmass MC Prod task force.
## Installation
Using a python3 installation in a virtual environment, e.g.
```
python3 -m venv myenv
source myenv/bin/activate
```you can install the requirements via
```
python -m pip install -r requirements.txt
```## Running
Simply run
```
python analysis.py
```which outputs a histogram using `histoprint`. For one Delphes file, one sees
```
0.00e+00 _ 4.68e+04 ╷
2.50e+01 _███████████████████████████████████████
5.00e+01 _█
7.50e+01 _
1.00e+02 _
1.25e+02 _
1.50e+02 _
1.75e+02 _
2.00e+02 _
2.25e+02 _
2.50e+02 _
2.75e+02 _
3.00e+02 _
3.25e+02 _
3.50e+02 _
3.75e+02 _
4.00e+02 _
4.25e+02 _
4.50e+02 _
4.75e+02 _
5.00e+02 _
5.25e+02 _
5.50e+02 _
5.75e+02 _
6.00e+02 _
6.25e+02 _
6.50e+02 _
6.75e+02 _
7.00e+02 _
7.25e+02 _
7.50e+02 _
7.75e+02 _
8.00e+02 _
8.25e+02 _
8.50e+02 _
8.75e+02 _
9.00e+02 _
9.25e+02 _
9.50e+02 _
9.75e+02 _
1.00e+03 _
```which takes about 2 seconds to run. For all 350+ files in one of the samples, it takes a little over 3 hours:
```
$ time python3 analysis.py
0.00e+00 _ 1.65e+07 ╷
2.50e+01 _███████████████████████████████████████
5.00e+01 _█
7.50e+01 _
1.00e+02 _
1.25e+02 _
1.50e+02 _
1.75e+02 _
2.00e+02 _
2.25e+02 _
2.50e+02 _
2.75e+02 _
3.00e+02 _
3.25e+02 _
3.50e+02 _
3.75e+02 _
4.00e+02 _
4.25e+02 _
4.50e+02 _
4.75e+02 _
5.00e+02 _
5.25e+02 _
5.50e+02 _
5.75e+02 _
6.00e+02 _
6.25e+02 _
6.50e+02 _
6.75e+02 _
7.00e+02 _
7.25e+02 _
7.50e+02 _
7.75e+02 _
8.00e+02 _
8.25e+02 _
8.50e+02 _
8.75e+02 _
9.00e+02 _
9.25e+02 _
9.50e+02 _
9.75e+02 _
1.00e+03 _real 182m44.441s
user 8m8.328s
sys 0m13.934s
```