Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
KM3io.jl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
common
KM3io.jl
Commits
38509708
Commit
38509708
authored
8 months ago
by
Tamas Gal
Browse files
Options
Downloads
Plain Diff
Merge branch '30-helper-functions-for-parameters-which-use-0-based-indexing' into 'main'
Make fitinf use 0-based indexing Closes
#30
See merge request
!36
parents
a934c463
f47532b0
No related branches found
No related tags found
1 merge request
!36
Make fitinf use 0-based indexing
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
src/exports.jl
+1
-0
1 addition, 0 deletions
src/exports.jl
src/root/offline.jl
+17
-2
17 additions, 2 deletions
src/root/offline.jl
test/physics.jl
+1
-1
1 addition, 1 deletion
test/physics.jl
test/root.jl
+1
-1
1 addition, 1 deletion
test/root.jl
test/tools.jl
+2
-1
2 additions, 1 deletion
test/tools.jl
with
22 additions
and
5 deletions
src/exports.jl
+
1
−
0
View file @
38509708
...
...
@@ -75,6 +75,7 @@ MCTrk,
TriggeredHit
,
Trk
,
XCalibratedHit
,
FitInformation
,
# Calibration
AbstractCalibratedHit
,
...
...
This diff is collapsed.
Click to expand it.
src/root/offline.jl
+
17
−
2
View file @
38509708
...
...
@@ -37,6 +37,21 @@ struct CalibratedMCHit
dir
::
Direction
{
Float64
}
end
"""
A container object to store fit information which uses 0-based indexing.
"""
struct
FitInformation
values
::
Vector
{
Float64
}
end
Base
.
getindex
(
fitinf
::
FitInformation
,
idx
)
=
fitinf
.
values
[
idx
+
1
]
Base
.
length
(
fitinf
::
FitInformation
)
=
length
(
fitinf
.
values
)
Base
.
firstindex
(
::
FitInformation
)
=
0
Base
.
lastindex
(
fitinf
::
FitInformation
)
=
length
(
fitinf
)
-
1
Base
.
eltype
(
::
FitInformation
)
=
Float64
function
Base.iterate
(
fitinf
::
FitInformation
,
state
=
0
)
state
>
length
(
fitinf
)
-
1
?
nothing
:
(
fitinf
[
state
],
state
+
1
)
end
"""
Represents a reconstructed "
track
", which can be e.g. a muon track but also a shower.
"""
...
...
@@ -50,7 +65,7 @@ struct Trk
lik
::
Float64
rec_type
::
Int32
rec_stages
::
Vector
{
Int32
}
fitinf
::
Vector
{
Float64
}
fitinf
::
FitInformation
end
"""
...
...
@@ -304,7 +319,7 @@ function Base.getindex(f::OfflineTree, idx::Integer)
e
.
trks_lik
[
i
],
e
.
trks_rec_type
[
i
],
e
.
trks_rec_stages
[
i
],
e
.
trks_fitinf
[
i
],
FitInformation
(
e
.
trks_fitinf
[
i
]
)
,
)
)
end
...
...
This diff is collapsed.
Click to expand it.
test/physics.jl
+
1
−
1
View file @
38509708
...
...
@@ -17,7 +17,7 @@ using Test
0
,
0
,
[
0
],
[
0
]
FitInformation
(
[
0
]
)
)
γs
=
cherenkov
(
track
,
hits
)
...
...
This diff is collapsed.
Click to expand it.
test/root.jl
+
1
−
1
View file @
38509708
...
...
@@ -18,7 +18,7 @@ const USRFILE = datapath("offline", "usr-sample.root")
@test
56
==
length
(
t
[
1
]
.
trks
)
@test
0
==
length
(
t
[
1
]
.
w
)
@test
17
==
length
(
t
[
1
]
.
trks
[
1
]
.
fitinf
)
@test
0.009290906625313346
==
t
[
end
]
.
trks
[
1
]
.
fitinf
[
1
]
@test
0.009290906625313346
==
t
[
end
]
.
trks
[
1
]
.
fitinf
[
0
]
close
(
f
)
f
=
ROOTFile
(
datapath
(
"offline"
,
"numucc.root"
))
...
...
This diff is collapsed.
Click to expand it.
test/tools.jl
+
2
−
1
View file @
38509708
...
...
@@ -91,7 +91,8 @@ const ONLINEFILE = datapath("online", "km3net_online.root")
@test
56
==
length
(
t
[
1
]
.
trks
)
@test
0
==
length
(
t
[
1
]
.
w
)
@test
17
==
length
(
t
[
1
]
.
trks
[
1
]
.
fitinf
)
@test
0.009290906625313346
==
t
[
end
]
.
trks
[
1
]
.
fitinf
[
1
]
@test
63.92088448673299
==
sum
(
t
[
end
]
.
trks
[
2
]
.
fitinf
)
@test
101.0
==
t
[
1
]
.
trks
[
1
]
.
fitinf
[
end
]
close
(
f
)
f
=
ROOTFile
(
datapath
(
"offline"
,
"numucc.root"
))
...
...
This diff is collapsed.
Click to expand it.
Tamas Gal
@tgal
mentioned in commit
dd010944
·
8 months ago
mentioned in commit
dd010944
mentioned in commit dd01094430366050a377a9d907e8c17931df11d2
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment