LegendSpecFits.jl

LegendSpecFits.jl is a Julia package for fitting spectra and calibrating the energy and pulse-shape parameters of high-purity germanium (HPGe) and silicon photomultiplier (SiPM) detectors of the LEGEND experiment. It is part of the LEGEND Julia analysis software and is called by the production dataflow (Juleana.jl) as well as in interactive analyses.

The package provides binned maximum-likelihood fits of gamma lines and other distributions, calibration curves and energy resolution curves, charge-trapping corrections, A/E and late-charge (LQ) pulse-shape cuts together with their survival fractions, energy filter optimization, and SiPM calibration. Most fit functions return their numerical results together with a report that LegendMakie.jl turns into figures.

Installation

LegendSpecFits.jl is registered in the LEGEND Julia registry. After adding the registry once, the package can be installed with the Julia package manager:

using Pkg
pkg"registry add General https://github.com/legend-exp/LegendJuliaRegistry.git"
Pkg.add("LegendSpecFits")

To work on the package itself, use Pkg.develop("LegendSpecFits").

Overview

The manual pages describe the concepts and the workflow of each part of the package:

The tutorials run complete analyses on synthetic data. The API page lists all documented functions and types.

  • LegendMakie.jl provides the plot recipes (lplot) that draw the reports returned by the fit functions.
  • LegendDataManagement.jl reads LEGEND data and metadata and evaluates the expression strings that the fit functions return (ljl_propfunc).
  • RadiationSpectra.jl provides the peak finder used for the first calibration.
  • BAT.jl provides the distribution transforms and the optimization interface behind the likelihood fits.
  • Juleana.jl is the production dataflow that applies the functions of this package to LEGEND data.