QualityControl  1.5.1
O2 Data Quality Control Framework
Check.h
1 // Copyright CERN and copyright holders of ALICE O2. This software is
2 // distributed under the terms of the GNU General Public License v3 (GPL
3 // Version 3), copied verbatim in the file "COPYING".
4 //
5 // See http://alice-o2.web.cern.ch/license for full licensing information.
6 //
7 // In applying this license CERN does not waive the privileges and immunities
8 // granted to it by virtue of its status as an Intergovernmental Organization
9 // or submit itself to any jurisdiction.
10 
11 #ifndef QC_CHECKER_CHECK_H
12 #define QC_CHECKER_CHECK_H
13 
14 // std
15 #include <functional>
16 #include <map>
17 #include <vector>
18 #include <memory>
19 #include <unordered_map>
20 // O2
21 #include <Framework/DataProcessorSpec.h>
22 // QC
23 #include "QualityControl/Quality.h"
24 #include "QualityControl/QualityObject.h"
29 
31 {
32 
39 class Check
40 {
41  public:
43 
51  Check(std::string checkName, std::string configurationSource);
52 
57  void init();
58 
59  QualityObjectsType check(std::map<std::string, std::shared_ptr<o2::quality_control::core::MonitorObject>>& moMap);
60 
67  void updateRevision(unsigned int revision);
68 
69  const std::string& getName() const { return mCheckConfig.name; };
70  o2::framework::OutputSpec getOutputSpec() const { return mOutputSpec; };
71  o2::framework::Inputs getInputs() const { return mInputs; };
72 
73  //TODO: Unique Input string
74  static o2::header::DataDescription createCheckerDataDescription(const std::string taskName);
75 
76  // For testing purpose
77  void setCheckInterface(CheckInterface* checkInterface) { mCheckInterface = checkInterface; };
78 
79  std::string getPolicyName() const;
80  std::vector<std::string> getObjectsNames() const;
81  bool getAllObjectsOption() const;
82 
83  private:
84  void initConfig(std::string checkName);
85 
86  void beautify(std::map<std::string, std::shared_ptr<MonitorObject>>& moMap, Quality quality);
87 
88  std::string mConfigurationSource;
90  CheckConfig mCheckConfig;
91  CheckInterface* mCheckInterface = nullptr;
92  size_t mNumberOfTaskSources;
93 
94  // DPL information
95  o2::framework::Inputs mInputs;
96  std::vector<std::string> mInputsStringified;
97  o2::framework::OutputSpec mOutputSpec;
98 
99  bool mBeautify = true;
100 };
101 
102 } // namespace o2::quality_control::checker
103 
104 #endif
Definition: Aggregator.h:32
Class representing the quality of a MonitorObject.
Definition: Quality.h:29
void init()
Initialize the check state Expected to run in the init phase of the FairDevice.
Definition: Check.cxx:139
Skeleton of a check.
Definition: CheckInterface.h:32
void updateRevision(unsigned int revision)
Change the revision.
static o2::header::DataDescription createCheckerDataDescription(const std::string taskName)
Static functions.
Definition: Check.cxx:42
Check(std::string checkName, std::string configurationSource)
Constructor.
Definition: Check.cxx:54
Container for the configuration of a Check or an Aggregator.
Definition: CheckConfig.h:26
Singleton class that any class in the QC can use to log.
Definition: QcInfoLogger.h:41
The class in charge of providing single check for a given map of MonitorObjects.
Definition: Check.h:39