From 42c8937e7073953797b1d609a1592b0ccad2ce9f Mon Sep 17 00:00:00 2001 From: Stefano Cannito Date: Thu, 18 Jul 2024 10:33:24 +0200 Subject: [PATCH 01/12] Set MC histos --- PWGLF/Tasks/Strangeness/phik0sanalysis.cxx | 34 +++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx index d90f0d78a5b..e7ed266e39a 100644 --- a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx @@ -82,11 +82,14 @@ static constexpr std::string_view PhiPiSESCut[nMultBin] = {"h2PhiPiSESCut_0_1", struct phik0shortanalysis { // Histograms are defined with HistogramRegistry HistogramRegistry eventHist{"eventHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - HistogramRegistry K0SHist{"K0SHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry MCeventHist{"MCeventHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry PhicandHist{"PhicandHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry K0SHist{"K0SHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry PhipurHist{"PhipurHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry PhiK0SHist{"PhiK0SHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry MCPhiK0SHist{"MCPhiK0SHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry PhiPionHist{"PhiPionHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry MCPhiPionHist{"MCPhiPionHist", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; // Configurable for event selection Configurable cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"}; @@ -206,6 +209,14 @@ struct phik0shortanalysis { eventHist.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(4, "INEL>0 cut"); eventHist.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(5, "With at least a #phi cand"); + // Number of MC events per selection + MCeventHist.add("hMCEventSelection", "hMCEVentSelection", kTH1F, {{6, -0.5f, 5.5f}}); + MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(1, "All collisions"); + MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(2, "sel8 cut"); + MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(3, "posZ cut"); + MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(4, "INEL>0 cut"); + MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(5, "With at least a #phi cand"); + // Event information eventHist.add("hVertexZRec", "hVertexZRec", kTH1F, {vertexZAxis}); eventHist.add("hMultiplicityPercent", "Multiplicity Percentile", kTH1F, {multAxis}); @@ -273,6 +284,27 @@ struct phik0shortanalysis { return true; } + // MC Event selection and QA filling + template + bool acceptMCEventQA(const T& collision) + { + eventHist.fill(HIST("hEventSelection"), 0); // all collisions + if (!collision.selection_bit(aod::evsel::kIsTriggerTVX)) + return false; + eventHist.fill(HIST("hEventSelection"), 1); // kIsTriggerTVX collisions + if (!collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) + return false; + eventHist.fill(HIST("hEventSelection"), 2); // kNoTimeFrameBorder collisions + if (std::abs(collision.posZ()) > cutzvertex) + return false; + eventHist.fill(HIST("hEventSelection"), 3); // vertex-Z selected + eventHist.fill(HIST("hVertexZRec"), collision.posZ()); + if (!collision.isInelGt0()) + return false; + eventHist.fill(HIST("hEventSelection"), 4); // INEL>0 collisions + return true; + } + // Single track selection for strangeness sector template bool selectionTrackStrangeness(const T& track) From 4d6984a6a5b4f920f18064eb529deb2274b7e659 Mon Sep 17 00:00:00 2001 From: Stefano Cannito Date: Thu, 18 Jul 2024 11:05:02 +0200 Subject: [PATCH 02/12] Accept MCevent --- PWGLF/Tasks/Strangeness/phik0sanalysis.cxx | 48 +++++++++++++--------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx index e7ed266e39a..c550bb2ab74 100644 --- a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx @@ -202,30 +202,30 @@ struct phik0shortanalysis { // Histograms // Number of events per selection - eventHist.add("hEventSelection", "hEVentSelection", kTH1F, {{5, -0.5f, 4.5f}}); + eventHist.add("hEventSelection", "hEventSelection", kTH1F, {{5, -0.5f, 4.5f}}); eventHist.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(1, "All collisions"); eventHist.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(2, "sel8 cut"); eventHist.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(3, "posZ cut"); eventHist.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(4, "INEL>0 cut"); eventHist.get(HIST("hEventSelection"))->GetXaxis()->SetBinLabel(5, "With at least a #phi cand"); - // Number of MC events per selection - MCeventHist.add("hMCEventSelection", "hMCEVentSelection", kTH1F, {{6, -0.5f, 5.5f}}); - MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(1, "All collisions"); - MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(2, "sel8 cut"); - MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(3, "posZ cut"); - MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(4, "INEL>0 cut"); - MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(5, "With at least a #phi cand"); - // Event information eventHist.add("hVertexZRec", "hVertexZRec", kTH1F, {vertexZAxis}); eventHist.add("hMultiplicityPercent", "Multiplicity Percentile", kTH1F, {multAxis}); - // K0S topological/PID cuts - K0SHist.add("hDCAV0Daughters", "hDCAV0Daughters", kTH1F, {{55, 0.0f, 2.2f}}); - K0SHist.add("hV0CosPA", "hV0CosPA", kTH1F, {{100, 0.95f, 1.f}}); - K0SHist.add("hNSigmaPosPionFromK0S", "hNSigmaPosPionFromK0Short", kTH2F, {ptAxis, {100, -5.f, 5.f}}); - K0SHist.add("hNSigmaNegPionFromK0S", "hNSigmaNegPionFromK0Short", kTH2F, {ptAxis, {100, -5.f, 5.f}}); + // Number of MC events per selection + MCeventHist.add("hMCEventSelection", "hMCEventSelection", kTH1F, {{7, -0.5f, 6.5f}}); + MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(1, "All collisions"); + MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(2, "kIsTriggerTVX"); + MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(3, "kNoTimeFrameBorder"); + MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(4, "sel8 cut"); + MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(5, "posZ cut"); + MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(6, "INEL>0 cut"); + MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(7, "With at least a #phi cand"); + + // MC Event information + MCeventHist.add("hMCVertexZRec", "hMCVertexZRec", kTH1F, {vertexZAxis}); + MCeventHist.add("hMCMultiplicityPercent", "MC Multiplicity Percentile", kTH1F, {multAxis}); // Phi tpological/PID cuts PhicandHist.add("hEta", "Eta distribution", kTH1F, {{200, -1.0f, 1.0f}}); @@ -234,6 +234,12 @@ struct phik0shortanalysis { PhicandHist.add("hNsigmaKaonTPC", "NsigmaKaon TPC distribution", kTH2F, {ptAxis, {100, -10.0f, 10.0f}}); PhicandHist.add("hNsigmaKaonTOF", "NsigmaKaon TOF distribution", kTH2F, {ptAxis, {100, -10.0f, 10.0f}}); + // K0S topological/PID cuts + K0SHist.add("hDCAV0Daughters", "hDCAV0Daughters", kTH1F, {{55, 0.0f, 2.2f}}); + K0SHist.add("hV0CosPA", "hV0CosPA", kTH1F, {{100, 0.95f, 1.f}}); + K0SHist.add("hNSigmaPosPionFromK0S", "hNSigmaPosPionFromK0Short", kTH2F, {ptAxis, {100, -5.f, 5.f}}); + K0SHist.add("hNSigmaNegPionFromK0S", "hNSigmaNegPionFromK0Short", kTH2F, {ptAxis, {100, -5.f, 5.f}}); + // Phi invariant mass for computing purities and normalisation PhipurHist.add("h2PhipurInvMass", "Invariant mass of Phi for Purity (no K0S/Pi)", kTH2F, {multAxis, PhimassAxis}); PhipurHist.add("h2PhipurK0SInvMassInclusive", "Invariant mass of Phi for Purity (K0S) Inclusive", kTH2F, {multAxis, PhimassAxis}); @@ -288,20 +294,22 @@ struct phik0shortanalysis { template bool acceptMCEventQA(const T& collision) { - eventHist.fill(HIST("hEventSelection"), 0); // all collisions + MCeventHist.fill(HIST("hMCEventSelection"), 0); // all collisions if (!collision.selection_bit(aod::evsel::kIsTriggerTVX)) return false; - eventHist.fill(HIST("hEventSelection"), 1); // kIsTriggerTVX collisions + MCeventHist.fill(HIST("hMCEventSelection"), 1); // kIsTriggerTVX collisions if (!collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) return false; - eventHist.fill(HIST("hEventSelection"), 2); // kNoTimeFrameBorder collisions + MCeventHist.fill(HIST("hMCEventSelection"), 2); // kNoTimeFrameBorder collisions + if (collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) + MCeventHist.fill(HIST("hMCEventSelection"), 3); // kNoITSROFrameBorder collisions (not requested in the selection, but useful for QA) if (std::abs(collision.posZ()) > cutzvertex) return false; - eventHist.fill(HIST("hEventSelection"), 3); // vertex-Z selected - eventHist.fill(HIST("hVertexZRec"), collision.posZ()); + MCeventHist.fill(HIST("hMCEventSelection"), 4); // vertex-Z selected + MCeventHist.fill(HIST("hMCVertexZRec"), collision.posZ()); if (!collision.isInelGt0()) return false; - eventHist.fill(HIST("hEventSelection"), 4); // INEL>0 collisions + MCeventHist.fill(HIST("hMCEventSelection"), 5); // INEL>0 collisions return true; } From a7be0dac39133632e8ef703468be4d79f46e02c2 Mon Sep 17 00:00:00 2001 From: Stefano Cannito Date: Sat, 20 Jul 2024 18:11:47 +0200 Subject: [PATCH 03/12] Completed accepMCEvent --- PWGLF/Tasks/Strangeness/phik0sanalysis.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx index c550bb2ab74..189e9d76d01 100644 --- a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx @@ -218,10 +218,10 @@ struct phik0shortanalysis { MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(1, "All collisions"); MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(2, "kIsTriggerTVX"); MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(3, "kNoTimeFrameBorder"); - MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(4, "sel8 cut"); + MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(4, "kNoITSROFrameBorder"); MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(5, "posZ cut"); MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(6, "INEL>0 cut"); - MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(7, "With at least a #phi cand"); + MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(7, "With at least a #phi"); // MC Event information MCeventHist.add("hMCVertexZRec", "hMCVertexZRec", kTH1F, {vertexZAxis}); From a0d20b37db8d846ea176080f44d80a65fe0de526 Mon Sep 17 00:00:00 2001 From: Stefano Cannito Date: Mon, 22 Jul 2024 15:11:09 +0200 Subject: [PATCH 04/12] V0DauMCTracks alias --- PWGLF/Tasks/Strangeness/phik0sanalysis.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx index 189e9d76d01..55bec84c418 100644 --- a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx @@ -171,9 +171,10 @@ struct phik0shortanalysis { // Defining the type of the V0s using FullV0s = soa::Filtered; - // Defining the type of the tracks + // Defining the type of the tracks for data and MC using FullTracks = soa::Join; using V0DauTracks = soa::Join; + using V0DauMCTracks = soa::Join; // Defining the binning policy for mixed event using BinningTypeVertexContributor = ColumnBinningPolicy; From cf1d5c14276d2a502c05f292c4095602bad127aa Mon Sep 17 00:00:00 2001 From: Stefano Cannito Date: Tue, 23 Jul 2024 13:17:59 +0200 Subject: [PATCH 05/12] Added histos for GenMC --- PWGLF/Tasks/Strangeness/phik0sanalysis.cxx | 79 ++++++++++++++++------ 1 file changed, 58 insertions(+), 21 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx index 55bec84c418..2fea31db3c7 100644 --- a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx @@ -166,13 +166,15 @@ struct phik0shortanalysis { // Defining the type of the collisions for data and MC using SelCollisions = soa::Join; - using MCCollisions = soa::Join; + using SimCollisions = soa::Join; // Defining the type of the V0s using FullV0s = soa::Filtered; // Defining the type of the tracks for data and MC using FullTracks = soa::Join; + using FullMCTracks = soa::Join; + using V0DauTracks = soa::Join; using V0DauMCTracks = soa::Join; @@ -214,19 +216,29 @@ struct phik0shortanalysis { eventHist.add("hVertexZRec", "hVertexZRec", kTH1F, {vertexZAxis}); eventHist.add("hMultiplicityPercent", "Multiplicity Percentile", kTH1F, {multAxis}); - // Number of MC events per selection - MCeventHist.add("hMCEventSelection", "hMCEventSelection", kTH1F, {{7, -0.5f, 6.5f}}); - MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(1, "All collisions"); - MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(2, "kIsTriggerTVX"); - MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(3, "kNoTimeFrameBorder"); - MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(4, "kNoITSROFrameBorder"); - MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(5, "posZ cut"); - MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(6, "INEL>0 cut"); - MCeventHist.get(HIST("hMCEventSelection"))->GetXaxis()->SetBinLabel(7, "With at least a #phi"); - - // MC Event information - MCeventHist.add("hMCVertexZRec", "hMCVertexZRec", kTH1F, {vertexZAxis}); - MCeventHist.add("hMCMultiplicityPercent", "MC Multiplicity Percentile", kTH1F, {multAxis}); + // Number of MC events per selection for Rec and Gen + MCeventHist.add("hRecMCEventSelection", "hRecMCEventSelection", kTH1F, {{7, -0.5f, 6.5f}}); + MCeventHist.get(HIST("hRecMCEventSelection"))->GetXaxis()->SetBinLabel(1, "All collisions"); + MCeventHist.get(HIST("hRecMCEventSelection"))->GetXaxis()->SetBinLabel(2, "kIsTriggerTVX"); + MCeventHist.get(HIST("hRecMCEventSelection"))->GetXaxis()->SetBinLabel(3, "kNoTimeFrameBorder"); + MCeventHist.get(HIST("hRecMCEventSelection"))->GetXaxis()->SetBinLabel(4, "kNoITSROFrameBorder"); + MCeventHist.get(HIST("hRecMCEventSelection"))->GetXaxis()->SetBinLabel(5, "posZ cut"); + MCeventHist.get(HIST("hRecMCEventSelection"))->GetXaxis()->SetBinLabel(6, "INEL>0 cut"); + MCeventHist.get(HIST("hRecMCEventSelection"))->GetXaxis()->SetBinLabel(7, "With at least a #phi"); + + MCeventHist.add("hGenMCEventSelection", "hGenMCEventSelection", kTH1F, {{5, -0.5f, 4.5f}}); + MCeventHist.get(HIST("hGenMCEventSelection"))->GetXaxis()->SetBinLabel(1, "All collisions"); + MCeventHist.get(HIST("hGenMCEventSelection"))->GetXaxis()->SetBinLabel(2, "posZ cut"); + MCeventHist.get(HIST("hGenMCEventSelection"))->GetXaxis()->SetBinLabel(3, "INEL>0 cut"); + MCeventHist.get(HIST("hGenMCEventSelection"))->GetXaxis()->SetBinLabel(4, "With at least a rec coll"); + MCeventHist.get(HIST("hGenMCEventSelection"))->GetXaxis()->SetBinLabel(5, "With at least a #phi"); + + // MC Event information for Rec and Gen + MCeventHist.add("hRecMCVertexZRec", "hRecMCVertexZRec", kTH1F, {vertexZAxis}); + MCeventHist.add("hRecMCMultiplicityPercent", "RecMC Multiplicity Percentile", kTH1F, {multAxis}); + + MCeventHist.add("hGenMCVertexZRec", "hGenMCVertexZRec", kTH1F, {vertexZAxis}); + MCeventHist.add("hGenMCMultiplicityPercent", "GenMC Multiplicity Percentile", kTH1F, {multAxis}); // Phi tpological/PID cuts PhicandHist.add("hEta", "Eta distribution", kTH1F, {{200, -1.0f, 1.0f}}); @@ -261,6 +273,16 @@ struct phik0shortanalysis { PhiK0SHist.add("h3PhiK0SInvMassMixedEventFirstCut", "2D Invariant mass of Phi and K0Short for Mixed Event Deltay < FirstCut", kTH3F, {multAxis, K0SmassAxis, PhimassAxis}); PhiK0SHist.add("h3PhiK0SInvMassMixedEventSecondCut", "2D Invariant mass of Phi and K0Short for Mixed Event Deltay < SecondCut", kTH3F, {multAxis, K0SmassAxis, PhimassAxis}); + // MC 2D mass for Phi and K0S + MCPhiK0SHist.add("h3PhiK0SInvMassRecMCInclusive", "2D Invariant mass of Phi and K0Short for RecMC Inclusive", kTH3F, {multAxis, K0SmassAxis, PhimassAxis}); + MCPhiK0SHist.add("h3PhiK0SInvMassRecMCFirstCut", "2D Invariant mass of Phi and K0Short for RecMC Deltay < FirstCut", kTH3F, {multAxis, K0SmassAxis, PhimassAxis}); + MCPhiK0SHist.add("h3PhiK0SInvMassRecMCSecondCut", "2D Invariant mass of Phi and K0Short for RecMC Deltay < SecondCut", kTH3F, {multAxis, K0SmassAxis, PhimassAxis}); + + // GenMC pT of K0S coupled to Phi + MCPhiK0SHist.add("h2PhiK0SpTGenMCInclusive", "pT of K0Short coupled to Phi for GenMC Inclusive", kTH2F, {multAxis, ptAxis}); + MCPhiK0SHist.add("h2PhiK0SpTGenMCFirstCut", "pT of K0Short coupled to Phi for GenMC Deltay < FirstCut", kTH2F, {multAxis, ptAxis}); + MCPhiK0SHist.add("h2PhiK0SpTGenMCSecondCut", "pT of K0Short coupled to Phi for GenMC Deltay < SecondCut", kTH2F, {multAxis, ptAxis}); + // Phi mass vs Pion NSigma dE/dx for (int i = 0; i < nMultBin; i++) { PhiPionHist.add(PhiPiSEInc[i].data(), "Phi Invariant mass vs Pion nSigma dE/dx for Same Event Inclusive", kTH3F, {ptAxis, {100, -10.0f, 10.0f}, cfgPhimassAxisInc.at(i)}); @@ -271,6 +293,16 @@ struct phik0shortanalysis { PhiPionHist.add("h4PhiInvMassPiNSigmadEdxMixedEventInclusive", "Phi Invariant mass vs Pion nSigma dE/dx for Mixed Event Inclusive", kTHnSparseF, {multAxis, ptAxis, {100, -10.0f, 10.0f}, PhimassAxis}); PhiPionHist.add("h4PhiInvMassPiNSigmadEdxMixedEventFirstCut", "Phi Invariant mass vs Pion nSigma dE/dx for Mixed Event Deltay < FirstCut", kTHnSparseF, {multAxis, ptAxis, {100, -10.0f, 10.0f}, PhimassAxis}); PhiPionHist.add("h4PhiInvMassPiNSigmadEdxMixedEventSecondCut", "Phi Invariant mass vs Pion nSigma dE/dx for Mixed Event Deltay < SecondCut", kTHnSparseF, {multAxis, ptAxis, {100, -10.0f, 10.0f}, PhimassAxis}); + + // MC Phi mass vs Pion NSigma dE/dx + MCPhiPionHist.add("h4PhiInvMassPiNSigmadEdxRecMCInclusive", "Phi Invariant mass vs Pion nSigma dE/dx for RecMC Inclusive", kTHnSparseF, {multAxis, ptAxis, {100, -10.0f, 10.0f}, PhimassAxis}); + MCPhiPionHist.add("h4PhiInvMassPiNSigmadEdxRecMCFirstCut", "Phi Invariant mass vs Pion nSigma dE/dx for RecMC Deltay < FirstCut", kTHnSparseF, {multAxis, ptAxis, {100, -10.0f, 10.0f}, PhimassAxis}); + MCPhiPionHist.add("h4PhiInvMassPiNSigmadEdxRecMCSecondCut", "Phi Invariant mass vs Pion nSigma dE/dx for RecMC Deltay < SecondCut", kTHnSparseF, {multAxis, ptAxis, {100, -10.0f, 10.0f}, PhimassAxis}); + + // GenMC pT of Pion coupled to Phi + MCPhiPionHist.add("h2PhiPiPionpTGenMCInclusive", "pT of Pion coupled to Phi for GenMC Inclusive", kTH2F, {multAxis, ptAxis}); + MCPhiPionHist.add("h2PhiPiPionpTGenMCFirstCut", "pT of Pion coupled to Phi for GenMC Deltay < FirstCut", kTH2F, {multAxis, ptAxis}); + MCPhiPionHist.add("h2PhiPiPionpTGenMCSecondCut", "pT of Pion coupled to Phi for GenMC Deltay < SecondCut", kTH2F, {multAxis, ptAxis}); } // Event selection and QA filling @@ -295,22 +327,22 @@ struct phik0shortanalysis { template bool acceptMCEventQA(const T& collision) { - MCeventHist.fill(HIST("hMCEventSelection"), 0); // all collisions + MCeventHist.fill(HIST("hRecMCEventSelection"), 0); // all collisions if (!collision.selection_bit(aod::evsel::kIsTriggerTVX)) return false; - MCeventHist.fill(HIST("hMCEventSelection"), 1); // kIsTriggerTVX collisions + MCeventHist.fill(HIST("hRecMCEventSelection"), 1); // kIsTriggerTVX collisions if (!collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) return false; - MCeventHist.fill(HIST("hMCEventSelection"), 2); // kNoTimeFrameBorder collisions + MCeventHist.fill(HIST("hRecMCEventSelection"), 2); // kNoTimeFrameBorder collisions if (collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) - MCeventHist.fill(HIST("hMCEventSelection"), 3); // kNoITSROFrameBorder collisions (not requested in the selection, but useful for QA) + MCeventHist.fill(HIST("hRecMCEventSelection"), 3); // kNoITSROFrameBorder collisions (not requested in the selection, but useful for QA) if (std::abs(collision.posZ()) > cutzvertex) return false; - MCeventHist.fill(HIST("hMCEventSelection"), 4); // vertex-Z selected - MCeventHist.fill(HIST("hMCVertexZRec"), collision.posZ()); + MCeventHist.fill(HIST("hRecMCEventSelection"), 4); // vertex-Z selected + MCeventHist.fill(HIST("hRecMCVertexZRec"), collision.posZ()); if (!collision.isInelGt0()) return false; - MCeventHist.fill(HIST("hMCEventSelection"), 5); // INEL>0 collisions + MCeventHist.fill(HIST("hRecMCEventSelection"), 5); // INEL>0 collisions return true; } @@ -1101,6 +1133,11 @@ struct phik0shortanalysis { } PROCESS_SWITCH(phik0shortanalysis, processMEPhiPion, "Process Mixed Event for Phi-Pion Analysis", false); + + void processMCEffPhiK0S() + { + + } }; WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) From a701e67ab8a814e71f67d653f979ed1d54eb92b1 Mon Sep 17 00:00:00 2001 From: Stefano Cannito Date: Wed, 24 Jul 2024 12:12:17 +0200 Subject: [PATCH 06/12] Updated acceptEventQA and fill methods --- PWGLF/Tasks/Strangeness/phik0sanalysis.cxx | 209 ++++++++++++--------- 1 file changed, 122 insertions(+), 87 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx index 2fea31db3c7..57d09ee7baf 100644 --- a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx @@ -77,6 +77,20 @@ static constexpr std::string_view PhiPiSEFCut[nMultBin] = {"h2PhiPiSEFCut_0_1", "h2PhiPiSEFCut_20_30", "h2PhiPiSEFCut_30_40", "h2PhiPiSEFCut_40_50", "h2PhiPiSEFCut_50_70", "h2PhiPiSEFCut_70_100"}; static constexpr std::string_view PhiPiSESCut[nMultBin] = {"h2PhiPiSESCut_0_1", "h2PhiPiSESCut_1_5", "h2PhiPiSESCut_5_10", "h2PhiPiSESCut_10_15", "h2PhiPiSESCut_15_20", "h2PhiPiSESCut_20_30", "h2PhiPiSESCut_30_40", "h2PhiPiSESCut_40_50", "h2PhiPiSESCut_50_70", "h2PhiPiSESCut_70_100"}; + +static constexpr std::string_view MCPhiK0SSEInc[nMultBin] = {"h2MCPhiK0SSEInc_0_1", "h2MCPhiK0SSEInc_1_5", "h2MCPhiK0SSEInc_5_10", "h2MCPhiK0SSEInc_10_15", "h2MCPhiK0SSEInc_15_20", + "h2MCPhiK0SSEInc_20_30", "h2MCPhiK0SSEInc_30_40", "h2MCPhiK0SSEInc_40_50", "h2MCPhiK0SSEInc_50_70", "h2MCPhiK0SSEInc_70_100"}; +static constexpr std::string_view MCPhiK0SSEFCut[nMultBin] = {"h2MCPhiK0SSEFCut_0_1", "h2MCPhiK0SSEFCut_1_5", "h2MCPhiK0SSEFCut_5_10", "h2MCPhiK0SSEFCut_10_15", "h2MCPhiK0SSEFCut_15_20", + "h2MCPhiK0SSEFCut_20_30", "h2MCPhiK0SSEFCut_30_40", "h2MCPhiK0SSEFCut_40_50", "h2MCPhiK0SSEFCut_50_70", "h2MCPhiK0SSEFCut_70_100"}; +static constexpr std::string_view MCPhiK0SSESCut[nMultBin] = {"h2MCPhiK0SSESCut_0_1", "h2MCPhiK0SSESCut_1_5", "h2MCPhiK0SSESCut_5_10", "h2MCPhiK0SSESCut_10_15", "h2MCPhiK0SSESCut_15_20", + "h2MCPhiK0SSESCut_20_30", "h2MCPhiK0SSESCut_30_40", "h2MCPhiK0SSESCut_40_50", "h2MCPhiK0SSESCut_50_70", "h2MCPhiK0SSESCut_70_100"}; + +static constexpr std::string_view MCPhiPiSEInc[nMultBin] = {"h2MCPhiPiSEInc_0_1", "h2MCPhiPiSEInc_1_5", "h2MCPhiPiSEInc_5_10", "h2MCPhiPiSEInc_10_15", "h2MCPhiPiSEInc_15_20", + "h2MCPhiPiSEInc_20_30", "h2MCPhiPiSEInc_30_40", "h2MCPhiPiSEInc_40_50", "h2MCPhiPiSEInc_50_70", "h2MCPhiPiSEInc_70_100"}; +static constexpr std::string_view MCPhiPiSEFCut[nMultBin] = {"h2MCPhiPiSEFCut_0_1", "h2MCPhiPiSEFCut_1_5", "h2MCPhiPiSEFCut_5_10", "h2MCPhiPiSEFCut_10_15", "h2MCPhiPiSEFCut_15_20", + "h2MCPhiPiSEFCut_20_30", "h2MCPhiPiSEFCut_30_40", "h2MCPhiPiSEFCut_40_50", "h2MCPhiPiSEFCut_50_70", "h2MCPhiPiSEFCut_70_100"}; +static constexpr std::string_view MCPhiPiSESCut[nMultBin] = {"h2MCPhiPiSESCut_0_1", "h2MCPhiPiSESCut_1_5", "h2MCPhiPiSESCut_5_10", "h2MCPhiPiSESCut_10_15", "h2MCPhiPiSESCut_15_20", + "h2MCPhiPiSESCut_20_30", "h2MCPhiPiSESCut_30_40", "h2MCPhiPiSESCut_40_50", "h2MCPhiPiSESCut_50_70", "h2MCPhiPiSESCut_70_100"}; } // namespace struct phik0shortanalysis { @@ -262,7 +276,7 @@ struct phik0shortanalysis { PhipurHist.add("h3PhipurPiInvMassFirstCut", "Invariant mass of Phi for Purity (Pi) Deltay < FirstCut", kTH3F, {multAxis, ptAxis, PhimassAxis}); PhipurHist.add("h3PhipurPiInvMassSecondCut", "Invariant mass of Phi for Purity (Pi) Deltay < SecondCut", kTH3F, {multAxis, ptAxis, PhimassAxis}); - // 2D mass for Phi and K0S + // 2D mass for Phi and K0S for Same Event and Mixed Event for (int i = 0; i < nMultBin; i++) { PhiK0SHist.add(PhiK0SSEInc[i].data(), "2D Invariant mass of Phi and K0Short for Same Event Inclusive", kTH2F, {K0SmassAxis, cfgPhimassAxisInc.at(i)}); PhiK0SHist.add(PhiK0SSEFCut[i].data(), "2D Invariant mass of Phi and K0Short for Same Event Deltay < FirstCut", kTH2F, {K0SmassAxis, cfgPhimassAxisFCut.at(i)}); @@ -274,16 +288,18 @@ struct phik0shortanalysis { PhiK0SHist.add("h3PhiK0SInvMassMixedEventSecondCut", "2D Invariant mass of Phi and K0Short for Mixed Event Deltay < SecondCut", kTH3F, {multAxis, K0SmassAxis, PhimassAxis}); // MC 2D mass for Phi and K0S - MCPhiK0SHist.add("h3PhiK0SInvMassRecMCInclusive", "2D Invariant mass of Phi and K0Short for RecMC Inclusive", kTH3F, {multAxis, K0SmassAxis, PhimassAxis}); - MCPhiK0SHist.add("h3PhiK0SInvMassRecMCFirstCut", "2D Invariant mass of Phi and K0Short for RecMC Deltay < FirstCut", kTH3F, {multAxis, K0SmassAxis, PhimassAxis}); - MCPhiK0SHist.add("h3PhiK0SInvMassRecMCSecondCut", "2D Invariant mass of Phi and K0Short for RecMC Deltay < SecondCut", kTH3F, {multAxis, K0SmassAxis, PhimassAxis}); + for (int i = 0; i < nMultBin; i++) { + MCPhiK0SHist.add(MCPhiK0SSEInc[i].data(), "2D Invariant mass of Phi and K0Short for RecMC Inclusive", kTH2F, {K0SmassAxis, cfgPhimassAxisInc.at(i)}); + MCPhiK0SHist.add(MCPhiK0SSEFCut[i].data(), "2D Invariant mass of Phi and K0Short for RecMC Deltay < FirstCut", kTH2F, {K0SmassAxis, cfgPhimassAxisFCut.at(i)}); + MCPhiK0SHist.add(MCPhiK0SSESCut[i].data(), "2D Invariant mass of Phi and K0Short for RecMC Deltay < SecondCut", kTH2F, {K0SmassAxis, cfgPhimassAxisSCut.at(i)}); + } // GenMC pT of K0S coupled to Phi MCPhiK0SHist.add("h2PhiK0SpTGenMCInclusive", "pT of K0Short coupled to Phi for GenMC Inclusive", kTH2F, {multAxis, ptAxis}); MCPhiK0SHist.add("h2PhiK0SpTGenMCFirstCut", "pT of K0Short coupled to Phi for GenMC Deltay < FirstCut", kTH2F, {multAxis, ptAxis}); MCPhiK0SHist.add("h2PhiK0SpTGenMCSecondCut", "pT of K0Short coupled to Phi for GenMC Deltay < SecondCut", kTH2F, {multAxis, ptAxis}); - // Phi mass vs Pion NSigma dE/dx + // Phi mass vs Pion NSigma dE/dx for Same Event and Mixed Event for (int i = 0; i < nMultBin; i++) { PhiPionHist.add(PhiPiSEInc[i].data(), "Phi Invariant mass vs Pion nSigma dE/dx for Same Event Inclusive", kTH3F, {ptAxis, {100, -10.0f, 10.0f}, cfgPhimassAxisInc.at(i)}); PhiPionHist.add(PhiPiSEFCut[i].data(), "Phi Invariant mass vs Pion nSigma dE/dx for Same Event Deltay < FirstCut", kTH3F, {ptAxis, {100, -10.0f, 10.0f}, cfgPhimassAxisFCut.at(i)}); @@ -295,9 +311,11 @@ struct phik0shortanalysis { PhiPionHist.add("h4PhiInvMassPiNSigmadEdxMixedEventSecondCut", "Phi Invariant mass vs Pion nSigma dE/dx for Mixed Event Deltay < SecondCut", kTHnSparseF, {multAxis, ptAxis, {100, -10.0f, 10.0f}, PhimassAxis}); // MC Phi mass vs Pion NSigma dE/dx - MCPhiPionHist.add("h4PhiInvMassPiNSigmadEdxRecMCInclusive", "Phi Invariant mass vs Pion nSigma dE/dx for RecMC Inclusive", kTHnSparseF, {multAxis, ptAxis, {100, -10.0f, 10.0f}, PhimassAxis}); - MCPhiPionHist.add("h4PhiInvMassPiNSigmadEdxRecMCFirstCut", "Phi Invariant mass vs Pion nSigma dE/dx for RecMC Deltay < FirstCut", kTHnSparseF, {multAxis, ptAxis, {100, -10.0f, 10.0f}, PhimassAxis}); - MCPhiPionHist.add("h4PhiInvMassPiNSigmadEdxRecMCSecondCut", "Phi Invariant mass vs Pion nSigma dE/dx for RecMC Deltay < SecondCut", kTHnSparseF, {multAxis, ptAxis, {100, -10.0f, 10.0f}, PhimassAxis}); + for (int i = 0; i < nMultBin; i++) { + MCPhiPionHist.add(MCPhiPiSEInc[i].data(), "Phi Invariant mass vs Pion nSigma dE/dx for RecMC Inclusive", kTH3F, {ptAxis, {100, -10.0f, 10.0f}, cfgPhimassAxisInc.at(i)}); + MCPhiPionHist.add(MCPhiPiSEFCut[i].data(), "Phi Invariant mass vs Pion nSigma dE/dx for RecMC Deltay < FirstCut", kTH3F, {ptAxis, {100, -10.0f, 10.0f}, cfgPhimassAxisFCut.at(i)}); + MCPhiPionHist.add(MCPhiPiSESCut[i].data(), "Phi Invariant mass vs Pion nSigma dE/dx for RecMC Deltay < SecondCut", kTH3F, {ptAxis, {100, -10.0f, 10.0f}, cfgPhimassAxisSCut.at(i)}); + } // GenMC pT of Pion coupled to Phi MCPhiPionHist.add("h2PhiPiPionpTGenMCInclusive", "pT of Pion coupled to Phi for GenMC Inclusive", kTH2F, {multAxis, ptAxis}); @@ -306,44 +324,41 @@ struct phik0shortanalysis { } // Event selection and QA filling - template + template bool acceptEventQA(const T& collision) { - eventHist.fill(HIST("hEventSelection"), 0); // all collisions - if (!collision.sel8()) - return false; - eventHist.fill(HIST("hEventSelection"), 1); // sel8 collisions - if (std::abs(collision.posZ()) > cutzvertex) - return false; - eventHist.fill(HIST("hEventSelection"), 2); // vertex-Z selected - eventHist.fill(HIST("hVertexZRec"), collision.posZ()); - if (!collision.isInelGt0()) - return false; - eventHist.fill(HIST("hEventSelection"), 3); // INEL>0 collisions - return true; - } - - // MC Event selection and QA filling - template - bool acceptMCEventQA(const T& collision) - { - MCeventHist.fill(HIST("hRecMCEventSelection"), 0); // all collisions - if (!collision.selection_bit(aod::evsel::kIsTriggerTVX)) - return false; - MCeventHist.fill(HIST("hRecMCEventSelection"), 1); // kIsTriggerTVX collisions - if (!collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) - return false; - MCeventHist.fill(HIST("hRecMCEventSelection"), 2); // kNoTimeFrameBorder collisions - if (collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) - MCeventHist.fill(HIST("hRecMCEventSelection"), 3); // kNoITSROFrameBorder collisions (not requested in the selection, but useful for QA) - if (std::abs(collision.posZ()) > cutzvertex) - return false; - MCeventHist.fill(HIST("hRecMCEventSelection"), 4); // vertex-Z selected - MCeventHist.fill(HIST("hRecMCVertexZRec"), collision.posZ()); - if (!collision.isInelGt0()) - return false; - MCeventHist.fill(HIST("hRecMCEventSelection"), 5); // INEL>0 collisions - return true; + if constexpr (!isMC) { // data event + eventHist.fill(HIST("hEventSelection"), 0); // all collisions + if (!collision.sel8()) + return false; + eventHist.fill(HIST("hEventSelection"), 1); // sel8 collisions + if (std::abs(collision.posZ()) > cutzvertex) + return false; + eventHist.fill(HIST("hEventSelection"), 2); // vertex-Z selected + eventHist.fill(HIST("hVertexZRec"), collision.posZ()); + if (!collision.isInelGt0()) + return false; + eventHist.fill(HIST("hEventSelection"), 3); // INEL>0 collisions + return true; + } else { // RecMC event + MCeventHist.fill(HIST("hRecMCEventSelection"), 0); // all collisions + if (!collision.selection_bit(aod::evsel::kIsTriggerTVX)) + return false; + MCeventHist.fill(HIST("hRecMCEventSelection"), 1); // kIsTriggerTVX collisions + if (!collision.selection_bit(aod::evsel::kNoTimeFrameBorder)) + return false; + MCeventHist.fill(HIST("hRecMCEventSelection"), 2); // kNoTimeFrameBorder collisions + if (collision.selection_bit(aod::evsel::kNoITSROFrameBorder)) + MCeventHist.fill(HIST("hRecMCEventSelection"), 3); // kNoITSROFrameBorder collisions (not requested in the selection, but useful for QA) + if (std::abs(collision.posZ()) > cutzvertex) + return false; + MCeventHist.fill(HIST("hRecMCEventSelection"), 4); // vertex-Z selected + MCeventHist.fill(HIST("hRecMCVertexZRec"), collision.posZ()); + if (!collision.isInelGt0()) + return false; + MCeventHist.fill(HIST("hRecMCEventSelection"), 5); // INEL>0 collisions + return true; + } } // Single track selection for strangeness sector @@ -456,7 +471,7 @@ struct phik0shortanalysis { } // Fill 2D invariant mass histogram for V0 and Phi - template + template void fillInvMass2D(TLorentzVector V0, const std::vector listPhi, float multiplicity, double weightInclusive, double weightLtFirstCut, double weightLtSecondCut) { double massV0 = V0.M(); @@ -484,11 +499,21 @@ struct phik0shortanalysis { continue; PhiK0SHist.fill(HIST("h3PhiK0SInvMassMixedEventSecondCut"), multiplicity, massV0, massPhi, weightLtSecondCut); } + + if constexpr (isMC) { // MC event + MCPhiK0SHist.fill(HIST(MCPhiK0SSEInc[iBin]), massV0, massPhi, weightInclusive); + if (deltay > cfgFirstCutonDeltay) + continue; + MCPhiK0SHist.fill(HIST(MCPhiK0SSEFCut[iBin]), massV0, massPhi, weightLtFirstCut); + if (deltay > cfgSecondCutonDeltay) + continue; + MCPhiK0SHist.fill(HIST(MCPhiK0SSESCut[iBin]), massV0, massPhi, weightLtSecondCut); + } } } // Fill Phi invariant mass vs Pion nSigmadE/dx histogram - template + template void fillInvMassNSigmadEdx(TLorentzVector Pi, float nSigmadEdxPi, const std::vector listPhi, float multiplicity, double weightInclusive, double weightLtFirstCut, double weightLtSecondCut) { double rapidityPi = Pi.Rapidity(); @@ -516,13 +541,23 @@ struct phik0shortanalysis { continue; PhiPionHist.fill(HIST("h4PhiInvMassPiNSigmadEdxMixedEventSecondCut"), multiplicity, ptPi, nSigmadEdxPi, massPhi, weightLtSecondCut); } + + if constexpr (isMC) { // MC event + MCPhiPionHist.fill(HIST(MCPhiPiSEInc[iBin]), ptPi, nSigmadEdxPi, massPhi, weightInclusive); + if (deltay > cfgFirstCutonDeltay) + continue; + MCPhiPionHist.fill(HIST(MCPhiPiSEFCut[iBin]), ptPi, nSigmadEdxPi, massPhi, weightLtFirstCut); + if (deltay > cfgSecondCutonDeltay) + continue; + MCPhiPionHist.fill(HIST(MCPhiPiSESCut[iBin]), ptPi, nSigmadEdxPi, massPhi, weightLtSecondCut); + } } } void processQAPurity(SelCollisions::iterator const& collision, FullTracks const& fullTracks, FullV0s const& V0s, V0DauTracks const&) { // Check if the event selection is passed - if (!acceptEventQA(collision)) + if (!acceptEventQA(collision)) return; float multiplicity = collision.centFT0M(); @@ -733,43 +768,43 @@ struct phik0shortanalysis { switch (iBin) { case 0: { - fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 1: { - fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 2: { - fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 3: { - fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 4: { - fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 5: { - fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 6: { - fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 7: { - fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 8: { - fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 9: { - fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } default: @@ -858,43 +893,43 @@ struct phik0shortanalysis { switch (iBin) { case 0: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 1: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 2: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 3: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 4: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 5: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 6: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 7: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 8: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 9: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } default: @@ -973,43 +1008,43 @@ struct phik0shortanalysis { switch (iBin) { case 0: { - fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 1: { - fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 2: { - fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 3: { - fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 4: { - fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 5: { - fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 6: { - fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 7: { - fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 8: { - fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 9: { - fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } default: @@ -1086,43 +1121,43 @@ struct phik0shortanalysis { switch (iBin) { case 0: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 1: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 2: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 3: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 4: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 5: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 6: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 7: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 8: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 9: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } default: From 4f989ad8e3eb8f4553b0ce09582a2346168e265e Mon Sep 17 00:00:00 2001 From: Stefano Cannito Date: Thu, 25 Jul 2024 11:55:07 +0200 Subject: [PATCH 07/12] Added recoMC in processMCeff --- PWGLF/Tasks/Strangeness/phik0sanalysis.cxx | 323 ++++++++++++++++++++- 1 file changed, 322 insertions(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx index 57d09ee7baf..5a0768145eb 100644 --- a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx @@ -196,9 +196,13 @@ struct phik0shortanalysis { using BinningTypeVertexContributor = ColumnBinningPolicy; SliceCache cache; + Partition posTracks = aod::track::signed1Pt > cfgCutCharge; Partition negTracks = aod::track::signed1Pt < cfgCutCharge; + Partition posMCTracks = aod::track::signed1Pt > cfgCutCharge; + Partition negMCTracks = aod::track::signed1Pt < cfgCutCharge; + void init(InitContext const&) { // Axes @@ -1169,9 +1173,326 @@ struct phik0shortanalysis { PROCESS_SWITCH(phik0shortanalysis, processMEPhiPion, "Process Mixed Event for Phi-Pion Analysis", false); - void processMCEffPhiK0S() + void processMCEffPhiK0S(SimCollisions::iterator const& collision, FullMCTracks const&, FullV0s const& V0s, V0DauMCTracks const&, aod::McCollisions const&, aod::McParticles const& mcParticles) { + if (!acceptEventQA(collision)) + return; + + float multiplicity = collision.centFT0M(); + eventHist.fill(HIST("hRecMCMultiplicityPercent"), multiplicity); + + int iBin = 0; + for (int i = 0; i < nMultBin; i++) { + if (multBin[i] < multiplicity && multiplicity <= multBin[i + 1]) { + iBin = i; + break; + } + } + + // Defining positive and negative tracks for phi reconstruction + auto posThisColl = posMCTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + auto negThisColl = negMCTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + + // V0 already reconstructed by the builder + for (const auto& v0 : V0s) { + const auto& posDaughterTrack = v0.posTrack_as(); + const auto& negDaughterTrack = v0.negTrack_as(); + if (!posDaughterTrack.has_mcParticle() || !negDaughterTrack.has_mcParticle()) + continue; + + auto posMCDaughterTrack = posDaughterTrack.mcParticle_as(); + auto negMCDaughterTrack = negDaughterTrack.mcParticle_as(); + if (posMCDaughterTrack.pdgCode() != 211 || negMCDaughterTrack.pdgCode() != -211) + continue; + if (!posMCDaughterTrack.has_mothers() || !negMCDaughterTrack.has_mothers()) + continue; + + int pdgParentv0 = 0; + bool isPhysPrim = false; + for (const auto& particleMotherOfNeg : negMCDaughterTrack.mothers_as()) { + for (const auto& particleMotherOfPos : posMCDaughterTrack.mothers_as()) { + if (particleMotherOfNeg == particleMotherOfPos) { + pdgParentv0 = particleMotherOfNeg.pdgCode(); + isPhysPrim = particleMotherOfNeg.isPhysicalPrimary(); + } + } + } + if (pdgParentv0 != 310 || !isPhysPrim) + continue; + + if (!selectionV0(v0, posDaughterTrack, negDaughterTrack)) + continue; + + TLorentzVector recK0S; + recK0S.SetXYZM(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); + if (recK0S.Rapidity() > 0.8) + continue; + + std::vector listrecPhi; + int countInclusive = 0, countLtFirstCut = 0, countLtSecondCut = 0; + + // Phi reconstruction + for (auto track1 : posThisColl) { // loop over all selected tracks + if (!selectionTrackResonance(track1) || !selectionPIDKaon(track1)) + continue; // topological and PID selection + + auto track1ID = track1.globalIndex(); + + if (!track1.has_mcParticle()) + continue; + + for (auto track2 : negThisColl) { + if (!selectionTrackResonance(track2) || !selectionPIDKaon(track2)) + continue; // topological and PID selection + + auto track2ID = track2.globalIndex(); + if (track2ID == track1ID) + continue; // condition to avoid double counting of pair + + if (!track2.has_mcParticle()) + continue; + + auto MCtrack1 = track1.mcParticle_as(); + auto MCtrack2 = track2.mcParticle_as(); + if (MCtrack1.pdgCode() != 321 || MCtrack2.pdgCode() != -321) + continue; + if (!MCtrack1.has_mothers() || !MCtrack2.has_mothers()) + continue; + if (!MCtrack1.isPhysicalPrimary() || !MCtrack2.isPhysicalPrimary()) + continue; + + int pdgParentPhi = 0; + for (const auto& MotherOfMCtrack1 : MCtrack1.mothers_as()) { + for (const auto& MotherOfMCtrack2 : MCtrack2.mothers_as()) { + if (MotherOfMCtrack1 == MotherOfMCtrack2) { + pdgParentPhi = MotherOfMCtrack1.pdgCode(); + } + } + } + + if (pdgParentPhi != 333) + continue; + + TLorentzVector recPhi; + recPhi = recMother(track1, track2, massKa, massKa); + if (recPhi.Rapidity() > 0.8) + continue; + + listrecPhi.push_back(recPhi); + + countInclusive++; + if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) + continue; + countLtFirstCut++; + if (std::abs(recK0S.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) + continue; + countLtSecondCut++; + } + } + float weightInclusive = 1. / static_cast(countInclusive); + float weightLtFirstCut = 1. / static_cast(countLtFirstCut); + float weightLtSecondCut = 1. / static_cast(countLtSecondCut); + + switch (iBin) { + case 0: { + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + break; + } + case 1: { + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + break; + } + case 2: { + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + break; + } + case 3: { + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + break; + } + case 4: { + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + break; + } + case 5: { + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + break; + } + case 6: { + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + break; + } + case 7: { + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + break; + } + case 8: { + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + break; + } + case 9: { + fillInvMass2D(recK0S, listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + break; + } + default: + break; + } + } + } + + PROCESS_SWITCH(phik0shortanalysis, processMCEffPhiK0S, "Process MC Efficiency for Phi-K0S Analysis", false); + + void processMCEffPhiPion(SimCollisions::iterator const& collision, FullMCTracks const& fullMCTracks, aod::McCollisions const&, aod::McParticles const& mcParticles) + { + if (!acceptEventQA(collision)) + return; + + float multiplicity = collision.centFT0M(); + eventHist.fill(HIST("hRecMCMultiplicityPercent"), multiplicity); + + int iBin = 0; + for (int i = 0; i < nMultBin; i++) { + if (multBin[i] < multiplicity && multiplicity <= multBin[i + 1]) { + iBin = i; + break; + } + } + + // Defining positive and negative tracks for phi reconstruction + auto posThisColl = posMCTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + auto negThisColl = negMCTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); + + // Loop over all primary pion candidates + for (const auto& track : fullMCTracks) { + + if (!track.has_mcParticle()) + continue; + + auto MCtrack = track.mcParticle_as(); + if (std::abs(MCtrack.pdgCode()) != 211 !! !MCtrack.isPhysicalPrimary()) + continue; + + // Pion selection + if (!selectionPion(track)) + continue; + + TLorentzVector recPi; + recPi.SetXYZM(track.px(), track.py(), track.pz(), massPi); + if (recPi.Rapidity() > 0.8) + continue; + + std::vector listrecPhi; + int countInclusive = 0, countLtFirstCut = 0, countLtSecondCut = 0; + + // Phi reconstruction + for (auto track1 : posThisColl) { // loop over all selected tracks + if (!selectionTrackResonance(track1) || !selectionPIDKaon(track1)) + continue; // topological and PID selection + + auto track1ID = track1.globalIndex(); + + if (!track1.has_mcParticle()) + continue; + + for (auto track2 : negThisColl) { + if (!selectionTrackResonance(track2) || !selectionPIDKaon(track2)) + continue; // topological and PID selection + + auto track2ID = track2.globalIndex(); + if (track2ID == track1ID) + continue; // condition to avoid double counting of pair + + if (!track2.has_mcParticle()) + continue; + + auto MCtrack1 = track1.mcParticle_as(); + auto MCtrack2 = track2.mcParticle_as(); + if (MCtrack1.pdgCode() != 321 || MCtrack2.pdgCode() != -321) + continue; + if (!MCtrack1.has_mothers() || !MCtrack2.has_mothers()) + continue; + if (!MCtrack1.isPhysicalPrimary() || !MCtrack2.isPhysicalPrimary()) + continue; + + int pdgParentPhi = 0; + for (const auto& MotherOfMCtrack1 : MCtrack1.mothers_as()) { + for (const auto& MotherOfMCtrack2 : MCtrack2.mothers_as()) { + if (MotherOfMCtrack1 == MotherOfMCtrack2) { + pdgParentPhi = MotherOfMCtrack1.pdgCode(); + } + } + } + + if (pdgParentPhi != 333) + continue; + + TLorentzVector recPhi; + recPhi = recMother(track1, track2, massKa, massKa); + if (recPhi.Rapidity() > 0.8) + continue; + + listrecPhi.push_back(recPhi); + + countInclusive++; + if (std::abs(recPi.Rapidity() - recPhi.Rapidity()) > cfgFirstCutonDeltay) + continue; + countLtFirstCut++; + if (std::abs(recPi.Rapidity() - recPhi.Rapidity()) > cfgSecondCutonDeltay) + continue; + countLtSecondCut++; + } + } + + float weightInclusive = 1. / static_cast(countInclusive); + float weightLtFirstCut = 1. / static_cast(countLtFirstCut); + float weightLtSecondCut = 1. / static_cast(countLtSecondCut); + + switch (iBin) { + case 0: { + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + break; + } + case 1: { + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + break; + } + case 2: { + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + break; + } + case 3: { + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + break; + } + case 4: { + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + break; + } + case 5: { + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + break; + } + case 6: { + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + break; + } + case 7: { + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + break; + } + case 8: { + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + break; + } + case 9: { + fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + break; + } + default: + break; + } + } } }; From 16d923d4c4b65a9638011d1b46a91427406addbc Mon Sep 17 00:00:00 2001 From: Stefano Cannito Date: Thu, 25 Jul 2024 14:20:39 +0200 Subject: [PATCH 08/12] Added genMC in processMCeff --- PWGLF/Tasks/Strangeness/phik0sanalysis.cxx | 88 +++++++++++++++++++--- 1 file changed, 76 insertions(+), 12 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx index 5a0768145eb..7686ed6843a 100644 --- a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx @@ -299,9 +299,9 @@ struct phik0shortanalysis { } // GenMC pT of K0S coupled to Phi - MCPhiK0SHist.add("h2PhiK0SpTGenMCInclusive", "pT of K0Short coupled to Phi for GenMC Inclusive", kTH2F, {multAxis, ptAxis}); - MCPhiK0SHist.add("h2PhiK0SpTGenMCFirstCut", "pT of K0Short coupled to Phi for GenMC Deltay < FirstCut", kTH2F, {multAxis, ptAxis}); - MCPhiK0SHist.add("h2PhiK0SpTGenMCSecondCut", "pT of K0Short coupled to Phi for GenMC Deltay < SecondCut", kTH2F, {multAxis, ptAxis}); + MCPhiK0SHist.add("h1PhiK0SGenMCInclusive", "K0Short coupled to Phi for GenMC Inclusive", kTH1F, {10, -0.5f, 9.5f}); + MCPhiK0SHist.add("h1PhiK0SGenMCFirstCut", "K0Short coupled to Phi for GenMC Deltay < FirstCut", kTH1F, {10, -0.5f, 9.5f}); + MCPhiK0SHist.add("h1PhiK0SGenMCSecondCut", "K0Short coupled to Phi for GenMC Deltay < SecondCut", kTH1F, {10, -0.5f, 9.5f}); // Phi mass vs Pion NSigma dE/dx for Same Event and Mixed Event for (int i = 0; i < nMultBin; i++) { @@ -322,9 +322,9 @@ struct phik0shortanalysis { } // GenMC pT of Pion coupled to Phi - MCPhiPionHist.add("h2PhiPiPionpTGenMCInclusive", "pT of Pion coupled to Phi for GenMC Inclusive", kTH2F, {multAxis, ptAxis}); - MCPhiPionHist.add("h2PhiPiPionpTGenMCFirstCut", "pT of Pion coupled to Phi for GenMC Deltay < FirstCut", kTH2F, {multAxis, ptAxis}); - MCPhiPionHist.add("h2PhiPiPionpTGenMCSecondCut", "pT of Pion coupled to Phi for GenMC Deltay < SecondCut", kTH2F, {multAxis, ptAxis}); + MCPhiPionHist.add("h1PhiPiGenMCInclusive", "Pion coupled to Phi for GenMC Inclusive", kTH1F, {10, -0.5f, 9.5f}); + MCPhiPionHist.add("h1PhiPiGenMCFirstCut", "Pion coupled to Phi for GenMC Deltay < FirstCut", kTH1F, {10, -0.5f, 9.5f}); + MCPhiPionHist.add("h1PhiPiGenMCSecondCut", "Pion coupled to Phi for GenMC Deltay < SecondCut", kTH1F, {10, -0.5f, 9.5f}); } // Event selection and QA filling @@ -607,9 +607,7 @@ struct phik0shortanalysis { PhipurHist.fill(HIST("h2PhipurInvMass"), multiplicity, recPhi.M()); - bool isCountedK0SInclusive = false; - bool isCountedK0SFirstCut = false; - bool isCountedK0SSecondCut = false; + bool isCountedK0SInclusive = false, isCountedK0SFirstCut = false, isCountedK0SSecondCut = false; // V0 already reconstructed by the builder for (const auto& v0 : V0s) { @@ -655,9 +653,7 @@ struct phik0shortanalysis { } isFilledhV0 = true; - bool isCountedPiInclusive = false; - bool isCountedPiFirstCut = false; - bool isCountedPiSecondCut = false; + bool isCountedPiInclusive = false, isCountedPiFirstCut = false, isCountedPiSecondCut = false; // Loop over all primary pion candidates for (const auto& track : fullTracks) { @@ -1188,6 +1184,7 @@ struct phik0shortanalysis { break; } } + int iCenter = iBin - 1; // Defining positive and negative tracks for phi reconstruction auto posThisColl = posMCTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); @@ -1339,6 +1336,39 @@ struct phik0shortanalysis { break; } } + + bool isCountedPhiInclusive = false, isCountedPhiFirstCut = false, isCountedPhiSecondCut = false; + + for (auto mcParticle1 : mcParticles) { + if (mcParticle1.y() > 0.8) + continue; + if (mcParticle1.pdgCode() != 310) + continue; + + for (auto mcParticle2 : mcParticles) { + if (mcParticle2.y() > 0.8) + continue; + if (mcParticle2.pdgCode() != 333) + continue; + + if (!isCountedPhiInclusive) { + MCPhiK0SHist.fill(HIST("h1PhiK0SGenMCInclusive"), iCenter); + isCountedPhiInclusive = true; + } + if (std::abs(mcParticle1.y() - mcParticle2.y()) > cfgFirstCutonDeltay) + continue; + if (!isCountedPhiFirstCut) { + MCPhiK0SHist.fill(HIST("h1PhiK0SGenMCFirstCut"), iCenter); + isCountedPhiFirstCut = true; + } + if (std::abs(mcParticle1.y() - mcParticle2.y()) > cfgSecondCutonDeltay) + continue; + if (!isCountedPhiSecondCut) { + MCPhiK0SHist.fill(HIST("h1PhiK0SGenMCSecondCut"), iCenter); + isCountedPhiSecondCut = true; + } + } + } } PROCESS_SWITCH(phik0shortanalysis, processMCEffPhiK0S, "Process MC Efficiency for Phi-K0S Analysis", false); @@ -1358,6 +1388,7 @@ struct phik0shortanalysis { break; } } + int iCenter = iBin - 1; // Defining positive and negative tracks for phi reconstruction auto posThisColl = posMCTracks->sliceByCached(aod::track::collisionId, collision.globalIndex(), cache); @@ -1493,6 +1524,39 @@ struct phik0shortanalysis { break; } } + + bool isCountedPhiInclusive = false, isCountedPhiFirstCut = false, isCountedPhiSecondCut = false; + + for (auto mcParticle1 : mcParticles) { + if (mcParticle1.y() > 0.8) + continue; + if (std::abs(mcParticle1.pdgCode()) != 211) + continue; + + for (auto mcParticle2 : mcParticles) { + if (mcParticle2.y() > 0.8) + continue; + if (mcParticle2.pdgCode() != 333) + continue; + + if (!isCountedPhiInclusive) { + MCPhiPionHist.fill(HIST("h1PhiPionGenMCInclusive"), iCenter); + isCountedPhiInclusive = true; + } + if (std::abs(mcParticle1.y() - mcParticle2.y()) > cfgFirstCutonDeltay) + continue; + if (!isCountedPhiFirstCut) { + MCPhiPionHist.fill(HIST("h1PhiPionGenMCFirstCut"), iCenter); + isCountedPhiFirstCut = true; + } + if (std::abs(mcParticle1.y() - mcParticle2.y()) > cfgSecondCutonDeltay) + continue; + if (!isCountedPhiSecondCut) { + MCPhiPionHist.fill(HIST("h1PhiPionGenMCSecondCut"), iCenter); + isCountedPhiSecondCut = true; + } + } + } } }; From f3d0680df11762ec40a74ab8f95f8fdeacaabf5a Mon Sep 17 00:00:00 2001 From: Stefano Cannito Date: Thu, 25 Jul 2024 16:03:21 +0200 Subject: [PATCH 09/12] New pion selection --- PWGLF/Tasks/Strangeness/phik0sanalysis.cxx | 26 ++++++++++++---------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx index 7686ed6843a..6fecefd4c38 100644 --- a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx @@ -453,24 +453,26 @@ struct phik0shortanalysis { return false; if (track.itsNCls() < minITSnCls) return false; - if (!track.hasTPC()) - return false; - if (track.tpcNClsFound() < minTPCnClsFound) - return false; - if (track.tpcNClsCrossedRows() < minNCrossedRowsTPC) - return false; - if (track.tpcChi2NCl() > maxChi2TPC) - return false; if (track.itsChi2NCl() > maxChi2ITS) return false; + if (track.pt() < 1.2) { + if (!track.hasTPC()) + return false; + if (track.tpcNClsFound() < minTPCnClsFound) + return false; + if (track.tpcNClsCrossedRows() < minNCrossedRowsTPC) + return false; + if (track.tpcChi2NCl() > maxChi2TPC) + return false; + } + if (track.pt() > 0.5) { + if (!track.hasTOF()) + return false; + } if (std::abs(track.dcaXY()) > dcaxyMax) return false; if (std::abs(track.dcaZ()) > dcazMax) return false; - if (!track.hasTOF()) - return false; - if (std::abs(track.tofNSigmaPi()) > NSigmaTOFPion) - return false; return true; } From e3cff1dc6efe266621c309e2a6ad8166841aa01f Mon Sep 17 00:00:00 2001 From: Stefano Cannito Date: Fri, 26 Jul 2024 09:19:12 +0200 Subject: [PATCH 10/12] Updated Pi info filling --- PWGLF/Tasks/Strangeness/phik0sanalysis.cxx | 127 +++++++++++---------- 1 file changed, 65 insertions(+), 62 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx index 6fecefd4c38..2e02c68ef3e 100644 --- a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx @@ -78,19 +78,19 @@ static constexpr std::string_view PhiPiSEFCut[nMultBin] = {"h2PhiPiSEFCut_0_1", static constexpr std::string_view PhiPiSESCut[nMultBin] = {"h2PhiPiSESCut_0_1", "h2PhiPiSESCut_1_5", "h2PhiPiSESCut_5_10", "h2PhiPiSESCut_10_15", "h2PhiPiSESCut_15_20", "h2PhiPiSESCut_20_30", "h2PhiPiSESCut_30_40", "h2PhiPiSESCut_40_50", "h2PhiPiSESCut_50_70", "h2PhiPiSESCut_70_100"}; -static constexpr std::string_view MCPhiK0SSEInc[nMultBin] = {"h2MCPhiK0SSEInc_0_1", "h2MCPhiK0SSEInc_1_5", "h2MCPhiK0SSEInc_5_10", "h2MCPhiK0SSEInc_10_15", "h2MCPhiK0SSEInc_15_20", - "h2MCPhiK0SSEInc_20_30", "h2MCPhiK0SSEInc_30_40", "h2MCPhiK0SSEInc_40_50", "h2MCPhiK0SSEInc_50_70", "h2MCPhiK0SSEInc_70_100"}; -static constexpr std::string_view MCPhiK0SSEFCut[nMultBin] = {"h2MCPhiK0SSEFCut_0_1", "h2MCPhiK0SSEFCut_1_5", "h2MCPhiK0SSEFCut_5_10", "h2MCPhiK0SSEFCut_10_15", "h2MCPhiK0SSEFCut_15_20", - "h2MCPhiK0SSEFCut_20_30", "h2MCPhiK0SSEFCut_30_40", "h2MCPhiK0SSEFCut_40_50", "h2MCPhiK0SSEFCut_50_70", "h2MCPhiK0SSEFCut_70_100"}; -static constexpr std::string_view MCPhiK0SSESCut[nMultBin] = {"h2MCPhiK0SSESCut_0_1", "h2MCPhiK0SSESCut_1_5", "h2MCPhiK0SSESCut_5_10", "h2MCPhiK0SSESCut_10_15", "h2MCPhiK0SSESCut_15_20", - "h2MCPhiK0SSESCut_20_30", "h2MCPhiK0SSESCut_30_40", "h2MCPhiK0SSESCut_40_50", "h2MCPhiK0SSESCut_50_70", "h2MCPhiK0SSESCut_70_100"}; - -static constexpr std::string_view MCPhiPiSEInc[nMultBin] = {"h2MCPhiPiSEInc_0_1", "h2MCPhiPiSEInc_1_5", "h2MCPhiPiSEInc_5_10", "h2MCPhiPiSEInc_10_15", "h2MCPhiPiSEInc_15_20", - "h2MCPhiPiSEInc_20_30", "h2MCPhiPiSEInc_30_40", "h2MCPhiPiSEInc_40_50", "h2MCPhiPiSEInc_50_70", "h2MCPhiPiSEInc_70_100"}; -static constexpr std::string_view MCPhiPiSEFCut[nMultBin] = {"h2MCPhiPiSEFCut_0_1", "h2MCPhiPiSEFCut_1_5", "h2MCPhiPiSEFCut_5_10", "h2MCPhiPiSEFCut_10_15", "h2MCPhiPiSEFCut_15_20", - "h2MCPhiPiSEFCut_20_30", "h2MCPhiPiSEFCut_30_40", "h2MCPhiPiSEFCut_40_50", "h2MCPhiPiSEFCut_50_70", "h2MCPhiPiSEFCut_70_100"}; -static constexpr std::string_view MCPhiPiSESCut[nMultBin] = {"h2MCPhiPiSESCut_0_1", "h2MCPhiPiSESCut_1_5", "h2MCPhiPiSESCut_5_10", "h2MCPhiPiSESCut_10_15", "h2MCPhiPiSESCut_15_20", - "h2MCPhiPiSESCut_20_30", "h2MCPhiPiSESCut_30_40", "h2MCPhiPiSESCut_40_50", "h2MCPhiPiSESCut_50_70", "h2MCPhiPiSESCut_70_100"}; +static constexpr std::string_view MCPhiK0SSEInc[nMultBin] = {"h2RecMCPhiK0SSEInc_0_1", "h2RecMCPhiK0SSEInc_1_5", "h2RecMCPhiK0SSEInc_5_10", "h2RecMCPhiK0SSEInc_10_15", "h2RecMCPhiK0SSEInc_15_20", + "h2RecMCPhiK0SSEInc_20_30", "h2RecMCPhiK0SSEInc_30_40", "h2RecMCPhiK0SSEInc_40_50", "h2RecMCPhiK0SSEInc_50_70", "h2RecMCPhiK0SSEInc_70_100"}; +static constexpr std::string_view MCPhiK0SSEFCut[nMultBin] = {"h2RecMCPhiK0SSEFCut_0_1", "h2RecMCPhiK0SSEFCut_1_5", "h2RecMCPhiK0SSEFCut_5_10", "h2RecMCPhiK0SSEFCut_10_15", "h2RecMCPhiK0SSEFCut_15_20", + "h2RecMCPhiK0SSEFCut_20_30", "h2RecMCPhiK0SSEFCut_30_40", "h2RecMCPhiK0SSEFCut_40_50", "h2RecMCPhiK0SSEFCut_50_70", "h2RecMCPhiK0SSEFCut_70_100"}; +static constexpr std::string_view MCPhiK0SSESCut[nMultBin] = {"h2RecMCPhiK0SSESCut_0_1", "h2RecMCPhiK0SSESCut_1_5", "h2RecMCPhiK0SSESCut_5_10", "h2RecMCPhiK0SSESCut_10_15", "h2RecMCPhiK0SSESCut_15_20", + "h2RecMCPhiK0SSESCut_20_30", "h2RecMCPhiK0SSESCut_30_40", "h2RecMCPhiK0SSESCut_40_50", "h2RecMCPhiK0SSESCut_50_70", "h2RecMCPhiK0SSESCut_70_100"}; + +static constexpr std::string_view MCPhiPiSEInc[nMultBin] = {"h2RecMCPhiPiSEInc_0_1", "h2RecMCPhiPiSEInc_1_5", "h2RecMCPhiPiSEInc_5_10", "h2RecMCPhiPiSEInc_10_15", "h2RecMCPhiPiSEInc_15_20", + "h2RecMCPhiPiSEInc_20_30", "h2RecMCPhiPiSEInc_30_40", "h2RecMCPhiPiSEInc_40_50", "h2RecMCPhiPiSEInc_50_70", "h2RecMCPhiPiSEInc_70_100"}; +static constexpr std::string_view MCPhiPiSEFCut[nMultBin] = {"h2RecMCPhiPiSEFCut_0_1", "h2RecMCPhiPiSEFCut_1_5", "h2RecMCPhiPiSEFCut_5_10", "h2RecMCPhiPiSEFCut_10_15", "h2RecMCPhiPiSEFCut_15_20", + "h2RecMCPhiPiSEFCut_20_30", "hRecMCPhiPiSEFCut_30_40", "h2RecMCPhiPiSEFCut_40_50", "h2RecMCPhiPiSEFCut_50_70", "h2RecMCPhiPiSEFCut_70_100"}; +static constexpr std::string_view MCPhiPiSESCut[nMultBin] = {"h2RecMCPhiPiSESCut_0_1", "h2RecMCPhiPiSESCut_1_5", "h2RecMCPhiPiSESCut_5_10", "h2RecMCPhiPiSESCut_10_15", "h2RecMCPhiPiSESCut_15_20", + "h2RecMCPhiPiSESCut_20_30", "h2RecMCPhiPiSESCut_30_40", "h2RecMCPhiPiSESCut_40_50", "h2RecMCPhiPiSESCut_50_70", "h2RecMCPhiPiSESCut_70_100"}; } // namespace struct phik0shortanalysis { @@ -305,20 +305,20 @@ struct phik0shortanalysis { // Phi mass vs Pion NSigma dE/dx for Same Event and Mixed Event for (int i = 0; i < nMultBin; i++) { - PhiPionHist.add(PhiPiSEInc[i].data(), "Phi Invariant mass vs Pion nSigma dE/dx for Same Event Inclusive", kTH3F, {ptAxis, {100, -10.0f, 10.0f}, cfgPhimassAxisInc.at(i)}); - PhiPionHist.add(PhiPiSEFCut[i].data(), "Phi Invariant mass vs Pion nSigma dE/dx for Same Event Deltay < FirstCut", kTH3F, {ptAxis, {100, -10.0f, 10.0f}, cfgPhimassAxisFCut.at(i)}); - PhiPionHist.add(PhiPiSESCut[i].data(), "Phi Invariant mass vs Pion nSigma dE/dx for Same Event Deltay < SecondCut", kTH3F, {ptAxis, {100, -10.0f, 10.0f}, cfgPhimassAxisSCut.at(i)}); + PhiPionHist.add(PhiPiSEInc[i].data(), "Phi Invariant mass vs Pion nSigma TPC/TOF for Same Event Inclusive", kTHnSparseF, {ptAxis, {100, -10.0f, 10.0f}, {100, -10.0f, 10.0f}, cfgPhimassAxisInc.at(i)}); + PhiPionHist.add(PhiPiSEFCut[i].data(), "Phi Invariant mass vs Pion nSigma TPC/TOF for Same Event Deltay < FirstCut", kTHnSparseF, {ptAxis, {100, -10.0f, 10.0f}, {100, -10.0f, 10.0f}, cfgPhimassAxisFCut.at(i)}); + PhiPionHist.add(PhiPiSESCut[i].data(), "Phi Invariant mass vs Pion nSigma TPC/TOF for Same Event Deltay < SecondCut", kTHnSparseF, {ptAxis, {100, -10.0f, 10.0f}, {100, -10.0f, 10.0f}, cfgPhimassAxisSCut.at(i)}); } - PhiPionHist.add("h4PhiInvMassPiNSigmadEdxMixedEventInclusive", "Phi Invariant mass vs Pion nSigma dE/dx for Mixed Event Inclusive", kTHnSparseF, {multAxis, ptAxis, {100, -10.0f, 10.0f}, PhimassAxis}); - PhiPionHist.add("h4PhiInvMassPiNSigmadEdxMixedEventFirstCut", "Phi Invariant mass vs Pion nSigma dE/dx for Mixed Event Deltay < FirstCut", kTHnSparseF, {multAxis, ptAxis, {100, -10.0f, 10.0f}, PhimassAxis}); - PhiPionHist.add("h4PhiInvMassPiNSigmadEdxMixedEventSecondCut", "Phi Invariant mass vs Pion nSigma dE/dx for Mixed Event Deltay < SecondCut", kTHnSparseF, {multAxis, ptAxis, {100, -10.0f, 10.0f}, PhimassAxis}); + PhiPionHist.add("h4PhiInvMassPiNSigmadEdxMixedEventInclusive", "Phi Invariant mass vs Pion nSigma TPC/TOF for Mixed Event Inclusive", kTHnSparseF, {multAxis, ptAxis, {100, -10.0f, 10.0f}, {100, -10.0f, 10.0f}, PhimassAxis}); + PhiPionHist.add("h4PhiInvMassPiNSigmadEdxMixedEventFirstCut", "Phi Invariant mass vs Pion nSigma TPC/TOF for Mixed Event Deltay < FirstCut", kTHnSparseF, {multAxis, ptAxis, {100, -10.0f, 10.0f}, {100, -10.0f, 10.0f}, PhimassAxis}); + PhiPionHist.add("h4PhiInvMassPiNSigmadEdxMixedEventSecondCut", "Phi Invariant mass vs Pion nSigma TPC/TOF for Mixed Event Deltay < SecondCut", kTHnSparseF, {multAxis, ptAxis, {100, -10.0f, 10.0f}, {100, -10.0f, 10.0f}, PhimassAxis}); // MC Phi mass vs Pion NSigma dE/dx for (int i = 0; i < nMultBin; i++) { - MCPhiPionHist.add(MCPhiPiSEInc[i].data(), "Phi Invariant mass vs Pion nSigma dE/dx for RecMC Inclusive", kTH3F, {ptAxis, {100, -10.0f, 10.0f}, cfgPhimassAxisInc.at(i)}); - MCPhiPionHist.add(MCPhiPiSEFCut[i].data(), "Phi Invariant mass vs Pion nSigma dE/dx for RecMC Deltay < FirstCut", kTH3F, {ptAxis, {100, -10.0f, 10.0f}, cfgPhimassAxisFCut.at(i)}); - MCPhiPionHist.add(MCPhiPiSESCut[i].data(), "Phi Invariant mass vs Pion nSigma dE/dx for RecMC Deltay < SecondCut", kTH3F, {ptAxis, {100, -10.0f, 10.0f}, cfgPhimassAxisSCut.at(i)}); + MCPhiPionHist.add(MCPhiPiSEInc[i].data(), "Phi Invariant mass vs Pion nSigma TPC/TOF for RecMC Inclusive", kTHnSparseF, {ptAxis, {100, -10.0f, 10.0f}, {100, -10.0f, 10.0f}, cfgPhimassAxisInc.at(i)}); + MCPhiPionHist.add(MCPhiPiSEFCut[i].data(), "Phi Invariant mass vs Pion nSigma TPC/TOF for RecMC Deltay < FirstCut", kTHnSparseF, {ptAxis, {100, -10.0f, 10.0f}, {100, -10.0f, 10.0f}, cfgPhimassAxisFCut.at(i)}); + MCPhiPionHist.add(MCPhiPiSESCut[i].data(), "Phi Invariant mass vs Pion nSigma TPC/TOF for RecMC Deltay < SecondCut", kTHnSparseF, {ptAxis, {100, -10.0f, 10.0f}, {100, -10.0f, 10.0f}, cfgPhimassAxisSCut.at(i)}); } // GenMC pT of Pion coupled to Phi @@ -455,6 +455,7 @@ struct phik0shortanalysis { return false; if (track.itsChi2NCl() > maxChi2ITS) return false; + if (track.pt() < 1.2) { if (!track.hasTPC()) return false; @@ -465,10 +466,12 @@ struct phik0shortanalysis { if (track.tpcChi2NCl() > maxChi2TPC) return false; } + if (track.pt() > 0.5) { if (!track.hasTOF()) return false; } + if (std::abs(track.dcaXY()) > dcaxyMax) return false; if (std::abs(track.dcaZ()) > dcazMax) @@ -520,7 +523,7 @@ struct phik0shortanalysis { // Fill Phi invariant mass vs Pion nSigmadE/dx histogram template - void fillInvMassNSigmadEdx(TLorentzVector Pi, float nSigmadEdxPi, const std::vector listPhi, float multiplicity, double weightInclusive, double weightLtFirstCut, double weightLtSecondCut) + void fillInvMassNSigma(TLorentzVector Pi, float nSigmaTPCPi, float nSigmaTOFPi, const std::vector listPhi, float multiplicity, double weightInclusive, double weightLtFirstCut, double weightLtSecondCut) { double rapidityPi = Pi.Rapidity(); double ptPi = Pi.Pt(); @@ -531,31 +534,31 @@ struct phik0shortanalysis { double deltay = std::abs(rapidityPi - rapidityPhi); if constexpr (!isMix) { // same event - PhiPionHist.fill(HIST(PhiPiSEInc[iBin]), ptPi, nSigmadEdxPi, massPhi, weightInclusive); + PhiPionHist.fill(HIST(PhiPiSEInc[iBin]), ptPi, nSigmaTPCPi, nSigmaTOFPi, massPhi, weightInclusive); if (deltay > cfgFirstCutonDeltay) continue; - PhiPionHist.fill(HIST(PhiPiSEFCut[iBin]), ptPi, nSigmadEdxPi, massPhi, weightLtFirstCut); + PhiPionHist.fill(HIST(PhiPiSEFCut[iBin]), ptPi, nSigmaTPCPi, nSigmaTOFPi, massPhi, weightLtFirstCut); if (deltay > cfgSecondCutonDeltay) continue; - PhiPionHist.fill(HIST(PhiPiSESCut[iBin]), ptPi, nSigmadEdxPi, massPhi, weightLtSecondCut); + PhiPionHist.fill(HIST(PhiPiSESCut[iBin]), ptPi, nSigmaTPCPi, nSigmaTOFPi, massPhi, weightLtSecondCut); } else { // mixed event - PhiPionHist.fill(HIST("h4PhiInvMassPiNSigmadEdxMixedEventInclusive"), multiplicity, ptPi, nSigmadEdxPi, massPhi, weightInclusive); + PhiPionHist.fill(HIST("h4PhiInvMassPiNSigmadEdxMixedEventInclusive"), multiplicity, ptPi, nSigmaTPCPi, nSigmaTOFPi, massPhi, weightInclusive); if (deltay > cfgFirstCutonDeltay) continue; - PhiPionHist.fill(HIST("h4PhiInvMassPiNSigmadEdxMixedEventFirstCut"), multiplicity, ptPi, nSigmadEdxPi, massPhi, weightLtFirstCut); + PhiPionHist.fill(HIST("h4PhiInvMassPiNSigmadEdxMixedEventFirstCut"), multiplicity, ptPi, nSigmaTPCPi, nSigmaTOFPi, massPhi, weightLtFirstCut); if (deltay > cfgSecondCutonDeltay) continue; - PhiPionHist.fill(HIST("h4PhiInvMassPiNSigmadEdxMixedEventSecondCut"), multiplicity, ptPi, nSigmadEdxPi, massPhi, weightLtSecondCut); + PhiPionHist.fill(HIST("h4PhiInvMassPiNSigmadEdxMixedEventSecondCut"), multiplicity, ptPi, nSigmaTPCPi, nSigmaTOFPi, massPhi, weightLtSecondCut); } if constexpr (isMC) { // MC event - MCPhiPionHist.fill(HIST(MCPhiPiSEInc[iBin]), ptPi, nSigmadEdxPi, massPhi, weightInclusive); + MCPhiPionHist.fill(HIST(MCPhiPiSEInc[iBin]), ptPi, nSigmaTPCPi, nSigmaTOFPi, massPhi, weightInclusive); if (deltay > cfgFirstCutonDeltay) continue; - MCPhiPionHist.fill(HIST(MCPhiPiSEFCut[iBin]), ptPi, nSigmadEdxPi, massPhi, weightLtFirstCut); + MCPhiPionHist.fill(HIST(MCPhiPiSEFCut[iBin]), ptPi, nSigmaTPCPi, nSigmaTOFPi, massPhi, weightLtFirstCut); if (deltay > cfgSecondCutonDeltay) continue; - MCPhiPionHist.fill(HIST(MCPhiPiSESCut[iBin]), ptPi, nSigmadEdxPi, massPhi, weightLtSecondCut); + MCPhiPionHist.fill(HIST(MCPhiPiSESCut[iBin]), ptPi, nSigmaTPCPi, nSigmaTOFPi, massPhi, weightLtSecondCut); } } } @@ -895,43 +898,43 @@ struct phik0shortanalysis { switch (iBin) { case 0: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 1: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 2: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 3: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 4: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 5: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 6: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 7: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 8: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 9: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } default: @@ -1123,43 +1126,43 @@ struct phik0shortanalysis { switch (iBin) { case 0: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 1: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 2: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 3: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 4: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 5: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 6: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 7: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 8: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 9: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } default: @@ -1483,43 +1486,43 @@ struct phik0shortanalysis { switch (iBin) { case 0: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 1: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 2: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 3: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 4: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 5: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 6: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 7: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 8: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } case 9: { - fillInvMassNSigmadEdx(recPi, track.tpcNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); + fillInvMassNSigma(recPi, track.tpcNSigmaPi(), track.tofNSigmaPi(), listrecPhi, multiplicity, weightInclusive, weightLtFirstCut, weightLtSecondCut); break; } default: From 53a8ab2f7614f893437366e723d24b0134bbb2e1 Mon Sep 17 00:00:00 2001 From: Stefano Cannito Date: Fri, 26 Jul 2024 09:38:32 +0200 Subject: [PATCH 11/12] Format fix --- PWGLF/Tasks/Strangeness/phik0sanalysis.cxx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx index 2e02c68ef3e..2ebdc06b1aa 100644 --- a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx @@ -331,7 +331,7 @@ struct phik0shortanalysis { template bool acceptEventQA(const T& collision) { - if constexpr (!isMC) { // data event + if constexpr (!isMC) { // data event eventHist.fill(HIST("hEventSelection"), 0); // all collisions if (!collision.sel8()) return false; @@ -344,7 +344,7 @@ struct phik0shortanalysis { return false; eventHist.fill(HIST("hEventSelection"), 3); // INEL>0 collisions return true; - } else { // RecMC event + } else { // RecMC event MCeventHist.fill(HIST("hRecMCEventSelection"), 0); // all collisions if (!collision.selection_bit(aod::evsel::kIsTriggerTVX)) return false; @@ -1176,7 +1176,7 @@ struct phik0shortanalysis { void processMCEffPhiK0S(SimCollisions::iterator const& collision, FullMCTracks const&, FullV0s const& V0s, V0DauMCTracks const&, aod::McCollisions const&, aod::McParticles const& mcParticles) { - if (!acceptEventQA(collision)) + if (!acceptEventQA(collision)) return; float multiplicity = collision.centFT0M(); @@ -1201,7 +1201,7 @@ struct phik0shortanalysis { const auto& negDaughterTrack = v0.negTrack_as(); if (!posDaughterTrack.has_mcParticle() || !negDaughterTrack.has_mcParticle()) continue; - + auto posMCDaughterTrack = posDaughterTrack.mcParticle_as(); auto negMCDaughterTrack = negDaughterTrack.mcParticle_as(); if (posMCDaughterTrack.pdgCode() != 211 || negMCDaughterTrack.pdgCode() != -211) @@ -1221,7 +1221,7 @@ struct phik0shortanalysis { } if (pdgParentv0 != 310 || !isPhysPrim) continue; - + if (!selectionV0(v0, posDaughterTrack, negDaughterTrack)) continue; @@ -1229,7 +1229,7 @@ struct phik0shortanalysis { recK0S.SetXYZM(v0.px(), v0.py(), v0.pz(), v0.mK0Short()); if (recK0S.Rapidity() > 0.8) continue; - + std::vector listrecPhi; int countInclusive = 0, countLtFirstCut = 0, countLtSecondCut = 0; @@ -1406,7 +1406,7 @@ struct phik0shortanalysis { continue; auto MCtrack = track.mcParticle_as(); - if (std::abs(MCtrack.pdgCode()) != 211 !! !MCtrack.isPhysicalPrimary()) + if (std::abs(MCtrack.pdgCode()) != 211 || !MCtrack.isPhysicalPrimary()) continue; // Pion selection From 400a4f24b0682466a9af4ea2cd7bd5b9785bb734 Mon Sep 17 00:00:00 2001 From: Stefano Cannito Date: Fri, 26 Jul 2024 11:09:59 +0200 Subject: [PATCH 12/12] Fix typo --- PWGLF/Tasks/Strangeness/phik0sanalysis.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx index 2ebdc06b1aa..091f699147a 100644 --- a/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx +++ b/PWGLF/Tasks/Strangeness/phik0sanalysis.cxx @@ -299,9 +299,9 @@ struct phik0shortanalysis { } // GenMC pT of K0S coupled to Phi - MCPhiK0SHist.add("h1PhiK0SGenMCInclusive", "K0Short coupled to Phi for GenMC Inclusive", kTH1F, {10, -0.5f, 9.5f}); - MCPhiK0SHist.add("h1PhiK0SGenMCFirstCut", "K0Short coupled to Phi for GenMC Deltay < FirstCut", kTH1F, {10, -0.5f, 9.5f}); - MCPhiK0SHist.add("h1PhiK0SGenMCSecondCut", "K0Short coupled to Phi for GenMC Deltay < SecondCut", kTH1F, {10, -0.5f, 9.5f}); + MCPhiK0SHist.add("h1PhiK0SGenMCInclusive", "K0Short coupled to Phi for GenMC Inclusive", kTH1F, {{10, -0.5f, 9.5f}}); + MCPhiK0SHist.add("h1PhiK0SGenMCFirstCut", "K0Short coupled to Phi for GenMC Deltay < FirstCut", kTH1F, {{10, -0.5f, 9.5f}}); + MCPhiK0SHist.add("h1PhiK0SGenMCSecondCut", "K0Short coupled to Phi for GenMC Deltay < SecondCut", kTH1F, {{10, -0.5f, 9.5f}}); // Phi mass vs Pion NSigma dE/dx for Same Event and Mixed Event for (int i = 0; i < nMultBin; i++) { @@ -322,9 +322,9 @@ struct phik0shortanalysis { } // GenMC pT of Pion coupled to Phi - MCPhiPionHist.add("h1PhiPiGenMCInclusive", "Pion coupled to Phi for GenMC Inclusive", kTH1F, {10, -0.5f, 9.5f}); - MCPhiPionHist.add("h1PhiPiGenMCFirstCut", "Pion coupled to Phi for GenMC Deltay < FirstCut", kTH1F, {10, -0.5f, 9.5f}); - MCPhiPionHist.add("h1PhiPiGenMCSecondCut", "Pion coupled to Phi for GenMC Deltay < SecondCut", kTH1F, {10, -0.5f, 9.5f}); + MCPhiPionHist.add("h1PhiPiGenMCInclusive", "Pion coupled to Phi for GenMC Inclusive", kTH1F, {{10, -0.5f, 9.5f}}); + MCPhiPionHist.add("h1PhiPiGenMCFirstCut", "Pion coupled to Phi for GenMC Deltay < FirstCut", kTH1F, {{10, -0.5f, 9.5f}}); + MCPhiPionHist.add("h1PhiPiGenMCSecondCut", "Pion coupled to Phi for GenMC Deltay < SecondCut", kTH1F, {{10, -0.5f, 9.5f}}); } // Event selection and QA filling