Skip to content

Commit f045619

Browse files
committed
Fix TOF DCS DP processing
Reset DP acknowledgment bit at the start of new period
1 parent 2f4a934 commit f045619

1 file changed

Lines changed: 15 additions & 12 deletions

File tree

Detectors/TOF/calibration/src/TOFDCSProcessor.cxx

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,18 @@ int TOFDCSProcessor::process(const gsl::span<const DPCOM> dps)
7070
mFirstTimeSet = true;
7171
}
7272

73-
std::unordered_map<DPID, DPVAL> mapin;
74-
for (auto& it : dps) {
75-
mapin[it.id] = it.data;
76-
}
77-
for (auto& it : mPids) {
78-
const auto& el = mapin.find(it.first);
79-
if (el == mapin.end()) {
80-
LOG(debug) << "DP " << it.first << " not found in map";
81-
} else {
82-
LOG(debug) << "DP " << it.first << " found in map";
73+
if (false) {
74+
std::unordered_map<DPID, DPVAL> mapin;
75+
for (auto& it : dps) {
76+
mapin[it.id] = it.data;
77+
}
78+
for (auto& it : mPids) {
79+
const auto& el = mapin.find(it.first);
80+
if (el == mapin.end()) {
81+
LOG(debug) << "DP " << it.first << " not found in map";
82+
} else {
83+
LOG(debug) << "DP " << it.first << " found in map";
84+
}
8385
}
8486
}
8587

@@ -332,11 +334,12 @@ void TOFDCSProcessor::updateDPsCCDB()
332334
double double_value;
333335
} converter0, converter1;
334336

335-
for (const auto& it : mPids) {
337+
for (auto& it : mPids) {
336338
const auto& type = it.first.get_type();
337339
if (type == o2::dcs::DPVAL_DOUBLE) {
338340
auto& tofdcs = mTOFDCS[it.first];
339-
if (it.second == true) { // we processed the DP at least 1x
341+
if (it.second) { // we processed the DP at least 1x
342+
it.second = false; // reset for the next period
340343
auto& dpvect = mDpsdoublesmap[it.first];
341344
tofdcs.firstValue.first = dpvect[0].get_epoch_time();
342345
converter0.raw_data = dpvect[0].payload_pt1;

0 commit comments

Comments
 (0)