Skip to content

Commit

Permalink
Merge pull request #119 from legend-exp/deprecate
Browse files Browse the repository at this point in the history
Avoid deprecated methods
  • Loading branch information
theHenks authored Feb 25, 2025
2 parents 9e1f713 + bb6cc79 commit 10e8e19
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/aoe_cut.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ Get the survival fraction after a AoE cut value `aoe_cut` for a given `peak` and
"""
function get_sf_after_aoe_cut(aoe_cut::Unitful.RealOrRealQuantity, aoe::Vector{<:Unitful.RealOrRealQuantity}, e::Vector{<:T}, peak::T, window::Vector{T}, bin_width::T, result_before::NamedTuple; uncertainty::Bool=true, fit_func::Symbol=:gamma_def) where T<:Unitful.Energy{<:Real}
# get energy after cut and create histogram
survived = fit(Histogram, ustrip.(e[aoe .>= aoe_cut]), ustrip(peak-first(window):bin_width:peak+last(window)))
cut = fit(Histogram, ustrip.(e[aoe .< aoe_cut]), ustrip(peak-first(window):bin_width:peak+last(window)))
survived = fit(Histogram, ustrip.(e[aoe .>= aoe_cut]), ustrip.(peak-first(window):bin_width:peak+last(window)))
cut = fit(Histogram, ustrip.(e[aoe .< aoe_cut]), ustrip.(peak-first(window):bin_width:peak+last(window)))
# fit peak and return number of signal counts
result, _ = fit_subpeaks_th228(survived, cut, result_before; uncertainty=uncertainty, fit_func=fit_func)
return result.sf
Expand Down
4 changes: 2 additions & 2 deletions src/aoefit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function generate_aoe_compton_bands(aoe::Vector{<:Real}, e::Vector{<:T}, compton
simple_pars_aoe_μ = simple_fit_aoe_μ.param
simple_pars_error_aoe_μ = zeros(length(simple_pars_aoe_μ))
try
simple_pars_error_aoe_μ = standard_errors(simple_fit_aoe_μ)
simple_pars_error_aoe_μ = stderror(simple_fit_aoe_μ)
catch e
@warn "Error calculating standard errors for simple fitted μ: $e"
end
Expand All @@ -67,7 +67,7 @@ function generate_aoe_compton_bands(aoe::Vector{<:Real}, e::Vector{<:T}, compton
simple_pars_aoe_σ = simple_fit_aoe_σ.param
simple_pars_error_aoe_σ = zeros(length(simple_pars_aoe_σ))
try
simple_pars_error_aoe_σ = standard_errors(simple_fit_aoe_σ)
simple_pars_error_aoe_σ = stderror(simple_fit_aoe_σ)
catch e
@warn "Error calculating standard errors for simple fitted σ: $e"
end
Expand Down

0 comments on commit 10e8e19

Please sign in to comment.