Skip to content

Commit 1544608

Browse files
lhusovaLucia Anna Tarasovicova
andauthored
change in CTP QC check (#2571)
* modification of quality message * create the error histogram, only if consitency check enabled * Fixing the filter --------- Co-authored-by: Lucia Anna Tarasovicova <lucia.anna.husova@cern.ch>
1 parent 2af8981 commit 1544608

File tree

4 files changed

+21
-9
lines changed

4 files changed

+21
-9
lines changed

Modules/CTP/include/CTP/RawDataQcTask.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class CTPRawDataReaderTask final : public TaskInterface
7474
const o2::ctp::CTPConfiguration* mCTPconfig = nullptr;
7575
std::string mMBclassName;
7676
std::array<uint64_t, o2::ctp::CTP_NCLASSES> mClassErrorsA;
77+
bool mPerformConsistencyCheck = false;
7778
};
7879

7980
} // namespace o2::quality_control_modules::ctp

Modules/CTP/include/CTP/RawDataReaderCheck.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class RawDataReaderCheck : public o2::quality_control::checker::CheckInterface
7474
std::vector<int> mVecIndexBad; // vector of ctp input and class indices, which had a big relative change
7575
std::vector<int> mVecIndexMedium; // vector of ctp input and class indices, which had a relative change
7676
std::bitset<o2::constants::lhc::LHCMaxBunches> mLHCBCs; // LHC filling scheme
77+
bool lhcDataFileFound = true;
7778

7879
ClassDefOverride(RawDataReaderCheck, 10);
7980
};

Modules/CTP/src/RawDataQcTask.cxx

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,12 @@ void CTPRawDataReaderTask::initialize(o2::framework::InitContext& /*ctx*/)
5151
mHistoBCMinBias2 = std::make_unique<TH1D>("bcMinBias2", "BC position MB2", norbits, 0, norbits);
5252
mHistoInputRatios = std::make_unique<TH1DRatio>("inputRatio", "Input Ratio to MTVX; Input; Ratio;", ninps, 0, ninps, true);
5353
mHistoClassRatios = std::make_unique<TH1DRatio>("classRatio", "Class Ratio to MB; Class; Ratio", nclasses, 0, nclasses, true);
54-
mHistoDecodeError = std::make_unique<TH1D>("decodeError", "Errors from decoder", nclasses, 0, nclasses);
5554
getObjectsManager()->startPublishing(mHistoInputs.get());
5655
getObjectsManager()->startPublishing(mHistoClasses.get());
5756
getObjectsManager()->startPublishing(mHistoClassRatios.get());
5857
getObjectsManager()->startPublishing(mHistoInputRatios.get());
5958
getObjectsManager()->startPublishing(mHistoBCMinBias1.get());
6059
getObjectsManager()->startPublishing(mHistoBCMinBias2.get());
61-
getObjectsManager()->startPublishing(mHistoDecodeError.get());
6260

6361
mDecoder.setDoLumi(1);
6462
mDecoder.setDoDigits(1);
@@ -78,7 +76,6 @@ void CTPRawDataReaderTask::startOfActivity(const Activity& activity)
7876
mHistoInputRatios->Reset();
7977
mHistoBCMinBias1->Reset();
8078
mHistoBCMinBias2->Reset();
81-
mHistoDecodeError->Reset();
8279

8380
mRunNumber = activity.mId;
8481
mTimestamp = activity.mValidity.getMin();
@@ -213,9 +210,15 @@ void CTPRawDataReaderTask::startOfActivity(const Activity& activity)
213210
if (performConsistencyCheck == "true") {
214211
mDecoder.setCheckConsistency(1);
215212
mDecoder.setDecodeInps(1);
213+
mPerformConsistencyCheck = true;
216214
} else {
217215
mDecoder.setCheckConsistency(0);
218216
}
217+
218+
if (mPerformConsistencyCheck) {
219+
mHistoDecodeError = std::make_unique<TH1D>("decodeError", "Errors from decoder", nclasses, 0, nclasses);
220+
getObjectsManager()->startPublishing(mHistoDecodeError.get());
221+
}
219222
}
220223

221224
void CTPRawDataReaderTask::startOfCycle()
@@ -228,7 +231,7 @@ void CTPRawDataReaderTask::monitorData(o2::framework::ProcessingContext& ctx)
228231
static constexpr double sOrbitLengthInMS = o2::constants::lhc::LHCOrbitMUS / 1000;
229232
auto nOrbitsPerTF = 32.;
230233
// get the input
231-
std::vector<o2::framework::InputSpec> filter;
234+
std::vector<o2::framework::InputSpec> filter{ o2::framework::InputSpec{ "filter", o2::framework::ConcreteDataTypeMatcher{ "CTP", "RAWDATA" }, o2::framework::Lifetime::Timeframe } };
232235
std::vector<o2::ctp::LumiInfo> lumiPointsHBF1;
233236
std::vector<o2::ctp::CTPDigit> outputDigits;
234237

@@ -269,9 +272,11 @@ void CTPRawDataReaderTask::monitorData(o2::framework::ProcessingContext& ctx)
269272
o2::framework::InputRecord& inputs = ctx.inputs();
270273
int ret = mDecoder.decodeRaw(inputs, filter, outputDigits, lumiPointsHBF1);
271274
mClassErrorsA = mDecoder.getClassErrorsA();
272-
for (size_t i = 0; i < o2::ctp::CTP_NCLASSES; i++) {
273-
if (mClassErrorsA[i] > 0) {
274-
mHistoDecodeError->Fill(i, mClassErrorsA[i]);
275+
if (mPerformConsistencyCheck) {
276+
for (size_t i = 0; i < o2::ctp::CTP_NCLASSES; i++) {
277+
if (mClassErrorsA[i] > 0) {
278+
mHistoDecodeError->Fill(i, mClassErrorsA[i]);
279+
}
275280
}
276281
}
277282

@@ -340,7 +345,8 @@ void CTPRawDataReaderTask::reset()
340345
mHistoClassRatios->Reset();
341346
mHistoBCMinBias1->Reset();
342347
mHistoBCMinBias2->Reset();
343-
mHistoDecodeError->Reset();
348+
if (mPerformConsistencyCheck)
349+
mHistoDecodeError->Reset();
344350
}
345351

346352
} // namespace o2::quality_control_modules::ctp

Modules/CTP/src/RawDataReaderCheck.cxx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,10 @@ void RawDataReaderCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality che
229229
}
230230

231231
if (checkResult == Quality::Null) {
232-
msg = std::make_shared<TLatex>(0.2, 0.8, Form("Check was not performed, LHC information not available"));
232+
if (lhcDataFileFound)
233+
msg = std::make_shared<TLatex>(0.2, 0.8, Form("Check was not performed, LHC filling scheme empty"));
234+
else
235+
msg = std::make_shared<TLatex>(0.2, 0.8, Form("Check was not performed, LHC information not available"));
233236
msg->SetTextColor(kBlack);
234237
msg->SetTextSize(0.03);
235238
msg->SetNDC();
@@ -419,6 +422,7 @@ void RawDataReaderCheck::startOfActivity(const core::Activity& activity)
419422
auto lhcifdata = UserCodeInterface::retrieveConditionAny<o2::parameters::GRPLHCIFData>("GLO/Config/GRPLHCIF", metadata, mTimestamp);
420423
if (lhcifdata == nullptr) {
421424
ILOG(Info, Support) << "LHC data not found for timestamp:" << mTimestamp << ENDM;
425+
lhcDataFileFound = false;
422426
return;
423427
} else {
424428
ILOG(Info, Support) << "LHC data found for timestamp:" << mTimestamp << ENDM;

0 commit comments

Comments
 (0)