Skip to content

Commit

Permalink
Use correct expression for (2 * sqrt(2 * log(2)))
Browse files Browse the repository at this point in the history
  • Loading branch information
theHenks committed Feb 25, 2025
1 parent fcdd598 commit 0da6776
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/sipm_simple_calibration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 0da6776

Please sign in to comment.