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
e7c09613
Commit
e7c09613
authored
1 year ago
by
Tamas Gal
Browse files
Options
Downloads
Plain Diff
Merge branch 'more-calibration-tools' into 'main'
Add calibratedtime and more structs See merge request
!27
parents
cac6d6e9
6d44cb89
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!27
Add calibratedtime and more structs
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
docs/src/api.md
+4
-0
4 additions, 0 deletions
docs/src/api.md
src/KM3io.jl
+3
-2
3 additions, 2 deletions
src/KM3io.jl
src/calibration.jl
+34
-1
34 additions, 1 deletion
src/calibration.jl
src/types.jl
+33
-0
33 additions, 0 deletions
src/types.jl
test/calibration.jl
+6
-0
6 additions, 0 deletions
test/calibration.jl
with
80 additions
and
3 deletions
docs/src/api.md
+
4
−
0
View file @
e7c09613
...
@@ -17,6 +17,7 @@ Location
...
@@ -17,6 +17,7 @@ Location
Evt
Evt
CalibratedHit
CalibratedHit
CalibratedMCHit
CalibratedMCHit
XCalibratedHit
Trk
Trk
MCTrk
MCTrk
```
```
...
@@ -27,6 +28,8 @@ DAQEvent
...
@@ -27,6 +28,8 @@ DAQEvent
EventHeader
EventHeader
SnapshotHit
SnapshotHit
TriggeredHit
TriggeredHit
CalibratedSnapshotHit
CalibratedTriggeredHit
UTCTime
UTCTime
UTCExtended
UTCExtended
Summaryslice
Summaryslice
...
@@ -88,6 +91,7 @@ read(filename::AbstractString, T::Type{AcousticsTriggerParameter})
...
@@ -88,6 +91,7 @@ read(filename::AbstractString, T::Type{AcousticsTriggerParameter})
## Calibration
## Calibration
```
@docs
```
@docs
calibrate
calibrate
calibratetime
combine
combine
floordist
floordist
slew
slew
...
...
This diff is collapsed.
Click to expand it.
src/KM3io.jl
+
3
−
2
View file @
e7c09613
...
@@ -40,11 +40,12 @@ export DAQEvent, EventHeader, SnapshotHit, UTCTime, UTCExtended, Summaryslice,
...
@@ -40,11 +40,12 @@ export DAQEvent, EventHeader, SnapshotHit, UTCTime, UTCExtended, Summaryslice,
count_active_channels
,
count_fifostatus
,
count_hrvstatus
,
status
,
count_active_channels
,
count_fifostatus
,
count_hrvstatus
,
status
,
maximal_udp_sequence_number
,
number_of_udp_packets_received
maximal_udp_sequence_number
,
number_of_udp_packets_received
# Offline dataformat
# Offline dataformat
export
Evt
,
Hit
,
TriggeredHit
,
Trk
,
CalibratedHit
,
XCalibratedHit
,
MCTrk
,
CalibratedMCHit
export
Evt
,
TriggeredHit
,
Trk
,
CalibratedHit
,
XCalibratedHit
,
MCTrk
,
CalibratedMCHit
,
CalibratedSnapshotHit
,
CalibratedTriggeredHit
export
K40Rates
export
K40Rates
export
calibrate
,
floordist
,
slew
,
combine
export
calibrate
,
calibratetime
,
floordist
,
slew
,
combine
export
besttrack
,
bestjppmuon
,
bestjppshower
,
bestaashower
,
export
besttrack
,
bestjppmuon
,
bestjppshower
,
bestaashower
,
RecStageRange
,
hashistory
,
hasjppmuonprefit
,
hasjppmuonsimplex
,
hasjppmuongandalf
,
RecStageRange
,
hashistory
,
hasjppmuonprefit
,
hasjppmuonsimplex
,
hasjppmuongandalf
,
...
...
This diff is collapsed.
Click to expand it.
src/calibration.jl
+
34
−
1
View file @
e7c09613
"""
"""
Apply geometry and time calibration to given hits.
Apply full geometry and time calibration to given hits. This way of calibration
should be used wisely since it creates a very bloaded [`XCalibratedHit`](@ref)
object, which might not be necessary. Often, we only need time the calibration
to be applied.
"""
"""
function
calibrate
(
det
::
Detector
,
hits
)
function
calibrate
(
det
::
Detector
,
hits
)
calibrated_hits
=
Vector
{
XCalibratedHit
}()
calibrated_hits
=
Vector
{
XCalibratedHit
}()
...
@@ -25,6 +30,34 @@ function calibrate(det::Detector, hits)
...
@@ -25,6 +30,34 @@ function calibrate(det::Detector, hits)
calibrated_hits
calibrated_hits
end
end
Base
.
time
(
det
::
Detector
,
hit
;
correct_slew
=
true
)
=
time
(
hit
;
correct_slew
=
correct_slew
)
+
getpmt
(
det
,
hit
)
.
t₀
"""
Calibrate the time of a given array of snapshot hits.
"""
function
calibratetime
(
det
::
Detector
,
hits
::
Vector
{
T
})
where
T
<:
SnapshotHit
out
=
sizehint!
(
Vector
{
CalibratedSnapshotHit
}(),
length
(
hits
))
for
h
in
hits
push!
(
out
,
CalibratedSnapshotHit
(
h
.
dom_id
,
h
.
channel_id
,
h
.
t
+
getpmt
(
det
,
h
)
.
t₀
,
h
.
tot
))
end
out
end
"""
Calibrate the time of a given array of triggered hits.
"""
function
calibratetime
(
det
::
Detector
,
hits
::
Vector
{
T
})
where
T
<:
TriggeredHit
out
=
sizehint!
(
Vector
{
CalibratedTriggeredHit
}(),
length
(
hits
))
for
h
in
hits
push!
(
out
,
CalibratedSnapshotHit
(
h
.
dom_id
,
h
.
channel_id
,
h
.
t
+
getpmt
(
det
,
h
)
.
t₀
,
h
.
tot
,
h
.
trigger_mask
))
end
out
end
"""
"""
Combine snapshot and triggered hits to a single hits-vector.
Combine snapshot and triggered hits to a single hits-vector.
...
...
This diff is collapsed.
Click to expand it.
src/types.jl
+
33
−
0
View file @
e7c09613
...
@@ -60,6 +60,18 @@ end
...
@@ -60,6 +60,18 @@ end
"""
"""
A calibrated snapshot hit.
"""
struct
CalibratedSnapshotHit
<:
AbstractCalibratedHit
dom_id
::
UInt32
channel_id
::
UInt8
t
::
Float64
tot
::
UInt8
end
"""
A hit which was triggered.
A hit which was triggered.
"""
"""
...
@@ -71,7 +83,28 @@ struct TriggeredHit <: AbstractDAQHit
...
@@ -71,7 +83,28 @@ struct TriggeredHit <: AbstractDAQHit
trigger_mask
::
UInt64
trigger_mask
::
UInt64
end
end
"""
A calibrated triggered hit.
"""
struct
CalibratedTriggeredHit
<:
AbstractCalibratedHit
dom_id
::
UInt32
channel_id
::
UInt8
t
::
Float64
tot
::
UInt8
trigger_mask
::
UInt64
end
"""
A fully dressed hit with all calibration information which can be
obtained. This structure is similar to the Hit structure in aanet
and should be used wisely. Most of the time it's much more
performant to use dedicated (simplified) structures.
"""
struct
XCalibratedHit
<:
AbstractCalibratedHit
struct
XCalibratedHit
<:
AbstractCalibratedHit
dom_id
::
UInt32
dom_id
::
UInt32
channel_id
::
UInt32
channel_id
::
UInt32
...
...
This diff is collapsed.
Click to expand it.
test/calibration.jl
+
6
−
0
View file @
e7c09613
...
@@ -9,6 +9,12 @@ using Test
...
@@ -9,6 +9,12 @@ using Test
chits
=
calibrate
(
det
,
hits
)
chits
=
calibrate
(
det
,
hits
)
@test
96
==
length
(
hits
)
@test
96
==
length
(
hits
)
@test
96
==
length
(
chits
)
@test
96
==
length
(
chits
)
@test
30733918
==
hits
[
1
]
.
t
@test
3.0941664391e7
≈
chits
[
1
]
.
t
chits
=
calibratetime
(
det
,
hits
)
@test
3.0941664391e7
≈
chits
[
1
]
.
t
end
end
...
...
This diff is collapsed.
Click to expand it.
Tamas Gal
@tgal
mentioned in commit
a1d736c5
·
1 year ago
mentioned in commit
a1d736c5
mentioned in commit a1d736c58130499dfa61a0b0cb4e267b68d2b75e
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