Skip to content

Commit b2ae9db

Browse files
committed
TRD: new run for update ChamberStatus/CFGtag flag divided in two variables, reset after ChamberStatus/CFGtag update
1 parent d455754 commit b2ae9db

2 files changed

Lines changed: 17 additions & 13 deletions

File tree

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ class DCSProcessor
7474
bool shouldUpdateVoltages() const { return mShouldUpdateVoltages; }
7575
bool shouldUpdateRun() const { return mShouldUpdateRun; }
7676
// LB: Only update ChamberStatus/CFGtag if both conditions are met (complete DPs and new run)
77-
bool shouldUpdateFedChamberStatus() const { return mShouldUpdateFedChamberStatus && mShouldUpdateRun; }
78-
bool shouldUpdateFedCFGtag() const { return mShouldUpdateFedCFGtag && mShouldUpdateRun; }
77+
bool shouldUpdateFedChamberStatus() const { return mFedChamberStatusCompleteDPs && mNewRunForFedChamberStatusUpdate; }
78+
bool shouldUpdateFedCFGtag() const { return mFedCFGtagCompleteDPs && mNewRunForFedCFGtagUpdate; }
7979

8080
// allow access to the CCDB objects from DPL processor
8181
CcdbObjectInfo& getccdbGasDPsInfo() { return mCcdbGasDPsInfo; }
@@ -171,8 +171,10 @@ class DCSProcessor
171171
bool mShouldUpdateVoltages{false};
172172
bool mShouldUpdateRun{false};
173173
// LB: FedChamberStatus and FedCFGtag logic
174-
bool mShouldUpdateFedChamberStatus{false};
175-
bool mShouldUpdateFedCFGtag{false};
174+
bool mFedChamberStatusCompleteDPs{false};
175+
bool mFedCFGtagCompleteDPs{false};
176+
bool mNewRunForFedChamberStatusUpdate{false};
177+
bool mNewRunForFedCFGtagUpdate{false};
176178
int mCurrentRunNumber{-1};
177179
int mFedChamberStatusAlarmCounter{0};
178180
int mFedCFGtagAlarmCounter{0};

Detectors/TRD/calibration/src/DCSProcessor.cxx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ int DCSProcessor::process(const gsl::span<const DPCOM> dps)
7878
int ChamberStatusUniqueDPsCounter = std::distance(allChamberStatusDPsid.begin(), ChamberStatusUniqueIterator);
7979
int CFGtagUniqueDPsCounter = std::distance(allCFGtagDPsid.begin(), CFGtagUniqueIterator);
8080
if (ChamberStatusUniqueDPsCounter >= mFedMinimunDPsForUpdate) {
81-
mShouldUpdateFedChamberStatus = true;
81+
mFedChamberStatusCompleteDPs = true;
8282
if (mVerbosity > 1) {
8383
LOG(info) << "Minimum number of required DPs (" << mFedMinimunDPsForUpdate << ") for ChamberStatus update were found.";
8484
}
8585
}
8686

8787
if (CFGtagUniqueDPsCounter >= mFedMinimunDPsForUpdate) {
88-
mShouldUpdateFedCFGtag = true;
88+
mFedCFGtagCompleteDPs = true;
8989
if (mVerbosity > 1) {
9090
LOG(info) << "Minimum number of required DPs (" << mFedMinimunDPsForUpdate << ") for CFGtag update were found.";
9191
}
@@ -245,6 +245,9 @@ int DCSProcessor::processDP(const DPCOM& dpcom)
245245
if (o2::dcs::getValue<int32_t>(dpcom) != mCurrentRunNumber) {
246246
LOG(info) << "New run number " << o2::dcs::getValue<int32_t>(dpcom) << " differs from the old one " << mCurrentRunNumber;
247247
mShouldUpdateRun = true;
248+
// LB: two different flags as they reset separately, after upload of CCDB, for each object
249+
mNewRunForFedChamberStatusUpdate = true;
250+
mNewRunForFedCFGtagUpdate = true;
248251
mRunEndTS = mCurrentTS;
249252
}
250253

@@ -268,7 +271,7 @@ int DCSProcessor::processDP(const DPCOM& dpcom)
268271
if (etime != mLastDPTimeStamps[dpid]) {
269272
if (dpInfoFedChamberStatus != o2::dcs::getValue<int>(dpcom)) {
270273
// If value changes after processing and DPs should not be updated, log change as warning (for now)
271-
if (mPids[dpid] && !(mShouldUpdateFedChamberStatus && mShouldUpdateRun)) {
274+
if (mPids[dpid] && !(mFedChamberStatusCompleteDPs && mNewRunForFedChamberStatusUpdate)) {
272275
// Issue an alarm if counter is lower than maximum, warning otherwise
273276
if (mFedChamberStatusAlarmCounter < mFedAlarmCounterMax) {
274277
LOG(alarm) << "ChamberStatus change " << dpid.get_alias() << " : " << dpInfoFedChamberStatus << " -> " << o2::dcs::getValue<int>(dpcom) << ", run = " << mCurrentRunNumber;
@@ -296,7 +299,7 @@ int DCSProcessor::processDP(const DPCOM& dpcom)
296299
if (etime != mLastDPTimeStamps[dpid]) {
297300
if (dpInfoFedCFGtag != o2::dcs::getValue<string>(dpcom)) {
298301
// If value changes after processing and DPs should not be updated, log change as warning (for now)
299-
if (mPids[dpid] && !(mShouldUpdateFedCFGtag && mShouldUpdateRun)) {
302+
if (mPids[dpid] && !(mFedCFGtagCompleteDPs && mNewRunForFedCFGtagUpdate)) {
300303
// Issue an alarm if counter is lower than maximum, warning otherwise
301304
if (mFedCFGtagAlarmCounter < mFedAlarmCounterMax) {
302305
LOG(alarm) << "CFGtag change " << dpid.get_alias() << " : " << dpInfoFedCFGtag << " -> " << o2::dcs::getValue<string>(dpcom) << ", run = " << mCurrentRunNumber;
@@ -568,9 +571,6 @@ bool DCSProcessor::updateFedCFGtagDPsCCDB()
568571

569572
bool retVal = false; // set to 'true' in case at least one DP for run has been processed
570573

571-
// Once updated, do not update again until new run
572-
// mShouldUpdateFedCFGtag = false;
573-
574574
for (const auto& it : mPids) {
575575
const auto& type = it.first.get_type();
576576
if (type == o2::dcs::DPVAL_STRING) {
@@ -738,7 +738,8 @@ void DCSProcessor::clearFedChamberStatusDPsInfo()
738738
{
739739
mTRDDCSFedChamberStatus.clear();
740740
mFedChamberStatusStartTSSet = false;
741-
mShouldUpdateFedChamberStatus = false;
741+
mFedChamberStatusCompleteDPs = false;
742+
mNewRunForFedChamberStatusUpdate = false;
742743
mFedChamberStatusAlarmCounter = 0;
743744
// reset the 'processed' flags for the fed DPs
744745
for (auto& it : mPids) {
@@ -755,7 +756,8 @@ void DCSProcessor::clearFedCFGtagDPsInfo()
755756
{
756757
mTRDDCSFedCFGtag.clear();
757758
mFedCFGtagStartTSSet = false;
758-
mShouldUpdateFedCFGtag = false;
759+
mFedChamberStatusCompleteDPs = false;
760+
mNewRunForFedChamberStatusUpdate = false;
759761
mFedCFGtagAlarmCounter = 0;
760762
// reset the 'processed' flags for the fed DPs
761763
for (auto& it : mPids) {

0 commit comments

Comments
 (0)