Skip to content

Commit 214aa13

Browse files
f3schknopers8
andauthored
GLO: Add K0s plots (#2513)
* Common: Expand stringToType for more types, fail compilation for unsupported types, use logger Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * GLO: use getFromConfig Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * GLO: limit reported bins Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * GLO: Task check for sync only once Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * GLO: modify test-json Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * GLO: reduce memory churn for ratios + allow to disable Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * GLO: add integrate and cycle k0s histogram Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * GLO: Add fit and trend graph Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * GLO: more stable fit Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * GLO: plots by default off & some cleanup Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * GLO: beautify check for K0s Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * GLO: Add MTC Trending Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * GLO: change to system includes Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * GLO: Use TrendingTask for K0s mass Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * GLO: generalize reductor Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * GLO: Add mtc pt trending Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * GLO: based mtc trending on histo Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * GLO: Add PV multiplicity vs ITS tracks Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * GLO: Add PV-ITS trending Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * GLO: Make MTC reductor configurable Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * GLO: Document parameters in README Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * GLO: K0s yield trending Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * GLO: K0s optionally separating mass in low Occ and low pt and high Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * GLO: Take different plot for PbPb for PV-ITS Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> * GLO: comment PV-ITS code for now * Update Modules/GLO/src/ITSTPCMatchingTask.cxx Co-authored-by: Piotr Konopka <piotr.jan.konopka@cern.ch> --------- Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch> Co-authored-by: Piotr Konopka <piotr.jan.konopka@cern.ch>
1 parent 43c72f0 commit 214aa13

File tree

12 files changed

+1027
-281
lines changed

12 files changed

+1027
-281
lines changed

Modules/Common/include/Common/Utils.h

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,8 @@
1717
#define QC_MODULE_COMMON_UTILS_H
1818

1919
#include <string>
20-
#include <unordered_map>
2120

22-
#include <Framework/Logger.h>
21+
#include "QualityControl/QcInfoLogger.h"
2322
#include "QualityControl/CustomParameters.h"
2423

2524
namespace o2::quality_control_modules::common
@@ -34,24 +33,36 @@ template <typename T>
3433
T stringToType(const std::string& param)
3534
{
3635
T retVal{};
37-
if constexpr (std::is_same<int, T>::value) {
36+
if constexpr (std::is_same_v<int, T>) {
3837
retVal = std::stoi(param);
39-
} else if constexpr (std::is_same<std::string, T>::value) {
38+
} else if constexpr (std::is_same_v<T, long>) {
39+
retVal = std::stol(param);
40+
} else if constexpr (std::is_same_v<T, long long>) {
41+
retVal = std::stoll(param);
42+
} else if constexpr (std::is_same_v<T, unsigned int>) {
43+
retVal = static_cast<unsigned int>(std::stoul(param));
44+
} else if constexpr (std::is_same_v<T, unsigned long>) {
45+
retVal = std::stoul(param);
46+
} else if constexpr (std::is_same_v<T, unsigned long long>) {
47+
retVal = std::stoull(param);
48+
} else if constexpr (std::is_same_v<std::string, T>) {
4049
retVal = param;
41-
} else if constexpr (std::is_same<float, T>::value) {
50+
} else if constexpr (std::is_same_v<float, T>) {
4251
retVal = std::stof(param);
43-
} else if constexpr (std::is_same<double, T>::value) {
52+
} else if constexpr (std::is_same_v<double, T>) {
4453
retVal = std::stod(param);
45-
} else if constexpr (std::is_same<bool, T>::value) {
54+
} else if constexpr (std::is_same_v<T, long double>) {
55+
retVal = std::stold(param);
56+
} else if constexpr (std::is_same_v<bool, T>) {
4657
if ((param == "true") || (param == "True") || (param == "TRUE") || (param == "1")) {
4758
retVal = true;
4859
} else if ((param == "false") || (param == "False") || (param == "FALSE") || (param == "0")) {
4960
retVal = false;
5061
} else {
51-
LOG(error) << "Cannot parse boolean.";
62+
ILOG(Fatal) << "Cannot decode boolean value from param '" << param << "'" << ENDM;
5263
}
5364
} else {
54-
LOG(error) << "Template type not supported";
65+
static_assert(false, "Unsupported type!");
5566
}
5667
return retVal;
5768
}
@@ -67,10 +78,11 @@ T getFromConfig(const quality_control::core::CustomParameters& params, const std
6778
{
6879
const auto itParam = params.find(name.data());
6980
if (itParam == params.end()) {
70-
LOGP(warning, "Missing parameter. Please add '{}': '<value>' to the 'taskParameters'. Using default value {}.", name.data(), retVal);
81+
ILOG(Info, Trace) << "Default parameter - " << name << ": " << retVal << ENDM;
7182
} else {
7283
const auto& param = itParam->second;
73-
return internal::stringToType<T>(param);
84+
retVal = internal::stringToType<T>(param);
85+
ILOG(Info, Trace) << "Custom parameter - " << name << ": " << retVal << ENDM;
7486
}
7587
return retVal;
7688
}
@@ -89,7 +101,7 @@ T getFromExtendedConfig(const quality_control::core::Activity& activity, const q
89101
if (auto param = params.atOptional(name, activity)) {
90102
parameter = param.value();
91103
} else {
92-
if constexpr (std::is_same<std::string, T>::value) {
104+
if constexpr (std::is_same_v<std::string, T>) {
93105
parameter = params.atOrDefaultValue(name, retVal);
94106
} else {
95107
parameter = params.atOrDefaultValue(name, std::to_string(retVal));

Modules/GLO/CMakeLists.txt

Lines changed: 54 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,80 @@
11
# ---- Library ----
22

3-
# add_compile_options(-O0 -g -fPIC)
43
add_library(O2QcGLO)
54

6-
target_sources(O2QcGLO PRIVATE src/ITSTPCmatchingCheck.cxx src/MeanVertexValidator.cxx src/MeanVertexPostProcessing.cxx src/MeanVertexCheck.cxx src/VertexingQcTask.cxx src/ITSTPCMatchingTask.cxx src/DataCompressionQcTask.cxx src/CTFSizeTask.cxx)
5+
target_sources(
6+
O2QcGLO
7+
PRIVATE src/ITSTPCMatchingTask.cxx
8+
src/ITSTPCmatchingCheck.cxx
9+
src/Reductors.cxx
10+
src/MeanVertexValidator.cxx
11+
src/MeanVertexPostProcessing.cxx
12+
src/MeanVertexCheck.cxx
13+
src/VertexingQcTask.cxx
14+
src/DataCompressionQcTask.cxx
15+
src/CTFSizeTask.cxx)
716

817
target_include_directories(
918
O2QcGLO
10-
PUBLIC $<INSTALL_INTERFACE:include>
11-
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
19+
PUBLIC $<INSTALL_INTERFACE:include> $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
1220
PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
1321

14-
target_link_libraries(O2QcGLO
15-
PUBLIC
16-
O2QualityControl
17-
O2::Steer
18-
O2::DataFormatsGlobalTracking
19-
O2::DataFormatsITS
20-
O2::DataFormatsCalibration
21-
O2::GlobalTracking
22-
O2::GLOQC
23-
O2QcCommon)
22+
target_link_libraries(
23+
O2QcGLO
24+
PUBLIC O2QualityControl
25+
O2::Steer
26+
O2::DataFormatsGlobalTracking
27+
O2::DataFormatsITS
28+
O2::DataFormatsCalibration
29+
O2::GlobalTracking
30+
O2::GLOQC
31+
O2QcCommon)
2432

25-
install(TARGETS O2QcGLO
26-
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
27-
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
28-
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
33+
install(
34+
TARGETS O2QcGLO
35+
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
36+
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
37+
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
2938

3039
# install json files
31-
install(FILES ITSTPCmatchedTracks_external.json
32-
ITSTPCmatchedTracks.json
33-
ITSTPCmatchedTracks_direct.json
34-
vertexing-qc-direct.json
35-
vertexing-qc-direct-mc.json
36-
vertexing-qc.json
37-
vertexing-qc-mc.json
38-
dataCompression-qc.json
39-
glo-mean-vtx-post-processing.json
40-
DESTINATION etc
41-
)
40+
install(
41+
FILES ITSTPCmatchedTracks_external.json
42+
ITSTPCmatchedTracks.json
43+
ITSTPCmatchedTracks_direct.json
44+
vertexing-qc-direct.json
45+
vertexing-qc-direct-mc.json
46+
vertexing-qc.json
47+
vertexing-qc-mc.json
48+
dataCompression-qc.json
49+
glo-mean-vtx-post-processing.json
50+
DESTINATION etc)
4251

43-
add_root_dictionary(O2QcGLO
44-
HEADERS
45-
include/GLO/MeanVertexValidator.h
46-
include/GLO/MeanVertexPostProcessing.h
47-
include/GLO/MeanVertexCheck.h
48-
include/GLO/VertexingQcTask.h
49-
include/GLO/ITSTPCMatchingTask.h
50-
include/GLO/DataCompressionQcTask.h
51-
include/GLO/CTFSizeTask.h
52-
include/GLO/ITSTPCmatchingCheck.h
53-
LINKDEF include/GLO/LinkDef.h)
52+
add_root_dictionary(
53+
O2QcGLO
54+
HEADERS include/GLO/MeanVertexValidator.h
55+
include/GLO/MeanVertexPostProcessing.h
56+
include/GLO/MeanVertexCheck.h
57+
include/GLO/VertexingQcTask.h
58+
include/GLO/DataCompressionQcTask.h
59+
include/GLO/CTFSizeTask.h
60+
include/GLO/ITSTPCMatchingTask.h
61+
include/GLO/ITSTPCmatchingCheck.h
62+
include/GLO/Reductors.h
63+
LINKDEF include/GLO/LinkDef.h)
5464

55-
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/GLO
56-
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/QualityControl")
65+
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/GLO DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/QualityControl")
5766

5867
# ---- Test(s) ----
5968

60-
#set(TEST_SRCS test/testQcGLO.cxx) # uncomment to reenable the test which was empty
69+
# set(TEST_SRCS test/testQcGLO.cxx) # uncomment to reenable the test which was empty
6170

6271
foreach(test ${TEST_SRCS})
6372
get_filename_component(test_name ${test} NAME)
6473
string(REGEX REPLACE ".cxx" "" test_name ${test_name})
6574

6675
add_executable(${test_name} ${test})
67-
target_link_libraries(${test_name}
68-
PRIVATE O2QcGLO Boost::unit_test_framework)
76+
target_link_libraries(${test_name} PRIVATE O2QcGLO Boost::unit_test_framework)
6977
add_test(NAME ${test_name} COMMAND ${test_name})
70-
set_property(TARGET ${test_name}
71-
PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/tests)
78+
set_property(TARGET ${test_name} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/tests)
7279
set_tests_properties(${test_name} PROPERTIES TIMEOUT 20)
7380
endforeach()

Modules/GLO/README.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# GLO
2+
Documents the available task in the module and their parameters.
3+
## ITS-TPC Matching Task
4+
### Parameters
5+
#### MC
6+
- `isMC=false` produce additional MC plots
7+
- `useTrkPID=false` propagate tracks with their pid hypothesis
8+
#### ITS
9+
- `minPtITSCut=0.1f` minimum ITS track momentum
10+
- `etaITSCut=1.4f` maximum ITS track eta
11+
- `minNITSClustersCut=0` minimum number of ITS clusters
12+
- `maxChi2PerClusterITS=1e10f` maximum chi2/ITS cluster
13+
#### TPC
14+
- `minPtTPCCut=0.1f` minimum TPC track momentum
15+
- `etaITSCut=1.4f` maximum ITS track eta
16+
- `minTPCClustersCut=60` minimum number of TPC clusters
17+
- `minDCACut=100.f` minimum TPC track DCA Z
18+
- `minDCACutY=10.f` minimum TPC track DCA Y
19+
#### ITS-TPC
20+
- `minPtCut=0.1f` minimum ITS-TPC momentum
21+
- `maxPtCut=20.f` maximum ITS-TPC momentum
22+
- `etaCut=1.4f` maximum ITS-TPC track eta
23+
#### Additional sync parameters
24+
- `isSync=false` synchronous processing, needed for all following parameters
25+
#### MTC ratios
26+
- `doMTCRatios=false` produce MTC ratio plots
27+
#### K0s
28+
- `doK0QC=false` produce K0s plots
29+
- `maxK0Eta=0.8f` maximum K0s eta
30+
- `refitK0=false` refit K0 prongs
31+
- `cutK0Mass=0.05f` cut around K0s peak
32+
- `trackSourcesK0` SVertexer input sources
33+
- `publishK0s3D=false` publish 3D cycle,integral histograms
34+
- `splitK0sMassOccupancy=float` splitting point in TPC occupancy to define low and high region by default off
35+
- `splitK0sMassPt=float` splitting point in pt to define low and high region by default off
36+
+ K0Fitter options
37+
#### ITS-PV
38+
- `doPVITSQC=false` produce ITS vs PV plots (not implemented yet)
39+
40+
## ITS-TPC Matching Check
41+
### Parameters
42+
#### Pt
43+
- `showPt=false` show check on MTC pt
44+
- `thresholdPt=0.5f` threshold on MTC pt
45+
- `minPt=1.0f` check range left
46+
- `maxPt=1.999f` check range right
47+
#### Phi
48+
- `showPhi=false` show check on MTC phi
49+
- `thresholdPhi=0.3f` threshold on MTC phi
50+
#### Eta
51+
- `showEta=false` show check on MTC eta
52+
- `thresholdEta=0.4f` threshold on MTC eta
53+
- `minEta=-0.8f` check range left
54+
- `maxEta=0.8f` check range right
55+
#### K0
56+
- `showK0s=false` show check on K0s mass
57+
- `acceptableK0sRError=0.2f` acceptable relative error to pdg value
58+
- `acceptableK0sUncertainty=0.2f` acceptable uncertainty to pdg value
59+
+ K0Fitter options
60+
#### Other
61+
- `limitRanges=5` maximum number of bad intervals shown
62+
63+
## K0sFitReductor
64+
Trends mean and sigma of fit.
65+
### Output
66+
- `mean` aggregated mass value
67+
- `sigma` aggregated sigma value
68+
69+
## MTCReductor
70+
Trends MTC at given pt.
71+
### Output
72+
- `mtc` mtc efficiency
73+
### Parameters
74+
- `pt` take value at this pt
75+
76+
## PVITSReductor
77+
Trends constant + slope of straight line fit in given range.
78+
### Output
79+
- `pol0` constant
80+
- `pol1` slope
81+
### Parameters
82+
- `r0` start fit range
83+
- `r1` end fit range
84+
85+
## K0Fitter
86+
Does a `pol2 + Gaus` fit.
87+
### Parameters
88+
- `k0sBackgroundRejLeft=0.48` reject region in background fit from left side of mass peak
89+
- `k0sBackgroundRejRight=0.51` reject region in background fit to right side of mass peak
90+
- `k0sBackgroundRangeLeft=0.45` absolute left range to fit background
91+
- `k0sBackgroundRangeRight=0.54` absolute right range to fit background

0 commit comments

Comments
 (0)