QualityControl  1.5.1
O2 Data Quality Control Framework
runnerUtils.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 QUALITYCONTROL_RUNNERUTILS_H
17 #define QUALITYCONTROL_RUNNERUTILS_H
18 
19 #include <string>
20 #include <Configuration/ConfigurationFactory.h>
21 #include <Common/Exceptions.h>
22 
24 {
25 
33 std::string getFirstTaskName(std::string configurationSource)
34 {
35  auto config = o2::configuration::ConfigurationFactory::getConfiguration(configurationSource);
36 
37  for (const auto& task : config->getRecursive("qc.tasks")) {
38  return task.first; // task name;
39  }
40 
41  throw;
42 }
43 
44 std::string getFirstCheckName(std::string configurationSource)
45 {
46  auto config = o2::configuration::ConfigurationFactory::getConfiguration(configurationSource);
47 
48  if (config->getRecursive("qc").count("checks")) {
49  for (const auto& check : config->getRecursive("qc.checks")) {
50  return check.first; // check name;
51  }
52  }
53 
54  BOOST_THROW_EXCEPTION(AliceO2::Common::ObjectNotFoundError() << AliceO2::Common::errinfo_details("No checks defined"));
55 }
56 
57 bool hasChecks(std::string configSource)
58 {
59  auto config = o2::configuration::ConfigurationFactory::getConfiguration(configSource);
60  return config->getRecursive("qc").count("checks") > 0;
61 }
62 
63 } // namespace o2::quality_control::core
64 
65 #endif //QUALITYCONTROL_RUNNERUTILS_H
std::string getFirstTaskName(std::string configurationSource)
Definition: runnerUtils.h:33
These methods can be used to build a complex processing topology. It spawns 3 separate dummy processi...
Definition: Activity.h:19