Skip to content
Open
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/MUON/MID/include/MID/DigitsQcCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ class DigitsQcCheck : public o2::quality_control::checker::CheckInterface
int nBadLB = 0;
double maxVal = 0;
double minVal = 1000;
int LineResp[36] = { 0 }; // NN

std::unordered_map<std::string, Quality> mQualityMap; ///! Quality map

Expand Down
2 changes: 2 additions & 0 deletions Modules/MUON/MID/include/MID/DigitsQcTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ class DigitsQcTask final : public TaskInterface
std::array<std::unique_ptr<TH2F>, 4> mBendHitsMap{};
std::array<std::unique_ptr<TH2F>, 4> mNBendHitsMap{};

std::array<std::unique_ptr<TH1F>, 36> mLineLocalResp{};

std::unique_ptr<TH1F> mDigitBCCounts{ nullptr };

o2::mid::Mapping mMapping;
Expand Down
49 changes: 45 additions & 4 deletions Modules/MUON/MID/src/DigitsQcCheck.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ namespace o2::quality_control_modules::mid

void DigitsQcCheck::configure()
{

ILOG(Info, Devel) << "configure DigitsQcCheck" << ENDM;
if (auto param = mCustomParameters.find("MeanMultThreshold"); param != mCustomParameters.end()) {
ILOG(Info, Devel) << "Custom parameter - MeanMultThreshold: " << param->second << ENDM;
Expand Down Expand Up @@ -63,6 +64,7 @@ void DigitsQcCheck::configure()

Quality DigitsQcCheck::check(std::map<std::string, std::shared_ptr<MonitorObject>>* moMap)
{

Quality result = Quality::Good;
// This info must be available from the beginning
TH1* meanMultiHits = nullptr;
Expand Down Expand Up @@ -124,12 +126,21 @@ Quality DigitsQcCheck::check(std::map<std::string, std::shared_ptr<MonitorObject
nBadLB = 0;
maxVal = 0;
minVal = 1000;
int Resp = 0;
auto histo = dynamic_cast<TH2F*>(item.second->getObject());
if (histo) {
mHistoHelper.normalizeHistoTokHz(histo);
int by0 = 0; // NN
for (int by = 1; by < 37; by++)
LineResp[by - 1] = 0;
for (int bx = 1; bx < 15; bx++) {
for (int by = 1; by < 37; by++) {
if (!((bx > 6) && (bx < 9) && (by > 15) && (by < 22))) { // central zone empty
Resp = 0; // NN
if (bx > 1)
LineResp[by - 1] = LineResp[by - 1] << 2;

if (!((bx > 6) && (bx < 9) && (by > 15) && (by < 22))) {
Resp = 1;
double val = histo->GetBinContent(bx, by);
if (val > maxVal) {
maxVal = val;
Expand All @@ -139,15 +150,29 @@ Quality DigitsQcCheck::check(std::map<std::string, std::shared_ptr<MonitorObject
}
if (val == 0) {
nEmptyLB++;
Resp = 0; // NN
} else if (val > mLocalBoardThreshold) {
nBadLB++;
Resp = 3; // NN
}
LineResp[by - 1] = LineResp[by - 1] + Resp;
by0 = by;
if ((bx == 1) || (bx == 14) || (by == 1) || (by == 33)) {
if ((bx == 14) && (by > 1) && (by < 33)) {
LineResp[by + 1] = LineResp[by + 1] << 2;
if ((by > 12) && (by < 25)) {
LineResp[by] = LineResp[by] << 2;
LineResp[by + 2] = LineResp[by + 2] << 2;
}
}
by += 3;
} // zones 1 board
else if (!((bx > 4) && (bx < 11) && (by > 12) && (by < 25))) {
} else if (!((bx > 4) && (bx < 11) && (by > 12) && (by < 25))) {

if ((bx > 10) && (by > 12) && (by < 25)) {
LineResp[by] = LineResp[by] << 2;
}
by += 1;
} // zones 2 boards
}
}
}
}
Expand Down Expand Up @@ -192,8 +217,24 @@ Quality DigitsQcCheck::check(std::map<std::string, std::shared_ptr<MonitorObject

mQualityMap[item.second->getName()] = qual;
result = qual;

} // if mNTFInSeconds > 0.
}

/////NN
for (int by = 1; by < 37; by++) {
std::string nline = std::to_string(by);
std::string HistoName = "RespBoardLine" + nline;
if (item.second->getName() == HistoName) {
auto histo = dynamic_cast<TH1F*>(item.second->getObject());
if (histo) {
histo->SetBins(1, LineResp[by - 1] - 0.5, LineResp[by - 1] + 0.5);
histo->Fill(LineResp[by - 1]);
}
}
}
/////NN

if (item.second->getName() == "NbLBEmpty") {
auto histo = dynamic_cast<TH1F*>(item.second->getObject());
if (histo) {
Expand Down
7 changes: 7 additions & 0 deletions Modules/MUON/MID/src/DigitsQcTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ void DigitsQcTask::initialize(o2::framework::InitContext& /*ctx*/)

std::array<std::string, 4> chId{ "11", "12", "21", "22" };

for (size_t i = 0; i < 36; ++i) {
std::string nline = "";
nline = std::to_string(i + 1);
mLineLocalResp[i] = std::make_unique<TH1F>(fmt::format("RespBoardLine{}", nline).c_str(), fmt::format("RespBoardLine{}", nline).c_str(), 1, 0, 1);
getObjectsManager()->startPublishing(mLineLocalResp[i].get());
}

for (size_t ich = 0; ich < 5; ++ich) {
std::string chName = "";
if (ich < 4) {
Expand Down