HPGe calibration

Peak splitting, DSP and quality cuts

JuLeAna.process_daq_energy_calibration_cal — Function
process_daq_energy_calibration_cal(processing_config, l200::LegendData, period::DataPeriod, run::DataRun;
    reprocess::Bool=false, timeout::Real=0)

Calibrate the DAQ online energy (daqenergy) of the HPGe detectors (geds) of a cal run.

For each detector, the daqenergy of the raw cal files of the run listed in the runinfo, except the filekeys marked unprocessable, is calibrated automatically with the Th-228 lines (th228_cal_lines) by autocal_energy. The result is a linear calibration c * daqenergy in keV, which process_peak_split_cal and process_peak_split_phy use to select the events of their peaks. When the calibration fails, the uncalibrated spectrum is plotted instead.

Inputs

  • raw tier of the cal filekeys of the run listed in the runinfo, except the filekeys marked unprocessable
  • dataprod_config(l200).raw(filekey), sections default and per detector

Outputs

  • l200.par.rpars.daqecal[period, run]: per detector the calibration constant c and the calibration function func, with a validity entry of category all for the run
  • plot :daq_energy for each calibrated detector, :daq_energy_failed for each detector whose calibration failed
  • run report :daq_energy_calibration_cal with one row per detector

Keywords

  • reprocess: discard the existing parameters and calibrate all detectors; otherwise a detector with parameters is skipped
  • timeout: seconds allowed per detector in parallel (0 = no limit)

Returns

Return nothing.

source
JuLeAna.process_peak_split_cal — Function
process_peak_split_cal(processing_config, l200::LegendData, period::DataPeriod, run::DataRun;
    reprocess::Bool=false, timeout::Real=0)

Extract the events in the Th-228 peaks from the raw cal data of the HPGe detectors (geds) of a run.

For each detector, the DAQ energy of the raw cal files of the run listed in the runinfo, except the filekeys marked unprocessable, is calibrated with the parameters of process_daq_energy_calibration_cal, and the events inside the energy windows given by peaks (for example Tl208FEP and Tl208SEP) are written with their raw waveforms. A detector without DAQ energy calibration fails. The processor throws an error if no file is found.

Inputs

  • raw tier of the cal filekeys of the run listed in the runinfo, except the filekeys marked unprocessable
  • l200.par.rpars.daqecal[period, run]: DAQ energy calibration function func per detector
  • dataprod_config(l200).raw(filekey), sections default and per detector, entry peaks

Outputs

  • jlpks tier file of the start filekey of the run for each detector, with one table per entry of peaks
  • run report :peak_split, with one row per detector (number of events per peak, time, allocations)

Keywords

  • reprocess: recreate the jlpks files; otherwise a detector with a readable jlpks file is skipped (an unreadable file is removed and recreated)
  • timeout: seconds allowed per detector in parallel (0 = no limit)
  • use_cache: write each output file to a local cache directory first and move it to its place when done; otherwise write it next to its final location (default: false)

Returns

Return nothing.

source
JuLeAna.process_peak_split_phy — Function
process_peak_split_phy(processing_config, l200::LegendData, period::DataPeriod, run::DataRun;
    reprocess::Bool=false, timeout::Real=0)

Extract the events in the peaks of the phy raw config, such as the K-40 and K-42 lines, from the raw phy data of the HPGe detectors (geds) of a run.

The same as process_peak_split_cal for the phy files of the run. The DAQ energy is calibrated with the parameters of process_daq_energy_calibration_cal of the cal data of the same run.

Inputs

  • raw tier of the phy filekeys of the run listed in the runinfo, except the filekeys marked unprocessable
  • l200.par.rpars.daqecal[period, run]: DAQ energy calibration function func per detector
  • dataprod_config(l200).raw(filekey) for the phy filekey, sections default and per detector, entry peaks

Outputs

  • jlpks tier file of the start phy filekey of the run for each detector, with one table per entry of peaks
  • run report :peak_split_phy, with one row per detector (number of events per peak, time, allocations)

Keywords

  • reprocess: recreate the jlpks files; otherwise a detector with a readable jlpks file is skipped (an unreadable file is removed and recreated)
  • timeout: seconds allowed per detector in parallel (0 = no limit)
  • use_cache: write each output file to a local cache directory first and move it to its place when done; otherwise write it next to its final location (default: false)

Returns

Return nothing.

source
JuLeAna.process_dsp_cal — Function
process_dsp_cal(processing_config, l200::LegendData, period::DataPeriod, run::DataRun;
    reprocess::Bool=false, timeout::Real=0,
    max_wvfs::Int=10000, use_partition_pars::Bool=true)

Run the DSP on the cal raw data of the HPGe detectors (geds) of a run.

For every raw cal file of the run, each detector is processed with its DSP configuration, its pole-zero decay time, and its energy and A/E filter optimization parameters. A detector is skipped and reported as failed if the decay time or the optimization parameters are missing, if its DSP configuration has no required_fltopt_selection or required_aoeopt_selection, if a parameter listed in required_fltopt (or required_aoeopt) is missing for a detector whose channel info row satisfies required_fltopt_selection (or required_aoeopt_selection), or if its DSP throws an error. The selections are strings of LegendDataManagement.ljl_propfunc expressions, e.g. "usability == :on && (low_aoe_status == :valid || low_aoe_status == :present)".

Inputs

  • raw tier of the cal filekeys of the run listed in the runinfo, except the filekeys marked unprocessable
  • dataprod_config(l200).dsp(filekey)
  • l200.par[pars_type, :pz], l200.par[pars_type, :fltopt] and l200.par[pars_type, :aoeopt], with pars_type being :ppars if use_partition_pars is true and :rpars otherwise
  • the QC evaluator from load_qc_evaluator(l200, filekey)

Outputs

  • jldsp tier file for each filekey, with one table per detector
  • run report :dsp_cal, with one row per filekey (number of processed detectors, failed detectors, time, allocations)

Keywords

  • reprocess: remove the existing jldsp files and process all detectors again; otherwise detectors already present in a file are skipped
  • timeout: seconds allowed per filekey in parallel (0 = no limit)
  • use_cache: write each output file to a local cache directory first and move it to its place when done; otherwise write it next to its final location (default: true)
  • max_wvfs: not used by this processor
  • use_partition_pars: read the decay time and optimization parameters from the partition-level parameters (:ppars) instead of the run-level parameters (:rpars)

Returns

Return nothing.

source
JuLeAna.process_dsp_phy — Function
process_dsp_phy(processing_config, l200::LegendData, period::DataPeriod, run::DataRun;
    reprocess::Bool=false, timeout::Real=0,
    max_wvfs::Int=10000, use_partition_pars::Bool=false)

Run the DSP on the phy raw data of a run for the additional detectors, PMTs, SiPMs (spms) and HPGe detectors (geds).

For every raw phy file of the run, the channel groups are processed in this order: the detectors listed under additional_detectors in the DSP configuration, the PMTs, the SiPMs (with their per-detector thresholds), and the HPGe detectors (with their pole-zero decay time and energy and A/E filter optimization parameters). A SiPM or HPGe detector is skipped and reported as failed if its parameters are missing, or if its DSP throws an error. An HPGe detector is also skipped if its DSP configuration has no required_fltopt_selection or required_aoeopt_selection, or if a parameter listed in required_fltopt (or required_aoeopt) is missing for a detector whose channel info row satisfies required_fltopt_selection (or required_aoeopt_selection). The selections are strings of LegendDataManagement.ljl_propfunc expressions, e.g. "usability == :on && (low_aoe_status == :valid || low_aoe_status == :present)".

Inputs

  • raw tier of the phy filekeys of the run listed in the runinfo, except the filekeys marked unprocessable
  • dataprod_config(l200).dsp(filekey), dataprod_config(l200).sipm(filekey) and dataprod_config(l200).pmt(filekey)
  • l200.par[pars_type, :pz], l200.par[pars_type, :fltopt], l200.par[pars_type, :aoeopt] and l200.par[pars_type, :sipmopt], with pars_type being :ppars if use_partition_pars is true and :rpars otherwise
  • the QC evaluator from load_qc_evaluator(l200, filekey)

Outputs

  • jldsp tier file for each filekey, with one table per detector
  • run report :dsp_phy, with one row per filekey (number of processed detectors, failed detectors, time, allocations)

Keywords

  • reprocess: remove the existing jldsp files and process all detectors again; otherwise detectors already present in a file are skipped
  • timeout: seconds allowed per filekey in parallel (0 = no limit)
  • use_cache: write each output file to a local cache directory first and move it to its place when done; otherwise write it next to its final location (default: true)
  • max_wvfs: not used by this processor
  • use_partition_pars: read the HPGe decay time and optimization parameters from the partition-level parameters (:ppars) instead of the run-level parameters (:rpars)

Returns

Return nothing.

source
JuLeAna.process_dsp_aux_phy — Function
process_dsp_aux_phy(processing_config, l200::LegendData, period::DataPeriod, run::DataRun;
    reprocess::Bool=false, timeout::Real=0)

Run the DSP and the calibration for the auxiliary detectors (for example the pulser) of the phy data of a run.

The auxiliary detectors are the channels selected by get_aux_evt_detsel_propfunc. For each of them, the raw data of the phy filekeys of the run listed in the runinfo are read together and processed with the function configured for it under additional_detectors in the DSP configuration. The result is then extended by the auxiliary calibration property function. A cross-check histogram of the energy named in the cal.aux_trig condition of the event configuration is saved, with the trigger threshold marked.

Inputs

  • raw tier of the phy filekeys of the run listed in the runinfo, except the filekeys marked unprocessable
  • dataprod_config(l200).dsp(filekey), section additional_detectors
  • dataprod_config(l200).evt(filekey), section aux
  • the auxiliary calibration from get_aux_cal_propfunc(l200, filekey, det)

Outputs

  • jlaux tier file for each auxiliary detector, with the DSP and calibrated columns
  • plot :dsp_aux_energy for each auxiliary detector (debug plot level)
  • run report :dsp_aux_phy, with one row per detector (status, number of events)

Keywords

  • reprocess: process detectors again whose jlaux file exists; otherwise a detector with a readable jlaux file is skipped
  • timeout: seconds allowed per auxiliary detector in parallel (0 = no limit)
  • use_cache: write each output file to a local cache directory first and move it to its place when done; otherwise write it next to its final location (default: true)

Returns

Return nothing.

source
JuLeAna.process_qcs_cal — Function
process_qcs_cal(processing_config, l200::LegendData, period::DataPeriod, run::DataRun;
    reprocess::Bool=false, timeout::Real=0)

Generate the quality-cut (QC) flags and their survival fractions for the cal data of the HPGe detectors (geds) of a run.

For each detector, the QC labels and the is_single_pulse flag defined in the QC configuration are evaluated on the jldsp data. Pulser events are flagged by coincidence of the event timestamps with the timestamps of the pulser channel (pulser.puls_detector) in the raw data. The survival fraction of each flag is computed for the pulser events and for the Tl-208 full-energy peak, which is located with a simple Th-228 calibration of the non-pulser events. A detector with fewer than 5000 events fails. A warning is logged if single-pulse events fail the is_valid_e flag.

Inputs

  • jldsp tier of the cal filekeys of the run listed in the runinfo, except the filekeys marked bad
  • raw tier timestamps of the pulser channel
  • dataprod_config(l200).qc(filekey) and dataprod_config(l200).energy(filekey)
  • l200.par.rpars.qcs[period, run] (existing parameters, unless reprocess is true)

Outputs

  • jlqcs tier file for each detector, with the QC flags and the pulser flag
  • l200.par.rpars.qcs[period, run] (flag definition, survival fractions, event counts) with its validity (category cal)
  • plots :raw_energy_e_trap and :qc_survival_fractions for each detector; :qc_survival_fractions is saved only at the debug plot level
  • run report :qcs_cal, with one row per detector

Keywords

  • reprocess: discard the existing parameters and process all detectors; otherwise a detector with complete parameters and an existing jlqcs file is skipped
  • timeout: seconds allowed per detector in parallel (0 = no limit)
  • use_cache: write each output file to a local cache directory first and move it to its place when done; otherwise write it next to its final location (default: true)

Returns

Return nothing.

source
JuLeAna.process_qcs_phy — Function
process_qcs_phy(processing_config, l200::LegendData, period::DataPeriod, run::DataRun;
    reprocess::Bool=false, timeout::Real=0)

Generate the quality-cut (QC) flags and their survival fractions for the phy data of the HPGe detectors (geds) of a run.

For each detector, the QC labels and the is_single_pulse and is_empty_trace flags defined in the QC configuration are evaluated on the jldsp data. Pulser events and forced-trigger events (without pulser events) are taken from the aux_trig flags of the pulser channel (pulser.puls_detector) and of the forced-trigger channel (forced_trigger.detector). The survival fraction of each flag is computed for the pulser events and for the forced-trigger events. A detector with fewer than 5000 events fails. A warning is logged if single-pulse events fail the is_valid_dsp flag.

Inputs

  • jldsp tier of the phy filekeys of the run listed in the runinfo, except the filekeys marked unprocessable
  • jlaux tier column aux_trig of the pulser and forced-trigger channels
  • dataprod_config(l200).qc(filekey)
  • l200.par.rpars.qcs[period, Symbol("<run>-phy")] (existing parameters, unless reprocess is true)

Outputs

  • jlqcs tier file for each detector, with the QC flags and the pulser flag
  • l200.par.rpars.qcs[period, Symbol("<run>-phy")] (flag definition, survival fractions, event counts) with its validity (category phy)
  • plots :qc_survival_fractions and :qc_survival_fractions_forced_trigger for each detector; :qc_survival_fractions_forced_trigger is saved only at the debug plot level
  • run report :qcs_phy, with one row per detector

Keywords

  • reprocess: discard the existing parameters and process all detectors; otherwise a detector with complete parameters and an existing jlqcs file is skipped
  • timeout: seconds allowed per detector in parallel (0 = no limit)
  • use_cache: write each output file to a local cache directory first and move it to its place when done; otherwise write it next to its final location (default: true)

Returns

Return nothing.

source

Decay time and filter optimization

JuLeAna.process_decay_time_cal — Function
process_decay_time_cal(processing_config, l200::LegendData, period::DataPeriod, run::DataRun;
    reprocess::Bool=false, timeout::Real=0)

Determine the preamplifier decay time of the HPGe detectors (geds) from the cal data of a run.

For each detector, the presummed waveforms of the peak named by peakname in the pz section of the DSP configuration are read from the jlpks tier. If there are more than max_wvfs waveforms, max_wvfs of them are selected at random, without repetition and in their original order. Waveforms that fail the QC condition qc are removed. The decay time of each remaining waveform is computed, and a truncated Gaussian is fitted to the values between min_tau and max_tau; its mean is the decay time. A detector gets warning status if the decay time is outside 350 to 700 µs. A detector fails if its jlpks file is missing or if loading, QC, DSP or the fit throws an error.

Inputs

  • jlpks tier of the start filekey of the run, entry peakname
  • dataprod_config(l200).dsp(filekey), sections default, per detector, and pz (min_tau, max_tau, nbins, rel_cut_fit, peakname, qc, max_wvfs)
  • the QC evaluator from load_qc_evaluator(l200, filekey)
  • l200.par.rpars.pz[period, run] (existing parameters, unless reprocess is true)

Outputs

  • l200.par.rpars.pz[period, run] with the decay time τ and the fit result of each detector, with its validity
  • plot :decay_time for each detector (debug plot level)
  • If error_plots is on, a failed decay time extraction saves error_decay_time_extraction.
  • run report :decay_time, with one row per detector (decay time, width)

Keywords

  • reprocess: discard the existing parameters and process all detectors; otherwise detectors that already have parameters are skipped
  • timeout: seconds allowed per detector in parallel (0 = no limit)

Returns

Return nothing.

source
JuLeAna.p_process_decay_time_cal — Function
p_process_decay_time_cal(processing_config, l200::LegendData, period::DataPeriod;
    reprocess::Bool=false, timeout::Real=0, only_first_period::Bool=true) -> Bool

Determine the preamplifier decay time of the HPGe detectors (geds) for every cal partition that contains period.

For each detector and partition, the presummed waveforms of the peak named by peakname in the pz section of the DSP configuration are read from the jlpks tier of the runs of the partition, n_evts events per run. If there are more than max_wvfs waveforms in total, max_wvfs of them are selected at random, without repetition and in their original order. Waveforms that fail the QC condition qc are removed. The decay time of each remaining waveform is computed, and a truncated Gaussian is fitted to the values between min_tau and max_tau; its mean is the decay time. An entry gets warning status if the decay time is outside 350 to 700 µs. An entry fails if loading, QC, DSP or the fit throws an error.

Inputs

  • jlpks tier of all runs of each partition, entry peakname
  • dataprod_config(l200).dsp(filekey), sections default, per detector, and pz (p_default, p)
  • the QC evaluator from load_qc_evaluator(l200, filekey)
  • l200.par.ppars.pz[det, part] (existing parameters, unless reprocess is true)

Outputs

  • l200.par.ppars.pz[det, part] with the decay time τ and the fit result, for each detector and partition, and the validity of all partitions
  • plot :decay_time for each detector and partition (debug plot level)
  • If error_plots is on, a failed decay time extraction saves error_decay_time_extraction.
  • partition report :decay_time, with one row per detector and partition

Keywords

  • reprocess: discard the existing parameters and process all entries again; otherwise entries that already have parameters are skipped
  • timeout: seconds allowed per detector and partition in parallel (0 = no limit)
  • only_first_period: skip a detector whose partition starts in an earlier period than period; it is then processed with that period. run_processing sets this to true when the previous period is also being processed.

Returns

true if at least one detector was skipped because of only_first_period, false otherwise. run_processing then waits for this step in the previous period.

source
JuLeAna.process_filter_optimization_cal — Function
process_filter_optimization_cal(processing_config, l200::LegendData, period::DataPeriod, run::DataRun;
    reprocess::Bool=false, timeout::Real=0)

Optimize the energy filter rise time and flat-top time for all processable HPGe detectors (geds) of the cal run.

For each filter type listed under e_filter in the optimization config, the rise time is chosen first from a sweep over the baseline noise (minimal ENC at a fixed flat-top time). The flat-top time is then chosen from a sweep over the full-energy-peak events as the one with the smallest FWHM. Waveforms of the peak named by peakname are taken from the jlpks tier. Quality cuts (qc expression of the optimization config) are applied to the waveforms before the sweeps, and at most max_wvfs waveforms are used. Filter types that already have results are skipped unless reprocess is set.

Inputs

  • jlpks tier of the start cal filekey of the run, for each detector (peak waveforms named by peakname).
  • dataprod_config(l200).dsp(filekey), in particular the flt_optimization section (default and per-detector entries) and the DSP config used for the filter grids.
  • l200.par.rpars.pz[period, run] (decay times).
  • Quality-cut evaluator loaded by load_qc_evaluator(l200, filekey).
  • l200.par.rpars.fltopt[period, run] (existing results, unless reprocess is set).

Outputs

  • l200.par.rpars.fltopt[period, run]: per detector and filter type the optimal rise time, flat-top time and minimal FWHM, together with the validity entry for the run.
  • Per detector and filter type, plots noise_sweep_<filter_type> and fwhm_ft_scan_<filter_type>, saved only at the debug plot level.
  • Run report :filter_optimization (Main Log, Metadata, Results table with one row per detector and filter type).

Keywords

  • reprocess: redo all detectors and filter types, discarding existing results in l200.par.rpars.fltopt[period, run]. If false, only filter types without results are processed.
  • timeout: seconds allowed per detector in parallel (0 = no limit).

Returns

nothing.

source
JuLeAna.p_process_filter_optimization_cal — Function
p_process_filter_optimization_cal(processing_config, l200::LegendData, period::DataPeriod;
    reprocess::Bool=false, timeout::Real=0, only_first_period::Bool=true)

Optimize the energy filter rise time and flat-top time per detector and cal partition for all partitions that contain period, using all analysis runs of the partition (HPGe detectors geds).

The method is the same as in process_filter_optimization_cal: for each filter type listed under e_filter, the rise time is chosen from a baseline noise sweep and the flat-top time from a sweep over full-energy-peak events. The waveforms of the peak named by peakname are read from the jlpks tier of all runs of the partition (n_evts events per run, drawn randomly if select_random is set) and at most max_wvfs of them are used after the quality cuts (qc expression).

Inputs

  • jlpks tier of the cal runs of each partition, for each detector.
  • dataprod_config(l200).dsp(filekey), in particular flt_optimization.p_default and the per-detector entries flt_optimization.p, and the DSP config used for the filter grids.
  • l200.par.ppars.pz[det, part] (decay times).
  • Quality-cut evaluator loaded by load_qc_evaluator(l200, filekey).
  • l200.par.ppars.fltopt[det, part] (existing results, if present).

Outputs

  • l200.par.ppars.fltopt[det, part]: per filter type the optimal rise time, flat-top time and minimal FWHM, with validity entries for the partition; the validity of all partitions of the period is written to l200.par.ppars.fltopt.
  • Per detector, partition and filter type, plots noise_sweep_<filter_type> and fwhm_ft_scan_<filter_type>, saved only at the debug plot level.
  • Partition report :filter_optimization (Main Log, Metadata, Results table with one row per detector, partition and filter type).

Keywords

  • reprocess: redo all filter types, ignoring results in l200.par.ppars.fltopt[det, part]. If false, only filter types without results are processed.
  • timeout: seconds allowed per detector and partition in parallel (0 = no limit).
  • only_first_period: if true, a detector whose partition starts in an earlier period is skipped (it is processed with that earlier period). run_processing sets this to true when the previous period is also being processed.

Returns

true if at least one detector and partition was skipped because of only_first_period, otherwise false. run_processing uses this to wait for the same step in the previous period.

source

Energy calibration

JuLeAna.process_ct_correction_cal — Function
process_ct_correction_cal(processing_config, l200::LegendData, period::DataPeriod, run::DataRun;
    reprocess::Bool=false, timeout::Real=0)

Determine the charge-trapping correction for all processable HPGe detectors (geds) of the cal run.

For each energy type in energy_types of the ctc section of the energy config, the energy is calibrated with a simple Th-228 calibration, and the correction parameters (polynomial in qdrift of order ctc_order) are optimized on the peak peak within the window (left_window_size, right_window_size). The FWHM of the peak before and after the correction is reported. Only single-pulse, non-pulser events passing the quality cuts are used.

Inputs

  • jlqcs tier of the start cal filekey (event mask is_single_pulse && !is_pulser) and jldsp tier of the cal run (energy types and qdrift), for each detector. A missing jlqcs file counts as a failure of that detector.
  • dataprod_config(l200).energy(filekey) (default, ctc.default and per-detector entries).
  • l200.par.rpars.ctc[period, run] (existing results, unless reprocess is set).

Outputs

  • l200.par.rpars.ctc[period, run]: per detector and energy type the correction result (including fct, fwhm_before, fwhm_after), together with the validity entry for the run.
  • Per detector and energy type, plots simple_calibration_<e_type> and ctc_<e_type>, saved only at the debug plot level.
  • If error_plots is on, a failed simple calibration saves error_simple_calibration_<e_type> and a failed alpha generation error_alpha_generation_<e_type>.
  • Run report :ct_correction (Main Log, Metadata, Results table with one row per detector and energy type).

Keywords

  • reprocess: redo all detectors and energy types, discarding existing results in l200.par.rpars.ctc[period, run]. If false, only energy types without results are processed.
  • timeout: seconds allowed per detector in parallel (0 = no limit).

Returns

nothing.

source
JuLeAna.process_energy_calibration_cal — Function
process_energy_calibration_cal(processing_config, l200::LegendData, period::DataPeriod, run::DataRun;
    reprocess::Bool=false, timeout::Real=0)

Calibrate the energy of all processable HPGe detectors (geds) of the cal run with the Th-228 spectrum.

For each energy type in energy_types of the energy config, the uncalibrated energies of single-pulse, non-pulser events passing the quality cuts are calibrated in three steps: a simple calibration locates the Th-228 peaks, the peaks are fitted with the functions in th228_fit_func, and a polynomial calibration curve (cal_pol_order) and a FWHM curve (fwhm_pol_order for energy types ending in _ctc, otherwise a quadratic FWHM² model) are fitted to the peaks that pass the fit quality cuts in qc. Peaks in cal_fit_excluded_peaks and fwhm_fit_excluded_peaks are left out of the respective fit. Energy types ending in _ctc use the charge-trapping-corrected energy expression from the CT correction results.

Inputs

  • jlqcs tier of the start cal filekey (event mask is_single_pulse && !is_pulser) and jldsp tier of the cal run, for each detector.
  • dataprod_config(l200).energy(filekey) (default and per-detector entries).
  • l200.par.rpars.ctc[period, run] (needed for _ctc energy types).
  • l200.par.rpars.ecal[period, run] (existing results, unless reprocess is set).

Outputs

  • l200.par.rpars.ecal[period, run]: per detector and energy type the simple calibration constant (m_cal_simple), FWHM curve (fwhm), calibration curve (cal) and calibrated peak fit results (fit), together with the validity entry for the run.
  • Per detector and energy type, plots simple_calibration_<e_type>, peak_fits_<e_type>, calibration_curve_<e_type> and fwhm_<e_type>. simple_calibration_<e_type> and peak_fits_<e_type> are saved only at the debug plot level.
  • Run report :energy_calibration (Main Log, Metadata, Results table with one row per detector and energy type).

Keywords

  • reprocess: redo all detectors and energy types, discarding existing results in l200.par.rpars.ecal[period, run]. If false, only energy types without results are processed.
  • timeout: seconds allowed per detector in parallel (0 = no limit).

Returns

nothing.

source
JuLeAna.p_process_energy_cal — Function
p_process_energy_cal(processing_config, l200::LegendData, period::DataPeriod;
    reprocess::Bool=false, timeout::Real=0, only_first_period::Bool=true)

Calibrate the energy per detector and cal partition for all partitions that contain period (HPGe detectors geds).

For each energy type in energy_types of the partition energy config, the energies of all runs of the partition are calibrated with the run-level calibration function (cal.func from l200.par.rpars.ecal) and concatenated, after selecting single-pulse, non-pulser events that pass the quality cuts. The Th-228 peaks in the resulting spectrum are fitted with the functions in th228_fit_func, then a polynomial calibration curve (cal_pol_order) and a FWHM curve (fwhm_pol_order for energy types ending in _ctc, otherwise a quadratic FWHM² model) are fitted to the peaks that pass the fit quality cuts in qc. Peaks in cal_fit_excluded_peaks and fwhm_fit_excluded_peaks are left out of the respective fit.

Inputs

  • jlqcs and jldsp tiers of all cal runs of each partition, for each detector.
  • l200.par.rpars.ecal[period, run] (run-level calibration function) for each run of the partition.
  • dataprod_config(l200).energy(filekey), sections p_default and per-detector entries p.
  • l200.par.ppars.ecal[det, part] (existing results, unless reprocess is set).

Outputs

  • l200.par.ppars.ecal[det, part]: per energy type the FWHM curve (fwhm), calibration curve (cal) and peak fit results (fit), with validity entries for the partition; the validity of all partitions of the period is written to l200.par.ppars.ecal.
  • Per detector, partition and energy type, plots partition_spectrum_<e_type>, peak_fits_<e_type>, calibration_curve_<e_type> and fwhm_<e_type>. peak_fits_<e_type> is saved only at the debug plot level.
  • If error_plots is on, a failed peak fitting saves error_peak_fitting_<e_type>.
  • Partition report :energy (Main Log, Metadata, Results table with one row per detector, partition and energy type).

Keywords

  • reprocess: redo all energy types, ignoring results in l200.par.ppars.ecal[det, part]. If false, only energy types without results are processed.
  • timeout: seconds allowed per detector and partition in parallel (0 = no limit).
  • only_first_period: if true, a detector whose partition starts in an earlier period is skipped (it is processed with that earlier period). run_processing sets this to true when the previous period is also being processed.

Returns

true if at least one detector and partition was skipped because of only_first_period, otherwise false. run_processing uses this to wait for the same step in the previous period.

source