Skip to content
Snippets Groups Projects
Commit 2c61f61d authored by Sebastien Ponce's avatar Sebastien Ponce
Browse files

Merge branch 'RichDLLs-Use-CounterArray' into 'master'

RichDLLs: Use Gaudi CounterArray Accumulator

See merge request !3719
parents abf506f5 8a915c3e
No related branches found
No related tags found
2 merge requests!3788Draft: Update SciFi cluster monitoring,!3719RichDLLs: Use Gaudi CounterArray Accumulator
Pipeline #6770002 passed
......@@ -12,12 +12,19 @@
// base class
#include "RichFutureRecBase/RichRecHistoAlgBase.h"
// Gaudi
#include "GAUDI_VERSION.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>
......@@ -50,13 +57,18 @@ namespace Rich::Future::Rec::Moni {
void operator()( const LHCb::RichPIDs& pids ) const override {
// local count buffers
auto withR1 = m_withR1.buffer();
auto withR2 = m_withR2.buffer();
auto withR1R2 = m_withR1R2.buffer();
auto withR1 = m_withR1.buffer();
auto withR2 = m_withR2.buffer();
auto withR1R2 = m_withR1R2.buffer();
#if GAUDI_MAJOR_VERSION > 37
auto aboveThres = m_aboveThres.buffer();
#else
// To be removed once support for older Gaudi releases no longer required.
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(),
};
#endif
// count PIDs
m_nPIDs += pids.size();
......@@ -118,13 +130,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.
Finish editing this message first!
Please register or to comment