forked from AliceO2Group/QualityControl
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPostProcessingConfig.cxx
More file actions
67 lines (60 loc) · 3.13 KB
/
PostProcessingConfig.cxx
File metadata and controls
67 lines (60 loc) · 3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
///
/// \file PostProcessingConfig.cxx
/// \author Piotr Konopka
///
#include "QualityControl/PostProcessingConfig.h"
#include <boost/property_tree/ptree.hpp>
namespace o2::quality_control::postprocessing
{
PostProcessingConfig::PostProcessingConfig(const std::string& id, const boost::property_tree::ptree& config) //
: id(id),
taskName(config.get<std::string>("qc.postprocessing." + id + ".taskName", id)),
activity(config.get<int>("qc.config.Activity.number", 0),
config.get<std::string>("qc.config.Activity.type", "NONE"),
config.get<std::string>("qc.config.Activity.periodName", ""),
config.get<std::string>("qc.config.Activity.passName", ""),
config.get<std::string>("qc.config.Activity.provenance", "qc"),
{ config.get<uint64_t>("qc.config.Activity.start", 0),
config.get<uint64_t>("qc.config.Activity.end", -1) }),
matchAnyRunNumber(config.get<bool>("qc.config.postprocessing.matchAnyRunNumber", false)),
critical(true)
{
moduleName = config.get<std::string>("qc.postprocessing." + id + ".moduleName");
className = config.get<std::string>("qc.postprocessing." + id + ".className");
detectorName = config.get<std::string>("qc.postprocessing." + id + ".detectorName", "MISC");
consulUrl = config.get<std::string>("qc.config.consul.url", "");
conditionUrl = config.get<std::string>("qc.config.conditionDB.url", "");
std::unordered_map<std::string, std::string> dbConfig{
{ "implementation", config.get<std::string>("qc.config.database.implementation") },
{ "host", config.get<std::string>("qc.config.database.host") }
};
database = dbConfig;
for (const auto& initTrigger : config.get_child("qc.postprocessing." + id + ".initTrigger")) {
initTriggers.push_back(initTrigger.second.get_value<std::string>());
}
for (const auto& updateTrigger : config.get_child("qc.postprocessing." + id + ".updateTrigger")) {
updateTriggers.push_back(updateTrigger.second.get_value<std::string>());
}
for (const auto& stopTrigger : config.get_child("qc.postprocessing." + id + ".stopTrigger")) {
stopTriggers.push_back(stopTrigger.second.get_value<std::string>());
}
auto ppTree = config.get_child("qc.postprocessing." + id);
if (ppTree.count("extendedTaskParameters")) {
customParameters.populateCustomParameters(ppTree.get_child("extendedTaskParameters"));
} else if (ppTree.count("taskParameters") > 0) {
for (const auto& [key, value] : ppTree.get_child("taskParameters")) {
customParameters.set(key, value.get_value<std::string>());
}
}
}
} // namespace o2::quality_control::postprocessing