DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
detdataformats
pybindsrc
daqheader.cpp
Go to the documentation of this file.
1
8
9
#include "
detdataformats/DAQHeader.hpp
"
10
11
#include <pybind11/operators.h>
12
#include <pybind11/pybind11.h>
13
#include <pybind11/stl.h>
14
15
#include <sstream>
16
17
namespace
py = pybind11;
18
19
namespace
dunedaq::detdataformats::python
{
20
21
// Quiet the linter about use of unsigned ints in the file
22
// NOLINTBEGIN(build/unsigned)
23
24
void
25
register_daqheader
(py::module& m)
26
{
27
28
py::class_<DAQHeader>(m,
"DAQHeader"
, py::buffer_protocol())
29
.def(py::init<>())
30
.def_property(
31
"version"
,
32
[](
DAQHeader
& self) -> uint32_t {
return
self.
version
; },
33
[](
DAQHeader
& self, uint32_t
version
) { self.
version
=
version
; })
34
.def_property(
35
"det_id"
,
36
[](
DAQHeader
& self) -> uint32_t {
return
self.
det_id
; },
37
[](
DAQHeader
& self, uint32_t det_id) { self.
det_id
= det_id; })
38
.def_property(
39
"crate_id"
,
40
[](
DAQHeader
& self) -> uint32_t {
return
self.
crate_id
; },
41
[](
DAQHeader
& self, uint32_t crate_id) { self.
crate_id
= crate_id; })
42
.def_property(
43
"slot_id"
,
44
[](
DAQHeader
& self) -> uint32_t {
return
self.
slot_id
; },
45
[](
DAQHeader
& self, uint32_t slot_id) { self.
slot_id
= slot_id; })
46
.def_property(
47
"link_id"
,
48
[](
DAQHeader
& self) -> uint32_t {
return
self.
link_id
; },
49
[](
DAQHeader
& self, uint32_t link_id) { self.
link_id
= link_id; })
50
.def_property(
51
"timestamp_1"
,
52
[](
DAQHeader
&) -> uint32_t {
53
throw
std::runtime_error(
"Cannot directly read timestamp_1; use get_timestamp() instead"
);
54
},
55
[](
DAQHeader
& self, uint32_t timestamp_1) { self.
timestamp_1
= timestamp_1; })
56
.def_property(
57
"timestamp_2"
,
58
[](
DAQHeader
&) -> uint32_t {
59
throw
std::runtime_error(
"Cannot directly read timestamp_2; use get_timestamp() instead"
);
60
},
61
[](
DAQHeader
& self, uint32_t timestamp_2) { self.
timestamp_2
= timestamp_2; })
62
.def(
"get_timestamp"
, &
DAQHeader::get_timestamp
);
63
}
64
65
}
// namespace dunedaq::detdataformats::python
66
67
// NOLINTEND(build/unsigned)
DAQHeader.hpp
version
version
Definition
TriggerActivity_serialization.hpp:50
dunedaq::detdataformats::python
Definition
daqethheader.cpp:19
dunedaq::detdataformats::python::register_daqheader
void register_daqheader(py::module &m)
Definition
daqheader.cpp:25
dunedaq::detdataformats::DAQHeader
DAQHeader is a versioned and unified structure for every FE electronics.
Definition
DAQHeader.hpp:23
dunedaq::detdataformats::DAQHeader::det_id
word_t det_id
Definition
DAQHeader.hpp:26
dunedaq::detdataformats::DAQHeader::get_timestamp
uint64_t get_timestamp() const
Definition
DAQHeader.hpp:30
dunedaq::detdataformats::DAQHeader::version
word_t version
Definition
DAQHeader.hpp:26
dunedaq::detdataformats::DAQHeader::link_id
word_t link_id
Definition
DAQHeader.hpp:26
dunedaq::detdataformats::DAQHeader::timestamp_2
word_t timestamp_2
Definition
DAQHeader.hpp:28
dunedaq::detdataformats::DAQHeader::crate_id
word_t crate_id
Definition
DAQHeader.hpp:26
dunedaq::detdataformats::DAQHeader::slot_id
word_t slot_id
Definition
DAQHeader.hpp:26
dunedaq::detdataformats::DAQHeader::timestamp_1
word_t timestamp_1
Definition
DAQHeader.hpp:27
Generated on
for DUNE-DAQ by
1.17.0