5 #ifndef TrkAmbiguityProcessor_AmbiCounter_icc
6 #define TrkAmbiguityProcessor_AmbiCounter_icc
15 template<
class EnumType>
28 const std::string errMsgPrefix =
"In AmbiCounter.icc, eta_bounds size must be ";
31 throw std::runtime_error(errMsgPrefix +
"in ascending order.");
38 return static_cast<size_t>(categoryIndex);
61 throw std::out_of_range(
"in AmbiCounter.icc::increment()");
70 for (
size_t categoryIdx=0; categoryIdx <
idx(Categories::kNCounter); ++categoryIdx) {
71 for (
unsigned int etaBinIdx=0; etaBinIdx <
a.m_counter[categoryIdx].size(); ++etaBinIdx) {
72 m_counter[categoryIdx][etaBinIdx] +=
a.m_counter[categoryIdx][etaBinIdx];
85 if (!
track->trackParameters()) {
88 std::array<int, nRegions> &nTracks =
m_counter.at(
idx(categoryIdx));
90 const double absEta = std::abs(
track->trackParameters()->front()->eta());
92 ++nTracks[possibleIdx.value()];
99 std::stringstream
out;
101 if (categoryIdx >= Categories::kNCounter)
throw std::out_of_range(
"Array index out of range in AmbiCounter::inc by region");
102 const auto & displayedArray =
m_counter[
idx(categoryIdx)];
103 const auto allRegionCounts =
std::accumulate(displayedArray.begin(), displayedArray.end(),0);
104 out << std::setiosflags(std::ios::dec) << std::setw(iw) << allRegionCounts;
105 for (
unsigned int etaBinIdx=0; etaBinIdx <
nRegions; ++etaBinIdx) {
106 out << std::setiosflags(std::ios::dec) << std::setw(iw) <<
m_counter[
idx(categoryIdx)][etaBinIdx];
118 std::array<std::array<int, nRegions>,
static_cast<size_t>(Categories::kNCounter)>
m_counter{};
121 std::optional<size_t>