20#include <fmt/format.h>
31 throw std::runtime_error(fmt::format(
"invalid mask {} (max allowed is {}",
39 for (
auto id : badchannels) {
41 ChannelCode cc(
id.getSolarId(),
id.getElinkId(),
id.getChannel());
43 }
catch (
const std::exception& e) {
44 LOGP(warning,
"Error processing channel - SolarId: {} ElinkId: {} Channel: {}. Error: {}. This channel is skipped.",
45 id.getSolarId(),
id.getElinkId(),
id.getChannel(), e.what());
53 for (
auto id : badchannels) {
61 LOGP(warning,
"Error processing Dual Sampa - index: {}. This DS is skipped.", badDS);
70 auto deId = badDS.
deId();
72 LOGP(warning,
"Error processing Dual Sampa - {}. This DS is skipped.",
raw::asString(badDS));
78 ChannelCode cc(deId, dePadIndex);
80 } catch (
const std::exception& e) {
81 LOGP(warning,
"Error processing channel - {} padIndex: {}. Error: {}. This channel is skipped.",
87void StatusMap::addDE(uint16_t badDE, uint32_t
mask)
90 if (!constants::isValidDetElemId(badDE)) {
91 LOGP(warning,
"Error processing DE - Id: {}. This DE is skipped.", badDE);
94 const auto&
seg = mapping::segmentation(badDE);
99 }
catch (
const std::exception& e) {
100 LOGP(warning,
"Error processing channel - deId: {} padIndex: {}. Error: {}. This channel is skipped.",
101 badDE, dePadIndex, e.what());
108 auto s = mStatus.find(
id);
109 if (s != mStatus.end()) {
118 std::map<int, std::vector<int>> rejectList;
124 for (
const auto& status : statusMap) {
125 auto channel = status.first;
126 if (!channel.isValid()) {
129 if ((
mask & status.second) != 0) {
130 rejectList[channel.getDeId()].emplace_back(channel.getDePadIndex());
o2::mch::mapping::CathodeSegmentation seg
ClassImp(o2::mch::StatusMap)
void add(gsl::span< const DsChannelId > badchannels, uint32_t mask)
void addDS(DsIndex badDS, uint32_t mask)
void forEachPad(CALLABLE &&func) const
void forEachPadInDualSampa(int dualSampaId, CALLABLE &&func) const
A DsDetId is just a pair (detection element id, dual sampa id)
uint16_t deId() const
deId returns one of the 156 possible detection element id
bool isValidDetElemId(int deId)
O2MCHMAPPINGIMPL3_EXPORT const Segmentation & segmentation(int detElemId)
std::string asString(const SampaCluster &sc)
std::map< int, std::vector< int > > applyMask(const o2::mch::StatusMap &statusMap, uint32_t mask)
void assertValidMask(uint32_t mask)
constexpr uint16_t NumberOfDualSampas
o2::mch::raw::DsDetId getDsDetId(DsIndex dsIndex)
std::vector< o2::mch::ChannelCode > cc