Commit 23eda071 authored by Antonino D'Anna's avatar Antonino D'Anna

updated mpcac to follow clearer the conventions

parent 974063ed
...@@ -9,3 +9,4 @@ This file should not be merged into master, but only kept as a reference within ...@@ -9,3 +9,4 @@ This file should not be merged into master, but only kept as a reference within
- Updated documentation in juobs_tools.jl - Updated documentation in juobs_tools.jl
- Updated documentation in juobs_type.jl - Updated documentation in juobs_type.jl
- Dic 8 2024: added functions plat_av to the existing one. This change should not be code-breaking, since it only add different version of the exising one. Now it is possible to pass a Vector or a Matrix W containing the weight to use in the plateau average. If W is a Matrix, a correlated fit is perform. If W is not given, then the old function is called. - Dic 8 2024: added functions plat_av to the existing one. This change should not be code-breaking, since it only add different version of the exising one. Now it is possible to pass a Vector or a Matrix W containing the weight to use in the plateau average. If W is a Matrix, a correlated fit is perform. If W is not given, then the old function is called.
- Dic 10 2024: mpcac function now follow the convention more clearly. documentation updated juobs_tools
\ No newline at end of file
...@@ -162,9 +162,9 @@ end ...@@ -162,9 +162,9 @@ end
mpcac(a0p::Vector{Corr},pp::Vector{Corr},plat::Vector{Vector{Int64}}; kwargs...) mpcac(a0p::Vector{Corr},pp::Vector{Corr},plat::Vector{Vector{Int64}}; kwargs...)
Computes the bare PCAC mass for a given correlator `a0p` and `pp` at a given plateau `plat`. Computes the bare PCAC mass for a given correlator `a0p` and `pp` at a given plateau `plat`. See also [juobs/docs/On\_the\_convention.pdf]
Correlator can be passed as an `Corr` struct or `Vector{uwreal}`. Correlator can be passed as an `Corr` struct or `Vector{uwreal}`.
In case of Vector{Corr} it is better to not broadcast, especially in case of `data=true` or `pl=true`, since the the overloaded function for Vector{Corr} takes care of the extra outputs and organize them into a `Tuple` of Vector In case of Vector{Corr} it is better to not broadcast, especially in case of `data=true` or `pl=true`, since the overloaded function for Vector{Corr} takes care of the extra outputs and organize them into a `Tuple` of Vector
The return structure is: mpcac[,data][,figs,axs] The return structure is: mpcac[,data][,figs,axs]
...@@ -220,18 +220,15 @@ function mpcac(a0p::Vector{uwreal}, pp::Vector{uwreal}, plat::Vector{Int64}; ca: ...@@ -220,18 +220,15 @@ function mpcac(a0p::Vector{uwreal}, pp::Vector{uwreal}, plat::Vector{Int64}; ca:
wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}}, Nothing}=nothing, wpm::Union{Dict{Int64,Vector{Float64}},Dict{String,Vector{Float64}}, Nothing}=nothing,
savepl::Bool = false,filename::String="",plot_kw...) savepl::Bool = false,filename::String="",plot_kw...)
corr_a0p = -a0p[1:end]
corr_pp = pp[1:end]
if ca != 0.0 if ca != 0.0
der_a0p = (corr_a0p[3:end] .- corr_a0p[1:end-2]) / 2 der_a0p = (corr_a0p[3:end] .- corr_a0p[1:end-2]) / 2
der2_pp = (corr_pp[1:end-4] - 2*corr_pp[3:end-2] + corr_pp[5:end])/4 der2_pp = (corr_pp[1:end-4] - 2*corr_pp[3:end-2] + corr_pp[5:end])/4
der_a0p = der_a0p[2:end-1] + ca * der2_pp der_a0p = der_a0p[2:end-1] - ca * der2_pp
else else
der_a0p = (corr_a0p[4:end-1] .- corr_a0p[2:end-3]) / 2 der_a0p = (corr_a0p[4:end-1] .- corr_a0p[2:end-3]) / 2
end end
aux = der_a0p ./ ( 2. .* corr_pp[3:end-2]) aux = -der_a0p ./ ( 2. .* corr_pp[3:end-2]) # this minus sign come from the convention used: see docs/On_the_convention.pdf
mass = plat_av(aux, plat, wpm) mass = plat_av(aux, plat, wpm)
if pl|| savepl if pl|| savepl
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment