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
6f9aef07
Verified
Commit
6f9aef07
authored
2 years ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
Add summaryslice header readout and preliminary summaryframe parsing logic
parent
3bfdc9ad
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/root/online.jl
+38
-1
38 additions, 1 deletion
src/root/online.jl
src/types.jl
+17
-0
17 additions, 0 deletions
src/types.jl
with
55 additions
and
1 deletion
src/root/online.jl
+
38
−
1
View file @
6f9aef07
...
...
@@ -53,6 +53,40 @@ function Base.show(io::IO, e::EventContainer)
print
(
io
,
"
$
(typeof(e)) with
$
(length(e.headers)) events"
)
end
packedsizeof
(
::
Type
{
SummarysliceHeader
})
=
44
function
UnROOT.readtype
(
io
::
IO
,
T
::
Type
{
SummarysliceHeader
})
skip
(
io
,
18
)
detector_id
=
UnROOT
.
readtype
(
io
,
Int32
)
run
=
UnROOT
.
readtype
(
io
,
Int32
)
frame_index
=
UnROOT
.
readtype
(
io
,
Int32
)
skip
(
io
,
6
)
UTC_seconds
=
UnROOT
.
readtype
(
io
,
UInt32
)
UTC_16nanosecondcycles
=
UnROOT
.
readtype
(
io
,
UInt32
)
T
(
detector_id
,
run
,
frame_index
,
UTCExtended
(
UTC_seconds
,
UTC_16nanosecondcycles
))
end
function
UnROOT.interped_data
(
rawdata
,
rawoffsets
,
::
Type
{
SummarysliceHeader
},
::
Type
{
T
})
where
{
T
<:
UnROOT
.
JaggType
}
UnROOT
.
splitup
(
rawdata
,
rawoffsets
,
SummarysliceHeader
,
jagged
=
false
)
end
UnROOT
.
packedsizeof
(
::
Type
{
SummaryFrame
})
=
120
# incl. cnt and vers
function
UnROOT.readtype
(
io
,
T
::
Type
{
SummaryFrame
})
dom_id
=
UnROOT
.
readtype
(
io
,
Int32
)
dq_status
=
UnROOT
.
readtype
(
io
,
UInt32
)
hrv
=
UnROOT
.
readtype
(
io
,
UInt32
)
fifo
=
UnROOT
.
readtype
(
io
,
UInt32
)
status3
=
UnROOT
.
readtype
(
io
,
UInt32
)
status4
=
UnROOT
.
readtype
(
io
,
UInt32
)
rates
=
[
UnROOT
.
read
(
io
,
UInt8
)
for
i
∈
1
:
31
]
# burn one byte
#read(io, UInt8)
T
(
dom_id
,
dq_status
,
hrv
,
fifo
,
status3
,
status4
,
rates
)
end
function
UnROOT.interped_data
(
rawdata
,
rawoffsets
,
::
Type
{
Vector
{
SummaryFrame
}},
::
Type
{
T
})
where
{
T
<:
UnROOT
.
JaggType
}
UnROOT
.
splitup
(
rawdata
,
rawoffsets
,
SummaryFrame
,
skipbytes
=
10
)
end
struct
OnlineFile
_fobj
::
UnROOT
.
ROOTFile
events
::
EventContainer
...
...
@@ -61,7 +95,9 @@ struct OnlineFile
customstructs
=
Dict
(
"KM3NETDAQ::JDAQEvent.snapshotHits"
=>
Vector
{
SnapshotHit
},
"KM3NETDAQ::JDAQEvent.triggeredHits"
=>
Vector
{
TriggeredHit
},
"KM3NETDAQ::JDAQEvent.KM3NETDAQ::JDAQEventHeader"
=>
EventHeader
"KM3NETDAQ::JDAQEvent.KM3NETDAQ::JDAQEventHeader"
=>
EventHeader
,
"KM3NETDAQ::JDAQSummaryslice.KM3NETDAQ::JDAQSummarysliceHeader"
=>
SummarysliceHeader
,
"KM3NETDAQ::JDAQSummaryslice.vector<KM3NETDAQ::JDAQSummaryFrame>"
=>
Vector
{
SummaryFrame
}
)
fobj
=
UnROOT
.
ROOTFile
(
filename
,
customstructs
=
customstructs
)
...
...
@@ -71,6 +107,7 @@ struct OnlineFile
LazyBranch
(
fobj
,
"KM3NET_EVENT/KM3NET_EVENT/snapshotHits"
),
LazyBranch
(
fobj
,
"KM3NET_EVENT/KM3NET_EVENT/triggeredHits"
))
)
end
end
Base
.
close
(
c
::
OnlineFile
)
=
close
(
f
.
_fobj
)
...
...
This diff is collapsed.
Click to expand it.
src/types.jl
+
17
−
0
View file @
6f9aef07
...
...
@@ -60,6 +60,23 @@ struct UTCExtended
end
end
struct
SummaryFrame
dom_id
::
Int32
dq_status
::
UInt32
hrv
::
UInt32
fifo
::
UInt32
status3
::
UInt32
status4
::
UInt32
rates
::
Vector
{
UInt8
}
end
struct
SummarysliceHeader
detector_id
::
Int32
run
::
Int32
frame_index
::
Int32
t
::
UTCExtended
end
struct
EventHeader
detector_id
::
Int32
run
::
Int32
...
...
This diff is collapsed.
Click to expand it.
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