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/TPCChannelMap.hpp"
10 : #include "detchannelmaps/PDSChannelMap.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 :
37 0 : py::class_<TPCChannelMap, std::shared_ptr<TPCChannelMap>>(m, "TPCChannelMap")
38 0 : .def("get_offline_channel_from_det_crate_slot_stream_chan", &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 :
45 0 : m.def("make_tpc_map", &make_tpc_map);
46 :
47 :
48 0 : py::class_<PDSChannelMap::PDSChannelInfo>(m, "PDSChannelInfo")
49 0 : .def(py::init<uint, uint, uint, uint>())
50 0 : .def_readwrite("detector", &PDSChannelMap::PDSChannelInfo::detector)
51 0 : .def_readwrite("crate", &PDSChannelMap::PDSChannelInfo::crate)
52 0 : .def_readwrite("slot", &PDSChannelMap::PDSChannelInfo::slot)
53 0 : .def_readwrite("stream", &PDSChannelMap::PDSChannelInfo::stream)
54 0 : .def_readwrite("channel", &PDSChannelMap::PDSChannelInfo::channel)
55 0 : .def_readwrite("element", &PDSChannelMap::PDSChannelInfo::element)
56 : ;
57 :
58 0 : py::class_<PDSChannelMap, std::shared_ptr<PDSChannelMap>>(m, "PDSChannelMap")
59 0 : .def("get_offline_channel_from_det_crate_slot_stream_chan", &PDSChannelMap::get_offline_channel_from_det_crate_slot_stream_chan)
60 0 : .def("get_element_from_offline_channel", &PDSChannelMap::get_element_from_offline_channel)
61 0 : .def("get_element_name_from_offline_channel", &PDSChannelMap::get_element_name_from_offline_channel)
62 0 : .def("get_det_crate_slot_fiber_chan_from_offline_channel", &PDSChannelMap::get_det_crate_slot_fiber_chan_from_offline_channel)
63 : ;
64 :
65 0 : m.def("make_pds_map", &make_pds_map);
66 :
67 0 : }
68 :
69 : } // namespace python
70 : } // namespace detchannelmaps
71 : } // namespace dunedaq
|