18#include <fmt/format.h>
24void add(std::map<uint32_t, uint32_t>& e2d,
int deId,
int dsId,
25 uint16_t solarId, uint8_t groupId, uint8_t
index)
28 auto code =
encode(dselec);
29 auto already = e2d.find(code);
32 if (already != e2d.end()) {
34 throw std::logic_error(fmt::format(
"FATAL_ERROR: dselec={} (deId,dsId={},{}) is already in the map for (deId,dsId={})",
46void add_cru(std::map<uint16_t, uint32_t>& s2f,
int feeId,
int linkId, uint16_t solarId)
50 if (std::find_if(
begin(s2f),
end(s2f), [code](
const auto&
v) {
return v.second == code; }) !=
end(s2f)) {
51 throw std::logic_error(fmt::format(
"FATAL_ERROR feeid,link=({},{}) (solarId={}) is already referenced in the map !",
52 feeId, linkId, solarId));
54 s2f.emplace(solarId, code);
A DsDetId is just a pair (detection element id, dual sampa id)
std::string asString(const SampaCluster &sc)
DsDetId decodeDsDetId(uint32_t code)
Create a DsDetId object from a integer code.
Enum< T >::Iterator begin(Enum< T >)
coder encode(vec, triggers, clusters)