Skip to content

Commit

Permalink
histogram labels from CTPInputsConfiguration
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucia Anna Tarasovicova committed Oct 21, 2024
1 parent b9e41e2 commit 9bce78c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
15 changes: 7 additions & 8 deletions Modules/CTP/include/CTP/RawDataReaderCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,13 @@ class RawDataReaderCheck : public o2::quality_control::checker::CheckInterface
TH1D* mHistClassesPrevious = nullptr; // histogram storing ctp class rates from previous cycle
TH1D* mHistInputRatioPrevious = nullptr; // histogram storing ctp input ratios to MB from previous cycle
TH1D* mHistClassRatioPrevious = nullptr;
TH1D* mHistAbsolute = nullptr; // histogram storing ctp class ratios to MB from previous cycle
std::vector<int> mVecGoodBC; // vector of good BC positions
std::vector<int> mVecMediumBC; // vector of medium BC positions, we expect a BC at this position, but inputs are below mThreshold
std::vector<int> mVecBadBC; // vector of bad BC positions, we don't expect a BC at this position, but inputs are abow mThreshold
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
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
TH1D* mHistAbsolute = nullptr; // histogram storing ctp class ratios to MB from previous cycle
std::vector<int> mVecGoodBC; // vector of good BC positions
std::vector<int> mVecMediumBC; // vector of medium BC positions, we expect a BC at this position, but inputs are below mThreshold
std::vector<int> mVecBadBC; // vector of bad BC positions, we don't expect a BC at this position, but inputs are abow mThreshold
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

ClassDefOverride(RawDataReaderCheck, 9);
};
Expand Down
9 changes: 7 additions & 2 deletions Modules/CTP/src/RawDataReaderCheck.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,12 @@ void RawDataReaderCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality che
}
if (mFlagInput) {
for (size_t i = 0; i < h->GetXaxis()->GetNbins(); i++) {
h->GetXaxis()->SetBinLabel(i + 1, ctpinputs[i]);
std::string label = o2::ctp::CTPInputsConfiguration::getInputNameFromIndex(i + 1);
if (label == "none") {
h->GetXaxis()->SetBinLabel(i + 1, Form("%i", i + 1));
} else {
h->GetXaxis()->SetBinLabel(i + 1, label.c_str());
}
}
h->GetXaxis()->SetLabelSize(0.045);
h->GetXaxis()->LabelsOption("v");
Expand All @@ -282,7 +287,7 @@ void RawDataReaderCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality che
h->GetListOfFunctions()->Add(msg->Clone());
for (size_t i = 0; i < mVecIndexBad.size(); i++) {
if (mFlagInput) {
msg = std::make_shared<TLatex>(0.45, 0.65 - i * 0.05, Form("Check %s %s", ctpinputs[mVecIndexBad[i]], groupName.c_str()));
msg = std::make_shared<TLatex>(0.45, 0.65 - i * 0.05, Form("Check %s %s", o2::ctp::CTPInputsConfiguration::getInputNameFromIndex(mVecIndexBad[i + 1]).c_str(), groupName.c_str()));
} else {
msg = std::make_shared<TLatex>(0.45, 0.65 - i * 0.05, Form("Check %s %s", groupName.c_str(), h->GetXaxis()->GetBinLabel(mVecIndexBad[i] + 1)));
}
Expand Down

0 comments on commit 9bce78c

Please sign in to comment.