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
8 changes: 6 additions & 2 deletions Modules/PHOS/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

add_library(O2QcPHOS)

target_sources(O2QcPHOS PRIVATE src/RawQcTask.cxx
target_sources(O2QcPHOS PRIVATE src/TH2FMean.cxx
src/TH2SBitmask.cxx
src/RawQcTask.cxx
src/RawCheck.cxx
src/ClusterQcTask.cxx
src/ClusterCheck.cxx
Expand All @@ -17,7 +19,9 @@ target_include_directories(
target_link_libraries(O2QcPHOS PUBLIC O2QualityControl O2::PHOSBase O2::PHOSReconstruction ROOT::Spectrum)

add_root_dictionary(O2QcPHOS
HEADERS include/PHOS/ClusterQcTask.h
HEADERS include/PHOS/TH2FMean.h
include/PHOS/TH2SBitmask.h
include/PHOS/ClusterQcTask.h
include/PHOS/ClusterCheck.h
include/PHOS/RawQcTask.h
include/PHOS/RawCheck.h
Expand Down
4 changes: 4 additions & 0 deletions Modules/PHOS/include/PHOS/LinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
#pragma link off all classes;
#pragma link off all functions;

#pragma link C++ class o2::quality_control_modules::phos::TH2SBitmask + ;

#pragma link C++ class o2::quality_control_modules::phos::TH2FMean + ;

#pragma link C++ class o2::quality_control_modules::phos::ClusterQcTask + ;

#pragma link C++ class o2::quality_control_modules::phos::ClusterCheck + ;
Expand Down
2 changes: 1 addition & 1 deletion Modules/PHOS/include/PHOS/RawCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class RawCheck final : public o2::quality_control::checker::CheckInterface
// Override interface
void configure() override;
Quality check(std::map<std::string, std::shared_ptr<MonitorObject>>* moMap) override;
void beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult = Quality::Null) override;
void beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult = Quality::Null) override {}
std::string getAcceptedType() override;

protected:
Expand Down
107 changes: 70 additions & 37 deletions Modules/PHOS/include/PHOS/RawQcTask.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@
class TH2F;
#include "DataFormatsPHOS/BadChannelsMap.h"
#include <TSpectrum.h>
#include "PHOS/TH2FMean.h"
#include "PHOS/TH2SBitmask.h"

using namespace o2::quality_control::core;

Expand All @@ -54,7 +56,7 @@ class RawQcTask final : public TaskInterface
void reset() override;

protected:
static constexpr short kNhist1D = 23;
static constexpr short kNhist1D = 27;
enum histos1D { kTotalDataVolume,
kMessageCounter,
kBadMapSummary,
Expand All @@ -74,15 +76,18 @@ class RawQcTask final : public TaskInterface
kLGrmsSummaryM2,
kLGrmsSummaryM3,
kLGrmsSummaryM4,
kCellSpM1,
kCellSpM2,
kCellSpM3,
kCellSpM4
kCellHGSpM1,
kCellHGSpM2,
kCellHGSpM3,
kCellHGSpM4,
kCellLGSpM1,
kCellLGSpM2,
kCellLGSpM3,
kCellLGSpM4
};

static constexpr short kNhist2D = 51;
static constexpr short kNhist2D = 42;
enum histos2D { kErrorNumber,
kErrorType,
kPayloadSizePerDDL,
kChi2M1,
kChi2M2,
Expand All @@ -92,22 +97,6 @@ class RawQcTask final : public TaskInterface
kChi2NormM2,
kChi2NormM3,
kChi2NormM4,
kHGmeanM1,
kHGmeanM2,
kHGmeanM3,
kHGmeanM4,
kLGmeanM1,
kLGmeanM2,
kLGmeanM3,
kLGmeanM4,
kHGrmsM1,
kHGrmsM2,
kHGrmsM3,
kHGrmsM4,
kLGrmsM1,
kLGrmsM2,
kLGrmsM3,
kLGrmsM4,
kHGoccupM1,
kHGoccupM2,
kHGoccupM3,
Expand All @@ -116,22 +105,60 @@ class RawQcTask final : public TaskInterface
kLGoccupM2,
kLGoccupM3,
kLGoccupM4,
kCellOccupM1,
kCellOccupM2,
kCellOccupM3,
kCellOccupM4,
kCellEM1,
kCellEM2,
kCellEM3,
kCellEM4,
kTimeEM1,
kTimeEM2,
kTimeEM3,
kTimeEM4,
kLEDNpeaksM1,
kLEDNpeaksM2,
kLEDNpeaksM3,
kLEDNpeaksM4 };
kTRUSTOccupM1,
kTRUSTOccupM2,
kTRUSTOccupM3,
kTRUSTOccupM4,
kTRUDGOccupM1,
kTRUDGOccupM2,
kTRUDGOccupM3,
kTRUDGOccupM4,
kTRUSTMatchM1,
kTRUSTMatchM2,
kTRUSTMatchM3,
kTRUSTMatchM4,
kTRUSTFakeM1,
kTRUSTFakeM2,
kTRUSTFakeM3,
kTRUSTFakeM4,
kTRUDGFakeM1,
kTRUDGFakeM2,
kTRUDGFakeM3,
kTRUDGFakeM4 };

static constexpr short kNhist2DMean = 24;
enum histos2DMean { kHGmeanM1,
kHGmeanM2,
kHGmeanM3,
kHGmeanM4,
kLGmeanM1,
kLGmeanM2,
kLGmeanM3,
kLGmeanM4,
kHGrmsM1,
kHGrmsM2,
kHGrmsM3,
kHGrmsM4,
kLGrmsM1,
kLGrmsM2,
kLGrmsM3,
kLGrmsM4,
kCellEM1,
kCellEM2,
kCellEM3,
kCellEM4,
kLEDNpeaksM1,
kLEDNpeaksM2,
kLEDNpeaksM3,
kLEDNpeaksM4
};

static constexpr short kNhist2DBitmask = 1;
enum histos2DBitmask { kErrorType };

void InitHistograms();

Expand All @@ -142,6 +169,9 @@ class RawQcTask final : public TaskInterface
void CreateLEDHistograms();
void FillLEDHistograms(const gsl::span<const o2::phos::Cell>& cells, const gsl::span<const o2::phos::TriggerRecord>& tr);

void CreateTRUHistograms();
void FillTRUHistograms(const gsl::span<const o2::phos::Cell>& cells, const gsl::span<const o2::phos::TriggerRecord>& tr);

private:
static constexpr short kNmod = 6;
static constexpr short kMaxErr = 5;
Expand All @@ -150,9 +180,12 @@ class RawQcTask final : public TaskInterface
int mMode = 0; ///< Possible modes: 0(def): Physics, 1: Pedestals, 2: LED
bool mFinalized = false; ///< if final histograms calculated
bool mCheckChi2 = false; ///< scan Chi2 distributions
bool mTrNoise = false; ///< check mathing of trigger summary tables and tr.digits

std::array<TH1F*, kNhist1D> mHist1D = { nullptr }; ///< Array of 1D histograms
std::array<TH2F*, kNhist2D> mHist2D = { nullptr }; ///< Array of 2D histograms
std::array<TH1F*, kNhist1D> mHist1D = { nullptr }; ///< Array of 1D histograms
std::array<TH2F*, kNhist2D> mHist2D = { nullptr }; ///< Array of 2D histograms
std::array<TH2FMean*, kNhist2DMean> mHist2DMean = { nullptr }; ///< Array of 2D mean histograms
std::array<TH2SBitmask*, kNhist2DBitmask> mHist2DBitmask = { nullptr }; ///< Array of 2D mean histograms

bool mInitBadMap = true; //! BadMap had to be initialized
const o2::phos::BadChannelsMap* mBadMap = nullptr; //! Bad map for comparison
Expand Down
48 changes: 48 additions & 0 deletions Modules/PHOS/include/PHOS/TH2FMean.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// 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.

///
/// \file TH2FMean.h
/// \author Dmitri Peresunko
///

#ifndef QC_MODULE_PHOS_TH2FMEAN_H
#define QC_MODULE_PHOS_TH2FMEAN_H

#include "QualityControl/TaskInterface.h"
#include <TH2F.h>
#include "Mergers/MergeInterface.h"

namespace o2::quality_control_modules::phos
{

/// \brief Custom TH2F class with special merger

class TH2FMean : public TH2F, public o2::mergers::MergeInterface
{
public:
/// \brief Constructor.
TH2FMean() = default;
TH2FMean(const char* name, const char* title, Int_t nbinsx, Double_t xlow, Double_t xup, Int_t nbinsy, Double_t ylow, Double_t yup) : TH2F(name, title, nbinsx, xlow, xup, nbinsy, ylow, yup) {}
/// \brief Default destructor
virtual ~TH2FMean() = default;

void merge(MergeInterface* const other) override;

private:
std::string mTreatMeAs = "TH2F"; // the name of the class this object should be considered as when drawing in QCG.

ClassDefOverride(TH2FMean, 1);
};

} // namespace o2::quality_control_modules::phos

#endif // QC_MODULE_PHOS_TH2FMEAN_H
48 changes: 48 additions & 0 deletions Modules/PHOS/include/PHOS/TH2SBitmask.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// 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.

///
/// \file TH2SBitmask.h
/// \author Dmitri Peresunko
///

#ifndef QC_MODULE_PHOS_TH2FBITMASK_H
#define QC_MODULE_PHOS_TH2FBITMASK_H

#include "QualityControl/TaskInterface.h"
#include <TH2S.h>
#include "Mergers/MergeInterface.h"

namespace o2::quality_control_modules::phos
{

/// \brief Custom TH2S class with special merger combining bit masks

class TH2SBitmask : public TH2S, public o2::mergers::MergeInterface
{
public:
/// \brief Constructor.
TH2SBitmask() = default;
TH2SBitmask(const char* name, const char* title, Int_t nbinsx, Double_t xlow, Double_t xup, Int_t nbinsy, Double_t ylow, Double_t yup) : TH2S(name, title, nbinsx, xlow, xup, nbinsy, ylow, yup) {}
/// \brief Default destructor
~TH2SBitmask() = default;

void merge(MergeInterface* const other) override;

private:
std::string mTreatMeAs = "TH2S"; // the name of the class this object should be considered as when drawing in QCG.

ClassDefOverride(TH2SBitmask, 1);
};

} // namespace o2::quality_control_modules::phos

#endif // QC_MODULE_PHOS_TH2FBITMASK_H
24 changes: 11 additions & 13 deletions Modules/PHOS/src/ClusterQcTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "DataFormatsPHOS/TriggerRecord.h"
#include "Framework/InputRecord.h"

//using namespace o2::phos;
// using namespace o2::phos;

namespace o2::quality_control_modules::phos
{
Expand Down Expand Up @@ -61,13 +61,13 @@ void ClusterQcTask::initialize(o2::framework::InitContext& /*ctx*/)
ILOG(Info, Support) << "Custom parameter - myOwnKey : " << param->second << AliceO2::InfoLogger::InfoLogger::endm;
}

//read alignment to calculate cluster global coordinates
// read alignment to calculate cluster global coordinates
mGeom = o2::phos::Geometry::GetInstance("Run3");

//TODO: configure reading bad map from CCDB
// TODO: configure reading bad map from CCDB
mBadMap.reset(new o2::phos::BadChannelsMap());

//Prepare histograms
// Prepare histograms
for (Int_t mod = 0; mod < 4; mod++) {
if (!mHist2D[kOccupancyM1 + mod]) {
mHist2D[kOccupancyM1 + mod] = new TH2F(Form("ClusterOccupancyM%d", mod + 1), Form("Cluster occupancy, mod %d", mod + 1), 64, 0., 64., 56, 0., 56.);
Expand All @@ -84,11 +84,11 @@ void ClusterQcTask::initialize(o2::framework::InitContext& /*ctx*/)
}

if (!mHist2D[kTimeEM1 + mod]) {
mHist2D[kTimeEM1 + mod] = new TH2F(Form("TimevsE%d", mod + 1), Form("Cell time vs energy, mod %d", mod + 1), 50, 0., 10., 50, -2.e-7, 2.e-7);
mHist2D[kTimeEM1 + mod] = new TH2F(Form("TimevsE%d", mod + 1), Form("Cluster time vs energy, mod %d", mod + 1), 50, 0., 10., 50, -5.e-7, 5.e-7);
mHist2D[kTimeEM1 + mod]->GetXaxis()->SetNdivisions(508, kFALSE);
mHist2D[kTimeEM1 + mod]->GetYaxis()->SetNdivisions(514, kFALSE);
mHist2D[kTimeEM1 + mod]->GetXaxis()->SetTitle("x, cells");
mHist2D[kTimeEM1 + mod]->GetYaxis()->SetTitle("z, cells");
mHist2D[kTimeEM1 + mod]->GetXaxis()->SetTitle("E, GeV");
mHist2D[kTimeEM1 + mod]->GetYaxis()->SetTitle("t-t_{0}, ns");
mHist2D[kTimeEM1 + mod]->SetStats(0);
mHist2D[kTimeEM1 + mod]->SetMinimum(0);
// mHist2D[kTimeEM1 + mod]->SetMaximum(100);
Expand Down Expand Up @@ -151,13 +151,11 @@ void ClusterQcTask::monitorData(o2::framework::ProcessingContext& ctx)
}

int mod = clu.module();
//Fill occupancy and time-E histos
// Fill occupancy and time-E histos
float posX, posZ;
clu.getLocalPosition(posX, posZ);
short absId;
mGeom->relPosToAbsId(mod, posX, posZ, absId);
char relid[3];
mGeom->absToRelNumbering(absId, relid);
mGeom->relPosToRelId(mod, posX, posZ, relid);

if (e > mOccCut) {
mHist2D[kOccupancyM1 + mod - 1]->Fill(relid[1] - 0.5, relid[2] - 0.5);
Expand All @@ -183,7 +181,7 @@ void ClusterQcTask::monitorData(o2::framework::ProcessingContext& ctx)
}
}

} //function monitor data
} // function monitor data

void ClusterQcTask::endOfCycle()
{
Expand Down Expand Up @@ -212,7 +210,7 @@ void ClusterQcTask::reset()
}
bool ClusterQcTask::checkCluster(const o2::phos::Cluster& clu)
{
//First check BadMap
// First check BadMap
float posX, posZ;
clu.getLocalPosition(posX, posZ);
short absId;
Expand Down
Loading