python
module for fitting charge spectra of silicon photomultipliers
PeakOTron: A This repository contains the code for the analysis of silicon photomultiplier (SiPM) charge spectra, as described in "PeakOTron: A Python Module for Fitting Charge Spectra of Silicon Photomultipliers" by J. Rolph et. al. (preprint submitted to Nuclear Instruments and Methods A).
The code implements the detector response model (DRM) described in [1], adding the correct treatment of non-Gaussian pedestals as well as a correct treatment of afterpulses.
Recommended software stack
PeakOTron
is entirely python
-based. The required modules to run the program are:
- astropy (v3.0.2)
- iminuit (v2.17.0)
- joblib (v0.13.2)
- matplotlib (v3.1.3)
- numba (v0.45.1)
- numpy (v1.17.2)
- pandas (v1.1.3)
- scipy (v1.3.1)
We have included a requirements.txt
file in this repository that can be used to install the necessary packages in the current python
environment using pip
:
pip install -r requirements.txt
Alternatively, we have also tested the program using an anaconda
environment. We recommend using packages from the conda-forge
channel using the following command in the current anaconda
environment:
conda install -c conda-forge numba astropy iminuit joblib matplotlib numpy pandas scipy
Getting started
In order to get acquainted with the program, you can either take a look at the example.py
script, which takes a set of measured SiPM spectra (contained inside the data
directory), runs the fit iteratively over each of them and produces the resulting outputs: The plots of the fits as well as the dumped PeakOTron
objects as joblib
files in the Results
sub-directory and a csv
file which is created from a pandas.DataFrame
containing the results of the fit parameters and their respective errors for each spectrum.
We also provide a jupyter
notebook (Introduction.ipynb
) that shows the usage of the program as well as an extensive description of the additional input parameters that need to be set by the user for the fit to produce accurate results. In the notebook, it is also shown how to get plots for both the final fit results and the determination of the pre-fit initial values.
References
[1] V. Chmill et al., On the characterisation of SiPMs from pulse-height spectra, Nucl. Instrum. Methods Phys. Res. A 854 (2017) 70–81. doi:10.1016/j.nima.2017.02.049.