Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
juobs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Javier Ugarrio
juobs
Commits
3e20520f
Commit
3e20520f
authored
Nov 17, 2020
by
Alessandro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
final updates. Only relevant modification: fit_routine
parent
3475958a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
46 additions
and
5 deletions
+46
-5
constants/juobs_const.jl
constants/juobs_const.jl
+7
-0
gevp tools/tools.jl
gevp tools/tools.jl
+20
-4
src/juobs_obs.jl
src/juobs_obs.jl
+1
-1
src/juobs_tools.jl
src/juobs_tools.jl
+18
-0
No files found.
constants/juobs_const.jl
View file @
3e20520f
...
...
@@ -9,6 +9,9 @@ const ZM_data = [1.9684, 1.9935, 2.0253, 2.0630, 2.0814]
const
ZM_error
=
[
35
,
27
,
33
,
38
,
45
]
.*
1e-4
const
ZM_tm_data
=
[
2.6047
,
2.6181
,
2.6312
,
2.6339
,
2.6127
]
const
ZM_tm_error
=
[
42
,
33
,
42
,
48
,
55
]
.*
1e-4
# 1808.09236
const
ZA_data
=
[
0.75642
,
0.76169
,
0.76979
,
0.78378
,
0.79667
]
const
ZA_err
=
[
72
,
93
,
43
,
47
,
47
]
.*
1e-5
#1608.08900
const
b_values2
=
[
3.40
,
3.46
,
3.55
,
3.70
]
const
t0_data
=
[
2.86
,
3.659
,
5.164
,
8.595
]
...
...
@@ -21,11 +24,13 @@ const C1 = zeros(5, 5)
const
C2
=
zeros
(
5
,
5
)
const
C3
=
zeros
(
4
,
4
)
const
C4
=
zeros
(
6
,
6
)
const
C5
=
zeros
(
5
,
5
)
for
i
=
1
:
6
C4
[
i
,
i
]
=
M_error
[
i
]
^
2
if
i
<=
5
C1
[
i
,
i
]
=
ZM_error
[
i
]
^
2
C2
[
i
,
i
]
=
ZM_tm_error
[
i
]
^
2
C5
[
i
,
i
]
=
ZA_err
[
i
]
^
2
if
i
<=
4
C3
[
i
,
i
]
=
t0_error
[
i
]
^
2
end
...
...
@@ -38,8 +43,10 @@ const t0_ = cobs(t0_data, C3, "t0")
const
t0_ph
=
cobs
(
t0_ph_value
,
t0_ph_error
.^
2
,
"sqrt(8 t0) (fm)"
)
const
a_
=
t0_ph
./
sqrt
.
(
8
.*
t0_
)
const
M
=
cobs
(
M_values
,
C4
,
"charmed meson masses"
)
const
Za
=
cobs
(
ZA_data
,
C5
,
"ZA"
)
zm
(
beta
::
Float64
)
=
ZM
[
b_values
.==
beta
][
1
]
zm_tm
(
beta
::
Float64
)
=
ZM_tm
[
b_values
.==
beta
][
1
]
t0
(
beta
::
Float64
)
=
t0_
[
b_values2
.==
beta
][
1
]
a
(
beta
::
Float64
)
=
a_
[
b_values2
.==
beta
][
1
]
za
(
beta
::
Float64
)
=
Za
[
b_values
.==
beta
][
1
]
\ No newline at end of file
gevp tools/tools.jl
View file @
3e20520f
...
...
@@ -201,10 +201,19 @@ function pseudo_mat_elem(evec::Array{Array{T,2} where T,1}, mass::uwreal, mu::Ar
aux
=
sqrt
(
2
)
*
sum
(
mu
)
/
mass
^
1.5
return
uwdot
(
aux
,
Rn
)
end
function
vec_mat_elem
(
evec
::
Array
{
Array
{
T
,
2
}
where
T
,
1
},
mass
::
uwreal
)
Rn
=
[
exp
(
mass
*
t
/
2
)
*
evec
[
t
][
1
]
for
t
=
1
:
length
(
evec
)]
return
uwdot
(
Rn
,
1
/
mass
)
function
vec_mat_elem
(
evec
::
Array
{
Array
{
T
,
2
}
where
T
,
1
},
mass
::
uwreal
,
deg
::
Bool
)
if
!
deg
Rn
=
[
exp
(
mass
*
t
/
2
)
*
evec
[
t
][
1
]
for
t
=
1
:
length
(
evec
)]
return
uwdot
(
Rn
,
za
(
beta
[
iens
])
*
sqrt
(
2
/
mass
))
else
Rn
=
[
exp
(
mass
*
t
/
2
)
*
evec
[
t
][
4
]
for
t
=
1
:
length
(
evec
)]
println
(
za
(
beta
[
iens
]))
println
(
mass
)
return
uwdot
(
Rn
,
za
(
beta
[
iens
])
*
sqrt
(
2
/
mass
))
#return uwdot(Rn , 1/mass)# * sqrt(2/ mass))
end
end
function
extract_dec_const
(
mat_elem
::
uwreal
,
mass
::
uwreal
,
mu
::
Array
{
Float64
})
return
sqrt
(
2
)
*
sum
(
mu
)
*
mat_elem
/
mass
^
1.5
end
...
...
@@ -221,4 +230,11 @@ function match_muc(muh, m_lh, m_sh, m_lh_star, m_sh_star, target)
par
,
chi2exp
=
lin_fit
(
muh
,
M
)
muh_target
=
x_lin_fit
(
par
,
target
)
return
muh_target
end
\ No newline at end of file
end
function
match_muc_flav
(
muh
,
m_lh
,
m_sh
,
target
)
M
=
(
2
/
3
.*
m_lh
.+
1
/
3
*
m_sh
)
#M = m_lh
par
,
chi2exp
=
lin_fit
(
muh
,
M
)
muh_target
=
x_lin_fit
(
par
,
target
)
return
muh_target
end
src/juobs_obs.jl
View file @
3e20520f
...
...
@@ -14,7 +14,7 @@ corr_pp = corr_obs.(data)
m = meff(corr_pp[1], [50, 60], pl=false)
```
"""
function
meff
(
corr
::
Vector
{
uwreal
},
plat
::
Vector
{
Int64
};
pl
::
Bool
=
true
,
data
::
Bool
=
false
)
function
meff
(
corr
::
Vector
{
uwreal
},
plat
::
Vector
{
Int64
};
pl
::
Bool
=
true
,
data
::
Bool
=
false
)
dim
=
length
(
corr
)
aux
=
0.5
.*
log
.
((
corr
[
2
:
dim
-
2
]
./
corr
[
3
:
dim
-
1
])
.^
2
)
mass
=
plat_av
(
aux
,
plat
)
...
...
src/juobs_tools.jl
View file @
3e20520f
...
...
@@ -169,8 +169,26 @@ function fit_routine(model::Function, ydata::Array{uwreal}, param::Int64=3; wpm:
println
(
"Chisq / chiexp: "
,
chisq
(
coef
(
fit
),
ydata
),
" / "
,
chi_exp
,
" (dof: "
,
dof
(
fit
),
")"
)
return
upar
end
function
fit_routine
(
model
::
Function
,
xdata
::
Array
{
<:
Real
},
ydata
::
Array
{
uwreal
},
param
::
Int64
=
3
;
wpm
::
Union
{
Dict
{
Int64
,
Vector
{
Float64
}},
Dict
{
String
,
Vector
{
Float64
}},
Nothing
}
=
nothing
)
yval
=
value
.
(
ydata
)
yer
=
err
.
(
ydata
)
chisq
=
gen_chisq
(
model
,
xdata
,
yer
)
fit
=
curve_fit
(
model
,
xdata
,
yval
,
1.0
./
yer
.^
2
,
fill
(
0.5
,
param
))
(
upar
,
chi_exp
)
=
isnothing
(
wpm
)
?
fit_error
(
chisq
,
coef
(
fit
),
ydata
)
:
fit_error
(
chisq
,
coef
(
fit
),
ydata
,
wpm
)
for
i
=
1
:
length
(
upar
)
uwerr
(
upar
[
i
])
print
(
"
\n
Fit parameter: "
,
i
,
": "
)
details
(
upar
[
i
])
end
println
(
"Chisq / chiexp: "
,
chisq
(
coef
(
fit
),
ydata
),
" / "
,
chi_exp
,
" (dof: "
,
dof
(
fit
),
")"
)
return
upar
end
function
gen_chisq
(
f
::
Function
,
x
::
Vector
{
Int64
},
err
::
Vector
{
Float64
})
chisq
(
par
,
dat
)
=
sum
((
dat
.-
f
(
x
,
par
))
.^
2
./
err
.^
2
)
return
chisq
end
function
gen_chisq
(
f
::
Function
,
x
::
Array
{
<:
Real
},
err
::
Vector
{
Float64
})
chisq
(
par
,
dat
)
=
sum
((
dat
.-
f
(
x
,
par
))
.^
2
./
err
.^
2
)
return
chisq
end
#TODO: add combined fits
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment