Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Modules/CTP/include/CTP/RawDataQcTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class CTPRawDataReaderTask final : public TaskInterface
const o2::ctp::CTPConfiguration* mCTPconfig = nullptr;
std::string mMBclassName;
std::array<uint64_t, o2::ctp::CTP_NCLASSES> mClassErrorsA;
bool mPerformConsistencyCheck = false;
};

} // namespace o2::quality_control_modules::ctp
Expand Down
1 change: 1 addition & 0 deletions Modules/CTP/include/CTP/RawDataReaderCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class RawDataReaderCheck : public o2::quality_control::checker::CheckInterface
std::vector<int> mVecIndexBad; // vector of ctp input and class indices, which had a big relative change
std::vector<int> mVecIndexMedium; // vector of ctp input and class indices, which had a relative change
std::bitset<o2::constants::lhc::LHCMaxBunches> mLHCBCs; // LHC filling scheme
bool lhcDataFileFound = true;

ClassDefOverride(RawDataReaderCheck, 10);
};
Expand Down
22 changes: 14 additions & 8 deletions Modules/CTP/src/RawDataQcTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,12 @@ void CTPRawDataReaderTask::initialize(o2::framework::InitContext& /*ctx*/)
mHistoBCMinBias2 = std::make_unique<TH1D>("bcMinBias2", "BC position MB2", norbits, 0, norbits);
mHistoInputRatios = std::make_unique<TH1DRatio>("inputRatio", "Input Ratio to MTVX; Input; Ratio;", ninps, 0, ninps, true);
mHistoClassRatios = std::make_unique<TH1DRatio>("classRatio", "Class Ratio to MB; Class; Ratio", nclasses, 0, nclasses, true);
mHistoDecodeError = std::make_unique<TH1D>("decodeError", "Errors from decoder", nclasses, 0, nclasses);
getObjectsManager()->startPublishing(mHistoInputs.get());
getObjectsManager()->startPublishing(mHistoClasses.get());
getObjectsManager()->startPublishing(mHistoClassRatios.get());
getObjectsManager()->startPublishing(mHistoInputRatios.get());
getObjectsManager()->startPublishing(mHistoBCMinBias1.get());
getObjectsManager()->startPublishing(mHistoBCMinBias2.get());
getObjectsManager()->startPublishing(mHistoDecodeError.get());

mDecoder.setDoLumi(1);
mDecoder.setDoDigits(1);
Expand All @@ -78,7 +76,6 @@ void CTPRawDataReaderTask::startOfActivity(const Activity& activity)
mHistoInputRatios->Reset();
mHistoBCMinBias1->Reset();
mHistoBCMinBias2->Reset();
mHistoDecodeError->Reset();

mRunNumber = activity.mId;
mTimestamp = activity.mValidity.getMin();
Expand Down Expand Up @@ -213,9 +210,15 @@ void CTPRawDataReaderTask::startOfActivity(const Activity& activity)
if (performConsistencyCheck == "true") {
mDecoder.setCheckConsistency(1);
mDecoder.setDecodeInps(1);
mPerformConsistencyCheck = true;
} else {
mDecoder.setCheckConsistency(0);
}

if (mPerformConsistencyCheck) {
mHistoDecodeError = std::make_unique<TH1D>("decodeError", "Errors from decoder", nclasses, 0, nclasses);
getObjectsManager()->startPublishing(mHistoDecodeError.get());
}
}

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

Expand Down Expand Up @@ -269,9 +272,11 @@ void CTPRawDataReaderTask::monitorData(o2::framework::ProcessingContext& ctx)
o2::framework::InputRecord& inputs = ctx.inputs();
int ret = mDecoder.decodeRaw(inputs, filter, outputDigits, lumiPointsHBF1);
mClassErrorsA = mDecoder.getClassErrorsA();
for (size_t i = 0; i < o2::ctp::CTP_NCLASSES; i++) {
if (mClassErrorsA[i] > 0) {
mHistoDecodeError->Fill(i, mClassErrorsA[i]);
if (mPerformConsistencyCheck) {
for (size_t i = 0; i < o2::ctp::CTP_NCLASSES; i++) {
if (mClassErrorsA[i] > 0) {
mHistoDecodeError->Fill(i, mClassErrorsA[i]);
}
}
}

Expand Down Expand Up @@ -340,7 +345,8 @@ void CTPRawDataReaderTask::reset()
mHistoClassRatios->Reset();
mHistoBCMinBias1->Reset();
mHistoBCMinBias2->Reset();
mHistoDecodeError->Reset();
if (mPerformConsistencyCheck)
mHistoDecodeError->Reset();
}

} // namespace o2::quality_control_modules::ctp
6 changes: 5 additions & 1 deletion Modules/CTP/src/RawDataReaderCheck.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@ void RawDataReaderCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality che
}

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