Line data Source code
1 : /**
2 : * @file wib.cpp
3 : *
4 : * This is part of the DUNE DAQ Software Suite, copyright 2020.
5 : * Licensing/copyright details are in the COPYING file that you should have
6 : * received with this code.
7 : */
8 :
9 : #include "detchannelmaps/PDSChannelMap.hpp"
10 : #include "detchannelmaps/TPCChannelMap.hpp"
11 :
12 : #include <pybind11/pybind11.h>
13 : #include <pybind11/stl.h>
14 :
15 : #include <iomanip>
16 :
17 : namespace py = pybind11;
18 :
19 : namespace dunedaq {
20 : namespace detchannelmaps {
21 : namespace python {
22 :
23 : void
24 0 : register_maps(py::module& m)
25 : {
26 :
27 0 : py::class_<TPCChannelMap::TPCChannelInfo>(m, "TPCChannelInfo")
28 0 : .def(py::init<uint, uint, uint, uint>())
29 0 : .def_readwrite("detector", &TPCChannelMap::TPCChannelInfo::detector)
30 0 : .def_readwrite("crate", &TPCChannelMap::TPCChannelInfo::crate)
31 0 : .def_readwrite("slot", &TPCChannelMap::TPCChannelInfo::slot)
32 0 : .def_readwrite("stream", &TPCChannelMap::TPCChannelInfo::stream)
33 0 : .def_readwrite("channel", &TPCChannelMap::TPCChannelInfo::channel)
34 0 : .def_readwrite("element", &TPCChannelMap::TPCChannelInfo::element);
35 :
36 0 : py::class_<TPCChannelMap, std::shared_ptr<TPCChannelMap>>(m, "TPCChannelMap")
37 0 : .def("get_offline_channel_from_det_crate_slot_stream_chan",
38 0 : &TPCChannelMap::get_offline_channel_from_det_crate_slot_stream_chan)
39 0 : .def("get_plane_from_offline_channel", &TPCChannelMap::get_plane_from_offline_channel)
40 0 : .def("get_element_id_from_offline_channel", &TPCChannelMap::get_element_id_from_offline_channel)
41 0 : .def("get_element_name_from_offline_channel", &TPCChannelMap::get_element_name_from_offline_channel)
42 0 : .def("get_channel_info_from_offline_channel", &TPCChannelMap::get_channel_info_from_offline_channel);
43 :
44 0 : m.def("make_tpc_map", &make_tpc_map);
45 :
46 0 : py::class_<PDSChannelMap::PDSChannelInfo>(m, "PDSChannelInfo")
47 0 : .def(py::init<uint, uint, uint, uint>())
48 0 : .def_readwrite("detector", &PDSChannelMap::PDSChannelInfo::detector)
49 0 : .def_readwrite("crate", &PDSChannelMap::PDSChannelInfo::crate)
50 0 : .def_readwrite("slot", &PDSChannelMap::PDSChannelInfo::slot)
51 0 : .def_readwrite("stream", &PDSChannelMap::PDSChannelInfo::stream)
52 0 : .def_readwrite("channel", &PDSChannelMap::PDSChannelInfo::channel)
53 0 : .def_readwrite("element", &PDSChannelMap::PDSChannelInfo::element);
54 :
55 0 : py::class_<PDSChannelMap, std::shared_ptr<PDSChannelMap>>(m, "PDSChannelMap")
56 0 : .def("get_offline_channel_from_det_crate_slot_stream_chan",
57 0 : &PDSChannelMap::get_offline_channel_from_det_crate_slot_stream_chan)
58 0 : .def("get_element_from_offline_channel", &PDSChannelMap::get_element_from_offline_channel)
59 0 : .def("get_element_name_from_offline_channel", &PDSChannelMap::get_element_name_from_offline_channel)
60 0 : .def("get_det_crate_slot_fiber_chan_from_offline_channel",
61 0 : &PDSChannelMap::get_det_crate_slot_fiber_chan_from_offline_channel);
62 :
63 0 : m.def("make_pds_map", &make_pds_map);
64 0 : }
65 :
66 : } // namespace python
67 : } // namespace detchannelmaps
68 : } // namespace dunedaq
|