#include <PD2HDChannelMapSPPluginBase.hpp>
◆ PD2HDChannelMapSPPluginBase() [1/3]
dunedaq::detchannelmaps::PD2HDChannelMapSPPluginBase::PD2HDChannelMapSPPluginBase |
( |
uint | det_id, |
|
|
const std::string & | channel_map_path ) |
|
inlineexplicit |
Construct a new PD2HDChannelMapSPPluginBase object.
- Parameters
-
Definition at line 24 of file PD2HDChannelMapSPPluginBase.hpp.
24 :
26
27 const char* detchannelmaps_share_cstr = getenv("DETCHANNELMAPS_SHARE");
28 if (!detchannelmaps_share_cstr) {
29 throw std::runtime_error("Environment variable DETCHANNELMAPS_SHARE is not set");
30 }
31 std::string detchannelmaps_share(detchannelmaps_share_cstr);
32 std::string channel_map_file = detchannelmaps_share + "/config/" + channel_map_path;
35
36 }
std::unique_ptr< dune::PD2HDChannelMapSP > m_channel_map
◆ PD2HDChannelMapSPPluginBase() [2/3]
◆ PD2HDChannelMapSPPluginBase() [3/3]
◆ get_channel_info_from_offline_channel()
std::optional< TPCChannelMap::TPCChannelInfo > dunedaq::detchannelmaps::PD2HDChannelMapSPPluginBase::get_channel_info_from_offline_channel |
( |
uint | offchannel | ) |
|
|
inlinefinal |
Definition at line 141 of file PD2HDChannelMapSPPluginBase.hpp.
141 {
142 auto ci =
m_channel_map->GetChanInfoFromOfflChan(offchannel);
143
144 if ( !ci.valid) {
145 return std::nullopt;
146 }
147 constexpr uint n_chan_per_stream = 64;
148 uint16_t slot_id = ci.wib-1;
149 uint16_t stream_id = ci.link*n_chan_per_stream+ci.wibframechan/n_chan_per_stream;
150 uint16_t chan_id = ci.wibframechan%n_chan_per_stream;
151
153 }
std::function< uint(std::string)> m_elem_name_id_converter
◆ get_element_id_from_offline_channel()
uint dunedaq::detchannelmaps::PD2HDChannelMapSPPluginBase::get_element_id_from_offline_channel |
( |
uint | offchannel | ) |
|
|
inlinefinal |
Get the element id from offline channel object.
- Parameters
-
- Returns
- uint
Definition at line 109 of file PD2HDChannelMapSPPluginBase.hpp.
109 {
110 auto chan_info =
m_channel_map->GetChanInfoFromOfflChan(offchannel);
111
112 if (!chan_info.valid) {
113 return -1;
114 }
115
117
118
119 return 0;
120 }
◆ get_element_name_from_offline_channel()
std::string dunedaq::detchannelmaps::PD2HDChannelMapSPPluginBase::get_element_name_from_offline_channel |
( |
uint | offchannel | ) |
|
|
inlinefinal |
Get the tpc element name from offline channel object.
- Parameters
-
- Returns
- std::string
Definition at line 129 of file PD2HDChannelMapSPPluginBase.hpp.
129 {
130 auto chan_info =
m_channel_map->GetChanInfoFromOfflChan(offchannel);
131
132 if (!chan_info.valid) {
133 return "";
134 }
135
136 return chan_info.APAName;
137 }
◆ get_offline_channel_from_det_crate_slot_stream_chan()
uint dunedaq::detchannelmaps::PD2HDChannelMapSPPluginBase::get_offline_channel_from_det_crate_slot_stream_chan |
( |
uint | det, |
|
|
uint | crate, |
|
|
uint | slot, |
|
|
uint | stream, |
|
|
uint | channel ) |
|
inlinefinal |
Get the offline channel from detector crate slot stream chan object.
- Parameters
-
det | |
crate | |
slot | |
stream | |
channel | |
- Returns
- offline channel identifier
Definition at line 56 of file PD2HDChannelMapSPPluginBase.hpp.
56 {
57
58
60 return -1;
61
62
63 if( (stream & 0xbc) )
64 return -1;
65
66 constexpr uint n_chan_per_stream = 64;
67
68 uint link = (stream >> 6) & 1;
69 uint stream_in_link = (stream & 0x3);
70 uint wibframechan = n_chan_per_stream*stream_in_link+
channel;
71
73 crate, slot, link, wibframechan
74 );
75
76 if (!chan_info.valid) {
77 return -1;
78 }
79
80 return chan_info.offlchan;
81 }
◆ get_plane_from_offline_channel()
uint dunedaq::detchannelmaps::PD2HDChannelMapSPPluginBase::get_plane_from_offline_channel |
( |
uint | offchannel | ) |
|
|
inlinefinal |
Get the plane from offline channel object.
- Parameters
-
- Returns
- plane id (0, 1 or 2)
Definition at line 91 of file PD2HDChannelMapSPPluginBase.hpp.
91 {
92 auto chan_info =
m_channel_map->GetChanInfoFromOfflChan(offchannel);
93
94 if (!chan_info.valid) {
95 return -1;
96 }
97
98 return chan_info.plane;
99 };
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ m_channel_map
◆ m_det_id
const uint dunedaq::detchannelmaps::PD2HDChannelMapSPPluginBase::m_det_id |
|
private |
◆ m_elem_name_id_converter
std::function<uint(std::string)> dunedaq::detchannelmaps::PD2HDChannelMapSPPluginBase::m_elem_name_id_converter |
|
protected |
The documentation for this class was generated from the following file: