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");
31 std::string detchannelmaps_share(detchannelmaps_share_cstr);
32 std::string channel_map_file = detchannelmaps_share +
"/config/" + channel_map_path;
66 constexpr uint n_chan_per_stream = 64;
68 uint link = (stream >> 6) & 1;
69 uint stream_in_link = (stream & 0x3);
70 uint wibframechan = n_chan_per_stream*stream_in_link+channel;
73 crate, slot, link, wibframechan
76 if (!chan_info.valid) {
80 return chan_info.offlchan;
92 auto chan_info =
m_channel_map->GetChanInfoFromOfflChan(offchannel);
94 if (!chan_info.valid) {
98 return chan_info.plane;
110 auto chan_info =
m_channel_map->GetChanInfoFromOfflChan(offchannel);
112 if (!chan_info.valid) {
130 auto chan_info =
m_channel_map->GetChanInfoFromOfflChan(offchannel);
132 if (!chan_info.valid) {
136 return chan_info.APAName;
140 std::optional<TPCChannelMap::TPCChannelInfo>
142 auto ci =
m_channel_map->GetChanInfoFromOfflChan(offchannel);
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;
uint get_plane_from_offline_channel(uint offchannel) final
Get the plane from offline channel object.
PD2HDChannelMapSPPluginBase(PD2HDChannelMapSPPluginBase &&)=delete
PD2HDChannelMapSPPluginBase is not move-constructible.
PD2HDChannelMapSPPluginBase & operator=(PD2HDChannelMapSPPluginBase &&)=delete
PD2HDChannelMapSPPluginBase is not move-assignable.
std::string get_element_name_from_offline_channel(uint offchannel) final
Get the tpc element name from offline channel object.
PD2HDChannelMapSPPluginBase(uint det_id, const std::string &channel_map_path)
Construct a new PD2HDChannelMapSPPluginBase object.
std::optional< TPCChannelMap::TPCChannelInfo > get_channel_info_from_offline_channel(uint offchannel) final
uint get_element_id_from_offline_channel(uint offchannel) final
Get the element id from offline channel object.
PD2HDChannelMapSPPluginBase & operator=(const PD2HDChannelMapSPPluginBase &)=delete
PD2HDChannelMapSPPluginBase is not copy-assignable.
std::function< uint(std::string)> m_elem_name_id_converter
uint get_offline_channel_from_det_crate_slot_stream_chan(uint det, uint crate, uint slot, uint stream, uint channel) final
Get the offline channel from detector crate slot stream chan object.
std::unique_ptr< dune::PD2HDChannelMapSP > m_channel_map
PD2HDChannelMapSPPluginBase(const PD2HDChannelMapSPPluginBase &)=delete
PD2HDChannelMapSPPluginBase is not copy-constructible.