Skip to content

Commit 842d111

Browse files
committed
TRD: comments clean up
1 parent ca2f7a6 commit 842d111

3 files changed

Lines changed: 11 additions & 23 deletions

File tree

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

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

@@ -91,7 +90,7 @@ class DCSProcessor
9190
CcdbObjectInfo& getccdbEnvDPsInfo() { return mCcdbEnvDPsInfo; }
9291
CcdbObjectInfo& getccdbFedChamberStatusDPsInfo() { return mCcdbFedChamberStatusDPsInfo; }
9392
CcdbObjectInfo& getccdbFedCFGtagDPsInfo() { return mCcdbFedCFGtagDPsInfo; }
94-
93+
9594
const std::unordered_map<DPID, TRDDCSMinMaxMeanInfo>& getTRDGasDPsInfo() const { return mTRDDCSGas; }
9695
const std::unordered_map<DPID, float>& getTRDVoltagesDPsInfo() const { return mTRDDCSVoltages; }
9796
const std::unordered_map<DPID, TRDDCSMinMaxMeanInfo>& getTRDCurrentsDPsInfo() const { return mTRDDCSCurrents; }
@@ -112,7 +111,6 @@ class DCSProcessor
112111
void clearCurrentsDPsInfo();
113112
void clearEnvDPsInfo();
114113
void clearRunDPsInfo();
115-
// LB: new DPs for Fed
116114
void clearFedChamberStatusDPsInfo();
117115
void clearFedCFGtagDPsInfo();
118116

@@ -125,7 +123,6 @@ class DCSProcessor
125123
std::unordered_map<DPID, TRDDCSMinMaxMeanInfo> mTRDDCSCurrents; ///< anode and drift currents
126124
std::unordered_map<DPID, float> mTRDDCSVoltages; ///< anode and drift voltages
127125
std::unordered_map<DPID, TRDDCSMinMaxMeanInfo> mTRDDCSEnv; ///< environment parameters (temperatures, pressures, humidity)
128-
// LB: new DPs for Fed
129126
std::array<int, constants::MAXCHAMBER> mTRDDCSFedChamberStatus; ///< fed chamber status
130127
std::array<string, constants::MAXCHAMBER> mTRDDCSFedCFGtag; ///< fed config tag
131128

@@ -136,23 +133,20 @@ class DCSProcessor
136133
CcdbObjectInfo mCcdbVoltagesDPsInfo;
137134
CcdbObjectInfo mCcdbCurrentsDPsInfo;
138135
CcdbObjectInfo mCcdbEnvDPsInfo;
139-
// LB: new DPs for Fed
140136
CcdbObjectInfo mCcdbFedChamberStatusDPsInfo;
141137
CcdbObjectInfo mCcdbFedCFGtagDPsInfo;
142138

143139
TFType mGasStartTS; ///< the time stamp of the first TF which was processesd for the current GAS CCDB object
144140
TFType mVoltagesStartTS; ///< the time stamp of the first TF which was processesd for the current voltages CCDB object
145141
TFType mCurrentsStartTS; ///< the time stamp of the first TF which was processesd for the current voltages CCDB object
146142
TFType mEnvStartTS;
147-
// LB: new DPs for Fed
148143
TFType mFedChamberStatusStartTS;
149144
TFType mFedCFGtagStartTS;
150145
TFType mCurrentTS{0}; ///< the time stamp of the TF currently being processed
151146
bool mGasStartTSset{false};
152147
bool mVoltagesStartTSSet{false};
153148
bool mCurrentsStartTSSet{false};
154149
bool mEnvStartTSSet{false};
155-
// LB: new DPs for Fed
156150
bool mFedChamberStatusStartTSSet{false};
157151
bool mFedCFGtagStartTSSet{false};
158152
std::bitset<constants::MAXCHAMBER> mVoltageSet{};
@@ -165,8 +159,6 @@ class DCSProcessor
165159
int mCurrentRunNumber{-1};
166160
int mFedChamberStatusAlarmCounter{0};
167161
int mFedCFGtagAlarmCounter{0};
168-
// LB: for testing runNo object, turned off for now
169-
// int mFinishedRunNumber;
170162

171163
// settings
172164
int mVerbosity{0};

Detectors/TRD/calibration/src/DCSProcessor.cxx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,10 @@ int DCSProcessor::processDP(const DPCOM& dpcom)
197197
}
198198

199199
if (type == DPVAL_INT) {
200+
201+
// check if DP is run number, only used for Chamber Status/CFGtag metadata
200202
if (std::strstr(dpid.get_alias(), "trd_fed_runNo") != nullptr) { // DP is trd_fed_runNo
201-
// LB: Check if new value is a valid run number (0 = cleared variable)
203+
// LB: Check if new value is a valid run number (0 = cleared variable, -1 = start variable)
202204
if (o2::dcs::getValue<int32_t>(dpcom) > 0) {
203205
// If value has changed from previous one, new run has begun and update
204206
if (o2::dcs::getValue<int32_t>(dpcom) != mCurrentRunNumber) {
@@ -219,13 +221,14 @@ int DCSProcessor::processDP(const DPCOM& dpcom)
219221
LOG(info) << "Current Run Number: " << mCurrentRunNumber;
220222
}
221223

222-
} else if (std::strstr(dpid.get_alias(), "trd_chamberStatus") != nullptr) { // DP is trd_chamberStatus
224+
// check if DP is Chamber Status
225+
} else if (std::strstr(dpid.get_alias(), "trd_chamberStatus") != nullptr) {
223226
if (!mFedChamberStatusStartTSSet) {
224227
mFedChamberStatusStartTS = mCurrentTS;
225228
mFedChamberStatusStartTSSet = true;
226229
}
227230

228-
// LB: for ChamberStatus, grab the chamber number from alias
231+
// LB: grab the chamber number from alias
229232
int chamberId = getChamberIdFromAlias(dpid.get_alias());
230233
auto& dpInfoFedChamberStatus = mTRDDCSFedChamberStatus[chamberId];
231234
if (etime != mLastDPTimeStamps[dpid]) {
@@ -250,7 +253,9 @@ int DCSProcessor::processDP(const DPCOM& dpcom)
250253
}
251254

252255
if (type == DPVAL_STRING) {
253-
if (std::strstr(dpid.get_alias(), "trd_CFGtag") != nullptr) { // DP is trd_CFGtag
256+
257+
// check if DP is chamber configuration tag
258+
if (std::strstr(dpid.get_alias(), "trd_CFGtag") != nullptr) {
254259
if (!mFedCFGtagStartTSSet) {
255260
mFedCFGtagStartTS = mCurrentTS;
256261
mFedCFGtagStartTSSet = true;

Detectors/TRD/calibration/workflow/TRDDCSDataProcessorSpec.h

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,6 @@ class TRDDCSDataProcessor : public o2::framework::Task
155155
mTimerVoltages = mTimerGas;
156156
mTimerCurrents = mTimerGas;
157157
mTimerEnv = mTimerGas;
158-
// LB: new DPs for Fed
159158
mTimerFedChamberStatus = mTimerGas;
160159
mTimerFedCFGtag = mTimerGas;
161160

@@ -201,15 +200,14 @@ class TRDDCSDataProcessor : public o2::framework::Task
201200
mTimerEnv = timeNow;
202201
}
203202

204-
// LB: processing logic for FedChamberStatus and FedCFGtag
205203
if (mProcessor->shouldUpdateFedChamberStatus()) {
206204
sendDPsoutputFedChamberStatus(pc.outputs());
207205
}
208206

209207
if (mProcessor->shouldUpdateFedCFGtag()) {
210208
sendDPsoutputFedCFGtag(pc.outputs());
211209
}
212-
210+
213211
sw.Stop();
214212

215213
if (mReportTiming) {
@@ -223,7 +221,6 @@ class TRDDCSDataProcessor : public o2::framework::Task
223221
sendDPsoutputVoltages(ec.outputs());
224222
sendDPsoutputCurrents(ec.outputs());
225223
sendDPsoutputEnv(ec.outputs());
226-
// LB: new DPs for Fed
227224
sendDPsoutputFedChamberStatus(ec.outputs());
228225
sendDPsoutputFedCFGtag(ec.outputs());
229226
}
@@ -235,7 +232,6 @@ class TRDDCSDataProcessor : public o2::framework::Task
235232
std::chrono::high_resolution_clock::time_point mTimerVoltages;
236233
std::chrono::high_resolution_clock::time_point mTimerCurrents;
237234
std::chrono::high_resolution_clock::time_point mTimerEnv;
238-
// LB: new DPs for Fed
239235
std::chrono::high_resolution_clock::time_point mTimerFedChamberStatus;
240236
std::chrono::high_resolution_clock::time_point mTimerFedCFGtag;
241237

@@ -244,7 +240,6 @@ class TRDDCSDataProcessor : public o2::framework::Task
244240
int64_t mCurrentsDPsUpdateInterval;
245241
int64_t mMinUpdateIntervalU;
246242
int64_t mEnvDPsUpdateInterval;
247-
// LB: new DPs for Fed
248243
int64_t mFedChamberStatusDPsUpdateInterval;
249244
int64_t mFedCFGtagDPsUpdateInterval;
250245

@@ -322,7 +317,6 @@ class TRDDCSDataProcessor : public o2::framework::Task
322317
}
323318
}
324319

325-
// LB: new DP for FedChamberStatus
326320
//________________________________________________________________
327321
void sendDPsoutputFedChamberStatus(DataAllocator& output)
328322
{
@@ -342,7 +336,6 @@ class TRDDCSDataProcessor : public o2::framework::Task
342336
}
343337
}
344338

345-
// LB: new DP for FedCFGtag
346339
//________________________________________________________________
347340
void sendDPsoutputFedCFGtag(DataAllocator& output)
348341
{
@@ -372,7 +365,6 @@ DataProcessorSpec getTRDDCSDataProcessorSpec()
372365
{
373366

374367
std::vector<OutputSpec> outputs;
375-
outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBPayload, "TRD_ChamberStat"});
376368
outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBPayload, "TRD_DCSGasDPs"});
377369
outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBWrapper, "TRD_DCSGasDPs"});
378370
outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBPayload, "TRD_DCSUDPs"});
@@ -383,7 +375,6 @@ DataProcessorSpec getTRDDCSDataProcessorSpec()
383375
outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBWrapper, "TRD_DCSRunDPs"});
384376
outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBPayload, "TRD_DCSEnvDPs"});
385377
outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBWrapper, "TRD_DCSEnvDPs"});
386-
// LB: new DPs for Fed
387378
// Must use reduced names due to initializer string cannot exceed descriptor size in Data Format
388379
outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBPayload, "TRD_ChamberStat"});
389380
outputs.emplace_back(ConcreteDataTypeMatcher{o2::calibration::Utils::gDataOriginCDBWrapper, "TRD_ChamberStat"});

0 commit comments

Comments
 (0)