Skip to content

Files

Latest commit

ee94104 · Mar 26, 2023

History

History

python

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Apr 4, 2022
Apr 4, 2022
Apr 4, 2022
Aug 2, 2022
Mar 22, 2023
Apr 7, 2022
Mar 23, 2023
Apr 4, 2022
Nov 26, 2022
Jan 11, 2023
Apr 4, 2022
May 17, 2022
Jul 7, 2022
Nov 15, 2022
May 9, 2022
May 11, 2022
Jul 7, 2022
May 11, 2022
May 6, 2022
Apr 4, 2022
May 23, 2022
Nov 15, 2022
Nov 15, 2022
May 24, 2022
Nov 15, 2022
Sep 19, 2022
Apr 4, 2022
Mar 26, 2023
Nov 15, 2022
Apr 11, 2022
Aug 17, 2022

Python loopers

The file loop_with_core.py shows how to loop over events and use NanoCORE This only requires CMSSW. Additional Python usage can be found in the unit tests.

For trendier folk, a conda environment is the recommended way to get the latest/greatest Python packages.

Python Plotting Scripts

The sripts stack_plots.py and compare_plots.py are used for stacking and comparing histograms from different root files, respectively. These scripts are executed via the commands:

python stack_plots.py
python compare_plots.py

Conda environment

You only have to do the initial setup once. Afterwards, you only need to activate the environment.

Initial setup

Install after a fresh login to the computers (to prevent CMSSW interference).

# download conda installer
curl -O -L https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh -b 

# add conda to the end of ~/.bashrc, so relogin after executing this line
~/miniconda3/bin/conda init

# stop conda from activating the base environment on login
conda config --set auto_activate_base false
conda config --add channels conda-forge

# install package to tarball environments
conda install --name base conda-pack -y

# create environments with as much stuff from anaconda
conda create --name pyrootenv uproot pandas root matplotlib jupyter

# and then any install residual packages with pip
conda run --name pyrootenv pip install yahist

Activate and use

conda activate pyrootenv
python read_with_uproot.py