From cee98f6d0609a0b9ce42f3708c75001a8789a056 Mon Sep 17 00:00:00 2001 From: Gleb Romanenko Date: Fri, 30 Oct 2026 15:53:22 +0100 Subject: [PATCH 1/4] adding TPC rejection cut --- PWGCF/Femto3D/Tasks/femto3dPairTask.cxx | 14 +++++++++----- PWGCF/Femto3D/Tasks/femto3dQA.cxx | 12 ++++++++---- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx b/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx index 4d08256aa4b..034a8dcf461 100644 --- a/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx +++ b/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx @@ -94,8 +94,9 @@ struct FemtoCorrelations { Configurable> _tofNSigma_2{"tofNSigma_2", std::vector{-3.0f, 3.0f}, "second particle PID: Nsigma range in TOF"}; Configurable> _tpcNSigmaResidual_2{"tpcNSigmaResidual_2", std::vector{-5.0f, 5.0f}, "second particle PID: residual TPC Nsigma cut to use with the TOF"}; - Configurable _particlePDGtoReject{"particlePDGtoRejectFromSecond", 0, "applied only if the particles are non-identical and only to the second particle in the pair!!!"}; - Configurable> _rejectWithinNsigmaTOF{"rejectWithinNsigmaTOF", std::vector{-0.0f, 0.0f}, "TOF rejection Nsigma range for the particle specified with PDG to be rejected"}; + Configurable _particlePDGtoReject{"particlePDGtoRejectFromFirst", 211, "if the particles are non-identical then applied only to the first"}; + Configurable _rejectWithinNsigmaTPC{"rejectWithinNsigmaTPC", 0.0, "TPC rejection Nsigma abs range for the particle specified with PDG to be rejected"}; + Configurable _rejectWithinNsigmaTOF{"rejectWithinNsigmaTOF", 0.0, "TOF rejection Nsigma abs range for the particle specified with PDG to be rejected"}; Configurable _dPhiMode{"dPhiMode", 0, "Flag to choose how to calc. dphi*: 0 - at a fixed TPC radius; 1 - average over different TPC radii;"}; Configurable _radiusTPC{"radiusTPC", 1.2, "TPC radius to calculate phi_star for"}; @@ -356,8 +357,8 @@ struct FemtoCorrelations { if (_fill3dCF && multBin > SEhistos_3D.size()) LOGF(fatal, "multBin value passed to the mixTracks function exceeds the configured number of Cent. bins (3D)"); - for (const auto& ii : tracks1) { - for (const auto& iii : tracks2) { + for (auto ii : tracks1) { + for (auto iii : tracks2) { Pair->SetPair(ii, iii); float pair_kT = Pair->GetKt(); @@ -450,6 +451,9 @@ struct FemtoCorrelations { continue; if (track.sign() == _sign_1 && (track.p() < _PIDtrshld_1 ? o2::aod::singletrackselector::TPCselection(track, TPCcuts_1, _itsNSigma_1.value) : o2::aod::singletrackselector::TOFselection(track, TOFcuts_1, _tpcNSigmaResidual_1.value))) { // filling the map: eventID <-> selected particles1 + if ((_rejectWithinNsigmaTPC != 0.0 && std::fabs(o2::aod::singletrackselector::getTPCNsigma(track, _particlePDGtoReject)) < _rejectWithinNsigmaTPC) || (_rejectWithinNsigmaTOF != 0.0 && std::fabs(o2::aod::singletrackselector::getTOFNsigma(track, _particlePDGtoReject)) < _rejectWithinNsigmaTOF)) + continue; + selectedtracks_1[track.singleCollSelId()].push_back(std::make_shared::iterator>(track)); pHisto_first->Fill(track.p()); @@ -460,7 +464,7 @@ struct FemtoCorrelations { if (IsIdentical) { continue; - } else if (track.sign() != _sign_2 && !TOFselection(track, std::make_pair(_particlePDGtoReject, _rejectWithinNsigmaTOF)) && (track.p() < _PIDtrshld_2 ? o2::aod::singletrackselector::TPCselection(track, TPCcuts_2, _itsNSigma_2.value) : o2::aod::singletrackselector::TOFselection(track, TOFcuts_2, _tpcNSigmaResidual_2.value))) { // filling the map: eventID <-> selected particles2 if (see condition above ^) + } else if (track.sign() != _sign_2 && (track.p() < _PIDtrshld_2 ? o2::aod::singletrackselector::TPCselection(track, TPCcuts_2, _itsNSigma_2.value) : o2::aod::singletrackselector::TOFselection(track, TOFcuts_2, _tpcNSigmaResidual_2.value))) { // filling the map: eventID <-> selected particles2 if (see condition above ^) selectedtracks_2[track.singleCollSelId()].push_back(std::make_shared::iterator>(track)); pHisto_second->Fill(track.p()); diff --git a/PWGCF/Femto3D/Tasks/femto3dQA.cxx b/PWGCF/Femto3D/Tasks/femto3dQA.cxx index e55cd3c73ed..5e218e1a938 100644 --- a/PWGCF/Femto3D/Tasks/femto3dQA.cxx +++ b/PWGCF/Femto3D/Tasks/femto3dQA.cxx @@ -75,15 +75,16 @@ struct QAHistograms { Configurable _tpcFractionSharedCls{"maxTpcFractionSharedCls", 0.4, "maximum fraction of TPC shared clasters"}; Configurable _itsNCls{"minItsNCls", 0, "minimum allowed number of ITS clasters for a track"}; Configurable _itsChi2NCl{"itsChi2NCl", 100.0, "upper limit for chi2 value of a fit over ITS clasters for a track"}; - Configurable _particlePDG{"particlePDG", 2212, "PDG code of a particle to perform PID for (only pion, kaon, proton and deurton are supported now)"}; + Configurable _particlePDG{"particlePDG", 2212, "PDG code of a particle to perform PID for"}; Configurable> _tpcNSigma{"tpcNSigma", std::vector{-4.0f, 4.0f}, "Nsigma range in TPC before the TOF is used"}; Configurable> _itsNSigma{"itsNSigma", std::vector{-10.0f, 10.0f}, "Nsigma range in ITS to use along with TPC"}; Configurable _PIDtrshld{"PIDtrshld", 10.0, "value of momentum from which the PID is done with TOF (before that only TPC is used)"}; Configurable> _tofNSigma{"tofNSigma", std::vector{-4.0f, 4.0f}, "Nsigma range in TOF"}; Configurable> _tpcNSigmaResidual{"tpcNSigmaResidual", std::vector{-5.0f, 5.0f}, "residual TPC Nsigma cut to use with the TOF"}; - Configurable _particlePDGtoReject{"particlePDGtoReject", 211, "PDG codes of perticles that will be rejected with TOF (only pion, kaon, proton and deurton are supported now)"}; - Configurable> _rejectWithinNsigmaTOF{"rejectWithinNsigmaTOF", std::vector{-0.0f, 0.0f}, "TOF rejection Nsigma range for particles specified with PDG to be rejected"}; + Configurable _particlePDGtoReject{"particlePDGtoReject", 211, "PDG codes of particles that will be rejected with TPC and/or TOF"}; + Configurable _rejectWithinNsigmaTPC{"rejectWithinNsigmaTPC", 0.0, "TPC rejection Nsigma abs for particles specified with PDG to be rejected"}; + Configurable _rejectWithinNsigmaTOF{"rejectWithinNsigmaTOF", 0.0, "TOF rejection Nsigma abs for particles specified with PDG to be rejected"}; Configurable> _centCut{"centCut", std::pair{0.f, 100.f}, "[min., max.] centrality range to keep tracks within"}; @@ -235,7 +236,10 @@ struct QAHistograms { registry.fill(HIST("TOFSignal_nocuts"), track.p(), track.beta()); } - if (!TOFselection(track, std::make_pair(_particlePDGtoReject, _rejectWithinNsigmaTOF)) && (track.p() < _PIDtrshld ? o2::aod::singletrackselector::TPCselection(track, TPCcuts, _itsNSigma.value) : o2::aod::singletrackselector::TOFselection(track, TOFcuts, _tpcNSigmaResidual.value))) { + if (track.p() < _PIDtrshld ? o2::aod::singletrackselector::TPCselection(track, TPCcuts, _itsNSigma.value) : o2::aod::singletrackselector::TOFselection(track, TOFcuts, _tpcNSigmaResidual.value)) { + if ((_rejectWithinNsigmaTPC != 0.0 && std::fabs(o2::aod::singletrackselector::getTPCNsigma(track, _particlePDGtoReject)) < _rejectWithinNsigmaTPC) || (_rejectWithinNsigmaTOF != 0.0 && std::fabs(o2::aod::singletrackselector::getTOFNsigma(track, _particlePDGtoReject)) < _rejectWithinNsigmaTOF)) + continue; + registry.fill(HIST("eta"), track.eta()); registry.fill(HIST("phi"), track.phi()); registry.fill(HIST("px"), track.px()); From 18648010d2ead745cd166f8a99e167d58c23cf7d Mon Sep 17 00:00:00 2001 From: Gleb Romanenko Date: Fri, 30 Oct 2026 16:00:56 +0100 Subject: [PATCH 2/4] adding TPC rejection cut --- PWGCF/Femto3D/Tasks/femto3dPairTask.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx b/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx index 034a8dcf461..c5062b28dda 100644 --- a/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx +++ b/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx @@ -357,8 +357,8 @@ struct FemtoCorrelations { if (_fill3dCF && multBin > SEhistos_3D.size()) LOGF(fatal, "multBin value passed to the mixTracks function exceeds the configured number of Cent. bins (3D)"); - for (auto ii : tracks1) { - for (auto iii : tracks2) { + for (const auto& ii : tracks1) { + for (const auto& iii : tracks2) { Pair->SetPair(ii, iii); float pair_kT = Pair->GetKt(); @@ -453,7 +453,7 @@ struct FemtoCorrelations { if (track.sign() == _sign_1 && (track.p() < _PIDtrshld_1 ? o2::aod::singletrackselector::TPCselection(track, TPCcuts_1, _itsNSigma_1.value) : o2::aod::singletrackselector::TOFselection(track, TOFcuts_1, _tpcNSigmaResidual_1.value))) { // filling the map: eventID <-> selected particles1 if ((_rejectWithinNsigmaTPC != 0.0 && std::fabs(o2::aod::singletrackselector::getTPCNsigma(track, _particlePDGtoReject)) < _rejectWithinNsigmaTPC) || (_rejectWithinNsigmaTOF != 0.0 && std::fabs(o2::aod::singletrackselector::getTOFNsigma(track, _particlePDGtoReject)) < _rejectWithinNsigmaTOF)) continue; - + selectedtracks_1[track.singleCollSelId()].push_back(std::make_shared::iterator>(track)); pHisto_first->Fill(track.p()); From 8cdec27e10a6c81c6b7619d3f7be2a7f458ebb3b Mon Sep 17 00:00:00 2001 From: Gleb Romanenko Date: Fri, 30 Oct 2026 16:22:48 +0100 Subject: [PATCH 3/4] fix megalinter --- PWGCF/Femto3D/Tasks/femto3dPairTask.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx b/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx index c5062b28dda..8416440be59 100644 --- a/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx +++ b/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx @@ -123,7 +123,7 @@ struct FemtoCorrelations { // P.P.P.P.S this way is still being testing i might be reconsidered; might change in the future, keep looking at the source code Configurable _MEreductionFactor{"MEreductionFactor", 1, "only one (pseudo)randomly choosen event out per pair $value events will be processed and contribute to the final mixing (if < 2 -> all the possible event pairs (per vertex¢ bin) will be processed); implemented for the sake of efficiency; look at the source code;"}; - bool IsIdentical; + bool IsIdentical = false; std::pair> TPCcuts_1; std::pair> TOFcuts_1; @@ -259,7 +259,7 @@ struct FemtoCorrelations { } if (_fillDetaDphi > -1) { - TString suffix[] = {"_nocut", "_cut"}; + TString suffix[2] = {"_nocut", "_cut"}; for (int f = 0; f < 2; f++) { std::vector> DoubleTrack_SE_histos_perMult; From 81b386f401582e839e1824c108fe2c467bc8364f Mon Sep 17 00:00:00 2001 From: Gleb Romanenko Date: Fri, 30 Oct 2026 16:30:36 +0100 Subject: [PATCH 4/4] fix megalinter2 --- PWGCF/Femto3D/Tasks/femto3dPairTask.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx b/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx index 8416440be59..0d29ebf334f 100644 --- a/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx +++ b/PWGCF/Femto3D/Tasks/femto3dPairTask.cxx @@ -123,7 +123,7 @@ struct FemtoCorrelations { // P.P.P.P.S this way is still being testing i might be reconsidered; might change in the future, keep looking at the source code Configurable _MEreductionFactor{"MEreductionFactor", 1, "only one (pseudo)randomly choosen event out per pair $value events will be processed and contribute to the final mixing (if < 2 -> all the possible event pairs (per vertex¢ bin) will be processed); implemented for the sake of efficiency; look at the source code;"}; - bool IsIdentical = false; + bool IsIdentical = true; std::pair> TPCcuts_1; std::pair> TOFcuts_1; @@ -259,7 +259,7 @@ struct FemtoCorrelations { } if (_fillDetaDphi > -1) { - TString suffix[2] = {"_nocut", "_cut"}; + const TString suffix[2] = {"_nocut", "_cut"}; for (int f = 0; f < 2; f++) { std::vector> DoubleTrack_SE_histos_perMult;