From 0da6776f4b984337cad35d2275a70a930cc78a56 Mon Sep 17 00:00:00 2001 From: Florian Henkes Date: Tue, 25 Feb 2025 19:50:09 +0100 Subject: [PATCH] Use correct expression for (2 * sqrt(2 * log(2))) --- src/sipm_simple_calibration.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sipm_simple_calibration.jl b/src/sipm_simple_calibration.jl index 2fcea5f4..1e6973b2 100644 --- a/src/sipm_simple_calibration.jl +++ b/src/sipm_simple_calibration.jl @@ -46,10 +46,10 @@ function sipm_simple_calibration(pe_uncal::Vector{<:Real}; bin_width_cut_scaled = bin_width_cut * bin_width_scale @debug "Using bin width: $(bin_width_cut_scaled)" h_uncal_cut = fit(Histogram, pe_uncal, bin_width_cut_min:bin_width_cut_scaled:initial_max_amp) - peakfinder_σ_scaled = if peakfinder_σ <= 0.0 - peakfinder_σ_scaled = round(Int, 2*(cuts_1pe.high - cuts_1pe.max) / bin_width_cut_scaled / 2 * sqrt(2 * log(2))) + peakfinder_σ_scaled::Int = if peakfinder_σ <= 0.0 + peakfinder_σ_scaled = round(Int, 2*(cuts_1pe.high - cuts_1pe.max) / bin_width_cut_scaled / (2 * sqrt(2 * log(2))) ) else - peakfinder_σ + rount(Int, peakfinder_σ) end @debug "Peakfinder σ: $(peakfinder_σ_scaled)" try @@ -76,7 +76,7 @@ function sipm_simple_calibration(pe_uncal::Vector{<:Real}; h_uncal_cut = fit(Histogram, pe_uncal, bin_width_cut_min:bin_width_cut_scaled:initial_max_amp) peakfinder_σ_scaled = if peakfinder_σ <= 0.0 - peakfinder_σ_scaled = round(Int, 2*(cuts_1pe.high - cuts_1pe.max) / bin_width_cut_scaled / 2 * sqrt(2 * log(2))) + peakfinder_σ_scaled = round(Int, 2*(cuts_1pe.high - cuts_1pe.max) / bin_width_cut_scaled / (2 * sqrt(2 * log(2))) ) else peakfinder_σ end