From 3055262a7d62ae09893805de434631c3cc89e1cc Mon Sep 17 00:00:00 2001 From: yashpatley <52608802+yashpatley@users.noreply.github.com> Date: Wed, 6 Sep 2023 18:42:26 +0530 Subject: [PATCH 1/3] Update lambda1520_spherocity_analysis.cxx --- .../Tasks/lambda1520_spherocity_analysis.cxx | 158 +++++++++++++++--- 1 file changed, 138 insertions(+), 20 deletions(-) diff --git a/PWGLF/Tasks/lambda1520_spherocity_analysis.cxx b/PWGLF/Tasks/lambda1520_spherocity_analysis.cxx index 1ccd9c9748a..395403c8679 100644 --- a/PWGLF/Tasks/lambda1520_spherocity_analysis.cxx +++ b/PWGLF/Tasks/lambda1520_spherocity_analysis.cxx @@ -16,6 +16,7 @@ /// \author Yash Patley #include +#include #include "Common/DataModel/PIDResponse.h" #include "Common/DataModel/Centrality.h" @@ -36,9 +37,10 @@ const float massKaon = TDatabasePDG::Instance()->GetParticle(321)->Mass(); struct lambdaAnalysis { // Configurables. - Configurable nBinsPt{"nBinsPt", 100, "N bins in pT histogram"}; + Configurable nBinsPt{"nBinsPt", 500, "N bins in pT histogram"}; Configurable nBinsInvM{"nBinsInvM", 500, "N bins in InvMass histograms"}; Configurable nTracksSph{"nTracksSph", 3, "min #tracks for spherocity distribution"}; + Configurable doRotate{"doRotate", true, "rotated inv mass spectra"}; // Tracks Configurable cfgPtMin{"ptMin", 0.15, "Minimum Track pT"}; @@ -83,23 +85,28 @@ struct lambdaAnalysis { const AxisSpec axisPtQA(200, 0., 2., "p_{T} (GeV/c)"); const AxisSpec axisPt(nBinsPt, 0., 10., "p_{T} (GeV/c)"); const AxisSpec axisEta(200, -1, 1, "#eta"); - const AxisSpec axisDCAz(500, -0.5, 0.5, {"DCA_{z} (#cm)"}); - const AxisSpec axisDCAxy(240, -0.12, 0.12, {"DCA_{xy} (#cm)"}); + const AxisSpec axisDCAz(500, -0.5, 0.5, {"DCA_{z} (cm)"}); + const AxisSpec axisDCAxy(240, -0.12, 0.12, {"DCA_{xy} (cm)"}); const AxisSpec axisTPCNCls(200, 0, 200, {"TPCNCls"}); - const AxisSpec axisTPCNsigma(28, -7, 7, {"TPC N^{Sigma}"}); - const AxisSpec axisTOFNsigma(28, -7, 7, {"TOF N^{Sigma}"}); + const AxisSpec axisTPCNsigma(28, -7, 7, {"n#sigma^{TPC}"}); + const AxisSpec axisTOFNsigma(28, -7, 7, {"n#sigma^{TOF}"}); const AxisSpec axisInvM(nBinsInvM, 1.4, 2.4, {"M_{inv} (GeV/c^{2})"}); // Create Histograms. + // Event histos.add("Event/hCent", "V0M (%)", kTH1F, {axisCent}); histos.add("Event/hSph", "Event Spherocity", kTH1F, {axisSp}); histos.add("Event/hSpCent", "Spherocity vs V0M(%)", kTH2F, {axisCent, axisSp}); + + // QA Before histos.add("QAbefore/Proton/hTPCNsigma", "n#sigma^{TPC} Protons", kTH2F, {axisPtQA, axisTPCNsigma}); histos.add("QAbefore/Proton/hTOFNsigma", "n#sigma^{TOF} Protons", kTH2F, {axisPtQA, axisTOFNsigma}); histos.add("QAbefore/Proton/hTpcTofNsigma", "n#sigma^{TPC} vs n#sigma^{TOF} Protons", kTH2F, {axisTPCNsigma, axisTOFNsigma}); histos.add("QAbefore/Kaon/hTPCNsigma", "n#sigma^{TPC} Kaons", kTH2F, {axisPtQA, axisTPCNsigma}); histos.add("QAbefore/Kaon/hTOFNsigma", "n#sigma^{TOF} Kaons", kTH2F, {axisPtQA, axisTOFNsigma}); histos.add("QAbefore/Kaon/hTpcTofNsigma", "n#sigma^{TPC} vs n#sigma^{TOF} Kaons", kTH2F, {axisTPCNsigma, axisTOFNsigma}); + + // QA After histos.add("QAafter/Proton/hDcaZ", "dca_{z} Protons", kTH2F, {axisPtQA, axisDCAz}); histos.add("QAafter/Proton/hDcaXY", "dca_{xy} Protons", kTH2F, {axisPtQA, axisDCAxy}); histos.add("QAafter/Proton/hTPCNsigma", "n#sigma^{TPC} Protons", kTH2F, {axisPtQA, axisTPCNsigma}); @@ -110,16 +117,39 @@ struct lambdaAnalysis { histos.add("QAafter/Kaon/hTPCNsigma", "n#sigma^{TPC} Kaons", kTH2F, {axisPtQA, axisTPCNsigma}); histos.add("QAafter/Kaon/hTOFNsigma", "n#sigma^{TOF} Kaons", kTH2F, {axisPtQA, axisTOFNsigma}); histos.add("QAafter/Kaon/hTpcTofNsigma", "n#sigma^{TPC} vs n#sigma^{TOF} Kaons", kTH2F, {axisTPCNsigma, axisTOFNsigma}); + + // Analysis + // Proton Kaon histos.add("Analysis/hPtProton", "Protons p_{T}", kTH1F, {axisPt}); histos.add("Analysis/hEtaProton", "Protons #eta", kTH1F, {axisEta}); histos.add("Analysis/hPtKaon", "Kaons p_{T}", kTH1F, {axisPt}); histos.add("Analysis/hEtaKaon", "Kaons #eta", kTH1F, {axisEta}); + + // Lambda Invariant Mass histos.add("Analysis/hInvMass", "#Lambda(1520) M_{inv}", kTH1F, {axisInvM}); histos.add("Analysis/hInvMassLS", "Like Signs M_{inv}", kTH1F, {axisInvM}); + histos.add("Analysis/hInvMassR", "Rotated Spectra", kTH1F, {axisInvM}); histos.add("Analysis/hInvMassMix", "Mixed Events M_{inv}", kTH1F, {axisInvM}); histos.add("Analysis/h4InvMass", "THn #Lambda(1520)", kTHnSparseF, {axisInvM, axisPt, axisSp, axisCent}); histos.add("Analysis/h4InvMassLS", "THn Like Signs", kTHnSparseF, {axisInvM, axisPt, axisSp, axisCent}); + histos.add("Analysis/h4InvMassR", "THn Rotated", kTHnSparseF, {axisInvM, axisPt, axisSp, axisCent}); histos.add("Analysis/h4InvMassMix", "THn Mixed Events", kTHnSparseF, {axisInvM, axisPt, axisSp, axisCent}); + + // MC + if (doprocessMC) { + histos.add("QAMCTrue/DcaZ_pr", "dca_{z}^{MC} Protons", kTH2F, {axisPtQA, axisDCAz}); + histos.add("QAMCTrue/DcaZ_ka", "dca_{z}^{MC} Kaons", kTH2F, {axisPtQA, axisDCAz}); + histos.add("QAMCTrue/DcaXY_pr", "dca_{xy}^{MC} Protons", kTH2F, {axisPtQA, axisDCAxy}); + histos.add("QAMCTrue/DcaXY_ka", "dca_{xy}^{MC} Kaons", kTH2F, {axisPtQA, axisDCAxy}); + histos.add("Analysis/hLambdaGen", "Generated #Lambda(1520) p_{T}", kTH1F, {axisPt}); + histos.add("Analysis/hLambdaGenAnti", "Generated #bar{#Lambda}(1520) p_{T}", kTH1F, {axisPt}); + histos.add("Analysis/hLambdaRec", "Reconstructed #Lambda(1520) p_{T}", kTH1F, {axisPt}); + histos.add("Analysis/hLambdaRecAnti", "Reconstructed #bar{#Lambda}(1520) p_{T}", kTH1F, {axisPt}); + histos.add("Analysis/hInvMassLambdaRec", "Recostructed #Lambda(1520)", kTH1F, {axisInvM}); + histos.add("Analysis/hInvMassLambdaRecAnti", "Recostructed #bar{#Lambda}(1520)", kTH1F, {axisInvM}); + histos.add("Analysis/h4InvMassLambdaRec", "Recostructed #Lambda(1520)", kTHnSparseF, {axisInvM, axisPt, axisSp, axisCent}); + histos.add("Analysis/h4InvMassLambdaRecAnti", "Recostructed #bar{#Lambda}(1520)", kTHnSparseF, {axisInvM, axisPt, axisSp, axisCent}); + } } template @@ -160,6 +190,7 @@ struct lambdaAnalysis { auto kaTofPIDcut = static_cast>(kaonTOFPIDcut); TLorentzVector p1, p2, p; + TRandom* rn = new TRandom(); for (auto const& [trkPr, trkKa] : soa::combinations(soa::CombinationsFullIndexPolicy(trk1, trk2))) { // Do not analyse same index tracks. @@ -235,7 +266,7 @@ struct lambdaAnalysis { } // Fill QA before track selection. - if (!mix) { + if (!mix & !mc) { if (std::abs(trkPr.tpcNSigmaPr()) < 6) { histos.fill(HIST("QAbefore/Proton/hTPCNsigma"), trkPr.pt(), trkPr.tpcNSigmaPr()); if (std::abs(trkPr.tofNSigmaPr()) < 6) { @@ -257,7 +288,7 @@ struct lambdaAnalysis { continue; // Fill QA after track selection. - if (!mix) { + if (!mix && !mc) { histos.fill(HIST("QAafter/Proton/hDcaZ"), trkPr.pt(), trkPr.dcaZ()); histos.fill(HIST("QAafter/Proton/hDcaXY"), trkPr.pt(), trkPr.dcaXY()); histos.fill(HIST("QAafter/Proton/hTPCNsigma"), trkPr.pt(), trkPr.tpcNSigmaPr()); @@ -274,12 +305,6 @@ struct lambdaAnalysis { } } - // Protons and Kaons pT spectra and Pseudorapidity distribution. - histos.fill(HIST("Analysis/hPtProton"), trkPr.pt()); - histos.fill(HIST("Analysis/hEtaProton"), trkPr.eta()); - histos.fill(HIST("Analysis/hPtKaon"), trkKa.pt()); - histos.fill(HIST("Analysis/hEtaKaon"), trkKa.eta()); - // Invariant mass reconstruction. p1.SetXYZM(trkPr.px(), trkPr.py(), trkPr.pz(), massProton); p2.SetXYZM(trkKa.px(), trkKa.py(), trkKa.pz(), massKaon); @@ -289,19 +314,73 @@ struct lambdaAnalysis { continue; // Fill Invariant Mass Histograms. - if (trkPr.sign() * trkKa.sign() < 0) { - if (!mix) { + if constexpr (!mix && !mc) { + + // Protons and Kaons pT spectra and Pseudorapidity distribution. + histos.fill(HIST("Analysis/hPtProton"), trkPr.pt()); + histos.fill(HIST("Analysis/hEtaProton"), trkPr.eta()); + histos.fill(HIST("Analysis/hPtKaon"), trkKa.pt()); + histos.fill(HIST("Analysis/hEtaKaon"), trkKa.eta()); + + if (trkPr.sign() * trkKa.sign() < 0) { histos.fill(HIST("Analysis/hInvMass"), p.M()); histos.fill(HIST("Analysis/h4InvMass"), p.M(), p.Pt(), sph, mult); + if (doRotate) { + float theta = rn->Uniform(0.1, 3.1); + p1.RotateX(theta); + theta = rn->Uniform(0.1, 3.1); + p1.RotateY(theta); + theta = rn->Uniform(0.1, 3.1); + p1.RotateZ(theta); + + p = p1 + p2; + + histos.fill(HIST("Analysis/hInvMassR"), p.M()); + histos.fill(HIST("Analysis/h4InvMassR"), p.M(), p.Pt(), sph, mult); + } } else { - histos.fill(HIST("Analysis/hInvMassMix"), p.M()); - histos.fill(HIST("Analysis/h4InvMassMix"), p.M(), p.Pt(), sph, mult); + histos.fill(HIST("Analysis/hInvMassLS"), p.M()); + histos.fill(HIST("Analysis/h4InvMassLS"), p.M(), p.Pt(), sph, mult); } + continue; } - if (trkPr.sign() * trkKa.sign() > 0 && !mix) { - histos.fill(HIST("Analysis/hInvMassLS"), p.M()); - histos.fill(HIST("Analysis/h4InvMassLS"), p.M(), p.Pt(), sph, mult); + if constexpr (mc) { + if (abs(trkPr.pdgCode()) != 2212 || abs(trkKa.pdgCode()) != 321) + continue; + + if (trkPr.motherId() != trkKa.motherId()) + continue; + + if (abs(trkPr.motherPDG()) != 3124) + continue; + + // Track selection check. + histos.fill(HIST("QAMCTrue/DcaXY_pr"), trkPr.dcaXY()); + histos.fill(HIST("QAMCTrue/DcaXY_ka"), trkKa.dcaXY()); + histos.fill(HIST("QAMCTrue/DcaZ_pr"), trkPr.dcaZ()); + histos.fill(HIST("QAMCTrue/DcaZ_ka"), trkKa.dcaZ()); + + // MC histograms + if (trkPr.motherPDG() > 0) { + histos.fill(HIST("Analysis/hLambdaRec"), p.Pt()); + histos.fill(HIST("Analysis/hInvMassLambdaRec"), p.M()); + histos.fill(HIST("Analysis/h4InvMassLambdaRec"), p.M(), p.Pt(), sph, mult); + } else { + histos.fill(HIST("Analysis/hLambdaRecAnti"), p.Pt()); + histos.fill(HIST("Analysis/hInvMassLambdaRecAnti"), p.M()); + histos.fill(HIST("Analysis/h4InvMassLambdaAnti"), p.M(), p.Pt(), sph, mult); + } + } + + if constexpr (mix) { + if (trkPr.sign() * trkKa.sign() < 0) { + histos.fill(HIST("Analysis/hInvMassMix"), p.M()); + histos.fill(HIST("Analysis/h4InvMassMix"), p.M(), p.Pt(), sph, mult); + } else { + histos.fill(HIST("Analysis/hInvMassMix"), p.M()); + histos.fill(HIST("Analysis/h4InvMassMix"), p.M(), p.Pt(), sph, mult); + } } } } @@ -324,6 +403,45 @@ struct lambdaAnalysis { PROCESS_SWITCH(lambdaAnalysis, processData, "Process for Same Event Data", true); + void processMC(resoCols::iterator const& collision, + soa::Join const& tracks, aod::McParticles const& mcParticles) + { + fillDataHistos(tracks, tracks, collision.spherocity(), collision.multV0M()); + } + PROCESS_SWITCH(lambdaAnalysis, processMC, "Process Event for MC", false); + + void processMCTrue(aod::ResoMCParents const& resoParents) + { + + for (auto const& part : resoParents) { + + if (abs(part.pdgCode()) != 3124) // #Lambda(1520) PDGCode = 3124 + continue; + if (abs(part.y()) > 0.5) { // rapidity cut + continue; + } + + bool pass1 = false; + bool pass2 = false; + + if (abs(part.daughterPDG1()) == 2212 || abs(part.daughterPDG2()) == 2212) { // At least one decay to Proton + pass1 = true; + } + if (abs(part.daughterPDG1()) == 321 || abs(part.daughterPDG2()) == 321) { // At least one decay to Kaon + pass2 = true; + } + + if (!pass1 || !pass2) // If we have both decay products + continue; + + if (part.pdgCode() > 0) + histos.fill(HIST("Analysis/hLambdaGen"), part.pt()); + else + histos.fill(HIST("Analysis/hLambdaGenAnti"), part.pt()); + } + } + PROCESS_SWITCH(lambdaAnalysis, processMCTrue, "Process Event for MC", false); + // Processing Event Mixing SliceCache cache; using BinningType = ColumnBinningPolicy; From 60b4d6f304457e4ed3fd4ee165f8bd194cec3a4e Mon Sep 17 00:00:00 2001 From: yashpatley <52608802+yashpatley@users.noreply.github.com> Date: Fri, 8 Sep 2023 12:03:48 +0530 Subject: [PATCH 2/3] Update lambda1520_spherocity_analysis.cxx --- PWGLF/Tasks/lambda1520_spherocity_analysis.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/lambda1520_spherocity_analysis.cxx b/PWGLF/Tasks/lambda1520_spherocity_analysis.cxx index 395403c8679..2a78d4a8943 100644 --- a/PWGLF/Tasks/lambda1520_spherocity_analysis.cxx +++ b/PWGLF/Tasks/lambda1520_spherocity_analysis.cxx @@ -335,8 +335,10 @@ struct lambdaAnalysis { p = p1 + p2; - histos.fill(HIST("Analysis/hInvMassR"), p.M()); - histos.fill(HIST("Analysis/h4InvMassR"), p.M(), p.Pt(), sph, mult); + if(p.Rapidity() < 0.5){ + histos.fill(HIST("Analysis/hInvMassR"), p.M()); + histos.fill(HIST("Analysis/h4InvMassR"), p.M(), p.Pt(), sph, mult); + } } } else { histos.fill(HIST("Analysis/hInvMassLS"), p.M()); From c6c908eae3d008afbc704fb19c791b144b6e0a10 Mon Sep 17 00:00:00 2001 From: yashpatley <52608802+yashpatley@users.noreply.github.com> Date: Fri, 8 Sep 2023 12:10:52 +0530 Subject: [PATCH 3/3] Update lambda1520_spherocity_analysis.cxx --- PWGLF/Tasks/lambda1520_spherocity_analysis.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/lambda1520_spherocity_analysis.cxx b/PWGLF/Tasks/lambda1520_spherocity_analysis.cxx index 2a78d4a8943..49ce40d04cc 100644 --- a/PWGLF/Tasks/lambda1520_spherocity_analysis.cxx +++ b/PWGLF/Tasks/lambda1520_spherocity_analysis.cxx @@ -335,7 +335,7 @@ struct lambdaAnalysis { p = p1 + p2; - if(p.Rapidity() < 0.5){ + if (p.Rapidity() < 0.5) { histos.fill(HIST("Analysis/hInvMassR"), p.M()); histos.fill(HIST("Analysis/h4InvMassR"), p.M(), p.Pt(), sph, mult); }