From a762576b93bd9a0f472283c587eeb77732b79a77 Mon Sep 17 00:00:00 2001 From: blacw Date: Wed, 17 Sep 2025 16:14:05 +0800 Subject: [PATCH 1/6] pi-hypertriton ME process --- .../TableProducer/PiNucleiFemto.cxx | 267 +++++++++++++++--- 1 file changed, 227 insertions(+), 40 deletions(-) diff --git a/PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx b/PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx index c7272ad3e30..8821d042251 100644 --- a/PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx +++ b/PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx @@ -204,12 +204,13 @@ struct PiNucleiFemto { PresliceUnsorted hypPerCol = o2::aod::hyperrec::collisionId; // binning for EM background - ConfigurableAxis axisVertex{"axisVertex", {30, -10, 10}, "Binning for multiplicity"}; + ConfigurableAxis axisVertex{"axisVertex", {30, -10, 10}, "Binning for vtxz"}; ConfigurableAxis axisCentrality{"axisCentrality", {40, 0, 100}, "Binning for centrality"}; using BinningType = ColumnBinningPolicy; BinningType binningPolicy{{axisVertex, axisCentrality}, true}; SliceCache cache; SameKindPair mPair{binningPolicy, settingNoMixedEvents, -1, &cache}; + //Pair hyperPair{binningPolicy, settingNoMixedEvents, -1, &cache}; std::array mBBparamsDe; @@ -229,6 +230,7 @@ struct PiNucleiFemto { "QA", {{"hVtxZ", "Vertex distribution in Z;Z (cm)", {HistType::kTH1F, {{400, -20.0, 20.0}}}}, {"hNcontributor", "Number of primary vertex contributor", {HistType::kTH1F, {{2000, 0.0f, 2000.0f}}}}, + {"hCentrality", "Centrality", {HistType::kTH1F, {{200, 0.0f, 100.0f}}}}, {"hTrackSel", "Accepted tracks", {HistType::kTH1F, {{Selections::kAll, -0.5, static_cast(Selections::kAll) - 0.5}}}}, {"hEvents", "; Events;", {HistType::kTH1F, {{3, -0.5, 2.5}}}}, {"hEmptyPool", "svPoolCreator did not find track pairs false/true", {HistType::kTH1F, {{2, -0.5, 1.5}}}}, @@ -240,6 +242,9 @@ struct PiNucleiFemto { {"hNuPitInvMass", "; M(Nu + p) (GeV/#it{c}^{2})", {HistType::kTH1F, {{300, 3.74f, 4.34f}}}}, {"hNuPt", "#it{p}_{T} distribution; #it{p}_{T} (GeV/#it{c})", {HistType::kTH1F, {{240, -6.0f, 6.0f}}}}, {"hPiPt", "Pt distribution; #it{p}_{T} (GeV/#it{c})", {HistType::kTH1F, {{120, -3.0f, 3.0f}}}}, + {"hHe3TPCnsigma", "NsigmaHe3 TPC distribution; #it{p}_{T} (GeV/#it{c}); n#sigma_{TPC}(He3)", {HistType::kTH2F, {{100, -2.0f, 2.0f}, {200, -5.0f, 5.0f}}}}, + {"hHe3P", "Pin distribution; p (GeV/#it{c})", {HistType::kTH1F, {{120, -3.0f, 3.0f}}}}, + {"hHe3P_preselected", "Pin distribution_preselected; p (GeV/#it{c})", {HistType::kTH1F, {{120, -3.0f, 3.0f}}}}, {"hNuEta", "eta distribution; #eta(Nu)", {HistType::kTH1F, {{200, -1.0f, 1.0f}}}}, {"hPiEta", "eta distribution; #eta(#pi)", {HistType::kTH1F, {{200, -1.0f, 1.0f}}}}, {"hNuPhi", "phi distribution; phi(Nu)", {HistType::kTH1F, {{600, -4.0f, 4.0f}}}}, @@ -268,6 +273,49 @@ struct PiNucleiFemto { false, true}; + + int numOfCentBins = 40; + int numOfVertexZBins = 30; + float Vz_low = -10.0f; + float Vz_high = 10.0f; + float Vz_step = (Vz_high - Vz_low) / numOfVertexZBins; + + struct EventRef { + int64_t collisionId; + }; + + struct PoolBin { + std::deque events; + }; + + std::vector All_Event_pool; + bool isInitialized = false; + + int nPoolBins() const { return numOfVertexZBins * numOfCentBins; } + + void initializePools() + { + All_Event_pool.clear(); + All_Event_pool.resize(nPoolBins()); + isInitialized = true; + } + + int where_pool(float vz, float v0Centr) const + { + float CentBinWidth = 100.0 / numOfCentBins; // = 2.5 + + int iy = static_cast(std::floor(v0Centr / CentBinWidth)); + if (iy < 0) iy = 0; + if (iy >= numOfCentBins) iy = numOfCentBins - 1; + + int ix = static_cast(std::floor((vz - Vz_low) / Vz_step)); + if (ix < 0) ix = 0; + if (ix >= numOfVertexZBins) ix = numOfVertexZBins - 1; + + int bin = ix + numOfVertexZBins * iy; + return bin; + } + void init(o2::framework::InitContext&) { mZorroSummary.setObject(mZorro.getZorroSummary()); @@ -488,6 +536,41 @@ struct PiNucleiFemto { return false; } + float averageClusterSizeCosl(uint32_t itsClusterSizes, float eta) + { + float average = 0; + int nclusters = 0; + const float cosl = 1. / std::cosh(eta); + const int nlayerITS = 7; + + for (int layer = 0; layer < nlayerITS; layer++) { + if ((itsClusterSizes >> (layer * 4)) & 0xf) { + nclusters++; + average += (itsClusterSizes >> (layer * 4)) & 0xf; + } + } + if (nclusters == 0) { + return 0; + } + return average * cosl / nclusters; + }; + + bool selectionPIDHyper(const aod::DataHypCandsWColl::iterator& V0Hyper) + { + mQaRegistry.fill(HIST("hHe3P_preselected"), V0Hyper.tpcMomHe()); + float averClusSizeHe = averageClusterSizeCosl(V0Hyper.itsClusterSizesHe(), V0Hyper.etaHe3()); + if (averClusSizeHe <= 4) { + return false; + } + if (V0Hyper.tpcChi2He() <= 0.5) { + return false; + } + mQaRegistry.fill(HIST("hHe3P"), V0Hyper.tpcMomHe()); + mQaRegistry.fill(HIST("hHe3TPCnsigma"), V0Hyper.nSigmaHe()); + + return true; + } + // ================================================================================================================== template @@ -606,22 +689,22 @@ struct PiNucleiFemto { bool fillCandidateInfoHyper(const aod::DataHypCandsWColl::iterator& V0Hyper, const Ttrack& trackPi, PiNucandidate& piHypercand, bool isMixedEvent) { piHypercand.collisionID = V0Hyper.collisionId(); - // get hypertriton information - // constexpr double mHe3 = o2::constants::physics::MassHelium3; - // constexpr double mPi = o2::constants::physics::MassPiPlus; - // --- He3 + //get hypertriton information + //constexpr double mHe3 = o2::constants::physics::MassHelium3; + //constexpr double mPi = o2::constants::physics::MassPiPlus; + // --- He3 float pxHe3 = V0Hyper.ptHe3() * std::cos(V0Hyper.phiHe3()); float pyHe3 = V0Hyper.ptHe3() * std::sin(V0Hyper.phiHe3()); float pzHe3 = V0Hyper.ptHe3() * std::sinh(V0Hyper.etaHe3()); - // float pHe3 = V0Hyper.ptHe3() * std::cosh(V0Hyper.etaHe3()); - // float enHe3 = std::sqrt(pHe3 * pHe3 + mHe3 * mHe3); - // --- pi + //float pHe3 = V0Hyper.ptHe3() * std::cosh(V0Hyper.etaHe3()); + //float enHe3 = std::sqrt(pHe3 * pHe3 + mHe3 * mHe3); + // --- pi float pxPi = V0Hyper.ptPi() * std::cos(V0Hyper.phiPi()); float pyPi = V0Hyper.ptPi() * std::sin(V0Hyper.phiPi()); float pzPi = V0Hyper.ptPi() * std::sinh(V0Hyper.etaPi()); - // float pPi = V0Hyper.ptPi() * std::cosh(V0Hyper.etaPi()); - // float enPi = std::sqrt(pPi * pPi + mPi * mPi); - // --- hypertriton + //float pPi = V0Hyper.ptPi() * std::cosh(V0Hyper.etaPi()); + //float enPi = std::sqrt(pPi * pPi + mPi * mPi); + // --- hypertriton float px = pxHe3 + pxPi; float py = pyHe3 + pyPi; float pz = pzHe3 + pzPi; @@ -639,12 +722,12 @@ struct PiNucleiFemto { } piHypercand.signPi = trackPi.sign(); - if (V0Hyper.isMatter()) { + if(V0Hyper.isMatter()){ piHypercand.signNu = 1; - } else { + }else{ piHypercand.signNu = -1; } - + piHypercand.dcaxyPi = trackPi.dcaXY(); piHypercand.dcazPi = trackPi.dcaZ(); piHypercand.tpcSignalPi = trackPi.tpcSignal(); @@ -720,29 +803,31 @@ struct PiNucleiFemto { template void pairTracksSameEventHyper(const Ttrack& piTracks, const Thypers& V0Hypers) { - for (const auto& piTrack : piTracks) { - - mQaRegistry.fill(HIST("hTrackSel"), Selections::kNoCuts); - - if (!selectTrack(piTrack)) { - continue; - } - mQaRegistry.fill(HIST("hTrackSel"), Selections::kTrackCuts); - - if (!selectionPIDPion(piTrack)) { - continue; - } - mQaRegistry.fill(HIST("hTrackSel"), Selections::kPID); - - for (const auto& V0Hyper : V0Hypers) { - - SVCand pair; - pair.tr0Idx = piTrack.globalIndex(); - pair.tr1Idx = V0Hyper.globalIndex(); - const int collIdx = V0Hyper.collisionId(); - CollBracket collBracket{collIdx, collIdx}; - pair.collBracket = collBracket; - mTrackHypPairs.push_back(pair); + for (const auto& V0Hyper : V0Hypers) { + if (!selectionPIDHyper(V0Hyper)) { + continue; + } + for (const auto& piTrack : piTracks) { + + mQaRegistry.fill(HIST("hTrackSel"), Selections::kNoCuts); + + if (!selectTrack(piTrack)) { + continue; + } + mQaRegistry.fill(HIST("hTrackSel"), Selections::kTrackCuts); + + if (!selectionPIDPion(piTrack)) { + continue; + } + mQaRegistry.fill(HIST("hTrackSel"), Selections::kPID); + + SVCand pair; + pair.tr0Idx = piTrack.globalIndex(); + pair.tr1Idx = V0Hyper.globalIndex(); + const int collIdx = V0Hyper.collisionId(); + CollBracket collBracket{collIdx, collIdx}; + pair.collBracket = collBracket; + mTrackHypPairs.push_back(pair); } } } @@ -770,6 +855,29 @@ struct PiNucleiFemto { } } + template + void pairHyperEventMixing(T1& pionCands, T2& hypCands) + { + for (const auto& hypCand : hypCands) { + if (!selectionPIDHyper(hypCand)) { + continue; + } + for (const auto& pionCand : pionCands) { + if (!selectTrack(pionCand) || !selectionPIDPion(pionCand)) { + continue; + } + + SVCand pair; + pair.tr0Idx = hypCand.globalIndex(); + pair.tr1Idx = pionCand.globalIndex(); + const int collIdx = hypCand.collisionId(); + CollBracket collBracket{collIdx, collIdx}; + pair.collBracket = collBracket; + mTrackHypPairs.push_back(pair); + } + } + } + template void fillTable(const PiNucandidate& piNucand, const Tcoll& collision) { @@ -971,12 +1079,21 @@ struct PiNucleiFemto { auto v0hyper = V0Hypers.rawIteratorAt(trackPair.tr1Idx); auto piTrack = piTracks.rawIteratorAt(trackPair.tr0Idx); - // auto collBracket = trackPair.collBracket; + //auto collBracket = trackPair.collBracket; PiNucandidate piNucand; if (!fillCandidateInfoHyper(v0hyper, piTrack, piNucand, isMixedEvent)) { continue; } + mQaRegistry.fill(HIST("hNuPt"), piNucand.recoPtNu()); + mQaRegistry.fill(HIST("hPiPt"), piNucand.recoPtPi()); + mQaRegistry.fill(HIST("hNuEta"), piNucand.recoEtaNu()); + mQaRegistry.fill(HIST("hPiEta"), piNucand.recoEtaPi()); + mQaRegistry.fill(HIST("hNuPhi"), piNucand.recoPhiNu()); + mQaRegistry.fill(HIST("hPiPhi"), piNucand.recoPhiPi()); + mQaRegistry.fill(HIST("hNuPitInvMass"), piNucand.invMass); + mQaRegistry.fill(HIST("hNClsPiITS"), piNucand.nClsItsPi); + mQaRegistry.fill(HIST("hisBkgEM"), piNucand.isBkgEM); auto collision = collisions.rawIteratorAt(piNucand.collisionID); @@ -1021,6 +1138,7 @@ struct PiNucleiFemto { { mGoodCollisions.clear(); mGoodCollisions.resize(collisions.size(), false); + //LOG(info) << "Number of hyperCandidates read = " << V0Hypers.size(); for (const auto& collision : collisions) { @@ -1033,7 +1151,7 @@ struct PiNucleiFemto { mGoodCollisions[collision.globalIndex()] = true; const uint64_t collIdx = collision.globalIndex(); auto trackTableThisCollision = pitracks.sliceBy(mPerCol, collIdx); - auto hypdTableThisCollision = V0Hypers.sliceBy(hypPerCol, collIdx); + auto hypdTableThisCollision = V0Hypers.sliceBy(hypPerCol, collIdx); trackTableThisCollision.bindExternalIndices(&pitracks); hypdTableThisCollision.bindExternalIndices(&V0Hypers); @@ -1043,7 +1161,7 @@ struct PiNucleiFemto { continue; } - fillPairsHyper(collisions, pitracks, V0Hypers, /*isMixedEvent*/ false); + fillPairsHyper(collisions, pitracks, V0Hypers,/*isMixedEvent*/ false); } } PROCESS_SWITCH(PiNucleiFemto, processSameEventHyper, "Process Same event", false); @@ -1068,6 +1186,75 @@ struct PiNucleiFemto { fillPairs(collisions, tracks, /*isMixedEvent*/ true); } PROCESS_SWITCH(PiNucleiFemto, processMixedEvent, "Process Mixed event", false); + + /*void processMixedEventHyper(const CollisionsFull& collisions, o2::aod::DataHypCandsWColl const& V0Hypers, const TrackCandidates& pitracks) + { + LOG(debug) << "Processing mixed event for hypertriton"; + mTrackHypPairs.clear(); + + for (const auto& [c1, tracks1, c2, V0Hypers2] : hyperPair) { + if (!c1.sel8() || !c2.sel8()) { + continue; + } + + mQaRegistry.fill(HIST("hNcontributor"), c2.numContrib()); + //mQaRegistry.fill(HIST("hCentrality"), c2.centFT0C()); + mQaRegistry.fill(HIST("hVtxZ"), c2.posZ()); + + pairHyperEventMixing(tracks1, V0Hypers2); + } + + fillPairsHyper(collisions, pitracks, V0Hypers,/*isMixedEvent*/ /*false); + } + PROCESS_SWITCH(PiNucleiFemto, processMixedEventHyper, "Process Mixed event", false);*/ + + void processMixedEventHyperPool(const CollisionsFull& collisions, o2::aod::DataHypCandsWColl const& V0Hypers, const TrackCandidates& pitracks) + { + LOG(info) << "Processing mixed event for hypertriton"; + + mTrackHypPairs.clear(); + if (!isInitialized) { + initializePools(); + LOG(info) << "Initialized event pool with size = " << All_Event_pool.size(); + } + for (auto const& collision : collisions) { + int poolIndexPi = where_pool(collision.posZ(), collision.centFT0C()); + auto& pool = All_Event_pool[poolIndexPi]; + + if (poolIndexPi < 0 || poolIndexPi >= All_Event_pool.size()) { + continue; + } + + for (auto const& storedEvent : pool.events) { + auto c1 = collisions.iteratorAt(storedEvent.collisionId); + const auto& c2 = collision; + if (!c1.sel8() || !c2.sel8()) continue; + + std::vector tracks1; + for (auto const& t : pitracks) { + if (t.collisionId() == c1.globalIndex()) { + tracks1.push_back(t); + } + } + + std::vector hypers2; + for (auto const& h : V0Hypers) { + if (h.collisionId() != c2.globalIndex()) continue; + int poolIndexHyp = where_pool(h.zPrimVtx(), h.centralityFT0C()); + if (poolIndexHyp != poolIndexPi) continue; + hypers2.push_back(h); + } + pairHyperEventMixing(tracks1, hypers2); + } + fillPairsHyper(collisions, pitracks, V0Hypers,/*isMixedEvent*/ true); + + if (static_cast(pool.events.size()) >= settingNoMixedEvents) { + pool.events.pop_front(); + } + pool.events.push_back({collision.globalIndex()}); + } + } + PROCESS_SWITCH(PiNucleiFemto, processMixedEventHyperPool, "Process Mixed event", false); }; WorkflowSpec defineDataProcessing(const ConfigContext& cfgc) From 4ef74b46ad3f316474ee2dcd739742294f1ee64a Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 17 Sep 2025 08:34:46 +0000 Subject: [PATCH 2/6] Please consider the following formatting changes --- .../TableProducer/PiNucleiFemto.cxx | 183 +++++++++--------- 1 file changed, 95 insertions(+), 88 deletions(-) diff --git a/PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx b/PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx index 8821d042251..2db05c76406 100644 --- a/PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx +++ b/PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx @@ -210,7 +210,7 @@ struct PiNucleiFemto { BinningType binningPolicy{{axisVertex, axisCentrality}, true}; SliceCache cache; SameKindPair mPair{binningPolicy, settingNoMixedEvents, -1, &cache}; - //Pair hyperPair{binningPolicy, settingNoMixedEvents, -1, &cache}; + // Pair hyperPair{binningPolicy, settingNoMixedEvents, -1, &cache}; std::array mBBparamsDe; @@ -273,12 +273,11 @@ struct PiNucleiFemto { false, true}; - int numOfCentBins = 40; int numOfVertexZBins = 30; float Vz_low = -10.0f; float Vz_high = 10.0f; - float Vz_step = (Vz_high - Vz_low) / numOfVertexZBins; + float Vz_step = (Vz_high - Vz_low) / numOfVertexZBins; struct EventRef { int64_t collisionId; @@ -300,17 +299,21 @@ struct PiNucleiFemto { isInitialized = true; } - int where_pool(float vz, float v0Centr) const + int where_pool(float vz, float v0Centr) const { float CentBinWidth = 100.0 / numOfCentBins; // = 2.5 int iy = static_cast(std::floor(v0Centr / CentBinWidth)); - if (iy < 0) iy = 0; - if (iy >= numOfCentBins) iy = numOfCentBins - 1; + if (iy < 0) + iy = 0; + if (iy >= numOfCentBins) + iy = numOfCentBins - 1; int ix = static_cast(std::floor((vz - Vz_low) / Vz_step)); - if (ix < 0) ix = 0; - if (ix >= numOfVertexZBins) ix = numOfVertexZBins - 1; + if (ix < 0) + ix = 0; + if (ix >= numOfVertexZBins) + ix = numOfVertexZBins - 1; int bin = ix + numOfVertexZBins * iy; return bin; @@ -557,16 +560,16 @@ struct PiNucleiFemto { bool selectionPIDHyper(const aod::DataHypCandsWColl::iterator& V0Hyper) { - mQaRegistry.fill(HIST("hHe3P_preselected"), V0Hyper.tpcMomHe()); - float averClusSizeHe = averageClusterSizeCosl(V0Hyper.itsClusterSizesHe(), V0Hyper.etaHe3()); - if (averClusSizeHe <= 4) { + mQaRegistry.fill(HIST("hHe3P_preselected"), V0Hyper.tpcMomHe()); + float averClusSizeHe = averageClusterSizeCosl(V0Hyper.itsClusterSizesHe(), V0Hyper.etaHe3()); + if (averClusSizeHe <= 4) { return false; } - if (V0Hyper.tpcChi2He() <= 0.5) { + if (V0Hyper.tpcChi2He() <= 0.5) { return false; } - mQaRegistry.fill(HIST("hHe3P"), V0Hyper.tpcMomHe()); - mQaRegistry.fill(HIST("hHe3TPCnsigma"), V0Hyper.nSigmaHe()); + mQaRegistry.fill(HIST("hHe3P"), V0Hyper.tpcMomHe()); + mQaRegistry.fill(HIST("hHe3TPCnsigma"), V0Hyper.nSigmaHe()); return true; } @@ -689,22 +692,22 @@ struct PiNucleiFemto { bool fillCandidateInfoHyper(const aod::DataHypCandsWColl::iterator& V0Hyper, const Ttrack& trackPi, PiNucandidate& piHypercand, bool isMixedEvent) { piHypercand.collisionID = V0Hyper.collisionId(); - //get hypertriton information - //constexpr double mHe3 = o2::constants::physics::MassHelium3; - //constexpr double mPi = o2::constants::physics::MassPiPlus; - // --- He3 + // get hypertriton information + // constexpr double mHe3 = o2::constants::physics::MassHelium3; + // constexpr double mPi = o2::constants::physics::MassPiPlus; + // --- He3 float pxHe3 = V0Hyper.ptHe3() * std::cos(V0Hyper.phiHe3()); float pyHe3 = V0Hyper.ptHe3() * std::sin(V0Hyper.phiHe3()); float pzHe3 = V0Hyper.ptHe3() * std::sinh(V0Hyper.etaHe3()); - //float pHe3 = V0Hyper.ptHe3() * std::cosh(V0Hyper.etaHe3()); - //float enHe3 = std::sqrt(pHe3 * pHe3 + mHe3 * mHe3); - // --- pi + // float pHe3 = V0Hyper.ptHe3() * std::cosh(V0Hyper.etaHe3()); + // float enHe3 = std::sqrt(pHe3 * pHe3 + mHe3 * mHe3); + // --- pi float pxPi = V0Hyper.ptPi() * std::cos(V0Hyper.phiPi()); float pyPi = V0Hyper.ptPi() * std::sin(V0Hyper.phiPi()); float pzPi = V0Hyper.ptPi() * std::sinh(V0Hyper.etaPi()); - //float pPi = V0Hyper.ptPi() * std::cosh(V0Hyper.etaPi()); - //float enPi = std::sqrt(pPi * pPi + mPi * mPi); - // --- hypertriton + // float pPi = V0Hyper.ptPi() * std::cosh(V0Hyper.etaPi()); + // float enPi = std::sqrt(pPi * pPi + mPi * mPi); + // --- hypertriton float px = pxHe3 + pxPi; float py = pyHe3 + pyPi; float pz = pzHe3 + pzPi; @@ -722,12 +725,12 @@ struct PiNucleiFemto { } piHypercand.signPi = trackPi.sign(); - if(V0Hyper.isMatter()){ + if (V0Hyper.isMatter()) { piHypercand.signNu = 1; - }else{ + } else { piHypercand.signNu = -1; } - + piHypercand.dcaxyPi = trackPi.dcaXY(); piHypercand.dcazPi = trackPi.dcaZ(); piHypercand.tpcSignalPi = trackPi.tpcSignal(); @@ -804,30 +807,30 @@ struct PiNucleiFemto { void pairTracksSameEventHyper(const Ttrack& piTracks, const Thypers& V0Hypers) { for (const auto& V0Hyper : V0Hypers) { - if (!selectionPIDHyper(V0Hyper)) { + if (!selectionPIDHyper(V0Hyper)) { + continue; + } + for (const auto& piTrack : piTracks) { + + mQaRegistry.fill(HIST("hTrackSel"), Selections::kNoCuts); + + if (!selectTrack(piTrack)) { continue; } - for (const auto& piTrack : piTracks) { - - mQaRegistry.fill(HIST("hTrackSel"), Selections::kNoCuts); - - if (!selectTrack(piTrack)) { - continue; - } - mQaRegistry.fill(HIST("hTrackSel"), Selections::kTrackCuts); - - if (!selectionPIDPion(piTrack)) { - continue; - } - mQaRegistry.fill(HIST("hTrackSel"), Selections::kPID); - - SVCand pair; - pair.tr0Idx = piTrack.globalIndex(); - pair.tr1Idx = V0Hyper.globalIndex(); - const int collIdx = V0Hyper.collisionId(); - CollBracket collBracket{collIdx, collIdx}; - pair.collBracket = collBracket; - mTrackHypPairs.push_back(pair); + mQaRegistry.fill(HIST("hTrackSel"), Selections::kTrackCuts); + + if (!selectionPIDPion(piTrack)) { + continue; + } + mQaRegistry.fill(HIST("hTrackSel"), Selections::kPID); + + SVCand pair; + pair.tr0Idx = piTrack.globalIndex(); + pair.tr1Idx = V0Hyper.globalIndex(); + const int collIdx = V0Hyper.collisionId(); + CollBracket collBracket{collIdx, collIdx}; + pair.collBracket = collBracket; + mTrackHypPairs.push_back(pair); } } } @@ -1079,7 +1082,7 @@ struct PiNucleiFemto { auto v0hyper = V0Hypers.rawIteratorAt(trackPair.tr1Idx); auto piTrack = piTracks.rawIteratorAt(trackPair.tr0Idx); - //auto collBracket = trackPair.collBracket; + // auto collBracket = trackPair.collBracket; PiNucandidate piNucand; if (!fillCandidateInfoHyper(v0hyper, piTrack, piNucand, isMixedEvent)) { @@ -1138,7 +1141,7 @@ struct PiNucleiFemto { { mGoodCollisions.clear(); mGoodCollisions.resize(collisions.size(), false); - //LOG(info) << "Number of hyperCandidates read = " << V0Hypers.size(); + // LOG(info) << "Number of hyperCandidates read = " << V0Hypers.size(); for (const auto& collision : collisions) { @@ -1151,7 +1154,7 @@ struct PiNucleiFemto { mGoodCollisions[collision.globalIndex()] = true; const uint64_t collIdx = collision.globalIndex(); auto trackTableThisCollision = pitracks.sliceBy(mPerCol, collIdx); - auto hypdTableThisCollision = V0Hypers.sliceBy(hypPerCol, collIdx); + auto hypdTableThisCollision = V0Hypers.sliceBy(hypPerCol, collIdx); trackTableThisCollision.bindExternalIndices(&pitracks); hypdTableThisCollision.bindExternalIndices(&V0Hypers); @@ -1161,7 +1164,7 @@ struct PiNucleiFemto { continue; } - fillPairsHyper(collisions, pitracks, V0Hypers,/*isMixedEvent*/ false); + fillPairsHyper(collisions, pitracks, V0Hypers, /*isMixedEvent*/ false); } } PROCESS_SWITCH(PiNucleiFemto, processSameEventHyper, "Process Same event", false); @@ -1204,9 +1207,10 @@ struct PiNucleiFemto { pairHyperEventMixing(tracks1, V0Hypers2); } - fillPairsHyper(collisions, pitracks, V0Hypers,/*isMixedEvent*/ /*false); - } - PROCESS_SWITCH(PiNucleiFemto, processMixedEventHyper, "Process Mixed event", false);*/ + fillPairsHyper(collisions, pitracks, V0Hypers,/*isMixedEvent*/ + /*false); +} +PROCESS_SWITCH(PiNucleiFemto, processMixedEventHyper, "Process Mixed event", false);*/ void processMixedEventHyperPool(const CollisionsFull& collisions, o2::aod::DataHypCandsWColl const& V0Hypers, const TrackCandidates& pitracks) { @@ -1214,44 +1218,47 @@ struct PiNucleiFemto { mTrackHypPairs.clear(); if (!isInitialized) { - initializePools(); - LOG(info) << "Initialized event pool with size = " << All_Event_pool.size(); + initializePools(); + LOG(info) << "Initialized event pool with size = " << All_Event_pool.size(); } - for (auto const& collision : collisions) { - int poolIndexPi = where_pool(collision.posZ(), collision.centFT0C()); - auto& pool = All_Event_pool[poolIndexPi]; + for (auto const& collision : collisions) { + int poolIndexPi = where_pool(collision.posZ(), collision.centFT0C()); + auto& pool = All_Event_pool[poolIndexPi]; - if (poolIndexPi < 0 || poolIndexPi >= All_Event_pool.size()) { - continue; - } + if (poolIndexPi < 0 || poolIndexPi >= All_Event_pool.size()) { + continue; + } - for (auto const& storedEvent : pool.events) { - auto c1 = collisions.iteratorAt(storedEvent.collisionId); - const auto& c2 = collision; - if (!c1.sel8() || !c2.sel8()) continue; - - std::vector tracks1; - for (auto const& t : pitracks) { - if (t.collisionId() == c1.globalIndex()) { - tracks1.push_back(t); - } - } - - std::vector hypers2; - for (auto const& h : V0Hypers) { - if (h.collisionId() != c2.globalIndex()) continue; - int poolIndexHyp = where_pool(h.zPrimVtx(), h.centralityFT0C()); - if (poolIndexHyp != poolIndexPi) continue; - hypers2.push_back(h); - } - pairHyperEventMixing(tracks1, hypers2); + for (auto const& storedEvent : pool.events) { + auto c1 = collisions.iteratorAt(storedEvent.collisionId); + const auto& c2 = collision; + if (!c1.sel8() || !c2.sel8()) + continue; + + std::vector tracks1; + for (auto const& t : pitracks) { + if (t.collisionId() == c1.globalIndex()) { + tracks1.push_back(t); } - fillPairsHyper(collisions, pitracks, V0Hypers,/*isMixedEvent*/ true); + } - if (static_cast(pool.events.size()) >= settingNoMixedEvents) { - pool.events.pop_front(); + std::vector hypers2; + for (auto const& h : V0Hypers) { + if (h.collisionId() != c2.globalIndex()) + continue; + int poolIndexHyp = where_pool(h.zPrimVtx(), h.centralityFT0C()); + if (poolIndexHyp != poolIndexPi) + continue; + hypers2.push_back(h); } - pool.events.push_back({collision.globalIndex()}); + pairHyperEventMixing(tracks1, hypers2); + } + fillPairsHyper(collisions, pitracks, V0Hypers, /*isMixedEvent*/ true); + + if (static_cast(pool.events.size()) >= settingNoMixedEvents) { + pool.events.pop_front(); + } + pool.events.push_back({collision.globalIndex()}); } } PROCESS_SWITCH(PiNucleiFemto, processMixedEventHyperPool, "Process Mixed event", false); From 007bfe097d108c24cf3ebdcbd8e7a130b93ac8c5 Mon Sep 17 00:00:00 2001 From: blacwovie Date: Wed, 17 Sep 2025 16:42:41 +0800 Subject: [PATCH 3/6] Update PiNucleiFemto.cxx --- PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx | 1 + 1 file changed, 1 insertion(+) diff --git a/PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx b/PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx index 2db05c76406..73006efebdd 100644 --- a/PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx +++ b/PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx @@ -66,6 +66,7 @@ #include // std::prev #include #include +#include using namespace o2; using namespace o2::framework; From 52ddf740d0c9b9c88a57b65e1863347d8b0e5f19 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Wed, 17 Sep 2025 08:43:14 +0000 Subject: [PATCH 4/6] Please consider the following formatting changes --- PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx b/PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx index 73006efebdd..f6dfec63bbf 100644 --- a/PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx +++ b/PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx @@ -63,10 +63,10 @@ #include #include #include +#include #include // std::prev #include #include -#include using namespace o2; using namespace o2::framework; From 4b014bd566fa5e51b1407eb0ab577614352c5894 Mon Sep 17 00:00:00 2001 From: blacwovie Date: Thu, 18 Sep 2025 11:25:37 +0800 Subject: [PATCH 5/6] Update PiNucleiFemto.cxx --- PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx b/PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx index f6dfec63bbf..4bbbb0e2561 100644 --- a/PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx +++ b/PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx @@ -1207,9 +1207,6 @@ struct PiNucleiFemto { pairHyperEventMixing(tracks1, V0Hypers2); } - - fillPairsHyper(collisions, pitracks, V0Hypers,/*isMixedEvent*/ - /*false); } PROCESS_SWITCH(PiNucleiFemto, processMixedEventHyper, "Process Mixed event", false);*/ @@ -1225,8 +1222,8 @@ PROCESS_SWITCH(PiNucleiFemto, processMixedEventHyper, "Process Mixed event", fal for (auto const& collision : collisions) { int poolIndexPi = where_pool(collision.posZ(), collision.centFT0C()); auto& pool = All_Event_pool[poolIndexPi]; - - if (poolIndexPi < 0 || poolIndexPi >= All_Event_pool.size()) { + + if (poolIndexPi < 0 || static_cast(poolIndexPi) >= All_Event_pool.size()) { continue; } From 726fcf99e33429437fbf2cc7fd5500781a981992 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 18 Sep 2025 03:26:08 +0000 Subject: [PATCH 6/6] Please consider the following formatting changes --- PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx b/PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx index 4bbbb0e2561..7cb1864593e 100644 --- a/PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx +++ b/PWGCF/Femto/FemtoNuclei/TableProducer/PiNucleiFemto.cxx @@ -1222,7 +1222,7 @@ PROCESS_SWITCH(PiNucleiFemto, processMixedEventHyper, "Process Mixed event", fal for (auto const& collision : collisions) { int poolIndexPi = where_pool(collision.posZ(), collision.centFT0C()); auto& pool = All_Event_pool[poolIndexPi]; - + if (poolIndexPi < 0 || static_cast(poolIndexPi) >= All_Event_pool.size()) { continue; }