13#include <fmt/format.h>
21 if (mLinkId < 0 || (mLinkId > 11 && mLinkId != 15)) {
22 throw std::invalid_argument(fmt::format(
"LinkId should be between 0 and 11 or = 15 but is {}",
linkId));
27 return (
id.feeId() << 16) |
id.linkId();
32 uint16_t feeId =
static_cast<uint16_t
>((
x & 0xFFFF0000) >> 16);
33 uint8_t linkId =
static_cast<uint8_t
>(
x & 0xF);
39 os << fmt::format(
"FeeLinkId(FEE={:4d},LINK={:1d}) CODE={:8d}",
id.feeId(),
id.linkId(),
encode(
id));
45 return fmt::format(
"FEE{}-LINK{}", feeLinkId.
feeId(), feeLinkId.
linkId());
FeeLinkId(uint16_t feeId, uint8_t linkId)
FeeLinkId decodeFeeLinkId(uint32_t code)
std::string asString(const SampaCluster &sc)
uint32_t encode(const DsDetId &id)
Create an integer code for the given id.
bool operator<(const observer_ptr< W1 > &p1, const observer_ptr< W2 > &p2)
std::ostream & operator<<(std::ostream &stream, o2::InteractionRecord const &ir)