Project
Loading...
Searching...
No Matches
CCDBParamSpec.cxx
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
13#include <fmt/format.h>
14#include <algorithm>
15
16namespace o2::framework
17{
18
20{
21 return ConfigParamSpec{"ccdb-path", VariantType::String, path, {fmt::format("Path in CCDB ({})", path)}, ConfigParamKind::kGeneric};
22}
23
25{
26 return ConfigParamSpec{"ccdb-run-dependent", VariantType::Int, defaultValue, {"Give object for specific run number"}, ConfigParamKind::kGeneric};
27}
28
30{
31 return ConfigParamSpec{"ccdb-query-rate", VariantType::Int, r, {"Query after once every N TFs"}, ConfigParamKind::kGeneric};
32}
33
34ConfigParamSpec ccdbMetadataSpec(std::string const& key, std::string const& defaultValue)
35{
36 return ConfigParamSpec{fmt::format("ccdb-metadata-{}", key),
38 defaultValue,
39 {fmt::format("CCDB metadata {}", key)},
41}
42
43std::vector<ConfigParamSpec> ccdbParamSpec(std::string const& path, std::vector<CCDBMetadata> metadata, int qrate)
44{
45 return ccdbParamSpec(path, false, metadata, qrate);
46}
47
48std::vector<ConfigParamSpec> ccdbParamSpec(std::string const& path, int runDependent, std::vector<CCDBMetadata> metadata, int qrate)
49{
50 // Add here CCDB objecs which should be considered run dependent
51 std::vector<ConfigParamSpec> result{ccdbPathSpec(path)};
52 if (runDependent > 0) {
53 result.push_back(ccdbRunDependent(runDependent));
54 }
55 if (qrate != 0) {
56 result.push_back(ccdbQueryRateSpec(qrate < 0 ? std::numeric_limits<int>::max() : qrate));
57 }
58 for (auto& [key, value] : metadata) {
59 result.push_back(ccdbMetadataSpec(key, value));
60 }
61 return result;
62}
63
65{
66 return ConfigParamSpec{"start-value-enumeration", VariantType::Int64, t, {fmt::format("start time for enumeration ({})", t)}, ConfigParamKind::kGeneric};
67}
68
69} // namespace o2::framework
StringRef key
GLuint64EXT * result
Definition glcorearb.h:5662
GLsizei const GLfloat * value
Definition glcorearb.h:819
GLsizei const GLchar *const * path
Definition glcorearb.h:3591
GLboolean r
Definition glcorearb.h:1233
Defining PrimaryVertex explicitly as messageable.
Definition TFIDInfo.h:20
ConfigParamSpec ccdbQueryRateSpec(int r)
std::vector< ConfigParamSpec > ccdbParamSpec(std::string const &path, int runDependent, std::vector< CCDBMetadata > metadata={}, int qrate=0)
ConfigParamSpec ccdbPathSpec(std::string const &path)
ConfigParamSpec ccdbRunDependent(int defaultValue=1)
ConfigParamSpec startTimeParamSpec(int64_t t)
ConfigParamSpec ccdbMetadataSpec(std::string const &key, std::string const &defaultValue)