Skip to content
Snippets Groups Projects
Commit c40a2791 authored by Christopher Rob Jones's avatar Christopher Rob Jones
Browse files

RichDLLs: Use Gaudi CounterArray Accumulator

parent 65fd7c77
No related branches found
No related tags found
No related merge requests found
Pipeline #6755985 passed
......@@ -13,11 +13,15 @@
#include "RichFutureRecBase/RichRecHistoAlgBase.h"
// Gaudi Functional
#include "Gaudi/Accumulators/CounterArray.h"
#include "LHCbAlgs/Consumer.h"
// Event model
#include "Event/RichPID.h"
// format
#include <fmt/format.h>
// STL
#include <array>
#include <mutex>
......@@ -53,10 +57,7 @@ namespace Rich::Future::Rec::Moni {
auto withR1 = m_withR1.buffer();
auto withR2 = m_withR2.buffer();
auto withR1R2 = m_withR1R2.buffer();
auto aboveThres = std::array{
m_aboveThres[0].buffer(), m_aboveThres[1].buffer(), m_aboveThres[2].buffer(),
m_aboveThres[3].buffer(), m_aboveThres[4].buffer(), m_aboveThres[5].buffer(),
};
auto aboveThres = m_aboveThres.buffer();
// count PIDs
m_nPIDs += pids.size();
......@@ -118,13 +119,11 @@ namespace Rich::Future::Rec::Moni {
mutable Gaudi::Accumulators::BinomialCounter<> m_withR1R2{this, "Used RICH1 and RICH2"};
/// Mass hypothesis thresholds
mutable std::array<Gaudi::Accumulators::BinomialCounter<>, Rich::NRealParticleTypes> m_aboveThres{
{{this, "El Above Threshold"},
{this, "Mu Above Threshold"},
{this, "Pi Above Threshold"},
{this, "Ka Above Threshold"},
{this, "Pr Above Threshold"},
{this, "De Above Threshold"}}};
mutable Gaudi::Accumulators::CounterArray<Gaudi::Accumulators::BinomialCounter<>, Rich::NRealParticleTypes>
m_aboveThres{this, []( const int n ) {
const auto types = std::array{"El", "Mu", "Pi", "Ka", "Pr", "De"};
return fmt::format( "{} Above Threshold", types.at( n ) );
}};
};
// Declaration of the Algorithm Factory
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment