Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
fd2bc06
Common: Expand stringToType for more types, fail compilation for unsu…
f3sch Feb 14, 2025
f65076f
GLO: use getFromConfig
f3sch Feb 14, 2025
23430d6
GLO: limit reported bins
f3sch Feb 17, 2025
a453c9c
GLO: Task check for sync only once
f3sch Feb 17, 2025
bb95ad2
GLO: modify test-json
f3sch Feb 19, 2025
2d2538b
GLO: reduce memory churn for ratios + allow to disable
f3sch Feb 25, 2025
04d9c62
GLO: add integrate and cycle k0s histogram
f3sch Feb 25, 2025
e036db8
GLO: Add fit and trend graph
f3sch Feb 25, 2025
e01def4
GLO: more stable fit
f3sch Feb 25, 2025
c452395
GLO: plots by default off & some cleanup
f3sch Feb 25, 2025
0114aa5
GLO: beautify check for K0s
f3sch Feb 25, 2025
773f6bd
GLO: Add MTC Trending
f3sch Feb 25, 2025
941e3f1
GLO: change to system includes
f3sch Mar 5, 2025
4f97f84
GLO: Use TrendingTask for K0s mass
f3sch Mar 5, 2025
c890a18
GLO: generalize reductor
f3sch Mar 7, 2025
9419ff1
GLO: Add mtc pt trending
f3sch Mar 7, 2025
482c500
GLO: based mtc trending on histo
f3sch Mar 10, 2025
1d4499e
GLO: Add PV multiplicity vs ITS tracks
f3sch Mar 10, 2025
2ee92ba
GLO: Add PV-ITS trending
f3sch Mar 10, 2025
9b5a6ca
GLO: Make MTC reductor configurable
f3sch Mar 13, 2025
49e1c8b
GLO: Document parameters in README
f3sch Mar 13, 2025
38c5429
GLO: K0s yield trending
f3sch Mar 14, 2025
c35f62d
GLO: K0s optionally separating mass in low Occ and low pt and high
f3sch Mar 14, 2025
69d5195
GLO: Take different plot for PbPb for PV-ITS
f3sch Mar 14, 2025
9d77a3c
GLO: comment PV-ITS code for now
f3sch Apr 23, 2025
5ef2e55
Update Modules/GLO/src/ITSTPCMatchingTask.cxx
f3sch Apr 23, 2025
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
36 changes: 24 additions & 12 deletions Modules/Common/include/Common/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,8 @@
#define QC_MODULE_COMMON_UTILS_H

#include <string>
#include <unordered_map>

#include <Framework/Logger.h>
#include "QualityControl/QcInfoLogger.h"
#include "QualityControl/CustomParameters.h"

namespace o2::quality_control_modules::common
Expand All @@ -34,24 +33,36 @@ template <typename T>
T stringToType(const std::string& param)
{
T retVal{};
if constexpr (std::is_same<int, T>::value) {
if constexpr (std::is_same_v<int, T>) {
retVal = std::stoi(param);
} else if constexpr (std::is_same<std::string, T>::value) {
} else if constexpr (std::is_same_v<T, long>) {
retVal = std::stol(param);
} else if constexpr (std::is_same_v<T, long long>) {
retVal = std::stoll(param);
} else if constexpr (std::is_same_v<T, unsigned int>) {
retVal = static_cast<unsigned int>(std::stoul(param));
} else if constexpr (std::is_same_v<T, unsigned long>) {
retVal = std::stoul(param);
} else if constexpr (std::is_same_v<T, unsigned long long>) {
retVal = std::stoull(param);
} else if constexpr (std::is_same_v<std::string, T>) {
retVal = param;
} else if constexpr (std::is_same<float, T>::value) {
} else if constexpr (std::is_same_v<float, T>) {
retVal = std::stof(param);
} else if constexpr (std::is_same<double, T>::value) {
} else if constexpr (std::is_same_v<double, T>) {
retVal = std::stod(param);
} else if constexpr (std::is_same<bool, T>::value) {
} else if constexpr (std::is_same_v<T, long double>) {
retVal = std::stold(param);
} else if constexpr (std::is_same_v<bool, T>) {
if ((param == "true") || (param == "True") || (param == "TRUE") || (param == "1")) {
retVal = true;
} else if ((param == "false") || (param == "False") || (param == "FALSE") || (param == "0")) {
retVal = false;
} else {
LOG(error) << "Cannot parse boolean.";
ILOG(Fatal) << "Cannot decode boolean value from param '" << param << "'" << ENDM;
}
} else {
LOG(error) << "Template type not supported";
static_assert(false, "Unsupported type!");
}
return retVal;
}
Expand All @@ -67,10 +78,11 @@ T getFromConfig(const quality_control::core::CustomParameters& params, const std
{
const auto itParam = params.find(name.data());
if (itParam == params.end()) {
LOGP(warning, "Missing parameter. Please add '{}': '<value>' to the 'taskParameters'. Using default value {}.", name.data(), retVal);
ILOG(Info, Trace) << "Default parameter - " << name << ": " << retVal << ENDM;
} else {
const auto& param = itParam->second;
return internal::stringToType<T>(param);
retVal = internal::stringToType<T>(param);
ILOG(Info, Trace) << "Custom parameter - " << name << ": " << retVal << ENDM;
}
return retVal;
}
Expand All @@ -89,7 +101,7 @@ T getFromExtendedConfig(const quality_control::core::Activity& activity, const q
if (auto param = params.atOptional(name, activity)) {
parameter = param.value();
} else {
if constexpr (std::is_same<std::string, T>::value) {
if constexpr (std::is_same_v<std::string, T>) {
parameter = params.atOrDefaultValue(name, retVal);
} else {
parameter = params.atOrDefaultValue(name, std::to_string(retVal));
Expand Down
101 changes: 54 additions & 47 deletions Modules/GLO/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,73 +1,80 @@
# ---- Library ----

# add_compile_options(-O0 -g -fPIC)
add_library(O2QcGLO)

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)
target_sources(
O2QcGLO
PRIVATE src/ITSTPCMatchingTask.cxx
src/ITSTPCmatchingCheck.cxx
src/Reductors.cxx
src/MeanVertexValidator.cxx
src/MeanVertexPostProcessing.cxx
src/MeanVertexCheck.cxx
src/VertexingQcTask.cxx
src/DataCompressionQcTask.cxx
src/CTFSizeTask.cxx)

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

target_link_libraries(O2QcGLO
PUBLIC
O2QualityControl
O2::Steer
O2::DataFormatsGlobalTracking
O2::DataFormatsITS
O2::DataFormatsCalibration
O2::GlobalTracking
O2::GLOQC
O2QcCommon)
target_link_libraries(
O2QcGLO
PUBLIC O2QualityControl
O2::Steer
O2::DataFormatsGlobalTracking
O2::DataFormatsITS
O2::DataFormatsCalibration
O2::GlobalTracking
O2::GLOQC
O2QcCommon)

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

# install json files
install(FILES ITSTPCmatchedTracks_external.json
ITSTPCmatchedTracks.json
ITSTPCmatchedTracks_direct.json
vertexing-qc-direct.json
vertexing-qc-direct-mc.json
vertexing-qc.json
vertexing-qc-mc.json
dataCompression-qc.json
glo-mean-vtx-post-processing.json
DESTINATION etc
)
install(
FILES ITSTPCmatchedTracks_external.json
ITSTPCmatchedTracks.json
ITSTPCmatchedTracks_direct.json
vertexing-qc-direct.json
vertexing-qc-direct-mc.json
vertexing-qc.json
vertexing-qc-mc.json
dataCompression-qc.json
glo-mean-vtx-post-processing.json
DESTINATION etc)

add_root_dictionary(O2QcGLO
HEADERS
include/GLO/MeanVertexValidator.h
include/GLO/MeanVertexPostProcessing.h
include/GLO/MeanVertexCheck.h
include/GLO/VertexingQcTask.h
include/GLO/ITSTPCMatchingTask.h
include/GLO/DataCompressionQcTask.h
include/GLO/CTFSizeTask.h
include/GLO/ITSTPCmatchingCheck.h
LINKDEF include/GLO/LinkDef.h)
add_root_dictionary(
O2QcGLO
HEADERS include/GLO/MeanVertexValidator.h
include/GLO/MeanVertexPostProcessing.h
include/GLO/MeanVertexCheck.h
include/GLO/VertexingQcTask.h
include/GLO/DataCompressionQcTask.h
include/GLO/CTFSizeTask.h
include/GLO/ITSTPCMatchingTask.h
include/GLO/ITSTPCmatchingCheck.h
include/GLO/Reductors.h
LINKDEF include/GLO/LinkDef.h)

install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/GLO
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/QualityControl")
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/GLO DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/QualityControl")

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

#set(TEST_SRCS test/testQcGLO.cxx) # uncomment to reenable the test which was empty
# set(TEST_SRCS test/testQcGLO.cxx) # uncomment to reenable the test which was empty

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 O2QcGLO Boost::unit_test_framework)
target_link_libraries(${test_name} PRIVATE O2QcGLO 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_property(TARGET ${test_name} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/tests)
set_tests_properties(${test_name} PROPERTIES TIMEOUT 20)
endforeach()
91 changes: 91 additions & 0 deletions Modules/GLO/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# GLO
Documents the available task in the module and their parameters.
## ITS-TPC Matching Task
### Parameters
#### MC
- `isMC=false` produce additional MC plots
- `useTrkPID=false` propagate tracks with their pid hypothesis
#### ITS
- `minPtITSCut=0.1f` minimum ITS track momentum
- `etaITSCut=1.4f` maximum ITS track eta
- `minNITSClustersCut=0` minimum number of ITS clusters
- `maxChi2PerClusterITS=1e10f` maximum chi2/ITS cluster
#### TPC
- `minPtTPCCut=0.1f` minimum TPC track momentum
- `etaITSCut=1.4f` maximum ITS track eta
- `minTPCClustersCut=60` minimum number of TPC clusters
- `minDCACut=100.f` minimum TPC track DCA Z
- `minDCACutY=10.f` minimum TPC track DCA Y
#### ITS-TPC
- `minPtCut=0.1f` minimum ITS-TPC momentum
- `maxPtCut=20.f` maximum ITS-TPC momentum
- `etaCut=1.4f` maximum ITS-TPC track eta
#### Additional sync parameters
- `isSync=false` synchronous processing, needed for all following parameters
#### MTC ratios
- `doMTCRatios=false` produce MTC ratio plots
#### K0s
- `doK0QC=false` produce K0s plots
- `maxK0Eta=0.8f` maximum K0s eta
- `refitK0=false` refit K0 prongs
- `cutK0Mass=0.05f` cut around K0s peak
- `trackSourcesK0` SVertexer input sources
- `publishK0s3D=false` publish 3D cycle,integral histograms
- `splitK0sMassOccupancy=float` splitting point in TPC occupancy to define low and high region by default off
- `splitK0sMassPt=float` splitting point in pt to define low and high region by default off
+ K0Fitter options
#### ITS-PV
- `doPVITSQC=false` produce ITS vs PV plots (not implemented yet)

## ITS-TPC Matching Check
### Parameters
#### Pt
- `showPt=false` show check on MTC pt
- `thresholdPt=0.5f` threshold on MTC pt
- `minPt=1.0f` check range left
- `maxPt=1.999f` check range right
#### Phi
- `showPhi=false` show check on MTC phi
- `thresholdPhi=0.3f` threshold on MTC phi
#### Eta
- `showEta=false` show check on MTC eta
- `thresholdEta=0.4f` threshold on MTC eta
- `minEta=-0.8f` check range left
- `maxEta=0.8f` check range right
#### K0
- `showK0s=false` show check on K0s mass
- `acceptableK0sRError=0.2f` acceptable relative error to pdg value
- `acceptableK0sUncertainty=0.2f` acceptable uncertainty to pdg value
+ K0Fitter options
#### Other
- `limitRanges=5` maximum number of bad intervals shown

## K0sFitReductor
Trends mean and sigma of fit.
### Output
- `mean` aggregated mass value
- `sigma` aggregated sigma value

## MTCReductor
Trends MTC at given pt.
### Output
- `mtc` mtc efficiency
### Parameters
- `pt` take value at this pt

## PVITSReductor
Trends constant + slope of straight line fit in given range.
### Output
- `pol0` constant
- `pol1` slope
### Parameters
- `r0` start fit range
- `r1` end fit range

## K0Fitter
Does a `pol2 + Gaus` fit.
### Parameters
- `k0sBackgroundRejLeft=0.48` reject region in background fit from left side of mass peak
- `k0sBackgroundRejRight=0.51` reject region in background fit to right side of mass peak
- `k0sBackgroundRangeLeft=0.45` absolute left range to fit background
- `k0sBackgroundRangeRight=0.54` absolute right range to fit background
Loading