1#ifndef DETCHANNELMAPS_INCLUDE_DETCHANNELMAPS_TPCCHANNELMAP_HPP_
2#define DETCHANNELMAPS_INCLUDE_DETCHANNELMAPS_TPCCHANNELMAP_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_TPCCHANNEL_MAP(klass) \
23 EXTERN_C_FUNC_DECLARE_START \
24 std::shared_ptr<dunedaq::detchannelmaps::TPCChannelMap> make() \
26 return std::shared_ptr<dunedaq::detchannelmaps::TPCChannelMap>(new klass()); \
38 ChannelMapCreationFailed,
39 "Failed to create TPCChannelMap of type " << plugin_name,
40 ((std::string)plugin_name)
45 "Invalid stream identifier " << stream,
51 "Invalid detector identifier " << stream,
64 static constexpr uint16_t kUndefined=0xffff;
66 uint16_t detector = kUndefined;
67 uint16_t crate = kUndefined;
68 uint16_t slot = kUndefined;
69 uint16_t stream = kUndefined;
70 uint16_t channel = kUndefined;
71 uint16_t element = kUndefined;
85 virtual uint get_offline_channel_from_det_crate_slot_stream_chan(uint det, uint crate, uint slot, uint stream, uint channel) = 0;
87 virtual uint get_plane_from_offline_channel(uint offchannel) = 0;
88 virtual uint get_element_id_from_offline_channel( uint ) = 0;
89 virtual std::string get_element_name_from_offline_channel(uint ) = 0;
90 virtual std::optional<TPCChannelInfo> get_channel_info_from_offline_channel(uint offchannel) = 0;
94 virtual ~TPCChannelMap()
noexcept =
default;
101 explicit TPCChannelMap(){}
112inline std::shared_ptr<TPCChannelMap>
113make_tpc_map(std::string
const& plugin_name)
115 static cet::BasicPluginFactory bpf(
"duneTPCChannelMap",
"make");
117 std::shared_ptr<TPCChannelMap> mod_ptr;
119 mod_ptr = bpf.makePlugin<std::shared_ptr<TPCChannelMap>>(plugin_name);
120 }
catch (
const cet::exception& cexpt) {
121 throw ChannelMapCreationFailed(
ERS_HERE, plugin_name, cexpt);
#define ERS_DECLARE_ISSUE(namespace_name, class_name, message, attributes)
InvalidStreamID
< Namespace