Skip to content

Commit

Permalink
change the threshold for BC check (#2391)
Browse files Browse the repository at this point in the history
Co-authored-by: Lucia Anna Tarasovicova <lucia.anna.husova@cern.ch>
  • Loading branch information
lhusova and Lucia Anna Tarasovicova authored Aug 20, 2024
1 parent aa1cca2 commit 1c8fab5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Modules/CTP/include/CTP/RawDataReaderCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class RawDataReaderCheck : public o2::quality_control::checker::CheckInterface
float mThresholdRateMedium = -1; // threshold for the relative change in ctp input and class rates
float mThresholdRateRatioBad = -1; // threshold for the relative change in ctp input and class ratios
float mThresholdRateRatioMedium = -1; // threshold for the relative change in ctp input and class ratios
float mNSigBC = -1; // n sigma for BC threshold
bool mFlagRatio = false; // flag that a ratio plot is checked
bool mFlagInput = false; // flag that an input plot is checked
TH1D* mHistInputPrevious = nullptr; // histogram storing ctp input rates from previous cycle
Expand All @@ -73,7 +74,7 @@ class RawDataReaderCheck : public o2::quality_control::checker::CheckInterface
std::bitset<o2::constants::lhc::LHCMaxBunches> mLHCBCs; // LHC filling scheme
const char* ctpinputs[49] = { " T0A", " T0C", " TVX", " TSC", " TCE", " VBA", " VOR", " VIR", " VNC", " VCH", "11", "12", " UCE", "DMC", " USC", " UVX", " U0C", " U0A", "COS", "LAS", "EMC", " PH0", "23", "24", "ZED", "ZNC", "PHL", "PHH", "PHM", "30", "31", "32", "33", "34", "35", "36", "EJ1", "EJ2", "EG1", "EG2", "DJ1", "DG1", "DJ2", "DG2", "45", "46", "47", "48", "49" }; // ctp input names

ClassDefOverride(RawDataReaderCheck, 7);
ClassDefOverride(RawDataReaderCheck, 8);
};

} // namespace o2::quality_control_modules::ctp
Expand Down
8 changes: 7 additions & 1 deletion Modules/CTP/src/RawDataReaderCheck.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ void RawDataReaderCheck::configure()
if (mThresholdRateRatioMedium > 4 || mThresholdRateRatioMedium < 0) {
mThresholdRateRatioMedium = 2;
}

param = mCustomParameters.atOrDefaultValue("nSigmaBC", "2");
mNSigBC = std::stof(param);
if (mNSigBC < 0) {
mNSigBC = 2;
}
}

Quality RawDataReaderCheck::check(std::map<std::string, std::shared_ptr<MonitorObject>>* moMap)
Expand Down Expand Up @@ -89,7 +95,7 @@ Quality RawDataReaderCheck::check(std::map<std::string, std::shared_ptr<MonitorO
continue;
}
mThreshold = h->GetEntries() / mLHCBCs.count();
mThreshold = sqrt(mThreshold);
mThreshold = mThreshold - mNSigBC * sqrt(mThreshold);
for (int i = 0; i < o2::constants::lhc::LHCMaxBunches; i++) {
if (mLHCBCs[i] && h->GetBinContent(i + 1) <= mThreshold) {
mVecMediumBC.push_back(i); // medium BC occures when BC is expected on this possition but there is less inputs than threshold
Expand Down
3 changes: 2 additions & 1 deletion Modules/CTP/src/qc-ctp.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
"thresholdRateBad": "3",
"thresholdRateMedium": "2",
"thresholdRateRatioBad": "3",
"thresholdRateRatioMedium": "2"
"thresholdRateRatioMedium": "2",
"mNSigBC": "2"
}
}
}
Expand Down

0 comments on commit 1c8fab5

Please sign in to comment.