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
6 changes: 6 additions & 0 deletions Modules/MUON/MID/include/MID/DigitsQcTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ class DigitsQcTask final : public TaskInterface
std::unique_ptr<TH1F> mNbLBHighRate{ nullptr };
std::unique_ptr<TH1F> mLBHighRate{ nullptr };

std::unique_ptr<TH1F> mGBTRate{ nullptr };
std::unique_ptr<TH1F> mCRURate{ nullptr };
std::unique_ptr<TH1F> mEPRate{ nullptr };

std::array<std::unique_ptr<TH1F>, 5> mMultHitB{};
std::array<std::unique_ptr<TH1F>, 5> mMultHitNB{};
std::unique_ptr<TH1F> mMeanMultiHits;
Expand All @@ -82,6 +86,8 @@ class DigitsQcTask final : public TaskInterface
std::array<std::unique_ptr<TH2F>, 4> mNBendHitsMap{};

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

o2::mid::Mapping mMapping;
};

} // namespace o2::quality_control_modules::mid
Expand Down
2 changes: 1 addition & 1 deletion Modules/MUON/MID/src/ClustQcTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ void ClustQcTask::monitorData(o2::framework::ProcessingContext& ctx)
}
}
} // loop on MT //
} // cluster in ROF //
} // cluster in ROF //
mMultClust11->Fill(multClusterMT11);
mMultClust12->Fill(multClusterMT12);
mMultClust21->Fill(multClusterMT21);
Expand Down
5 changes: 4 additions & 1 deletion Modules/MUON/MID/src/DigitsHelper.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include <fmt/format.h>
#include "TH1.h"
#include "TH2.h"
#include "MIDRaw/CrateMapper.h"
#include "MIDRaw/CrateParameters.h"
#include "MIDBase/DetectorParameters.h"
#include "MIDBase/GeometryParameters.h"
#include "MIDGlobalMapping/GlobalMapper.h"
Expand All @@ -32,6 +34,7 @@ void DigitsHelper::initMaps()
{
o2::mid::GlobalMapper gm;
auto infos = gm.buildStripsInfo();
o2::mid::CrateMapper cm;

auto stripHistoB = makeStripMapHisto("templateStripB", "templateStripB", 0);
auto stripHistoNB = makeStripMapHisto("templateStripNB", "templateStripNB", 1);
Expand Down Expand Up @@ -238,4 +241,4 @@ void DigitsHelper::fillStripHisto(const o2::mid::ColumnData& col, TH1* histo) co
}
}

} // namespace o2::quality_control_modules::mid
} // namespace o2::quality_control_modules::mid
83 changes: 61 additions & 22 deletions Modules/MUON/MID/src/DigitsQcCheck.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -248,37 +248,76 @@ void DigitsQcCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality checkRes
if (mo->getName().find(lbHistoName) != std::string::npos) {
// This matches "LocalBoardsMap*"
auto histo = dynamic_cast<TH2F*>(mo->getObject());
if (mo->getName() == lbHistoName) {
// This is LocalBoardsMap and it was already scaled in the checker
if (!checkResult.getFlags().empty()) {
mHistoHelper.addLatex(histo, 0.12, 0.72, color, checkResult.getFlags().front().second.c_str());
if (histo) {
if (mo->getName() == lbHistoName) {
// This is LocalBoardsMap and it was already scaled in the checker
if (!checkResult.getFlags().empty()) {
mHistoHelper.addLatex(histo, 0.12, 0.72, color, checkResult.getFlags().front().second.c_str());
}
mHistoHelper.addLatex(histo, 0.3, 0.32, color, fmt::format("Quality::{}", checkResult.getName()));
histo->SetMaximum(zcontoursLoc4.back());
histo->SetContour(zcontoursLoc4.size(), zcontoursLoc4.data());
} else {
mHistoHelper.normalizeHistoTokHz(histo);
histo->SetMaximum(zcontoursLoc.back());
histo->SetContour(zcontoursLoc.size(), zcontoursLoc.data());
}
mHistoHelper.addLatex(histo, 0.3, 0.32, color, fmt::format("Quality::{}", checkResult.getName()));
histo->SetMaximum(zcontoursLoc4.back());
histo->SetContour(zcontoursLoc4.size(), zcontoursLoc4.data());
} else {
mHistoHelper.normalizeHistoTokHz(histo);
histo->SetMaximum(zcontoursLoc.back());
histo->SetContour(zcontoursLoc.size(), zcontoursLoc.data());
mHistoHelper.updateTitleWithNTF(histo);
histo->SetStats(0);
}
mHistoHelper.updateTitleWithNTF(histo);
histo->SetStats(0);
} else {

// Strips Display
if (mo->getName().find("BendHitsMap") != std::string::npos) {
// This matches both [N]BendHitsMap*
int maxStrip = 20; // 20kHz Max Display
auto histo = dynamic_cast<TH2F*>(mo->getObject());
} else if (mo->getName().find("BendHitsMap") != std::string::npos) { // Strips Display
// This matches both [N]BendHitsMap*
int maxStrip = 20; // 20kHz Max Display
auto histo = dynamic_cast<TH2F*>(mo->getObject());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please check for nullptr in case the cast was not successful

if (histo) {
mHistoHelper.normalizeHistoTokHz(histo);
histo->SetMaximum(zcontoursStrip.back());
histo->SetContour(zcontoursStrip.size(), zcontoursStrip.data());
histo->SetStats(0);
} else if (mo->getName() == "Hits") {
auto histo = dynamic_cast<TH1F*>(mo->getObject());
}
} else if (mo->getName() == "Hits") {
auto histo = dynamic_cast<TH1F*>(mo->getObject());
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok thanks for these changes and sorry for my late response.
When is it possible to have it at point2?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that we are starting physics, we will perform upgrades more opportunistically, i.e. when we are given a slot by RC. I do not know what is our next slot.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok thanks again

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ValerieRamillien are you planning to implement these proposed changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay. I just did it.

if (histo) {
mHistoHelper.normalizeHistoTokHz(histo);
histo->SetStats(0);
}
} else if (mo->getName() == "GBTRate") {
auto histo = dynamic_cast<TH1F*>(mo->getObject());
if (histo) {
// if (mHistoHelper.getNTFs() > 0)
mHistoHelper.normalizeHistoTokHz(histo);
histo->SetMinimum(0.);
TString XLabel[32] = { "5R0", "5R1", "4R0", "4R1", "1R0", "1R1", "0R0", "0R1",
"2R0", "2R1", "3R0", "3R1", "7R0", "7R1", "6R0", "6R1",
"5L0", "5L1", "4L0", "4L1", "1L0", "1L1", "0L0", "0L1",
"2L0", "2L1", "3L0", "3L1", "7L0", "7L1", "6L0", "6L1" };
for (Int_t i = 0; i < 32; ++i)
histo->GetXaxis()->SetBinLabel(i + 1, XLabel[i]);
histo->GetXaxis()->SetLabelSize(0.07);
histo->GetXaxis()->SetLabelColor(4);
}
} else if (mo->getName() == "EPRate") {
auto histo = dynamic_cast<TH1F*>(mo->getObject());
if (histo) {
mHistoHelper.normalizeHistoTokHz(histo);
histo->SetMinimum(0.);
histo->GetXaxis()->SetBinLabel(1, "CRU0(990)-EP0");
histo->GetXaxis()->SetBinLabel(2, "CRU0(990)-EP1");
histo->GetXaxis()->SetBinLabel(3, "CRU1(974)-EP0");
histo->GetXaxis()->SetBinLabel(4, "CRU1(974)-EP1");
histo->GetXaxis()->SetLabelSize(0.07);
histo->GetXaxis()->SetLabelColor(4);
}
} else if (mo->getName() == "CRURate") {
auto histo = dynamic_cast<TH1F*>(mo->getObject());
if (histo) {
mHistoHelper.normalizeHistoTokHz(histo);
histo->SetMinimum(0.);
histo->GetXaxis()->SetBinLabel(1, "CRU0 (990)");
histo->GetXaxis()->SetBinLabel(2, "CRU1 (974)");
histo->GetXaxis()->SetLabelSize(0.07);
histo->GetXaxis()->SetLabelColor(4);
}
}
}
mHistoHelper.updateTitle(dynamic_cast<TH1*>(mo->getObject()), mHistoHelper.getCurrentTime());
Expand Down
54 changes: 54 additions & 0 deletions Modules/MUON/MID/src/DigitsQcTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@
#include <Framework/InputRecord.h>
#include "DataFormatsMID/ColumnData.h"
#include "DataFormatsMID/ROFRecord.h"
#include "MIDBase/Mapping.h"
#include "MIDBase/DetectorParameters.h"
#include "MIDBase/GeometryParameters.h"
#include "MIDWorkflow/ColumnDataSpecsUtils.h"
#include "MIDGlobalMapping/GlobalMapper.h"
#include "MIDRaw/CrateMapper.h"
#include "MIDRaw/CrateParameters.h"
#include "MIDRaw/Decoder.h"
#include "MID/DigitsHelper.h"

namespace o2::quality_control_modules::mid
Expand All @@ -52,6 +57,15 @@ void DigitsQcTask::initialize(o2::framework::InitContext& /*ctx*/)
mLBHighRate = std::make_unique<TH1F>("LBHighRate", "LocalBoardHigherRate", 1, 0, 1.);
getObjectsManager()->startPublishing(mLBHighRate.get());

mGBTRate = std::make_unique<TH1F>("GBTRate", "GBTRate", 32, 0, 32.);
getObjectsManager()->startPublishing(mGBTRate.get());

mCRURate = std::make_unique<TH1F>("CRURate", "CRURate", 2, 0, 2.);
getObjectsManager()->startPublishing(mCRURate.get());

mEPRate = std::make_unique<TH1F>("EPRate", "EPRate", 4, 0, 4.);
getObjectsManager()->startPublishing(mEPRate.get());

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

for (size_t ich = 0; ich < 5; ++ich) {
Expand Down Expand Up @@ -128,15 +142,51 @@ void DigitsQcTask::monitorData(o2::framework::ProcessingContext& ctx)
unsigned long int prevSize = 0;
o2::InteractionRecord prevIr;
bool isFirst = true;

o2::mid::CrateMapper cm;

for (auto& rof : rofs) {
auto eventDigits = digits.subspan(rof.firstEntry, rof.nEntries);
evtSizeB.fill(0);
evtSizeNB.fill(0);

for (auto& col : eventDigits) {

auto ich = o2::mid::detparams::getChamber(col.deId);
evtSizeB[ich] += mDigitsHelper.countDigits(col, 0);
evtSizeNB[ich] += mDigitsHelper.countDigits(col, 1);
mDigitsHelper.fillStripHisto(col, mHits.get());

for (int lineId = 0; lineId < 4; lineId++) {
if (col.getBendPattern(lineId)) {
auto locId = cm.deLocalBoardToRO(col.deId, col.columnId, lineId);

int crateId = o2::mid::raw::getCrateId(locId);
int cruId = o2::mid::crateparams::isRightSide(crateId) ? 0 : 1;
int epId = 0;
switch (crateId % 8) {
case 0:
case 1:
case 4:
case 5:
epId = 0;
break;
case 2:
case 3:
case 6:
case 7:
epId = 1;
break;
}
auto locIdInCrate = o2::mid::raw::getLocId(locId);
auto gbtId = o2::mid::crateparams::getGBTIdFromBoardInCrate(locIdInCrate);
auto gbtUniqueId = o2::mid::crateparams::makeGBTUniqueId(crateId, gbtId);
mGBTRate->Fill(gbtUniqueId);
mCRURate->Fill(cruId);
int epIndex = 2 * cruId + epId;
mEPRate->Fill(epIndex);
}
}
}

unsigned long int sizeTot = 0;
Expand Down Expand Up @@ -218,6 +268,10 @@ void DigitsQcTask::reset()
resetDisplayHistos();

mDigitBCCounts->Reset();

mGBTRate->Reset();
mCRURate->Reset();
mEPRate->Reset();
}

} // namespace o2::quality_control_modules::mid
1 change: 0 additions & 1 deletion Modules/MUON/MID/src/RawQcTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ void RawQcTask::monitorData(o2::framework::ProcessingContext& ctx)
int isLoc = (statusWord >> 6) & 1;
int busyLoc = (statusWord >> 5) & 1;
int decisionLoc = (statusWord >> 4) & 1;

int isPhys = (triggerWord >> 2) & 1;
int isCalib = (triggerWord >> 3) & 1;
int sOrb = triggerWord & 1;
Expand Down
12 changes: 6 additions & 6 deletions Modules/MUON/MID/src/TracksQcTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -478,12 +478,12 @@ void TracksQcTask::monitorData(o2::framework::ProcessingContext& ctx)
mTrackLocalBoardsNBRatio44Map->Fill(-colId - 0.5, linePos, NBFired);
}
} // board in line loop
} // board loop
} // only fire board in the line
} //(EffFlag>2)
} //(EffFlag>1)
} // Efficiency part (EffFlag>0)
} // tracks in ROF
} // board loop
} // only fire board in the line
} //(EffFlag>2)
} //(EffFlag>1)
} // Efficiency part (EffFlag>0)
} // tracks in ROF
mMultTracks->Fill(multTracks);

} // ROFRecords //
Expand Down