From 285877c4e88f72a41471774e82ccf54892f68b31 Mon Sep 17 00:00:00 2001 From: blacw Date: Tue, 2 Sep 2025 18:33:37 +0800 Subject: [PATCH 1/9] add new table for Hypertiton collision ID --- PWGLF/DataModel/LFHypernucleiTables.h | 18 ++++++++++++ PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx | 29 ++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/PWGLF/DataModel/LFHypernucleiTables.h b/PWGLF/DataModel/LFHypernucleiTables.h index f0f37bf4d86..7e103c7cc5b 100644 --- a/PWGLF/DataModel/LFHypernucleiTables.h +++ b/PWGLF/DataModel/LFHypernucleiTables.h @@ -34,6 +34,7 @@ DECLARE_SOA_COLUMN(QFT0C, qFT0C, float); // Amplitude with FT0 DECLARE_SOA_COLUMN(MultFT0C, multFT0C, float); // Multiplicity with FT0C estimator DECLARE_SOA_COLUMN(PsiTPC, psiTPC, float); // Psi with TPC estimator DECLARE_SOA_COLUMN(MultTPC, multTPC, float); // Multiplicity with TPC estimator +DECLARE_SOA_COLUMN(CollisionId, collisionId, int64_t); // CollisionID DECLARE_SOA_COLUMN(IsMatter, isMatter, bool); // bool: true for matter DECLARE_SOA_COLUMN(PtHe3, ptHe3, float); // Pt of the He daughter @@ -147,9 +148,26 @@ DECLARE_SOA_TABLE(MCHypCands, "AOD", "MCHYPCANDS", hyperrec::IsRecoMCCollision, hyperrec::IsSurvEvSel); +DECLARE_SOA_TABLE(DataHypCandsWColl, "AOD", "HYPCANDSWCOLL", + o2::soa::Index<>, + hyperrec::CollisionId,hyperrec::CentralityFT0A, hyperrec::CentralityFT0C, hyperrec::CentralityFT0M, + hyperrec::XPrimVtx, hyperrec::YPrimVtx, hyperrec::ZPrimVtx, + + hyperrec::IsMatter, + hyperrec::PtHe3, hyperrec::PhiHe3, hyperrec::EtaHe3, + hyperrec::PtPi, hyperrec::PhiPi, hyperrec::EtaPi, + hyperrec::XDecVtx, hyperrec::YDecVtx, hyperrec::ZDecVtx, + hyperrec::DcaV0Daug, hyperrec::DcaHe, hyperrec::DcaPi, + hyperrec::NSigmaHe, hyperrec::NTPCclusHe, hyperrec::NTPCclusPi, hyperrec::NTPCpidClusHe, hyperrec::NTPCpidClusPi, + hyperrec::TPCmomHe, hyperrec::TPCmomPi, hyperrec::TPCsignalHe, hyperrec::TPCsignalPi, hyperrec::TPCChi2He, hyperrec::ITSChi2He, hyperrec::ITSChi2Pi, + hyperrec::TOFMass, + hyperrec::ITSclusterSizesHe, hyperrec::ITSclusterSizesPi, + hyperrec::Flags, hyperrec::TrackedClSize); + using DataHypCand = DataHypCands::iterator; using DataHypCandFlow = DataHypCandsFlow::iterator; using MCHypCand = MCHypCands::iterator; +using DataHypCandWColl = DataHypCandsWColl::iterator; namespace hyperkink { diff --git a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx index e93828980b1..d48dea3303a 100644 --- a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx @@ -137,6 +137,7 @@ struct hyperRecoTask { Produces outputDataTable; Produces outputDataTableWithFlow; Produces outputMCTable; + Produces outputDataTableWithCollID; Service ccdb; Zorro zorro; OutputObj zorroSummary{"zorroSummary"}; @@ -733,6 +734,34 @@ struct hyperRecoTask { } PROCESS_SWITCH(hyperRecoTask, processDataWithFlow, "Data analysis with flow", false); + void processDataWithCollID(CollisionsFull const& collisions, aod::V0s const& V0s, TracksFull const& tracks, aod::AmbiguousTracks const& ambiTracks, aod::BCsWithTimestamps const& bcs) + { + goodCollision.clear(); + goodCollision.resize(collisions.size(), false); + hyperCandidates.clear(); + + selectGoodCollisions(collisions); + useCustomVertexer ? fillCustomV0s(collisions, tracks, ambiTracks, bcs) : fillV0s(collisions, tracks, V0s); + + for (auto& hypCand : hyperCandidates) { + auto collision = collisions.rawIteratorAt(hypCand.collisionID); + float trackedHypClSize = !trackedClSize.empty() ? trackedClSize[hypCand.v0ID] : 0; + outputDataTableWithCollID(hypCand.collisionID, collision.centFT0A(), collision.centFT0C(), collision.centFT0M(), + collision.posX(), collision.posY(), collision.posZ(), + hypCand.isMatter, + hypCand.recoPtHe3(), hypCand.recoPhiHe3(), hypCand.recoEtaHe3(), + hypCand.recoPtPi(), hypCand.recoPhiPi(), hypCand.recoEtaPi(), + hypCand.decVtx[0], hypCand.decVtx[1], hypCand.decVtx[2], + hypCand.dcaV0dau, hypCand.he3DCAXY, hypCand.piDCAXY, + hypCand.nSigmaHe3, hypCand.nTPCClustersHe3, hypCand.nTPCClustersPi, + hypCand.nTPCpidClusHe3, hypCand.nTPCpidClusPi, + hypCand.momHe3TPC, hypCand.momPiTPC, hypCand.tpcSignalHe3, hypCand.tpcSignalPi, hypCand.tpcChi2He3, hypCand.itsChi2He3, hypCand.itsChi2Pi, + hypCand.massTOFHe3, + hypCand.clusterSizeITSHe3, hypCand.clusterSizeITSPi, hypCand.flags, trackedHypClSize); + } + } + PROCESS_SWITCH(hyperRecoTask, processDataWithCollID, "Data analysis with collision ID", false); + void processMC(CollisionsFullMC const& collisions, aod::McCollisions const& mcCollisions, aod::V0s const& V0s, TracksFull const& tracks, aod::AmbiguousTracks const& ambiTracks, aod::BCsWithTimestamps const& bcs, aod::McTrackLabels const& trackLabelsMC, aod::McParticles const& particlesMC) { filledMothers.clear(); From 729ffd469e1e83a7f8bc6b76764175e6f2a55992 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 2 Sep 2025 10:38:10 +0000 Subject: [PATCH 2/9] Please consider the following formatting changes --- PWGLF/DataModel/LFHypernucleiTables.h | 2 +- PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx | 22 ++++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/PWGLF/DataModel/LFHypernucleiTables.h b/PWGLF/DataModel/LFHypernucleiTables.h index 7e103c7cc5b..6b10a7ddd9f 100644 --- a/PWGLF/DataModel/LFHypernucleiTables.h +++ b/PWGLF/DataModel/LFHypernucleiTables.h @@ -150,7 +150,7 @@ DECLARE_SOA_TABLE(MCHypCands, "AOD", "MCHYPCANDS", DECLARE_SOA_TABLE(DataHypCandsWColl, "AOD", "HYPCANDSWCOLL", o2::soa::Index<>, - hyperrec::CollisionId,hyperrec::CentralityFT0A, hyperrec::CentralityFT0C, hyperrec::CentralityFT0M, + hyperrec::CollisionId, hyperrec::CentralityFT0A, hyperrec::CentralityFT0C, hyperrec::CentralityFT0M, hyperrec::XPrimVtx, hyperrec::YPrimVtx, hyperrec::ZPrimVtx, hyperrec::IsMatter, diff --git a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx index d48dea3303a..67250aafc9b 100644 --- a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx @@ -747,17 +747,17 @@ struct hyperRecoTask { auto collision = collisions.rawIteratorAt(hypCand.collisionID); float trackedHypClSize = !trackedClSize.empty() ? trackedClSize[hypCand.v0ID] : 0; outputDataTableWithCollID(hypCand.collisionID, collision.centFT0A(), collision.centFT0C(), collision.centFT0M(), - collision.posX(), collision.posY(), collision.posZ(), - hypCand.isMatter, - hypCand.recoPtHe3(), hypCand.recoPhiHe3(), hypCand.recoEtaHe3(), - hypCand.recoPtPi(), hypCand.recoPhiPi(), hypCand.recoEtaPi(), - hypCand.decVtx[0], hypCand.decVtx[1], hypCand.decVtx[2], - hypCand.dcaV0dau, hypCand.he3DCAXY, hypCand.piDCAXY, - hypCand.nSigmaHe3, hypCand.nTPCClustersHe3, hypCand.nTPCClustersPi, - hypCand.nTPCpidClusHe3, hypCand.nTPCpidClusPi, - hypCand.momHe3TPC, hypCand.momPiTPC, hypCand.tpcSignalHe3, hypCand.tpcSignalPi, hypCand.tpcChi2He3, hypCand.itsChi2He3, hypCand.itsChi2Pi, - hypCand.massTOFHe3, - hypCand.clusterSizeITSHe3, hypCand.clusterSizeITSPi, hypCand.flags, trackedHypClSize); + collision.posX(), collision.posY(), collision.posZ(), + hypCand.isMatter, + hypCand.recoPtHe3(), hypCand.recoPhiHe3(), hypCand.recoEtaHe3(), + hypCand.recoPtPi(), hypCand.recoPhiPi(), hypCand.recoEtaPi(), + hypCand.decVtx[0], hypCand.decVtx[1], hypCand.decVtx[2], + hypCand.dcaV0dau, hypCand.he3DCAXY, hypCand.piDCAXY, + hypCand.nSigmaHe3, hypCand.nTPCClustersHe3, hypCand.nTPCClustersPi, + hypCand.nTPCpidClusHe3, hypCand.nTPCpidClusPi, + hypCand.momHe3TPC, hypCand.momPiTPC, hypCand.tpcSignalHe3, hypCand.tpcSignalPi, hypCand.tpcChi2He3, hypCand.itsChi2He3, hypCand.itsChi2Pi, + hypCand.massTOFHe3, + hypCand.clusterSizeITSHe3, hypCand.clusterSizeITSPi, hypCand.flags, trackedHypClSize); } } PROCESS_SWITCH(hyperRecoTask, processDataWithCollID, "Data analysis with collision ID", false); From 45b1c207309287ee1292ee88828896188b0a7f4e Mon Sep 17 00:00:00 2001 From: blacwovie Date: Tue, 2 Sep 2025 19:02:11 +0800 Subject: [PATCH 3/9] Update hyperRecoTask.cxx --- PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx index 67250aafc9b..7176cb1f6c6 100644 --- a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx @@ -410,10 +410,10 @@ struct hyperRecoTask { hypCand.nSigmaHe3 = computeNSigmaHe3(heTrack); hypCand.nTPCClustersHe3 = heTrack.tpcNClsFound(); hypCand.tpcSignalHe3 = heTrack.tpcSignal(); - hypCand.nTPCpidClusHe3 = (int16_t)heTrack.tpcNClsFindable() - heTrack.tpcNClsFindableMinusPID(); + hypCand.nTPCpidClusHe3 = static_castheTrack.tpcNClsFindable() - heTrack.tpcNClsFindableMinusPID(); hypCand.clusterSizeITSHe3 = heTrack.itsClusterSizes(); hypCand.nTPCClustersPi = piTrack.tpcNClsFound(); - hypCand.nTPCpidClusPi = (int16_t)piTrack.tpcNClsFindable() - piTrack.tpcNClsFindableMinusPID(); + hypCand.nTPCpidClusPi = static_castpiTrack.tpcNClsFindable() - piTrack.tpcNClsFindableMinusPID(); hypCand.tpcSignalPi = piTrack.tpcSignal(); hypCand.tpcChi2He3 = heTrack.tpcChi2NCl(); hypCand.itsChi2He3 = heTrack.itsChi2NCl(); From 3748dd65b7a236716f4f08a46301bbc439141214 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Tue, 2 Sep 2025 11:02:41 +0000 Subject: [PATCH 4/9] Please consider the following formatting changes --- PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx index 7176cb1f6c6..7f3e6211527 100644 --- a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx @@ -410,10 +410,10 @@ struct hyperRecoTask { hypCand.nSigmaHe3 = computeNSigmaHe3(heTrack); hypCand.nTPCClustersHe3 = heTrack.tpcNClsFound(); hypCand.tpcSignalHe3 = heTrack.tpcSignal(); - hypCand.nTPCpidClusHe3 = static_castheTrack.tpcNClsFindable() - heTrack.tpcNClsFindableMinusPID(); + hypCand.nTPCpidClusHe3 = static_cast heTrack.tpcNClsFindable() - heTrack.tpcNClsFindableMinusPID(); hypCand.clusterSizeITSHe3 = heTrack.itsClusterSizes(); hypCand.nTPCClustersPi = piTrack.tpcNClsFound(); - hypCand.nTPCpidClusPi = static_castpiTrack.tpcNClsFindable() - piTrack.tpcNClsFindableMinusPID(); + hypCand.nTPCpidClusPi = static_cast piTrack.tpcNClsFindable() - piTrack.tpcNClsFindableMinusPID(); hypCand.tpcSignalPi = piTrack.tpcSignal(); hypCand.tpcChi2He3 = heTrack.tpcChi2NCl(); hypCand.itsChi2He3 = heTrack.itsChi2NCl(); From f9aa1328b854c3fae359a9eb1c7f4acf165d0223 Mon Sep 17 00:00:00 2001 From: blacwovie Date: Tue, 2 Sep 2025 19:10:48 +0800 Subject: [PATCH 5/9] Update hyperRecoTask.cxx --- PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx index 7f3e6211527..ee4878b1741 100644 --- a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx @@ -121,7 +121,7 @@ struct hyperCandidate { uint32_t clusterSizeITSPi = 0u; // collision information - unsigned int collisionID = 0; + int64_t collisionID = 0; bool isMatter = false; bool isSignal = false; // true MC signal From 3e872840607c3324d9da1b4d2e4086d61757d83f Mon Sep 17 00:00:00 2001 From: blacwovie Date: Thu, 4 Sep 2025 16:04:10 +0800 Subject: [PATCH 6/9] Update hyperRecoTask.cxx --- PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx index ee4878b1741..a1a39eb9dab 100644 --- a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx @@ -410,10 +410,10 @@ struct hyperRecoTask { hypCand.nSigmaHe3 = computeNSigmaHe3(heTrack); hypCand.nTPCClustersHe3 = heTrack.tpcNClsFound(); hypCand.tpcSignalHe3 = heTrack.tpcSignal(); - hypCand.nTPCpidClusHe3 = static_cast heTrack.tpcNClsFindable() - heTrack.tpcNClsFindableMinusPID(); + hypCand.nTPCpidClusHe3 = static_cast (heTrack.tpcNClsFindable() - heTrack.tpcNClsFindableMinusPID()); hypCand.clusterSizeITSHe3 = heTrack.itsClusterSizes(); hypCand.nTPCClustersPi = piTrack.tpcNClsFound(); - hypCand.nTPCpidClusPi = static_cast piTrack.tpcNClsFindable() - piTrack.tpcNClsFindableMinusPID(); + hypCand.nTPCpidClusPi = static_cast (piTrack.tpcNClsFindable() - piTrack.tpcNClsFindableMinusPID()); hypCand.tpcSignalPi = piTrack.tpcSignal(); hypCand.tpcChi2He3 = heTrack.tpcChi2NCl(); hypCand.itsChi2He3 = heTrack.itsChi2NCl(); From f7a4d89254acd5518aceefe735dddc7b064ad99d Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 4 Sep 2025 08:04:43 +0000 Subject: [PATCH 7/9] Please consider the following formatting changes --- PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx index a1a39eb9dab..76467400b82 100644 --- a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx @@ -410,10 +410,10 @@ struct hyperRecoTask { hypCand.nSigmaHe3 = computeNSigmaHe3(heTrack); hypCand.nTPCClustersHe3 = heTrack.tpcNClsFound(); hypCand.tpcSignalHe3 = heTrack.tpcSignal(); - hypCand.nTPCpidClusHe3 = static_cast (heTrack.tpcNClsFindable() - heTrack.tpcNClsFindableMinusPID()); + hypCand.nTPCpidClusHe3 = static_cast(heTrack.tpcNClsFindable() - heTrack.tpcNClsFindableMinusPID()); hypCand.clusterSizeITSHe3 = heTrack.itsClusterSizes(); hypCand.nTPCClustersPi = piTrack.tpcNClsFound(); - hypCand.nTPCpidClusPi = static_cast (piTrack.tpcNClsFindable() - piTrack.tpcNClsFindableMinusPID()); + hypCand.nTPCpidClusPi = static_cast(piTrack.tpcNClsFindable() - piTrack.tpcNClsFindableMinusPID()); hypCand.tpcSignalPi = piTrack.tpcSignal(); hypCand.tpcChi2He3 = heTrack.tpcChi2NCl(); hypCand.itsChi2He3 = heTrack.itsChi2NCl(); From a29bf4705143c55f1aaba452540c2f8ac9b6e99e Mon Sep 17 00:00:00 2001 From: blacwovie Date: Thu, 4 Sep 2025 16:13:16 +0800 Subject: [PATCH 8/9] Update hyperRecoTask.cxx --- PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx index 76467400b82..ac3529e6658 100644 --- a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx @@ -91,7 +91,7 @@ struct hyperCandidate { float genPhi() const { return std::atan2(gMom[1], gMom[0]); } float genEta() const { return std::asinh(gMom[2] / genPt()); } - int v0ID; + int v0ID = -1; int heTrackID; int piTrackID; float dcaV0dau = -10; From 75370edd05e05a3e07811f9427c83d911c50a5d1 Mon Sep 17 00:00:00 2001 From: blacwovie Date: Thu, 4 Sep 2025 17:14:54 +0800 Subject: [PATCH 9/9] Update hyperRecoTask.cxx --- PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx index ac3529e6658..ebe45137da0 100644 --- a/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx +++ b/PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx @@ -410,10 +410,10 @@ struct hyperRecoTask { hypCand.nSigmaHe3 = computeNSigmaHe3(heTrack); hypCand.nTPCClustersHe3 = heTrack.tpcNClsFound(); hypCand.tpcSignalHe3 = heTrack.tpcSignal(); - hypCand.nTPCpidClusHe3 = static_cast(heTrack.tpcNClsFindable() - heTrack.tpcNClsFindableMinusPID()); + hypCand.nTPCpidClusHe3 = static_cast(heTrack.tpcNClsFindable()) - heTrack.tpcNClsFindableMinusPID(); hypCand.clusterSizeITSHe3 = heTrack.itsClusterSizes(); hypCand.nTPCClustersPi = piTrack.tpcNClsFound(); - hypCand.nTPCpidClusPi = static_cast(piTrack.tpcNClsFindable() - piTrack.tpcNClsFindableMinusPID()); + hypCand.nTPCpidClusPi = static_cast(piTrack.tpcNClsFindable()) - piTrack.tpcNClsFindableMinusPID(); hypCand.tpcSignalPi = piTrack.tpcSignal(); hypCand.tpcChi2He3 = heTrack.tpcChi2NCl(); hypCand.itsChi2He3 = heTrack.itsChi2NCl();