Skip to content

Commit 2f4a934

Browse files
committed
Fix MFT DCS DP processor
1 parent 3709196 commit 2f4a934

2 files changed

Lines changed: 16 additions & 17 deletions

File tree

Detectors/ITSMFT/MFT/condition/src/MFTDCSProcessor.cxx

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,20 @@ int MFTDCSProcessor::process(const gsl::span<const DPCOM> dps)
6363
mStartTFset = true;
6464
}
6565

66-
std::unordered_map<DPID, DPVAL> mapin;
67-
for (auto& it : dps) {
68-
mapin[it.id] = it.data;
69-
}
70-
for (auto& it : mPids) {
71-
const auto& el = mapin.find(it.first);
72-
if (el == mapin.end()) {
73-
LOG(debug) << "DP " << it.first << " not found in map";
74-
} else {
75-
LOG(debug) << "DP " << it.first << " found in map";
66+
if (false) { // RS: why do we need to lose CPU on this dummy check?
67+
std::unordered_map<DPID, DPVAL> mapin;
68+
for (auto& it : dps) {
69+
mapin[it.id] = it.data;
70+
}
71+
for (auto& it : mPids) {
72+
const auto& el = mapin.find(it.first);
73+
if (el == mapin.end()) {
74+
LOG(debug) << "DP " << it.first << " not found in map";
75+
} else {
76+
LOG(debug) << "DP " << it.first << " found in map";
77+
}
7678
}
7779
}
78-
7980
// now we process all DPs, one by one
8081
for (const auto& it : dps) {
8182
// we process only the DPs defined in the configuration
@@ -91,7 +92,6 @@ int MFTDCSProcessor::process(const gsl::span<const DPCOM> dps)
9192
processDP(new_it);
9293
*/
9394
processDP(it);
94-
9595
mPids[it.id] = true;
9696
}
9797

@@ -156,11 +156,12 @@ void MFTDCSProcessor::updateDPsCCDB()
156156
double double_value;
157157
} converter0, converter1;
158158

159-
for (const auto& it : mPids) {
159+
for (auto& it : mPids) {
160160
const auto& type = it.first.get_type();
161161
if (type == o2::dcs::DPVAL_DOUBLE) {
162162
auto& mftdcs = mMFTDCS[it.first];
163-
if (it.second == true) { // we processed the DP at least 1x
163+
if (it.second) { // we processed the DP at least 1x
164+
it.second = false; // once the point was used, reset it
164165
auto& dpvect = mDpsdoublesmap[it.first];
165166
mftdcs.firstValue.first = dpvect[0].get_epoch_time();
166167
converter0.raw_data = dpvect[0].payload_pt1;

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,6 @@ class MFTDCSDataProcessor : public o2::framework::Task
146146

147147
auto timeNow = HighResClock::now();
148148
Duration elapsedTime = timeNow - mTimer; // in seconds
149-
150149
if (elapsedTime.count() >= mDPsUpdateInterval) {
151150
sendDPsoutput(pc.outputs());
152151
mTimer = timeNow;
@@ -183,8 +182,7 @@ class MFTDCSDataProcessor : public o2::framework::Task
183182
}
184183

185184
if (tend == -1) {
186-
constexpr long SECONDSPERYEAR = 365 * 24 * 60 * 60;
187-
tend = o2::ccdb::getFutureTimestamp(SECONDSPERYEAR);
185+
tend = tstart + o2::ccdb::CcdbObjectInfo::MONTH;
188186
}
189187

190188
info.setStartValidityTimestamp(tstart);

0 commit comments

Comments
 (0)