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
9 changes: 9 additions & 0 deletions Modules/MFT/include/MFT/QcMFTClusterTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,17 @@
/// \author Katarina Krizkova Gajdosova
/// \author Diana Maria Krupova
/// \author David Grund
/// \author Jakub Juracka
///

#ifndef QC_MFT_CLUSTER_TASK_H
#define QC_MFT_CLUSTER_TASK_H

#include <TH1F.h>
#include <TH2F.h>
#include <TCanvas.h>
#include <TString.h>
#include <THStack.h>
#include <DataFormatsITSMFT/TopologyDictionary.h>
#include "ReconstructionDataFormats/BaseCluster.h"
#include "MFTBase/GeometryTGeo.h"
Expand Down Expand Up @@ -79,6 +83,8 @@ class QcMFTClusterTask /*final*/ : public TaskInterface // todo add back the "fi
std::unique_ptr<TH1FRatio> mClusterZ = nullptr;
std::vector<std::unique_ptr<TH2FRatio>> mClusterXYinLayer;
std::vector<std::unique_ptr<TH1FRatio>> mClusterRinLayer;
std::unique_ptr<TCanvas> mClusterRinAllLayers = nullptr;
std::unique_ptr<THStack> mClusterRinAllLayersStack = nullptr;

std::unique_ptr<TH1FRatio> mClustersROFSize = nullptr;
std::unique_ptr<TH1FRatio> mClustersBC = nullptr;
Expand All @@ -87,6 +93,8 @@ class QcMFTClusterTask /*final*/ : public TaskInterface // todo add back the "fi

int mOnlineQC;

const TString mColors[10] = { "#1F77B4", "#FF7F0E", "#2CA02C", "#D62728", "#8C564B", "#E377C2", "#9467BD", "#BCBD22", "#7F7F7F", "#17BECF" };

// needed to construct the name and path of some histograms
int mHalf[936] = { 0 };
int mDisk[936] = { 0 };
Expand All @@ -100,6 +108,7 @@ class QcMFTClusterTask /*final*/ : public TaskInterface // todo add back the "fi

// internal functions
void getChipMapData();
void updateCanvas();

// cluster size in pixels
int mClusterSize = { 0 };
Expand Down
8 changes: 0 additions & 8 deletions Modules/MFT/src/QcMFTClusterCheck.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ void QcMFTClusterCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality chec
tl->SetTextFont(142);
tl->SetTextSize(0.08);
hMap->GetListOfFunctions()->Add(tl);
tl->Draw();
}
}

Expand All @@ -299,7 +298,6 @@ void QcMFTClusterCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality chec
b->SetFillStyle(4055);
b->SetFillColor(15);
h->GetListOfFunctions()->Add(b);
b->Draw();
}
}
}
Expand All @@ -319,31 +317,25 @@ void QcMFTClusterCheck::beautify(std::shared_ptr<MonitorObject> mo, Quality chec
msg1->Clear();
msg1->AddText("Quality Good");
msg1->SetFillColor(kGreen);
msg1->Draw();
msg2->Clear();
msg2->AddText("No action needed");
msg2->SetFillColor(kGreen);
msg2->Draw();
} else if (checkResult == Quality::Medium) {
LOG(info) << "Quality::Medium";
msg1->Clear();
msg1->AddText("Quality medium");
msg1->SetFillColor(kOrange);
msg1->Draw();
msg2->Clear();
msg2->AddText("Write a logbook entry tagging MFT");
msg2->SetFillColor(kOrange);
msg2->Draw();
} else if (checkResult == Quality::Bad) {
LOG(info) << "Quality::Bad";
msg1->Clear();
msg1->AddText("Quality bad");
msg1->SetFillColor(kRed);
msg1->Draw();
msg2->Clear();
msg2->AddText("Call the on-call!");
msg2->SetFillColor(kRed);
msg2->Draw();
}
}
}
Expand Down
24 changes: 23 additions & 1 deletion Modules/MFT/src/QcMFTClusterTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#include <TH2.h>
#include <TString.h>
#include <TAxis.h>
#include <THStack.h>
#include <TColor.h>
// O2
#include <DataFormatsITSMFT/CompCluster.h>
#include <Framework/InputRecord.h>
Expand Down Expand Up @@ -249,11 +251,20 @@ void QcMFTClusterTask::initialize(o2::framework::InitContext& /*ctx*/)

auto clusterR = std::make_unique<TH1FRatio>(
Form("ClusterRinLayer/mClusterRinLayer%d", nMFTLayer),
Form("Cluster Radial Position in Layer %d; r (cm); # entries", nMFTLayer), 400, 0, 20, true);
Form("Cluster Radial Position in Layer %d; r (cm); # entries per orbit", nMFTLayer), 400, 0, 20, true);
mClusterRinLayer.push_back(std::move(clusterR));
getObjectsManager()->startPublishing(mClusterRinLayer[nMFTLayer].get());
getObjectsManager()->setDisplayHint(mClusterRinLayer[nMFTLayer].get(), "hist");
}
// canvas for for cluster R in all layers
mClusterRinAllLayers = std::make_unique<TCanvas>("mClusterRinAllLayers", "Cluster Radial Position in All MFT Layers");
getObjectsManager()->startPublishing(mClusterRinAllLayers.get());
mClusterRinAllLayersStack = std::make_unique<THStack>("mClusterRinAllLayersStack", "Cluster Radial Position in All MFT Layers; r (cm); # entries");
for (auto nMFTLayer = 0; nMFTLayer < 10; nMFTLayer++) {
mClusterRinLayer[nMFTLayer]->getNum()->SetLineColor(TColor::GetColor(mColors[nMFTLayer]));
mClusterRinLayer[nMFTLayer]->getNum()->SetTitle(Form("D%dF%d", static_cast<int>(std::floor(nMFTLayer / 2.)), nMFTLayer % 2 == 0 ? 0 : 1));
mClusterRinAllLayersStack->Add(mClusterRinLayer[nMFTLayer]->getNum());
}
}
}

Expand Down Expand Up @@ -403,6 +414,7 @@ void QcMFTClusterTask::endOfCycle()
mClusterXYinLayer[nMFTLayer]->update();
mClusterRinLayer[nMFTLayer]->update();
}
updateCanvas();
}
}

Expand Down Expand Up @@ -435,6 +447,7 @@ void QcMFTClusterTask::reset()
mClusterXYinLayer[nMFTLayer]->Reset();
mClusterRinLayer[nMFTLayer]->Reset();
}
mClusterRinAllLayers->Clear();
}
}

Expand All @@ -457,4 +470,13 @@ void QcMFTClusterTask::getChipMapData()
}
}

void QcMFTClusterTask::updateCanvas()
{
mClusterRinAllLayers->cd();
mClusterRinAllLayers->Clear();
mClusterRinAllLayersStack->Draw("nostack hist");
mClusterRinAllLayers->Update();
gPad->BuildLegend(0.83, 0.50, 0.90, 0.90, "", "l");
}

} // namespace o2::quality_control_modules::mft