Skip to content

Commit ca2f7a6

Browse files
committed
TRD: remove run number DPs CCDB upload
1 parent 0fc2f06 commit ca2f7a6

3 files changed

Lines changed: 4 additions & 95 deletions

File tree

Detectors/TRD/calibration/include/TRDCalibration/DCSProcessor.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,12 @@ class DCSProcessor
6363
bool updateVoltagesDPsCCDB();
6464
bool updateCurrentsDPsCCDB();
6565
bool updateEnvDPsCCDB();
66-
bool updateRunDPsCCDB();
6766
// LB: new DPs for Fed
6867
bool updateFedChamberStatusDPsCCDB();
6968
bool updateFedCFGtagDPsCCDB();
7069

7170
// signal that the CCDB object for the voltages should be updated due to change exceeding threshold
7271
bool shouldUpdateVoltages() const { return mShouldUpdateVoltages; }
73-
bool shouldUpdateRun() const { return mShouldUpdateRun; }
7472
// LB: Only update ChamberStatus/CFGtag if both conditions are met (complete DPs and new run)
7573
bool shouldUpdateFedChamberStatus() const { return mFedChamberStatusCompleteDPs && mFirstRunEntryForFedChamberStatusUpdate; }
7674
bool shouldUpdateFedCFGtag() const { return mFedCFGtagCompleteDPs && mFirstRunEntryForFedCFGtagUpdate; }
@@ -91,14 +89,13 @@ class DCSProcessor
9189
CcdbObjectInfo& getccdbVoltagesDPsInfo() { return mCcdbVoltagesDPsInfo; }
9290
CcdbObjectInfo& getccdbCurrentsDPsInfo() { return mCcdbCurrentsDPsInfo; }
9391
CcdbObjectInfo& getccdbEnvDPsInfo() { return mCcdbEnvDPsInfo; }
94-
CcdbObjectInfo& getccdbRunDPsInfo() { return mCcdbRunDPsInfo; }
9592
CcdbObjectInfo& getccdbFedChamberStatusDPsInfo() { return mCcdbFedChamberStatusDPsInfo; }
9693
CcdbObjectInfo& getccdbFedCFGtagDPsInfo() { return mCcdbFedCFGtagDPsInfo; }
94+
9795
const std::unordered_map<DPID, TRDDCSMinMaxMeanInfo>& getTRDGasDPsInfo() const { return mTRDDCSGas; }
9896
const std::unordered_map<DPID, float>& getTRDVoltagesDPsInfo() const { return mTRDDCSVoltages; }
9997
const std::unordered_map<DPID, TRDDCSMinMaxMeanInfo>& getTRDCurrentsDPsInfo() const { return mTRDDCSCurrents; }
10098
const std::unordered_map<DPID, TRDDCSMinMaxMeanInfo>& getTRDEnvDPsInfo() const { return mTRDDCSEnv; }
101-
const std::unordered_map<DPID, int>& getTRDRunDPsInfo() const { return mTRDDCSRun; }
10299
const std::array<int, constants::MAXCHAMBER>& getTRDFedChamberStatusDPsInfo() const { return mTRDDCSFedChamberStatus; }
103100
const std::array<string, constants::MAXCHAMBER>& getTRDFedCFGtagDPsInfo() const { return mTRDDCSFedCFGtag; }
104101

@@ -128,7 +125,6 @@ class DCSProcessor
128125
std::unordered_map<DPID, TRDDCSMinMaxMeanInfo> mTRDDCSCurrents; ///< anode and drift currents
129126
std::unordered_map<DPID, float> mTRDDCSVoltages; ///< anode and drift voltages
130127
std::unordered_map<DPID, TRDDCSMinMaxMeanInfo> mTRDDCSEnv; ///< environment parameters (temperatures, pressures, humidity)
131-
std::unordered_map<DPID, int> mTRDDCSRun; ///< run number (run type ignored)
132128
// LB: new DPs for Fed
133129
std::array<int, constants::MAXCHAMBER> mTRDDCSFedChamberStatus; ///< fed chamber status
134130
std::array<string, constants::MAXCHAMBER> mTRDDCSFedCFGtag; ///< fed config tag
@@ -140,7 +136,6 @@ class DCSProcessor
140136
CcdbObjectInfo mCcdbVoltagesDPsInfo;
141137
CcdbObjectInfo mCcdbCurrentsDPsInfo;
142138
CcdbObjectInfo mCcdbEnvDPsInfo;
143-
CcdbObjectInfo mCcdbRunDPsInfo;
144139
// LB: new DPs for Fed
145140
CcdbObjectInfo mCcdbFedChamberStatusDPsInfo;
146141
CcdbObjectInfo mCcdbFedCFGtagDPsInfo;
@@ -149,8 +144,6 @@ class DCSProcessor
149144
TFType mVoltagesStartTS; ///< the time stamp of the first TF which was processesd for the current voltages CCDB object
150145
TFType mCurrentsStartTS; ///< the time stamp of the first TF which was processesd for the current voltages CCDB object
151146
TFType mEnvStartTS;
152-
TFType mRunStartTS;
153-
TFType mRunEndTS;
154147
// LB: new DPs for Fed
155148
TFType mFedChamberStatusStartTS;
156149
TFType mFedCFGtagStartTS;
@@ -159,13 +152,11 @@ class DCSProcessor
159152
bool mVoltagesStartTSSet{false};
160153
bool mCurrentsStartTSSet{false};
161154
bool mEnvStartTSSet{false};
162-
bool mRunStartTSSet{false};
163155
// LB: new DPs for Fed
164156
bool mFedChamberStatusStartTSSet{false};
165157
bool mFedCFGtagStartTSSet{false};
166158
std::bitset<constants::MAXCHAMBER> mVoltageSet{};
167159
bool mShouldUpdateVoltages{false};
168-
bool mShouldUpdateRun{false};
169160
// LB: FedChamberStatus and FedCFGtag logic
170161
bool mFedChamberStatusCompleteDPs{false};
171162
bool mFedCFGtagCompleteDPs{false};

Detectors/TRD/calibration/src/DCSProcessor.cxx

Lines changed: 0 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -198,32 +198,21 @@ int DCSProcessor::processDP(const DPCOM& dpcom)
198198

199199
if (type == DPVAL_INT) {
200200
if (std::strstr(dpid.get_alias(), "trd_fed_runNo") != nullptr) { // DP is trd_fed_runNo
201-
if (!mRunStartTSSet) {
202-
mRunStartTS = mCurrentTS;
203-
mRunStartTSSet = true;
204-
}
205-
206-
auto& runNumber = mTRDDCSRun[dpid];
207-
208201
// LB: Check if new value is a valid run number (0 = cleared variable)
209202
if (o2::dcs::getValue<int32_t>(dpcom) > 0) {
210203
// If value has changed from previous one, new run has begun and update
211204
if (o2::dcs::getValue<int32_t>(dpcom) != mCurrentRunNumber) {
212205
LOG(info) << "New run number " << o2::dcs::getValue<int32_t>(dpcom) << " differs from the old one " << mCurrentRunNumber;
213-
mShouldUpdateRun = true;
214206
// LB: two different flags as they reset separately, after upload of CCDB, for each object
215207
mFirstRunEntryForFedChamberStatusUpdate = true;
216208
mFirstRunEntryForFedCFGtagUpdate = true;
217209
// LB: reset alarm counters
218210
mFedChamberStatusAlarmCounter = 0;
219211
mFedCFGtagAlarmCounter = 0;
220-
mRunEndTS = mCurrentTS;
221212
}
222213

223214
// LB: Save current run number
224215
mCurrentRunNumber = o2::dcs::getValue<int32_t>(dpcom);
225-
// Save to mTRDDCSRun
226-
runNumber = mCurrentRunNumber;
227216
}
228217

229218
if (mVerbosity > 2) {
@@ -476,38 +465,6 @@ bool DCSProcessor::updateEnvDPsCCDB()
476465
return retVal;
477466
}
478467

479-
bool DCSProcessor::updateRunDPsCCDB()
480-
{
481-
// here we create the object containing the run data points to then be sent to CCDB
482-
LOG(info) << "Preparing CCDB object for TRD run DPs";
483-
484-
bool retVal = false; // set to 'true' in case at least one DP for run has been processed
485-
486-
for (const auto& it : mPids) {
487-
const auto& type = it.first.get_type();
488-
if (type == o2::dcs::DPVAL_INT) {
489-
if (std::strstr(it.first.get_alias(), "trd_fed_run") != nullptr) {
490-
if (it.second == true) { // we processed the DP at least 1x
491-
retVal = true;
492-
}
493-
if (mVerbosity > 0) {
494-
LOG(info) << "PID = " << it.first.get_alias() << ". Value = " << mTRDDCSRun[it.first];
495-
}
496-
}
497-
}
498-
}
499-
std::map<std::string, std::string> md;
500-
md["responsible"] = "Leonardo Barreto";
501-
// Redundancy for testing, this object is updated after run ended, so need to write old run number, not current
502-
// md["runNumber"] = std::to_string(mFinishedRunNumber);
503-
o2::calibration::Utils::prepareCCDBobjectInfo(mTRDDCSRun, mCcdbRunDPsInfo, "TRD/Calib/DCSDPsRun", md, mRunStartTS, mRunEndTS);
504-
505-
// LB: Deactivated upload of Run DPs to CCDB even if processed
506-
// To turn it back on just comment the next line
507-
retVal = false;
508-
return retVal;
509-
}
510-
511468
bool DCSProcessor::updateFedChamberStatusDPsCCDB()
512469
{
513470
// here we create the object containing the fedChamberStatus data points to then be sent to CCDB
@@ -637,22 +594,6 @@ void DCSProcessor::clearEnvDPsInfo()
637594
}
638595
}
639596

640-
void DCSProcessor::clearRunDPsInfo()
641-
{
642-
mTRDDCSRun.clear();
643-
mRunStartTSSet = false;
644-
mShouldUpdateRun = false;
645-
// reset the 'processed' flags for the run DPs
646-
for (auto& it : mPids) {
647-
const auto& type = it.first.get_type();
648-
if (type == o2::dcs::DPVAL_INT) {
649-
if (std::strstr(it.first.get_alias(), "trd_fed_run") != nullptr) {
650-
it.second = false;
651-
}
652-
}
653-
}
654-
}
655-
656597
void DCSProcessor::clearFedChamberStatusDPsInfo()
657598
{
658599
// mTRDDCSFedChamberStatus should not be cleared after upload giving alarm/warn logic

Detectors/TRD/calibration/workflow/TRDDCSDataProcessorSpec.h

Lines changed: 3 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,9 @@ class TRDDCSDataProcessor : public o2::framework::Task
209209
if (mProcessor->shouldUpdateFedCFGtag()) {
210210
sendDPsoutputFedCFGtag(pc.outputs());
211211
}
212-
213-
if (mProcessor->shouldUpdateRun()) {
214-
sendDPsoutputRun(pc.outputs());
215-
}
212+
216213
sw.Stop();
214+
217215
if (mReportTiming) {
218216
LOGP(info, "Timing CPU:{:.3e} Real:{:.3e} at slice {}", sw.CpuTime(), sw.RealTime(), pc.services().get<o2::framework::TimingInfo>().timeslice);
219217
}
@@ -225,7 +223,6 @@ class TRDDCSDataProcessor : public o2::framework::Task
225223
sendDPsoutputVoltages(ec.outputs());
226224
sendDPsoutputCurrents(ec.outputs());
227225
sendDPsoutputEnv(ec.outputs());
228-
sendDPsoutputRun(ec.outputs());
229226
// LB: new DPs for Fed
230227
sendDPsoutputFedChamberStatus(ec.outputs());
231228
sendDPsoutputFedCFGtag(ec.outputs());
@@ -325,26 +322,6 @@ class TRDDCSDataProcessor : public o2::framework::Task
325322
}
326323
}
327324

328-
//________________________________________________________________
329-
void sendDPsoutputRun(DataAllocator& output)
330-
{
331-
// extract CCDB infos and calibration object for DPs
332-
if (mProcessor->updateRunDPsCCDB()) {
333-
const auto& payload = mProcessor->getTRDRunDPsInfo();
334-
auto& info = mProcessor->getccdbRunDPsInfo();
335-
auto image = o2::ccdb::CcdbApi::createObjectImage(&payload, &info);
336-
LOG(info) << "Sending object " << info.getPath() << "/" << info.getFileName() << " of size " << image->size()
337-
<< " bytes, valid for " << info.getStartValidityTimestamp() << " : " << info.getEndValidityTimestamp();
338-
output.snapshot(Output{o2::calibration::Utils::gDataOriginCDBPayload, "TRD_DCSRunDPs", 0}, *image.get());
339-
output.snapshot(Output{o2::calibration::Utils::gDataOriginCDBWrapper, "TRD_DCSRunDPs", 0}, info);
340-
mProcessor->clearRunDPsInfo();
341-
} else {
342-
auto& info = mProcessor->getccdbRunDPsInfo();
343-
// LOG(info) << "Not sending object " << info.getPath() << "/" << info.getFileName() << " since no DPs were processed for it";
344-
LOG(info) << "Not sending object " << info.getPath() << "/" << info.getFileName() << " as upload of Run DPs was deactivated";
345-
}
346-
}
347-
348325
// LB: new DP for FedChamberStatus
349326
//________________________________________________________________
350327
void sendDPsoutputFedChamberStatus(DataAllocator& output)
@@ -395,7 +372,7 @@ DataProcessorSpec getTRDDCSDataProcessorSpec()
395372
{
396373

397374
std::vector<OutputSpec> outputs;
398-
375+
outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBPayload, "TRD_ChamberStat"});
399376
outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBPayload, "TRD_DCSGasDPs"});
400377
outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBWrapper, "TRD_DCSGasDPs"});
401378
outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBPayload, "TRD_DCSUDPs"});

0 commit comments

Comments
 (0)