From 2ed8d989776c89c667cc10c6db8abb6d0045fbe6 Mon Sep 17 00:00:00 2001 From: Siarhei Harkusha <Siarhei.Harkusha@cern.ch> Date: Mon, 2 Nov 2020 13:12:32 +0100 Subject: [PATCH] dqm_algorithms: Replace struct by class --- .../dqm_algorithms/LastBinThresholdAction.h | 20 ++++++++++++------- .../src/LastBinThresholdAction.cxx | 2 +- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/DataQuality/dqm_algorithms/dqm_algorithms/LastBinThresholdAction.h b/DataQuality/dqm_algorithms/dqm_algorithms/LastBinThresholdAction.h index ec7ae9f0a0d8..8e25fd315d9f 100644 --- a/DataQuality/dqm_algorithms/dqm_algorithms/LastBinThresholdAction.h +++ b/DataQuality/dqm_algorithms/dqm_algorithms/LastBinThresholdAction.h @@ -9,42 +9,48 @@ Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration namespace dqm_algorithms { - struct LessThan { + class LessThan { + public: bool operator() (double a, double b, double /*error = 0.*/) const { return a < b; } }; - struct GreaterThan { + class GreaterThan { + public: bool operator() (double a, double b, double /*error = 0.*/) const { return a > b; } }; - struct DifferentThan { + class DifferentThan { + public: bool operator() (double a, double b, double error = 0.) const { return std::abs(a - b) > error; } }; - struct NoAction { + class NoAction { + public: void operator() (const std::string&, std::string&, double, double) const {} }; - struct TileDQAction { + class TileDQAction { + public: void operator() (const std::string& histogramName, std::string action, double averageBinContent, double lastBinContent) const; }; template<class Exceed, class Action> - struct LastBinThresholdAction : public dqm_core::Algorithm { + class LastBinThresholdAction : public dqm_core::Algorithm { + public: LastBinThresholdAction(const std::string & name); // Overwrites virtual functions virtual LastBinThresholdAction* clone( ) override; virtual dqm_core::Result* execute( const std::string& , const TObject& , const dqm_core::AlgorithmConfig& ) override; using dqm_core::Algorithm::printDescription; - virtual void printDescription(std::ostream& out); + virtual void printDescription(std::ostream& out) const; private: std::string m_name; diff --git a/DataQuality/dqm_algorithms/src/LastBinThresholdAction.cxx b/DataQuality/dqm_algorithms/src/LastBinThresholdAction.cxx index 0b4586fffc5c..a4a9e6e0fbd1 100644 --- a/DataQuality/dqm_algorithms/src/LastBinThresholdAction.cxx +++ b/DataQuality/dqm_algorithms/src/LastBinThresholdAction.cxx @@ -187,7 +187,7 @@ dqm_algorithms::LastBinThresholdAction<Exceed, Action>::execute(const std::strin } template<class Exceed, class Action> -void dqm_algorithms::LastBinThresholdAction<Exceed, Action>::printDescription(std::ostream& out) { +void dqm_algorithms::LastBinThresholdAction<Exceed, Action>::printDescription(std::ostream& out) const { out << m_name + ": Checks for number of bins exceded threshold value" << std::endl; out << "Mandatory Parameter: BinThreshold: Look for bins exceeded BinTreshold; Count number of bins satifying requirement" << std::endl; -- GitLab