From 5f462ebd50243c13b2ee4cddeb1a03fc58c1e212 Mon Sep 17 00:00:00 2001 From: Francesca Ercolessi Date: Mon, 5 Oct 2026 10:50:31 +0200 Subject: [PATCH 1/2] Add purity histos --- .../Tasks/Nuspex/hadronnucleicorrelation.cxx | 29 +++++++++++++++---- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx index 0bd761901d2..c9b848e635b 100644 --- a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx +++ b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx @@ -95,6 +95,7 @@ struct HadronNucleiCorrelation { Configurable isPrim{"isPrim", true, "is isPrim"}; Configurable doCorrection{"doCorrection", false, "do efficiency correction"}; Configurable doQuadraticPID{"doQuadraticPID", false, "do PID with sum in quadrature of TOF and TPC"}; + Configurable doPIDRej{"doPIDRej", false, "do PID rejection of competing species"}; struct : ConfigurableGroup { std::string prefix = "Coalescence"; // JSON group name @@ -130,12 +131,13 @@ struct HadronNucleiCorrelation { Configurable nsigmaElPr{"nsigmaElPr", 1.0f, "cut nsigma TPC El for protons"}; Configurable nsigmaElDe{"nsigmaElDe", 3.0f, "cut nsigma TPC El for protons"}; Configurable nsigmaTOF{"nsigmaTOF", 3.5f, "cut nsigma TOF"}; + Configurable nsigmaTOFPrRej{"nsigmaTOFPrRej", 3.f, "cut nsigma TOF for proton rejection"}; + Configurable doPrRej{"doPrRej", 3.f, "do TOF proton rejection"}; Configurable nsigmaQuadratic{"nsigmaQuadratic", 3.0f, "cut on sqrt(nsigmaTPC^2 + nsigmaTOF^2), used above the TOF pT threshold when doQuadraticPID is on"}; Configurable nsigmaITSPr{"nsigmaITSPr", -2.0f, "cut nsigma ITS Pr"}; Configurable nsigmaITSDe{"nsigmaITSDe", -2.0f, "cut nsigma ITS De"}; Configurable doITSPID{"doITSPID", true, "do ITS PID"}; Configurable pTthrprTOF{"pTthrprTOF", 0.8f, "threshold pT proton to use TOF"}; - Configurable pTthrprTPCEl{"pTthrprTPCEl", 1.0f, "threshold pT proton to use TPC El rejection"}; Configurable pTthrdeTOF{"pTthrdeTOF", 1.0f, "threshold pT deuteron to use TOF"}; Configurable pTthrdeTPCEl{"pTthrdeTPCEl", 1.0f, "threshold pT deuteron to use TPC El rejection"}; Configurable rejectionEl{"rejectionEl", true, "use TPC El rejection"}; @@ -407,6 +409,8 @@ struct HadronNucleiCorrelation { registryQa.add("QA/h3dTPCTOF_AntiPr", "n#sigma TPC vs n#sigma TOF", {HistType::kTH3D, {tpcNSigmaAxis, tofNSigmaAxis, ptAxis}}); registryQa.add("QA/h3dTPCTOF_De", "n#sigma TPC vs n#sigma TOF", {HistType::kTH3D, {tpcNSigmaAxis, tofNSigmaAxis, ptAxis}}); registryQa.add("QA/h3dTPCTOF_AntiDe", "n#sigma TPC vs n#sigma TOF", {HistType::kTH3D, {tpcNSigmaAxis, tofNSigmaAxis, ptAxis}}); + registryQa.add("QA/h3dTPCTOF_De_Rej", "n#sigma TPC vs n#sigma TOF", {HistType::kTH3D, {tpcNSigmaAxis, tofNSigmaAxis, ptAxis}}); + registryQa.add("QA/h3dTPCTOF_AntiDe_Rej", "n#sigma TPC vs n#sigma TOF", {HistType::kTH3D, {tpcNSigmaAxis, tofNSigmaAxis, ptAxis}}); registryQa.add("QA/hnSigmaTPCVsPt_El", "n#sigma TPC vs p_{T} for e hypothesis (all tracks)", {HistType::kTH2D, {ptAxis, tpcNSigmaAxis}}); registryQa.add("QA/hnSigmaTPCVsPt_Pr", "n#sigma TPC vs p_{T} for p hypothesis (all tracks)", {HistType::kTH2D, {ptAxis, tpcNSigmaAxis}}); registryQa.add("QA/hnSigmaTPCVsPt_De", "n#sigma TPC vs p_{T} for d hypothesis (all tracks)", {HistType::kTH2D, {ptAxis, tpcNSigmaAxis}}); @@ -581,7 +585,6 @@ struct HadronNucleiCorrelation { { const bool isTPCPID = std::abs(track.tpcNSigmaPr()) < nsigmaTPC.value; const bool isTOFPID = std::abs(track.tofNSigmaPr()) < nsigmaTOF.value; - const bool isTPCElRejection = rejectionEl.value && track.beta() < BetahasTOFthr && track.pt() < pTthrprTPCEl.value && track.tpcNSigmaEl() >= nsigmaElPr.value; const bool isITSPID = track.itsNSigmaPr() > nsigmaITSPr.value; const bool isQuadraticPID = std::hypot(track.tpcNSigmaPr(), track.tofNSigmaPr()) < nsigmaQuadratic.value; @@ -594,7 +597,7 @@ struct HadronNucleiCorrelation { if (!doITSPID.value || isITSPID) { return signCheck; } - } else if (isTPCElRejection || isTOFPID) { + } else if (isTOFPID) { return signCheck; } } @@ -1021,12 +1024,23 @@ struct HadronNucleiCorrelation { registryQa.fill(HIST("QA/hnSigmaTOFVsPt_De"), track.pt() * track.sign(), track.tofNSigmaDe()); registryQa.fill(HIST("QA/hnSigmaITSVsPt_Pr"), track.pt() * track.sign(), track.itsNSigmaPr()); registryQa.fill(HIST("QA/hnSigmaITSVsPt_De"), track.pt() * track.sign(), track.itsNSigmaDe()); + + const bool isTPCElRejection = rejectionEl.value && track.beta() < BetahasTOFthr && track.pt() < pTthrdeTPCEl.value && track.tpcNSigmaEl() >= nsigmaElDe.value; + const bool isTOFPID = std::abs(track.tofNSigmaDe()) < nsigmaTOF.value; + const bool isNotPr = std::abs(track.tofNSigmaPr()) >= nsigmaTOFPrRej.value || !doPrRej; + if (track.sign() > 0) { + if (track.pt() >= pTthrprTOF.value || !doITSPID.value || track.itsNSigmaPr() > nsigmaITSPr.value) { registryQa.fill(HIST("QA/h3dTPCTOF_Pr"), track.tpcNSigmaPr(), track.tofNSigmaPr(), track.pt()); } if (track.pt() >= pTthrdeTOF.value || !doITSPID.value || track.itsNSigmaDe() > nsigmaITSDe.value) { - registryQa.fill(HIST("QA/h3dTPCTOF_De"), track.tpcNSigmaDe(), track.tofNSigmaDe(), track.pt()); + if (isNotPr) { + registryQa.fill(HIST("QA/h3dTPCTOF_De"), track.tpcNSigmaDe(), track.tofNSigmaDe(), track.pt()); + if (isTPCElRejection || isTOFPID) { + registryQa.fill(HIST("QA/h3dTPCTOF_De_Rej"), track.tpcNSigmaDe(), track.tofNSigmaDe(), track.pt()); + } + } } } if (track.sign() < 0) { @@ -1034,7 +1048,12 @@ struct HadronNucleiCorrelation { registryQa.fill(HIST("QA/h3dTPCTOF_AntiPr"), track.tpcNSigmaPr(), track.tofNSigmaPr(), track.pt()); } if (track.pt() >= pTthrdeTOF.value || !doITSPID.value || track.itsNSigmaDe() > nsigmaITSDe.value) { - registryQa.fill(HIST("QA/h3dTPCTOF_AntiDe"), track.tpcNSigmaDe(), track.tofNSigmaDe(), track.pt()); + if (isNotPr) { + registryQa.fill(HIST("QA/h3dTPCTOF_AntiDe"), track.tpcNSigmaDe(), track.tofNSigmaDe(), track.pt()); + if (isTPCElRejection || isTOFPID) { + registryQa.fill(HIST("QA/h3dTPCTOF_AntiDe_Rej"), track.tpcNSigmaDe(), track.tofNSigmaDe(), track.pt()); + } + } } } From b179e4d378f1b62d3a55f8f1af7998737bf88b7d Mon Sep 17 00:00:00 2001 From: Francesca Ercolessi Date: Mon, 5 Oct 2026 11:11:45 +0200 Subject: [PATCH 2/2] fix bool and rej protons --- PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx index c9b848e635b..f4b1ef4083c 100644 --- a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx +++ b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx @@ -132,7 +132,7 @@ struct HadronNucleiCorrelation { Configurable nsigmaElDe{"nsigmaElDe", 3.0f, "cut nsigma TPC El for protons"}; Configurable nsigmaTOF{"nsigmaTOF", 3.5f, "cut nsigma TOF"}; Configurable nsigmaTOFPrRej{"nsigmaTOFPrRej", 3.f, "cut nsigma TOF for proton rejection"}; - Configurable doPrRej{"doPrRej", 3.f, "do TOF proton rejection"}; + Configurable doPrRej{"doPrRej", true, "do TOF proton rejection"}; Configurable nsigmaQuadratic{"nsigmaQuadratic", 3.0f, "cut on sqrt(nsigmaTPC^2 + nsigmaTOF^2), used above the TOF pT threshold when doQuadraticPID is on"}; Configurable nsigmaITSPr{"nsigmaITSPr", -2.0f, "cut nsigma ITS Pr"}; Configurable nsigmaITSDe{"nsigmaITSDe", -2.0f, "cut nsigma ITS De"}; @@ -622,11 +622,15 @@ struct HadronNucleiCorrelation { const bool isTOFPID = std::abs(track.tofNSigmaDe()) < nsigmaTOF.value; const bool isTPCElRejection = rejectionEl.value && track.beta() < BetahasTOFthr && track.pt() < pTthrdeTPCEl.value && track.tpcNSigmaEl() >= nsigmaElDe.value; const bool isITSPID = track.itsNSigmaDe() > nsigmaITSDe.value; + const bool isNotPr = std::abs(track.tofNSigmaPr()) >= nsigmaTOFPrRej.value || !doPrRej.value; const bool isQuadraticPID = std::hypot(track.tpcNSigmaDe(), track.tofNSigmaDe()) < nsigmaQuadratic.value; // Check if the sign of the track matches the expected sign for deuterons or antideuterons const bool signCheck = (sign > 0 && track.sign() > 0) || (sign < 0 && track.sign() < 0); + if (!isNotPr) { + return false; + } if (!doQuadraticPID.value) { if (isTPCPID) { if (track.pt() < pTthrdeTOF.value) { @@ -1027,7 +1031,7 @@ struct HadronNucleiCorrelation { const bool isTPCElRejection = rejectionEl.value && track.beta() < BetahasTOFthr && track.pt() < pTthrdeTPCEl.value && track.tpcNSigmaEl() >= nsigmaElDe.value; const bool isTOFPID = std::abs(track.tofNSigmaDe()) < nsigmaTOF.value; - const bool isNotPr = std::abs(track.tofNSigmaPr()) >= nsigmaTOFPrRej.value || !doPrRej; + const bool isNotPr = std::abs(track.tofNSigmaPr()) >= nsigmaTOFPrRej.value || !doPrRej.value; if (track.sign() > 0) {