QualityControl  1.5.1
O2 Data Quality Control Framework
QualityObject.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_CORE_QUALITYOBJECT_H
12 #define QC_CORE_QUALITYOBJECT_H
13 
14 // std
15 #include <map>
16 // ROOT
17 #include <TObject.h>
18 // O2
19 #include <Common/Exceptions.h>
20 // QC
21 #include "QualityControl/Quality.h"
22 
24 {
25 
29 class QualityObject : public TObject
30 {
31  public:
33  QualityObject();
34 
36  Quality quality,
37  std::string checkName,
38  std::string detectorName = "DET",
39  std::string policyName = "",
40  std::vector<std::string> inputs = {},
41  std::vector<std::string> monitorObjectsNames = {},
42  std::map<std::string, std::string> metadata = {});
43 
45  ~QualityObject() override;
46 
48  QualityObject(const QualityObject& other) = default;
50  QualityObject(QualityObject&& other) /*noexcept*/ = default;
52  QualityObject& operator=(const QualityObject& other) = default;
54  QualityObject& operator=(QualityObject&& other) /*noexcept*/ = default;
55 
56  friend std::ostream& operator<<(std::ostream& out, const QualityObject& q); // output
57 
61  std::string getName() const;
62 
66  const char* GetName() const override;
67 
76  void updateQuality(Quality quality);
77  Quality getQuality() const;
78 
82  void setInputs(std::vector<std::string> inputs) { mInputs = inputs; }
83  std::vector<std::string> getInputs() const { return mInputs; }
84 
88  void addMetadata(std::string key, std::string value);
92  void addMetadata(std::map<std::string, std::string> pairs);
95  void updateMetadata(std::string key, std::string value);
97  const std::map<std::string, std::string>& getMetadataMap() const;
101  const std::string getMetadata(std::string key);
102 
107  std::string getPath() const;
108 
109  const std::string& getDetectorName() const;
110  void setDetectorName(const std::string& detectorName);
111 
112  void setQuality(const Quality& quality);
113  const std::string& getCheckName() const;
114 
115  const std::string& getPolicyName() const;
116 
117  const std::vector<std::string> getMonitorObjectsNames() const;
118 
119  private:
120  Quality mQuality;
121  std::string mCheckName;
122  std::string mDetectorName;
123  std::string mPolicyName;
124  std::vector<std::string> mInputs;
125  std::vector<std::string> mMonitorObjectsNames;
126 
127  ClassDefOverride(QualityObject, 3);
128 };
129 
130 using QualityObjectsType = std::vector<std::shared_ptr<QualityObject>>;
131 using QualityObjectsMapType = std::map<std::string, std::shared_ptr<const QualityObject>>;
132 
133 } // namespace o2::quality_control::core
134 
135 #endif
std::string getName() const
Return the name of the check.
Definition: QualityObject.cxx:54
QualityObject()
Default constructor.
Definition: QualityObject.cxx:43
const std::map< std::string, std::string > & getMetadataMap() const
Get the full map of user&#39;s metadata.
Definition: QualityObject.cxx:86
QualityObject & operator=(const QualityObject &other)=default
Copy assignment operator.
const std::string getMetadata(std::string key)
Get a metadata.
Definition: QualityObject.cxx:96
Class representing the quality of a MonitorObject.
Definition: Quality.h:29
void setInputs(std::vector< std::string > inputs)
Definition: QualityObject.h:82
Encapsulation of a Quality into a TObject that can be streamed and stored.
Definition: QualityObject.h:29
void updateMetadata(std::string key, std::string value)
Update the value of metadata. If the key does not exist it will ignore it.
Definition: QualityObject.cxx:91
const char * GetName() const override
Return the name of the check.
Definition: QualityObject.cxx:48
std::string getPath() const
Build the path to this object. Build the path to this object as it will appear in the GUI...
Definition: QualityObject.cxx:101
These methods can be used to build a complex processing topology. It spawns 3 separate dummy processi...
Definition: Activity.h:19
void updateQuality(Quality quality)
Get the quality of this object.
Definition: QualityObject.cxx:66
void addMetadata(std::string key, std::string value)
Add key value pair that will end up in the database Add a metadata (key value pair) to the QualityObj...
Definition: QualityObject.cxx:76