From 97faa484327eeeaa8ed37362f42104f7360b4bec Mon Sep 17 00:00:00 2001 From: Marek Bombara Date: Thu, 21 Oct 2021 13:21:48 +0200 Subject: [PATCH 01/14] starting changes --- Modules/CMakeLists.txt | 1 + Modules/TRG/CMakeLists.txt | 42 ++++++++ Modules/TRG/include/TRG/LinkDef.h | 8 ++ Modules/TRG/include/TRG/RawDataQcTask.h | 54 ++++++++++ Modules/TRG/src/RawDataQcTask.cxx | 137 ++++++++++++++++++++++++ Modules/TRG/test/testQcTRG.cxx | 30 ++++++ dpl-config.json | 18 ++++ 7 files changed, 290 insertions(+) create mode 100644 Modules/TRG/CMakeLists.txt create mode 100644 Modules/TRG/include/TRG/LinkDef.h create mode 100644 Modules/TRG/include/TRG/RawDataQcTask.h create mode 100644 Modules/TRG/src/RawDataQcTask.cxx create mode 100644 Modules/TRG/test/testQcTRG.cxx create mode 100644 dpl-config.json diff --git a/Modules/CMakeLists.txt b/Modules/CMakeLists.txt index 47779d0f27..f50f0ec6d6 100644 --- a/Modules/CMakeLists.txt +++ b/Modules/CMakeLists.txt @@ -19,3 +19,4 @@ add_subdirectory(CPV) add_subdirectory(GLO) add_subdirectory(FV0) add_subdirectory(FDD) +add_subdirectory(TRG) diff --git a/Modules/TRG/CMakeLists.txt b/Modules/TRG/CMakeLists.txt new file mode 100644 index 0000000000..2d85bfa0e1 --- /dev/null +++ b/Modules/TRG/CMakeLists.txt @@ -0,0 +1,42 @@ +# ---- Library ---- + +add_library(O2QcTRG) + +target_sources(O2QcTRG PRIVATE src/RawDataQcTask.cxx ) + +target_include_directories( + O2QcTRG + PUBLIC $ + $ + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src) + +target_link_libraries(O2QcTRG PUBLIC O2QualityControl) + +install(TARGETS O2QcTRG + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + +add_root_dictionary(O2QcTRG + HEADERS +include/TRG/RawDataQcTask.h + LINKDEF include/TRG/LinkDef.h + BASENAME O2QcTRG) + +# ---- Test(s) ---- + +set(TEST_SRCS test/testQcTRG.cxx) + +foreach(test ${TEST_SRCS}) + get_filename_component(test_name ${test} NAME) + string(REGEX REPLACE ".cxx" "" test_name ${test_name}) + + add_executable(${test_name} ${test}) + target_link_libraries(${test_name} + PRIVATE O2QcTRG Boost::unit_test_framework) + add_test(NAME ${test_name} COMMAND ${test_name}) + set_property(TARGET ${test_name} + PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/tests) + set_tests_properties(${test_name} PROPERTIES TIMEOUT 20) +endforeach() + diff --git a/Modules/TRG/include/TRG/LinkDef.h b/Modules/TRG/include/TRG/LinkDef.h new file mode 100644 index 0000000000..2e27fc3b6a --- /dev/null +++ b/Modules/TRG/include/TRG/LinkDef.h @@ -0,0 +1,8 @@ +#ifdef __CLING__ +#pragma link off all globals; +#pragma link off all classes; +#pragma link off all functions; + +#pragma link C++ class o2::quality_control_modules::trg::RawDataQcTask+; + +#endif diff --git a/Modules/TRG/include/TRG/RawDataQcTask.h b/Modules/TRG/include/TRG/RawDataQcTask.h new file mode 100644 index 0000000000..84752a6035 --- /dev/null +++ b/Modules/TRG/include/TRG/RawDataQcTask.h @@ -0,0 +1,54 @@ +// 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 RawDataQcTask.h +/// \author My Name +/// + +#ifndef QC_MODULE_TRG_TRGRAWDATAQCTASK_H +#define QC_MODULE_TRG_TRGRAWDATAQCTASK_H + +#include "QualityControl/TaskInterface.h" + +class TH1F; + +using namespace o2::quality_control::core; + +namespace o2::quality_control_modules::trg +{ + +/// \brief Example Quality Control DPL Task +/// \author My Name +class RawDataQcTask final : public TaskInterface +{ + public: + /// \brief Constructor + RawDataQcTask() = default; + /// Destructor + ~RawDataQcTask() override; + + // 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: + TH1F* mHistogram = nullptr; +}; + +} // namespace o2::quality_control_modules::trg + +#endif // QC_MODULE_TRG_TRGRAWDATAQCTASK_H diff --git a/Modules/TRG/src/RawDataQcTask.cxx b/Modules/TRG/src/RawDataQcTask.cxx new file mode 100644 index 0000000000..0ae942daa5 --- /dev/null +++ b/Modules/TRG/src/RawDataQcTask.cxx @@ -0,0 +1,137 @@ +// 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 RawDataQcTask.cxx +/// \author Marek Bombara +/// + +#include +#include + +#include "QualityControl/QcInfoLogger.h" +#include "TRG/RawDataQcTask.h" +#include +#include + +namespace o2::quality_control_modules::trg +{ + +RawDataQcTask::~RawDataQcTask() +{ + delete mHistogram; +} + +void RawDataQcTask::initialize(o2::framework::InitContext& /*ctx*/) +{ + ILOG(Info, Support) << "initialize RawDataQcTask" << ENDM; // QcInfoLogger is used. FairMQ logs will go to there as well. + + // this is how to get access to custom parameters defined in the config file at qc.tasks..taskParameters + if (auto param = mCustomParameters.find("myOwnKey"); param != mCustomParameters.end()) { + ILOG(Info, Devel) << "Custom parameter - myOwnKey: " << param->second << ENDM; + } + + mHistogram = new TH1F("example", "example", 20, 0, 30000); + getObjectsManager()->startPublishing(mHistogram); + getObjectsManager()->startPublishing(new TH1F("example2", "This is mb histogram", 20, 0, 30000)); + try { + getObjectsManager()->addMetadata(mHistogram->GetName(), "custom", "34"); + } catch (...) { + // some methods can throw exceptions, it is indicated in their doxygen. + // In case it is recoverable, it is recommended to catch them and do something meaningful. + // Here we don't care that the metadata was not added and just log the event. + ILOG(Warning, Support) << "Metadata could not be added to " << mHistogram->GetName() << ENDM; + } +} + +void RawDataQcTask::startOfActivity(Activity& activity) +{ + ILOG(Info, Support) << "startOfActivity " << activity.mId << ENDM; + mHistogram->Reset(); +} + +void RawDataQcTask::startOfCycle() +{ + ILOG(Info, Support) << "startOfCycle" << ENDM; +} + +void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) +{ + // In this function you can access data inputs specified in the JSON config file, for example: + // "query": "random:ITS/RAWDATA/0" + // which is correspondingly ://(input.header); + // get payload of a specific input, which is a char array. + // const char* payload = input.payload; + + // for the sake of an example, let's fill the histogram with payload sizes + mHistogram->Fill(header->payloadSize); + } + + // 2. Using get("") + + // get the payload of a specific input, which is a char array. "random" is the binding specified in the config file. + // auto payload = ctx.inputs().get("random").payload; + + // get payload of a specific input, which is a structure array: + // const auto* header = header::get(ctx.inputs().get("random").header); + // struct s {int a; double b;}; + // auto array = ctx.inputs().get("random"); + // for (int j = 0; j < header->payloadSize / sizeof(s); ++j) { + // int i = array.get()[j].a; + // } + + // get payload of a specific input, which is a root object + // auto h = ctx.inputs().get("histos"); + // Double_t stats[4]; + // h->GetStats(stats); + // auto s = ctx.inputs().get("string"); + // LOG(info) << "String is " << s->GetString().Data(); + + // 3. Access CCDB. If it is enough to retrieve it once, do it in initialize(). + // Remember to delete the object when the pointer goes out of scope or it is no longer needed. + // TObject* condition = TaskInterface::retrieveCondition("QcTask/example"); // put a valid condition path here + // if (condition) { + // LOG(info) << "Retrieved " << condition->ClassName(); + // delete condition; + // } +} + +void RawDataQcTask::endOfCycle() +{ + ILOG(Info, Support) << "endOfCycle" << ENDM; +} + +void RawDataQcTask::endOfActivity(Activity& /*activity*/) +{ + ILOG(Info, Support) << "endOfActivity" << ENDM; +} + +void RawDataQcTask::reset() +{ + // clean all the monitor objects here + + ILOG(Info, Support) << "Resetting the histogram" << ENDM; + mHistogram->Reset(); +} + +} // namespace o2::quality_control_modules::trg diff --git a/Modules/TRG/test/testQcTRG.cxx b/Modules/TRG/test/testQcTRG.cxx new file mode 100644 index 0000000000..2853b6b854 --- /dev/null +++ b/Modules/TRG/test/testQcTRG.cxx @@ -0,0 +1,30 @@ +// 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 testTRG.cxx +/// \author My Name +/// + +#include "QualityControl/TaskFactory.h" + +#define BOOST_TEST_MODULE Publisher test +#define BOOST_TEST_MAIN +#define BOOST_TEST_DYN_LINK + +#include + +namespace o2::quality_control_modules::trg +{ + +BOOST_AUTO_TEST_CASE(instantiate_task) { BOOST_CHECK(true); } + +} // namespace o2::quality_control_modules::trg diff --git a/dpl-config.json b/dpl-config.json new file mode 100644 index 0000000000..e796a2ab09 --- /dev/null +++ b/dpl-config.json @@ -0,0 +1,18 @@ +{ + "internal-dpl-clock": "", + "producer-0": { + "orbit-offset-enumeration": "0", + "orbit-multiplier-enumeration": "0", + "start-value-enumeration": "0", + "end-value-enumeration": "-1", + "step-value-enumeration": "1" + }, + "Dispatcher": { + "period-timer-stats": "10000000" + }, + "QC-TASK-RUNNER-QcTask": { + "period-timer-cycle": "10000000" + }, + "QC-CHECK-RUNNER-QcCheck": "", + "printer": "" +} From 1be4c0f48cbdcef2a9b17e8669e30cb48874594e Mon Sep 17 00:00:00 2001 From: Marek Bombara Date: Fri, 22 Oct 2021 14:34:32 +0200 Subject: [PATCH 02/14] hope good start --- Modules/CMakeLists.txt | 1 + Modules/CTP/CMakeLists.txt | 43 +++++++ Modules/CTP/basic-ctp.json | 76 +++++++++++++ Modules/CTP/include/CTP/Example2Check.h | 46 ++++++++ Modules/CTP/include/CTP/LinkDef.h | 10 ++ Modules/CTP/include/CTP/RawDataQcTask.h | 55 +++++++++ Modules/CTP/src/Example2Check.cxx | 85 ++++++++++++++ Modules/CTP/src/RawDataQcTask.cxx | 145 ++++++++++++++++++++++++ Modules/CTP/test/testQcCTP.cxx | 30 +++++ QualityControl | 1 + 10 files changed, 492 insertions(+) create mode 100644 Modules/CTP/CMakeLists.txt create mode 100644 Modules/CTP/basic-ctp.json create mode 100644 Modules/CTP/include/CTP/Example2Check.h create mode 100644 Modules/CTP/include/CTP/LinkDef.h create mode 100644 Modules/CTP/include/CTP/RawDataQcTask.h create mode 100644 Modules/CTP/src/Example2Check.cxx create mode 100644 Modules/CTP/src/RawDataQcTask.cxx create mode 100644 Modules/CTP/test/testQcCTP.cxx create mode 160000 QualityControl diff --git a/Modules/CMakeLists.txt b/Modules/CMakeLists.txt index f50f0ec6d6..2dd91cdb6a 100644 --- a/Modules/CMakeLists.txt +++ b/Modules/CMakeLists.txt @@ -20,3 +20,4 @@ add_subdirectory(GLO) add_subdirectory(FV0) add_subdirectory(FDD) add_subdirectory(TRG) +add_subdirectory(CTP) diff --git a/Modules/CTP/CMakeLists.txt b/Modules/CTP/CMakeLists.txt new file mode 100644 index 0000000000..ba67932471 --- /dev/null +++ b/Modules/CTP/CMakeLists.txt @@ -0,0 +1,43 @@ +# ---- Library ---- + +add_library(O2QcCTP) + +target_sources(O2QcCTP PRIVATE src/Example2Check.cxx src/RawDataQcTask.cxx ) + +target_include_directories( + O2QcCTP + PUBLIC $ + $ + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src) + +target_link_libraries(O2QcCTP PUBLIC O2QualityControl) + +install(TARGETS O2QcCTP + LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} + ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) + +add_root_dictionary(O2QcCTP + HEADERS +include/CTP/RawDataQcTask.h +include/CTP/Example2Check.h + LINKDEF include/CTP/LinkDef.h + BASENAME O2QcCTP) + +# ---- Test(s) ---- + +set(TEST_SRCS test/testQcCTP.cxx) + +foreach(test ${TEST_SRCS}) + get_filename_component(test_name ${test} NAME) + string(REGEX REPLACE ".cxx" "" test_name ${test_name}) + + add_executable(${test_name} ${test}) + target_link_libraries(${test_name} + PRIVATE O2QcCTP Boost::unit_test_framework) + add_test(NAME ${test_name} COMMAND ${test_name}) + set_property(TARGET ${test_name} + PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/tests) + set_tests_properties(${test_name} PROPERTIES TIMEOUT 20) +endforeach() + diff --git a/Modules/CTP/basic-ctp.json b/Modules/CTP/basic-ctp.json new file mode 100644 index 0000000000..de1c54b08e --- /dev/null +++ b/Modules/CTP/basic-ctp.json @@ -0,0 +1,76 @@ +{ + "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": { + "MyRawDataQcTask": { + "active": "true", + "className": "o2::quality_control_modules::ctp::RawDataQcTask", + "moduleName": "QcCTP", + "detectorName": "CTP", + "cycleDurationSeconds": "10", + "maxNumberCycles": "-1", + "": "The other type of dataSource is \"direct\", see basic-no-sampling.json.", + "dataSource": { + "type": "dataSamplingPolicy", + "name": "tst-raw" + }, + "taskParameters": { + "myOwnKey": "myOwnValue" + }, + "location": "remote", + "saveObjectsToFile": "test.root", "": "~/alice/QualityControl/Modules/CTP/" + } + }, + "checks": { + "Example2Check": { + "active": "true", + "className": "o2::quality_control_modules::ctp::Example2Check", + "moduleName": "QcCTP", + "policy": "OnAny", + "detectorName": "CTP", + "dataSource": [{ + "type": "Task", + "name": "MyRawDataQcTask", + "MOs": ["example2"] + }] + } + } + }, + "dataSamplingPolicies": [ + { + "id": "tst-raw", + "active": "true", + "machines": [], + "query": "random:TST/RAWDATA/0", + "samplingConditions": [ + { + "condition": "random", + "fraction": "0.1", + "seed": "1234" + } + ], + "blocking": "false" + } + ] +} diff --git a/Modules/CTP/include/CTP/Example2Check.h b/Modules/CTP/include/CTP/Example2Check.h new file mode 100644 index 0000000000..4deb15ecc9 --- /dev/null +++ b/Modules/CTP/include/CTP/Example2Check.h @@ -0,0 +1,46 @@ +// 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 Example2Check.h +/// \author My Name +/// + +#ifndef QC_MODULE_CTP_CTPEXAMPLE2CHECK_H +#define QC_MODULE_CTP_CTPEXAMPLE2CHECK_H + +#include "QualityControl/CheckInterface.h" + +namespace o2::quality_control_modules::ctp +{ + +/// \brief Example QC Check +/// \author My Name +class Example2Check : public o2::quality_control::checker::CheckInterface +{ + public: + /// Default constructor + Example2Check() = default; + /// Destructor + ~Example2Check() override = default; + + // Override interface + void configure(std::string name) override; + Quality check(std::map>* moMap) override; + void beautify(std::shared_ptr mo, Quality checkResult = Quality::Null) override; + std::string getAcceptedType() override; + + ClassDefOverride(Example2Check, 1); +}; + +} // namespace o2::quality_control_modules::ctp + +#endif // QC_MODULE_CTP_CTPEXAMPLE2CHECK_H diff --git a/Modules/CTP/include/CTP/LinkDef.h b/Modules/CTP/include/CTP/LinkDef.h new file mode 100644 index 0000000000..0e8b085b81 --- /dev/null +++ b/Modules/CTP/include/CTP/LinkDef.h @@ -0,0 +1,10 @@ +#ifdef __CLING__ +#pragma link off all globals; +#pragma link off all classes; +#pragma link off all functions; + +#pragma link C++ class o2::quality_control_modules::ctp::RawDataQcTask+; + +#pragma link C++ class o2::quality_control_modules::ctp::Example2Check+; + +#endif diff --git a/Modules/CTP/include/CTP/RawDataQcTask.h b/Modules/CTP/include/CTP/RawDataQcTask.h new file mode 100644 index 0000000000..d0c673bbcc --- /dev/null +++ b/Modules/CTP/include/CTP/RawDataQcTask.h @@ -0,0 +1,55 @@ +// 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 RawDataQcTask.h +/// \author My Name +/// + +#ifndef QC_MODULE_CTP_CTPRAWDATAQCTASK_H +#define QC_MODULE_CTP_CTPRAWDATAQCTASK_H + +#include "QualityControl/TaskInterface.h" + +class TH1F; + +using namespace o2::quality_control::core; + +namespace o2::quality_control_modules::ctp +{ + +/// \brief Example Quality Control DPL Task +/// \author My Name +class RawDataQcTask final : public TaskInterface +{ + public: + /// \brief Constructor + RawDataQcTask() = default; + /// Destructor + ~RawDataQcTask() override; + + // 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: + TH1F* mHistogram = nullptr; + TH1F* mHistogram2 = nullptr; +}; + +} // namespace o2::quality_control_modules::ctp + +#endif // QC_MODULE_CTP_CTPRAWDATAQCTASK_H diff --git a/Modules/CTP/src/Example2Check.cxx b/Modules/CTP/src/Example2Check.cxx new file mode 100644 index 0000000000..02651c8a87 --- /dev/null +++ b/Modules/CTP/src/Example2Check.cxx @@ -0,0 +1,85 @@ +// 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 Example2Check.cxx +/// \author My Name +/// + +#include "CTP/Example2Check.h" +#include "QualityControl/MonitorObject.h" +#include "QualityControl/Quality.h" +#include "QualityControl/QcInfoLogger.h" +// ROOT +#include + +#include + +using namespace std; +using namespace o2::quality_control; + +namespace o2::quality_control_modules::ctp +{ + +void Example2Check::configure(std::string) {} + +Quality Example2Check::check(std::map>* moMap) +{ + Quality result = Quality::Null; + + for (auto& [moName, mo] : *moMap) { + + (void)moName; + if (mo->getName() == "example3") { + auto* h = dynamic_cast(mo->getObject()); + + result = Quality::Good; + + for (int i = 0; i < h->GetNbinsX(); i++) { + if (i > 0 && i < 8 && h->GetBinContent(i) == 0) { + result = Quality::Bad; + result.addReason(FlagReasonFactory::Unknown(), + "It is bad because there is nothing in bin " + std::to_string(i)); + break; + } else if ((i == 0 || i > 7) && h->GetBinContent(i) > 0) { + result = Quality::Medium; + result.addReason(FlagReasonFactory::Unknown(), + "It is medium because bin " + std::to_string(i) + " is not empty"); + result.addReason(FlagReasonFactory::ProcessingError(), + "This is to demonstrate that we can assign more than one Reason to a Quality"); + } + } + } + } + return result; +} + +std::string Example2Check::getAcceptedType() { return "TH1"; } + +void Example2Check::beautify(std::shared_ptr mo, Quality checkResult) +{ + if (mo->getName() == "example") { + auto* h = dynamic_cast(mo->getObject()); + + if (checkResult == Quality::Good) { + h->SetFillColor(kGreen); + } else if (checkResult == Quality::Bad) { + ILOG(Info, Support) << "Quality::Bad, setting to red" << ENDM; + h->SetFillColor(kRed); + } else if (checkResult == Quality::Medium) { + ILOG(Info, Support) << "Quality::medium, setting to orange" << ENDM; + h->SetFillColor(kOrange); + } + h->SetLineColor(kBlack); + } +} + +} // namespace o2::quality_control_modules::ctp diff --git a/Modules/CTP/src/RawDataQcTask.cxx b/Modules/CTP/src/RawDataQcTask.cxx new file mode 100644 index 0000000000..751c052169 --- /dev/null +++ b/Modules/CTP/src/RawDataQcTask.cxx @@ -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. + +/// +/// \file RawDataQcTask.cxx +/// \author My Name +/// + +#include +#include + +#include "QualityControl/QcInfoLogger.h" +#include "CTP/RawDataQcTask.h" +#include +#include + +namespace o2::quality_control_modules::ctp +{ + +RawDataQcTask::~RawDataQcTask() +{ + delete mHistogram; + delete mHistogram2; +} + +void RawDataQcTask::initialize(o2::framework::InitContext& /*ctx*/) +{ + ILOG(Info, Support) << "initialize RawDataQcTask" << ENDM; // QcInfoLogger is used. FairMQ logs will go to there as well. + + // this is how to get access to custom parameters defined in the config file at qc.tasks..taskParameters + if (auto param = mCustomParameters.find("myOwnKey"); param != mCustomParameters.end()) { + ILOG(Info, Devel) << "Custom parameter - myOwnKey: " << param->second << ENDM; + } + + mHistogram = new TH1F("example", "example", 20, 0, 30000); + mHistogram2 = new TH1F("example3", "example3", 20, 0, 20); + getObjectsManager()->startPublishing(mHistogram); + getObjectsManager()->startPublishing(mHistogram2); + getObjectsManager()->startPublishing(new TH1F("example2", "example2", 20, 0, 30000)); + try { + getObjectsManager()->addMetadata(mHistogram->GetName(), "custom", "34"); + getObjectsManager()->addMetadata(mHistogram2->GetName(), "custom", "34"); + } catch (...) { + // some methods can throw exceptions, it is indicated in their doxygen. + // In case it is recoverable, it is recommended to catch them and do something meaningful. + // Here we don't care that the metadata was not added and just log the event. + ILOG(Warning, Support) << "Metadata could not be added to " << mHistogram->GetName() << ENDM; + ILOG(Warning, Support) << "Metadata could not be added to " << mHistogram2->GetName() << ENDM; + } +} + +void RawDataQcTask::startOfActivity(Activity& activity) +{ + ILOG(Info, Support) << "startOfActivity " << activity.mId << ENDM; + mHistogram->Reset(); + mHistogram2->Reset(); +} + +void RawDataQcTask::startOfCycle() +{ + ILOG(Info, Support) << "startOfCycle" << ENDM; +} + +void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) +{ + // In this function you can access data inputs specified in the JSON config file, for example: + // "query": "random:ITS/RAWDATA/0" + // which is correspondingly ://(input.header); + // get payload of a specific input, which is a char array. + // const char* payload = input.payload; + + // for the sake of an example, let's fill the histogram with payload sizes + mHistogram->Fill(header->payloadSize); + mHistogram2->Fill(4.); + } + + // 2. Using get("") + + // get the payload of a specific input, which is a char array. "random" is the binding specified in the config file. + // auto payload = ctx.inputs().get("random").payload; + + // get payload of a specific input, which is a structure array: + // const auto* header = header::get(ctx.inputs().get("random").header); + // struct s {int a; double b;}; + // auto array = ctx.inputs().get("random"); + // for (int j = 0; j < header->payloadSize / sizeof(s); ++j) { + // int i = array.get()[j].a; + // } + + // get payload of a specific input, which is a root object + // auto h = ctx.inputs().get("histos"); + // Double_t stats[4]; + // h->GetStats(stats); + // auto s = ctx.inputs().get("string"); + // LOG(info) << "String is " << s->GetString().Data(); + + // 3. Access CCDB. If it is enough to retrieve it once, do it in initialize(). + // Remember to delete the object when the pointer goes out of scope or it is no longer needed. + // TObject* condition = TaskInterface::retrieveCondition("QcTask/example"); // put a valid condition path here + // if (condition) { + // LOG(info) << "Retrieved " << condition->ClassName(); + // delete condition; + // } +} + +void RawDataQcTask::endOfCycle() +{ + ILOG(Info, Support) << "endOfCycle" << ENDM; +} + +void RawDataQcTask::endOfActivity(Activity& /*activity*/) +{ + ILOG(Info, Support) << "endOfActivity" << ENDM; +} + +void RawDataQcTask::reset() +{ + // clean all the monitor objects here + + ILOG(Info, Support) << "Resetting the histogram" << ENDM; + mHistogram->Reset(); + mHistogra2->Reset(); +} + +} // namespace o2::quality_control_modules::ctp diff --git a/Modules/CTP/test/testQcCTP.cxx b/Modules/CTP/test/testQcCTP.cxx new file mode 100644 index 0000000000..98e8021cde --- /dev/null +++ b/Modules/CTP/test/testQcCTP.cxx @@ -0,0 +1,30 @@ +// 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 testCTP.cxx +/// \author My Name +/// + +#include "QualityControl/TaskFactory.h" + +#define BOOST_TEST_MODULE Publisher test +#define BOOST_TEST_MAIN +#define BOOST_TEST_DYN_LINK + +#include + +namespace o2::quality_control_modules::ctp +{ + +BOOST_AUTO_TEST_CASE(instantiate_task) { BOOST_CHECK(true); } + +} // namespace o2::quality_control_modules::ctp diff --git a/QualityControl b/QualityControl new file mode 160000 index 0000000000..743d549a75 --- /dev/null +++ b/QualityControl @@ -0,0 +1 @@ +Subproject commit 743d549a75985c4ea16ff1d065b2525dff46eb79 From c590aee400858d9e5b9305b009bcbe8e3f9c7e60 Mon Sep 17 00:00:00 2001 From: Marek Bombara Date: Thu, 16 Dec 2021 12:43:53 +0100 Subject: [PATCH 03/14] committing before release update --- Modules/CTP/src/RawDataQcTask.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/CTP/src/RawDataQcTask.cxx b/Modules/CTP/src/RawDataQcTask.cxx index 751c052169..38b45d44fd 100644 --- a/Modules/CTP/src/RawDataQcTask.cxx +++ b/Modules/CTP/src/RawDataQcTask.cxx @@ -139,7 +139,7 @@ void RawDataQcTask::reset() ILOG(Info, Support) << "Resetting the histogram" << ENDM; mHistogram->Reset(); - mHistogra2->Reset(); + mHistogram2->Reset(); } } // namespace o2::quality_control_modules::ctp From 3dd54a946ee772e9769dd68c18c583267287bffe Mon Sep 17 00:00:00 2001 From: Marek Bombara Date: Fri, 14 Jan 2022 13:22:36 +0100 Subject: [PATCH 04/14] payload added --- Modules/CTP/src/RawDataQcTask.cxx | 58 +++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 3 deletions(-) diff --git a/Modules/CTP/src/RawDataQcTask.cxx b/Modules/CTP/src/RawDataQcTask.cxx index 38b45d44fd..095b3411eb 100644 --- a/Modules/CTP/src/RawDataQcTask.cxx +++ b/Modules/CTP/src/RawDataQcTask.cxx @@ -11,7 +11,7 @@ /// /// \file RawDataQcTask.cxx -/// \author My Name +/// \author Marek Bombara /// #include @@ -19,6 +19,10 @@ #include "QualityControl/QcInfoLogger.h" #include "CTP/RawDataQcTask.h" +#include "DetectorsRaw/RDHUtils.h" +#include "Headers/RAWDataHeader.h" +#include "DPLUtils/DPLRawParser.h" +#include "DataFormatsCTP/Digits.h" #include #include @@ -80,8 +84,56 @@ void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) // One can find additional examples at: // https://github.com/AliceO2Group/AliceO2/blob/dev/Framework/Core/README.md#using-inputs---the-inputrecord-api - // Some examples: + // get the input + o2::framework::DPLRawParser parser(ctx.inputs()); + LOG(info) << "hello ========================="; + // loop over input + for (auto it = parser.begin(), end = parser.end(); it != end; ++it) { + // get the header + auto const* rdh = it.get_if(); + //o2::raw::RDHUtils::printRDH(rdh); + auto triggerBC = o2::raw::RDHUtils::getTriggerBC(rdh); + //LOG(info) << "trigger BC = " << triggerBC; + auto triggerOrbit = o2::raw::RDHUtils::getTriggerOrbit(rdh); + //LOG(info) << "trigger orbit = " << triggerOrbit; + mHistogram->Fill(triggerOrbit); + mHistogram2->Fill(triggerBC); + + uint32_t payloadCTP; + auto feeID = o2::raw::RDHUtils::getFEEID(rdh); // 0 = IR, 1 = TCR + auto linkCRU = (feeID & 0xf00) >> 8; + if (linkCRU == o2::ctp::GBTLinkIDIntRec) { + payloadCTP = o2::ctp::NIntRecPayload; + } else if (linkCRU == o2::ctp::GBTLinkIDClassRec) { + payloadCTP = o2::ctp::NClassPayload; + } else { + LOG(error) << "Unxpected CTP CRU link:" << linkCRU; + } + LOG(info) << "RDH FEEid: " << feeID << " CTP CRU link:" << linkCRU << " Orbit:" << triggerOrbit << " payloadCTP = " << payloadCTP; + + gsl::span payload(it.data(), it.size()); + o2::ctp::gbtword80_t gbtWord = 0; + int wordCount = 0; + + for (auto payloadWord : payload) + { + //LOG(info) << wordCount << " payload:" << int(payloadWord); + std::cout << wordCount << " payload: 0x" << std::hex << payloadWord << std::endl; + if (wordCount == 15) { + wordCount = 0; + } else if (wordCount > 9) { + wordCount++; + } else if (wordCount == 9) { + for (int i = 0; i < 8; i++) { + gbtWord[wordCount * 8 + i] = bool(int(payloadWord) & (1 << i)); + } + wordCount++; + } + } + } + // Some examples: +/* // 1. In a loop for (auto&& input : framework::InputRecordWalker(ctx.inputs())) { // get message header @@ -93,7 +145,7 @@ void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) mHistogram->Fill(header->payloadSize); mHistogram2->Fill(4.); } - +*/ // 2. Using get("") // get the payload of a specific input, which is a char array. "random" is the binding specified in the config file. From 07673dc314e0759e91033324d158f78839a93c17 Mon Sep 17 00:00:00 2001 From: Marek Bombara Date: Fri, 14 Jan 2022 15:15:57 +0100 Subject: [PATCH 05/14] payload reading --- Modules/CTP/src/RawDataQcTask.cxx | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Modules/CTP/src/RawDataQcTask.cxx b/Modules/CTP/src/RawDataQcTask.cxx index 095b3411eb..75501a8abd 100644 --- a/Modules/CTP/src/RawDataQcTask.cxx +++ b/Modules/CTP/src/RawDataQcTask.cxx @@ -23,6 +23,7 @@ #include "Headers/RAWDataHeader.h" #include "DPLUtils/DPLRawParser.h" #include "DataFormatsCTP/Digits.h" +//#include "Detectors/CTP/RawToDigitConverterSpec.h" #include #include @@ -88,6 +89,9 @@ void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) o2::framework::DPLRawParser parser(ctx.inputs()); LOG(info) << "hello ========================="; // loop over input + o2::ctp::gbtword80_t remnant = 0; + uint32_t size_gbt = 0; + for (auto it = parser.begin(), end = parser.end(); it != end; ++it) { // get the header auto const* rdh = it.get_if(); @@ -114,11 +118,12 @@ void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) gsl::span payload(it.data(), it.size()); o2::ctp::gbtword80_t gbtWord = 0; int wordCount = 0; + std::vector diglets; for (auto payloadWord : payload) { //LOG(info) << wordCount << " payload:" << int(payloadWord); - std::cout << wordCount << " payload: 0x" << std::hex << payloadWord << std::endl; + //std::cout << wordCount << " payload: 0x" << std::hex << payloadWord << std::endl; if (wordCount == 15) { wordCount = 0; } else if (wordCount > 9) { @@ -128,6 +133,15 @@ void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) gbtWord[wordCount * 8 + i] = bool(int(payloadWord) & (1 << i)); } wordCount++; + LOG(info) << " gbtword:" << gbtWord; + //makeGBTWordInverse(diglets, gbtWord, remnant, size_gbt, payloadCTP); + gbtWord = 0; + } else { + for (int i = 0; i < 8; i++) { + gbtWord[wordCount * 8 + i] = bool(int(payloadWord) & (1 << i)); + //gbtWord[(9-wordCount) * 8 + i] = bool(int(payloadWord) & (1 << i)); + } + wordCount++; } } From ed48d5cbefa5261f5c2aba08829b13ee5a171c59 Mon Sep 17 00:00:00 2001 From: Marek Bombara Date: Sun, 16 Jan 2022 15:14:05 +0100 Subject: [PATCH 06/14] Adding bc, inputs and classes --- Modules/CTP/src/RawDataQcTask.cxx | 98 ++++++++++++++++++++++++++++++- 1 file changed, 95 insertions(+), 3 deletions(-) diff --git a/Modules/CTP/src/RawDataQcTask.cxx b/Modules/CTP/src/RawDataQcTask.cxx index 75501a8abd..a80d3219fd 100644 --- a/Modules/CTP/src/RawDataQcTask.cxx +++ b/Modules/CTP/src/RawDataQcTask.cxx @@ -91,6 +91,10 @@ void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) // loop over input o2::ctp::gbtword80_t remnant = 0; uint32_t size_gbt = 0; + uint32_t orbit0 = 0; + bool first = true; + const o2::ctp::gbtword80_t bcidmask = 0xfff; + o2::ctp::gbtword80_t pldmask = 0; for (auto it = parser.begin(), end = parser.end(); it != end; ++it) { // get the header @@ -99,6 +103,11 @@ void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) auto triggerBC = o2::raw::RDHUtils::getTriggerBC(rdh); //LOG(info) << "trigger BC = " << triggerBC; auto triggerOrbit = o2::raw::RDHUtils::getTriggerOrbit(rdh); + if (first) { + orbit0 = triggerOrbit; + first = false; + } + //LOG(info) << "trigger orbit = " << triggerOrbit; mHistogram->Fill(triggerOrbit); mHistogram2->Fill(triggerBC); @@ -113,17 +122,24 @@ void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) } else { LOG(error) << "Unxpected CTP CRU link:" << linkCRU; } - LOG(info) << "RDH FEEid: " << feeID << " CTP CRU link:" << linkCRU << " Orbit:" << triggerOrbit << " payloadCTP = " << payloadCTP; - + //LOG(info) << "RDH FEEid: " << feeID << " CTP CRU link:" << linkCRU << " Orbit:" << triggerOrbit << " payloadCTP = " << payloadCTP; + pldmask = 0; + for (uint32_t i = 0; i < payloadCTP; i++) { + pldmask[12 + i] = 1; + } gsl::span payload(it.data(), it.size()); o2::ctp::gbtword80_t gbtWord = 0; int wordCount = 0; std::vector diglets; + Int_t plc = 0; for (auto payloadWord : payload) { //LOG(info) << wordCount << " payload:" << int(payloadWord); //std::cout << wordCount << " payload: 0x" << std::hex << payloadWord << std::endl; + //LOG(info) << " payloadword:" << int(payloadWord) << " plcount = " << plc; + plc++; + //LOG(info) << " payload:" << payload; if (wordCount == 15) { wordCount = 0; } else if (wordCount > 9) { @@ -133,7 +149,83 @@ void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) gbtWord[wordCount * 8 + i] = bool(int(payloadWord) & (1 << i)); } wordCount++; - LOG(info) << " gbtword:" << gbtWord; + diglets.clear(); + //LOG(info) << " gbtword before:" << gbtWord; + // === according to makeGBTWordInverse in O2: Detectors/CTP/workflow/src/RawToDigitConverterSpec.cxx ======== + o2::ctp::gbtword80_t diglet = remnant; + //o2::ctp::gbtword80_t diglet = 0; + uint32_t k = 0; + const uint32_t nGBT = o2::ctp::NGBT; + while (k < (nGBT - payloadCTP)) { + std::bitset masksize = 0; + for (uint32_t j = 0; j < (payloadCTP - size_gbt); j++) { + masksize[j] = 1; + } + diglet |= (gbtWord & masksize) << (size_gbt); + diglets.push_back(diglet); + diglet = 0; + k += payloadCTP - size_gbt; + gbtWord = gbtWord >> (payloadCTP - size_gbt); + size_gbt = 0; + } + size_gbt = nGBT - k; + remnant = gbtWord; + // ========================================== + //LOG(info) << " gbtword after:" << gbtWord; + for (auto diglet : diglets) { + //LOG(info) << " diglet:" << diglet; + //LOG(info) << " pldmask:" << pldmask; + o2::ctp::gbtword80_t pld = (diglet & pldmask); + if (pld.count() == 0) { + continue; + } + LOG(info) << " pld:" << pld; + pld >>= 12; + //o2::ctp::CTPDigit digit; + uint32_t bcid = (diglet & bcidmask).to_ulong(); + LOG(info) << " diglet:" << diglet; + LOG(info) << " bcid:" << bcid; + + o2::ctp::gbtword80_t InputMask = 0; + if (linkCRU == o2::ctp::GBTLinkIDIntRec) + { + InputMask = pld; + LOG(info) << " InputMask:" << InputMask; + for (Int_t i = 0; i-1; j--) + //for (Int_t j=79; j>-1; j--) + { + if ((j<=11)&&(j>-1)) + { + bctemp = gbtWord[j]; + BCid = BCid | (bctemp << j); + } + + } + //UInt_t BCid = gbtWord << 68; + //BCid = BCid >> 20; + //LOG(info) << " BC = " << BCid; //makeGBTWordInverse(diglets, gbtWord, remnant, size_gbt, payloadCTP); gbtWord = 0; } else { From 9530b0f840e38e1cf541fc65e52413f6fd35e55f Mon Sep 17 00:00:00 2001 From: Marek Bombara Date: Sun, 16 Jan 2022 16:29:00 +0100 Subject: [PATCH 07/14] Adding histograms --- Modules/CTP/include/CTP/RawDataQcTask.h | 7 +-- Modules/CTP/src/RawDataQcTask.cxx | 61 ++++++++++++------------- 2 files changed, 33 insertions(+), 35 deletions(-) diff --git a/Modules/CTP/include/CTP/RawDataQcTask.h b/Modules/CTP/include/CTP/RawDataQcTask.h index d0c673bbcc..c88da60d74 100644 --- a/Modules/CTP/include/CTP/RawDataQcTask.h +++ b/Modules/CTP/include/CTP/RawDataQcTask.h @@ -11,7 +11,7 @@ /// /// \file RawDataQcTask.h -/// \author My Name +/// \author Marek Bombara /// #ifndef QC_MODULE_CTP_CTPRAWDATAQCTASK_H @@ -46,8 +46,9 @@ class RawDataQcTask final : public TaskInterface void reset() override; private: - TH1F* mHistogram = nullptr; - TH1F* mHistogram2 = nullptr; + TH1F* mHistoBC = nullptr; + TH1F* mHistoInputs = nullptr; + TH1F* mHistoClasses = nullptr; }; } // namespace o2::quality_control_modules::ctp diff --git a/Modules/CTP/src/RawDataQcTask.cxx b/Modules/CTP/src/RawDataQcTask.cxx index a80d3219fd..73a63528af 100644 --- a/Modules/CTP/src/RawDataQcTask.cxx +++ b/Modules/CTP/src/RawDataQcTask.cxx @@ -32,8 +32,9 @@ namespace o2::quality_control_modules::ctp RawDataQcTask::~RawDataQcTask() { - delete mHistogram; - delete mHistogram2; + delete mHistoBC; + delete mHistoInputs; + delete mHistoClasses; } void RawDataQcTask::initialize(o2::framework::InitContext& /*ctx*/) @@ -45,28 +46,33 @@ void RawDataQcTask::initialize(o2::framework::InitContext& /*ctx*/) ILOG(Info, Devel) << "Custom parameter - myOwnKey: " << param->second << ENDM; } - mHistogram = new TH1F("example", "example", 20, 0, 30000); - mHistogram2 = new TH1F("example3", "example3", 20, 0, 20); - getObjectsManager()->startPublishing(mHistogram); - getObjectsManager()->startPublishing(mHistogram2); - getObjectsManager()->startPublishing(new TH1F("example2", "example2", 20, 0, 30000)); + mHistoBC = new TH1F("histobc", "BC distribution", 3564, 0, 3564); + mHistoInputs = new TH1F("inputs", "Inputs distribution", 48, 0, 48); + mHistoClasses = new TH1F("classes", "Classes distribution", 64, 0, 64); + getObjectsManager()->startPublishing(mHistoBC); + getObjectsManager()->startPublishing(mHistoInputs); + getObjectsManager()->startPublishing(mHistoClasses); + //getObjectsManager()->startPublishing(new TH1F("example2", "example2", 20, 0, 30000)); try { - getObjectsManager()->addMetadata(mHistogram->GetName(), "custom", "34"); - getObjectsManager()->addMetadata(mHistogram2->GetName(), "custom", "34"); + getObjectsManager()->addMetadata(mHistoBC->GetName(), "custom", "34"); + getObjectsManager()->addMetadata(mHistoInputs->GetName(), "custom", "34"); + getObjectsManager()->addMetadata(mHistoClasses->GetName(), "custom", "34"); } catch (...) { // some methods can throw exceptions, it is indicated in their doxygen. // In case it is recoverable, it is recommended to catch them and do something meaningful. // Here we don't care that the metadata was not added and just log the event. - ILOG(Warning, Support) << "Metadata could not be added to " << mHistogram->GetName() << ENDM; - ILOG(Warning, Support) << "Metadata could not be added to " << mHistogram2->GetName() << ENDM; + ILOG(Warning, Support) << "Metadata could not be added to " << mHistoBC->GetName() << ENDM; + ILOG(Warning, Support) << "Metadata could not be added to " << mHistoInputs->GetName() << ENDM; + ILOG(Warning, Support) << "Metadata could not be added to " << mHistoClasses->GetName() << ENDM; } } void RawDataQcTask::startOfActivity(Activity& activity) { ILOG(Info, Support) << "startOfActivity " << activity.mId << ENDM; - mHistogram->Reset(); - mHistogram2->Reset(); + mHistoBC->Reset(); + mHistoInputs->Reset(); + mHistoClasses->Reset(); } void RawDataQcTask::startOfCycle() @@ -109,8 +115,8 @@ void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) } //LOG(info) << "trigger orbit = " << triggerOrbit; - mHistogram->Fill(triggerOrbit); - mHistogram2->Fill(triggerBC); + //mHistogram->Fill(triggerOrbit); + //mHistogram2->Fill(triggerBC); uint32_t payloadCTP; auto feeID = o2::raw::RDHUtils::getFEEID(rdh); // 0 = IR, 1 = TCR @@ -185,6 +191,7 @@ void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) uint32_t bcid = (diglet & bcidmask).to_ulong(); LOG(info) << " diglet:" << diglet; LOG(info) << " bcid:" << bcid; + mHistoBC->Fill(bcid); o2::ctp::gbtword80_t InputMask = 0; if (linkCRU == o2::ctp::GBTLinkIDIntRec) @@ -193,7 +200,7 @@ void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) LOG(info) << " InputMask:" << InputMask; for (Int_t i = 0; iFill(i);} } } @@ -204,25 +211,14 @@ void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) LOG(info) << " ClassMask:" << ClassMask; for (Int_t i = 0; iFill(i);} + //if (ClassMask[i]!=0) {LOG(info) << " i:" << i;} } } } // print BC - first 12 bits - Int_t gbtWordSize = gbtWord.size(); - UShort_t bctemp = 0; - UInt_t BCid = 0; - for (Int_t j=gbtWordSize-1; j>-1; j--) - //for (Int_t j=79; j>-1; j--) - { - if ((j<=11)&&(j>-1)) - { - bctemp = gbtWord[j]; - BCid = BCid | (bctemp << j); - } - - } + //UInt_t BCid = gbtWord << 68; //BCid = BCid >> 20; //LOG(info) << " BC = " << BCid; @@ -296,8 +292,9 @@ void RawDataQcTask::reset() // clean all the monitor objects here ILOG(Info, Support) << "Resetting the histogram" << ENDM; - mHistogram->Reset(); - mHistogram2->Reset(); + mHistoBC->Reset(); + mHistoInputs->Reset(); + mHistoClasses->Reset(); } } // namespace o2::quality_control_modules::ctp From 70ae7e8662062f2b52bf70bb07540bb0ecfc5928 Mon Sep 17 00:00:00 2001 From: Marek Bombara Date: Mon, 17 Jan 2022 08:20:06 +0100 Subject: [PATCH 08/14] Remove duplicated directory --- QualityControl | 1 - 1 file changed, 1 deletion(-) delete mode 160000 QualityControl diff --git a/QualityControl b/QualityControl deleted file mode 160000 index 743d549a75..0000000000 --- a/QualityControl +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 743d549a75985c4ea16ff1d065b2525dff46eb79 From 313dde88e09cc28a47eda736d14ca95de2ae0bfc Mon Sep 17 00:00:00 2001 From: Marek Bombara Date: Mon, 17 Jan 2022 08:24:27 +0100 Subject: [PATCH 09/14] Remove TRG directory --- Modules/TRG/CMakeLists.txt | 42 -------- Modules/TRG/include/TRG/LinkDef.h | 8 -- Modules/TRG/include/TRG/RawDataQcTask.h | 54 ---------- Modules/TRG/src/RawDataQcTask.cxx | 137 ------------------------ Modules/TRG/test/testQcTRG.cxx | 30 ------ 5 files changed, 271 deletions(-) delete mode 100644 Modules/TRG/CMakeLists.txt delete mode 100644 Modules/TRG/include/TRG/LinkDef.h delete mode 100644 Modules/TRG/include/TRG/RawDataQcTask.h delete mode 100644 Modules/TRG/src/RawDataQcTask.cxx delete mode 100644 Modules/TRG/test/testQcTRG.cxx diff --git a/Modules/TRG/CMakeLists.txt b/Modules/TRG/CMakeLists.txt deleted file mode 100644 index 2d85bfa0e1..0000000000 --- a/Modules/TRG/CMakeLists.txt +++ /dev/null @@ -1,42 +0,0 @@ -# ---- Library ---- - -add_library(O2QcTRG) - -target_sources(O2QcTRG PRIVATE src/RawDataQcTask.cxx ) - -target_include_directories( - O2QcTRG - PUBLIC $ - $ - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src) - -target_link_libraries(O2QcTRG PUBLIC O2QualityControl) - -install(TARGETS O2QcTRG - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) - -add_root_dictionary(O2QcTRG - HEADERS -include/TRG/RawDataQcTask.h - LINKDEF include/TRG/LinkDef.h - BASENAME O2QcTRG) - -# ---- Test(s) ---- - -set(TEST_SRCS test/testQcTRG.cxx) - -foreach(test ${TEST_SRCS}) - get_filename_component(test_name ${test} NAME) - string(REGEX REPLACE ".cxx" "" test_name ${test_name}) - - add_executable(${test_name} ${test}) - target_link_libraries(${test_name} - PRIVATE O2QcTRG Boost::unit_test_framework) - add_test(NAME ${test_name} COMMAND ${test_name}) - set_property(TARGET ${test_name} - PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/tests) - set_tests_properties(${test_name} PROPERTIES TIMEOUT 20) -endforeach() - diff --git a/Modules/TRG/include/TRG/LinkDef.h b/Modules/TRG/include/TRG/LinkDef.h deleted file mode 100644 index 2e27fc3b6a..0000000000 --- a/Modules/TRG/include/TRG/LinkDef.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifdef __CLING__ -#pragma link off all globals; -#pragma link off all classes; -#pragma link off all functions; - -#pragma link C++ class o2::quality_control_modules::trg::RawDataQcTask+; - -#endif diff --git a/Modules/TRG/include/TRG/RawDataQcTask.h b/Modules/TRG/include/TRG/RawDataQcTask.h deleted file mode 100644 index 84752a6035..0000000000 --- a/Modules/TRG/include/TRG/RawDataQcTask.h +++ /dev/null @@ -1,54 +0,0 @@ -// 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 RawDataQcTask.h -/// \author My Name -/// - -#ifndef QC_MODULE_TRG_TRGRAWDATAQCTASK_H -#define QC_MODULE_TRG_TRGRAWDATAQCTASK_H - -#include "QualityControl/TaskInterface.h" - -class TH1F; - -using namespace o2::quality_control::core; - -namespace o2::quality_control_modules::trg -{ - -/// \brief Example Quality Control DPL Task -/// \author My Name -class RawDataQcTask final : public TaskInterface -{ - public: - /// \brief Constructor - RawDataQcTask() = default; - /// Destructor - ~RawDataQcTask() override; - - // 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: - TH1F* mHistogram = nullptr; -}; - -} // namespace o2::quality_control_modules::trg - -#endif // QC_MODULE_TRG_TRGRAWDATAQCTASK_H diff --git a/Modules/TRG/src/RawDataQcTask.cxx b/Modules/TRG/src/RawDataQcTask.cxx deleted file mode 100644 index 0ae942daa5..0000000000 --- a/Modules/TRG/src/RawDataQcTask.cxx +++ /dev/null @@ -1,137 +0,0 @@ -// 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 RawDataQcTask.cxx -/// \author Marek Bombara -/// - -#include -#include - -#include "QualityControl/QcInfoLogger.h" -#include "TRG/RawDataQcTask.h" -#include -#include - -namespace o2::quality_control_modules::trg -{ - -RawDataQcTask::~RawDataQcTask() -{ - delete mHistogram; -} - -void RawDataQcTask::initialize(o2::framework::InitContext& /*ctx*/) -{ - ILOG(Info, Support) << "initialize RawDataQcTask" << ENDM; // QcInfoLogger is used. FairMQ logs will go to there as well. - - // this is how to get access to custom parameters defined in the config file at qc.tasks..taskParameters - if (auto param = mCustomParameters.find("myOwnKey"); param != mCustomParameters.end()) { - ILOG(Info, Devel) << "Custom parameter - myOwnKey: " << param->second << ENDM; - } - - mHistogram = new TH1F("example", "example", 20, 0, 30000); - getObjectsManager()->startPublishing(mHistogram); - getObjectsManager()->startPublishing(new TH1F("example2", "This is mb histogram", 20, 0, 30000)); - try { - getObjectsManager()->addMetadata(mHistogram->GetName(), "custom", "34"); - } catch (...) { - // some methods can throw exceptions, it is indicated in their doxygen. - // In case it is recoverable, it is recommended to catch them and do something meaningful. - // Here we don't care that the metadata was not added and just log the event. - ILOG(Warning, Support) << "Metadata could not be added to " << mHistogram->GetName() << ENDM; - } -} - -void RawDataQcTask::startOfActivity(Activity& activity) -{ - ILOG(Info, Support) << "startOfActivity " << activity.mId << ENDM; - mHistogram->Reset(); -} - -void RawDataQcTask::startOfCycle() -{ - ILOG(Info, Support) << "startOfCycle" << ENDM; -} - -void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) -{ - // In this function you can access data inputs specified in the JSON config file, for example: - // "query": "random:ITS/RAWDATA/0" - // which is correspondingly ://(input.header); - // get payload of a specific input, which is a char array. - // const char* payload = input.payload; - - // for the sake of an example, let's fill the histogram with payload sizes - mHistogram->Fill(header->payloadSize); - } - - // 2. Using get("") - - // get the payload of a specific input, which is a char array. "random" is the binding specified in the config file. - // auto payload = ctx.inputs().get("random").payload; - - // get payload of a specific input, which is a structure array: - // const auto* header = header::get(ctx.inputs().get("random").header); - // struct s {int a; double b;}; - // auto array = ctx.inputs().get("random"); - // for (int j = 0; j < header->payloadSize / sizeof(s); ++j) { - // int i = array.get()[j].a; - // } - - // get payload of a specific input, which is a root object - // auto h = ctx.inputs().get("histos"); - // Double_t stats[4]; - // h->GetStats(stats); - // auto s = ctx.inputs().get("string"); - // LOG(info) << "String is " << s->GetString().Data(); - - // 3. Access CCDB. If it is enough to retrieve it once, do it in initialize(). - // Remember to delete the object when the pointer goes out of scope or it is no longer needed. - // TObject* condition = TaskInterface::retrieveCondition("QcTask/example"); // put a valid condition path here - // if (condition) { - // LOG(info) << "Retrieved " << condition->ClassName(); - // delete condition; - // } -} - -void RawDataQcTask::endOfCycle() -{ - ILOG(Info, Support) << "endOfCycle" << ENDM; -} - -void RawDataQcTask::endOfActivity(Activity& /*activity*/) -{ - ILOG(Info, Support) << "endOfActivity" << ENDM; -} - -void RawDataQcTask::reset() -{ - // clean all the monitor objects here - - ILOG(Info, Support) << "Resetting the histogram" << ENDM; - mHistogram->Reset(); -} - -} // namespace o2::quality_control_modules::trg diff --git a/Modules/TRG/test/testQcTRG.cxx b/Modules/TRG/test/testQcTRG.cxx deleted file mode 100644 index 2853b6b854..0000000000 --- a/Modules/TRG/test/testQcTRG.cxx +++ /dev/null @@ -1,30 +0,0 @@ -// 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 testTRG.cxx -/// \author My Name -/// - -#include "QualityControl/TaskFactory.h" - -#define BOOST_TEST_MODULE Publisher test -#define BOOST_TEST_MAIN -#define BOOST_TEST_DYN_LINK - -#include - -namespace o2::quality_control_modules::trg -{ - -BOOST_AUTO_TEST_CASE(instantiate_task) { BOOST_CHECK(true); } - -} // namespace o2::quality_control_modules::trg From 573a078f97e24fd969cae4ef33910d4c82f9c809 Mon Sep 17 00:00:00 2001 From: Marek Bombara Date: Mon, 17 Jan 2022 08:41:54 +0100 Subject: [PATCH 10/14] Renaming Example2Check to RawDataQcCheck --- Modules/CMakeLists.txt | 1 - Modules/CTP/CMakeLists.txt | 4 ++-- Modules/CTP/basic-ctp.json | 4 ++-- Modules/CTP/include/CTP/LinkDef.h | 2 +- .../CTP/{Example2Check.h => RawDataQcCheck.h} | 18 +++++++++--------- .../{Example2Check.cxx => RawDataQcCheck.cxx} | 18 +++++++++--------- 6 files changed, 23 insertions(+), 24 deletions(-) rename Modules/CTP/include/CTP/{Example2Check.h => RawDataQcCheck.h} (74%) rename Modules/CTP/src/{Example2Check.cxx => RawDataQcCheck.cxx} (83%) diff --git a/Modules/CMakeLists.txt b/Modules/CMakeLists.txt index 2dd91cdb6a..431cf3b574 100644 --- a/Modules/CMakeLists.txt +++ b/Modules/CMakeLists.txt @@ -19,5 +19,4 @@ add_subdirectory(CPV) add_subdirectory(GLO) add_subdirectory(FV0) add_subdirectory(FDD) -add_subdirectory(TRG) add_subdirectory(CTP) diff --git a/Modules/CTP/CMakeLists.txt b/Modules/CTP/CMakeLists.txt index ba67932471..791b510ca8 100644 --- a/Modules/CTP/CMakeLists.txt +++ b/Modules/CTP/CMakeLists.txt @@ -2,7 +2,7 @@ add_library(O2QcCTP) -target_sources(O2QcCTP PRIVATE src/Example2Check.cxx src/RawDataQcTask.cxx ) +target_sources(O2QcCTP PRIVATE src/RawDataQcCheck.cxx src/RawDataQcTask.cxx ) target_include_directories( O2QcCTP @@ -20,7 +20,7 @@ install(TARGETS O2QcCTP add_root_dictionary(O2QcCTP HEADERS include/CTP/RawDataQcTask.h -include/CTP/Example2Check.h +include/CTP/RawDataQcCheck.h LINKDEF include/CTP/LinkDef.h BASENAME O2QcCTP) diff --git a/Modules/CTP/basic-ctp.json b/Modules/CTP/basic-ctp.json index de1c54b08e..c52c859a8c 100644 --- a/Modules/CTP/basic-ctp.json +++ b/Modules/CTP/basic-ctp.json @@ -43,9 +43,9 @@ } }, "checks": { - "Example2Check": { + "RawDataQcCheck": { "active": "true", - "className": "o2::quality_control_modules::ctp::Example2Check", + "className": "o2::quality_control_modules::ctp::RawDataQcCheck", "moduleName": "QcCTP", "policy": "OnAny", "detectorName": "CTP", diff --git a/Modules/CTP/include/CTP/LinkDef.h b/Modules/CTP/include/CTP/LinkDef.h index 0e8b085b81..e8dca6d855 100644 --- a/Modules/CTP/include/CTP/LinkDef.h +++ b/Modules/CTP/include/CTP/LinkDef.h @@ -5,6 +5,6 @@ #pragma link C++ class o2::quality_control_modules::ctp::RawDataQcTask+; -#pragma link C++ class o2::quality_control_modules::ctp::Example2Check+; +#pragma link C++ class o2::quality_control_modules::ctp::RawDataQcCheck+; #endif diff --git a/Modules/CTP/include/CTP/Example2Check.h b/Modules/CTP/include/CTP/RawDataQcCheck.h similarity index 74% rename from Modules/CTP/include/CTP/Example2Check.h rename to Modules/CTP/include/CTP/RawDataQcCheck.h index 4deb15ecc9..bfaf238c7e 100644 --- a/Modules/CTP/include/CTP/Example2Check.h +++ b/Modules/CTP/include/CTP/RawDataQcCheck.h @@ -10,27 +10,27 @@ // or submit itself to any jurisdiction. /// -/// \file Example2Check.h +/// \file RawDataQcCheck.h /// \author My Name /// -#ifndef QC_MODULE_CTP_CTPEXAMPLE2CHECK_H -#define QC_MODULE_CTP_CTPEXAMPLE2CHECK_H +#ifndef QC_MODULE_CTP_CTPRAWDATAQCCHECK_H +#define QC_MODULE_CTP_CTPRAWDATAQCCHECK_H #include "QualityControl/CheckInterface.h" namespace o2::quality_control_modules::ctp { -/// \brief Example QC Check +/// \brief RawData QC Check /// \author My Name -class Example2Check : public o2::quality_control::checker::CheckInterface +class RawDataQcCheck : public o2::quality_control::checker::CheckInterface { public: /// Default constructor - Example2Check() = default; + RawDataQcCheck() = default; /// Destructor - ~Example2Check() override = default; + ~RawDataQcCheck() override = default; // Override interface void configure(std::string name) override; @@ -38,9 +38,9 @@ class Example2Check : public o2::quality_control::checker::CheckInterface void beautify(std::shared_ptr mo, Quality checkResult = Quality::Null) override; std::string getAcceptedType() override; - ClassDefOverride(Example2Check, 1); + ClassDefOverride(RawDataQcCheck, 1); }; } // namespace o2::quality_control_modules::ctp -#endif // QC_MODULE_CTP_CTPEXAMPLE2CHECK_H +#endif // QC_MODULE_CTP_CTPRAWDATAQCCHECK_H diff --git a/Modules/CTP/src/Example2Check.cxx b/Modules/CTP/src/RawDataQcCheck.cxx similarity index 83% rename from Modules/CTP/src/Example2Check.cxx rename to Modules/CTP/src/RawDataQcCheck.cxx index 02651c8a87..600015fbe8 100644 --- a/Modules/CTP/src/Example2Check.cxx +++ b/Modules/CTP/src/RawDataQcCheck.cxx @@ -10,11 +10,11 @@ // or submit itself to any jurisdiction. /// -/// \file Example2Check.cxx -/// \author My Name +/// \file RawDataQcCheck.cxx +/// \author Marek Bombara /// -#include "CTP/Example2Check.h" +#include "CTP/RawDataQcCheck.h" #include "QualityControl/MonitorObject.h" #include "QualityControl/Quality.h" #include "QualityControl/QcInfoLogger.h" @@ -29,16 +29,16 @@ using namespace o2::quality_control; namespace o2::quality_control_modules::ctp { -void Example2Check::configure(std::string) {} +void RawDataQcCheck::configure(std::string) {} -Quality Example2Check::check(std::map>* moMap) +Quality RawDataQcCheck::check(std::map>* moMap) { Quality result = Quality::Null; for (auto& [moName, mo] : *moMap) { (void)moName; - if (mo->getName() == "example3") { + if (mo->getName() == "histobc") { auto* h = dynamic_cast(mo->getObject()); result = Quality::Good; @@ -62,11 +62,11 @@ Quality Example2Check::check(std::map mo, Quality checkResult) +void RawDataQcCheck::beautify(std::shared_ptr mo, Quality checkResult) { - if (mo->getName() == "example") { + if (mo->getName() == "inputs") { auto* h = dynamic_cast(mo->getObject()); if (checkResult == Quality::Good) { From 9eeebe76d414a18032c91732754ba67f5d8b6d7d Mon Sep 17 00:00:00 2001 From: Marek Bombara Date: Mon, 17 Jan 2022 10:05:49 +0100 Subject: [PATCH 11/14] Commenting prints --- Modules/CTP/src/RawDataQcTask.cxx | 87 +++---------------------------- 1 file changed, 7 insertions(+), 80 deletions(-) diff --git a/Modules/CTP/src/RawDataQcTask.cxx b/Modules/CTP/src/RawDataQcTask.cxx index 73a63528af..d44ebfc73d 100644 --- a/Modules/CTP/src/RawDataQcTask.cxx +++ b/Modules/CTP/src/RawDataQcTask.cxx @@ -23,7 +23,6 @@ #include "Headers/RAWDataHeader.h" #include "DPLUtils/DPLRawParser.h" #include "DataFormatsCTP/Digits.h" -//#include "Detectors/CTP/RawToDigitConverterSpec.h" #include #include @@ -52,7 +51,6 @@ void RawDataQcTask::initialize(o2::framework::InitContext& /*ctx*/) getObjectsManager()->startPublishing(mHistoBC); getObjectsManager()->startPublishing(mHistoInputs); getObjectsManager()->startPublishing(mHistoClasses); - //getObjectsManager()->startPublishing(new TH1F("example2", "example2", 20, 0, 30000)); try { getObjectsManager()->addMetadata(mHistoBC->GetName(), "custom", "34"); getObjectsManager()->addMetadata(mHistoInputs->GetName(), "custom", "34"); @@ -82,19 +80,8 @@ void RawDataQcTask::startOfCycle() void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) { - // In this function you can access data inputs specified in the JSON config file, for example: - // "query": "random:ITS/RAWDATA/0" - // which is correspondingly ://(); - //o2::raw::RDHUtils::printRDH(rdh); - auto triggerBC = o2::raw::RDHUtils::getTriggerBC(rdh); - //LOG(info) << "trigger BC = " << triggerBC; auto triggerOrbit = o2::raw::RDHUtils::getTriggerOrbit(rdh); if (first) { orbit0 = triggerOrbit; @@ -138,14 +123,9 @@ void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) int wordCount = 0; std::vector diglets; - Int_t plc = 0; + // === according to O2: Detectors/CTP/workflow/src/RawToDigitConverterSpec.cxx ======== for (auto payloadWord : payload) { - //LOG(info) << wordCount << " payload:" << int(payloadWord); - //std::cout << wordCount << " payload: 0x" << std::hex << payloadWord << std::endl; - //LOG(info) << " payloadword:" << int(payloadWord) << " plcount = " << plc; - plc++; - //LOG(info) << " payload:" << payload; if (wordCount == 15) { wordCount = 0; } else if (wordCount > 9) { @@ -156,10 +136,7 @@ void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) } wordCount++; diglets.clear(); - //LOG(info) << " gbtword before:" << gbtWord; - // === according to makeGBTWordInverse in O2: Detectors/CTP/workflow/src/RawToDigitConverterSpec.cxx ======== o2::ctp::gbtword80_t diglet = remnant; - //o2::ctp::gbtword80_t diglet = 0; uint32_t k = 0; const uint32_t nGBT = o2::ctp::NGBT; while (k < (nGBT - payloadCTP)) { @@ -185,19 +162,18 @@ void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) if (pld.count() == 0) { continue; } - LOG(info) << " pld:" << pld; + //LOG(info) << " pld:" << pld; pld >>= 12; - //o2::ctp::CTPDigit digit; uint32_t bcid = (diglet & bcidmask).to_ulong(); - LOG(info) << " diglet:" << diglet; - LOG(info) << " bcid:" << bcid; + //LOG(info) << " diglet:" << diglet; + //LOG(info) << " bcid:" << bcid; mHistoBC->Fill(bcid); o2::ctp::gbtword80_t InputMask = 0; if (linkCRU == o2::ctp::GBTLinkIDIntRec) { InputMask = pld; - LOG(info) << " InputMask:" << InputMask; + //LOG(info) << " InputMask:" << InputMask; for (Int_t i = 0; iFill(i);} @@ -208,73 +184,24 @@ void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) if (linkCRU == o2::ctp::GBTLinkIDClassRec) { ClassMask = pld; - LOG(info) << " ClassMask:" << ClassMask; + //LOG(info) << " ClassMask:" << ClassMask; for (Int_t i = 0; iFill(i);} - //if (ClassMask[i]!=0) {LOG(info) << " i:" << i;} } } } - // print BC - first 12 bits - - //UInt_t BCid = gbtWord << 68; - //BCid = BCid >> 20; - //LOG(info) << " BC = " << BCid; - //makeGBTWordInverse(diglets, gbtWord, remnant, size_gbt, payloadCTP); gbtWord = 0; } else { for (int i = 0; i < 8; i++) { gbtWord[wordCount * 8 + i] = bool(int(payloadWord) & (1 << i)); - //gbtWord[(9-wordCount) * 8 + i] = bool(int(payloadWord) & (1 << i)); } wordCount++; } } } - // Some examples: -/* - // 1. In a loop - for (auto&& input : framework::InputRecordWalker(ctx.inputs())) { - // get message header - const auto* header = header::get(input.header); - // get payload of a specific input, which is a char array. - // const char* payload = input.payload; - - // for the sake of an example, let's fill the histogram with payload sizes - mHistogram->Fill(header->payloadSize); - mHistogram2->Fill(4.); - } -*/ - // 2. Using get("") - - // get the payload of a specific input, which is a char array. "random" is the binding specified in the config file. - // auto payload = ctx.inputs().get("random").payload; - - // get payload of a specific input, which is a structure array: - // const auto* header = header::get(ctx.inputs().get("random").header); - // struct s {int a; double b;}; - // auto array = ctx.inputs().get("random"); - // for (int j = 0; j < header->payloadSize / sizeof(s); ++j) { - // int i = array.get()[j].a; - // } - - // get payload of a specific input, which is a root object - // auto h = ctx.inputs().get("histos"); - // Double_t stats[4]; - // h->GetStats(stats); - // auto s = ctx.inputs().get("string"); - // LOG(info) << "String is " << s->GetString().Data(); - - // 3. Access CCDB. If it is enough to retrieve it once, do it in initialize(). - // Remember to delete the object when the pointer goes out of scope or it is no longer needed. - // TObject* condition = TaskInterface::retrieveCondition("QcTask/example"); // put a valid condition path here - // if (condition) { - // LOG(info) << "Retrieved " << condition->ClassName(); - // delete condition; - // } } void RawDataQcTask::endOfCycle() From 7111186b70a7446530edb39c01b6a8d5228eb245 Mon Sep 17 00:00:00 2001 From: Marek Bombara Date: Tue, 18 Jan 2022 08:39:28 +0100 Subject: [PATCH 12/14] clang format applied --- Modules/CTP/include/CTP/LinkDef.h | 4 +- Modules/CTP/src/RawDataQcTask.cxx | 73 +++++++++++++++---------------- 2 files changed, 37 insertions(+), 40 deletions(-) diff --git a/Modules/CTP/include/CTP/LinkDef.h b/Modules/CTP/include/CTP/LinkDef.h index e8dca6d855..4c24ad4284 100644 --- a/Modules/CTP/include/CTP/LinkDef.h +++ b/Modules/CTP/include/CTP/LinkDef.h @@ -3,8 +3,8 @@ #pragma link off all classes; #pragma link off all functions; -#pragma link C++ class o2::quality_control_modules::ctp::RawDataQcTask+; +#pragma link C++ class o2::quality_control_modules::ctp::RawDataQcTask + ; -#pragma link C++ class o2::quality_control_modules::ctp::RawDataQcCheck+; +#pragma link C++ class o2::quality_control_modules::ctp::RawDataQcCheck + ; #endif diff --git a/Modules/CTP/src/RawDataQcTask.cxx b/Modules/CTP/src/RawDataQcTask.cxx index d44ebfc73d..1a4b842f51 100644 --- a/Modules/CTP/src/RawDataQcTask.cxx +++ b/Modules/CTP/src/RawDataQcTask.cxx @@ -83,7 +83,7 @@ void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) // get the input o2::framework::DPLRawParser parser(ctx.inputs()); o2::ctp::gbtword80_t remnant = 0; - uint32_t size_gbt = 0; + uint32_t sizegbt = 0; uint32_t orbit0 = 0; bool first = true; const o2::ctp::gbtword80_t bcidmask = 0xfff; @@ -99,9 +99,9 @@ void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) first = false; } - //LOG(info) << "trigger orbit = " << triggerOrbit; - //mHistogram->Fill(triggerOrbit); - //mHistogram2->Fill(triggerBC); + // LOG(info) << "trigger orbit = " << triggerOrbit; + // mHistogram->Fill(triggerOrbit); + // mHistogram2->Fill(triggerBC); uint32_t payloadCTP; auto feeID = o2::raw::RDHUtils::getFEEID(rdh); // 0 = IR, 1 = TCR @@ -113,7 +113,7 @@ void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) } else { LOG(error) << "Unxpected CTP CRU link:" << linkCRU; } - //LOG(info) << "RDH FEEid: " << feeID << " CTP CRU link:" << linkCRU << " Orbit:" << triggerOrbit << " payloadCTP = " << payloadCTP; + // LOG(info) << "RDH FEEid: " << feeID << " CTP CRU link:" << linkCRU << " Orbit:" << triggerOrbit << " payloadCTP = " << payloadCTP; pldmask = 0; for (uint32_t i = 0; i < payloadCTP; i++) { pldmask[12 + i] = 1; @@ -124,8 +124,7 @@ void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) std::vector diglets; // === according to O2: Detectors/CTP/workflow/src/RawToDigitConverterSpec.cxx ======== - for (auto payloadWord : payload) - { + for (auto payloadWord : payload) { if (wordCount == 15) { wordCount = 0; } else if (wordCount > 9) { @@ -141,66 +140,64 @@ void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) const uint32_t nGBT = o2::ctp::NGBT; while (k < (nGBT - payloadCTP)) { std::bitset masksize = 0; - for (uint32_t j = 0; j < (payloadCTP - size_gbt); j++) { + for (uint32_t j = 0; j < (payloadCTP - sizegbt); j++) { masksize[j] = 1; } - diglet |= (gbtWord & masksize) << (size_gbt); + diglet |= (gbtWord & masksize) << (sizegbt); diglets.push_back(diglet); diglet = 0; - k += payloadCTP - size_gbt; - gbtWord = gbtWord >> (payloadCTP - size_gbt); - size_gbt = 0; + k += payloadCTP - sizegbt; + gbtWord = gbtWord >> (payloadCTP - sizegbt); + sizegbt = 0; } - size_gbt = nGBT - k; + sizegbt = nGBT - k; remnant = gbtWord; // ========================================== - //LOG(info) << " gbtword after:" << gbtWord; + // LOG(info) << " gbtword after:" << gbtWord; for (auto diglet : diglets) { - //LOG(info) << " diglet:" << diglet; - //LOG(info) << " pldmask:" << pldmask; + // LOG(info) << " diglet:" << diglet; + // LOG(info) << " pldmask:" << pldmask; o2::ctp::gbtword80_t pld = (diglet & pldmask); if (pld.count() == 0) { continue; } - //LOG(info) << " pld:" << pld; + // LOG(info) << " pld:" << pld; pld >>= 12; uint32_t bcid = (diglet & bcidmask).to_ulong(); - //LOG(info) << " diglet:" << diglet; - //LOG(info) << " bcid:" << bcid; + // LOG(info) << " diglet:" << diglet; + // LOG(info) << " bcid:" << bcid; mHistoBC->Fill(bcid); - o2::ctp::gbtword80_t InputMask = 0; - if (linkCRU == o2::ctp::GBTLinkIDIntRec) - { - InputMask = pld; - //LOG(info) << " InputMask:" << InputMask; - for (Int_t i = 0; iFill(i);} + o2::ctp::gbtword80_t inputMask = 0; + if (linkCRU == o2::ctp::GBTLinkIDIntRec) { + inputMask = pld; + // LOG(info) << " InputMask:" << inputMask; + for (Int_t i = 0; i < payloadCTP; i++) { + if (inputMask[i] != 0) { + mHistoInputs->Fill(i); + } } } - o2::ctp::gbtword80_t ClassMask = 0; - if (linkCRU == o2::ctp::GBTLinkIDClassRec) - { - ClassMask = pld; - //LOG(info) << " ClassMask:" << ClassMask; - for (Int_t i = 0; iFill(i);} + o2::ctp::gbtword80_t classMask = 0; + if (linkCRU == o2::ctp::GBTLinkIDClassRec) { + classMask = pld; + // LOG(info) << " ClassMask:" << classMask; + for (Int_t i = 0; i < payloadCTP; i++) { + if (classMask[i] != 0) { + mHistoClasses->Fill(i); + } } } - } gbtWord = 0; } else { for (int i = 0; i < 8; i++) { - gbtWord[wordCount * 8 + i] = bool(int(payloadWord) & (1 << i)); + gbtWord[wordCount * 8 + i] = bool(int(payloadWord) & (1 << i)); } wordCount++; } } - } } From 8a1dee2e77ddc6d99d125b260b0c5bb58faf4f9d Mon Sep 17 00:00:00 2001 From: Marek Bombara Date: Wed, 19 Jan 2022 15:34:30 +0100 Subject: [PATCH 13/14] implementing reviewing suggestions at PR --- Modules/CTP/CMakeLists.txt | 3 +- Modules/CTP/basic-ctp.json | 23 ++----- Modules/CTP/include/CTP/LinkDef.h | 2 - Modules/CTP/include/CTP/RawDataQcCheck.h | 46 ------------- Modules/CTP/include/CTP/RawDataQcTask.h | 6 +- Modules/CTP/src/RawDataQcCheck.cxx | 85 ------------------------ Modules/CTP/src/RawDataQcTask.cxx | 35 +++------- dpl-config.json | 18 ----- 8 files changed, 17 insertions(+), 201 deletions(-) delete mode 100644 Modules/CTP/include/CTP/RawDataQcCheck.h delete mode 100644 Modules/CTP/src/RawDataQcCheck.cxx delete mode 100644 dpl-config.json diff --git a/Modules/CTP/CMakeLists.txt b/Modules/CTP/CMakeLists.txt index 791b510ca8..d9875a106b 100644 --- a/Modules/CTP/CMakeLists.txt +++ b/Modules/CTP/CMakeLists.txt @@ -2,7 +2,7 @@ add_library(O2QcCTP) -target_sources(O2QcCTP PRIVATE src/RawDataQcCheck.cxx src/RawDataQcTask.cxx ) +target_sources(O2QcCTP PRIVATE src/RawDataQcTask.cxx ) target_include_directories( O2QcCTP @@ -20,7 +20,6 @@ install(TARGETS O2QcCTP add_root_dictionary(O2QcCTP HEADERS include/CTP/RawDataQcTask.h -include/CTP/RawDataQcCheck.h LINKDEF include/CTP/LinkDef.h BASENAME O2QcCTP) diff --git a/Modules/CTP/basic-ctp.json b/Modules/CTP/basic-ctp.json index c52c859a8c..38aac11eea 100644 --- a/Modules/CTP/basic-ctp.json +++ b/Modules/CTP/basic-ctp.json @@ -16,7 +16,7 @@ "url": "infologger:///debug?qc" }, "consul": { - "url": "http://consul-test.cern.ch:8500" + "url": "" }, "conditionDB": { "url": "ccdb-test.cern.ch:8080" @@ -38,31 +38,16 @@ "taskParameters": { "myOwnKey": "myOwnValue" }, - "location": "remote", - "saveObjectsToFile": "test.root", "": "~/alice/QualityControl/Modules/CTP/" + "location": "remote" } }, - "checks": { - "RawDataQcCheck": { - "active": "true", - "className": "o2::quality_control_modules::ctp::RawDataQcCheck", - "moduleName": "QcCTP", - "policy": "OnAny", - "detectorName": "CTP", - "dataSource": [{ - "type": "Task", - "name": "MyRawDataQcTask", - "MOs": ["example2"] - }] - } - } }, "dataSamplingPolicies": [ { - "id": "tst-raw", + "id": "ctp-raw", "active": "true", "machines": [], - "query": "random:TST/RAWDATA/0", + "query": "random:CTP/RAWDATA/0", "samplingConditions": [ { "condition": "random", diff --git a/Modules/CTP/include/CTP/LinkDef.h b/Modules/CTP/include/CTP/LinkDef.h index 4c24ad4284..160929854c 100644 --- a/Modules/CTP/include/CTP/LinkDef.h +++ b/Modules/CTP/include/CTP/LinkDef.h @@ -5,6 +5,4 @@ #pragma link C++ class o2::quality_control_modules::ctp::RawDataQcTask + ; -#pragma link C++ class o2::quality_control_modules::ctp::RawDataQcCheck + ; - #endif diff --git a/Modules/CTP/include/CTP/RawDataQcCheck.h b/Modules/CTP/include/CTP/RawDataQcCheck.h deleted file mode 100644 index bfaf238c7e..0000000000 --- a/Modules/CTP/include/CTP/RawDataQcCheck.h +++ /dev/null @@ -1,46 +0,0 @@ -// 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 RawDataQcCheck.h -/// \author My Name -/// - -#ifndef QC_MODULE_CTP_CTPRAWDATAQCCHECK_H -#define QC_MODULE_CTP_CTPRAWDATAQCCHECK_H - -#include "QualityControl/CheckInterface.h" - -namespace o2::quality_control_modules::ctp -{ - -/// \brief RawData QC Check -/// \author My Name -class RawDataQcCheck : public o2::quality_control::checker::CheckInterface -{ - public: - /// Default constructor - RawDataQcCheck() = default; - /// Destructor - ~RawDataQcCheck() override = default; - - // Override interface - void configure(std::string name) override; - Quality check(std::map>* moMap) override; - void beautify(std::shared_ptr mo, Quality checkResult = Quality::Null) override; - std::string getAcceptedType() override; - - ClassDefOverride(RawDataQcCheck, 1); -}; - -} // namespace o2::quality_control_modules::ctp - -#endif // QC_MODULE_CTP_CTPRAWDATAQCCHECK_H diff --git a/Modules/CTP/include/CTP/RawDataQcTask.h b/Modules/CTP/include/CTP/RawDataQcTask.h index c88da60d74..8b183ed05f 100644 --- a/Modules/CTP/include/CTP/RawDataQcTask.h +++ b/Modules/CTP/include/CTP/RawDataQcTask.h @@ -28,13 +28,13 @@ namespace o2::quality_control_modules::ctp /// \brief Example Quality Control DPL Task /// \author My Name -class RawDataQcTask final : public TaskInterface +class CTPRawDataReaderTask final : public TaskInterface { public: /// \brief Constructor - RawDataQcTask() = default; + CTPRawDataReaderTask() = default; /// Destructor - ~RawDataQcTask() override; + ~CTPRawDataReaderTask() override; // Definition of the methods for the template method pattern void initialize(o2::framework::InitContext& ctx) override; diff --git a/Modules/CTP/src/RawDataQcCheck.cxx b/Modules/CTP/src/RawDataQcCheck.cxx deleted file mode 100644 index 600015fbe8..0000000000 --- a/Modules/CTP/src/RawDataQcCheck.cxx +++ /dev/null @@ -1,85 +0,0 @@ -// 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 RawDataQcCheck.cxx -/// \author Marek Bombara -/// - -#include "CTP/RawDataQcCheck.h" -#include "QualityControl/MonitorObject.h" -#include "QualityControl/Quality.h" -#include "QualityControl/QcInfoLogger.h" -// ROOT -#include - -#include - -using namespace std; -using namespace o2::quality_control; - -namespace o2::quality_control_modules::ctp -{ - -void RawDataQcCheck::configure(std::string) {} - -Quality RawDataQcCheck::check(std::map>* moMap) -{ - Quality result = Quality::Null; - - for (auto& [moName, mo] : *moMap) { - - (void)moName; - if (mo->getName() == "histobc") { - auto* h = dynamic_cast(mo->getObject()); - - result = Quality::Good; - - for (int i = 0; i < h->GetNbinsX(); i++) { - if (i > 0 && i < 8 && h->GetBinContent(i) == 0) { - result = Quality::Bad; - result.addReason(FlagReasonFactory::Unknown(), - "It is bad because there is nothing in bin " + std::to_string(i)); - break; - } else if ((i == 0 || i > 7) && h->GetBinContent(i) > 0) { - result = Quality::Medium; - result.addReason(FlagReasonFactory::Unknown(), - "It is medium because bin " + std::to_string(i) + " is not empty"); - result.addReason(FlagReasonFactory::ProcessingError(), - "This is to demonstrate that we can assign more than one Reason to a Quality"); - } - } - } - } - return result; -} - -std::string RawDataQcCheck::getAcceptedType() { return "TH1"; } - -void RawDataQcCheck::beautify(std::shared_ptr mo, Quality checkResult) -{ - if (mo->getName() == "inputs") { - auto* h = dynamic_cast(mo->getObject()); - - if (checkResult == Quality::Good) { - h->SetFillColor(kGreen); - } else if (checkResult == Quality::Bad) { - ILOG(Info, Support) << "Quality::Bad, setting to red" << ENDM; - h->SetFillColor(kRed); - } else if (checkResult == Quality::Medium) { - ILOG(Info, Support) << "Quality::medium, setting to orange" << ENDM; - h->SetFillColor(kOrange); - } - h->SetLineColor(kBlack); - } -} - -} // namespace o2::quality_control_modules::ctp diff --git a/Modules/CTP/src/RawDataQcTask.cxx b/Modules/CTP/src/RawDataQcTask.cxx index 1a4b842f51..e75eb33d02 100644 --- a/Modules/CTP/src/RawDataQcTask.cxx +++ b/Modules/CTP/src/RawDataQcTask.cxx @@ -29,21 +29,16 @@ namespace o2::quality_control_modules::ctp { -RawDataQcTask::~RawDataQcTask() +CTPRawDataReaderTask::~CTPRawDataReaderTask() { delete mHistoBC; delete mHistoInputs; delete mHistoClasses; } -void RawDataQcTask::initialize(o2::framework::InitContext& /*ctx*/) +void CTPRawDataReaderTask::initialize(o2::framework::InitContext& /*ctx*/) { - ILOG(Info, Support) << "initialize RawDataQcTask" << ENDM; // QcInfoLogger is used. FairMQ logs will go to there as well. - - // this is how to get access to custom parameters defined in the config file at qc.tasks..taskParameters - if (auto param = mCustomParameters.find("myOwnKey"); param != mCustomParameters.end()) { - ILOG(Info, Devel) << "Custom parameter - myOwnKey: " << param->second << ENDM; - } + ILOG(Info, Support) << "initialize CTPRawDataReaderTask" << ENDM; // QcInfoLogger is used. FairMQ logs will go to there as well. mHistoBC = new TH1F("histobc", "BC distribution", 3564, 0, 3564); mHistoInputs = new TH1F("inputs", "Inputs distribution", 48, 0, 48); @@ -51,21 +46,9 @@ void RawDataQcTask::initialize(o2::framework::InitContext& /*ctx*/) getObjectsManager()->startPublishing(mHistoBC); getObjectsManager()->startPublishing(mHistoInputs); getObjectsManager()->startPublishing(mHistoClasses); - try { - getObjectsManager()->addMetadata(mHistoBC->GetName(), "custom", "34"); - getObjectsManager()->addMetadata(mHistoInputs->GetName(), "custom", "34"); - getObjectsManager()->addMetadata(mHistoClasses->GetName(), "custom", "34"); - } catch (...) { - // some methods can throw exceptions, it is indicated in their doxygen. - // In case it is recoverable, it is recommended to catch them and do something meaningful. - // Here we don't care that the metadata was not added and just log the event. - ILOG(Warning, Support) << "Metadata could not be added to " << mHistoBC->GetName() << ENDM; - ILOG(Warning, Support) << "Metadata could not be added to " << mHistoInputs->GetName() << ENDM; - ILOG(Warning, Support) << "Metadata could not be added to " << mHistoClasses->GetName() << ENDM; - } } -void RawDataQcTask::startOfActivity(Activity& activity) +void CTPRawDataReaderTask::startOfActivity(Activity& activity) { ILOG(Info, Support) << "startOfActivity " << activity.mId << ENDM; mHistoBC->Reset(); @@ -73,12 +56,12 @@ void RawDataQcTask::startOfActivity(Activity& activity) mHistoClasses->Reset(); } -void RawDataQcTask::startOfCycle() +void CTPRawDataReaderTask::startOfCycle() { ILOG(Info, Support) << "startOfCycle" << ENDM; } -void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) +void CTPRawDataReaderTask::monitorData(o2::framework::ProcessingContext& ctx) { // get the input o2::framework::DPLRawParser parser(ctx.inputs()); @@ -201,17 +184,17 @@ void RawDataQcTask::monitorData(o2::framework::ProcessingContext& ctx) } } -void RawDataQcTask::endOfCycle() +void CTPRawDataReaderTask::endOfCycle() { ILOG(Info, Support) << "endOfCycle" << ENDM; } -void RawDataQcTask::endOfActivity(Activity& /*activity*/) +void CTPRawDataReaderTask::endOfActivity(Activity& /*activity*/) { ILOG(Info, Support) << "endOfActivity" << ENDM; } -void RawDataQcTask::reset() +void CTPRawDataReaderTask::reset() { // clean all the monitor objects here diff --git a/dpl-config.json b/dpl-config.json deleted file mode 100644 index e796a2ab09..0000000000 --- a/dpl-config.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "internal-dpl-clock": "", - "producer-0": { - "orbit-offset-enumeration": "0", - "orbit-multiplier-enumeration": "0", - "start-value-enumeration": "0", - "end-value-enumeration": "-1", - "step-value-enumeration": "1" - }, - "Dispatcher": { - "period-timer-stats": "10000000" - }, - "QC-TASK-RUNNER-QcTask": { - "period-timer-cycle": "10000000" - }, - "QC-CHECK-RUNNER-QcCheck": "", - "printer": "" -} From 792134c1bd942a2b3acbce2b903fb6495412dfb7 Mon Sep 17 00:00:00 2001 From: Marek Bombara Date: Wed, 19 Jan 2022 21:25:07 +0100 Subject: [PATCH 14/14] changing class name --- Modules/CTP/basic-ctp.json | 2 +- Modules/CTP/include/CTP/LinkDef.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Modules/CTP/basic-ctp.json b/Modules/CTP/basic-ctp.json index 38aac11eea..a6edc4872c 100644 --- a/Modules/CTP/basic-ctp.json +++ b/Modules/CTP/basic-ctp.json @@ -25,7 +25,7 @@ "tasks": { "MyRawDataQcTask": { "active": "true", - "className": "o2::quality_control_modules::ctp::RawDataQcTask", + "className": "o2::quality_control_modules::ctp::CTPRawDataReaderTask", "moduleName": "QcCTP", "detectorName": "CTP", "cycleDurationSeconds": "10", diff --git a/Modules/CTP/include/CTP/LinkDef.h b/Modules/CTP/include/CTP/LinkDef.h index 160929854c..8ddfd850fe 100644 --- a/Modules/CTP/include/CTP/LinkDef.h +++ b/Modules/CTP/include/CTP/LinkDef.h @@ -3,6 +3,6 @@ #pragma link off all classes; #pragma link off all functions; -#pragma link C++ class o2::quality_control_modules::ctp::RawDataQcTask + ; +#pragma link C++ class o2::quality_control_modules::ctp::CTPRawDataReaderTask + ; #endif