Skip to content

Commit

Permalink
Add fraction of TPC clusters used for PID to AO2D
Browse files Browse the repository at this point in the history
We add this fraction as a binned variable contained in the track flags (like the PID in tracking).
  • Loading branch information
mpuccio committed Aug 21, 2024
1 parent 0abf8fb commit 80a7f35
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Detectors/AOD/src/AODProducerWorkflowSpec.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2487,6 +2487,9 @@ AODProducerWorkflowDPL::TrackExtraInfo AODProducerWorkflowDPL::processBarrelTrac
extraInfoHolder.tpcNClsFindableMinusFound = tpcOrig.getNClusters() - tpcClData.found;
extraInfoHolder.tpcNClsFindableMinusCrossedRows = tpcOrig.getNClusters() - tpcClData.crossed;
extraInfoHolder.tpcNClsShared = tpcClData.shared;
uint8_t clsFractionUsedForPID = (tpcOrig.getdEdx().NHitsIROC + tpcOrig.getdEdx().NHitsOROC1 + tpcOrig.getdEdx().NHitsOROC2 + tpcOrig.getdEdx().NHitsOROC3) * 8 / tpcClData.found;
clsFractionUsedForPID = clsFractionUsedForPID > 7u ? 7u : clsFractionUsedForPID; // 7 is the maximum value
extraInfoHolder.flags |= clsFractionUsedForPID << 25;
if (src == GIndex::TPC) { // standalone TPC track should set its time from their timebins range
if (needBCSlice) {
double t = (tpcOrig.getTime0() + 0.5 * (tpcOrig.getDeltaTFwd() - tpcOrig.getDeltaTBwd())) * mTPCBinNS; // central value
Expand Down
4 changes: 4 additions & 0 deletions Framework/Core/include/Framework/AnalysisDataModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@ DECLARE_SOA_DYNAMIC_COLUMN(IsPVContributor, isPVContributor, //! Run 3: Has this
[](uint8_t flags) -> bool { return (flags & o2::aod::track::PVContributor) == o2::aod::track::PVContributor; });
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(MinFractionOfTPCclustersForPID, minFractionOfTPCclustersForPID, //! Minimum fraction of TPC clusters used for PID in bins of 0.125
[](uint32_t flags) -> float { return ((flags >> 25) & 0x7) * 0.125; });
DECLARE_SOA_DYNAMIC_COLUMN(TPCNClsFound, tpcNClsFound, //! Number of found TPC clusters
[](uint8_t tpcNClsFindable, int8_t tpcNClsFindableMinusFound) -> int16_t { return (int16_t)tpcNClsFindable - tpcNClsFindableMinusFound; });
DECLARE_SOA_DYNAMIC_COLUMN(TPCNClsCrossedRows, tpcNClsCrossedRows, //! Number of crossed TPC Rows
Expand Down Expand Up @@ -487,6 +489,7 @@ DECLARE_SOA_TABLE_FULL(StoredTracksExtra_000, "TracksExtra", "AOD", "TRACKEXTRA"
track::TPCSignal, track::TRDSignal, track::Length, track::TOFExpMom,
track::PIDForTracking<track::Flags>,
track::IsPVContributor<track::Flags>,
track::MinFractionOfTPCclustersForPID<track::Flags>,
track::HasITS<track::DetectorMap>, track::HasTPC<track::DetectorMap>,
track::HasTRD<track::DetectorMap>, track::HasTOF<track::DetectorMap>,
track::TPCNClsFound<track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
Expand All @@ -505,6 +508,7 @@ DECLARE_SOA_TABLE_FULL_VERSIONED(StoredTracksExtra_001, "TracksExtra", "AOD", "T
track::TPCSignal, track::TRDSignal, track::Length, track::TOFExpMom,
track::PIDForTracking<track::Flags>,
track::IsPVContributor<track::Flags>,
track::MinFractionOfTPCclustersForPID<track::Flags>,
track::HasITS<track::v001::DetectorMap>, track::HasTPC<track::v001::DetectorMap>,
track::HasTRD<track::v001::DetectorMap>, track::HasTOF<track::v001::DetectorMap>,
track::TPCNClsFound<track::TPCNClsFindable, track::TPCNClsFindableMinusFound>,
Expand Down
1 change: 1 addition & 0 deletions Framework/Core/include/Framework/DataTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ enum TrackFlags : uint32_t {
PVContributor = 0x2, // This track has contributed to the collision vertex fit
OrphanTrack = 0x4, // Track has no association with any collision vertex
TrackTimeAsym = 0x8, // track with an asymmetric time range
// NOTE bits 26..28 reserved for the fraction of TPC clusters used for PID
// NOTE Highest 4 (29..32) bits reserved for PID hypothesis
};
enum TrackFlagsRun2Enum {
Expand Down

0 comments on commit 80a7f35

Please sign in to comment.