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
1 change: 1 addition & 0 deletions Modules/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ add_subdirectory(TPC)
add_subdirectory(ITS)
add_subdirectory(MFT)
add_subdirectory(PHOS)
add_subdirectory(FT0)
add_subdirectory(MID)
74 changes: 74 additions & 0 deletions Modules/FT0/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
# ---- Library ----

add_library(QcFT0)

target_sources(QcFT0 PRIVATE src/BasicDigitQcTask.cxx
src/ChannelsCheck.cxx
src/DigitsCheck.cxx
src/MergedTreeCheck.cxx
src/TreeReaderPostProcessing.cxx)

target_include_directories(
QcFT0
PUBLIC $<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)

target_link_libraries(QcFT0 PUBLIC QualityControl O2::DataFormatsFT0)


install(TARGETS QcFT0
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})


add_root_dictionary(QcFT0
HEADERS include/FT0/BasicDigitQcTask.h
include/FT0/ChannelsCheck.h
include/FT0/DigitsCheck.h
include/FT0/Utilities.h
include/FT0/MergedTreeCheck.h
include/FT0/TreeReaderPostProcessing.h
LINKDEF include/FT0/LinkDef.h
BASENAME QcFT0)

# ---- Executables ----

set(EXE_SRCS
src/runDataProducer.cxx )
set(EXE_NAMES
o2-qc-ft0-data-producer)

list(LENGTH EXE_SRCS count)
math(EXPR count "${count}-1")
foreach(i RANGE ${count})
list(GET EXE_SRCS ${i} src)
list(GET EXE_NAMES ${i} name)
add_executable(${name} ${src})
target_link_libraries(${name} PRIVATE QualityControl QcFT0 O2::DataFormatsFT0)
endforeach()

install(
TARGETS o2-qc-ft0-data-producer
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)


# ---- Test(s) ----

set(TEST_SRCS test/testQcFT0.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 QcFT0 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()

70 changes: 70 additions & 0 deletions Modules/FT0/basic-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
{
"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?METRIC"
},
"consul": {
"url": "http://consul-test.cern.ch:8500"
},
"conditionDB": {
"url": "ccdb-test.cern.ch:8080"
}
},
"tasks": {
"BasicDigitQcTask": {
"active": "true",
"className": "o2::quality_control_modules::ft0::BasicDigitQcTask",
"moduleName": "QcFT0",
"detectorName": "FT0",
"cycleDurationSeconds": "10",
"maxNumberCycles": "-1",
"dataSource": {
"type": "direct",
"query": "digits:FT0/DIGITSBC/0;channels:FT0/DIGITSCH/0"
},
"taskParameters": {}
}
},
"checks": {
"DigitsCheck": {
"active": "true",
"dataSource": [{
"type": "Task",
"name": "BasicDigitQcTask",
"MOs": ["EventTree"]
}],
"className": "o2::quality_control_modules::ft0::DigitsCheck",
"moduleName": "QcFT0",
"detectorName": "FT0",
"policy": "OnAny"
},
"ChannelsCheck": {
"active": "true",
"dataSource": [{
"type": "Task",
"name": "BasicDigitQcTask",
"MOs": ["EventTree"]
}],
"className": "o2::quality_control_modules::ft0::ChannelsCheck",
"moduleName": "QcFT0",
"detectorName": "FT0",
"policy": "OnAny"
}
}
},
"dataSamplingPolicies": [
]
}

60 changes: 60 additions & 0 deletions Modules/FT0/include/FT0/BasicDigitQcTask.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
// 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 BasicDigitQcTask.h
/// \author Milosz Filus
/// Example of QC Task for FT0 detector

#ifndef QC_MODULE_FT0_FT0BASICDIGITQCTASK_H
#define QC_MODULE_FT0_FT0BASICDIGITQCTASK_H

#include "QualityControl/TaskInterface.h"
#include <memory>
#include "TH1.h"
#include "TH2.h"
#include "TTree.h"
#include "TFile.h"
#include "TMultiGraph.h"
#include "Rtypes.h"

using namespace o2::quality_control::core;

namespace o2::quality_control_modules::ft0
{

class BasicDigitQcTask final : public TaskInterface
{
public:
/// \brief Constructor
BasicDigitQcTask() = default;
/// Destructor
~BasicDigitQcTask() 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:
// Object which will be published
std::unique_ptr<TH1F> mChargeHistogram;
std::unique_ptr<TH1F> mTimeHistogram;
std::unique_ptr<TH2F> mAmplitudeAndTime;
std::unique_ptr<TTree> mTTree;
};

} // namespace o2::quality_control_modules::ft0

#endif // QC_MODULE_FT0_FT0BasicDigitQcTask_H
44 changes: 44 additions & 0 deletions Modules/FT0/include/FT0/ChannelsCheck.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// 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 ChannelsCheck.h
/// \author Milosz Filus
/// Dummy check for FT0 detector
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really a dummy check ?


#ifndef QC_MODULE_FT0_FT0ChannelsCheck_H
#define QC_MODULE_FT0_FT0ChannelsCheck_H

// Quality Control
#include "QualityControl/CheckInterface.h"

namespace o2::quality_control_modules::ft0
{

class ChannelsCheck : public o2::quality_control::checker::CheckInterface
{
public:
/// Default constructor
ChannelsCheck() = default;
/// Destructor
~ChannelsCheck() override = default;

// Override interface
void configure(std::string name) override;
Quality check(std::map<std::string, std::shared_ptr<MonitorObject>>* moMap) override;
void beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult = Quality::Null) override;
std::string getAcceptedType() override;

ClassDefOverride(ChannelsCheck, 1);
};

} // namespace o2::quality_control_modules::ft0

#endif
46 changes: 46 additions & 0 deletions Modules/FT0/include/FT0/DigitsCheck.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
// 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 ChannelsCheck.h
/// \author Milosz Filus
/// Another dummy check for FT0 detector
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SAme question


#ifndef QC_MODULE_FT0_FT0DigitsCheck_H
#define QC_MODULE_FT0_FT0DigitsCheck_H

// Quality Control
#include "QualityControl/CheckInterface.h"

namespace o2::quality_control_modules::ft0
{

/// \brief
///
class DigitsCheck : public o2::quality_control::checker::CheckInterface
{
public:
/// Default constructor
DigitsCheck() = default;
/// Destructor
~DigitsCheck() override = default;

// Override interface
void configure(std::string name) override;
Quality check(std::map<std::string, std::shared_ptr<MonitorObject>>* moMap) override;
void beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult = Quality::Null) override;
std::string getAcceptedType() override;

ClassDefOverride(DigitsCheck, 1);
};

} // namespace o2::quality_control_modules::ft0

#endif
14 changes: 14 additions & 0 deletions Modules/FT0/include/FT0/LinkDef.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#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::ft0::EventWithChannelData + ;

#pragma link C++ class o2::quality_control_modules::ft0::BasicDigitQcTask + ;
#pragma link C++ class o2::quality_control_modules::ft0::DigitsCheck + ;
#pragma link C++ class o2::quality_control_modules::ft0::ChannelsCheck + ;
#pragma link C++ class o2::quality_control_modules::ft0::MergedTreeCheck + ;
#pragma link C++ class o2::quality_control_modules::ft0::TreeReaderPostProcessing + ;

#endif
44 changes: 44 additions & 0 deletions Modules/FT0/include/FT0/MergedTreeCheck.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// 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 MergedTreeCheck.h
/// \author Milosz Filus
/// Example of post processing check

#ifndef QC_MODULE_FT0_FT0MergedTreeCheck_H
#define QC_MODULE_FT0_FT0MergedTreeCheck_H

// Quality Control
#include "QualityControl/CheckInterface.h"

namespace o2::quality_control_modules::ft0
{

class MergedTreeCheck : public o2::quality_control::checker::CheckInterface
{
public:
/// Default constructor
MergedTreeCheck() = default;
/// Destructor
~MergedTreeCheck() override = default;

// Override interface
void configure(std::string name) override;
Quality check(std::map<std::string, std::shared_ptr<MonitorObject>>* moMap) override;
void beautify(std::shared_ptr<MonitorObject> mo, Quality checkResult = Quality::Null) override;
std::string getAcceptedType() override;

ClassDefOverride(MergedTreeCheck, 1);
};

} // namespace o2::quality_control_modules::ft0

#endif
Loading