Skip to content

Commit

Permalink
doc string for y2σs (#48)
Browse files Browse the repository at this point in the history
  • Loading branch information
mmikhasenko authored Aug 23, 2024
1 parent a6edd11 commit 57c0d6f
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions .cspell/julia.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ joinpath
Kallen
lineshape
makedocs
mapslices
misq
mjsq
mksq
Expand Down
37 changes: 37 additions & 0 deletions src/tbs_struct.jl
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,43 @@ function x2σs(x, ms::MassTuple; k::Int)
return MandelstamTuple{typeof(ms.m0)}(σt)
end



"""
y2σs(y, ms::MassTuple; k::Int = last(findmin(Tuple(ms))))
Maps a pair of variables to the plain of squared masses using a linear transformation.
The values [0,1] correspond to the physical limits of the mass squared variables.
The physical value
## Arguments
- `y` : a pair of numbers
- `ms` : masses of the system as a `MassTuple`, see `ThreeBodyMasses`.
- `k` : the index for which the variable is not generated. By default, the function picks the coordinates
where the Dalitz plot has the closest shape to the squared fitting box.
## Returns
- an instance of `MandelstamTuple` with the squared masses.
## Example
The phase space sample with 100 points can be generated as follows:
```julia
data = let
N = 100
# map random variables to dalitz
_data = mapslices(rand(N,2); dims=2) do xy
y2σs(xy, ms)
end[:,1]
# select physical
filter!(_data) do σs
isphysical(σs, ms)
end
_data
end
````
"""
function y2σs(y, ms::MassTuple; k::Int = last(findmin(Tuple(ms))))
i, j = ij_from_k(k)
σi = fitin(y[1], lims(ms; k = i))
Expand Down

0 comments on commit 57c0d6f

Please sign in to comment.