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/TPC/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ target_sources(O2QcTPC PRIVATE src/PID.cxx
src/ROCReductor.cxx
src/Clusters.cxx
src/CalDetPublisher.cxx
src/Utility.cxx)
src/Utility.cxx
src/RawDigits.cxx)

target_include_directories(
O2QcTPC
Expand All @@ -21,7 +22,8 @@ target_include_directories(

target_link_libraries(O2QcTPC
PUBLIC O2QualityControl
O2::TPCQC)
O2::TPCQC
O2::TPCWorkflow)



Expand All @@ -35,6 +37,7 @@ add_root_dictionary(O2QcTPC
include/TPC/Clusters.h
include/TPC/CalDetPublisher.h
include/TPC/Utility.h
include/TPC/RawDigits.h
LINKDEF include/TPC/LinkDef.h
BASENAME O2QcTPC)

Expand Down Expand Up @@ -91,4 +94,5 @@ install(FILES run/tpcQCPID_sampled.json
run/tpcQCClusters_direct.json
run/tpcQCTrackingFromExternal_direct.json
run/tpcQCCalDetPublisher.json
run/tpcQCRawDigits_direct.json
DESTINATION etc)
1 change: 1 addition & 0 deletions Modules/TPC/include/TPC/LinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#pragma link C++ class o2::quality_control_modules::tpc::ROCReductor+;
#pragma link C++ class o2::quality_control_modules::tpc::Clusters+;
#pragma link C++ class o2::quality_control_modules::tpc::CalDetPublisher+;
#pragma link C++ class o2::quality_control_modules::tpc::RawDigits+;

#pragma link C++ function o2::quality_control_modules::tpc::addAndPublish+;
#pragma link C++ function o2::quality_control_modules::tpc::toVector+;
Expand Down
71 changes: 71 additions & 0 deletions Modules/TPC/include/TPC/RawDigits.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// 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 RawDigits.h
/// \author Jens Wiechula
/// \author Thomas Klemenz
///

#ifndef QC_MODULE_TPC_RAWDIGITS_H
#define QC_MODULE_TPC_RAWDIGITS_H

// O2 includes
#include "TPCQC/Clusters.h"
#include "TPCQC/CalPadWrapper.h"
#include "TPCReconstruction/RawReaderCRU.h"
#include "TPCWorkflow/CalibProcessingHelper.h"

// QC includes
#include "QualityControl/TaskInterface.h"

class TCanvas;

using namespace o2::quality_control::core;

namespace o2::quality_control_modules::tpc
{

/// \brief Example Quality Control DPL Task
/// It is final because there is no reason to derive from it. Just remove it if needed.
/// \author Barthelemy von Haller
/// \author Piotr Konopka
class RawDigits /*final*/ : public TaskInterface // todo add back the "final" when doxygen is fixed
{
public:
/// \brief Constructor
RawDigits();
/// \brief Destructor
~RawDigits() = default;

// Definition of the methods for the template method pattern
void initialize(o2::framework::InitContext& ctx) override;
void startOfActivity(Activity& activity) override;
void startOfCycle() override;
void monitorData(o2::framework::ProcessingContext& ctx) override;
void endOfCycle() override;
void endOfActivity(Activity& activity) override;
void reset() override;

private:
o2::tpc::qc::Clusters mRawDigitQC; ///< O2 Cluster task to perform actions on cluster objects
std::vector<o2::tpc::qc::CalPadWrapper> mWrapperVector{}; ///< vector holding CalPad objects wrapped as TObjects; published on QCG; will be non-wrapped CalPad objects in the future
std::vector<std::unique_ptr<TCanvas>> mNRawDigitsCanvasVec{}; ///< summary canvases of the NRawDigits object
std::vector<std::unique_ptr<TCanvas>> mQMaxCanvasVec{}; ///< summary canvases of the QMax object
std::vector<std::unique_ptr<TCanvas>> mQTotCanvasVec{}; ///< summary canvases of the QTot object
std::vector<std::unique_ptr<TCanvas>> mSigmaTimeCanvasVec{}; ///< summary canvases of the SigmaTime object
std::vector<std::unique_ptr<TCanvas>> mSigmaPadCanvasVec{}; ///< summary canvases of the SigmaPad object
std::vector<std::unique_ptr<TCanvas>> mTimeBinCanvasVec{}; ///< summary canvases of the TimeBin object
o2::tpc::rawreader::RawReaderCRUManager mRawReader;
};

} // namespace o2::quality_control_modules::tpc

#endif // QC_MODULE_TPC_RawDigits_H
2 changes: 1 addition & 1 deletion Modules/TPC/run/tpcQCClusters_direct.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"className": "o2::quality_control_modules::tpc::Clusters",
"moduleName": "QcTPC",
"detectorName": "TPC",
"cycleDurationSeconds": "10",
"cycleDurationSeconds": "60",
"maxNumberCycles": "-1",
"dataSource": {
"type": "direct",
Expand Down
2 changes: 1 addition & 1 deletion Modules/TPC/run/tpcQCPID_direct.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"className": "o2::quality_control_modules::tpc::PID",
"moduleName": "QcTPC",
"detectorName": "TPC",
"cycleDurationSeconds": "10",
"cycleDurationSeconds": "60",
"maxNumberCycles": "-1",
"dataSource": {
"type": "direct",
Expand Down
46 changes: 46 additions & 0 deletions Modules/TPC/run/tpcQCRawDigits_direct.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"qc": {
"config": {
"database": {
"implementation": "CCDB",
"host": "ccdb-test.cern.ch:8080",
"username": "not_applicable",
"password": "not_applicable",
"name": "not_applicable"
},
"Activity": {
"number": "42",
"type": "2"
},
"monitoring": {
"url": "infologger:///debug?qc"
},
"consul": {
"url": "http://consul-test.cern.ch:8500"
},
"conditionDB": {
"url": "ccdb-test.cern.ch:8080"
}
},
"tasks": {
"RawDigits": {
"active": "true",
"className": "o2::quality_control_modules::tpc::RawDigits",
"moduleName": "QcTPC",
"detectorName": "TPC",
"cycleDurationSeconds": "60",
"maxNumberCycles": "-1",
"dataSource": {
"type": "direct",
"query" : "input:TPC/RAWDATA"
},
"taskParameters": {
"myOwnKey": "myOwnValue"
},
"location": "remote"
}
}
},
"dataSamplingPolicies": [
]
}
2 changes: 1 addition & 1 deletion Modules/TPC/run/tpcQCTracks_direct.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"className": "o2::quality_control_modules::tpc::Tracks",
"moduleName": "QcTPC",
"detectorName": "TPC",
"cycleDurationSeconds": "10",
"cycleDurationSeconds": "60",
"maxNumberCycles": "-1",
"dataSource": {
"type": "direct",
Expand Down
101 changes: 101 additions & 0 deletions Modules/TPC/src/RawDigits.cxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// 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 RawDigits.cxx
/// \author Thomas Klemenz
///

// O2 includes
#include "Framework/ProcessingContext.h"
#include "DataFormatsTPC/ClusterNative.h"
#include "TPCBase/Painter.h"

// QC includes
#include "QualityControl/QcInfoLogger.h"
#include "TPC/RawDigits.h"
#include "TPC/Utility.h"

namespace o2::quality_control_modules::tpc
{

RawDigits::RawDigits() : TaskInterface()
{
mWrapperVector.emplace_back(&mRawDigitQC.getNClusters());
mWrapperVector.emplace_back(&mRawDigitQC.getQMax());
mWrapperVector.emplace_back(&mRawDigitQC.getTimeBin());
}

void RawDigits::initialize(o2::framework::InitContext& /*ctx*/)
{
QcInfoLogger::GetInstance() << "initialize TPC RawDigits QC task" << AliceO2::InfoLogger::InfoLogger::endm;

mRawReader.createReader("");

addAndPublish(getObjectsManager(), mNRawDigitsCanvasVec, { "c_Sides_N_RawDigits", "c_ROCs_N_RawDigits_1D", "c_ROCs_N_RawDigits_2D" });
addAndPublish(getObjectsManager(), mQMaxCanvasVec, { "c_Sides_Q_Max", "c_ROCs_Q_Max_1D", "c_ROCs_Q_Max_2D" });
addAndPublish(getObjectsManager(), mTimeBinCanvasVec, { "c_Sides_Time_Bin", "c_ROCs_Time_Bin_1D", "c_ROCs_Time_Bin_2D" });

for (auto& wrapper : mWrapperVector) {
getObjectsManager()->startPublishing(&wrapper);
getObjectsManager()->addMetadata(wrapper.getObj()->getName().data(), "custom", "87");
}

mRawReader.setLinkZSCallback([this](int cru, int rowInSector, int padInRow, int timeBin, float adcValue) -> bool {
mRawDigitQC.fillADCValue(cru, rowInSector, padInRow, timeBin, adcValue);
return true;
});
}

void RawDigits::startOfActivity(Activity& /*activity*/)
{
QcInfoLogger::GetInstance() << "startOfActivity" << AliceO2::InfoLogger::InfoLogger::endm;
}

void RawDigits::startOfCycle()
{
QcInfoLogger::GetInstance() << "startOfCycle" << AliceO2::InfoLogger::InfoLogger::endm;
}

void RawDigits::monitorData(o2::framework::ProcessingContext& ctx)
{
auto& reader = mRawReader.getReaders()[0];
o2::tpc::calib_processing_helper::processRawData(ctx.inputs(), reader, false);

mRawDigitQC.analyse();

auto vecPtrNRawDigits = toVector(mNRawDigitsCanvasVec);
o2::tpc::painter::makeSummaryCanvases(mRawDigitQC.getNClusters(), 300, 0, 0, true, &vecPtrNRawDigits);

auto vecPtrQMax = toVector(mQMaxCanvasVec);
o2::tpc::painter::makeSummaryCanvases(mRawDigitQC.getQMax(), 300, 0, 0, true, &vecPtrQMax);

auto vecPtrTimeBin = toVector(mTimeBinCanvasVec);
o2::tpc::painter::makeSummaryCanvases(mRawDigitQC.getTimeBin(), 300, 0, 0, true, &vecPtrTimeBin);
}

void RawDigits::endOfCycle()
{
QcInfoLogger::GetInstance() << "endOfCycle" << AliceO2::InfoLogger::InfoLogger::endm;
}

void RawDigits::endOfActivity(Activity& /*activity*/)
{
QcInfoLogger::GetInstance() << "endOfActivity" << AliceO2::InfoLogger::InfoLogger::endm;
}

void RawDigits::reset()
{
// clean all the monitor objects here

QcInfoLogger::GetInstance() << "Resetting the histogram" << AliceO2::InfoLogger::InfoLogger::endm;
}

} // namespace o2::quality_control_modules::tpc