Skip to content

Commit d803180

Browse files
syano0822shahor02
authored andcommitted
Modified CCDB server configration in MFT condition
1 parent e39ed79 commit d803180

4 files changed

Lines changed: 15 additions & 10 deletions

File tree

Detectors/ITSMFT/MFT/condition/macros/makeMFTCCDBEntryForDCS.C

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,10 @@
2222

2323
using DPID = o2::dcs::DataPointIdentifier;
2424

25-
int makeMFTCCDBEntryForDCS(const std::string url = "http://ccdb-test.cern.ch:8080")
25+
int makeMFTCCDBEntryForDCS(std::string ccdb_path = o2::base::NameConf::getCCDBServer())
2626
{
2727

28-
// std::string url(argv[0]);
29-
// macro to populate CCDB for TOF with the configuration for DCS
3028
std::unordered_map<DPID, std::string> dpid2DataDesc;
31-
3229
std::vector<std::string> aliases = {"MFT_PSU_ZONE/H[0..1]/D[0..4]/F[0..1]/Z[0..3]/Current/Analog",
3330
"MFT_PSU_ZONE/H[0..1]/D[0..4]/F[0..1]/Z[0..3]/Current/BackBias",
3431
"MFT_PSU_ZONE/H[0..1]/D[0..4]/F[0..1]/Z[0..3]/Current/Digital",
@@ -63,7 +60,7 @@ int makeMFTCCDBEntryForDCS(const std::string url = "http://ccdb-test.cern.ch:808
6360
}
6461

6562
o2::ccdb::CcdbApi api;
66-
api.init(url); // or http://localhost:8080 for a local installation
63+
api.init(ccdb_path);
6764
std::map<std::string, std::string> md;
6865
long ts = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
6966
api.storeAsTFileAny(&dpid2DataDesc, "MFT/Config/DCSDPconfig", md, ts);

Detectors/ITSMFT/MFT/condition/macros/readMFTDCSentries.C

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
#include <bitset>
2424
#endif
2525

26-
void readMFTDCSentries(long ts = 9999999999000, const char* ccdb = "http://ccdb-test.cern.ch:8080")
26+
void readMFTDCSentries(long ts = 9999999999000, std::string ccdb_path = o2::base::NameConf::getCCDBServer())
2727
{
2828

2929
o2::mft::DCSNameResolver namer;
3030
namer.init();
3131

3232
o2::ccdb::CcdbApi api;
33-
api.init(ccdb); // or http://ccdb-test.cern.ch:8080
33+
api.init(ccdb_path); // or http://ccdb-test.cern.ch:8080
3434
std::map<std::string, std::string> metadata;
3535
if (ts == 9999999999000) {
3636
ts = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();

Detectors/ITSMFT/MFT/condition/testWorkflow/MFTDCSDataProcessorSpec.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,26 @@ class MFTDCSDataProcessor : public o2::framework::Task
5757
//________________________________________________________________
5858
void init(o2::framework::InitContext& ic) final
5959
{
60+
61+
// o2::conf::ConfigurableParam::updateFromString(ic.options().get<std::string>("configKeyValues"));
62+
6063
std::vector<DPID> vect;
6164
mDPsUpdateInterval = ic.options().get<int64_t>("DPs-update-interval");
6265
if (mDPsUpdateInterval == 0) {
6366
LOG(error) << "MFT DPs update interval set to zero seconds --> changed to 60";
6467
mDPsUpdateInterval = 60;
6568
}
69+
6670
bool useCCDBtoConfigure = ic.options().get<bool>("use-ccdb-to-configure");
6771

6872
mStart = ic.options().get<int64_t>("tstart");
6973
mEnd = ic.options().get<int64_t>("tend");
7074

7175
if (useCCDBtoConfigure) {
7276
LOG(info) << "Configuring via CCDB";
73-
std::string ccdbpath = ic.options().get<std::string>("ccdb-path");
77+
7478
auto& mgr = CcdbManager::instance();
75-
mgr.setURL(ccdbpath);
79+
mgr.setURL(o2::base::NameConf::getCCDBServer());
7680
CcdbApi api;
7781
api.init(mgr.getURL());
7882
long ts = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
@@ -219,11 +223,11 @@ DataProcessorSpec getMFTDCSDataProcessorSpec()
219223
outputs,
220224
AlgorithmSpec{adaptFromTask<o2::mft::MFTDCSDataProcessor>()},
221225
Options{
222-
{"ccdb-path", VariantType::String, "http://localhost:8080", {"Path to CCDB"}},
223226
{"tstart", VariantType::Int64, -1ll, {"Start of validity timestamp"}},
224227
{"tend", VariantType::Int64, -1ll, {"End of validity timestamp"}},
225228
{"use-ccdb-to-configure", VariantType::Bool, false, {"Use CCDB to configure"}},
226229
{"use-verbose-mode", VariantType::Bool, false, {"Use verbose mode"}},
230+
//{"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}},
227231
{"DPs-update-interval", VariantType::Int64, 600ll, {"Interval (in s) after which to update the DPs CCDB entry"}}}};
228232
}
229233

Detectors/ITSMFT/MFT/condition/testWorkflow/mft-dcs-data-workflow.cxx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ using namespace o2::framework;
2828
void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
2929
{
3030
// option allowing to set parameters
31+
std::vector<o2::framework::ConfigParamSpec> options{
32+
{"configKeyValues", VariantType::String, "", {"Semicolon separated key=value strings"}}};
33+
std::swap(workflowOptions, options);
3134
}
3235

3336
// ------------------------------------------------------------------
@@ -37,6 +40,7 @@ void customize(std::vector<o2::framework::ConfigParamSpec>& workflowOptions)
3740
WorkflowSpec defineDataProcessing(ConfigContext const& configcontext)
3841
{
3942
WorkflowSpec specs;
43+
o2::conf::ConfigurableParam::updateFromString(configcontext.options().get<std::string>("configKeyValues"));
4044
specs.emplace_back(getMFTDCSDataProcessorSpec());
4145
return specs;
4246
}

0 commit comments

Comments
 (0)