DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
dunedaq
sourcecode
detdataformats
pybindsrc
detid.cpp
Go to the documentation of this file.
1
9
#include "
detdataformats/DetID.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
void
register_detid
(py::module& m) {
22
py::class_<DetID> py_detid(m,
"DetID"
);
23
py_detid.def(py::init())
24
.def(py::init<const DetID::Subdetector&>())
25
.def(
"__repr__"
, [](
const
DetID
& gid) {
26
std::ostringstream oss;
27
oss <<
"<detdataformats::DetID "
<< gid.
to_string
() <<
">"
;
28
return
oss.str();
29
})
30
.def(
"to_string"
, &
DetID::to_string
)
31
.def(
"is_in_valid_state"
, &
DetID::is_in_valid_state
)
32
.def(
"subdetector_to_string"
, &
DetID::subdetector_to_string
)
33
.def(
"string_to_subdetector"
, &
DetID::string_to_subdetector
);
34
35
py::enum_<DetID::Subdetector>(py_detid,
"Subdetector"
)
36
.value(
"kUnknown"
,
DetID::Subdetector::kUnknown
)
37
.value(
"kDAQ"
,
DetID::Subdetector::kDAQ
)
38
.value(
"kHD_PDS"
,
DetID::Subdetector::kHD_PDS
)
39
.value(
"kHD_TPC"
,
DetID::Subdetector::kHD_TPC
)
40
.value(
"kHD_CRT"
,
DetID::Subdetector::kHD_CRT
)
41
.value(
"kVD_CathodePDS"
,
DetID::Subdetector::kVD_CathodePDS
)
42
.value(
"kVD_MembranePDS"
,
DetID::Subdetector::kVD_MembranePDS
)
43
.value(
"kVD_BottomTPC"
,
DetID::Subdetector::kVD_BottomTPC
)
44
.value(
"kVD_TopTPC"
,
DetID::Subdetector::kVD_TopTPC
)
45
.value(
"kNDLAr_TPC"
,
DetID::Subdetector::kNDLAr_TPC
)
46
.value(
"kNDLAr_PDS"
,
DetID::Subdetector::kNDLAr_PDS
)
47
.value(
"kND_GAr"
,
DetID::Subdetector::kND_GAr
)
48
.export_values();
49
50
py_detid.def_readwrite(
"version"
, &
DetID::version
)
51
.def_readwrite(
"subdetector"
, &
DetID::subdetector
);
52
}
53
54
}
// namespace dunedaq::detdataformats::python
55
DetID.hpp
dunedaq::detdataformats::python
Definition
daqethheader.cpp:19
dunedaq::detdataformats::python::register_detid
void register_detid(py::module &m)
Definition
detid.cpp:21
dunedaq::detdataformats::DetID
DetID is a versioned structure containing the 6 bits field of the unique identifier for a subdetector...
Definition
DetID.hpp:30
dunedaq::detdataformats::DetID::subdetector_to_string
static std::string subdetector_to_string(const Subdetector &type)
Definition
DetID.hxx:67
dunedaq::detdataformats::DetID::to_string
std::string to_string() const
Definition
DetID.hpp:77
dunedaq::detdataformats::DetID::string_to_subdetector
static Subdetector string_to_subdetector(const std::string &typestring)
Definition
DetID.hxx:102
dunedaq::detdataformats::DetID::is_in_valid_state
bool is_in_valid_state() const noexcept
Definition
DetID.hpp:84
dunedaq::detdataformats::DetID::subdetector
Subdetector subdetector
The general subdetector of the source of the data.
Definition
DetID.hpp:69
dunedaq::detdataformats::DetID::Subdetector::kVD_MembranePDS
@ kVD_MembranePDS
dunedaq::detdataformats::DetID::Subdetector::kVD_TopTPC
@ kVD_TopTPC
dunedaq::detdataformats::DetID::Subdetector::kUnknown
@ kUnknown
dunedaq::detdataformats::DetID::Subdetector::kHD_TPC
@ kHD_TPC
dunedaq::detdataformats::DetID::Subdetector::kND_GAr
@ kND_GAr
dunedaq::detdataformats::DetID::Subdetector::kVD_BottomTPC
@ kVD_BottomTPC
dunedaq::detdataformats::DetID::Subdetector::kNDLAr_TPC
@ kNDLAr_TPC
dunedaq::detdataformats::DetID::Subdetector::kNDLAr_PDS
@ kNDLAr_PDS
dunedaq::detdataformats::DetID::Subdetector::kVD_CathodePDS
@ kVD_CathodePDS
dunedaq::detdataformats::DetID::Subdetector::kHD_CRT
@ kHD_CRT
dunedaq::detdataformats::DetID::Subdetector::kHD_PDS
@ kHD_PDS
dunedaq::detdataformats::DetID::Subdetector::kDAQ
@ kDAQ
dunedaq::detdataformats::DetID::version
Version_t version
Version number of the DetID.
Definition
DetID.hpp:65
Generated on Sat Jun 28 2025 for DUNE-DAQ by
1.12.0