From ca2f7a6d71a91ad53bca64a4f3a9106cd03aa0d7 Mon Sep 17 00:00:00 2001 From: leo-barreto Date: Fri, 23 Feb 2024 00:17:01 +0100 Subject: [PATCH 1/5] TRD: remove run number DPs CCDB upload --- .../include/TRDCalibration/DCSProcessor.h | 11 +--- .../TRD/calibration/src/DCSProcessor.cxx | 59 ------------------- .../workflow/TRDDCSDataProcessorSpec.h | 29 +-------- 3 files changed, 4 insertions(+), 95 deletions(-) diff --git a/Detectors/TRD/calibration/include/TRDCalibration/DCSProcessor.h b/Detectors/TRD/calibration/include/TRDCalibration/DCSProcessor.h index 7ff85499835f4..3f26457917d0c 100644 --- a/Detectors/TRD/calibration/include/TRDCalibration/DCSProcessor.h +++ b/Detectors/TRD/calibration/include/TRDCalibration/DCSProcessor.h @@ -63,14 +63,12 @@ class DCSProcessor bool updateVoltagesDPsCCDB(); bool updateCurrentsDPsCCDB(); bool updateEnvDPsCCDB(); - bool updateRunDPsCCDB(); // LB: new DPs for Fed bool updateFedChamberStatusDPsCCDB(); bool updateFedCFGtagDPsCCDB(); // signal that the CCDB object for the voltages should be updated due to change exceeding threshold bool shouldUpdateVoltages() const { return mShouldUpdateVoltages; } - bool shouldUpdateRun() const { return mShouldUpdateRun; } // LB: Only update ChamberStatus/CFGtag if both conditions are met (complete DPs and new run) bool shouldUpdateFedChamberStatus() const { return mFedChamberStatusCompleteDPs && mFirstRunEntryForFedChamberStatusUpdate; } bool shouldUpdateFedCFGtag() const { return mFedCFGtagCompleteDPs && mFirstRunEntryForFedCFGtagUpdate; } @@ -91,14 +89,13 @@ class DCSProcessor CcdbObjectInfo& getccdbVoltagesDPsInfo() { return mCcdbVoltagesDPsInfo; } CcdbObjectInfo& getccdbCurrentsDPsInfo() { return mCcdbCurrentsDPsInfo; } CcdbObjectInfo& getccdbEnvDPsInfo() { return mCcdbEnvDPsInfo; } - CcdbObjectInfo& getccdbRunDPsInfo() { return mCcdbRunDPsInfo; } CcdbObjectInfo& getccdbFedChamberStatusDPsInfo() { return mCcdbFedChamberStatusDPsInfo; } CcdbObjectInfo& getccdbFedCFGtagDPsInfo() { return mCcdbFedCFGtagDPsInfo; } + const std::unordered_map& getTRDGasDPsInfo() const { return mTRDDCSGas; } const std::unordered_map& getTRDVoltagesDPsInfo() const { return mTRDDCSVoltages; } const std::unordered_map& getTRDCurrentsDPsInfo() const { return mTRDDCSCurrents; } const std::unordered_map& getTRDEnvDPsInfo() const { return mTRDDCSEnv; } - const std::unordered_map& getTRDRunDPsInfo() const { return mTRDDCSRun; } const std::array& getTRDFedChamberStatusDPsInfo() const { return mTRDDCSFedChamberStatus; } const std::array& getTRDFedCFGtagDPsInfo() const { return mTRDDCSFedCFGtag; } @@ -128,7 +125,6 @@ class DCSProcessor std::unordered_map mTRDDCSCurrents; ///< anode and drift currents std::unordered_map mTRDDCSVoltages; ///< anode and drift voltages std::unordered_map mTRDDCSEnv; ///< environment parameters (temperatures, pressures, humidity) - std::unordered_map mTRDDCSRun; ///< run number (run type ignored) // LB: new DPs for Fed std::array mTRDDCSFedChamberStatus; ///< fed chamber status std::array mTRDDCSFedCFGtag; ///< fed config tag @@ -140,7 +136,6 @@ class DCSProcessor CcdbObjectInfo mCcdbVoltagesDPsInfo; CcdbObjectInfo mCcdbCurrentsDPsInfo; CcdbObjectInfo mCcdbEnvDPsInfo; - CcdbObjectInfo mCcdbRunDPsInfo; // LB: new DPs for Fed CcdbObjectInfo mCcdbFedChamberStatusDPsInfo; CcdbObjectInfo mCcdbFedCFGtagDPsInfo; @@ -149,8 +144,6 @@ class DCSProcessor TFType mVoltagesStartTS; ///< the time stamp of the first TF which was processesd for the current voltages CCDB object TFType mCurrentsStartTS; ///< the time stamp of the first TF which was processesd for the current voltages CCDB object TFType mEnvStartTS; - TFType mRunStartTS; - TFType mRunEndTS; // LB: new DPs for Fed TFType mFedChamberStatusStartTS; TFType mFedCFGtagStartTS; @@ -159,13 +152,11 @@ class DCSProcessor bool mVoltagesStartTSSet{false}; bool mCurrentsStartTSSet{false}; bool mEnvStartTSSet{false}; - bool mRunStartTSSet{false}; // LB: new DPs for Fed bool mFedChamberStatusStartTSSet{false}; bool mFedCFGtagStartTSSet{false}; std::bitset mVoltageSet{}; bool mShouldUpdateVoltages{false}; - bool mShouldUpdateRun{false}; // LB: FedChamberStatus and FedCFGtag logic bool mFedChamberStatusCompleteDPs{false}; bool mFedCFGtagCompleteDPs{false}; diff --git a/Detectors/TRD/calibration/src/DCSProcessor.cxx b/Detectors/TRD/calibration/src/DCSProcessor.cxx index ec86cbbd5df4d..a9d460ba96b3a 100644 --- a/Detectors/TRD/calibration/src/DCSProcessor.cxx +++ b/Detectors/TRD/calibration/src/DCSProcessor.cxx @@ -198,32 +198,21 @@ int DCSProcessor::processDP(const DPCOM& dpcom) if (type == DPVAL_INT) { if (std::strstr(dpid.get_alias(), "trd_fed_runNo") != nullptr) { // DP is trd_fed_runNo - if (!mRunStartTSSet) { - mRunStartTS = mCurrentTS; - mRunStartTSSet = true; - } - - auto& runNumber = mTRDDCSRun[dpid]; - // LB: Check if new value is a valid run number (0 = cleared variable) if (o2::dcs::getValue(dpcom) > 0) { // If value has changed from previous one, new run has begun and update if (o2::dcs::getValue(dpcom) != mCurrentRunNumber) { LOG(info) << "New run number " << o2::dcs::getValue(dpcom) << " differs from the old one " << mCurrentRunNumber; - mShouldUpdateRun = true; // LB: two different flags as they reset separately, after upload of CCDB, for each object mFirstRunEntryForFedChamberStatusUpdate = true; mFirstRunEntryForFedCFGtagUpdate = true; // LB: reset alarm counters mFedChamberStatusAlarmCounter = 0; mFedCFGtagAlarmCounter = 0; - mRunEndTS = mCurrentTS; } // LB: Save current run number mCurrentRunNumber = o2::dcs::getValue(dpcom); - // Save to mTRDDCSRun - runNumber = mCurrentRunNumber; } if (mVerbosity > 2) { @@ -476,38 +465,6 @@ bool DCSProcessor::updateEnvDPsCCDB() return retVal; } -bool DCSProcessor::updateRunDPsCCDB() -{ - // here we create the object containing the run data points to then be sent to CCDB - LOG(info) << "Preparing CCDB object for TRD run DPs"; - - bool retVal = false; // set to 'true' in case at least one DP for run has been processed - - for (const auto& it : mPids) { - const auto& type = it.first.get_type(); - if (type == o2::dcs::DPVAL_INT) { - if (std::strstr(it.first.get_alias(), "trd_fed_run") != nullptr) { - if (it.second == true) { // we processed the DP at least 1x - retVal = true; - } - if (mVerbosity > 0) { - LOG(info) << "PID = " << it.first.get_alias() << ". Value = " << mTRDDCSRun[it.first]; - } - } - } - } - std::map md; - md["responsible"] = "Leonardo Barreto"; - // Redundancy for testing, this object is updated after run ended, so need to write old run number, not current - // md["runNumber"] = std::to_string(mFinishedRunNumber); - o2::calibration::Utils::prepareCCDBobjectInfo(mTRDDCSRun, mCcdbRunDPsInfo, "TRD/Calib/DCSDPsRun", md, mRunStartTS, mRunEndTS); - - // LB: Deactivated upload of Run DPs to CCDB even if processed - // To turn it back on just comment the next line - retVal = false; - return retVal; -} - bool DCSProcessor::updateFedChamberStatusDPsCCDB() { // here we create the object containing the fedChamberStatus data points to then be sent to CCDB @@ -637,22 +594,6 @@ void DCSProcessor::clearEnvDPsInfo() } } -void DCSProcessor::clearRunDPsInfo() -{ - mTRDDCSRun.clear(); - mRunStartTSSet = false; - mShouldUpdateRun = false; - // reset the 'processed' flags for the run DPs - for (auto& it : mPids) { - const auto& type = it.first.get_type(); - if (type == o2::dcs::DPVAL_INT) { - if (std::strstr(it.first.get_alias(), "trd_fed_run") != nullptr) { - it.second = false; - } - } - } -} - void DCSProcessor::clearFedChamberStatusDPsInfo() { // mTRDDCSFedChamberStatus should not be cleared after upload giving alarm/warn logic diff --git a/Detectors/TRD/calibration/workflow/TRDDCSDataProcessorSpec.h b/Detectors/TRD/calibration/workflow/TRDDCSDataProcessorSpec.h index 551a9af93ef69..8678a4cedd3fe 100644 --- a/Detectors/TRD/calibration/workflow/TRDDCSDataProcessorSpec.h +++ b/Detectors/TRD/calibration/workflow/TRDDCSDataProcessorSpec.h @@ -209,11 +209,9 @@ class TRDDCSDataProcessor : public o2::framework::Task if (mProcessor->shouldUpdateFedCFGtag()) { sendDPsoutputFedCFGtag(pc.outputs()); } - - if (mProcessor->shouldUpdateRun()) { - sendDPsoutputRun(pc.outputs()); - } + sw.Stop(); + if (mReportTiming) { LOGP(info, "Timing CPU:{:.3e} Real:{:.3e} at slice {}", sw.CpuTime(), sw.RealTime(), pc.services().get().timeslice); } @@ -225,7 +223,6 @@ class TRDDCSDataProcessor : public o2::framework::Task sendDPsoutputVoltages(ec.outputs()); sendDPsoutputCurrents(ec.outputs()); sendDPsoutputEnv(ec.outputs()); - sendDPsoutputRun(ec.outputs()); // LB: new DPs for Fed sendDPsoutputFedChamberStatus(ec.outputs()); sendDPsoutputFedCFGtag(ec.outputs()); @@ -325,26 +322,6 @@ class TRDDCSDataProcessor : public o2::framework::Task } } - //________________________________________________________________ - void sendDPsoutputRun(DataAllocator& output) - { - // extract CCDB infos and calibration object for DPs - if (mProcessor->updateRunDPsCCDB()) { - const auto& payload = mProcessor->getTRDRunDPsInfo(); - auto& info = mProcessor->getccdbRunDPsInfo(); - auto image = o2::ccdb::CcdbApi::createObjectImage(&payload, &info); - LOG(info) << "Sending object " << info.getPath() << "/" << info.getFileName() << " of size " << image->size() - << " bytes, valid for " << info.getStartValidityTimestamp() << " : " << info.getEndValidityTimestamp(); - output.snapshot(Output{o2::calibration::Utils::gDataOriginCDBPayload, "TRD_DCSRunDPs", 0}, *image.get()); - output.snapshot(Output{o2::calibration::Utils::gDataOriginCDBWrapper, "TRD_DCSRunDPs", 0}, info); - mProcessor->clearRunDPsInfo(); - } else { - auto& info = mProcessor->getccdbRunDPsInfo(); - // LOG(info) << "Not sending object " << info.getPath() << "/" << info.getFileName() << " since no DPs were processed for it"; - LOG(info) << "Not sending object " << info.getPath() << "/" << info.getFileName() << " as upload of Run DPs was deactivated"; - } - } - // LB: new DP for FedChamberStatus //________________________________________________________________ void sendDPsoutputFedChamberStatus(DataAllocator& output) @@ -395,7 +372,7 @@ DataProcessorSpec getTRDDCSDataProcessorSpec() { std::vector outputs; - + outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBPayload, "TRD_ChamberStat"}); outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBPayload, "TRD_DCSGasDPs"}); outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBWrapper, "TRD_DCSGasDPs"}); outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBPayload, "TRD_DCSUDPs"}); From 842d1117c01a67a2d38ce58898451c9951998056 Mon Sep 17 00:00:00 2001 From: leo-barreto Date: Fri, 23 Feb 2024 00:38:54 +0100 Subject: [PATCH 2/5] TRD: comments clean up --- .../include/TRDCalibration/DCSProcessor.h | 10 +--------- Detectors/TRD/calibration/src/DCSProcessor.cxx | 13 +++++++++---- .../calibration/workflow/TRDDCSDataProcessorSpec.h | 11 +---------- 3 files changed, 11 insertions(+), 23 deletions(-) diff --git a/Detectors/TRD/calibration/include/TRDCalibration/DCSProcessor.h b/Detectors/TRD/calibration/include/TRDCalibration/DCSProcessor.h index 3f26457917d0c..27cba85a89941 100644 --- a/Detectors/TRD/calibration/include/TRDCalibration/DCSProcessor.h +++ b/Detectors/TRD/calibration/include/TRDCalibration/DCSProcessor.h @@ -63,7 +63,6 @@ class DCSProcessor bool updateVoltagesDPsCCDB(); bool updateCurrentsDPsCCDB(); bool updateEnvDPsCCDB(); - // LB: new DPs for Fed bool updateFedChamberStatusDPsCCDB(); bool updateFedCFGtagDPsCCDB(); @@ -91,7 +90,7 @@ class DCSProcessor CcdbObjectInfo& getccdbEnvDPsInfo() { return mCcdbEnvDPsInfo; } CcdbObjectInfo& getccdbFedChamberStatusDPsInfo() { return mCcdbFedChamberStatusDPsInfo; } CcdbObjectInfo& getccdbFedCFGtagDPsInfo() { return mCcdbFedCFGtagDPsInfo; } - + const std::unordered_map& getTRDGasDPsInfo() const { return mTRDDCSGas; } const std::unordered_map& getTRDVoltagesDPsInfo() const { return mTRDDCSVoltages; } const std::unordered_map& getTRDCurrentsDPsInfo() const { return mTRDDCSCurrents; } @@ -112,7 +111,6 @@ class DCSProcessor void clearCurrentsDPsInfo(); void clearEnvDPsInfo(); void clearRunDPsInfo(); - // LB: new DPs for Fed void clearFedChamberStatusDPsInfo(); void clearFedCFGtagDPsInfo(); @@ -125,7 +123,6 @@ class DCSProcessor std::unordered_map mTRDDCSCurrents; ///< anode and drift currents std::unordered_map mTRDDCSVoltages; ///< anode and drift voltages std::unordered_map mTRDDCSEnv; ///< environment parameters (temperatures, pressures, humidity) - // LB: new DPs for Fed std::array mTRDDCSFedChamberStatus; ///< fed chamber status std::array mTRDDCSFedCFGtag; ///< fed config tag @@ -136,7 +133,6 @@ class DCSProcessor CcdbObjectInfo mCcdbVoltagesDPsInfo; CcdbObjectInfo mCcdbCurrentsDPsInfo; CcdbObjectInfo mCcdbEnvDPsInfo; - // LB: new DPs for Fed CcdbObjectInfo mCcdbFedChamberStatusDPsInfo; CcdbObjectInfo mCcdbFedCFGtagDPsInfo; @@ -144,7 +140,6 @@ class DCSProcessor TFType mVoltagesStartTS; ///< the time stamp of the first TF which was processesd for the current voltages CCDB object TFType mCurrentsStartTS; ///< the time stamp of the first TF which was processesd for the current voltages CCDB object TFType mEnvStartTS; - // LB: new DPs for Fed TFType mFedChamberStatusStartTS; TFType mFedCFGtagStartTS; TFType mCurrentTS{0}; ///< the time stamp of the TF currently being processed @@ -152,7 +147,6 @@ class DCSProcessor bool mVoltagesStartTSSet{false}; bool mCurrentsStartTSSet{false}; bool mEnvStartTSSet{false}; - // LB: new DPs for Fed bool mFedChamberStatusStartTSSet{false}; bool mFedCFGtagStartTSSet{false}; std::bitset mVoltageSet{}; @@ -165,8 +159,6 @@ class DCSProcessor int mCurrentRunNumber{-1}; int mFedChamberStatusAlarmCounter{0}; int mFedCFGtagAlarmCounter{0}; - // LB: for testing runNo object, turned off for now - // int mFinishedRunNumber; // settings int mVerbosity{0}; diff --git a/Detectors/TRD/calibration/src/DCSProcessor.cxx b/Detectors/TRD/calibration/src/DCSProcessor.cxx index a9d460ba96b3a..0b9ff37e92c90 100644 --- a/Detectors/TRD/calibration/src/DCSProcessor.cxx +++ b/Detectors/TRD/calibration/src/DCSProcessor.cxx @@ -197,8 +197,10 @@ int DCSProcessor::processDP(const DPCOM& dpcom) } if (type == DPVAL_INT) { + + // check if DP is run number, only used for Chamber Status/CFGtag metadata if (std::strstr(dpid.get_alias(), "trd_fed_runNo") != nullptr) { // DP is trd_fed_runNo - // LB: Check if new value is a valid run number (0 = cleared variable) + // LB: Check if new value is a valid run number (0 = cleared variable, -1 = start variable) if (o2::dcs::getValue(dpcom) > 0) { // If value has changed from previous one, new run has begun and update if (o2::dcs::getValue(dpcom) != mCurrentRunNumber) { @@ -219,13 +221,14 @@ int DCSProcessor::processDP(const DPCOM& dpcom) LOG(info) << "Current Run Number: " << mCurrentRunNumber; } - } else if (std::strstr(dpid.get_alias(), "trd_chamberStatus") != nullptr) { // DP is trd_chamberStatus + // check if DP is Chamber Status + } else if (std::strstr(dpid.get_alias(), "trd_chamberStatus") != nullptr) { if (!mFedChamberStatusStartTSSet) { mFedChamberStatusStartTS = mCurrentTS; mFedChamberStatusStartTSSet = true; } - // LB: for ChamberStatus, grab the chamber number from alias + // LB: grab the chamber number from alias int chamberId = getChamberIdFromAlias(dpid.get_alias()); auto& dpInfoFedChamberStatus = mTRDDCSFedChamberStatus[chamberId]; if (etime != mLastDPTimeStamps[dpid]) { @@ -250,7 +253,9 @@ int DCSProcessor::processDP(const DPCOM& dpcom) } if (type == DPVAL_STRING) { - if (std::strstr(dpid.get_alias(), "trd_CFGtag") != nullptr) { // DP is trd_CFGtag + + // check if DP is chamber configuration tag + if (std::strstr(dpid.get_alias(), "trd_CFGtag") != nullptr) { if (!mFedCFGtagStartTSSet) { mFedCFGtagStartTS = mCurrentTS; mFedCFGtagStartTSSet = true; diff --git a/Detectors/TRD/calibration/workflow/TRDDCSDataProcessorSpec.h b/Detectors/TRD/calibration/workflow/TRDDCSDataProcessorSpec.h index 8678a4cedd3fe..ab627243f63ea 100644 --- a/Detectors/TRD/calibration/workflow/TRDDCSDataProcessorSpec.h +++ b/Detectors/TRD/calibration/workflow/TRDDCSDataProcessorSpec.h @@ -155,7 +155,6 @@ class TRDDCSDataProcessor : public o2::framework::Task mTimerVoltages = mTimerGas; mTimerCurrents = mTimerGas; mTimerEnv = mTimerGas; - // LB: new DPs for Fed mTimerFedChamberStatus = mTimerGas; mTimerFedCFGtag = mTimerGas; @@ -201,7 +200,6 @@ class TRDDCSDataProcessor : public o2::framework::Task mTimerEnv = timeNow; } - // LB: processing logic for FedChamberStatus and FedCFGtag if (mProcessor->shouldUpdateFedChamberStatus()) { sendDPsoutputFedChamberStatus(pc.outputs()); } @@ -209,7 +207,7 @@ class TRDDCSDataProcessor : public o2::framework::Task if (mProcessor->shouldUpdateFedCFGtag()) { sendDPsoutputFedCFGtag(pc.outputs()); } - + sw.Stop(); if (mReportTiming) { @@ -223,7 +221,6 @@ class TRDDCSDataProcessor : public o2::framework::Task sendDPsoutputVoltages(ec.outputs()); sendDPsoutputCurrents(ec.outputs()); sendDPsoutputEnv(ec.outputs()); - // LB: new DPs for Fed sendDPsoutputFedChamberStatus(ec.outputs()); sendDPsoutputFedCFGtag(ec.outputs()); } @@ -235,7 +232,6 @@ class TRDDCSDataProcessor : public o2::framework::Task std::chrono::high_resolution_clock::time_point mTimerVoltages; std::chrono::high_resolution_clock::time_point mTimerCurrents; std::chrono::high_resolution_clock::time_point mTimerEnv; - // LB: new DPs for Fed std::chrono::high_resolution_clock::time_point mTimerFedChamberStatus; std::chrono::high_resolution_clock::time_point mTimerFedCFGtag; @@ -244,7 +240,6 @@ class TRDDCSDataProcessor : public o2::framework::Task int64_t mCurrentsDPsUpdateInterval; int64_t mMinUpdateIntervalU; int64_t mEnvDPsUpdateInterval; - // LB: new DPs for Fed int64_t mFedChamberStatusDPsUpdateInterval; int64_t mFedCFGtagDPsUpdateInterval; @@ -322,7 +317,6 @@ class TRDDCSDataProcessor : public o2::framework::Task } } - // LB: new DP for FedChamberStatus //________________________________________________________________ void sendDPsoutputFedChamberStatus(DataAllocator& output) { @@ -342,7 +336,6 @@ class TRDDCSDataProcessor : public o2::framework::Task } } - // LB: new DP for FedCFGtag //________________________________________________________________ void sendDPsoutputFedCFGtag(DataAllocator& output) { @@ -372,7 +365,6 @@ DataProcessorSpec getTRDDCSDataProcessorSpec() { std::vector outputs; - outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBPayload, "TRD_ChamberStat"}); outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBPayload, "TRD_DCSGasDPs"}); outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBWrapper, "TRD_DCSGasDPs"}); outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBPayload, "TRD_DCSUDPs"}); @@ -383,7 +375,6 @@ DataProcessorSpec getTRDDCSDataProcessorSpec() outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBWrapper, "TRD_DCSRunDPs"}); outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBPayload, "TRD_DCSEnvDPs"}); outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBWrapper, "TRD_DCSEnvDPs"}); - // LB: new DPs for Fed // Must use reduced names due to initializer string cannot exceed descriptor size in Data Format outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBPayload, "TRD_ChamberStat"}); outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBWrapper, "TRD_ChamberStat"}); From 961d4ed04d903fe116190bec40176b822b4ec442 Mon Sep 17 00:00:00 2001 From: leo-barreto Date: Fri, 23 Feb 2024 01:17:32 +0100 Subject: [PATCH 3/5] TRD: change Chamber Status start TS --- Detectors/TRD/calibration/src/DCSProcessor.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Detectors/TRD/calibration/src/DCSProcessor.cxx b/Detectors/TRD/calibration/src/DCSProcessor.cxx index 0b9ff37e92c90..165bbbd6a6148 100644 --- a/Detectors/TRD/calibration/src/DCSProcessor.cxx +++ b/Detectors/TRD/calibration/src/DCSProcessor.cxx @@ -495,9 +495,9 @@ bool DCSProcessor::updateFedChamberStatusDPsCCDB() std::map md; md["responsible"] = "Leonardo Barreto"; md["runNumber"] = std::to_string(mCurrentRunNumber); - // LB: set start timestamp 30 seconds before DPs are received + // LB: set start timestamp 30000 miliseconds before DPs are received o2::calibration::Utils::prepareCCDBobjectInfo(mTRDDCSFedChamberStatus, mCcdbFedChamberStatusDPsInfo, - "TRD/Calib/DCSDPsFedChamberStatus", md, mFedChamberStatusStartTS - 30, + "TRD/Calib/DCSDPsFedChamberStatus", md, mFedChamberStatusStartTS - 30000, mFedChamberStatusStartTS + 3 * o2::ccdb::CcdbObjectInfo::DAY); return retVal; @@ -528,9 +528,9 @@ bool DCSProcessor::updateFedCFGtagDPsCCDB() std::map md; md["responsible"] = "Leonardo Barreto"; md["runNumber"] = std::to_string(mCurrentRunNumber); - // LB: set start timestamp 30 seconds before DPs are received + // LB: set start timestamp 30000 seconds before DPs are received o2::calibration::Utils::prepareCCDBobjectInfo(mTRDDCSFedCFGtag, mCcdbFedCFGtagDPsInfo, - "TRD/Calib/DCSDPsFedCFGtag", md, mFedCFGtagStartTS - 30, + "TRD/Calib/DCSDPsFedCFGtag", md, mFedCFGtagStartTS - 30000, mFedCFGtagStartTS + 3 * o2::ccdb::CcdbObjectInfo::DAY); return retVal; From ade2c27117f2cfdfc255611c465f2361e73095bb Mon Sep 17 00:00:00 2001 From: leo-barreto Date: Fri, 23 Feb 2024 15:02:11 +0100 Subject: [PATCH 4/5] TRD: add option to turn on end of stream CCDB upload --- .../workflow/TRDDCSDataProcessorSpec.h | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/Detectors/TRD/calibration/workflow/TRDDCSDataProcessorSpec.h b/Detectors/TRD/calibration/workflow/TRDDCSDataProcessorSpec.h index ab627243f63ea..0cfe0401aec87 100644 --- a/Detectors/TRD/calibration/workflow/TRDDCSDataProcessorSpec.h +++ b/Detectors/TRD/calibration/workflow/TRDDCSDataProcessorSpec.h @@ -150,6 +150,9 @@ class TRDDCSDataProcessor : public o2::framework::Task LOG(info) << "Invalid voltage variation trigger of DPs to update Anode/DriftUMon to " << utrigger << ", using default value of 1 V"; } + mUploadAtEoS = ic.options().get("enable-uploadAtEoS"); + LOG(info) << "Setting upload of CCDB objects at end of stream to " << mUploadAtEoS; + mProcessor->init(vect); mTimerGas = std::chrono::high_resolution_clock::now(); mTimerVoltages = mTimerGas; @@ -217,15 +220,20 @@ class TRDDCSDataProcessor : public o2::framework::Task void endOfStream(o2::framework::EndOfStreamContext& ec) final { - sendDPsoutputGas(ec.outputs()); - sendDPsoutputVoltages(ec.outputs()); - sendDPsoutputCurrents(ec.outputs()); - sendDPsoutputEnv(ec.outputs()); - sendDPsoutputFedChamberStatus(ec.outputs()); - sendDPsoutputFedCFGtag(ec.outputs()); + // LB: no objects should be uploaded at end of stream, unless stated otherwise + if (mUploadAtEoS) { + LOG(info) << "End of stream upload of CCDB objects"; + sendDPsoutputGas(ec.outputs()); + sendDPsoutputVoltages(ec.outputs()); + sendDPsoutputCurrents(ec.outputs()); + sendDPsoutputEnv(ec.outputs()); + } else { + LOG(info) << "No CCDB object upload done at the end of stream"; + } } private: + bool mUploadAtEoS = false; bool mReportTiming = false; std::unique_ptr mProcessor; std::chrono::high_resolution_clock::time_point mTimerGas; @@ -397,7 +405,8 @@ DataProcessorSpec getTRDDCSDataProcessorSpec() {"DPs-voltage-variation-trigger", VariantType::Int64, 1ll, {"Voltage variation trigger for upload of CCDB object"}}, {"DPs-update-interval-gas", VariantType::Int64, 900ll, {"Interval (in s) after which to update the DPs CCDB entry for gas parameters"}}, {"DPs-max-counter-alarm-fed", VariantType::Int, 1, {"Maximum number of alarms after FedChamberStatus and FedCFGtag changes, following changes are logged as warnings"}}, - {"DPs-min-counter-update-fed", VariantType::Int, 522, {"Minimum number of DPs to update FedChamberStatus and FedCFGtag objects"}}}}; + {"DPs-min-counter-update-fed", VariantType::Int, 522, {"Minimum number of DPs to update FedChamberStatus and FedCFGtag objects"}}, + {"enable-uploadAtEoS", VariantType::Bool, false, {"Upload CCDB objects at end of stream"}}}}; } } // namespace framework From 0c2a62afedb8d035b58cde3b78677b606395700c Mon Sep 17 00:00:00 2001 From: leo-barreto Date: Mon, 26 Feb 2024 12:06:47 +0100 Subject: [PATCH 5/5] TRD: remove Run DPs from output vector --- Detectors/TRD/calibration/workflow/TRDDCSDataProcessorSpec.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/Detectors/TRD/calibration/workflow/TRDDCSDataProcessorSpec.h b/Detectors/TRD/calibration/workflow/TRDDCSDataProcessorSpec.h index 0cfe0401aec87..2bda25b4f3dc8 100644 --- a/Detectors/TRD/calibration/workflow/TRDDCSDataProcessorSpec.h +++ b/Detectors/TRD/calibration/workflow/TRDDCSDataProcessorSpec.h @@ -379,8 +379,6 @@ DataProcessorSpec getTRDDCSDataProcessorSpec() outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBWrapper, "TRD_DCSUDPs"}); outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBPayload, "TRD_DCSIDPs"}); outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBWrapper, "TRD_DCSIDPs"}); - outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBPayload, "TRD_DCSRunDPs"}); - outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBWrapper, "TRD_DCSRunDPs"}); outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBPayload, "TRD_DCSEnvDPs"}); outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBWrapper, "TRD_DCSEnvDPs"}); // Must use reduced names due to initializer string cannot exceed descriptor size in Data Format