QualityControl  1.5.1
O2 Data Quality Control Framework
RepoPathUtils.h
Go to the documentation of this file.
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 
15 
16 #ifndef QC_REPOPATH_UTILS_H
17 #define QC_REPOPATH_UTILS_H
18 
19 #include <string>
20 #include <vector>
21 #include <Common/Exceptions.h>
23 #include "QualityControl/QualityObject.h"
24 
26 {
28 {
29  public:
38  static std::string getMoPath(const std::string& detectorCode,
39  const std::string& taskName,
40  const std::string& moName)
41  {
42  std::string path = "qc/" + detectorCode + "/MO/" + taskName + "/" + moName;
43  return path;
44  }
45 
52  static std::string getMoPath(const MonitorObject* mo)
53  {
54  return getMoPath(mo->getDetectorName(), mo->getTaskName(), mo->getName());
55  }
56 
67  static std::string getQoPath(const std::string& detectorCode,
68  const std::string& checkName,
69  const std::string& policyName = "",
70  const std::vector<std::string>& monitorObjectsNames = std::vector<std::string>())
71  {
72  std::string path = "qc/" + detectorCode + "/QO/" + checkName;
73  if (policyName == "OnEachSeparately") {
74  if (monitorObjectsNames.empty()) {
75  BOOST_THROW_EXCEPTION(AliceO2::Common::FatalException() << AliceO2::Common::errinfo_details("getQoPath: The vector of monitorObjectsNames is empty."));
76  }
77  path += "/" + monitorObjectsNames[0];
78  }
79  return path;
80  }
81 
89  static std::string getQoPath(const QualityObject* qo)
90  {
91  return getQoPath(qo->getDetectorName(), qo->getCheckName(), qo->getPolicyName(), qo->getMonitorObjectsNames());
92  }
93 };
94 } // namespace o2::quality_control::core
95 
96 #endif // QC_REPOPATH_UTILS_H
static std::string getMoPath(const MonitorObject *mo)
Definition: RepoPathUtils.h:52
static std::string getMoPath(const std::string &detectorCode, const std::string &taskName, const std::string &moName)
Definition: RepoPathUtils.h:38
static std::string getQoPath(const std::string &detectorCode, const std::string &checkName, const std::string &policyName="", const std::vector< std::string > &monitorObjectsNames=std::vector< std::string >())
Definition: RepoPathUtils.h:67
Encapsulation of a Quality into a TObject that can be streamed and stored.
Definition: QualityObject.h:29
static std::string getQoPath(const QualityObject *qo)
Definition: RepoPathUtils.h:89
These methods can be used to build a complex processing topology. It spawns 3 separate dummy processi...
Definition: Activity.h:19
This class keeps the meta data about one published object.
Definition: MonitorObject.h:41
Definition: RepoPathUtils.h:27
const std::string getName() const
Return the name of the encapsulated object (if any).
Definition: MonitorObject.cxx:53