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
49e91906
Commit
49e91906
authored
11 months ago
by
Manu Le Guirriec
Browse files
Options
Downloads
Patches
Plain Diff
Create DAQSummaryslice object
parent
c7dabdb5
No related branches found
Branches containing commit
Tags
v0.17.1
Tags containing commit
1 merge request
!35
DAQSummaryslice stream
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/controlhost.jl
+1
-0
1 addition, 0 deletions
src/controlhost.jl
src/daq.jl
+37
-0
37 additions, 0 deletions
src/daq.jl
src/exports.jl
+1
-0
1 addition, 0 deletions
src/exports.jl
src/types.jl
+10
-0
10 additions, 0 deletions
src/types.jl
with
49 additions
and
0 deletions
src/controlhost.jl
+
1
−
0
View file @
49e91906
...
...
@@ -100,6 +100,7 @@ struct CHClient{T}
end
CHTag
(
::
Type
{
T
})
where
T
=
error
(
"No controlhost tag defined for type '
$(T)
'"
)
CHTag
(
::
Type
{
DAQEvent
})
=
CHTag
(
"IO_EVT"
)
CHTag
(
::
Type
{
DAQSummaryslice
})
=
CHTag
(
"IO_SUM"
)
CHClient
(
ip
::
IPv4
,
port
::
Integer
,
tags
::
Vector
{
CHTag
})
=
CHClient
{
CHMessage
}(
ip
,
port
,
tags
)
CHClient
{
T
}(
ip
::
IPv4
,
port
::
Integer
)
where
T
=
CHClient
{
T
}(
ip
,
port
,
[
CHTag
(
T
)])
Base
.
eltype
(
::
CHClient
{
T
})
where
T
=
T
...
...
This diff is collapsed.
Click to expand it.
src/daq.jl
+
37
−
0
View file @
49e91906
# Online DAQ readout
using
StaticArrays
function
Base.read
(
s
::
IO
,
::
Type
{
T
};
legacy
=
false
)
where
T
<:
DAQEvent
length
=
read
(
s
,
Int32
)
...
...
@@ -52,3 +53,39 @@ function Base.read(s::IO, ::Type{T}; legacy=false) where T<:DAQEvent
T
(
header
,
snapshot_hits
,
triggered_hits
)
end
function
Base.read
(
s
::
IO
,
::
Type
{
T
};
legacy
=
false
)
where
T
<:
DAQSummaryslice
length
=
read
(
s
,
Int32
)
type
=
read
(
s
,
Int32
)
version
=
Int16
(
0
)
!
legacy
&&
(
version
=
read
(
s
,
Int16
))
detector_id
=
read
(
s
,
Int32
)
run_id
=
read
(
s
,
Int32
)
frame_index
=
read
(
s
,
Int32
)
utc_seconds
=
read
(
s
,
UInt32
)
utc_16nanosecondcycles
=
read
(
s
,
UInt32
)
# 16ns ticks
header
=
SummarysliceHeader
(
detector_id
,
run_id
,
frame_index
,
UTCExtended
(
utc_seconds
,
utc_16nanosecondcycles
)
)
n_frames
=
read
(
s
,
Int32
)
summary_frames
=
Vector
{
SummaryFrame
}()
sizehint!
(
summary_frames
,
n_frames
)
@inbounds
for
i
∈
1
:
n_frames
dom_id
=
read
(
s
,
Int32
)
daq
=
read
(
s
,
UInt32
)
status
=
read
(
s
,
UInt32
)
fifo
=
read
(
s
,
UInt32
)
status3
=
read
(
s
,
UInt32
)
status4
=
read
(
s
,
UInt32
)
rates
=
@SVector
[
read
(
s
,
UInt8
)
for
i
∈
1
:
31
]
push!
(
summary_frames
,
SummaryFrame
(
dom_id
,
daq
,
status
,
fifo
,
status3
,
status4
,
rates
))
end
T
(
header
,
summary_frames
)
end
This diff is collapsed.
Click to expand it.
src/exports.jl
+
1
−
0
View file @
49e91906
...
...
@@ -44,6 +44,7 @@ ROOTFile,
# Online dataformat
DAQEvent
,
DAQSummaryslice
,
EventHeader
,
SnapshotHit
,
SummaryFrame
,
...
...
This diff is collapsed.
Click to expand it.
src/types.jl
+
10
−
0
View file @
49e91906
...
...
@@ -205,3 +205,13 @@ struct DAQEvent
snapshot_hits
::
Vector
{
SnapshotHit
}
triggered_hits
::
Vector
{
TriggeredHit
}
end
"""
DAQSummaryslice from JLigier
"""
struct
DAQSummaryslice
header
::
SummarysliceHeader
summary_frames
::
Vector
{
SummaryFrame
}
end
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