Skip to content

Commit

Permalink
Fix default constructors in serialisation methods
Browse files Browse the repository at this point in the history
  • Loading branch information
gojakuch committed May 11, 2024
1 parent 5d6271f commit 61e7562
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Serialize.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function savejets(filename, jets; format="px py pz E")
end

"""
loadjets!(filename, jets; splitby=isspace, constructor=(x,y,z,E)->LorentzVector(E,px,py,pz), dtype=Float64) -> jets
loadjets!(filename, jets; splitby=isspace, constructor=(px,py,pz,E)->LorentzVector(E,px,py,pz), dtype=Float64)
Loads the `jets` from a file. Ignores lines that start with `'#'`. Each line gets processed in the following way: the line is split using `split(line, splitby)` or simply `split(line)` by default. Every value in this line is then converted to the `dtype` (which is `Float64` by default). These values are then used as arguments for the `constructor` function which should produce individual jets. By default, the `constructor` constructs Lorentz vectors.
Expand All @@ -47,7 +47,7 @@ loadjets!("myjets1.dat", jets)
loadjets!("myjets2.dat", jets)
```
"""
function loadjets!(filename, jets; splitby=isspace, constructor=(x,y,z,E)->LorentzVector(E,px,py,pz), dtype=Float64)
function loadjets!(filename, jets; splitby=isspace, constructor=(px,py,pz,E)->LorentzVector(E,px,py,pz), dtype=Float64)
open(filename, "r") do file
for line in eachline(file)
if line[1] != '#'
Expand Down

0 comments on commit 61e7562

Please sign in to comment.