1#ifndef DETCHANNELMAPS_INCLUDE_DETCHANNELMAPS_PDSCHANNELMAP_HPP_
2#define DETCHANNELMAPS_INCLUDE_DETCHANNELMAPS_PDSCHANNELMAP_HPP_
4#include "cetlib/BasicPluginFactory.h"
5#include "cetlib/compiler_macros.h"
11#ifndef EXTERN_C_FUNC_DECLARE_START
13#define EXTERN_C_FUNC_DECLARE_START \
22#define DEFINE_DUNE_DET_PDSCHANNEL_MAP(klass) \
23 EXTERN_C_FUNC_DECLARE_START \
24 std::shared_ptr<dunedaq::detchannelmaps::PDSChannelMap> make() \
26 return std::shared_ptr<dunedaq::detchannelmaps::PDSChannelMap>(new klass()); \
38 PDSChannelMapCreationFailed,
39 "Failed to create PDSChannelMap of type " << plugin_name,
40 ((std::string)plugin_name)
44 "Invalid stream number " << stream,
56 static constexpr uint16_t kUndefined=0xffff;
58 uint16_t detector = kUndefined;
59 uint16_t crate = kUndefined;
60 uint16_t slot = kUndefined;
61 uint16_t stream = kUndefined;
62 uint16_t channel = kUndefined;
63 uint16_t element = kUndefined;
77 virtual uint get_offline_channel_from_det_crate_slot_stream_chan(uint det, uint crate, uint slot, uint stream, uint channel) = 0;
79 virtual uint get_element_from_offline_channel(uint ) = 0;
80 virtual std::string get_element_name_from_offline_channel(uint ) = 0;
81 virtual std::optional<PDSChannelInfo> get_det_crate_slot_fiber_chan_from_offline_channel(uint offchannel) = 0;
85 virtual ~PDSChannelMap()
noexcept =
default;
92 explicit PDSChannelMap(){}
103inline std::shared_ptr<PDSChannelMap>
104make_pds_map(std::string
const& plugin_name)
106 static cet::BasicPluginFactory bpf(
"dunePDSChannelMap",
"make");
108 std::shared_ptr<PDSChannelMap> mod_ptr;
110 mod_ptr = bpf.makePlugin<std::shared_ptr<PDSChannelMap>>(plugin_name);
111 }
catch (
const cet::exception& cexpt) {
112 throw PDSChannelMapCreationFailed(
ERS_HERE, plugin_name, cexpt);
#define ERS_DECLARE_ISSUE(namespace_name, class_name, message, attributes)
PDSInvalidStream
< Namespace