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
8
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
22
register_detid
(py::module& m)
23
{
24
py::class_<DetID> py_detid(m,
"DetID"
);
25
py_detid.def(py::init())
26
.def(py::init<const DetID::Subdetector&>())
27
.def(
"__repr__"
,
28
[](
const
DetID
& gid) {
29
std::ostringstream oss;
30
oss <<
"<detdataformats::DetID "
<<
DetID::subdetector_to_string
(gid.
subdetector
) <<
">"
;
31
return
oss.str();
32
})
33
.def(
"subdetector_to_string"
, &
DetID::subdetector_to_string
)
34
.def(
"string_to_subdetector"
, &
DetID::string_to_subdetector
);
35
36
py::enum_<DetID::Subdetector>(py_detid,
"Subdetector"
)
37
.value(
"kUnknown"
,
DetID::Subdetector::kUnknown
)
38
.value(
"kDAQ"
,
DetID::Subdetector::kDAQ
)
39
.value(
"kHD_PDS"
,
DetID::Subdetector::kHD_PDS
)
40
.value(
"kHD_TPC"
,
DetID::Subdetector::kHD_TPC
)
41
.value(
"kHD_CRT"
,
DetID::Subdetector::kHD_CRT
)
42
.value(
"kVD_CathodePDS"
,
DetID::Subdetector::kVD_CathodePDS
)
43
.value(
"kVD_MembranePDS"
,
DetID::Subdetector::kVD_MembranePDS
)
44
.value(
"kVD_BottomTPC"
,
DetID::Subdetector::kVD_BottomTPC
)
45
.value(
"kVD_TopTPC"
,
DetID::Subdetector::kVD_TopTPC
)
46
.value(
"kVD_BernCRT"
,
DetID::Subdetector::kVD_BernCRT
)
47
.value(
"kVD_GrenobleCRT"
,
DetID::Subdetector::kVD_GrenobleCRT
)
48
.value(
"kNDLAr_TPC"
,
DetID::Subdetector::kNDLAr_TPC
)
49
.value(
"kNDLAr_PDS"
,
DetID::Subdetector::kNDLAr_PDS
)
50
.value(
"kND_GAr"
,
DetID::Subdetector::kND_GAr
)
51
.export_values();
52
53
py_detid.def_readwrite(
"subdetector"
, &
DetID::subdetector
);
54
}
55
56
}
// namespace dunedaq::detdataformats::python
DetID.hpp
dunedaq::detdataformats::python
Definition
daqethheader.cpp:19
dunedaq::detdataformats::python::register_detid
void register_detid(py::module &m)
Definition
detid.cpp:22
dunedaq::detdataformats::DetID
DetID is a structure containing the 6 bits field of the unique identifier for a subdetector in the ra...
Definition
DetID.hpp:30
dunedaq::detdataformats::DetID::subdetector_to_string
static std::string subdetector_to_string(const Subdetector &type)
Definition
DetID.hxx:60
dunedaq::detdataformats::DetID::string_to_subdetector
static Subdetector string_to_subdetector(const std::string &typestring)
Definition
DetID.hxx:95
dunedaq::detdataformats::DetID::Subdetector::kVD_GrenobleCRT
@ kVD_GrenobleCRT
Definition
DetID.hpp:47
dunedaq::detdataformats::DetID::Subdetector::kVD_MembranePDS
@ kVD_MembranePDS
Definition
DetID.hpp:43
dunedaq::detdataformats::DetID::Subdetector::kVD_TopTPC
@ kVD_TopTPC
Definition
DetID.hpp:45
dunedaq::detdataformats::DetID::Subdetector::kUnknown
@ kUnknown
Definition
DetID.hpp:37
dunedaq::detdataformats::DetID::Subdetector::kHD_TPC
@ kHD_TPC
Definition
DetID.hpp:40
dunedaq::detdataformats::DetID::Subdetector::kND_GAr
@ kND_GAr
Definition
DetID.hpp:50
dunedaq::detdataformats::DetID::Subdetector::kVD_BottomTPC
@ kVD_BottomTPC
Definition
DetID.hpp:44
dunedaq::detdataformats::DetID::Subdetector::kNDLAr_TPC
@ kNDLAr_TPC
Definition
DetID.hpp:48
dunedaq::detdataformats::DetID::Subdetector::kNDLAr_PDS
@ kNDLAr_PDS
Definition
DetID.hpp:49
dunedaq::detdataformats::DetID::Subdetector::kVD_CathodePDS
@ kVD_CathodePDS
Definition
DetID.hpp:42
dunedaq::detdataformats::DetID::Subdetector::kHD_CRT
@ kHD_CRT
Definition
DetID.hpp:41
dunedaq::detdataformats::DetID::Subdetector::kHD_PDS
@ kHD_PDS
Definition
DetID.hpp:39
dunedaq::detdataformats::DetID::Subdetector::kVD_BernCRT
@ kVD_BernCRT
Definition
DetID.hpp:46
dunedaq::detdataformats::DetID::Subdetector::kDAQ
@ kDAQ
Definition
DetID.hpp:38
dunedaq::detdataformats::DetID::subdetector
Subdetector subdetector
The general subdetector of the source of the data.
Definition
DetID.hpp:56
Generated on
for DUNE-DAQ by
1.16.1