From 048f0bddada30a48d41d61d919d23925a3e8ff48 Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Sat, 17 Jan 2026 20:12:33 +0100 Subject: [PATCH 1/2] store tracks number beyond 8 bits - split the number of tacks (up to q6 bit) encoding into 2 bytes in the collision table - used in the pb-pb analysis of run 2 --- PWGLF/TableProducer/Nuspex/ebyeMaker.cxx | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx index 25556b2bc14..edaa506ea4d 100644 --- a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx +++ b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx @@ -93,6 +93,20 @@ float calculateDCAStraightToPV(float X, float Y, float Z, float Px, float Py, fl { return std::sqrt((std::pow((pvY - Y) * Pz - (pvZ - Z) * Py, 2) + std::pow((pvX - X) * Pz - (pvZ - Z) * Px, 2) + std::pow((pvX - X) * Py - (pvY - Y) * Px, 2)) / (Px * Px + Py * Py + Pz * Pz)); } +void encode16bit(int const& n, uint8_t& low, uint8_t& up) +{ + if (n >= (1 << 16)) + low = up = -1; + int bbyte = 8; + for (int b{0}; b < bbyte; ++b) { + int bl = (n & (1 << b)) >> b; + int bu = (n & (1 << (b + bbyte))) >> (b + bbyte); + if (bl > 0) + low += (1 << b); + if (bu > 0) + up += (1 << b); + } +} } // namespace struct CandidateV0 { @@ -184,6 +198,7 @@ struct EbyeMaker { uint8_t nTrackletsColl; uint8_t nTracksColl; uint8_t nChPartGen; + int nTracksCollFull; Configurable cfgMaterialCorrection{"cfgMaterialCorrection", static_cast(o2::base::Propagator::MatCorrType::USEMatCorrNONE), "Type of material correction"}; Configurable> cfgBetheBlochParams{"cfgBetheBlochParams", {kBetheBlochDefault[0], 2, 6, particleNamesPar, betheBlochParNames}, "TPC Bethe-Bloch parameterisation for deuteron"}; @@ -565,6 +580,7 @@ struct EbyeMaker { candidateV0s.clear(); nTrackletsColl = 0u; nTracksColl = 0u; + nTracksCollFull = 0; std::array dcaInfo; for (const auto& track : tracks) { @@ -592,9 +608,10 @@ struct EbyeMaker { if (track.tpcNClsFound() < trackNclusTpcCut || track.tpcNClsCrossedRows() < trackNcrossedRows) continue; histos.fill(HIST("QA/tpcSignal"), track.tpcInnerParam(), track.tpcSignal()); - if (trackPt > ptMin[0] && trackPt < ptMax[0] && ((track.sign() < 0 && countOnlyLSTrk == TracksCharge::kNegative) || (track.sign() > 0 && countOnlyLSTrk == TracksCharge::kPositive) || (countOnlyLSTrk == TracksCharge::kAll))) + if (trackPt > ptMin[0] && trackPt < ptMax[0] && ((track.sign() < 0 && countOnlyLSTrk == TracksCharge::kNegative) || (track.sign() > 0 && countOnlyLSTrk == TracksCharge::kPositive) || (countOnlyLSTrk == TracksCharge::kAll))){ nTracksColl++; - + nTracksCollFull++; + } for (int iP{0}; iP < kNpart; ++iP) { if (trackPt < ptMin[iP] || trackPt > ptMax[iP]) { continue; @@ -989,6 +1006,7 @@ struct EbyeMaker { histos.fill(HIST("QA/V0MvsCL0"), centralityCl0, centrality); histos.fill(HIST("QA/trackletsVsV0M"), centrality, multTracklets); + encode16bit(nTracksCollFull, nTrackletsColl, nTracksColl); miniCollTable(static_cast(collision.posZ() * 10), 0x0, nTrackletsColl, centrality, nTracksColl); for (auto& candidateTrack : candidateTracks[0]) { // o2-linter: disable=const-ref-in-for-loop (not a const ref) auto tk = tracks.rawIteratorAt(candidateTrack.globalIndex); From a1b2fe0b15bd56fc2fa2a2224985afdcef79ca34 Mon Sep 17 00:00:00 2001 From: Mario Ciacco Date: Sat, 17 Jan 2026 20:15:01 +0100 Subject: [PATCH 2/2] fix formatting (missing space) --- PWGLF/TableProducer/Nuspex/ebyeMaker.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx index edaa506ea4d..c89883b011c 100644 --- a/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx +++ b/PWGLF/TableProducer/Nuspex/ebyeMaker.cxx @@ -608,7 +608,7 @@ struct EbyeMaker { if (track.tpcNClsFound() < trackNclusTpcCut || track.tpcNClsCrossedRows() < trackNcrossedRows) continue; histos.fill(HIST("QA/tpcSignal"), track.tpcInnerParam(), track.tpcSignal()); - if (trackPt > ptMin[0] && trackPt < ptMax[0] && ((track.sign() < 0 && countOnlyLSTrk == TracksCharge::kNegative) || (track.sign() > 0 && countOnlyLSTrk == TracksCharge::kPositive) || (countOnlyLSTrk == TracksCharge::kAll))){ + if (trackPt > ptMin[0] && trackPt < ptMax[0] && ((track.sign() < 0 && countOnlyLSTrk == TracksCharge::kNegative) || (track.sign() > 0 && countOnlyLSTrk == TracksCharge::kPositive) || (countOnlyLSTrk == TracksCharge::kAll))) { nTracksColl++; nTracksCollFull++; }