From 3b925f1b0e630f09f70ef5c67c6e917e894441e8 Mon Sep 17 00:00:00 2001 From: skundu692 Date: Tue, 17 Dec 2024 18:55:50 +0100 Subject: [PATCH 1/2] Add TPC PID info in f1 table + momentum dependent PID cut for f1 daughters + improved rotational background --- PWGLF/DataModel/ReducedF1ProtonTables.h | 4 + .../Resonances/f1protonreducedtable.cxx | 12 ++- .../Tasks/Resonances/f1protoncorrelation.cxx | 95 ++++++++++++++----- 3 files changed, 87 insertions(+), 24 deletions(-) diff --git a/PWGLF/DataModel/ReducedF1ProtonTables.h b/PWGLF/DataModel/ReducedF1ProtonTables.h index e7534204f54..0f5576a2eb9 100644 --- a/PWGLF/DataModel/ReducedF1ProtonTables.h +++ b/PWGLF/DataModel/ReducedF1ProtonTables.h @@ -60,6 +60,8 @@ DECLARE_SOA_COLUMN(F1d3Py, f1d3Py, float); //! F DECLARE_SOA_COLUMN(F1d3Pz, f1d3Pz, float); //! F1 d3 Pz DECLARE_SOA_COLUMN(F1d1TOFHit, f1d1TOFHit, int); //! TOF hit pion DECLARE_SOA_COLUMN(F1d2TOFHit, f1d2TOFHit, int); //! TOF hit pion +DECLARE_SOA_COLUMN(F1d1TPC, f1d1TPC, float); //! TPC nsigma pion +DECLARE_SOA_COLUMN(F1d2TPC, f1d2TPC, float); //! TPC nsigma kaon DECLARE_SOA_COLUMN(F1Mass, f1Mass, float); //! F1 mass DECLARE_SOA_COLUMN(F1MassKaonKshort, f1MassKaonKshort, float); //! F1 mass kaon kshort DECLARE_SOA_COLUMN(F1PionIndex, f1PionIndex, int64_t); //! F1 pion index @@ -93,6 +95,8 @@ DECLARE_SOA_TABLE(F1Tracks, "AOD", "F1TRACK", f1protondaughter::F1d3Pz, f1protondaughter::F1d1TOFHit, f1protondaughter::F1d2TOFHit, + f1protondaughter::F1d1TPC, + f1protondaughter::F1d2TPC, f1protondaughter::F1Mass, f1protondaughter::F1MassKaonKshort, f1protondaughter::F1PionIndex, diff --git a/PWGLF/TableProducer/Resonances/f1protonreducedtable.cxx b/PWGLF/TableProducer/Resonances/f1protonreducedtable.cxx index 50eb1ba4ffd..324f2ed2b01 100644 --- a/PWGLF/TableProducer/Resonances/f1protonreducedtable.cxx +++ b/PWGLF/TableProducer/Resonances/f1protonreducedtable.cxx @@ -530,10 +530,14 @@ struct f1protonreducedtable { // keep TOF Hit of pion std::vector PionTOFHit = {}; std::vector PionTOFHitFinal = {}; + std::vector PionTPC = {}; + std::vector PionTPCFinal = {}; // keep TOF Hit of kaon std::vector KaonTOFHit = {}; std::vector KaonTOFHitFinal = {}; + std::vector KaonTPC = {}; + std::vector KaonTPCFinal = {}; // keep kaon-kshort mass of f1resonance std::vector f1kaonkshortmass = {}; @@ -618,9 +622,11 @@ struct f1protonreducedtable { auto PionTOF = 0; if (track.sign() > 0) { qaRegistry.fill(HIST("hNsigmaPtpionTPC"), nTPCSigmaP[0], track.pt()); + PionTPC.push_back(nTPCSigmaP[0]); } if (track.sign() < 0) { qaRegistry.fill(HIST("hNsigmaPtpionTPC"), nTPCSigmaN[0], track.pt()); + PionTPC.push_back(nTPCSigmaN[0]); } if (track.hasTOF()) { qaRegistry.fill(HIST("hNsigmaPtpionTOF"), track.tofNSigmaPi(), track.pt()); @@ -637,9 +643,11 @@ struct f1protonreducedtable { auto KaonTOF = 0; if (track.sign() > 0) { qaRegistry.fill(HIST("hNsigmaPtkaonTPC"), nTPCSigmaP[1], track.pt()); + KaonTPC.push_back(nTPCSigmaP[1]); } if (track.sign() < 0) { qaRegistry.fill(HIST("hNsigmaPtkaonTPC"), nTPCSigmaN[1], track.pt()); + KaonTPC.push_back(nTPCSigmaN[1]); } if (track.hasTOF()) { qaRegistry.fill(HIST("hNsigmaPtkaonTOF"), track.tofNSigmaKa(), track.pt()); @@ -742,6 +750,8 @@ struct f1protonreducedtable { F1KshortDaughterNegativeIndex.push_back(KshortNegDaughIndex.at(i3)); PionTOFHitFinal.push_back(PionTOFHit.at(i1)); // Pion TOF Hit KaonTOFHitFinal.push_back(KaonTOFHit.at(i2)); // Kaon TOF Hit + PionTPCFinal.push_back(PionTPC.at(i1)); // Pion TPC + KaonTPCFinal.push_back(KaonTPC.at(i2)); // Kaon TPC if (pairsign == 1) { qaRegistry.fill(HIST("hInvMassf1"), F1Vector.M(), F1Vector.Pt()); numberF1 = numberF1 + 1; @@ -798,7 +808,7 @@ struct f1protonreducedtable { F1d1dummy = f1resonanced1.at(i5); F1d2dummy = f1resonanced2.at(i5); F1d3dummy = f1resonanced3.at(i5); - f1track(indexEvent, f1signal.at(i5), F1VectorDummy.Px(), F1VectorDummy.Py(), F1VectorDummy.Pz(), F1d1dummy.Px(), F1d1dummy.Py(), F1d1dummy.Pz(), F1d2dummy.Px(), F1d2dummy.Py(), F1d2dummy.Pz(), F1d3dummy.Px(), F1d3dummy.Py(), F1d3dummy.Pz(), PionTOFHitFinal.at(i5), KaonTOFHitFinal.at(i5), F1VectorDummy.M(), f1kaonkshortmass.at(i5), F1PionIndex.at(i5), F1KaonIndex.at(i5), F1KshortDaughterPositiveIndex.at(i5), F1KshortDaughterNegativeIndex.at(i5)); + f1track(indexEvent, f1signal.at(i5), F1VectorDummy.Px(), F1VectorDummy.Py(), F1VectorDummy.Pz(), F1d1dummy.Px(), F1d1dummy.Py(), F1d1dummy.Pz(), F1d2dummy.Px(), F1d2dummy.Py(), F1d2dummy.Pz(), F1d3dummy.Px(), F1d3dummy.Py(), F1d3dummy.Pz(), PionTOFHitFinal.at(i5), KaonTOFHitFinal.at(i5), PionTPCFinal.at(i5), KaonTPCFinal.at(i5), F1VectorDummy.M(), f1kaonkshortmass.at(i5), F1PionIndex.at(i5), F1KaonIndex.at(i5), F1KshortDaughterPositiveIndex.at(i5), F1KshortDaughterNegativeIndex.at(i5)); } //// Fill track table for proton////////////////// for (auto iproton = protons.begin(); iproton != protons.end(); ++iproton) { diff --git a/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx b/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx index 31d72363498..5348bc46b6b 100644 --- a/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx +++ b/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx @@ -41,13 +41,16 @@ struct f1protoncorrelation { Configurable nsigmaCutCombined{"nsigmaCutCombined", 3.0, "Value of the TOF Nsigma cut"}; // PID selection Configurable fillRotation{"fillRotation", 1, "Fill rotation"}; + Configurable pdepPID{"pdepPID", 1, "Momentum dependent pi, k PID"}; Configurable strategyPIDPion{"strategyPIDPion", 0, "PID strategy Pion"}; Configurable strategyPIDKaon{"strategyPIDKaon", 0, "PID strategy Kaon"}; Configurable maxKKS0Mass{"maxKKS0Mass", 1.025, "Maximum kaon kshort mass"}; Configurable maxMomentumPion{"maxMomentumPion", 4.0, "Maximum momentum Pion"}; Configurable maxMomentumKaon{"maxMomentumKaon", 4.0, "Maximum momentum Kaon"}; - Configurable momentumTOFPion{"momentumTOFPion", 0.8, "Pion momentum TOF"}; - Configurable momentumTOFKaon{"momentumTOFKaon", 0.8, "Kaon momentum TOF"}; + Configurable momentumTOFPionMin{"momentumTOFPionMin", 0.8, "Pion momentum TOF Min"}; + Configurable momentumTOFKaonMin{"momentumTOFKaonMin", 0.8, "Kaon momentum TOF Min"}; + Configurable momentumTOFPionMax{"momentumTOFPionMax", 1.2, "Pion momentum TOF Max"}; + Configurable momentumTOFKaonMax{"momentumTOFKaonMax", 1.2, "Kaon momentum TOF Max"}; Configurable momentumTOFProton{"momentumTOFProton", 0.7, "Proton momentum TOF"}; Configurable lowPtF1{"lowPtF1", 1.0, "PT cut F1"}; // Event Mixing @@ -59,8 +62,10 @@ struct f1protoncorrelation { void init(o2::framework::InitContext&) { // register histograms - histos.add("hNsigmaProtonTPCSE", "Nsigma Proton TPC distribution same event", kTH2F, {{200, -10.0f, 10.0f}, {100, 0.0f, 1.0f}}); - histos.add("hNsigmaProtonTPCME", "Nsigma Proton TPC distribution mixed event", kTH2F, {{200, -10.0f, 10.0f}, {100, 0.0f, 1.0f}}); + histos.add("hNsigmaProtonTPC", "Nsigma Proton TPC distribution", kTH2F, {{100, -5.0f, 5.0f}, {100, 0.0f, 10.0f}}); + histos.add("hNsigmaKaonTPC", "Nsigma Kaon TPC distribution", kTH2F, {{100, -5.0f, 5.0f}, {100, 0.0f, 10.0f}}); + histos.add("hNsigmaPionTPC", "Nsigma Pion TPC distribution", kTH2F, {{100, -5.0f, 5.0f}, {100, 0.0f, 10.0f}}); + histos.add("hNsigmaPionKaonTPC", "Nsigma Pion Kaon TPC correlation", kTH2F, {{100, -5.0f, 5.0f}, {100, -5.0f, 5.0f}}); histos.add("h2SameEventPtCorrelation", "Pt correlation of F1 and proton", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {100, 0.0, 10.0}}); histos.add("h2SameEventInvariantMassUnlike_mass", "Unlike Sign Invariant mass of f1 same event", kTH3F, {{100, 0.0f, 1.0f}, {100, 0.0, 10.0}, {800, 1.0, 1.8}}); @@ -96,7 +101,7 @@ struct f1protoncorrelation { } TLorentzVector F1, Proton, F1ProtonPair, Pion, Kaon, Kshort; - TLorentzVector F1Rot, PionRot, KaonKshortPair; + TLorentzVector F1Rot, PionRot, KaonKshortPair, KaonKshortPairRot; // Process the data in same event void process(aod::RedF1PEvents::iterator const& /*collision*/, aod::F1Tracks const& f1tracks, aod::ProtonTracks const& protontracks) { @@ -109,15 +114,38 @@ struct f1protoncorrelation { Kaon.SetXYZM(f1track.f1d2Px(), f1track.f1d2Py(), f1track.f1d2Pz(), 0.493); Kshort.SetXYZM(f1track.f1d3Px(), f1track.f1d3Py(), f1track.f1d3Pz(), 0.497); KaonKshortPair = Kaon + Kshort; - if (Pion.P() > maxMomentumPion || Kaon.P() > maxMomentumKaon) { + if (Pion.Pt() > maxMomentumPion || Kaon.Pt() > maxMomentumKaon) { continue; } - if (strategyPIDPion == 1 && Pion.P() > momentumTOFPion && f1track.f1d1TOFHit() != 1) { + if (pdepPID) { + if (Kaon.Pt() <= 0.5 && (f1track.f1d2TPC() < -2.5 || f1track.f1d2TPC() > 2.5)) { + continue; + } + if (Kaon.Pt() > 0.5 && Kaon.Pt() <= 0.7 && (f1track.f1d2TPC() < -1.5 || f1track.f1d2TPC() > 2.5)) { + continue; + } + if (Kaon.Pt() > 0.7 && Kaon.Pt() <= 1.0 && (f1track.f1d2TPC() < -1.0 || f1track.f1d2TPC() > 2.5)) { + continue; + } + if (Kaon.Pt() > 1.0 && (f1track.f1d2TPC() < -2.0 || f1track.f1d2TPC() > 2.0)) { + continue; + } + if (Pion.Pt() < 2.0 && (f1track.f1d1TPC() < -2.5 || f1track.f1d1TPC() > 2.5)) { + continue; + } + if (Pion.Pt() > 2.0 && (f1track.f1d1TPC() < -2.0 || f1track.f1d1TPC() > 2.0)) { + continue; + } + } + if (strategyPIDPion == 1 && Pion.Pt() > momentumTOFPionMin && Pion.Pt() <= momentumTOFPionMax && f1track.f1d1TOFHit() != 1) { continue; } - if (strategyPIDKaon == 1 && Kaon.P() > momentumTOFKaon && f1track.f1d2TOFHit() != 1) { + if (strategyPIDKaon == 1 && Kaon.Pt() > momentumTOFKaonMin && Kaon.Pt() <= momentumTOFKaonMax && f1track.f1d2TOFHit() != 1) { continue; } + histos.fill(HIST("hNsigmaKaonTPC"), f1track.f1d2TPC(), Kaon.Pt()); + histos.fill(HIST("hNsigmaPionTPC"), f1track.f1d1TPC(), Pion.Pt()); + histos.fill(HIST("hNsigmaPionKaonTPC"), f1track.f1d1TPC(), f1track.f1d2TPC()); for (auto protontrack : protontracks) { Proton.SetXYZM(protontrack.protonPx(), protontrack.protonPy(), protontrack.protonPz(), 0.938); if (Proton.P() < momentumTOFProton && TMath::Abs(protontrack.protonNsigmaTPC()) > 3) { @@ -130,10 +158,12 @@ struct f1protoncorrelation { continue; } auto relative_momentum = getkstar(F1, Proton); + if (relative_momentum <= 0.5) { + histos.fill(HIST("hNsigmaProtonTPC"), protontrack.protonNsigmaTPC(), Proton.Pt()); + } histos.fill(HIST("h2SameEventPtCorrelation"), relative_momentum, F1.Pt(), Proton.Pt()); if (f1track.f1SignalStat() == 1) { histos.fill(HIST("h2SameEventInvariantMassUnlike_mass"), relative_momentum, F1.Pt(), F1.M()); // F1 sign = 1 unlike, F1 sign = -1 like - histos.fill(HIST("hNsigmaProtonTPCSE"), protontrack.protonNsigmaTPC(), relative_momentum); } if (f1track.f1SignalStat() == -1) { histos.fill(HIST("h2SameEventInvariantMassLike_mass"), relative_momentum, F1.Pt(), F1.M()); @@ -144,10 +174,10 @@ struct f1protoncorrelation { auto angleend = 7.0 * TMath::Pi() / 6.0; auto anglestep = (angleend - anglestart) / (1.0 * (9.0 - 1.0)); auto rotangle = anglestart + nrotbkg * anglestep; - auto rotPionPx = f1track.f1d1Px() * std::cos(rotangle) - f1track.f1d1Py() * std::sin(rotangle); - auto rotPionPy = f1track.f1d1Px() * std::sin(rotangle) + f1track.f1d1Py() * std::cos(rotangle); - PionRot.SetXYZM(rotPionPx, rotPionPy, f1track.f1d1Pz(), 0.139); - F1Rot = PionRot + KaonKshortPair; + auto rotKKPx = KaonKshortPair.Px() * std::cos(rotangle) - KaonKshortPair.Py() * std::sin(rotangle); + auto rotKKPy = KaonKshortPair.Px() * std::sin(rotangle) + KaonKshortPair.Py() * std::cos(rotangle); + KaonKshortPairRot.SetXYZM(rotKKPx, rotKKPy, KaonKshortPair.Pz(), KaonKshortPair.M()); + F1Rot = Pion + KaonKshortPairRot; auto relative_momentum_rot = getkstar(F1Rot, Proton); if (f1track.f1SignalStat() == 1) { histos.fill(HIST("h2SameEventInvariantMassRot_mass"), relative_momentum_rot, F1Rot.Pt(), F1Rot.M()); @@ -195,13 +225,33 @@ struct f1protoncorrelation { Kaon.SetXYZM(t1.f1d2Px(), t1.f1d2Py(), t1.f1d2Pz(), 0.493); Kshort.SetXYZM(t1.f1d3Px(), t1.f1d3Py(), t1.f1d3Pz(), 0.497); KaonKshortPair = Kaon + Kshort; - if (Pion.P() > maxMomentumPion || Kaon.P() > maxMomentumKaon) { + if (Pion.Pt() > maxMomentumPion || Kaon.Pt() > maxMomentumKaon) { continue; } - if (strategyPIDPion == 1 && Pion.P() > momentumTOFPion && t1.f1d1TOFHit() != 1) { + if (pdepPID) { + if (Kaon.Pt() <= 0.5 && (t1.f1d2TPC() < -2.5 || t1.f1d2TPC() > 2.5)) { + continue; + } + if (Kaon.Pt() > 0.5 && Kaon.Pt() <= 0.7 && (t1.f1d2TPC() < -1.5 || t1.f1d2TPC() > 2.5)) { + continue; + } + if (Kaon.Pt() > 0.7 && Kaon.Pt() <= 1.0 && (t1.f1d2TPC() < -1.0 || t1.f1d2TPC() > 2.5)) { + continue; + } + if (Kaon.Pt() > 1.0 && (t1.f1d2TPC() < -2.0 || t1.f1d2TPC() > 2.0)) { + continue; + } + if (Pion.Pt() < 2.0 && (t1.f1d1TPC() < -2.5 || t1.f1d1TPC() > 2.5)) { + continue; + } + if (Pion.Pt() > 2.0 && (t1.f1d1TPC() < -2.0 || t1.f1d1TPC() > 2.0)) { + continue; + } + } + if (strategyPIDPion == 1 && Pion.Pt() > momentumTOFPionMin && Pion.Pt() <= momentumTOFPionMax && t1.f1d1TOFHit() != 1) { continue; } - if (strategyPIDKaon == 1 && Kaon.P() > momentumTOFKaon && t1.f1d2TOFHit() != 1) { + if (strategyPIDKaon == 1 && Kaon.Pt() > momentumTOFKaonMin && Kaon.Pt() <= momentumTOFKaonMax && t1.f1d2TOFHit() != 1) { continue; } Proton.SetXYZM(t2.protonPx(), t2.protonPy(), t2.protonPz(), 0.938); @@ -213,11 +263,10 @@ struct f1protoncorrelation { } auto relative_momentum = getkstar(F1, Proton); if (t1.f1SignalStat() == 1) { - histos.fill(HIST("h2MixEventInvariantMassUnlike_mass104"), relative_momentum, F1.Pt(), F1.M()); // F1 sign = 1 unlike, F1 sign = -1 like - histos.fill(HIST("hNsigmaProtonTPCME"), t2.protonNsigmaTPC(), relative_momentum); + histos.fill(HIST("h2MixEventInvariantMassUnlike_mass"), relative_momentum, F1.Pt(), F1.M()); // F1 sign = 1 unlike, F1 sign = -1 like } if (t1.f1SignalStat() == -1) { - histos.fill(HIST("h2MixEventInvariantMassLike_mass104"), relative_momentum, F1.Pt(), F1.M()); + histos.fill(HIST("h2MixEventInvariantMassLike_mass"), relative_momentum, F1.Pt(), F1.M()); } if (fillRotation) { for (int nrotbkg = 0; nrotbkg < 9; nrotbkg++) { @@ -225,10 +274,10 @@ struct f1protoncorrelation { auto angleend = 7.0 * TMath::Pi() / 6.0; auto anglestep = (angleend - anglestart) / (1.0 * (9.0 - 1.0)); auto rotangle = anglestart + nrotbkg * anglestep; - auto rotPionPx = t1.f1d1Px() * std::cos(rotangle) - t1.f1d1Py() * std::sin(rotangle); - auto rotPionPy = t1.f1d1Px() * std::sin(rotangle) + t1.f1d1Py() * std::cos(rotangle); - PionRot.SetXYZM(rotPionPx, rotPionPy, t1.f1d1Pz(), 0.139); - F1Rot = PionRot + KaonKshortPair; + auto rotKKPx = KaonKshortPair.Px() * std::cos(rotangle) - KaonKshortPair.Py() * std::sin(rotangle); + auto rotKKPy = KaonKshortPair.Px() * std::sin(rotangle) + KaonKshortPair.Py() * std::cos(rotangle); + KaonKshortPairRot.SetXYZM(rotKKPx, rotKKPy, KaonKshortPair.Pz(), KaonKshortPair.M()); + F1Rot = Pion + KaonKshortPairRot; auto relative_momentum_rot = getkstar(F1Rot, Proton); if (t1.f1SignalStat() == 1) { histos.fill(HIST("h2MixEventInvariantMassRot_mass"), relative_momentum_rot, F1Rot.Pt(), F1Rot.M()); From de7a5a8939fd647f1066c450ac288adf7ddb759a Mon Sep 17 00:00:00 2001 From: skundu692 Date: Wed, 18 Dec 2024 19:12:29 +0100 Subject: [PATCH 2/2] bug fix for proton PID selection --- PWGLF/Tasks/Resonances/f1protoncorrelation.cxx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx b/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx index 5348bc46b6b..66344a45442 100644 --- a/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx +++ b/PWGLF/Tasks/Resonances/f1protoncorrelation.cxx @@ -148,10 +148,10 @@ struct f1protoncorrelation { histos.fill(HIST("hNsigmaPionKaonTPC"), f1track.f1d1TPC(), f1track.f1d2TPC()); for (auto protontrack : protontracks) { Proton.SetXYZM(protontrack.protonPx(), protontrack.protonPy(), protontrack.protonPz(), 0.938); - if (Proton.P() < momentumTOFProton && TMath::Abs(protontrack.protonNsigmaTPC()) > 3) { + if (Proton.P() < momentumTOFProton && TMath::Abs(protontrack.protonNsigmaTPC()) > 2.5) { continue; } - if (Proton.P() >= momentumTOFProton && protontrack.protonTOFHit() != 1 && TMath::Abs(protontrack.protonNsigmaTOF()) > 3) { + if (Proton.P() >= momentumTOFProton && (protontrack.protonTOFHit() != 1 || TMath::Abs(protontrack.protonNsigmaTOF()) > 2.5)) { continue; } if ((f1track.f1PionIndex() == protontrack.f1ProtonIndex()) || (f1track.f1KaonIndex() == protontrack.f1ProtonIndex()) || (f1track.f1KshortPositiveIndex() == protontrack.f1ProtonIndex()) || (f1track.f1KshortNegativeIndex() == protontrack.f1ProtonIndex())) { @@ -255,10 +255,10 @@ struct f1protoncorrelation { continue; } Proton.SetXYZM(t2.protonPx(), t2.protonPy(), t2.protonPz(), 0.938); - if (Proton.P() < momentumTOFProton && TMath::Abs(t2.protonNsigmaTPC()) > 3) { + if (Proton.P() < momentumTOFProton && TMath::Abs(t2.protonNsigmaTPC()) > 2.5) { continue; } - if (Proton.P() >= momentumTOFProton && t2.protonTOFHit() != 1 && TMath::Abs(t2.protonNsigmaTOF()) > 3) { + if (Proton.P() >= momentumTOFProton && (t2.protonTOFHit() != 1 || TMath::Abs(t2.protonNsigmaTOF()) > 2.5)) { continue; } auto relative_momentum = getkstar(F1, Proton);