From f9e82e9b3d688a12d2bc17b0c85f6fb175240b64 Mon Sep 17 00:00:00 2001 From: gianniliveraro Date: Sun, 5 Apr 2026 01:03:50 -0300 Subject: [PATCH 1/3] Cleanup + fixes --- .../Strangeness/sigma0builder.cxx | 37 ++++++------- PWGLF/Tasks/Strangeness/sigmaanalysis.cxx | 54 ++++++++++--------- 2 files changed, 45 insertions(+), 46 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx index 339088a311c..f052c5c63f9 100644 --- a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx +++ b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx @@ -1081,7 +1081,7 @@ struct sigma0builder { // Assumption: first mother is the physical one auto const& lambdaMother = lambdaMothers.front(); int lambdaMotherIndex = lambdaMother.globalIndex(); - + // ============================================================ // 2) --- EMCal cluster: loop over MC contributors --- // ============================================================ @@ -1096,7 +1096,7 @@ struct sigma0builder { for (size_t i = 0; i < cluster.mcParticleIds().size(); i++) { int mcId = cluster.mcParticleIds()[i]; - auto mcPart = mcparticles.iteratorAt(mcId); + auto mcPart = mcparticles.rawIteratorAt(mcId); // Accumulate total momentum (fallback strategy) sumPx += mcPart.px(); @@ -1112,31 +1112,28 @@ struct sigma0builder { if (daughterId < 0) continue; // Not from Sigma0 -> try next contributor - auto mcPhoton = mcparticles.iteratorAt(daughterId); - - // Sanity check: are we getting the correct particles? - auto dummy = mcparticles.rawIteratorAt(daughterId); - if (mcPhoton.globalIndex() != dummy.globalIndex()) - LOGF(fatal, "The behave of rawIteratorAt != iteratorAt. Index %i != %i. Please check. Aborting.", mcPhoton.globalIndex(), dummy.globalIndex()); + auto mcPhoton = mcparticles.rawIteratorAt(daughterId); // Require true photon, please if (mcPhoton.pdgCode() != PDG_t::kGamma) continue; - + // Get Sigma0 index from photon mother - auto mothers = mcPhoton.mothersIds(); - if (mothers.empty()) // No mothers? Weird + auto const& photonMothers = mcPhoton.template mothers_as(); + if (photonMothers.empty()) // No mothers? Weird continue; - int sigmaIndex = mothers[0]; - + // Assumption: first mother is the physical one + auto const& photonMother = photonMothers.front(); + int photonMotherIndex = photonMother.globalIndex(); + // ------------------------------------------------------------ // Check 2: // Does this photon share the same mother as the Lambda? // ------------------------------------------------------------ - if (sigmaIndex == lambdaMotherIndex) { + if (photonMotherIndex == lambdaMotherIndex) { matchedPhotonId = daughterId; - matchedMotherIndex = sigmaIndex; + matchedMotherIndex = photonMotherIndex; MCinfo.EMCalClusterAmplitude = cluster.amplitudeA()[i]; break; // SUCCESS -> stop loop } @@ -1148,8 +1145,8 @@ struct sigma0builder { if (matchedPhotonId >= 0 && matchedMotherIndex >= 0) { - auto mcPhoton = mcparticles.iteratorAt(matchedPhotonId); - auto mcSigma = mcparticles.iteratorAt(matchedMotherIndex); + auto mcPhoton = mcparticles.rawIteratorAt(matchedPhotonId); + auto mcSigma = mcparticles.rawIteratorAt(matchedMotherIndex); // --- Pair (Sigma0) information MCinfo.fV0PairProducedByGenerator = mcSigma.producedByGenerator(); @@ -1172,7 +1169,7 @@ struct sigma0builder { MCinfo.V01PDGCode = mcPhoton.pdgCode(); if (!mcPhoton.mothersIds().empty()) { - auto mcMother = mcparticles.iteratorAt(mcPhoton.mothersIds()[0]); + auto mcMother = mcparticles.rawIteratorAt(mcPhoton.mothersIds()[0]); MCinfo.V01PDGCodeMother = mcMother.pdgCode(); } @@ -2405,7 +2402,7 @@ struct sigma0builder { // Momentum components float gammapx = gammapT * std::cos(gamma.phi()); float gammapy = gammapT * std::sin(gamma.phi()); - float gammapz = gammapT * std::sinh(gamma.phi()); + float gammapz = gammapT * std::sinh(gamma.eta()); //_______________________________________________ // Sigma0 pre-selections @@ -2442,7 +2439,7 @@ struct sigma0builder { if constexpr (requires { gamma.mcParticleIds(); lambda.motherMCPartId(); }) { auto sigma0MCInfo = getClusterV0PairMCInfo(gamma, lambda, collision, mcparticles); - + sigma0mccores(sigma0MCInfo.V0PairMCParticleID, sigma0MCInfo.V0PairMCRadius, sigma0MCInfo.V0PairPDGCode, sigma0MCInfo.V0PairPDGCodeMother, sigma0MCInfo.V0PairMCProcess, sigma0MCInfo.fV0PairProducedByGenerator, sigma0MCInfo.V01MCpx, sigma0MCInfo.V01MCpy, sigma0MCInfo.V01MCpz, sigma0MCInfo.EMCalClusterAmplitude, sigma0MCInfo.V01PDGCodePos, sigma0MCInfo.V01PDGCodeNeg, sigma0MCInfo.fIsV01Primary, sigma0MCInfo.V01PDGCode, sigma0MCInfo.V01PDGCodeMother, sigma0MCInfo.fIsV01CorrectlyAssign, diff --git a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx index fd6b48609e1..864b3d83e5e 100644 --- a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx @@ -258,6 +258,7 @@ struct sigmaanalysis { ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.0f, 0.1f, 0.2f, 0.3f, 0.4f, 0.5f, 0.6f, 0.7f, 0.8f, 0.9f, 1.0f, 1.1f, 1.2f, 1.3f, 1.4f, 1.5f, 1.6f, 1.7f, 1.8f, 1.9f, 2.0f, 2.2f, 2.4f, 2.6f, 2.8f, 3.0f, 3.2f, 3.4f, 3.6f, 3.8f, 4.0f, 4.4f, 4.8f, 5.2f, 5.6f, 6.0f, 6.5f, 7.0f, 7.5f, 8.0f, 9.0f, 10.0f, 11.0f, 12.0f, 13.0f, 14.0f, 15.0f, 17.0f, 19.0f, 21.0f, 23.0f, 25.0f, 30.0f, 35.0f, 40.0f, 50.0f}, "p_{T} (GeV/c)"}; ConfigurableAxis axisInvPt{"axisInvPt", {VARIABLE_WIDTH, 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 2.0, 5.0, 10.0, 20.0, 50.0}, ""}; ConfigurableAxis axisDeltaPt{"axisDeltaPt", {400, -50.0, 50.0}, ""}; + ConfigurableAxis axisReso{"axisReso", {400, -2.0, 2.0}, ""}; ConfigurableAxis axisRapidity{"axisRapidity", {100, -2.0f, 2.0f}, "Rapidity"}; ConfigurableAxis axisIRBinning{"axisIRBinning", {150, 0, 1500}, "Binning for the interaction rate (kHz)"}; ConfigurableAxis axisNch{"axisNch", {300, 0.0f, 3000.0f}, "N_{ch}"}; @@ -502,18 +503,16 @@ struct sigmaanalysis { histos.add(histodir + "/MC/ASigma0/h3dMCProcess", "h3dMCProcess", kTH3D, {{50, -0.5f, 49.5f}, axisPt, axisSigmaMass}); // pT Resolution: - if (fillResoQAhistos && histodir == "BeforeSel") { - histos.add(histodir + "/MC/Reso/h2dGammaInvPtResolution", "h2dGammaPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); + if (fillResoQAhistos) { + histos.add(histodir + "/MC/Reso/h2dGammaPtResolution", "h2dGammaPtResolution", kTH2D, {axisInvPt, axisReso}); histos.add(histodir + "/MC/Reso/h2dGammaInvPtResolution", "h2dGammaInvPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h2dLambdaPtResolution", "h2dLambdaPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); - histos.add(histodir + "/MC/Reso/h3dLambdaPtResoVsTPCCR", "h3dLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); - histos.add(histodir + "/MC/Reso/h3dLambdaPtResoVsTPCCR", "h3dLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); + histos.add(histodir + "/MC/Reso/h3dLambdaPtResoVsTPCCR", "h3dLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); histos.add(histodir + "/MC/Reso/h2dAntiLambdaPtResolution", "h2dAntiLambdaPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); - histos.add(histodir + "/MC/Reso/h3dAntiLambdaPtResoVsTPCCR", "h3dAntiLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); - histos.add(histodir + "/MC/Reso/h3dAntiLambdaPtResoVsTPCCR", "h3dAntiLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); - histos.add(histodir + "/MC/Reso/h2dSigma0PtResolution", "h2dSigma0PtResolution", kTH2D, {axisInvPt, axisDeltaPt}); + histos.add(histodir + "/MC/Reso/h3dAntiLambdaPtResoVsTPCCR", "h3dAntiLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); + histos.add(histodir + "/MC/Reso/h2dSigma0PtResolution", "h2dSigma0PtResolution", kTH2D, {axisInvPt, axisReso}); histos.add(histodir + "/MC/Reso/h2dSigma0InvPtResolution", "h2dSigma0InvPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); - histos.add(histodir + "/MC/Reso/h2dAntiSigma0PtResolution", "h2dAntiSigma0PtResolution", kTH2D, {axisInvPt, axisDeltaPt}); + histos.add(histodir + "/MC/Reso/h2dAntiSigma0PtResolution", "h2dAntiSigma0PtResolution", kTH2D, {axisInvPt, axisReso}); histos.add(histodir + "/MC/Reso/h2dSigma0RadiusResolution", "h2dSigma0RadiusResolution", kTH2D, {axisPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h2dASigma0RadiusResolution", "h2dASigma0RadiusResolution", kTH2D, {axisPt, axisDeltaPt}); } @@ -1003,16 +1002,19 @@ struct sigmaanalysis { return TrkCode; } - template + template void getResolution(TSigma0Object const& sigma) { + // Check whether it is before or after selections + static constexpr std::string_view MainDir[] = {"BeforeSel", "AfterSel"}; + //_______________________________________ // Gamma MC association if (sigma.photonPDGCode() == 22) { if (sigma.photonmcpt() > 0) { - histos.fill(HIST("BeforeSel/MC/Reso/h2dGammaPtResolution"), sigma.photonmcpt(), sigma.photonPt() - sigma.photonmcpt()); // pT resolution - histos.fill(HIST("BeforeSel/MC/Reso/h2dGammaInvPtResolution"), 1.f / sigma.photonmcpt(), 1.f / sigma.photonPt() - 1.f / sigma.photonmcpt()); // pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dGammaPtResolution"), sigma.photonmcpt(), (sigma.photonPt()/sigma.photonmcpt()) - 1.f); // pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dGammaInvPtResolution"), 1.f / sigma.photonmcpt(), 1.f / sigma.photonPt() - 1.f / sigma.photonmcpt()); // pT resolution } } @@ -1020,9 +1022,9 @@ struct sigmaanalysis { // Lambda MC association if (sigma.lambdaPDGCode() == 3122) { if (sigma.lambdamcpt() > 0) { - histos.fill(HIST("BeforeSel/MC/Reso/h2dLambdaPtResolution"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt()); // 1/pT resolution - histos.fill(HIST("BeforeSel/MC/Reso/h3dLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), -1 * sigma.lambdaNegTPCCrossedRows()); // 1/pT resolution - histos.fill(HIST("BeforeSel/MC/Reso/h3dLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), sigma.lambdaPosTPCCrossedRows()); // 1/pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dLambdaPtResolution"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt()); // 1/pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h3dLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), -1 * sigma.lambdaNegTPCCrossedRows()); // 1/pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h3dLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), sigma.lambdaPosTPCCrossedRows()); // 1/pT resolution } } @@ -1030,25 +1032,25 @@ struct sigmaanalysis { // AntiLambda MC association if (sigma.lambdaPDGCode() == -3122) { if (sigma.lambdamcpt() > 0) { - histos.fill(HIST("BeforeSel/MC/Reso/h2dAntiLambdaPtResolution"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt()); // pT resolution - histos.fill(HIST("BeforeSel/MC/Reso/h3dAntiLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), -1 * sigma.lambdaNegTPCCrossedRows()); // 1/pT resolution - histos.fill(HIST("BeforeSel/MC/Reso/h3dAntiLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), sigma.lambdaPosTPCCrossedRows()); // 1/pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dAntiLambdaPtResolution"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt()); // pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h3dAntiLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), -1 * sigma.lambdaNegTPCCrossedRows()); // 1/pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h3dAntiLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), sigma.lambdaPosTPCCrossedRows()); // 1/pT resolution } } //_______________________________________ // Sigma and AntiSigma MC association if (sigma.isSigma0()) { - histos.fill(HIST("BeforeSel/MC/Reso/h2dSigma0RadiusResolution"), sigma.mcpt(), sigma.radius() - sigma.mcradius()); // pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dSigma0RadiusResolution"), sigma.mcpt(), sigma.radius() - sigma.mcradius()); // pT resolution if (sigma.mcpt() > 0) { - histos.fill(HIST("BeforeSel/MC/Reso/h2dSigma0PtResolution"), sigma.mcpt(), sigma.pt() - sigma.mcpt()); // pT resolution - histos.fill(HIST("BeforeSel/MC/Reso/h2dSigma0InvPtResolution"), 1.f / sigma.mcpt(), 1.f / sigma.pt() - 1.f / sigma.mcpt()); // pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dSigma0PtResolution"), sigma.mcpt(), (sigma.pt()/sigma.mcpt()) - 1.f); // pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dSigma0InvPtResolution"), 1.f / sigma.mcpt(), 1.f / sigma.pt() - 1.f / sigma.mcpt()); // pT resolution } } if (sigma.isAntiSigma0()) { - histos.fill(HIST("BeforeSel/MC/Reso/h2dASigma0RadiusResolution"), sigma.mcpt(), sigma.radius() - sigma.mcradius()); // pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dASigma0RadiusResolution"), sigma.mcpt(), sigma.radius() - sigma.mcradius()); // pT resolution if (sigma.mcpt() > 0) - histos.fill(HIST("BeforeSel/MC/Reso/h2dAntiSigma0PtResolution"), 1.f / sigma.mcpt(), 1.f / sigma.pt() - 1.f / sigma.mcpt()); // pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dAntiSigma0PtResolution"), 1.f / sigma.mcpt(), 1.f / sigma.pt() - 1.f / sigma.mcpt()); // pT resolution } } @@ -1220,7 +1222,7 @@ struct sigmaanalysis { //_______________________________________ // MC specific - if (doprocessMonteCarlo) { + if (doprocessMonteCarlo || doprocessMonteCarloWithEMCal) { if constexpr (requires { sigma.lambdaPDGCode(); sigma.photonPDGCode(); }) { if (fillSelhistos) { @@ -1302,8 +1304,8 @@ struct sigmaanalysis { //_______________________________________ // pT resolution histos - if ((mode == 0) && fillResoQAhistos) - getResolution(sigma); + if (fillResoQAhistos) + getResolution(sigma); } } } @@ -1664,7 +1666,7 @@ struct sigmaanalysis { auto sigma0 = fullSigma0s.rawIteratorAt(sigma0grouped[coll.globalIndex()][i]); // if MC - if constexpr (requires { sigma0.isSigma0(); sigma0.isAntiSigma0(); }) { + if constexpr (requires { sigma0.isSigma0(); sigma0.isAntiSigma0(); }) { if (doMCAssociation && !(sigma0.isSigma0() || sigma0.isAntiSigma0())) continue; From c6bb35239163ad1bf3c401a3c223c17d4b511402 Mon Sep 17 00:00:00 2001 From: gianniliveraro Date: Sun, 5 Apr 2026 13:27:35 -0300 Subject: [PATCH 2/3] Cleanup --- PWGLF/Tasks/Strangeness/sigmaanalysis.cxx | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx index 864b3d83e5e..1c44c88ad3a 100644 --- a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx @@ -41,10 +41,8 @@ #include "ReconstructionDataFormats/Track.h" #include -#include #include #include -#include #include #include @@ -1011,7 +1009,7 @@ struct sigmaanalysis { //_______________________________________ // Gamma MC association - if (sigma.photonPDGCode() == 22) { + if (sigma.photonPDGCode() == PDG_t::kGamma) { if (sigma.photonmcpt() > 0) { histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dGammaPtResolution"), sigma.photonmcpt(), (sigma.photonPt()/sigma.photonmcpt()) - 1.f); // pT resolution histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dGammaInvPtResolution"), 1.f / sigma.photonmcpt(), 1.f / sigma.photonPt() - 1.f / sigma.photonmcpt()); // pT resolution @@ -1020,7 +1018,7 @@ struct sigmaanalysis { //_______________________________________ // Lambda MC association - if (sigma.lambdaPDGCode() == 3122) { + if (sigma.lambdaPDGCode() == PDG_t::kLambda0) { if (sigma.lambdamcpt() > 0) { histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dLambdaPtResolution"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt()); // 1/pT resolution histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h3dLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), -1 * sigma.lambdaNegTPCCrossedRows()); // 1/pT resolution @@ -1030,7 +1028,7 @@ struct sigmaanalysis { //_______________________________________ // AntiLambda MC association - if (sigma.lambdaPDGCode() == -3122) { + if (sigma.lambdaPDGCode() == PDG_t::kLambda0Bar) { if (sigma.lambdamcpt() > 0) { histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dAntiLambdaPtResolution"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt()); // pT resolution histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h3dAntiLambdaPtResoVsTPCCR"), 1.f / sigma.lambdamcpt(), 1.f / sigma.lambdaPt() - 1.f / sigma.lambdamcpt(), -1 * sigma.lambdaNegTPCCrossedRows()); // 1/pT resolution @@ -1074,24 +1072,24 @@ struct sigmaanalysis { //_______________________________________ // Real Gamma x Real Lambda - but not from the same sigma0/antisigma0! - if ((PhotonPDGCode == 22) && ((LambdaPDGCode == 3122) || (LambdaPDGCode == -3122)) && (!fIsSigma && !fIsAntiSigma)) { + if ((PhotonPDGCode == PDG_t::kGamma) && ((LambdaPDGCode == PDG_t::kLambda0) || (LambdaPDGCode == PDG_t::kLambda0Bar)) && (!fIsSigma && !fIsAntiSigma)) { histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassSigma_TrueDaughters"), sigmapT, sigmaMass); histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dTrueDaughtersMatrix"), LambdaPDGCodeMother, PhotonPDGCodeMother); } //_______________________________________ // Real Gamma x fake Lambda - if ((PhotonPDGCode == 22) && (LambdaPDGCode != 3122) && (LambdaPDGCode != -3122)) + if ((PhotonPDGCode == PDG_t::kGamma) && (LambdaPDGCode != PDG_t::kLambda0) && (LambdaPDGCode != PDG_t::kLambda0Bar)) histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassSigma_TrueGammaFakeLambda"), sigmapT, sigmaMass); //_______________________________________ // Fake Gamma x Real Lambda - if ((PhotonPDGCode != 22) && ((LambdaPDGCode == 3122) || (LambdaPDGCode == -3122))) + if ((PhotonPDGCode != PDG_t::kGamma) && ((LambdaPDGCode == PDG_t::kLambda0) || (LambdaPDGCode == PDG_t::kLambda0Bar))) histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassSigma_FakeGammaTrueLambda"), sigmapT, sigmaMass); //_______________________________________ // Fake Gamma x Fake Lambda - if ((PhotonPDGCode != 22) && (LambdaPDGCode != 3122) && (LambdaPDGCode != -3122)) + if ((PhotonPDGCode != PDG_t::kGamma) && (LambdaPDGCode != PDG_t::kLambda0) && (LambdaPDGCode != PDG_t::kLambda0Bar)) histos.fill(HIST(MainDir[mode]) + HIST("/MC/BkgStudy/h2dPtVsMassSigma_FakeDaughters"), sigmapT, sigmaMass); } From d7bd85fc2f282dedd112089943dace7483419cfa Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Sun, 5 Apr 2026 16:37:06 +0000 Subject: [PATCH 3/3] Please consider the following formatting changes --- .../TableProducer/Strangeness/sigma0builder.cxx | 16 ++++++++-------- PWGLF/Tasks/Strangeness/sigmaanalysis.cxx | 10 +++++----- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx index f052c5c63f9..0450200a07b 100644 --- a/PWGLF/TableProducer/Strangeness/sigma0builder.cxx +++ b/PWGLF/TableProducer/Strangeness/sigma0builder.cxx @@ -1081,7 +1081,7 @@ struct sigma0builder { // Assumption: first mother is the physical one auto const& lambdaMother = lambdaMothers.front(); int lambdaMotherIndex = lambdaMother.globalIndex(); - + // ============================================================ // 2) --- EMCal cluster: loop over MC contributors --- // ============================================================ @@ -1117,21 +1117,21 @@ struct sigma0builder { // Require true photon, please if (mcPhoton.pdgCode() != PDG_t::kGamma) continue; - + // Get Sigma0 index from photon mother - auto const& photonMothers = mcPhoton.template mothers_as(); + auto const& photonMothers = mcPhoton.template mothers_as(); if (photonMothers.empty()) // No mothers? Weird continue; // Assumption: first mother is the physical one auto const& photonMother = photonMothers.front(); - int photonMotherIndex = photonMother.globalIndex(); - + int photonMotherIndex = photonMother.globalIndex(); + // ------------------------------------------------------------ // Check 2: // Does this photon share the same mother as the Lambda? // ------------------------------------------------------------ - if (photonMotherIndex == lambdaMotherIndex) { + if (photonMotherIndex == lambdaMotherIndex) { matchedPhotonId = daughterId; matchedMotherIndex = photonMotherIndex; MCinfo.EMCalClusterAmplitude = cluster.amplitudeA()[i]; @@ -2402,7 +2402,7 @@ struct sigma0builder { // Momentum components float gammapx = gammapT * std::cos(gamma.phi()); float gammapy = gammapT * std::sin(gamma.phi()); - float gammapz = gammapT * std::sinh(gamma.eta()); + float gammapz = gammapT * std::sinh(gamma.eta()); //_______________________________________________ // Sigma0 pre-selections @@ -2439,7 +2439,7 @@ struct sigma0builder { if constexpr (requires { gamma.mcParticleIds(); lambda.motherMCPartId(); }) { auto sigma0MCInfo = getClusterV0PairMCInfo(gamma, lambda, collision, mcparticles); - + sigma0mccores(sigma0MCInfo.V0PairMCParticleID, sigma0MCInfo.V0PairMCRadius, sigma0MCInfo.V0PairPDGCode, sigma0MCInfo.V0PairPDGCodeMother, sigma0MCInfo.V0PairMCProcess, sigma0MCInfo.fV0PairProducedByGenerator, sigma0MCInfo.V01MCpx, sigma0MCInfo.V01MCpy, sigma0MCInfo.V01MCpz, sigma0MCInfo.EMCalClusterAmplitude, sigma0MCInfo.V01PDGCodePos, sigma0MCInfo.V01PDGCodeNeg, sigma0MCInfo.fIsV01Primary, sigma0MCInfo.V01PDGCode, sigma0MCInfo.V01PDGCodeMother, sigma0MCInfo.fIsV01CorrectlyAssign, diff --git a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx index 1c44c88ad3a..8e0b65f125a 100644 --- a/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/sigmaanalysis.cxx @@ -505,9 +505,9 @@ struct sigmaanalysis { histos.add(histodir + "/MC/Reso/h2dGammaPtResolution", "h2dGammaPtResolution", kTH2D, {axisInvPt, axisReso}); histos.add(histodir + "/MC/Reso/h2dGammaInvPtResolution", "h2dGammaInvPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h2dLambdaPtResolution", "h2dLambdaPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); - histos.add(histodir + "/MC/Reso/h3dLambdaPtResoVsTPCCR", "h3dLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); + histos.add(histodir + "/MC/Reso/h3dLambdaPtResoVsTPCCR", "h3dLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); histos.add(histodir + "/MC/Reso/h2dAntiLambdaPtResolution", "h2dAntiLambdaPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); - histos.add(histodir + "/MC/Reso/h3dAntiLambdaPtResoVsTPCCR", "h3dAntiLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); + histos.add(histodir + "/MC/Reso/h3dAntiLambdaPtResoVsTPCCR", "h3dAntiLambdaPtResoVsTPCCR", kTH3D, {axisInvPt, axisDeltaPt, axisTPCrows}); histos.add(histodir + "/MC/Reso/h2dSigma0PtResolution", "h2dSigma0PtResolution", kTH2D, {axisInvPt, axisReso}); histos.add(histodir + "/MC/Reso/h2dSigma0InvPtResolution", "h2dSigma0InvPtResolution", kTH2D, {axisInvPt, axisDeltaPt}); histos.add(histodir + "/MC/Reso/h2dAntiSigma0PtResolution", "h2dAntiSigma0PtResolution", kTH2D, {axisInvPt, axisReso}); @@ -1011,7 +1011,7 @@ struct sigmaanalysis { // Gamma MC association if (sigma.photonPDGCode() == PDG_t::kGamma) { if (sigma.photonmcpt() > 0) { - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dGammaPtResolution"), sigma.photonmcpt(), (sigma.photonPt()/sigma.photonmcpt()) - 1.f); // pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dGammaPtResolution"), sigma.photonmcpt(), (sigma.photonPt() / sigma.photonmcpt()) - 1.f); // pT resolution histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dGammaInvPtResolution"), 1.f / sigma.photonmcpt(), 1.f / sigma.photonPt() - 1.f / sigma.photonmcpt()); // pT resolution } } @@ -1041,7 +1041,7 @@ struct sigmaanalysis { if (sigma.isSigma0()) { histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dSigma0RadiusResolution"), sigma.mcpt(), sigma.radius() - sigma.mcradius()); // pT resolution if (sigma.mcpt() > 0) { - histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dSigma0PtResolution"), sigma.mcpt(), (sigma.pt()/sigma.mcpt()) - 1.f); // pT resolution + histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dSigma0PtResolution"), sigma.mcpt(), (sigma.pt() / sigma.mcpt()) - 1.f); // pT resolution histos.fill(HIST(MainDir[mode]) + HIST("/MC/Reso/h2dSigma0InvPtResolution"), 1.f / sigma.mcpt(), 1.f / sigma.pt() - 1.f / sigma.mcpt()); // pT resolution } } @@ -1664,7 +1664,7 @@ struct sigmaanalysis { auto sigma0 = fullSigma0s.rawIteratorAt(sigma0grouped[coll.globalIndex()][i]); // if MC - if constexpr (requires { sigma0.isSigma0(); sigma0.isAntiSigma0(); }) { + if constexpr (requires { sigma0.isSigma0(); sigma0.isAntiSigma0(); }) { if (doMCAssociation && !(sigma0.isSigma0() || sigma0.isAntiSigma0())) continue;