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:
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.
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
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"
Gianluca Bianco |
Simone Gasperini |
DrWatt |