24template <
typename KEY,
typename VALUE>
27 std::map<VALUE, KEY> dest;
29 dest.emplace(p.second, p.first);
36 static std::vector<uint8_t> channelsPerDS;
37 if (channelsPerDS.empty()) {
41 auto dsId = det.dsId();
42 auto deId = det.deId();
45 channelsPerDS.emplace_back(nch);
49 return channelsPerDS[dsIndex];
51 LOGP(error,
"invalid Dual Sampa index: {}", dsIndex);
58 static std::map<uint32_t, uint16_t>
m;
63 std::vector<int> dsids;
65 dsids.emplace_back(dsid);
68 std::sort(dsids.begin(), dsids.end());
69 for (
auto dsId : dsids) {
71 m.emplace(
encode(det), dsIndex);
84 }
catch (
const std::exception&) {
85 LOGP(error,
"invalid Dual Sampa Id: {}",
raw::asString(dsDetId));
95 }
catch (
const std::exception&) {
96 LOGP(error,
"invalid Dual Sampa index: {}", dsIndex);
o2::mch::mapping::CathodeSegmentation seg
void forEachPadInDualSampa(int dualSampaId, CALLABLE &&func) const
void forEachDualSampa(std::function< void(int dualSampaId)> func) const
Loop over dual sampas of this detection element.
A DsDetId is just a pair (detection element id, dual sampa id)
O2MCHMAPPINGIMPL3_EXPORT const Segmentation & segmentation(int detElemId)
void forEachDetectionElement(CALLABLE &&func)
std::string asString(const SampaCluster &sc)
DsDetId decodeDsDetId(uint32_t code)
Create a DsDetId object from a integer code.
uint64_t encode(uint32_t a, uint32_t b)
std::map< uint32_t, uint16_t > buildDetId2DsIndexMap()
DsIndex getDsIndex(const o2::mch::raw::DsDetId &dsDetId)
uint8_t numberOfDualSampaChannels(DsIndex dsIndex)
constexpr uint16_t NumberOfDualSampas
std::map< VALUE, KEY > inverseMap(const std::map< KEY, VALUE > &src)
o2::mch::raw::DsDetId getDsDetId(DsIndex dsIndex)