Skip to content

Commit ec1b807

Browse files
njacazioknopers8
authored andcommitted
First prototype of Task and Checker for TOF (#193)
* Added new Task and Checker for TOF - First TOF commit - ./o2-qc-module-configurator.sh -m TOF -c TOFCheck -t TOFTask - Ported the plots from AliRoot/TOF/TOFrec/AliTOFQADataMakerRec.h into TOFTask.h/TOFTask.cxx - Ported (skeletonized) the checks from AliRoot/TOF/TOFsim/AliTOFQADataMakerRec.h in TOFCheck.h/TOFCheck.cxx * Removed TOF Metadata * Removed comprehensive TOFCheck from Modules * Added Checker for TOF Raw ToT * Added Checker for TOF Raw Hit Multiplicity * Added Checker for TOF Raw Times * Fix to cast in TOFCheckRawsMulti * Attached each histogram to its dedicated checker - some histograms are still in prototype stage * Moved Histograms to shared_ptr * Added unit test for TOF * Adde json configuration file for TOF * Fixed -wformat std::string warning in compilation * Added first prototype of TOF workflow for QC - to be fixed at the CMakeLists level * Updated include for TOF runner * Formatted TOF runner with clang-format * Updated FairLogger include - Moved #include <FairLogger.h> to #include <fairlogger/Logger.h> * Updated TOF CMakeList * updated include path for runTOF.cxx
1 parent e9f5a62 commit ec1b807

14 files changed

Lines changed: 1447 additions & 0 deletions

Modules/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ add_subdirectory(Common)
44
add_subdirectory(Daq)
55
add_subdirectory(Example)
66
add_subdirectory(Skeleton)
7+
add_subdirectory(TOF)

Modules/TOF/CMakeLists.txt

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# ---- Library ----
2+
3+
add_library(QcTOF src/TOFTask.cxx src/TOFCheckRawsMulti.cxx
4+
src/TOFCheckRawsTime.cxx src/TOFCheckRawsToT.cxx)
5+
6+
target_sources(QcTOF PRIVATE)
7+
8+
target_include_directories(
9+
QcTOF
10+
PUBLIC $<INSTALL_INTERFACE:include>
11+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
12+
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
13+
14+
target_link_libraries(QcTOF PUBLIC QualityControl)
15+
16+
install(TARGETS QcTOF
17+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
18+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
19+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
20+
21+
# ---- ROOT dictionary ----
22+
23+
add_root_dictionary(QcTOF
24+
HEADERS include/TOF/TOFTask.h
25+
include/TOF/TOFCheckRawsMulti.h
26+
include/TOF/TOFCheckRawsTime.h
27+
include/TOF/TOFCheckRawsToT.h
28+
LINKDEF include/TOF/LinkDef.h
29+
BASENAME QcTOF)
30+
31+
# ---- Test(s) ----
32+
33+
add_executable(testQcTOF test/testTOF.cxx)
34+
target_link_libraries(testQcTOF PRIVATE QcTOF Boost::unit_test_framework)
35+
add_test(NAME testQcTOF COMMAND testQcTOF)
36+
set_tests_properties(testQcTOF PROPERTIES TIMEOUT 60)
37+
38+
# ---- Executables ----
39+
40+
set(EXE_SRCS src/runTOF.cxx)
41+
42+
set(EXE_NAMES o2-qc-run-tof)
43+
44+
list(LENGTH EXE_SRCS count)
45+
math(EXPR count "${count}-1")
46+
foreach(i RANGE ${count})
47+
list(GET EXE_SRCS ${i} src)
48+
list(GET EXE_NAMES ${i} name)
49+
add_executable(${name} ${src})
50+
target_link_libraries(${name} PRIVATE QualityControl CURL::libcurl)
51+
endforeach()
52+
53+
# ---- Extra scripts ----
54+
55+
install(FILES tof.json DESTINATION etc)
56+
57+
get_property(dirs
58+
DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
59+
PROPERTY INCLUDE_DIRECTORIES)
60+
foreach(dir ${dirs})
61+
message(STATUS "dir='${dir}'")
62+
endforeach()

Modules/TOF/include/TOF/LinkDef.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#ifdef __CLING__
2+
#pragma link off all globals;
3+
#pragma link off all classes;
4+
#pragma link off all functions;
5+
6+
#pragma link C++ class o2::quality_control_modules::tof::TOFTask+;
7+
#pragma link C++ class o2::quality_control_modules::tof::TOFCheckRawsMulti+;
8+
#pragma link C++ class o2::quality_control_modules::tof::TOFCheckRawsTime+;
9+
#pragma link C++ class o2::quality_control_modules::tof::TOFCheckRawsToT+;
10+
#endif
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
11+
///
12+
/// \file TOFCheckRawsMulti.h
13+
/// \author Nicolo' Jacazio
14+
///
15+
16+
#ifndef QC_MODULE_TOF_TOFCHECKRAWSMULTI_H
17+
#define QC_MODULE_TOF_TOFCHECKRAWSMULTI_H
18+
19+
#include "QualityControl/CheckInterface.h"
20+
#include "QualityControl/MonitorObject.h"
21+
#include "QualityControl/Quality.h"
22+
23+
namespace o2::quality_control_modules::tof
24+
{
25+
26+
/// \brief Check whether a plot is empty or not.
27+
///
28+
/// \author Nicolo' Jacazio
29+
class TOFCheckRawsMulti : public o2::quality_control::checker::CheckInterface
30+
{
31+
public:
32+
/// Default constructor
33+
TOFCheckRawsMulti();
34+
/// Destructor
35+
~TOFCheckRawsMulti() override;
36+
37+
// Override interface
38+
void configure(std::string name) override;
39+
Quality check(const MonitorObject* mo) override;
40+
void beautify(MonitorObject* mo, Quality checkResult = Quality::Null) override;
41+
std::string getAcceptedType() override;
42+
43+
/// Minumum value of TOF raw hit multiplicity
44+
Float_t minTOFrawhits;
45+
/// Maximum value of TOF raw hit multiplicity
46+
Float_t maxTOFrawhits;
47+
48+
private:
49+
/// Mean of the TOF hit multiplicity histogram
50+
Float_t multiMean;
51+
/// Number of events with 0 TOF hits
52+
Float_t zeroBinIntegral;
53+
/// Number of events with low TOF hits multiplicity
54+
Float_t lowMIntegral;
55+
/// Number of events with TOF hits multiplicity > 0
56+
Float_t totIntegral;
57+
58+
ClassDefOverride(TOFCheckRawsMulti, 1);
59+
};
60+
61+
} // namespace o2::quality_control_modules::tof
62+
63+
#endif // QC_MODULE_TOF_TOFCHECKRAWSMULTI_H
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
11+
///
12+
/// \file TOFCheckRawsTime.h
13+
/// \author Nicolo' Jacazio
14+
///
15+
16+
#ifndef QC_MODULE_TOF_TOFCHECKRAWSTIME_H
17+
#define QC_MODULE_TOF_TOFCHECKRAWSTIME_H
18+
19+
#include "QualityControl/CheckInterface.h"
20+
#include "QualityControl/MonitorObject.h"
21+
#include "QualityControl/Quality.h"
22+
23+
namespace o2::quality_control_modules::tof
24+
{
25+
26+
/// \brief Check whether a plot is empty or not.
27+
///
28+
/// \author Barthelemy von Haller
29+
class TOFCheckRawsTime : public o2::quality_control::checker::CheckInterface
30+
{
31+
public:
32+
/// Default constructor
33+
TOFCheckRawsTime();
34+
/// Destructor
35+
~TOFCheckRawsTime() override;
36+
37+
// Override interface
38+
void configure(std::string name) override;
39+
Quality check(const MonitorObject* mo) override;
40+
void beautify(MonitorObject* mo, Quality checkResult = Quality::Null) override;
41+
std::string getAcceptedType() override;
42+
43+
/// Minimum value for TOF raw time
44+
Float_t minTOFrawTime;
45+
/// Maximum value for TOF raw time
46+
Float_t maxTOFrawTime;
47+
48+
private:
49+
/// Mean of the TOF raw time distribution
50+
Float_t timeMean;
51+
/// Integral of the TOF raw time distribution in the peak region i.e. within minTOFrawTime and maxTOFrawTime
52+
Float_t peakIntegral;
53+
/// Integral of the TOF raw time distribution in the whole histogram range
54+
Float_t totIntegral;
55+
56+
ClassDefOverride(TOFCheckRawsTime, 1);
57+
};
58+
59+
} // namespace o2::quality_control_modules::tof
60+
61+
#endif // QC_MODULE_TOF_TOFCHECKRAWSTIME_H
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
11+
///
12+
/// \file TOFCheckRawsToT.h
13+
/// \author Nicolo' Jacazio
14+
///
15+
16+
#ifndef QC_MODULE_TOF_TOFCHECKRAWSTOT_H
17+
#define QC_MODULE_TOF_TOFCHECKRAWSTOT_H
18+
19+
#include "QualityControl/CheckInterface.h"
20+
#include "QualityControl/MonitorObject.h"
21+
#include "QualityControl/Quality.h"
22+
23+
namespace o2::quality_control_modules::tof
24+
{
25+
26+
/// \brief Check whether a plot is empty or not.
27+
///
28+
/// \author Barthelemy von Haller
29+
class TOFCheckRawsToT : public o2::quality_control::checker::CheckInterface
30+
{
31+
public:
32+
/// Default constructor
33+
TOFCheckRawsToT();
34+
/// Destructor
35+
~TOFCheckRawsToT() override;
36+
37+
// Override interface
38+
void configure(std::string name) override;
39+
Quality check(const MonitorObject* mo) override;
40+
void beautify(MonitorObject* mo, Quality checkResult = Quality::Null) override;
41+
std::string getAcceptedType() override;
42+
43+
/// Minimum ToT allowed for the mean in ns
44+
Float_t minTOFrawTot;
45+
/// Maximum ToT allowed for the mean in ns
46+
Double_t maxTOFrawTot;
47+
48+
ClassDefOverride(TOFCheckRawsToT, 1);
49+
};
50+
51+
} // namespace o2::quality_control_modules::tof
52+
53+
#endif // QC_MODULE_TOF_TOFCHECKRAWSTOT_H

Modules/TOF/include/TOF/TOFTask.h

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
// Copyright CERN and copyright holders of ALICE O2. This software is
2+
// distributed under the terms of the GNU General Public License v3 (GPL
3+
// Version 3), copied verbatim in the file "COPYING".
4+
//
5+
// See http://alice-o2.web.cern.ch/license for full licensing information.
6+
//
7+
// In applying this license CERN does not waive the privileges and immunities
8+
// granted to it by virtue of its status as an Intergovernmental Organization
9+
// or submit itself to any jurisdiction.
10+
11+
///
12+
/// \file TOFTask.h
13+
/// \author Nicolo' Jacazio
14+
///
15+
16+
#ifndef QC_MODULE_TOF_TOFTASK_H
17+
#define QC_MODULE_TOF_TOFTASK_H
18+
19+
#include "QualityControl/TaskInterface.h"
20+
21+
class TH1F;
22+
class TH2F;
23+
class TH1I;
24+
class TH2I;
25+
26+
using namespace o2::quality_control::core;
27+
28+
namespace o2::quality_control_modules::tof
29+
{
30+
31+
/// \brief TOF Quality Control DPL Task
32+
/// \author Nicolo' Jacazio
33+
class TOFTask /*final*/
34+
: public TaskInterface // todo add back the "final" when doxygen is fixed
35+
{
36+
public:
37+
/// \brief Constructor
38+
TOFTask();
39+
/// Destructor
40+
~TOFTask() override;
41+
42+
// Definition of the methods for the template method pattern
43+
void initialize(o2::framework::InitContext& ctx) override;
44+
void startOfActivity(Activity& activity) override;
45+
void startOfCycle() override;
46+
void monitorData(o2::framework::ProcessingContext& ctx) override;
47+
void endOfCycle() override;
48+
void endOfActivity(Activity& activity) override;
49+
void reset() override;
50+
51+
static Int_t fgNbinsMultiplicity; /// Number of bins in multiplicity plot
52+
static Int_t fgRangeMinMultiplicity; /// Min range in multiplicity plot
53+
static Int_t fgRangeMaxMultiplicity; /// Max range in multiplicity plot
54+
static Int_t fgNbinsTime; /// Number of bins in time plot
55+
static const Float_t fgkNbinsWidthTime; /// Width of bins in time plot
56+
static Float_t fgRangeMinTime; /// Range min in time plot
57+
static Float_t fgRangeMaxTime; /// Range max in time plot
58+
static Int_t fgCutNmaxFiredMacropad; /// Cut on max number of fired macropad
59+
static const Int_t fgkFiredMacropadLimit; /// Limit on cut on number of fired macropad
60+
61+
private:
62+
std::shared_ptr<TH1I> mTOFRawsMulti; /// TOF raw hit multiplicity per event
63+
std::shared_ptr<TH1I> mTOFRawsMultiIA; /// TOF raw hit multiplicity per event - I/A side
64+
std::shared_ptr<TH1I> mTOFRawsMultiOA; /// TOF raw hit multiplicity per event - O/A side
65+
std::shared_ptr<TH1I> mTOFRawsMultiIC; /// TOF raw hit multiplicity per event - I/C side
66+
std::shared_ptr<TH1I> mTOFRawsMultiOC; /// TOF raw hit multiplicity per event- O/C side
67+
68+
std::shared_ptr<TH1F> mTOFRawsTime; /// TOF Raws - Hit time (ns)
69+
std::shared_ptr<TH1F> mTOFRawsTimeIA; /// TOF Raws - Hit time (ns) - I/A side
70+
std::shared_ptr<TH1F> mTOFRawsTimeOA; /// TOF Raws - Hit time (ns) - O/A side
71+
std::shared_ptr<TH1F> mTOFRawsTimeIC; /// TOF Raws - Hit time (ns) - I/C side
72+
std::shared_ptr<TH1F> mTOFRawsTimeOC; /// TOF Raws - Hit time (ns) - O/C side
73+
74+
std::shared_ptr<TH1F> mTOFRawsToT; /// TOF Raws - Hit ToT (ns)
75+
std::shared_ptr<TH1F> mTOFRawsToTIA; /// TOF Raws - Hit ToT (ns) - I/A side
76+
std::shared_ptr<TH1F> mTOFRawsToTOA; /// TOF Raws - Hit ToT (ns) - O/A side
77+
std::shared_ptr<TH1F> mTOFRawsToTIC; /// TOF Raws - Hit ToT (ns) - I/C side
78+
std::shared_ptr<TH1F> mTOFRawsToTOC; /// TOF Raws - Hit ToT (ns) - O/C side
79+
80+
std::shared_ptr<TH1F> mTOFRawsLTMHits; /// LTMs OR signals
81+
std::shared_ptr<TH2F> mTOFrefMap; /// TOF enabled channel reference map
82+
std::shared_ptr<TH2F> mTOFRawHitMap; /// TOF raw hit map (1 bin = 1 FEA = 24 channels)
83+
84+
std::shared_ptr<TH2I> mTOFDecodingErrors; /// Decoding error monitoring
85+
86+
std::shared_ptr<TH1F> mTOFOrphansTime; /// TOF Raws - Orphans time (ns)
87+
std::shared_ptr<TH2F> mTOFRawTimeVsTRM035; /// TOF raws - Hit time vs TRM - crates 0 to 35
88+
std::shared_ptr<TH2F> mTOFRawTimeVsTRM3671; /// TOF raws - Hit time vs TRM - crates 36 to 72
89+
std::shared_ptr<TH2F> mTOFTimeVsStrip; /// TOF raw hit time vs. MRPC (along z axis)
90+
std::shared_ptr<TH2F> mTOFtimeVsBCID; /// TOF time vs BCID
91+
std::shared_ptr<TH2F> mTOFchannelEfficiencyMap; /// TOF channels (HWok && efficient && !noisy && !problematic)
92+
std::shared_ptr<TH2F> mTOFhitsCTTM; /// Map of hit pads according to CTTM numbering
93+
std::shared_ptr<TH2F> mTOFmacropadCTTM; /// Map of hit macropads according to CTTM numbering
94+
std::shared_ptr<TH2F> mTOFmacropadDeltaPhiTime; /// #Deltat vs #Delta#Phi of hit macropads
95+
std::shared_ptr<TH2I> mBXVsCttmBit; /// BX ID in TOF matching window vs trg channel
96+
std::shared_ptr<TH2F> mTimeVsCttmBit; /// TOF raw time vs trg channel
97+
std::shared_ptr<TH2F> mTOFRawHitMap24; /// TOF average raw hits/channel map (1 bin = 1 FEA = 24 channels)
98+
std::shared_ptr<TH2I> mHitMultiVsDDL; /// TOF raw hit multiplicity per event vs DDL
99+
std::shared_ptr<TH1I> mNfiredMacropad; /// Number of fired TOF macropads per event
100+
};
101+
102+
} // namespace o2::quality_control_modules::tof
103+
104+
#endif // QC_MODULE_TOF_TOFTASK_H

0 commit comments

Comments
 (0)