@@ -396,6 +396,18 @@ DECLARE_SOA_DYNAMIC_COLUMN(TPCDeltaTBwd, tpcDeltaTBwd, //! Delta Backward of tra
396396
397397} // namespace v001
398398
399+ namespace
400+ {
401+ inline uint16_t fixTPCNClsFindable (uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusFound)
402+ {
403+ uint16_t res = tpcNClsFindable;
404+ if (tpcNClsFindable <= tpcNClsFindableMinusFound) {
405+ res += 256 ;
406+ }
407+ return res;
408+ }
409+ } // namespace
410+
399411DECLARE_SOA_DYNAMIC_COLUMN (HasITS, hasITS, // ! Flag to check if track has a ITS match
400412 [](uint8_t detectorMap) -> bool { return detectorMap & o2::aod::track::ITS ; });
401413DECLARE_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
419431DECLARE_SOA_DYNAMIC_COLUMN (PIDForTracking, pidForTracking, // ! PID hypothesis used during tracking. See the constants in the class PID in PID.h
420432 [](uint32_t flags) -> uint32_t { return flags >> 28 ; });
421433DECLARE_SOA_DYNAMIC_COLUMN (TPCNClsFound, tpcNClsFound, // ! Number of found TPC clusters
422- [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusFound) -> int16_t { return (int16_t )tpcNClsFindable - tpcNClsFindableMinusFound; });
434+ [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusFound) -> int16_t
435+ {
436+ return fixTPCNClsFindable (tpcNClsFindable, tpcNClsFindableMinusFound) - tpcNClsFindableMinusFound;
437+ });
423438DECLARE_SOA_DYNAMIC_COLUMN (TPCNClsPID, tpcNClsPID, // ! Number of found TPC clusters used for PID
424- [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusPID) -> int16_t { return (int16_t )tpcNClsFindable - tpcNClsFindableMinusPID; });
439+ [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusPID, int8_t tpcNClsFindableMinusFound) -> int16_t
440+ {
441+ return fixTPCNClsFindable (tpcNClsFindable, tpcNClsFindableMinusFound) - tpcNClsFindableMinusPID;
442+ });
425443DECLARE_SOA_DYNAMIC_COLUMN (TPCNClsCrossedRows, tpcNClsCrossedRows, // ! Number of crossed TPC Rows
426- [](uint8_t tpcNClsFindable, int8_t TPCNClsFindableMinusCrossedRows) -> int16_t { return (int16_t )tpcNClsFindable - TPCNClsFindableMinusCrossedRows; });
444+ [](uint8_t tpcNClsFindable, int8_t TPCNClsFindableMinusCrossedRows, int8_t tpcNClsFindableMinusFound) -> int16_t
445+ {
446+ return fixTPCNClsFindable (tpcNClsFindable, tpcNClsFindableMinusFound) - TPCNClsFindableMinusCrossedRows;
447+ });
427448DECLARE_SOA_DYNAMIC_COLUMN (ITSNCls, itsNCls, // ! Number of ITS clusters
428449 [](uint8_t itsClusterMap) -> uint8_t {
429450 uint8_t itsNcls = 0 ;
@@ -456,19 +477,19 @@ DECLARE_SOA_DYNAMIC_COLUMN(ITSNSharedCls, itsNSharedCls, //! Number of shared IT
456477 });
457478DECLARE_SOA_DYNAMIC_COLUMN (TPCFoundOverFindableCls, tpcFoundOverFindableCls, // ! Ratio of found over findable clusters
458479 [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusFound) -> float {
459- int16_t tpcNClsFound = ( int16_t ) tpcNClsFindable - tpcNClsFindableMinusFound;
480+ int16_t tpcNClsFound = fixTPCNClsFindable ( tpcNClsFindable, tpcNClsFindableMinusFound) - tpcNClsFindableMinusFound;
460481 return (float )tpcNClsFound / (float )tpcNClsFindable;
461482 });
462483
463484DECLARE_SOA_DYNAMIC_COLUMN (TPCCrossedRowsOverFindableCls, tpcCrossedRowsOverFindableCls, // ! Ratio crossed rows over findable clusters
464- [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusCrossedRows) -> float {
465- int16_t tpcNClsCrossedRows = ( int16_t ) tpcNClsFindable - tpcNClsFindableMinusCrossedRows;
485+ [](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusCrossedRows, int8_t tpcNClsFindableMinusFound ) -> float {
486+ int16_t tpcNClsCrossedRows = fixTPCNClsFindable ( tpcNClsFindable, tpcNClsFindableMinusFound) - tpcNClsFindableMinusCrossedRows;
466487 return (float )tpcNClsCrossedRows / (float )tpcNClsFindable;
467488 });
468489
469490DECLARE_SOA_DYNAMIC_COLUMN (TPCFractionSharedCls, tpcFractionSharedCls, // ! Fraction of shared TPC clusters
470491 [](uint8_t tpcNClsShared, uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusFound) -> float {
471- int16_t tpcNClsFound = ( int16_t ) tpcNClsFindable - tpcNClsFindableMinusFound;
492+ int16_t tpcNClsFound = fixTPCNClsFindable ( tpcNClsFindable, tpcNClsFindableMinusFound) - tpcNClsFindableMinusFound;
472493 return (float )tpcNClsShared / (float )tpcNClsFound;
473494 });
474495
@@ -577,7 +598,7 @@ DECLARE_SOA_TABLE_FULL(StoredTracksExtra_000, "TracksExtra", "AOD", "TRACKEXTRA"
577598 track::HasITS<track::DetectorMap>, track::HasTPC<track::DetectorMap>,
578599 track::HasTRD<track::DetectorMap>, track::HasTOF<track::DetectorMap>,
579600 track::TPCNClsFound<track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
580- track::TPCNClsCrossedRows<track::TPCNClsFindable, track::TPCNClsFindableMinusCrossedRows>,
601+ track::TPCNClsCrossedRows<track::TPCNClsFindable, track::TPCNClsFindableMinusCrossedRows, track::TPCNClsFindableMinusFound >,
581602 track::TOFExpTimeEl<track::Length, track::TOFExpMom>,
582603 track::TOFExpTimeMu<track::Length, track::TOFExpMom>,
583604 track::TOFExpTimePi<track::Length, track::TOFExpMom>,
@@ -588,7 +609,7 @@ DECLARE_SOA_TABLE_FULL(StoredTracksExtra_000, "TracksExtra", "AOD", "TRACKEXTRA"
588609 track::TOFExpTimeHe<track::Length, track::TOFExpMom>,
589610 track::TOFExpTimeAl<track::Length, track::TOFExpMom>,
590611 track::ITSNCls<track::ITSClusterMap>, track::ITSNClsInnerBarrel<track::ITSClusterMap>,
591- track::TPCCrossedRowsOverFindableCls<track::TPCNClsFindable, track::TPCNClsFindableMinusCrossedRows>,
612+ track::TPCCrossedRowsOverFindableCls<track::TPCNClsFindable, track::TPCNClsFindableMinusCrossedRows, track::TPCNClsFindableMinusFound >,
592613 track::TPCFoundOverFindableCls<track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
593614 track::TPCFractionSharedCls<track::TPCNClsShared, track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
594615 track::TRDHasCrossing<track::TRDPattern>, track::TRDHasNeighbor<track::TRDPattern>, track::TRDNTracklets<track::TRDPattern>,
@@ -605,7 +626,7 @@ DECLARE_SOA_TABLE_FULL_VERSIONED(StoredTracksExtra_001, "TracksExtra", "AOD", "T
605626 track::HasITS<track::v001::DetectorMap>, track::HasTPC<track::v001::DetectorMap>,
606627 track::HasTRD<track::v001::DetectorMap>, track::HasTOF<track::v001::DetectorMap>,
607628 track::TPCNClsFound<track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
608- track::TPCNClsCrossedRows<track::TPCNClsFindable, track::TPCNClsFindableMinusCrossedRows>,
629+ track::TPCNClsCrossedRows<track::TPCNClsFindable, track::TPCNClsFindableMinusCrossedRows, track::TPCNClsFindableMinusFound >,
609630 track::v001::ITSClusterMap<track::ITSClusterSizes>, track::v001::ITSNCls<track::ITSClusterSizes>, track::v001::ITSNClsInnerBarrel<track::ITSClusterSizes>,
610631 track::v001::ITSClsSizeInLayer<track::ITSClusterSizes>,
611632 track::v001::IsITSAfterburner<track::v001::DetectorMap, track::ITSChi2NCl>,
@@ -618,7 +639,7 @@ DECLARE_SOA_TABLE_FULL_VERSIONED(StoredTracksExtra_001, "TracksExtra", "AOD", "T
618639 track::TOFExpTimeTr<track::Length, track::TOFExpMom>,
619640 track::TOFExpTimeHe<track::Length, track::TOFExpMom>,
620641 track::TOFExpTimeAl<track::Length, track::TOFExpMom>,
621- track::TPCCrossedRowsOverFindableCls<track::TPCNClsFindable, track::TPCNClsFindableMinusCrossedRows>,
642+ track::TPCCrossedRowsOverFindableCls<track::TPCNClsFindable, track::TPCNClsFindableMinusCrossedRows, track::TPCNClsFindableMinusFound >,
622643 track::TPCFoundOverFindableCls<track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
623644 track::TPCFractionSharedCls<track::TPCNClsShared, track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
624645 track::TRDHasCrossing<track::TRDPattern>, track::TRDHasNeighbor<track::TRDPattern>, track::TRDNTracklets<track::TRDPattern>,
@@ -635,8 +656,8 @@ DECLARE_SOA_TABLE_FULL_VERSIONED(StoredTracksExtra_002, "TracksExtra", "AOD", "T
635656 track::HasITS<track::v001::DetectorMap>, track::HasTPC<track::v001::DetectorMap>,
636657 track::HasTRD<track::v001::DetectorMap>, track::HasTOF<track::v001::DetectorMap>,
637658 track::TPCNClsFound<track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
638- track::TPCNClsPID<track::TPCNClsFindable, track::TPCNClsFindableMinusPID>,
639- track::TPCNClsCrossedRows<track::TPCNClsFindable, track::TPCNClsFindableMinusCrossedRows>,
659+ track::TPCNClsPID<track::TPCNClsFindable, track::TPCNClsFindableMinusPID, track::TPCNClsFindableMinusFound >,
660+ track::TPCNClsCrossedRows<track::TPCNClsFindable, track::TPCNClsFindableMinusCrossedRows, track::TPCNClsFindableMinusFound >,
640661 track::v001::ITSClusterMap<track::ITSClusterSizes>, track::v001::ITSNCls<track::ITSClusterSizes>, track::v001::ITSNClsInnerBarrel<track::ITSClusterSizes>,
641662 track::v001::ITSClsSizeInLayer<track::ITSClusterSizes>,
642663 track::v001::IsITSAfterburner<track::v001::DetectorMap, track::ITSChi2NCl>,
@@ -649,7 +670,7 @@ DECLARE_SOA_TABLE_FULL_VERSIONED(StoredTracksExtra_002, "TracksExtra", "AOD", "T
649670 track::TOFExpTimeTr<track::Length, track::TOFExpMom>,
650671 track::TOFExpTimeHe<track::Length, track::TOFExpMom>,
651672 track::TOFExpTimeAl<track::Length, track::TOFExpMom>,
652- track::TPCCrossedRowsOverFindableCls<track::TPCNClsFindable, track::TPCNClsFindableMinusCrossedRows>,
673+ track::TPCCrossedRowsOverFindableCls<track::TPCNClsFindable, track::TPCNClsFindableMinusCrossedRows, track::TPCNClsFindableMinusFound >,
653674 track::TPCFoundOverFindableCls<track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
654675 track::TPCFractionSharedCls<track::TPCNClsShared, track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
655676 track::TRDHasCrossing<track::TRDPattern>, track::TRDHasNeighbor<track::TRDPattern>, track::TRDNTracklets<track::TRDPattern>,
0 commit comments