Skip to content

Some tutorial notebooks for fitting in Hight Energy Physics (alias particle physics).

Notifications You must be signed in to change notification settings

nikoladze/HEPFittingTutorial

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 

Repository files navigation

HEP Fitting Tutorial

Originally by Kilian Lieret

Jupyter notebooks preview is available here.

To run the tutorial, just click on:

Binder

Contents

  • Fitting basics: Minmize a cost function using scipy.optimize.minimize
  • Fitting polynomials to points using np.polyfit
  • Fitting arbitrary functions to points using scipy.optimize.curve_fit
  • Template fits using pyroofit
  • Histogram template fits using pyhf
  • Hypothesis tests with pyhf

Setup instructions

If you want to use what you learned in the tutorial on your projects later, here are some examples how you can setup the nescessary software:

Generic

If you don't have anything setup and need both ROOT and the python packages, the easiest way is through Anaconda or Miniconda. After installing, create your environment using

conda env create -f environment.yml

and activate it via

conda activate HEPFittingTutorial

On LMU jupyterhub (for Bachelor course 2022)

Most tutorials should run when you start jupyterhub with the root/6.24.02 environment.

Then you can install additional dependencies with

pip3 install --user pyroofit pyhf iminuit mplhep

For running the ROOT 6.26 RooFit example (optional) you can add the following line to ~/jupyterhub_environment.sh:

module load root/6.26.00

and then restart the jupyterhub server using the python/3.9-2021.11 environment

About

Some tutorial notebooks for fitting in Hight Energy Physics (alias particle physics).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published