diff --git a/Framework/Core/include/Framework/AnalysisDataModel.h b/Framework/Core/include/Framework/AnalysisDataModel.h index c8dd33fba62ee..5d6092b6b06e2 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,9 +431,17 @@ 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_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 @@ -456,8 +476,14 @@ 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; - return (float)tpcNClsFound / (float)tpcNClsFindable; + int16_t tpcNClsFound = fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound) - tpcNClsFindableMinusFound; + return (float)tpcNClsFound / (float)fixTPCNClsFindable(tpcNClsFindable, tpcNClsFindableMinusFound); + }); + +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 @@ -468,7 +494,7 @@ DECLARE_SOA_DYNAMIC_COLUMN(TPCCrossedRowsOverFindableCls, tpcCrossedRowsOverFind 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 +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, @@ -588,7 +614,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, @@ -605,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, @@ -618,7 +644,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, @@ -635,8 +661,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_fix, track::v001::ITSClusterMap, track::v001::ITSNCls, track::v001::ITSNClsInnerBarrel, track::v001::ITSClsSizeInLayer, track::v001::IsITSAfterburner, @@ -649,7 +675,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,