Skip to content

Commit

Permalink
[EMCAL-767] changed the SM, TRU, and FastOR gridlines to a public hel…
Browse files Browse the repository at this point in the history
…per class
  • Loading branch information
Sierra Weyhmiller committed Jul 16, 2024
1 parent b58153a commit 0216620
Show file tree
Hide file tree
Showing 5 changed files with 152 additions and 86 deletions.
1 change: 1 addition & 0 deletions Modules/EMCAL/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ add_root_dictionary(O2QcEMCAL
include/EMCAL/CellTimeCalibCheck.h
include/EMCAL/CellAmpCheck.h
include/EMCAL/TrendGraphCheck.h
include/EMCAL/DrawGridlines.h
LINKDEF include/EMCAL/LinkDef.h)


Expand Down
1 change: 0 additions & 1 deletion Modules/EMCAL/include/EMCAL/CalibMonitoringTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ class CalibMonitoringTask final : public quality_control::postprocessing::PostPr
int GetTRUIndexFromSTUIndex(Int_t id, Int_t detector);
int GetChannelForMaskRun2(int mask, int bitnumber, bool onethirdsm);
std::vector<int> GetAbsFastORIndexFromMask();
void DrawTRUGrid();

std::vector<std::string> mCalibObjects; ///< list of vectors of parm objects to be processed
TH1* mTimeCalibParamHisto = nullptr; ///< Monitor Time Calib Param
Expand Down
145 changes: 145 additions & 0 deletions Modules/EMCAL/include/EMCAL/DrawGridlines.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
// All rights not expressly granted are reserved.
//
// This software is distributed under the terms of the GNU General Public
// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.

#ifndef QUALITYCONTROL_DRAWGRIDLINES_H
#define QUALITYCONTROL_DRAWGRIDLINES_H

#include "TLine.h"

namespace o2::quality_control_modules::emcal
{

/// \file DrawGridlines.h
/// \brief Quality Control helper task for drawing the EMCAL gridlines
/// \author Sierra Cantway

class DrawGridlines final : public quality_control::postprocessing::PostProcessingInterface
{
public:
/// \brief Constructor
DrawGridlines() = default;
/// \brief Destructor
~DrawGridlines() = default;

/// \brief Draw the gridlines for the Supermodule limits in the Trigger Geometry
static void DrawSMGridInTriggerGeo()
{

// EMCAL
for (int iside = 0; iside <= 48; iside += 24) {
auto smline = new TLine(static_cast<double>(iside) - 0.5, -0.5, static_cast<double>(iside) - 0.5, 63.5);
smline->SetLineWidth(6);
smline->Draw("same");
}
for (int iphi = 0; iphi < 60; iphi += 12) {
auto smline = new TLine(-0.5, static_cast<double>(iphi) - 0.5, 47.5, static_cast<double>(iphi) - 0.5);
smline->SetLineWidth(6);
smline->Draw("same");
}
for (auto iphi = 60; iphi <= 64; iphi += 4) {
auto smline = new TLine(-0.5, static_cast<double>(iphi) - 0.5, 47.5, static_cast<double>(iphi) - 0.5);
smline->SetLineWidth(6);
smline->Draw("same");
}

// DCAL
for (int side = 0; side < 2; side++) {
int sideoffset = (side == 0) ? 0 : 32;
for (int isepeta = 0; isepeta < 2; isepeta++) {
int etaoffset = sideoffset + isepeta * 16;
auto smline = new TLine(static_cast<double>(etaoffset) - 0.5, 63.5, static_cast<double>(etaoffset) - 0.5, 99.5);
smline->SetLineWidth(6);
smline->Draw("same");
}
for (auto iphi = 76; iphi <= 88; iphi += 12) {
auto smline = new TLine(static_cast<double>(sideoffset) - 0.5, static_cast<double>(iphi) - 0.5, static_cast<double>(sideoffset + 16) - 0.5, static_cast<double>(iphi) - 0.5);
smline->SetLineWidth(6);
smline->Draw("same");
}
}
for (auto iphi = 100; iphi <= 104; iphi += 4) {
auto smline = new TLine(-0.5, static_cast<double>(iphi) - 0.5, 47.5, static_cast<int>(iphi) - 0.5);
smline->SetLineWidth(6);
smline->Draw("same");
}
for (auto ieta = 0; ieta <= 48; ieta += 24) {
auto smline = new TLine(static_cast<double>(ieta) - 0.5, 99.5, static_cast<double>(ieta) - 0.5, 103.5);
smline->SetLineWidth(6);
smline->Draw("same");
}
};

/// \brief Draw the gridlines for the TRU limits
static void DrawTRUGrid()
{

// EMCAL
for (int side = 0; side < 2; side++) {
int sideoffset = 24 * side;
for (int itru = 0; itru < 2; itru++) {
int truoffset = sideoffset + (itru + 1) * 8;
auto truline = new TLine(static_cast<int>(truoffset) - 0.5, -0.5, static_cast<int>(truoffset) - 0.5, 59.5);
truline->SetLineWidth(3);
truline->Draw("same");
}
}

// DCAL
for (int side = 0; side < 2; side++) {
int sideoffset = (side == 0) ? 0 : 32;
auto truseparator = new TLine(static_cast<double>(sideoffset + 8) - 0.5, 63.5, static_cast<double>(sideoffset + 8) - 0.5, 99.5);
truseparator->SetLineWidth(3);
truseparator->Draw("same");
}
};

/// \brief Draw the gridlines for the FastOR limits
static void DrawFastORGrid()
{

// EMCAL
for (int iphi = 1; iphi < 64; iphi++) {
auto fastorLine = new TLine(-0.5, static_cast<double>(iphi) - 0.5, 47.5, static_cast<double>(iphi) - 0.5);
fastorLine->Draw("same");
}
for (int ieta = 1; ieta < 48; ieta++) {
auto fastorLine = new TLine(static_cast<double>(ieta) - 0.5, -0.5, static_cast<double>(ieta) - 0.5, 63.5);
fastorLine->Draw("same");
}

// DCAL
for (int side = 0; side < 2; side++) {
int sideoffset = (side == 0) ? 0 : 32;
for (int ieta = 0; ieta <= 16; ieta++) {
int etaoffset = sideoffset + ieta;
auto fastorline = new TLine(static_cast<double>(etaoffset - 0.5), 63.5, static_cast<double>(etaoffset) - 0.5, 99.5);
fastorline->Draw("same");
}
for (int iphi = 0; iphi <= 36; iphi++) {
int phioffset = iphi + 64;
auto fastorline = new TLine(static_cast<double>(sideoffset - 0.5), static_cast<double>(phioffset - 0.5), static_cast<double>(sideoffset + 16) - 0.5, static_cast<double>(phioffset) - 0.5);
fastorline->Draw("same");
}
}
for (auto ieta = 1; ieta < 48; ieta++) {
auto etaline = new TLine(static_cast<double>(ieta) - 0.5, 99.5, static_cast<double>(ieta) - 0.5, 103.5);
etaline->Draw("same");
}
for (auto iphi = 101; iphi <= 103; iphi++) {
auto philine = new TLine(-0.5, static_cast<double>(iphi) - 0.5, 47.5, static_cast<int>(iphi) - 0.5);
philine->Draw("same");
}
};
};

} // namespace o2::quality_control_modules::emcal

#endif // QUALITYCONTROL_DRAWGRIDLINES_H
1 change: 1 addition & 0 deletions Modules/EMCAL/include/EMCAL/LinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@
#pragma link C++ class o2::quality_control_modules::emcal::TrendGraphCheck + ;

#pragma link C++ class o2::quality_control_modules::emcal::RawErrorCheckAll + ;
#pragma link C++ class o2::quality_control_modules::emcal::DrawGridlines + ;

#endif
90 changes: 5 additions & 85 deletions Modules/EMCAL/src/CalibMonitoringTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
// QC includes
#include "QualityControl/QcInfoLogger.h"
#include "EMCAL/CalibMonitoringTask.h"
#include "EMCAL/DrawGridlines.h"

// root includes
#include "TCanvas.h"
Expand Down Expand Up @@ -93,90 +94,6 @@ std::vector<int> CalibMonitoringTask::GetAbsFastORIndexFromMask()
return maskedfastors;
}

void CalibMonitoringTask::DrawTRUGrid()
{
// EMCAL
for (int iphi = 1; iphi < 64; iphi++) {
auto fastorLine = new TLine(-0.5, static_cast<double>(iphi) - 0.5, 47.5, static_cast<double>(iphi) - 0.5);
fastorLine->Draw("same");
}
for (int ieta = 1; ieta < 48; ieta++) {
auto fastorLine = new TLine(static_cast<double>(ieta) - 0.5, -0.5, static_cast<double>(ieta) - 0.5, 63.5);
fastorLine->Draw("same");
}
for (int side = 0; side < 2; side++) {
int sideoffset = 24 * side;
for (int itru = 0; itru < 2; itru++) {
int truoffset = sideoffset + (itru + 1) * 8;
auto truline = new TLine(static_cast<int>(truoffset) - 0.5, -0.5, static_cast<int>(truoffset) - 0.5, 59.5);
truline->SetLineWidth(2);
truline->Draw("same");
}
}
for (int iside = 0; iside <= 48; iside += 24) {
auto smline = new TLine(static_cast<double>(iside) - 0.5, -0.5, static_cast<double>(iside) - 0.5, 63.5);
smline->SetLineWidth(3);
smline->Draw("same");
}
for (int iphi = 0; iphi < 60; iphi += 12) {
auto smline = new TLine(-0.5, static_cast<double>(iphi) - 0.5, 47.5, static_cast<double>(iphi) - 0.5);
smline->SetLineWidth(3);
smline->Draw("same");
}
for (auto iphi = 60; iphi <= 64; iphi += 4) {
auto smline = new TLine(-0.5, static_cast<double>(iphi) - 0.5, 47.5, static_cast<double>(iphi) - 0.5);
smline->SetLineWidth(3);
smline->Draw("same");
}

// DCAL
for (int side = 0; side < 2; side++) {
int sideoffset = (side == 0) ? 0 : 32;
for (int ieta = 0; ieta <= 16; ieta++) {
int etaoffset = sideoffset + ieta;
auto fastorline = new TLine(static_cast<double>(etaoffset - 0.5), 63.5, static_cast<double>(etaoffset) - 0.5, 99.5);
fastorline->Draw("same");
}
for (int iphi = 0; iphi <= 36; iphi++) {
int phioffset = iphi + 64;
auto fastorline = new TLine(static_cast<double>(sideoffset - 0.5), static_cast<double>(phioffset - 0.5), static_cast<double>(sideoffset + 16) - 0.5, static_cast<double>(phioffset) - 0.5);
fastorline->Draw("same");
}
for (int isepeta = 0; isepeta < 2; isepeta++) {
int etaoffset = sideoffset + isepeta * 16;
auto smline = new TLine(static_cast<double>(etaoffset) - 0.5, 63.5, static_cast<double>(etaoffset) - 0.5, 99.5);
smline->SetLineWidth(3);
smline->Draw("same");
}
for (auto iphi = 76; iphi <= 88; iphi += 12) {
auto smline = new TLine(static_cast<double>(sideoffset) - 0.5, static_cast<double>(iphi) - 0.5, static_cast<double>(sideoffset + 16) - 0.5, static_cast<double>(iphi) - 0.5);
smline->SetLineWidth(3);
smline->Draw("same");
}
auto truseparator = new TLine(static_cast<double>(sideoffset + 8) - 0.5, 63.5, static_cast<double>(sideoffset + 8) - 0.5, 99.5);
truseparator->SetLineWidth(2);
truseparator->Draw("same");
}
for (auto ieta = 1; ieta < 48; ieta++) {
auto etaline = new TLine(static_cast<double>(ieta) - 0.5, 99.5, static_cast<double>(ieta) - 0.5, 103.5);
etaline->Draw("same");
}
for (auto iphi = 101; iphi <= 103; iphi++) {
auto philine = new TLine(-0.5, static_cast<double>(iphi) - 0.5, 47.5, static_cast<int>(iphi) - 0.5);
philine->Draw("same");
}
for (auto iphi = 100; iphi <= 104; iphi += 4) {
auto smline = new TLine(-0.5, static_cast<double>(iphi) - 0.5, 47.5, static_cast<int>(iphi) - 0.5);
smline->SetLineWidth(3);
smline->Draw("same");
}
for (auto ieta = 0; ieta <= 48; ieta += 24) {
auto smline = new TLine(static_cast<double>(ieta) - 0.5, 99.5, static_cast<double>(ieta) - 0.5, 103.5);
smline->SetLineWidth(3);
smline->Draw("same");
}
}

void CalibMonitoringTask::configure(const boost::property_tree::ptree& config)
{
mCalibDB = std::make_unique<o2::emcal::CalibDB>(config.get<std::string>("qc.config.conditionDB.url").data());
Expand Down Expand Up @@ -445,7 +362,10 @@ void CalibMonitoringTask::update(Trigger t, framework::ServiceRegistryRef)
mTRUMaskPositionCanvas->Clear();
mTRUMaskPositionCanvas->cd();
mTRUMaskPositionHisto->Draw("colz");
DrawTRUGrid();

o2::quality_control_modules::emcal::DrawGridlines::DrawFastORGrid();
o2::quality_control_modules::emcal::DrawGridlines::DrawTRUGrid();
o2::quality_control_modules::emcal::DrawGridlines::DrawSMGridInTriggerGeo();
}
}
}
Expand Down

0 comments on commit 0216620

Please sign in to comment.