Skip to content

Python framework to measure differential cross-sections of particle physics processes using classical- and quantum-computing based unfolding techniques.

License

Notifications You must be signed in to change notification settings

JustWhit3/PyXSec

Repository files navigation

PyXSec

Table of contents

Introduction

PyXSec is a Python framework used to measure the differential cross-sections of particle physics processes using the unfolding technique. The peculiarity of this software is that you can perform this measurements using classical- and quantum-computing based techniques.

This software is currently based ROOT, but plans are work in progress to substitute it with NumPy and uproot.

For the moment the cross-sections can be measured using the following unfolding modules:

  • RooUnfold: for classical unfolding backend
  • QUnfold: for quantum-computing based backend

The idea at the base of this framework was inspired by the TTbarUnfold framework, developed by Marino Romano, which is widely used in particle physics analyses to measure cross-sections using classical unfolding techniques.

⚠️ The project is currently work-in-progress and it is still not ready for production. See the contribution file if interested.

⚠️ This project is not currently available on PyPI, but it will be very soon. Our idea is to let it be easily installable in order to keep analyses as clean as possible and doesn't require to clone the entire repository everytime for a new study.

Developer environment

To setup the environment for PyXSec development you need two dependencies:

To setup the conda conda environment to work with the repository (only the first time):

conda create --name pyxsec-dev python==3.10
conda activate pyxsec-dev
pip install -r requirements.txt
pip cache purge && pip check

and every time you open a new shell:

conda activate pyxsec-dev

How to use

The usage is very simple. You need an input XML configuration file with all the paths and the files needed for the measurement. An example is the following:

<configuration>
    <data       file="PWGH7.AFII.root"	hpath="reco/2j2b_emu/DR_b1b2" />                      <!-- Data -->
    <sig        file="AFII.root"	    hpath="reco/2j2b_emu/DR_b1b2" />                      <!-- Signal -->
    <bkg        file=""                 hpath="" />                                           <!-- Background -->
    <res	    file="AFII.root"        hpath="reco/2j2b_emu/particle_DR_b1b2_vs_DR_b1b2" />  <!-- Response matrix -->
    <gen        file="AFII.root"        hpath="particle/2j2b_emu/particle_DR_b1b2" />         <!-- Theory distributions -->
    <lumi       value="138965.16" />                                                          <!-- Luminosity -->
    <br         value="1"/>                                                                   <!-- Branching ratio -->
    <do_total   value="0" />                                                                  <!-- Do total xsec -->
    <unfolding  method="SimNeal"        regularization="0" statErr="toys:Gauss" ntoys="0" />  <!-- Unfolding settings -->
    <spectrum   particle="2j2b_emu"     variable="DR_b1b2" />                                 <!-- Particle-level info -->
</configuration>

each ROOT file must have reco and particle/parton level tress well separated. Each tree must contain branches for each interested selection and each branch must contain variables distributions to be unfolded and response matrices.

A quick example about how to use the framework:

python PyXSec.py --config="config.xml" --output="output.root"

⚠️ This usage is still not supported, but this should be the final form of the framework signature.

Credits

Main developers


Gianluca Bianco

Simone Gasperini

Other contributors


DrWatt

Stargazers over time

Stargazers over time

About

Python framework to measure differential cross-sections of particle physics processes using classical- and quantum-computing based unfolding techniques.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published