From 82006843cc9074a1cc0c1e990e29b2eac2d05761 Mon Sep 17 00:00:00 2001 From: Anton Alkin Date: Tue, 7 Jul 2026 10:30:35 +0200 Subject: [PATCH 1/5] [O2-7038] DPL Analysis: correction for tpcNClsFindable overflow --- .../include/Framework/AnalysisDataModel.h | 49 +++++++++++++------ 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index c8dd33fba62ee..3829988e2c969 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -396,6 +396,18 @@ DECLARE_SOA_DYNAMIC_COLUMN(TPCDeltaTBwd, tpcDeltaTBwd, //! Delta Backward of tra } // namespace v001 +namespace +{ +inline uint16_t fixTPCNClsFindable(uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusFound) +{ + uint16_t res = tpcNClsFindable; + if (tpcNClsFindable <= tpcNClsFindableMinusFound) { + res += 256; + } + return res; +} +} // namespace + DECLARE_SOA_DYNAMIC_COLUMN(HasITS, hasITS, //! Flag to check if track has a ITS match [](uint8_t detectorMap) -> bool { return detectorMap & o2::aod::track::ITS; }); DECLARE_SOA_DYNAMIC_COLUMN(HasTPC, hasTPC, //! Flag to check if track has a TPC match @@ -419,11 +431,20 @@ DECLARE_SOA_DYNAMIC_COLUMN(HasTPCBothSides, hasTPCBothSides, //! Run 3: Has this DECLARE_SOA_DYNAMIC_COLUMN(PIDForTracking, pidForTracking, //! PID hypothesis used during tracking. See the constants in the class PID in PID.h [](uint32_t flags) -> uint32_t { return flags >> 28; }); DECLARE_SOA_DYNAMIC_COLUMN(TPCNClsFound, tpcNClsFound, //! Number of found TPC clusters - [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusFound) -> int16_t { return (int16_t)tpcNClsFindable - tpcNClsFindableMinusFound; }); + [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusFound) -> int16_t + { + return fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound) - tpcNClsFindableMinusFound; + }); DECLARE_SOA_DYNAMIC_COLUMN(TPCNClsPID, tpcNClsPID, //! Number of found TPC clusters used for PID - [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusPID) -> int16_t { return (int16_t)tpcNClsFindable - tpcNClsFindableMinusPID; }); + [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusPID, int8_t tpcNClsFindableMinusFound) -> int16_t + { + return fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound) - tpcNClsFindableMinusPID; + }); DECLARE_SOA_DYNAMIC_COLUMN(TPCNClsCrossedRows, tpcNClsCrossedRows, //! Number of crossed TPC Rows - [](uint8_t tpcNClsFindable, int8_t TPCNClsFindableMinusCrossedRows) -> int16_t { return (int16_t)tpcNClsFindable - TPCNClsFindableMinusCrossedRows; }); + [](uint8_t tpcNClsFindable, int8_t TPCNClsFindableMinusCrossedRows, int8_t tpcNClsFindableMinusFound) -> int16_t + { + return fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound) - TPCNClsFindableMinusCrossedRows; + }); DECLARE_SOA_DYNAMIC_COLUMN(ITSNCls, itsNCls, //! Number of ITS clusters [](uint8_t itsClusterMap) -> uint8_t { uint8_t itsNcls = 0; @@ -456,19 +477,19 @@ DECLARE_SOA_DYNAMIC_COLUMN(ITSNSharedCls, itsNSharedCls, //! Number of shared IT }); DECLARE_SOA_DYNAMIC_COLUMN(TPCFoundOverFindableCls, tpcFoundOverFindableCls, //! Ratio of found over findable clusters [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusFound) -> float { - int16_t tpcNClsFound = (int16_t)tpcNClsFindable - tpcNClsFindableMinusFound; + int16_t tpcNClsFound = fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound) - tpcNClsFindableMinusFound; return (float)tpcNClsFound / (float)tpcNClsFindable; }); DECLARE_SOA_DYNAMIC_COLUMN(TPCCrossedRowsOverFindableCls, tpcCrossedRowsOverFindableCls, //! Ratio crossed rows over findable clusters - [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusCrossedRows) -> float { - int16_t tpcNClsCrossedRows = (int16_t)tpcNClsFindable - tpcNClsFindableMinusCrossedRows; + [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusCrossedRows, int8_t tpcNClsFindableMinusFound) -> float { + int16_t tpcNClsCrossedRows = fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound) - tpcNClsFindableMinusCrossedRows; return (float)tpcNClsCrossedRows / (float)tpcNClsFindable; }); DECLARE_SOA_DYNAMIC_COLUMN(TPCFractionSharedCls, tpcFractionSharedCls, //! Fraction of shared TPC clusters [](uint8_t tpcNClsShared, uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusFound) -> float { - int16_t tpcNClsFound = (int16_t)tpcNClsFindable - tpcNClsFindableMinusFound; + int16_t tpcNClsFound = fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound) - tpcNClsFindableMinusFound; return (float)tpcNClsShared / (float)tpcNClsFound; }); @@ -577,7 +598,7 @@ DECLARE_SOA_TABLE_FULL(StoredTracksExtra_000, "TracksExtra", "AOD", "TRACKEXTRA" track::HasITS, track::HasTPC, track::HasTRD, track::HasTOF, track::TPCNClsFound, - track::TPCNClsCrossedRows, + track::TPCNClsCrossedRows, track::TOFExpTimeEl, track::TOFExpTimeMu, track::TOFExpTimePi, @@ -588,7 +609,7 @@ DECLARE_SOA_TABLE_FULL(StoredTracksExtra_000, "TracksExtra", "AOD", "TRACKEXTRA" track::TOFExpTimeHe, track::TOFExpTimeAl, track::ITSNCls, track::ITSNClsInnerBarrel, - track::TPCCrossedRowsOverFindableCls, + track::TPCCrossedRowsOverFindableCls, track::TPCFoundOverFindableCls, track::TPCFractionSharedCls, track::TRDHasCrossing, track::TRDHasNeighbor, track::TRDNTracklets, @@ -605,7 +626,7 @@ DECLARE_SOA_TABLE_FULL_VERSIONED(StoredTracksExtra_001, "TracksExtra", "AOD", "T track::HasITS, track::HasTPC, track::HasTRD, track::HasTOF, track::TPCNClsFound, - track::TPCNClsCrossedRows, + track::TPCNClsCrossedRows, track::v001::ITSClusterMap, track::v001::ITSNCls, track::v001::ITSNClsInnerBarrel, track::v001::ITSClsSizeInLayer, track::v001::IsITSAfterburner, @@ -618,7 +639,7 @@ DECLARE_SOA_TABLE_FULL_VERSIONED(StoredTracksExtra_001, "TracksExtra", "AOD", "T track::TOFExpTimeTr, track::TOFExpTimeHe, track::TOFExpTimeAl, - track::TPCCrossedRowsOverFindableCls, + track::TPCCrossedRowsOverFindableCls, track::TPCFoundOverFindableCls, track::TPCFractionSharedCls, track::TRDHasCrossing, track::TRDHasNeighbor, track::TRDNTracklets, @@ -635,8 +656,8 @@ DECLARE_SOA_TABLE_FULL_VERSIONED(StoredTracksExtra_002, "TracksExtra", "AOD", "T track::HasITS, track::HasTPC, track::HasTRD, track::HasTOF, track::TPCNClsFound, - track::TPCNClsPID, - track::TPCNClsCrossedRows, + track::TPCNClsPID, + track::TPCNClsCrossedRows, track::v001::ITSClusterMap, track::v001::ITSNCls, track::v001::ITSNClsInnerBarrel, track::v001::ITSClsSizeInLayer, track::v001::IsITSAfterburner, @@ -649,7 +670,7 @@ DECLARE_SOA_TABLE_FULL_VERSIONED(StoredTracksExtra_002, "TracksExtra", "AOD", "T track::TOFExpTimeTr, track::TOFExpTimeHe, track::TOFExpTimeAl, - track::TPCCrossedRowsOverFindableCls, + track::TPCCrossedRowsOverFindableCls, track::TPCFoundOverFindableCls, track::TPCFractionSharedCls, track::TRDHasCrossing, track::TRDHasNeighbor, track::TRDNTracklets, From fb3e2bc0c990ba06577542a9f2ad8191cc9a9f24 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 7 Jul 2026 08:32:51 +0000 Subject: [PATCH 2/5] Please consider the following formatting changes --- Framework/Core/include/Framework/AnalysisDataModel.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index 3829988e2c969..6b21b2c80a8da 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -431,18 +431,15 @@ DECLARE_SOA_DYNAMIC_COLUMN(HasTPCBothSides, hasTPCBothSides, //! Run 3: Has this DECLARE_SOA_DYNAMIC_COLUMN(PIDForTracking, pidForTracking, //! PID hypothesis used during tracking. See the constants in the class PID in PID.h [](uint32_t flags) -> uint32_t { return flags >> 28; }); DECLARE_SOA_DYNAMIC_COLUMN(TPCNClsFound, tpcNClsFound, //! Number of found TPC clusters - [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusFound) -> int16_t - { - return fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound) - tpcNClsFindableMinusFound; + [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusFound) -> int16_t { + return fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound) - tpcNClsFindableMinusFound; }); DECLARE_SOA_DYNAMIC_COLUMN(TPCNClsPID, tpcNClsPID, //! Number of found TPC clusters used for PID - [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusPID, int8_t tpcNClsFindableMinusFound) -> int16_t - { + [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusPID, int8_t tpcNClsFindableMinusFound) -> int16_t { return fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound) - tpcNClsFindableMinusPID; }); DECLARE_SOA_DYNAMIC_COLUMN(TPCNClsCrossedRows, tpcNClsCrossedRows, //! Number of crossed TPC Rows - [](uint8_t tpcNClsFindable, int8_t TPCNClsFindableMinusCrossedRows, int8_t tpcNClsFindableMinusFound) -> int16_t - { + [](uint8_t tpcNClsFindable, int8_t TPCNClsFindableMinusCrossedRows, int8_t tpcNClsFindableMinusFound) -> int16_t { return fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound) - TPCNClsFindableMinusCrossedRows; }); DECLARE_SOA_DYNAMIC_COLUMN(ITSNCls, itsNCls, //! Number of ITS clusters From a893e861d8c2590e99ba4aeb805509532b8b95ca Mon Sep 17 00:00:00 2001 From: Anton Alkin Date: Tue, 7 Jul 2026 11:56:34 +0200 Subject: [PATCH 3/5] fixup! [O2-7038] DPL Analysis: correction for tpcNClsFindable overflow --- Framework/Core/include/Framework/AnalysisDataModel.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index 6b21b2c80a8da..7bc7295059320 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -475,13 +475,13 @@ DECLARE_SOA_DYNAMIC_COLUMN(ITSNSharedCls, itsNSharedCls, //! Number of shared IT DECLARE_SOA_DYNAMIC_COLUMN(TPCFoundOverFindableCls, tpcFoundOverFindableCls, //! Ratio of found over findable clusters [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusFound) -> float { int16_t tpcNClsFound = fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound) - tpcNClsFindableMinusFound; - return (float)tpcNClsFound / (float)tpcNClsFindable; + return (float)tpcNClsFound / (float)fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound); }); DECLARE_SOA_DYNAMIC_COLUMN(TPCCrossedRowsOverFindableCls, tpcCrossedRowsOverFindableCls, //! Ratio crossed rows over findable clusters [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusCrossedRows, int8_t tpcNClsFindableMinusFound) -> float { int16_t tpcNClsCrossedRows = fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound) - tpcNClsFindableMinusCrossedRows; - return (float)tpcNClsCrossedRows / (float)tpcNClsFindable; + return (float)tpcNClsCrossedRows / (float)fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound); }); DECLARE_SOA_DYNAMIC_COLUMN(TPCFractionSharedCls, tpcFractionSharedCls, //! Fraction of shared TPC clusters From f4adf683c1c177258a06f9761276e0f376c41472 Mon Sep 17 00:00:00 2001 From: Anton Alkin Date: Tue, 7 Jul 2026 11:59:35 +0200 Subject: [PATCH 4/5] fixup! [O2-7038] DPL Analysis: correction for tpcNClsFindable overflow --- .../Core/include/Framework/AnalysisDataModel.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index 7bc7295059320..7366e8f2e4299 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -478,12 +478,18 @@ DECLARE_SOA_DYNAMIC_COLUMN(TPCFoundOverFindableCls, tpcFoundOverFindableCls, //! return (float)tpcNClsFound / (float)fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound); }); -DECLARE_SOA_DYNAMIC_COLUMN(TPCCrossedRowsOverFindableCls, tpcCrossedRowsOverFindableCls, //! Ratio crossed rows over findable clusters +DECLARE_SOA_DYNAMIC_COLUMN(TPCCrossedRowsOverFindableCls_fix, tpcCrossedRowsOverFindableCls, //! Ratio crossed rows over findable clusters [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusCrossedRows, int8_t tpcNClsFindableMinusFound) -> float { int16_t tpcNClsCrossedRows = fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound) - tpcNClsFindableMinusCrossedRows; return (float)tpcNClsCrossedRows / (float)fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound); }); +DECLARE_SOA_DYNAMIC_COLUMN(TPCCrossedRowsOverFindableCls, tpcCrossedRowsOverFindableCls, //! Ratio crossed rows over findable clusters + [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusCrossedRows) -> float { + int16_t tpcNClsCrossedRows = (int16_t)tpcNClsFindable - tpcNClsFindableMinusCrossedRows; + return (float)tpcNClsCrossedRows / (float)tpcNClsFindable; + }); + DECLARE_SOA_DYNAMIC_COLUMN(TPCFractionSharedCls, tpcFractionSharedCls, //! Fraction of shared TPC clusters [](uint8_t tpcNClsShared, uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusFound) -> float { int16_t tpcNClsFound = fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound) - tpcNClsFindableMinusFound; @@ -606,7 +612,7 @@ DECLARE_SOA_TABLE_FULL(StoredTracksExtra_000, "TracksExtra", "AOD", "TRACKEXTRA" track::TOFExpTimeHe, track::TOFExpTimeAl, track::ITSNCls, track::ITSNClsInnerBarrel, - track::TPCCrossedRowsOverFindableCls, + track::TPCCrossedRowsOverFindableCls_fix, track::TPCFoundOverFindableCls, track::TPCFractionSharedCls, track::TRDHasCrossing, track::TRDHasNeighbor, track::TRDNTracklets, @@ -636,7 +642,7 @@ DECLARE_SOA_TABLE_FULL_VERSIONED(StoredTracksExtra_001, "TracksExtra", "AOD", "T track::TOFExpTimeTr, track::TOFExpTimeHe, track::TOFExpTimeAl, - track::TPCCrossedRowsOverFindableCls, + track::TPCCrossedRowsOverFindableCls_fix, track::TPCFoundOverFindableCls, track::TPCFractionSharedCls, track::TRDHasCrossing, track::TRDHasNeighbor, track::TRDNTracklets, @@ -667,7 +673,7 @@ DECLARE_SOA_TABLE_FULL_VERSIONED(StoredTracksExtra_002, "TracksExtra", "AOD", "T track::TOFExpTimeTr, track::TOFExpTimeHe, track::TOFExpTimeAl, - track::TPCCrossedRowsOverFindableCls, + track::TPCCrossedRowsOverFindableCls_fix, track::TPCFoundOverFindableCls, track::TPCFractionSharedCls, track::TRDHasCrossing, track::TRDHasNeighbor, track::TRDNTracklets, From 439c52aad10faf1efe7389357326eb191727b2d4 Mon Sep 17 00:00:00 2001 From: Anton Alkin Date: Tue, 7 Jul 2026 13:38:06 +0200 Subject: [PATCH 5/5] fixup! [O2-7038] DPL Analysis: correction for tpcNClsFindable overflow --- Framework/Core/include/Framework/AnalysisDataModel.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index 7366e8f2e4299..5d6092b6b06e2 100644 --- a/Framework/Core/include/Framework/AnalysisDataModel.h +++ b/Framework/Core/include/Framework/AnalysisDataModel.h @@ -438,10 +438,12 @@ DECLARE_SOA_DYNAMIC_COLUMN(TPCNClsPID, tpcNClsPID, //! Number of found TPC clust [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusPID, int8_t tpcNClsFindableMinusFound) -> int16_t { return fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound) - tpcNClsFindableMinusPID; }); -DECLARE_SOA_DYNAMIC_COLUMN(TPCNClsCrossedRows, tpcNClsCrossedRows, //! Number of crossed TPC Rows +DECLARE_SOA_DYNAMIC_COLUMN(TPCNClsCrossedRows_fix, tpcNClsCrossedRows, //! Number of crossed TPC Rows [](uint8_t tpcNClsFindable, int8_t TPCNClsFindableMinusCrossedRows, int8_t tpcNClsFindableMinusFound) -> int16_t { return fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound) - TPCNClsFindableMinusCrossedRows; }); +DECLARE_SOA_DYNAMIC_COLUMN(TPCNClsCrossedRows, tpcNClsCrossedRows, //! Number of crossed TPC Rows + [](uint8_t tpcNClsFindable, int8_t TPCNClsFindableMinusCrossedRows) -> int16_t { return (int16_t)tpcNClsFindable - TPCNClsFindableMinusCrossedRows; }); DECLARE_SOA_DYNAMIC_COLUMN(ITSNCls, itsNCls, //! Number of ITS clusters [](uint8_t itsClusterMap) -> uint8_t { uint8_t itsNcls = 0; @@ -601,7 +603,7 @@ DECLARE_SOA_TABLE_FULL(StoredTracksExtra_000, "TracksExtra", "AOD", "TRACKEXTRA" track::HasITS, track::HasTPC, track::HasTRD, track::HasTOF, track::TPCNClsFound, - track::TPCNClsCrossedRows, + track::TPCNClsCrossedRows_fix, track::TOFExpTimeEl, track::TOFExpTimeMu, track::TOFExpTimePi, @@ -629,7 +631,7 @@ DECLARE_SOA_TABLE_FULL_VERSIONED(StoredTracksExtra_001, "TracksExtra", "AOD", "T track::HasITS, track::HasTPC, track::HasTRD, track::HasTOF, track::TPCNClsFound, - track::TPCNClsCrossedRows, + track::TPCNClsCrossedRows_fix, track::v001::ITSClusterMap, track::v001::ITSNCls, track::v001::ITSNClsInnerBarrel, track::v001::ITSClsSizeInLayer, track::v001::IsITSAfterburner, @@ -660,7 +662,7 @@ DECLARE_SOA_TABLE_FULL_VERSIONED(StoredTracksExtra_002, "TracksExtra", "AOD", "T track::HasTRD, track::HasTOF, track::TPCNClsFound, track::TPCNClsPID, - track::TPCNClsCrossedRows, + track::TPCNClsCrossedRows_fix, track::v001::ITSClusterMap, track::v001::ITSNCls, track::v001::ITSNClsInnerBarrel, track::v001::ITSClsSizeInLayer, track::v001::IsITSAfterburner,