Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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
```