Hi,
I have prepared a GUI-based detector calibration application that can be used to calibrate ROOT based detector data, autodetect peaks using TSpectrum, Sliding window method or user provided ADC bins and provide calibration coefficients and calculates resoution for the given number of channels.
Kindly find the application here. And try to use and suggest your remarks and changes.
Detector Calibration GUI
A modern, user-friendly graphical interface for Detector Calibration, Resolution calculations and plotting with an auto peak detection feature and functional user override to assign ADC and Energy values.
Energy calibration tool for multi-channel detector systems.
Built with Python · PyROOT · PyQt5 · Matplotlib · SciPy
Key Features
-
Dual ROOT backend: PyROOT (native) or uproot (pure Python) — detected automatically.
-
Flexible data loading: TTree filter mode, array-branch mode, custom Draw() expressions, or pre-filled TH1 histograms.
-
Three peak detection algorithms: ROOT TSpectrum (standard and HighRes), Sliding Window, and SciPy fallback — all with optional Gaussian confirmation
-
Gaussian peak confirmation: Each detected candidate is verified by a Gaussian fit. Accepted peaks are centroid-refined; rejected peaks are shown as red × markers.
-
Peak propagation: Detect peaks on one reference channel and automatically search all other channels within a configurable ADC window.
-
Three calibration models: Linear, nonlinear scintillator, 3-point nonlinear variant, plus user-defined custom expressions.
-
Detect + Fit All: One-click workflow — detect, propagate, and fit all channels simultaneously in a background thread.
-
Calibrated spectrum viewer: Full-range energy spectra using session or file-loaded coefficients.
-
Energy resolution analysis: Interactive Gaussian fitting with multiple background models, FWHM extraction, and per-channel trend plots.
-
Rich output: Human-readable calibration log, compact coefficients table, and resolution results file.