From 5d9a2f3066c00a5f39ddd41883b5746aa50882dd Mon Sep 17 00:00:00 2001 From: nkaratze Date: Mon, 14 Jul 2025 22:32:21 +0200 Subject: [PATCH 1/4] Added function for cuts and some extra smaller changes --- PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx | 938 +++++++++++-------- 1 file changed, 557 insertions(+), 381 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx b/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx index bd93c66cdfc..0f71b6c1705 100644 --- a/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx +++ b/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx @@ -61,7 +61,7 @@ struct V0PtInvMassPlots { HistogramRegistry rLambdaMassPlotsPerPtBin{"LambdaMassPlotsPerPtBin", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry rAntilambdaMassPlotsPerPtBin{"AntilambdaMassPlotsPerPtBin", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; HistogramRegistry rFeeddownMatrices{"FeeddownMatrices", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - HistogramRegistry rMCCorrections{"rMCCorrections", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry rMCCorrections{"MCCorrections", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; // Configurable for histograms Configurable nBins{"nBins", 100, "N bins in all histos"}; @@ -76,7 +76,6 @@ struct V0PtInvMassPlots { Configurable etadau{"etadau", 0.8, "Eta Daughters"}; Configurable rapidityCut{"rapidityCut", 0.5, "V0 Rapidity Window"}; Configurable itsMinHits{"itsMinHits", 1.0, "Minimum Hits of Daughter Tracks in the ITS"}; - Configurable paramArmenterosCut{"paramArmenterosCut", 0.2, "Armenteros Cut on parameter"}; // Configurables switches for event selection Configurable dosel8{"dosel8", true, "Enable sel8 event selection"}; @@ -89,6 +88,45 @@ struct V0PtInvMassPlots { Configurable doIsVertexITSTPC{"doIsVertexITSTPC", true, "Enable IsVertexITSTPC event selection"}; Configurable doisInelGt0{"doisInelGt0", true, "Enable isInelGt0 event selection"}; + // Configurables switches for v0 selection + Configurable doRapidityCut{"doRapidityCut", true, "Enable rapidity v0 selection"}; + Configurable doDaughterPseudorapidityCut{"doDaughterPseudorapidityCut", true, "Enable Daughter pseudorapidity v0 selection"}; + Configurable doisITSAfterburner{"doisITSAfterburner", true, "Enable ITS Afterburner"}; + Configurable doitsMinHits{"doitsMinHits", true, "Enable ITS Minimum hits"}; + + // Configurables switches for K0sh selection + Configurable doK0shTPCPID{"doK0shTPCPID", true, "Enable K0sh TPC PID"}; + Configurable doK0shcomptmasscut{"doK0shcomptmasscut", true, "Enable K0sh Competitive V0 Mass Cut"}; + Configurable doK0shMaxct{"doK0shMaxct", true, "Enable K0sh Max ct Cut"}; + Configurable doK0shArmenterosCut{"doK0shArmenterosCut", true, "Enable K0sh Armenteros Cut"}; + Configurable doK0shcosPACut{"doK0shcosPACut", true, "Enable K0sh cosPA Topological Cut"}; + Configurable doK0shDCAdauCut{"doK0shDCAdauCut", true, "Enable K0sh DCA daughters Topological Cut"}; + Configurable doK0shv0radiusCut{"doK0shv0radiusCut", true, "Enable K0sh v0radius Topological Cut"}; + Configurable doK0shdcaposdautopv{"doK0shdcaposdautopv", true, "Enable K0sh DCA pos daughter to PV Topological Cut"}; + Configurable doK0shdcanegdautopv{"doK0shdcanegdautopv", true, "Enable K0sh DCA neg daughter to PV Topological Cut"}; + + // Configurables switches for Lambda selection + Configurable doLambdaTPCPID{"doLambdaTPCPID", true, "Enable Lambda TPC PID"}; + Configurable doLambdacomptmasscut{"doLambdacomptmasscut", true, "Enable Lambda Competitive V0 Mass Cut"}; + Configurable doLambdaMaxct{"doLambdaMaxct", true, "Enable Lambda Max ct Cut"}; + Configurable doLambdaArmenterosCut{"doLambdaArmenterosCut", true, "Enable Lambda Armenteros Cut"}; + Configurable doLambdacosPACut{"doLambdacosPACut", true, "Enable Lambda cosPA Topological Cut"}; + Configurable doLambdaDCAdauCut{"doLambdaDCAdauCut", true, "Enable Lambda DCA daughters Topological Cut"}; + Configurable doLambdav0radiusCut{"doLambdav0radiusCut", true, "Enable Lambda v0radius Topological Cut"}; + Configurable doLambdadcaposdautopv{"doLambdadcaposdautopv", true, "Enable Lambda DCA pos daughter to PV Topological Cut"}; + Configurable doLambdadcanegdautopv{"doLambdadcanegdautopv", true, "Enable Lambda DCA neg daughter to PV Topological Cut"}; + + // Configurables switches for Lambda selection + Configurable doAntilambdaTPCPID{"doAntilambdaTPCPID", true, "Enable Antilambda TPC PID"}; + Configurable doAntilambdacomptmasscut{"doAntilambdacomptmasscut", true, "Enable Antilambda Competitive V0 Mass Cut"}; + Configurable doAntilambdaMaxct{"doAntilambdaMaxct", true, "Enable Antilambda Max ct Cut"}; + Configurable doAntilambdaArmenterosCut{"doAntilambdaArmenterosCut", true, "Enable Antilambda Armenteros Cut"}; + Configurable doAntilambdacosPACut{"doAntilambdacosPACut", true, "Enable Antilambda cosPA Topological Cut"}; + Configurable doAntilambdaDCAdauCut{"doAntilambdaDCAdauCut", true, "Enable Antilambda DCA daughters Topological Cut"}; + Configurable doAntilambdav0radiusCut{"doAntilambdav0radiusCut", true, "Enable Antilambda v0radius Topological Cut"}; + Configurable doAntilambdadcaposdautopv{"doAntilambdadcaposdautopv", true, "Enable Antilambda DCA pos daughter to PV Topological Cut"}; + Configurable doAntilambdadcanegdautopv{"doAntilambdadcanegdautopv", true, "Enable Antilambda DCA neg daughter to PV Topological Cut"}; + // Configurable Kaonsh Cuts (best cuts determined by v0topologicalcuts task) Configurable kaonshSettingdcav0dau{"kaonshSettingdcav0dau", 0.3, "DCA V0 Daughters"}; Configurable kaonshSettingdcapostopv{"kaonshSettingdcapostopv", 0.05, "DCA Pos To PV"}; @@ -96,6 +134,7 @@ struct V0PtInvMassPlots { Configurable kaonshSettingcosPA{"kaonshSettingcosPA", 0.98, "V0 CosPA"}; // double -> N.B. dcos(x)/dx = 0 at x=0 Configurable kaonshSettingradius{"kaonshSettingradius", 0.50, "v0radius"}; Configurable kaonshmaxct{"kaonshmaxct", 20.00, "K0sh maximum ct value"}; + Configurable K0shparamArmenterosCut{"K0shparamArmenterosCut", 0.2, "K0sh Armenteros Cut on parameter"}; // Configurable Lambda Cuts (best cuts determined by v0topologicalcuts task) Configurable lambdaSettingdcav0dau{"lambdaSettingdcav0dau", 0.3, "DCA V0 Daughters"}; @@ -104,6 +143,7 @@ struct V0PtInvMassPlots { Configurable lambdaSettingcosPA{"lambdaSettingcosPA", 0.98, "V0 CosPA"}; // double -> N.B. dcos(x)/dx = 0 at x=0 Configurable lambdaSettingradius{"lambdaSettingradius", 0.50, "v0radius"}; Configurable lambdamaxct{"lambdamaxct", 30.00, "Lambda maximum ct value"}; + Configurable lambdaparamArmenterosCut{"lambdaparamArmenterosCut", 0.2, "Lambda Armenteros Cut on parameter"}; // Configurable Antilambda Cuts (best cuts determined by v0topologicalcuts task) Configurable antilambdaSettingdcav0dau{"antilambdaSettingdcav0dau", 0.3, "DCA V0 Daughters"}; @@ -112,6 +152,7 @@ struct V0PtInvMassPlots { Configurable antilambdaSettingcosPA{"antilambdaSettingcosPA", 0.98, "V0 CosPA"}; // double -> N.B. dcos(x)/dx = 0 at x=0 Configurable antilambdaSettingradius{"antilambdaSettingradius", 0.50, "v0radius"}; Configurable antilambdamaxct{"antilambdamaxct", 30.00, "Antilambda maximum ct value"}; + Configurable antilambdaparamArmenterosCut{"antilambdaparamArmenterosCut", 0.2, "Antilambda Armenteros Cut on parameter"}; // Configurables for Specific V0s analysis Configurable kzeroAnalysis{"kzeroAnalysis", true, "Enable Kzerosh Pt Analysis"}; @@ -151,8 +192,9 @@ struct V0PtInvMassPlots { AxisSpec lambdaPtAxis = {lambdaptedgevalues, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec antilambdaPtAxis = {antilambdaPtedgevalues, "#it{p}_{T} (GeV/#it{c})"}; AxisSpec armenterosQtAxis = {nBinsArmenteros, 0.0f, 0.3f, "#it{p}_{T} (GeV/#it{c})"}; - AxisSpec armenterosasymAxis = {nBinsArmenteros, -1.f, 1.f, "#ait{p}^{+}_{||}-it{p}^{-}_{||}/it{p}^{+}_{||}+it{p}^{-}_{||}"}; + AxisSpec armenterosasymAxis = {nBinsArmenteros, -1.f, 1.f, "#it{p}^{+}_{||}-#it{p}^{-}_{||}/#it{p}^{+}_{||}+#it{p}^{-}_{||}"}; AxisSpec vertexZAxis = {nBins, -11.0f, 11.0f, "vrtx_{Z} [cm]"}; + AxisSpec partCutsAxis{10, 0.0f, 10.0f, "Cut index"}; std::vector kaonhistvalue(nmaxHistograms + 1); std::vector lambdahistvalue(nmaxHistograms + 1); @@ -180,8 +222,13 @@ struct V0PtInvMassPlots { } // General Plots + rPtAnalysis.add("hNEvents", "hNEvents", {HistType::kTH1D, {{10, 0.f, 10.f}}}); rPtAnalysis.add("hNRecEvents_Data", "hNRecEvents_Data", {HistType::kTH1D, {{1, 0.f, 1.f}}}); rPtAnalysis.add("hNV0s", "hNV0s", {HistType::kTH1D, {{10, 0.f, 10.f}}}); + rPtAnalysis.add("hNK0sh", "hNK0sh", {HistType::kTH1D, {{10, 0.f, 10.f}}}); + rPtAnalysis.add("hNLambda", "hNLambda", {HistType::kTH1D, {{10, 0.f, 10.f}}}); + rPtAnalysis.add("hNAntilambda", "hNAntilambda", {HistType::kTH1D, {{10, 0.f, 10.f}}}); + rPtAnalysis.add("hVertexZRec", "hVertexZRec", {HistType::kTH1F, {vertexZAxis}}); rPtAnalysis.add("hArmenterosPodolanskiPlot", "hArmenterosPodolanskiPlot", {HistType::kTH2F, {{armenterosasymAxis}, {armenterosQtAxis}}}); rPtAnalysis.add("hV0EtaDaughters", "hV0EtaDaughters", {HistType::kTH1F, {{nBins, -1.2f, 1.2f}}}); @@ -189,38 +236,39 @@ struct V0PtInvMassPlots { // Adding Kzerosh Histograms to registry if (kzeroAnalysis == true) { - rPtAnalysis.add("hK0ShortReconstructedPtSpectrum", "hK0ShortReconstructedPtSpectrum", {HistType::kTH1F, {k0ShortPtAxis}}); - rPtAnalysis.add("hMassK0ShortAll", "hMassK0ShortAll", {HistType::kTH1F, {k0ShortMassAxis}}); - rPtAnalysis.add("hK0ShortPtSpectrumBeforeCuts", "hK0ShortPtSpectrumBeforeCuts", {HistType::kTH1F, {k0ShortPtAxis}}); - rPtAnalysis.add("hMassK0ShortAllAfterCuts", "hMassK0ShortAllAfterCuts", {HistType::kTH1F, {k0ShortMassAxis}}); - rPtAnalysis.add("hNSigmaPosPiFromK0s", "hNSigmaPosPiFromK0s", {HistType::kTH2F, {{100, -5.f, 5.f}, {k0ShortPtAxis}}}); - rPtAnalysis.add("hNSigmaNegPiFromK0s", "hNSigmaNegPiFromK0s", {HistType::kTH2F, {{100, -5.f, 5.f}, {k0ShortPtAxis}}}); - rPtAnalysis.add("hK0shEtaDaughters", "hK0shEtaDaughters", {HistType::kTH1F, {{nBins, -1.2f, 1.2f}}}); - rPtAnalysis.add("hArmenterosPodolanskiPlotK0Short", "hArmenterosPodolanskiPlotK0Short", {HistType::kTH2F, {{armenterosasymAxis}, {armenterosQtAxis}}}); - rPtAnalysis.add("hK0shNegDaughterPt", "hK0shNegDaughterPt", {HistType::kTH1F, {k0ShortPtAxis}}); - rPtAnalysis.add("hK0shPosDaughterPt", "hK0shPosDaughterPt", {HistType::kTH1F, {k0ShortPtAxis}}); - + rPtAnalysis.add("hMassK0ShortvsCuts", "hMassK0ShortvsCuts", {HistType::kTH2F, {{partCutsAxis}, {k0ShortMassAxis}}}); + rPtAnalysis.add("hArmenterosPodolanskiPlotK0sh", "hArmenterosPodolanskiPlotK0sh", {HistType::kTH2F, {{armenterosasymAxis}, {armenterosQtAxis}}}); + rPtAnalysis.add("hNSigmaPosPionFromK0s", "hNSigmaPosPionFromK0s", {HistType::kTH2F, {{100, -5.f, 5.f}, {k0ShortPtAxis}}}); + rPtAnalysis.add("hNSigmaNegPionFromK0s", "hNSigmaNegPionFromK0s", {HistType::kTH2F, {{100, -5.f, 5.f}, {k0ShortPtAxis}}}); + rPtAnalysis.add("hK0shV0radius", "hK0shV0radius", {HistType::kTH1F, {{nBins, 0.0f, 50.0f}}}); + rPtAnalysis.add("hK0shcosPA", "hK0shcosPA", {HistType::kTH1F, {{nBins, 0.95f, 1.0f}}}); + rPtAnalysis.add("hK0shDCAV0Daughters", "hK0shDCAV0Daughters", {HistType::kTH1F, {{nBins, 0.0f, 2.2f}}}); + rPtAnalysis.add("hK0shDCAPosDaughter", "hK0shDCAPosDaughter", {HistType::kTH1F, {{nBins, 0.0f, 2.2f}}}); + rPtAnalysis.add("hK0shDCANegDaughter", "hK0shDCANegDaughter", {HistType::kTH1F, {{nBins, 0.0f, 2.2f}}}); for (int i = 0; i < nmaxHistograms; i++) { pthistos::kaonPt[i] = rKaonshMassPlotsPerPtBin.add(fmt::format("hPt_from_{0}_to_{1}", kaonhistvalue[i], kaonhistvalue[i + 1]).c_str(), fmt::format("hPt_from_{0}_to_{1}", kaonhistvalue[i], kaonhistvalue[i + 1]).c_str(), {HistType::kTH1D, {{k0ShortMassAxis}}}); } + rFeeddownMatrices.add("hK0shFeeddownMatrix", "hK0shFeeddownMatrix", {HistType::kTH2F, {{k0ShortPtAxis}, {k0ShortPtAxis}}}); + rFeeddownMatrices.add("hK0shPhiFeeddownMatrix", "hK0shPhiFeeddownMatrix", {HistType::kTH2F, {{k0ShortPtAxis}, {k0ShortPtAxis}}}); } // Adding Lambda Histograms if (lambdaAnalysis == true) { // same method as in Kzerosh above - rPtAnalysis.add("hLambdaReconstructedPtSpectrum", "hLambdaReconstructedPtSpectrum", {HistType::kTH1F, {lambdaPtAxis}}); - rPtAnalysis.add("hMassLambdaAll", "hMassLambdaAll", {HistType::kTH1F, {lambdaMassAxis}}); - rPtAnalysis.add("hLambdaPtSpectrumBeforeCuts", "hLambdaPtSpectrumBeforeCuts", {HistType::kTH1F, {lambdaPtAxis}}); - rPtAnalysis.add("hMassLambdaAllAfterCuts", "hMassLambdaAllAfterCuts", {HistType::kTH1F, {lambdaMassAxis}}); - rPtAnalysis.add("hNSigmaPosProtonFromLambda", "hNSigmaPosProtonFromLambda", {HistType::kTH2F, {{100, -5.f, 5.f}, {lambdaPtAxis}}}); - rPtAnalysis.add("hNSigmaNegPionFromLambda", "hNSigmaNegPionFromLambda", {HistType::kTH2F, {{100, -5.f, 5.f}, {lambdaPtAxis}}}); - rPtAnalysis.add("hLambdaEtaDaughters", "hLambdaEtaDaughters", {HistType::kTH1F, {{nBins, -1.2f, 1.2f}}}); + rPtAnalysis.add("hMassLambdavsCuts", "hMassLambdavsCuts", {HistType::kTH2F, {{partCutsAxis}, {k0ShortMassAxis}}}); rPtAnalysis.add("hArmenterosPodolanskiPlotLambda", "hArmenterosPodolanskiPlotLambda", {HistType::kTH2F, {{armenterosasymAxis}, {armenterosQtAxis}}}); - rPtAnalysis.add("hLambdaNegDaughterPt", "hLambdaNegDaughterPt", {HistType::kTH1F, {lambdaPtAxis}}); - rPtAnalysis.add("hLambdaPosDaughterPt", "hLambdaPosDaughterPt", {HistType::kTH1F, {lambdaPtAxis}}); + rPtAnalysis.add("hLambdaAlphaTestPtSpectrum", "hLambdaAlphaTestPtSpectrum", {HistType::kTH1F, {lambdaPtAxis}}); + rPtAnalysis.add("hNSigmaPosProtonFromLambdas", "hNSigmaPosProtonFromLambdas", {HistType::kTH2F, {{100, -5.f, 5.f}, {lambdaPtAxis}}}); + rPtAnalysis.add("hNSigmaNegPionFromLambdas", "hNSigmaNegPionFromLambdas", {HistType::kTH2F, {{100, -5.f, 5.f}, {lambdaPtAxis}}}); + rPtAnalysis.add("hLambdaV0radius", "hLambdaV0radius", {HistType::kTH1F, {{nBins, 0.0f, 50.0f}}}); + rPtAnalysis.add("hLambdacosPA", "hLambdacosPA", {HistType::kTH1F, {{nBins, 0.95f, 1.0f}}}); + rPtAnalysis.add("hLambdaDCAV0Daughters", "hLambdaDCAV0Daughters", {HistType::kTH1F, {{nBins, 0.0f, 2.2f}}}); + rPtAnalysis.add("hLambdaDCAPosDaughter", "hLambdaDCAPosDaughter", {HistType::kTH1F, {{nBins, 0.0f, 2.2f}}}); + rPtAnalysis.add("hLambdaDCANegDaughter", "hLambdaDCANegDaughter", {HistType::kTH1F, {{nBins, 0.0f, 2.2f}}}); for (int i = 0; i < nmaxHistograms; i++) { pthistos::lambdaPt[i] = rLambdaMassPlotsPerPtBin.add(fmt::format("hPt_from_{0}_to_{1}", lambdahistvalue[i], lambdahistvalue[i + 1]).c_str(), fmt::format("hPt_from_{0}_to_{1}", lambdahistvalue[i], lambdahistvalue[i + 1]).c_str(), {HistType::kTH1D, {{lambdaMassAxis}}}); } // lambdafeeddown matrices + rFeeddownMatrices.add("hLambdaFeeddownMatrix", "hLambdaFeeddownMatrix", {HistType::kTH2F, {{lambdaPtAxis}, {lambdaPtAxis}}}); rFeeddownMatrices.add("hLambdaXiMinusFeeddownMatrix", "hLambdaXiMinusFeeddownMatrix", {HistType::kTH2F, {{lambdaPtAxis}, {lambdaPtAxis}}}); rFeeddownMatrices.add("hLambdaXiZeroFeeddownMatrix", "hLambdaXiZeroFeeddownMatrix", {HistType::kTH2F, {{lambdaPtAxis}, {lambdaPtAxis}}}); rFeeddownMatrices.add("hLambdaOmegaFeeddownMatrix", "hLambdaOmegaFeeddownMatrix", {HistType::kTH2F, {{lambdaPtAxis}, {lambdaPtAxis}}}); @@ -228,21 +276,21 @@ struct V0PtInvMassPlots { // Adding Antilambda Histograms if (antiLambdaAnalysis == true) { // same method as in Lambda and Kzerosh above - rPtAnalysis.add("hAntilambdaGeneratedPtSpectrum", "hAntilambdaGeneratedPtSpectrum", {HistType::kTH1F, {{antilambdaPtAxis}}}); - rPtAnalysis.add("hAntilambdaReconstructedPtSpectrum", "hAntilambdaReconstructedPtSpectrum", {HistType::kTH1F, {antilambdaPtAxis}}); - rPtAnalysis.add("hMassAntilambdaAll", "hMassAntilambdaAll", {HistType::kTH1F, {antiLambdaMassAxis}}); - rPtAnalysis.add("hantilambdaPtSpectrumBeforeCuts", "hantilambdaPtSpectrumBeforeCuts", {HistType::kTH1F, {antilambdaPtAxis}}); - rPtAnalysis.add("hMassAntilambdaAllAfterCuts", "hMassAntilambdaAllAfterCuts", {HistType::kTH1F, {antiLambdaMassAxis}}); - rPtAnalysis.add("hNSigmaNegProtonFromAntilambda", "hNSigmaNegProtonFromAntilambda", {HistType::kTH2F, {{100, -5.f, 5.f}, {antilambdaPtAxis}}}); - rPtAnalysis.add("hNSigmaPosPionFromAntilambda", "hNSigmaPosPionFromAntilambda", {HistType::kTH2F, {{100, -5.f, 5.f}, {antilambdaPtAxis}}}); - rPtAnalysis.add("hAntiLambdaEtaDaughters", "hAntiLambdaEtaDaughters", {HistType::kTH1F, {{nBins, -1.2f, 1.2f}}}); - rPtAnalysis.add("hArmenterosPodolanskiPlotAntiLambda", "hArmenterosPodolanskiPlotAntiLambda", {HistType::kTH2F, {{armenterosasymAxis}, {armenterosQtAxis}}}); - rPtAnalysis.add("hAntiLambdaNegDaughterPt", "hAntiLambdaNegDaughterPt", {HistType::kTH1F, {antilambdaPtAxis}}); - rPtAnalysis.add("hAntiLambdaPosDaughterPt", "hAntiLambdaPosDaughterPt", {HistType::kTH1F, {antilambdaPtAxis}}); + rPtAnalysis.add("hMassAntilambdavsCuts", "hMassAntilambdavsCuts", {HistType::kTH2F, {{partCutsAxis}, {k0ShortMassAxis}}}); + rPtAnalysis.add("hArmenterosPodolanskiPlotAntilambda", "hArmenterosPodolanskiPlotAntilambda", {HistType::kTH2F, {{armenterosasymAxis}, {armenterosQtAxis}}}); + rPtAnalysis.add("hAntilambdaAlphaTestPtSpectrum", "hAntilambdaAlphaTestPtSpectrum", {HistType::kTH1F, {antilambdaPtAxis}}); + rPtAnalysis.add("hNSigmaPosPionFromAntilambdas", "hNSigmaPosPionFromAntilambdas", {HistType::kTH2F, {{100, -5.f, 5.f}, {antilambdaPtAxis}}}); + rPtAnalysis.add("hNSigmaNegProtonFromAntilambdas", "hNSigmaNegProtonFromAntilambdas", {HistType::kTH2F, {{100, -5.f, 5.f}, {antilambdaPtAxis}}}); + rPtAnalysis.add("hAntilambdaV0radius", "hAntilambdaV0radius", {HistType::kTH1F, {{nBins, 0.0f, 50.0f}}}); + rPtAnalysis.add("hAntilambdacosPA", "hAntilambdacosPA", {HistType::kTH1F, {{nBins, 0.95f, 1.0f}}}); + rPtAnalysis.add("hAntilambdaDCAV0Daughters", "hAntilambdaDCAV0Daughters", {HistType::kTH1F, {{nBins, 0.0f, 2.2f}}}); + rPtAnalysis.add("hAntilambdaDCAPosDaughter", "hAntilambdaDCAPosDaughter", {HistType::kTH1F, {{nBins, 0.0f, 2.2f}}}); + rPtAnalysis.add("hAntilambdaDCANegDaughter", "hAntilambdaDCANegDaughter", {HistType::kTH1F, {{nBins, 0.0f, 2.2f}}}); for (int i = 0; i < nmaxHistograms; i++) { pthistos::antilambdaPt[i] = rAntilambdaMassPlotsPerPtBin.add(fmt::format("hPt_from_{0}_to_{1}", antilambdahistvalue[i], antilambdahistvalue[i + 1]).c_str(), fmt::format("hPt_from_{0}_to_{1}", antilambdahistvalue[i], antilambdahistvalue[i + 1]).c_str(), {HistType::kTH1D, {{antiLambdaMassAxis}}}); } // antilambdafeeddown matrices + rFeeddownMatrices.add("hAntiLambdaFeeddownMatrix", "hAntiLambdaFeeddownMatrix", {HistType::kTH2F, {{antilambdaPtAxis}, {antilambdaPtAxis}}}); rFeeddownMatrices.add("hAntiLambdaXiPlusFeeddownMatrix", "hAntiLambdaXiPlusFeeddownMatrix", {HistType::kTH2F, {{antilambdaPtAxis}, {antilambdaPtAxis}}}); rFeeddownMatrices.add("hAntiLambdaAntiXiZeroFeeddownMatrix", "hAntiLambdaAntiXiZeroFeeddownMatrix", {HistType::kTH2F, {{antilambdaPtAxis}, {antilambdaPtAxis}}}); rFeeddownMatrices.add("hAntiLambdaAntiOmegaFeeddownMatrix", "hAntiLambdaAntiOmegaPlusFeeddownMatrix", {HistType::kTH2F, {{antilambdaPtAxis}, {antilambdaPtAxis}}}); @@ -263,11 +311,10 @@ struct V0PtInvMassPlots { rMCCorrections.add("hAntilambdaAfterEventSelectionPtSpectrum", "hAntilambdaAfterEventSelectionPtSpectrum", {HistType::kTH1F, {{antilambdaPtAxis}}}); // Event and V0s Corrections - rMCCorrections.add("hNEvents", "hNEvents", {HistType::kTH1D, {{10, 0.f, 10.f}}}); rMCCorrections.add("hNEvents_Corrections", "hNEvents_Corrections", {HistType::kTH1D, {{10, 0.f, 10.f}}}); rMCCorrections.add("hNRecEvents_MC", "hNRecEvents_MC", {HistType::kTH1D, {{1, 0.f, 1.f}}}); - // Generated Level Pt Spectrums + // Generated Level Pt Spectrums (with rapidity cut) rMCCorrections.add("GenParticleRapidity", "GenParticleRapidity", {HistType::kTH1F, {{nBins, -10.0f, 10.0f}}}); rMCCorrections.add("hK0ShGeneratedPtSpectrum", "hK0ShGeneratedPtSpectrum", {HistType::kTH1F, {k0ShortPtAxis}}); rMCCorrections.add("hLambdaGeneratedPtSpectrum", "hLambdaGeneratedPtSpectrum", {HistType::kTH1F, {lambdaPtAxis}}); @@ -281,47 +328,327 @@ struct V0PtInvMassPlots { rMCCorrections.add("hPhiGeneratedPtSpectrum", "hPhiGeneratedPtSpectrum", {HistType::kTH1F, {k0ShortPtAxis}}); } - // Event selection + // Event selection function template bool acceptEvent(TCollision const& collision) { - rMCCorrections.fill(HIST("hNEvents"), 0.5); + rPtAnalysis.fill(HIST("hNEvents"), 0.5); + rPtAnalysis.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(1, "All"); if (!(collision.sel8() && dosel8)) { return false; } - rMCCorrections.fill(HIST("hNEvents"), 1.5); + rPtAnalysis.fill(HIST("hNEvents"), 1.5); + rPtAnalysis.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(2, "sel 8"); if (!(collision.selection_bit(aod::evsel::kNoTimeFrameBorder) && doNoTimeFrameBorder)) { return false; } - rMCCorrections.fill(HIST("hNEvents"), 2.5); + rPtAnalysis.fill(HIST("hNEvents"), 2.5); + rPtAnalysis.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(3, "NoTimeFrameBorder"); if (!(collision.selection_bit(aod::evsel::kNoITSROFrameBorder) && doNoITSROFrameBorder)) { return false; } - rMCCorrections.fill(HIST("hNEvents"), 3.5); + rPtAnalysis.fill(HIST("hNEvents"), 3.5); + rPtAnalysis.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(4, "NoITSROFrameBorder"); if (!(collision.selection_bit(aod::evsel::kIsTriggerTVX) && doIsTriggerTVX)) { return false; } - rMCCorrections.fill(HIST("hNEvents"), 4.5); + rPtAnalysis.fill(HIST("hNEvents"), 4.5); + rPtAnalysis.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(5, "IsTriggerTVX"); if (!(std::abs(collision.posZ()) < cutZVertex && docutZVertex)) { return false; } - rMCCorrections.fill(HIST("hNEvents"), 5.5); + rPtAnalysis.fill(HIST("hNEvents"), 5.5); + rPtAnalysis.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(6, "cutZVertex"); if (!(collision.selection_bit(aod::evsel::kIsVertexTOFmatched) && doIsVertexTOFmatched)) { return false; } - rMCCorrections.fill(HIST("hNEvents"), 6.5); + rPtAnalysis.fill(HIST("hNEvents"), 6.5); + rPtAnalysis.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(7, "IsVertexTOFmatched"); if (!(collision.selection_bit(aod::evsel::kNoSameBunchPileup) && doNoSameBunchPileup)) { return false; } - rMCCorrections.fill(HIST("hNEvents"), 7.5); + rPtAnalysis.fill(HIST("hNEvents"), 7.5); + rPtAnalysis.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(8, "NoSameBunchPileup"); if (!(collision.selection_bit(aod::evsel::kIsVertexITSTPC) && doIsVertexITSTPC)) { return false; } - rMCCorrections.fill(HIST("hNEvents"), 8.5); + rPtAnalysis.fill(HIST("hNEvents"), 8.5); + rPtAnalysis.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(9, "IsVertexITSTPC"); if (!(collision.isInelGt0() && doisInelGt0)) { return false; } - rMCCorrections.fill(HIST("hNEvents"), 9.5); + rPtAnalysis.fill(HIST("hNEvents"), 9.5); + rPtAnalysis.get(HIST("hNEvents"))->GetXaxis()->SetBinLabel(10, "isInelGt0"); + return true; + + // Cut Plots + rPtAnalysis.fill(HIST("hVertexZRec"), collision.posZ()); + } + + // V0 selection function + template + bool acceptV0(TV0 const& v0) + { + const auto& posDaughterTrack = v0.template posTrack_as(); // Positive Daughter track + const auto& negDaughterTrack = v0.template negTrack_as(); // Negative Daughter track + + rPtAnalysis.fill(HIST("hNV0s"), 0.5); + rPtAnalysis.get(HIST("hNV0s"))->GetXaxis()->SetBinLabel(1, "All V0s"); + if (std::abs(v0.y()) > rapidityCut && doRapidityCut) { // V0 Rapidity Cut + return false; + } + rPtAnalysis.fill(HIST("hNV0s"), 1.5); + rPtAnalysis.get(HIST("hNV0s"))->GetXaxis()->SetBinLabel(2, "Rapidity"); + if ((std::abs(posDaughterTrack.eta()) > etadau && std::abs(negDaughterTrack.eta()) > etadau) && doDaughterPseudorapidityCut) { // Daughters Pseudorapidity Cut + return false; + } + rPtAnalysis.fill(HIST("hNV0s"), 2.5); + rPtAnalysis.get(HIST("hNV0s"))->GetXaxis()->SetBinLabel(3, "Dau Pseudorapidity"); + if ((posDaughterTrack.isITSAfterburner() || negDaughterTrack.isITSAfterburner()) && doisITSAfterburner) { // ITS After Burner on daughter tracks + return false; + } + rPtAnalysis.fill(HIST("hNV0s"), 3.5); + rPtAnalysis.get(HIST("hNV0s"))->GetXaxis()->SetBinLabel(4, "ITS Afterburner"); + if (posDaughterTrack.itsNCls() <= itsMinHits && negDaughterTrack.itsNCls() <= itsMinHits && doitsMinHits) { // Minimum hits in the ITS + return false; + rPtAnalysis.fill(HIST("hNV0s"), 4.5); + rPtAnalysis.get(HIST("hNV0s"))->GetXaxis()->SetBinLabel(5, "ITS Min Hits"); + // Cut Plots + rPtAnalysis.fill(HIST("V0Rapidity"), v0.y()); + rPtAnalysis.fill(HIST("hV0EtaDaughters"), v0.template posTrack_as().eta()); + rPtAnalysis.fill(HIST("hV0EtaDaughters"), v0.template negTrack_as().eta()); + } + return true; + } + + // K0sh selection function + template + bool acceptK0sh(TV0 const& v0) + { + const auto& posDaughterTrack = v0.template posTrack_as(); // Positive Daughter track + const auto& negDaughterTrack = v0.template negTrack_as(); // Negative Daughter track + + rPtAnalysis.fill(HIST("hNK0sh"), 0.5); + rPtAnalysis.get(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(1, "All"); + rPtAnalysis.fill(HIST("hMassK0ShortvsCuts"), 0.5, v0.mK0Short()); + if ((std::abs(posDaughterTrack.tpcNSigmaPi()) > nSigmaTPCPion && std::abs(negDaughterTrack.tpcNSigmaPi()) > nSigmaTPCPion) && doK0shTPCPID) { // TPC PID for two pions + return false; + } + rPtAnalysis.fill(HIST("hNK0sh"), 1.5); + rPtAnalysis.get(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(2, "TPC_PID"); + rPtAnalysis.fill(HIST("hMassK0ShortvsCuts"), 1.5, v0.mK0Short()); + if (std::abs(v0.mLambda() - o2::constants::physics::MassLambda0) < compv0masscut && std::abs(v0.mAntiLambda() - o2::constants::physics::MassLambda0) < compv0masscut && doK0shcomptmasscut) { // Kzero competitive v0 mass cut (cut out Lambdas and Anti-Lambdas) + return false; + } + rPtAnalysis.fill(HIST("hNK0sh"), 2.5); + rPtAnalysis.get(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(3, "Compt_Mass"); + rPtAnalysis.fill(HIST("hMassK0ShortvsCuts"), 2.5, v0.mK0Short()); + if (v0.v0radius() > kaonshmaxct && doK0shMaxct) { // K0sh max ct + return false; + } + rPtAnalysis.fill(HIST("hNK0sh"), 3.5); + rPtAnalysis.get(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(4, "Max_ct"); + rPtAnalysis.fill(HIST("hMassK0ShortvsCuts"), 3.5, v0.mK0Short()); + if (v0.qtarm() < (K0shparamArmenterosCut * std::abs(v0.alpha())) && doK0shArmenterosCut) { // K0sh Armenteros Cut + return false; + } + rPtAnalysis.fill(HIST("hNK0sh"), 4.5); + rPtAnalysis.get(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(5, "Armenteros"); + rPtAnalysis.fill(HIST("hMassK0ShortvsCuts"), 4.5, v0.mK0Short()); + if (v0.v0cosPA() < kaonshSettingcosPA && doK0shcosPACut) { // K0sh cosPA Topological Cut + return false; + } + rPtAnalysis.fill(HIST("hNK0sh"), 5.5); + rPtAnalysis.get(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(6, "cosPA"); + rPtAnalysis.fill(HIST("hMassK0ShortvsCuts"), 5.5, v0.mK0Short()); + if (v0.dcaV0daughters() > kaonshSettingdcav0dau && doK0shDCAdauCut) { // K0sh DCAdaughters Topological Cut + return false; + } + rPtAnalysis.fill(HIST("hNK0sh"), 6.5); + rPtAnalysis.get(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(7, "DCAdau"); + rPtAnalysis.fill(HIST("hMassK0ShortvsCuts"), 6.5, v0.mK0Short()); + if (v0.v0radius() < kaonshSettingradius && doK0shv0radiusCut) { // K0sh v0radius Topological Cut + return false; + } + rPtAnalysis.fill(HIST("hNK0sh"), 7.5); + rPtAnalysis.get(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(8, "v0radius"); + rPtAnalysis.fill(HIST("hMassK0ShortvsCuts"), 7.5, v0.mK0Short()); + if (std::abs(v0.dcapostopv()) < kaonshSettingdcapostopv && doK0shdcaposdautopv) { // K0sh DCAPosDaughterToPV Topological Cut + return false; + } + rPtAnalysis.fill(HIST("hNK0sh"), 8.5); + rPtAnalysis.get(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(9, "DCAPosDautoPV"); + rPtAnalysis.fill(HIST("hMassK0ShortvsCuts"), 8.5, v0.mK0Short()); + if (std::abs(v0.dcanegtopv()) < kaonshSettingdcanegtopv && doK0shdcanegdautopv) { // K0sh DCANegDaughterToPV Topological Cut + return false; + } + rPtAnalysis.fill(HIST("hNK0sh"), 9.5); + rPtAnalysis.get(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(10, "DCANegDautoPV"); + rPtAnalysis.fill(HIST("hMassK0ShortvsCuts"), 9.5, v0.mK0Short()); + + // Cut Plots + rPtAnalysis.fill(HIST("hArmenterosPodolanskiPlotK0sh"), v0.alpha(), v0.qtarm()); + rPtAnalysis.fill(HIST("hNSigmaPosPionFromK0s"), posDaughterTrack.tpcNSigmaPi(), posDaughterTrack.tpcInnerParam()); + rPtAnalysis.fill(HIST("hNSigmaNegPionFromK0s"), negDaughterTrack.tpcNSigmaPi(), negDaughterTrack.tpcInnerParam()); + rPtAnalysis.fill(HIST("hK0shcosPA"), v0.v0cosPA()); + rPtAnalysis.fill(HIST("hK0shV0radius"), v0.v0radius()); + rPtAnalysis.fill(HIST("hK0shDCAV0Daughters"), v0.dcaV0daughters()); + rPtAnalysis.fill(HIST("hK0shDCAPosDaughter"), v0.dcapostopv()); + rPtAnalysis.fill(HIST("hK0shDCANegDaughter"), v0.dcanegtopv()); + return true; + } + + // Lambda selection function + template + bool acceptLambda(TV0 const& v0) + { + const auto& posDaughterTrack = v0.template posTrack_as(); // Positive Daughter track + const auto& negDaughterTrack = v0.template negTrack_as(); // Negative Daughter track + + rPtAnalysis.fill(HIST("hNLambda"), 0.5); + rPtAnalysis.get(HIST("hNLambda"))->GetXaxis()->SetBinLabel(1, "All"); + rPtAnalysis.fill(HIST("hMassLambdavsCuts"), 0.5, v0.mLambda()); + if (std::abs(posDaughterTrack.tpcNSigmaPr()) > nSigmaTPCProton && std::abs(negDaughterTrack.tpcNSigmaPi()) > nSigmaTPCPion && doLambdaTPCPID) { // TPC PID on daughter pion and proton for Lambda + return false; + } + rPtAnalysis.fill(HIST("hNLambda"), 1.5); + rPtAnalysis.get(HIST("hNLambda"))->GetXaxis()->SetBinLabel(2, "TPC_PID"); + rPtAnalysis.fill(HIST("hMassLambdavsCuts"), 1.5, v0.mLambda()); + if (std::abs(v0.mK0Short() - o2::constants::physics::MassK0Short) < compv0masscut && doLambdacomptmasscut) { // Lambda competitive v0 mass cut (cut out Kaons) + return false; + } + rPtAnalysis.fill(HIST("hNLambda"), 2.5); + rPtAnalysis.get(HIST("hNLambda"))->GetXaxis()->SetBinLabel(3, "Compt_Mass"); + rPtAnalysis.fill(HIST("hMassLambdavsCuts"), 2.5, v0.mLambda()); + if (v0.v0radius() > lambdamaxct && doLambdaMaxct) { // Lambda max ct + return false; + } + rPtAnalysis.fill(HIST("hNLambda"), 3.5); + rPtAnalysis.get(HIST("hNLambda"))->GetXaxis()->SetBinLabel(4, "Max_ct"); + rPtAnalysis.fill(HIST("hMassLambdavsCuts"), 3.5, v0.mLambda()); + if (v0.qtarm() < (lambdaparamArmenterosCut * std::abs(v0.alpha())) && doLambdaArmenterosCut) { // Lambda Armenteros Cut + return false; + } + rPtAnalysis.fill(HIST("hNLambda"), 4.5); + rPtAnalysis.get(HIST("hNLambda"))->GetXaxis()->SetBinLabel(5, "Armenteros"); + rPtAnalysis.fill(HIST("hMassLambdavsCuts"), 4.5, v0.mLambda()); + if (v0.v0cosPA() < lambdaSettingcosPA && doLambdacosPACut) { // Lambda cosPA Topological Cut + return false; + } + rPtAnalysis.fill(HIST("hNLambda"), 5.5); + rPtAnalysis.get(HIST("hNLambda"))->GetXaxis()->SetBinLabel(6, "cosPA"); + rPtAnalysis.fill(HIST("hMassLambdavsCuts"), 5.5, v0.mLambda()); + if (v0.dcaV0daughters() > lambdaSettingdcav0dau && doLambdaDCAdauCut) { // Lambda DCAdaughters Topological Cut + return false; + } + rPtAnalysis.fill(HIST("hNLambda"), 6.5); + rPtAnalysis.get(HIST("hNLambda"))->GetXaxis()->SetBinLabel(7, "DCAdau"); + rPtAnalysis.fill(HIST("hMassLambdavsCuts"), 6.5, v0.mLambda()); + if (v0.v0radius() < lambdaSettingradius && doLambdav0radiusCut) { // Lambda v0radius Topological Cut + return false; + } + rPtAnalysis.fill(HIST("hNLambda"), 7.5); + rPtAnalysis.get(HIST("hNLambda"))->GetXaxis()->SetBinLabel(8, "v0radius"); + rPtAnalysis.fill(HIST("hMassLambdavsCuts"), 7.5, v0.mLambda()); + if (std::abs(v0.dcapostopv()) < lambdaSettingdcapostopv && doLambdadcaposdautopv) { // Lambda DCAPosDaughterToPV Topological Cut + return false; + } + rPtAnalysis.fill(HIST("hNLambda"), 8.5); + rPtAnalysis.get(HIST("hNLambda"))->GetXaxis()->SetBinLabel(9, "DCAPosDautoPV"); + rPtAnalysis.fill(HIST("hMassLambdavsCuts"), 8.5, v0.mLambda()); + if (std::abs(v0.dcanegtopv()) < lambdaSettingdcanegtopv && doLambdadcanegdautopv) { // Lambda DCANegDaughterToPV Topological Cut + return false; + } + rPtAnalysis.fill(HIST("hNLambda"), 9.5); + rPtAnalysis.get(HIST("hNLambda"))->GetXaxis()->SetBinLabel(10, "DCANegDautoPV"); + rPtAnalysis.fill(HIST("hMassLambdavsCuts"), 9.5, v0.mLambda()); + + // Cut Plots + rPtAnalysis.fill(HIST("hArmenterosPodolanskiPlotLambda"), v0.alpha(), v0.qtarm()); + rPtAnalysis.fill(HIST("hNSigmaPosProtonFromLambdas"), posDaughterTrack.tpcNSigmaPr(), posDaughterTrack.tpcInnerParam()); + rPtAnalysis.fill(HIST("hNSigmaNegPionFromLambdas"), negDaughterTrack.tpcNSigmaPi(), negDaughterTrack.tpcInnerParam()); + rPtAnalysis.fill(HIST("hLambdacosPA"), v0.v0cosPA()); + rPtAnalysis.fill(HIST("hLambdaV0radius"), v0.v0radius()); + rPtAnalysis.fill(HIST("hLambdaDCAV0Daughters"), v0.dcaV0daughters()); + rPtAnalysis.fill(HIST("hLambdaDCAPosDaughter"), v0.dcapostopv()); + rPtAnalysis.fill(HIST("hLambdaDCANegDaughter"), v0.dcanegtopv()); + return true; + } + + // Antilambda selection function + template + bool acceptAntilambda(TV0 const& v0) + { + const auto& posDaughterTrack = v0.template posTrack_as(); // Positive Daughter track + const auto& negDaughterTrack = v0.template negTrack_as(); // Negative Daughter track + + rPtAnalysis.fill(HIST("hNAntilambda"), 0.5); + rPtAnalysis.get(HIST("hNAntilambda"))->GetXaxis()->SetBinLabel(1, "All"); + rPtAnalysis.fill(HIST("hMassAntilambdavsCuts"), 0.5, v0.mAntiLambda()); + if (std::abs(negDaughterTrack.tpcNSigmaPr()) > nSigmaTPCProton && std::abs(posDaughterTrack.tpcNSigmaPi()) > nSigmaTPCPion) { // TPC PID on daughter pion and proton for AntiLambda + return false; + } + rPtAnalysis.fill(HIST("hNAntilambda"), 1.5); + rPtAnalysis.get(HIST("hNAntilambda"))->GetXaxis()->SetBinLabel(2, "TPC_PID"); + rPtAnalysis.fill(HIST("hMassAntilambdavsCuts"), 1.5, v0.mAntiLambda()); + if (std::abs(v0.mK0Short() - o2::constants::physics::MassK0Short) < compv0masscut && doAntilambdacomptmasscut) { // Antilambda competitive v0 mass cut (cut out Kaons) + return false; + } + rPtAnalysis.fill(HIST("hNAntilambda"), 2.5); + rPtAnalysis.get(HIST("hNAntilambda"))->GetXaxis()->SetBinLabel(3, "Compt_Mass"); + rPtAnalysis.fill(HIST("hMassAntilambdavsCuts"), 2.5, v0.mAntiLambda()); + if (v0.v0radius() > antilambdamaxct && doAntilambdaMaxct) { // Antilambda max ct + return false; + } + rPtAnalysis.fill(HIST("hNAntilambda"), 3.5); + rPtAnalysis.get(HIST("hNAntilambda"))->GetXaxis()->SetBinLabel(4, "Max_ct"); + rPtAnalysis.fill(HIST("hMassAntilambdavsCuts"), 3.5, v0.mAntiLambda()); + if (v0.qtarm() < (antilambdaparamArmenterosCut * std::abs(v0.alpha())) && doAntilambdaArmenterosCut) { // Antilambda Armenteros Cut + return false; + } + rPtAnalysis.fill(HIST("hNAntilambda"), 4.5); + rPtAnalysis.get(HIST("hNAntilambda"))->GetXaxis()->SetBinLabel(5, "Armenteros"); + rPtAnalysis.fill(HIST("hMassAntilambdavsCuts"), 4.5, v0.mAntiLambda()); + if (v0.v0cosPA() < antilambdaSettingcosPA && doAntilambdacosPACut) { // Antilambda cosPA Topological Cut + return false; + } + rPtAnalysis.fill(HIST("hNAntilambda"), 5.5); + rPtAnalysis.get(HIST("hNAntilambda"))->GetXaxis()->SetBinLabel(6, "cosPA"); + rPtAnalysis.fill(HIST("hMassAntilambdavsCuts"), 5.5, v0.mAntiLambda()); + if (v0.dcaV0daughters() > antilambdaSettingdcav0dau && doAntilambdaDCAdauCut) { // Antilambda DCAdaughters Topological Cut + return false; + } + rPtAnalysis.fill(HIST("hNAntilambda"), 6.5); + rPtAnalysis.get(HIST("hNAntilambda"))->GetXaxis()->SetBinLabel(7, "DCAdau"); + rPtAnalysis.fill(HIST("hMassAntilambdavsCuts"), 6.5, v0.mAntiLambda()); + if (v0.v0radius() < antilambdaSettingradius && doAntilambdav0radiusCut) { // Antilambda v0radius Topological Cut + return false; + } + rPtAnalysis.fill(HIST("hNAntilambda"), 7.5); + rPtAnalysis.get(HIST("hNAntilambda"))->GetXaxis()->SetBinLabel(8, "v0radius"); + rPtAnalysis.fill(HIST("hMassAntilambdavsCuts"), 7.5, v0.mAntiLambda()); + if (std::abs(v0.dcapostopv()) < antilambdaSettingdcapostopv && doAntilambdadcaposdautopv) { // Antilambda DCAPosDaughterToPV Topological Cut + return false; + } + rPtAnalysis.fill(HIST("hNAntilambda"), 8.5); + rPtAnalysis.get(HIST("hNAntilambda"))->GetXaxis()->SetBinLabel(9, "DCAPosDautoPV"); + rPtAnalysis.fill(HIST("hMassAntilambdavsCuts"), 8.5, v0.mAntiLambda()); + if (std::abs(v0.dcanegtopv()) < antilambdaSettingdcanegtopv && doAntilambdadcanegdautopv) { // Antilambda DCANegDaughterToPV Topological Cut + return false; + } + rPtAnalysis.fill(HIST("hNAntilambda"), 9.5); + rPtAnalysis.get(HIST("hNAntilambda"))->GetXaxis()->SetBinLabel(10, "DCANegDautoPV"); + rPtAnalysis.fill(HIST("hMassAntilambdavsCuts"), 9.5, v0.mAntiLambda()); + + // Cut plots + rPtAnalysis.fill(HIST("hArmenterosPodolanskiPlotAntilambda"), v0.alpha(), v0.qtarm()); + rPtAnalysis.fill(HIST("hNSigmaPosPionFromAntilambdas"), posDaughterTrack.tpcNSigmaPr(), posDaughterTrack.tpcInnerParam()); + rPtAnalysis.fill(HIST("hNSigmaNegProtonFromAntilambdas"), negDaughterTrack.tpcNSigmaPi(), negDaughterTrack.tpcInnerParam()); + rPtAnalysis.fill(HIST("hAntilambdacosPA"), v0.v0cosPA()); + rPtAnalysis.fill(HIST("hAntilambdaV0radius"), v0.v0radius()); + rPtAnalysis.fill(HIST("hAntilambdaDCAV0Daughters"), v0.dcaV0daughters()); + rPtAnalysis.fill(HIST("hAntilambdaDCAPosDaughter"), v0.dcapostopv()); + rPtAnalysis.fill(HIST("hAntilambdaDCANegDaughter"), v0.dcanegtopv()); return true; } @@ -336,36 +663,61 @@ struct V0PtInvMassPlots { // Event Efficiency, Event Split and V0 Signal Loss Corrections rMCCorrections.fill(HIST("hNEvents_Corrections"), 0.5); // Event Efficiency Denominator - // Signal Loss Denominator Loop + // Particles (of interest) Generated Pt Spectrum and Signal Loss Denominator Loop for (const auto& mcParticle : mcParticles) { - if (!mcParticle.isPhysicalPrimary()) { - continue; - } - if (std::abs(mcParticle.y()) > rapidityCut) { - continue; - } - if (mcParticle.pdgCode() == kK0Short) // kzero matched - { - rMCCorrections.fill(HIST("hK0ShBeforeEventSelectionPtSpectrum"), mcParticle.pt()); - } - if (mcParticle.pdgCode() == kLambda0) // lambda matched - { - rMCCorrections.fill(HIST("hLambdaBeforeEventSelectionPtSpectrum"), mcParticle.pt()); - } - if (mcParticle.pdgCode() == kLambda0Bar) // antilambda matched - { - rMCCorrections.fill(HIST("hAntilambdaBeforeEventSelectionPtSpectrum"), mcParticle.pt()); + if (std::abs(mcParticle.y()) < rapidityCut) { + if (mcParticle.isPhysicalPrimary()) { + rMCCorrections.fill(HIST("GenParticleRapidity"), mcParticle.y()); + if (mcParticle.pdgCode() == kK0Short) // kzero matched + { + rMCCorrections.fill(HIST("hK0ShGeneratedPtSpectrum"), mcParticle.pt()); + } + if (mcParticle.pdgCode() == kLambda0) // lambda matched + { + rMCCorrections.fill(HIST("hLambdaGeneratedPtSpectrum"), mcParticle.pt()); + } + if (mcParticle.pdgCode() == kLambda0Bar) // antilambda matched + { + rMCCorrections.fill(HIST("hAntilambdaGeneratedPtSpectrum"), mcParticle.pt()); + } + if (mcParticle.pdgCode() == kXiMinus) // Xi Minus matched + { + rMCCorrections.fill(HIST("hXiMinusGeneratedPtSpectrum"), mcParticle.pt()); + } + if (mcParticle.pdgCode() == kXi0) // Xi Zero matched + { + rMCCorrections.fill(HIST("hXiZeroGeneratedPtSpectrum"), mcParticle.pt()); + } + if (mcParticle.pdgCode() == kOmegaMinus) // Omega matched + { + rMCCorrections.fill(HIST("hOmegaGeneratedPtSpectrum"), mcParticle.pt()); + } + if (mcParticle.pdgCode() == kXiPlusBar) // Xi Plus matched + { + rMCCorrections.fill(HIST("hXiPlusGeneratedPtSpectrum"), mcParticle.pt()); + } + if (mcParticle.pdgCode() == -kXi0) // Anti-Xi Zero matched + { + rMCCorrections.fill(HIST("hAntiXiZeroGeneratedPtSpectrum"), mcParticle.pt()); + } + if (mcParticle.pdgCode() == kOmegaPlusBar) // Anti-Omega matched + { + rMCCorrections.fill(HIST("hAntiOmegaGeneratedPtSpectrum"), mcParticle.pt()); + } + if (mcParticle.pdgCode() == kPhi) // Phi + { + rMCCorrections.fill(HIST("hPhiGeneratedPtSpectrum"), mcParticle.pt()); + } + } } } - // End of Signal Loss Denominator Loop - + // Signal Loss Numenator Loop for (const auto& collision : collisions) { rMCCorrections.fill(HIST("hNEvents_Corrections"), 1.5); // Number of Events Reconsctructed if (!acceptEvent(collision)) { // Event Selection return; } rMCCorrections.fill(HIST("hNEvents_Corrections"), 2.5); // Event Split Denomimator and Event Efficiency Numenator - // Signal Loss Numenator Loop for (const auto& mcParticle : mcParticles) { if (!mcParticle.isPhysicalPrimary()) { continue; @@ -386,57 +738,8 @@ struct V0PtInvMassPlots { rMCCorrections.fill(HIST("hAntilambdaAfterEventSelectionPtSpectrum"), mcParticle.pt()); } } - // End of Signal Loss Numenator Loop - - // Particles (of interest) Generated Pt Spectrum - for (const auto& mcParticle : mcParticles) { - if (std::abs(mcParticle.y()) < rapidityCut) { - if (mcParticle.isPhysicalPrimary()) { - rMCCorrections.fill(HIST("GenParticleRapidity"), mcParticle.y()); - if (mcParticle.pdgCode() == kK0Short) // kzero matched - { - rMCCorrections.fill(HIST("hK0ShGeneratedPtSpectrum"), mcParticle.pt()); - } - if (mcParticle.pdgCode() == kLambda0) // lambda matched - { - rMCCorrections.fill(HIST("hLambdaGeneratedPtSpectrum"), mcParticle.pt()); - } - if (mcParticle.pdgCode() == kLambda0Bar) // antilambda matched - { - rMCCorrections.fill(HIST("hAntilambdaGeneratedPtSpectrum"), mcParticle.pt()); - } - if (mcParticle.pdgCode() == kXiMinus) // Xi Minus matched - { - rMCCorrections.fill(HIST("hXiMinusGeneratedPtSpectrum"), mcParticle.pt()); - } - if (mcParticle.pdgCode() == kXi0) // Xi Zero matched - { - rMCCorrections.fill(HIST("hXiZeroGeneratedPtSpectrum"), mcParticle.pt()); - } - if (mcParticle.pdgCode() == kOmegaMinus) // Omega matched - { - rMCCorrections.fill(HIST("hOmegaGeneratedPtSpectrum"), mcParticle.pt()); - } - if (mcParticle.pdgCode() == kXiPlusBar) // Xi Plus matched - { - rMCCorrections.fill(HIST("hXiPlusGeneratedPtSpectrum"), mcParticle.pt()); - } - if (mcParticle.pdgCode() == -kXi0) // Anti-Xi Zero matched - { - rMCCorrections.fill(HIST("hAntiXiZeroGeneratedPtSpectrum"), mcParticle.pt()); - } - if (mcParticle.pdgCode() == kOmegaPlusBar) // Anti-Omega matched - { - rMCCorrections.fill(HIST("hAntiOmegaGeneratedPtSpectrum"), mcParticle.pt()); - } - if (mcParticle.pdgCode() == kPhi) // Phi - { - rMCCorrections.fill(HIST("hPhiGeneratedPtSpectrum"), mcParticle.pt()); - } - } - } - } } + // End of Signal Loss Numenator Loop } // This is the Process for the MC reconstructed Data void recMCProcess(soa::Join::iterator const& collision, @@ -444,10 +747,6 @@ struct V0PtInvMassPlots { DaughterTracks const&, // no need to define a variable for tracks, if we don't access them directly aod::McParticles const& mcParticles) { - // PDG mass values for Competitive V0 Cut old: const auto& mK0shPDG = 0.497611; - double mK0shPDG = o2::constants::physics::MassK0Short; - double mLambdaPDG = o2::constants::physics::MassLambda0; - // tokenise strings into individual values pthistos::kaonPtBins = o2::utils::Str::tokenize(kzeroSettingPtBinsString, ','); pthistos::lambdaPtBins = o2::utils::Str::tokenize(lambdaSettingPtBinsString, ','); @@ -487,164 +786,115 @@ struct V0PtInvMassPlots { // V0 Signal Splitting Numenator End for (const auto& v0 : V0s) { - const auto& posDaughterTrack = v0.posTrack_as(); // Daughter tracks for PID - const auto& negDaughterTrack = v0.negTrack_as(); // Daughter tracks for PID - rPtAnalysis.fill(HIST("hNV0s"), 0.5); - rPtAnalysis.fill(HIST("hVertexZRec"), collision.posZ()); // Checking that the V0 is a true K0s/Lambdas/Antilambdas and then filling the parameter histograms and the invariant mass plots for different cuts (which are taken from namespace) if (v0.has_mcParticle()) { auto v0mcParticle = v0.mcParticle(); - rPtAnalysis.fill(HIST("hNV0s"), 1.5); - if (std::abs(v0mcParticle.y()) < rapidityCut) { - rPtAnalysis.fill(HIST("hNV0s"), 2.5); - rPtAnalysis.fill(HIST("V0Rapidity"), v0.y()); - - // signal splitting demoninator - if (v0mcParticle.isPhysicalPrimary()) { - if (v0mcParticle.pdgCode() == kK0Short) { // kzero matched - rMCCorrections.fill(HIST("hK0ShSplitDenominatorPtSpectrum"), v0mcParticle.pt()); + + // signal splitting demoninator + if (v0mcParticle.isPhysicalPrimary()) { + if (v0mcParticle.pdgCode() == kK0Short) { // kzero matched + rMCCorrections.fill(HIST("hK0ShSplitDenominatorPtSpectrum"), v0mcParticle.pt()); + } + if (v0mcParticle.pdgCode() == kLambda0) { // lambda matched + rMCCorrections.fill(HIST("hLambdaSplitDenominatorPtSpectrum"), v0mcParticle.pt()); + } + if (v0mcParticle.pdgCode() == kLambda0Bar) { // antilambda matched + rMCCorrections.fill(HIST("hAntilambdaSplitDenominatorPtSpectrum"), v0mcParticle.pt()); + } + } + // signal splitting demoninator end + + if (!acceptV0(v0)) { // V0 Selections + continue; + } + rPtAnalysis.fill(HIST("hArmenterosPodolanskiPlot"), v0.alpha(), v0.qtarm()); + // kzero analysis + if (kzeroAnalysis == true) { + if (v0mcParticle.pdgCode() == kK0Short) { // kzero matched + if (!acceptK0sh(v0)) { // K0sh Selection + continue; } - if (v0mcParticle.pdgCode() == kLambda0) { // lambda matched - rMCCorrections.fill(HIST("hLambdaSplitDenominatorPtSpectrum"), v0mcParticle.pt()); + + if (v0mcParticle.isPhysicalPrimary()) { + for (int i = 0; i < nmaxHistograms; i++) { + if (kaonptedgevalues[i] <= v0.pt() && v0.pt() < kaonptedgevalues[i + 1]) { // finding v0s with pt within the range of our bin edges + pthistos::kaonPt[i]->Fill(v0.mK0Short()); // filling the k0s namespace histograms + } + } } - if (v0mcParticle.pdgCode() == kLambda0Bar) { // antilambda matched - rMCCorrections.fill(HIST("hAntilambdaSplitDenominatorPtSpectrum"), v0mcParticle.pt()); + if (!v0mcParticle.isPhysicalPrimary()) { + auto v0mothers = v0mcParticle.mothers_as(); // Get mothers + if (!v0mothers.empty()) { + auto& v0mcParticleMother = v0mothers.front(); // First mother + rFeeddownMatrices.fill(HIST("hK0shFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt()); + if (v0mcParticleMother.pdgCode() == kPhi) { // Phi Mother Matched + rFeeddownMatrices.fill(HIST("hK0shPhiFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt()); + } + } } } - // signal splitting demoninator end - - if (std::abs(v0.posTrack_as().eta()) < etadau && std::abs(v0.negTrack_as().eta()) < etadau) { // daughters pseudorapidityCut cut - rPtAnalysis.fill(HIST("hNV0s"), 3.5); - rPtAnalysis.fill(HIST("hV0EtaDaughters"), v0.negTrack_as().eta()); - rPtAnalysis.fill(HIST("hV0EtaDaughters"), v0.posTrack_as().eta()); - if (v0.negTrack_as().isITSAfterburner() && v0.posTrack_as().isITSAfterburner()) { // ITS After Burner on daughter tracks - rPtAnalysis.fill(HIST("hNV0s"), 4.5); - if (v0.negTrack_as().itsNCls() >= itsMinHits && v0.posTrack_as().itsNCls() >= itsMinHits) { // Minimum hits in the ITS - rPtAnalysis.fill(HIST("hNV0s"), 5.5); - if (kzeroAnalysis == true) { - // kzero analysis - if (std::abs(posDaughterTrack.tpcNSigmaPi()) < nSigmaTPCPion && std::abs(negDaughterTrack.tpcNSigmaPi()) < nSigmaTPCPion) { // PID for two pions - if (v0mcParticle.pdgCode() == kK0Short) { // kzero matched - rPtAnalysis.fill(HIST("hMassK0ShortAll"), v0.mK0Short()); - rPtAnalysis.fill(HIST("hK0ShortPtSpectrumBeforeCuts"), v0.pt()); - if (std::abs(v0.mLambda() - mLambdaPDG) > compv0masscut && std::abs(v0.mAntiLambda() - mLambdaPDG) > compv0masscut) { // Kzero competitive v0 mass cut (cut out Lambdas and Anti-Lambdas) - // Implementing best kzero topological cuts - if (v0.v0radius() < kaonshmaxct) { - if (v0.qtarm() > (paramArmenterosCut * std::abs(v0.alpha()))) { - if (v0.v0cosPA() > kaonshSettingcosPA && v0.dcaV0daughters() < kaonshSettingdcav0dau && v0.v0radius() > kaonshSettingradius && std::abs(v0.dcapostopv()) > kaonshSettingdcapostopv && std::abs(v0.dcanegtopv()) > kaonshSettingdcanegtopv) { - rPtAnalysis.fill(HIST("hMassK0ShortAllAfterCuts"), v0.mK0Short()); - rPtAnalysis.fill(HIST("hK0ShortReconstructedPtSpectrum"), v0.pt()); - rPtAnalysis.fill(HIST("hK0shEtaDaughters"), v0.negTrack_as().eta()); - rPtAnalysis.fill(HIST("hK0shEtaDaughters"), v0.posTrack_as().eta()); - rPtAnalysis.fill(HIST("hK0shNegDaughterPt"), v0.negTrack_as().pt()); // Neg Daughter Pt - rPtAnalysis.fill(HIST("hK0shPosDaughterPt"), v0.posTrack_as().pt()); // Pos Daughter Pt - if (v0mcParticle.isPhysicalPrimary()) { - for (int i = 0; i < nmaxHistograms; i++) { - if (kaonptedgevalues[i] <= v0.pt() && v0.pt() < kaonptedgevalues[i + 1]) { // finding v0s with pt within the range of our bin edges - pthistos::kaonPt[i]->Fill(v0.mK0Short()); // filling the k0s namespace histograms - } - } - } - } - } - } - } - } - } + } + // lambda analysis + if (lambdaAnalysis == true) { + if (v0mcParticle.pdgCode() == kLambda0) { // lambda matched + + if (!acceptLambda(v0)) { // Lambda Selections + continue; + } + + if (v0mcParticle.isPhysicalPrimary()) { + for (int i = 0; i < nmaxHistograms; i++) { + if (lambdaptedgevalues[i] <= v0.pt() && v0.pt() < lambdaptedgevalues[i + 1]) { + pthistos::lambdaPt[i]->Fill(v0.mLambda()); + } + } + } + if (!v0mcParticle.isPhysicalPrimary()) { + auto v0mothers = v0mcParticle.mothers_as(); // Get mothers + if (!v0mothers.empty()) { + auto& v0mcParticleMother = v0mothers.front(); // First mother + rFeeddownMatrices.fill(HIST("hLambdaFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt()); + if (v0mcParticleMother.pdgCode() == kXiMinus) { // Xi Minus Mother Matched + rFeeddownMatrices.fill(HIST("hLambdaXiMinusFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt()); + } + if (v0mcParticleMother.pdgCode() == kXi0) { // Xi Zero Mother Matched + rFeeddownMatrices.fill(HIST("hLambdaXiZeroFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt()); + } + if (v0mcParticleMother.pdgCode() == kOmegaMinus) { // Omega Mother Matched + rFeeddownMatrices.fill(HIST("hLambdaOmegaFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt()); + } + } + } + } + } + // antilambda analysis + if (antiLambdaAnalysis == true) { + if (v0mcParticle.pdgCode() == kLambda0Bar) { // antilambda matched + + if (!acceptAntilambda(v0)) { // Antilambda Selections + continue; + } + + if (v0mcParticle.isPhysicalPrimary()) { + for (int i = 0; i < nmaxHistograms; i++) { + if (antilambdaPtedgevalues[i] <= v0.pt() && v0.pt() < antilambdaPtedgevalues[i + 1]) { + pthistos::antilambdaPt[i]->Fill(v0.mAntiLambda()); } - // lambda analysis - if (lambdaAnalysis == true) { - if (std::abs(posDaughterTrack.tpcNSigmaPr()) < nSigmaTPCProton && std::abs(negDaughterTrack.tpcNSigmaPi()) < nSigmaTPCPion) { // TPC PID on daughter pion and proton for Lambda - if (v0mcParticle.pdgCode() == kLambda0) { // lambda matched - rPtAnalysis.fill(HIST("hMassLambdaAll"), v0.mLambda()); - rPtAnalysis.fill(HIST("hLambdaPtSpectrumBeforeCuts"), v0.pt()); - if (std::abs(v0.mK0Short() - mK0shPDG) > compv0masscut) { // lambda competitive v0 mass cut (cut out Kaons) - // Implementing best lambda cuts - if (v0.v0radius() < lambdamaxct) { - if (v0.v0cosPA() > lambdaSettingcosPA && v0.dcaV0daughters() < lambdaSettingdcav0dau && v0.v0radius() > lambdaSettingradius && std::abs(v0.dcapostopv()) > lambdaSettingdcapostopv && std::abs(v0.dcanegtopv()) > lambdaSettingdcanegtopv) { - rPtAnalysis.fill(HIST("hMassLambdaAllAfterCuts"), v0.mLambda()); - rPtAnalysis.fill(HIST("hLambdaReconstructedPtSpectrum"), v0.pt()); - rPtAnalysis.fill(HIST("hLambdaEtaDaughters"), v0.negTrack_as().eta()); - rPtAnalysis.fill(HIST("hLambdaEtaDaughters"), v0.posTrack_as().eta()); - rPtAnalysis.fill(HIST("hLambdaNegDaughterPt"), v0.negTrack_as().pt()); // Neg Daughter Pt - rPtAnalysis.fill(HIST("hLambdaPosDaughterPt"), v0.posTrack_as().pt()); // Pos Daughter Pt - if (v0mcParticle.isPhysicalPrimary()) { - for (int i = 0; i < nmaxHistograms; i++) { - if (lambdaptedgevalues[i] <= v0.pt() && v0.pt() < lambdaptedgevalues[i + 1]) { - pthistos::lambdaPt[i]->Fill(v0.mLambda()); - } - } - } - if (!v0mcParticle.isPhysicalPrimary()) { - auto v0mothers = v0mcParticle.mothers_as(); // Get mothers - if (!v0mothers.empty()) { - auto& v0mcParticleMother = v0mothers.front(); // First mother - if (v0mcParticleMother.pdgCode() == kXiMinus) // Xi Minus Mother Matched - { - rFeeddownMatrices.fill(HIST("hLambdaXiMinusFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt()); - } - if (v0mcParticleMother.pdgCode() == kXi0) // Xi Zero Mother Matched - { - rFeeddownMatrices.fill(HIST("hLambdaXiZeroFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt()); - } - if (v0mcParticleMother.pdgCode() == kOmegaMinus) // Omega Mother Matched - { - rFeeddownMatrices.fill(HIST("hLambdaOmegaFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt()); - } - } - } - } - } - } - } - } + } + } + if (!v0mcParticle.isPhysicalPrimary()) { + auto v0mothers = v0mcParticle.mothers_as(); // Get mothers + if (!v0mothers.empty()) { + auto& v0mcParticleMother = v0mothers.front(); // First mother + rFeeddownMatrices.fill(HIST("hAntiLambdaFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt()); + if (v0mcParticleMother.pdgCode() == kXiPlusBar) { // Xi Plus Mother Matched + rFeeddownMatrices.fill(HIST("hAntiLambdaXiPlusFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt()); + } + if (v0mcParticleMother.pdgCode() == -kXi0) { // Anti-Xi Zero Mother Matched + rFeeddownMatrices.fill(HIST("hAntiLambdaAntiXiZeroFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt()); } - // antilambda analysis - if (antiLambdaAnalysis == true) { - if (std::abs(negDaughterTrack.tpcNSigmaPr()) < nSigmaTPCProton && std::abs(posDaughterTrack.tpcNSigmaPi()) < nSigmaTPCPion) { // TPC PID on daughter pion and proton for AntiLambda - if (v0mcParticle.pdgCode() == kLambda0Bar) { // antilambda matched - rPtAnalysis.fill(HIST("hMassAntilambdaAll"), v0.mAntiLambda()); - rPtAnalysis.fill(HIST("hantilambdaPtSpectrumBeforeCuts"), v0.pt()); - if (std::abs(v0.mK0Short() - mK0shPDG) > compv0masscut) { // antilambda competitive v0 mass cut (cut out Kaons) - if (v0.v0radius() < antilambdamaxct) { - // Implementing best antilambda cuts - if (v0.v0cosPA() > antilambdaSettingcosPA && v0.dcaV0daughters() < antilambdaSettingdcav0dau && v0.v0radius() > antilambdaSettingradius && std::abs(v0.dcapostopv()) > antilambdaSettingdcapostopv && std::abs(v0.dcanegtopv()) > antilambdaSettingdcanegtopv) { - rPtAnalysis.fill(HIST("hMassAntilambdaAllAfterCuts"), v0.mAntiLambda()); - rPtAnalysis.fill(HIST("hAntilambdaReconstructedPtSpectrum"), v0.pt()); - rPtAnalysis.fill(HIST("hAntiLambdaEtaDaughters"), v0.negTrack_as().eta()); - rPtAnalysis.fill(HIST("hAntiLambdaEtaDaughters"), v0.posTrack_as().eta()); - rPtAnalysis.fill(HIST("hAntiLambdaNegDaughterPt"), v0.negTrack_as().pt()); // Neg Daughter Pt - rPtAnalysis.fill(HIST("hAntiLambdaPosDaughterPt"), v0.posTrack_as().pt()); // Pos Daughter Pt - if (v0mcParticle.isPhysicalPrimary()) { - for (int i = 0; i < nmaxHistograms; i++) { - if (antilambdaPtedgevalues[i] <= v0.pt() && v0.pt() < antilambdaPtedgevalues[i + 1]) { - pthistos::antilambdaPt[i]->Fill(v0.mAntiLambda()); - } - } - } - if (!v0mcParticle.isPhysicalPrimary()) { - auto v0mothers = v0mcParticle.mothers_as(); // Get mothers - if (!v0mothers.empty()) { - auto& v0mcParticleMother = v0mothers.front(); // First mother - if (v0mcParticleMother.pdgCode() == kXiPlusBar) // Xi Plus Mother Matched - { - rFeeddownMatrices.fill(HIST("hAntiLambdaXiPlusFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt()); - } - if (v0mcParticleMother.pdgCode() == -kXi0) // Anti-Xi Zero Mother Matched - { - rFeeddownMatrices.fill(HIST("hAntiLambdaAntiXiZeroFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt()); - } - if (v0mcParticleMother.pdgCode() == kOmegaPlusBar) // Anti-Omega (minus) Mother Matched - { - rFeeddownMatrices.fill(HIST("hAntiLambdaAntiOmegaFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt()); - } - } - } - } - } - } - } - } + if (v0mcParticleMother.pdgCode() == kOmegaPlusBar) { // Anti-Omega (minus) Mother Matched + rFeeddownMatrices.fill(HIST("hAntiLambdaAntiOmegaFeeddownMatrix"), v0mcParticle.pt(), v0mcParticleMother.pt()); } } } @@ -658,9 +908,6 @@ struct V0PtInvMassPlots { aod::V0Datas const& V0s, DaughterTracks const&) { - double mK0shPDG = o2::constants::physics::MassK0Short; - double mLambdaPDG = o2::constants::physics::MassLambda0; - // tokenise strings into individual values pthistos::kaonPtBins = o2::utils::Str::tokenize(kzeroSettingPtBinsString, ','); pthistos::lambdaPtBins = o2::utils::Str::tokenize(lambdaSettingPtBinsString, ','); @@ -679,114 +926,43 @@ struct V0PtInvMassPlots { return; } rPtAnalysis.fill(HIST("hNRecEvents_Data"), 1.0); // Number of Reconstructed Events + for (const auto& v0 : V0s) { - rPtAnalysis.fill(HIST("hNV0s"), 0.5); - const auto& posDaughterTrack = v0.posTrack_as(); // Daughter tracks for PID - const auto& negDaughterTrack = v0.negTrack_as(); // Daughter tracks for PID - rPtAnalysis.fill(HIST("hVertexZRec"), collision.posZ()); - if (std::abs(v0.y()) < rapidityCut) { - rPtAnalysis.fill(HIST("hNV0s"), 1.5); - rPtAnalysis.fill(HIST("V0Rapidity"), v0.y()); - if (std::abs(v0.posTrack_as().eta()) < etadau && std::abs(v0.negTrack_as().eta()) < etadau) { // daughters pseudorapidityCut cut - rPtAnalysis.fill(HIST("hNV0s"), 2.5); - rPtAnalysis.fill(HIST("hV0EtaDaughters"), v0.negTrack_as().eta()); - rPtAnalysis.fill(HIST("hV0EtaDaughters"), v0.posTrack_as().eta()); - if (v0.negTrack_as().isITSAfterburner() && v0.posTrack_as().isITSAfterburner()) { // ITS After Burner on daughter tracks - rPtAnalysis.fill(HIST("hNV0s"), 3.5); - if (v0.negTrack_as().itsNCls() >= itsMinHits && v0.posTrack_as().itsNCls() >= itsMinHits) { // Minimum hits in the ITS - rPtAnalysis.fill(HIST("hNV0s"), 4.5); - // Armenteros-Podolandski Plot Values - double pv0 = std::sqrt((v0.px() * v0.px()) + (v0.py() * v0.py()) + (v0.pz() * v0.pz())); - double pposdauparallelv0 = ((v0.posTrack_as().px() * v0.px()) + (v0.posTrack_as().py() * v0.py()) + (v0.posTrack_as().pz() * v0.pz())) / pv0; - double qValue = std::sqrt(((v0.posTrack_as().px() * v0.posTrack_as().px()) + (v0.posTrack_as().py() * v0.posTrack_as().py()) + (v0.posTrack_as().pz() * v0.posTrack_as().pz())) - (pposdauparallelv0 * pposdauparallelv0)); - double plpos = (v0.posTrack_as().px() * v0.px() / pv0) + (v0.posTrack_as().py() * v0.py() / pv0) + (v0.posTrack_as().pz() * v0.pz() / pv0); - double plneg = (v0.negTrack_as().px() * v0.px() / pv0) + (v0.negTrack_as().py() * v0.py() / pv0) + (v0.negTrack_as().pz() * v0.pz() / pv0); - double aValue = (plpos - plneg) / (plpos + plneg); - rPtAnalysis.fill(HIST("hArmenterosPodolanskiPlot"), aValue, qValue); - // kzero analysis - if (kzeroAnalysis == true) { - // Filling the five Kzero invariant mass plots for different cuts (which are taken from namespace), for full explanation see the first kzero cut filling in the MC process - rPtAnalysis.fill(HIST("hMassK0ShortAll"), v0.mK0Short()); - if (std::abs(v0.mLambda() - mLambdaPDG) > compv0masscut && std::abs(v0.mAntiLambda() - mLambdaPDG) > compv0masscut) { // antilambda competitive v0 mass cut (cut out Lambdas and Anti-Lambdas) - // Implementing best kzero cuts - if (std::abs(posDaughterTrack.tpcNSigmaPi()) < nSigmaTPCPion && std::abs(negDaughterTrack.tpcNSigmaPi()) < nSigmaTPCPion) { // TPC PID on daughter pions - rPtAnalysis.fill(HIST("hNSigmaPosPiFromK0s"), posDaughterTrack.tpcNSigmaPi(), posDaughterTrack.tpcInnerParam()); - rPtAnalysis.fill(HIST("hNSigmaNegPiFromK0s"), negDaughterTrack.tpcNSigmaPi(), negDaughterTrack.tpcInnerParam()); - if (v0.v0radius() < kaonshmaxct) { - if (v0.qtarm() > (paramArmenterosCut * std::abs(v0.alpha()))) { - if (v0.v0cosPA() > kaonshSettingcosPA && v0.dcaV0daughters() < kaonshSettingdcav0dau && v0.v0radius() > kaonshSettingradius && std::abs(v0.dcapostopv()) > kaonshSettingdcapostopv && std::abs(v0.dcanegtopv()) > kaonshSettingdcanegtopv) { - rPtAnalysis.fill(HIST("hMassK0ShortAllAfterCuts"), v0.mK0Short()); - rPtAnalysis.fill(HIST("hK0shEtaDaughters"), v0.negTrack_as().eta()); - rPtAnalysis.fill(HIST("hK0shEtaDaughters"), v0.posTrack_as().eta()); - rPtAnalysis.fill(HIST("hArmenterosPodolanskiPlotK0Short"), aValue, qValue); - rPtAnalysis.fill(HIST("hK0shNegDaughterPt"), v0.negTrack_as().pt()); // Neg Daughter Pt - rPtAnalysis.fill(HIST("hK0shPosDaughterPt"), v0.posTrack_as().pt()); // Pos Daughter Pt - for (int i = 0; i < nmaxHistograms; i++) { - if (kaonptedgevalues[i] <= v0.pt() && v0.pt() < kaonptedgevalues[i + 1]) { - pthistos::kaonPt[i]->Fill(v0.mK0Short()); - } - } - } - } - } - } - } - } - // lambda analysis - if (lambdaAnalysis == true) { - // Filling the five lambda invariant mass plots for different cuts (which are taken from namespace), for full explanation see the first kzero cut filling in the MC process - rPtAnalysis.fill(HIST("hMassLambdaAll"), v0.mLambda()); - if (std::abs(v0.mK0Short() - mK0shPDG) > compv0masscut) { // lambda competitive v0 mass cut (cut out Kaons) - if (std::abs(posDaughterTrack.tpcNSigmaPr()) < nSigmaTPCProton && std::abs(negDaughterTrack.tpcNSigmaPi()) < nSigmaTPCPion) { // TPC PID on daughter pion and proton for Lambda - rPtAnalysis.fill(HIST("hNSigmaPosProtonFromLambda"), posDaughterTrack.tpcNSigmaPr(), posDaughterTrack.tpcInnerParam()); - rPtAnalysis.fill(HIST("hNSigmaNegPionFromLambda"), negDaughterTrack.tpcNSigmaPi(), negDaughterTrack.tpcInnerParam()); - // Implementing best lambda cuts - if (v0.v0radius() < lambdamaxct) { - if (v0.v0cosPA() > lambdaSettingcosPA && v0.dcaV0daughters() < lambdaSettingdcav0dau && v0.v0radius() > lambdaSettingradius && std::abs(v0.dcapostopv()) > lambdaSettingdcapostopv && std::abs(v0.dcanegtopv()) > lambdaSettingdcanegtopv) { - rPtAnalysis.fill(HIST("hMassLambdaAllAfterCuts"), v0.mLambda()); - rPtAnalysis.fill(HIST("hLambdaEtaDaughters"), v0.negTrack_as().eta()); - rPtAnalysis.fill(HIST("hLambdaEtaDaughters"), v0.posTrack_as().eta()); - rPtAnalysis.fill(HIST("hArmenterosPodolanskiPlotLambda"), aValue, qValue); - rPtAnalysis.fill(HIST("hLambdaNegDaughterPt"), v0.negTrack_as().pt()); // Neg Daughter Pt - rPtAnalysis.fill(HIST("hLambdaPosDaughterPt"), v0.posTrack_as().pt()); // Pos Daughter Pt - for (int i = 0; i < nmaxHistograms; i++) { - if (lambdaptedgevalues[i] <= v0.pt() && v0.pt() < lambdaptedgevalues[i + 1]) { - pthistos::lambdaPt[i]->Fill(v0.mLambda()); - } - } - } - } - } - } - } - // anti-lambda analysis - if (antiLambdaAnalysis == true) { - // Filling the five Antilambda invariant mass plots for different cuts (which are taken from namespace), for full explanation see the first kzero cut filling in the MC process - rPtAnalysis.fill(HIST("hMassAntilambdaAll"), v0.mAntiLambda()); - if (std::abs(v0.mK0Short() - mK0shPDG) > compv0masscut) { // antilambda competitive v0 mass cut (cut out Kaons) - if (std::abs(negDaughterTrack.tpcNSigmaPr()) < nSigmaTPCProton && std::abs(posDaughterTrack.tpcNSigmaPi()) < nSigmaTPCPion) { // TPC PID on daughter pion and proton for AntiLambda - rPtAnalysis.fill(HIST("hNSigmaPosPionFromAntilambda"), posDaughterTrack.tpcNSigmaPi(), posDaughterTrack.tpcInnerParam()); - rPtAnalysis.fill(HIST("hNSigmaNegProtonFromAntilambda"), negDaughterTrack.tpcNSigmaPr(), negDaughterTrack.tpcInnerParam()); - // implementing best antilambda cuts - if (v0.v0radius() < antilambdamaxct) { - if (v0.v0cosPA() > antilambdaSettingcosPA && v0.dcaV0daughters() < antilambdaSettingdcav0dau && v0.v0radius() > antilambdaSettingradius && std::abs(v0.dcapostopv()) > antilambdaSettingdcapostopv && std::abs(v0.dcanegtopv()) > antilambdaSettingdcanegtopv) { - rPtAnalysis.fill(HIST("hMassAntilambdaAllAfterCuts"), v0.mAntiLambda()); - rPtAnalysis.fill(HIST("hAntiLambdaEtaDaughters"), v0.negTrack_as().eta()); - rPtAnalysis.fill(HIST("hAntiLambdaEtaDaughters"), v0.posTrack_as().eta()); - rPtAnalysis.fill(HIST("hArmenterosPodolanskiPlotAntiLambda"), aValue, qValue); - rPtAnalysis.fill(HIST("hAntiLambdaNegDaughterPt"), v0.negTrack_as().pt()); // Neg Daughter Pt - rPtAnalysis.fill(HIST("hAntiLambdaPosDaughterPt"), v0.posTrack_as().pt()); // Pos Daughter Pt - for (int i = 0; i < nmaxHistograms; i++) { - if (lambdaptedgevalues[i] <= v0.pt() && v0.pt() < lambdaptedgevalues[i + 1]) { - pthistos::antilambdaPt[i]->Fill(v0.mAntiLambda()); - } - } - } - } - } - } - } - } + // Checking that the V0 is a true K0s/Lambdas/Antilambdas and then filling the parameter histograms and the invariant mass plots for different cuts (which are taken from namespace) + if (!acceptV0(v0)) { // V0 Selection + continue; + } + rPtAnalysis.fill(HIST("hArmenterosPodolanskiPlot"), v0.alpha(), v0.qtarm()); + // kzero analysis + if (kzeroAnalysis == true) { + if (!acceptK0sh(v0)) { // K0sh Selection + continue; + } + for (int i = 0; i < nmaxHistograms; i++) { + if (kaonptedgevalues[i] <= v0.pt() && v0.pt() < kaonptedgevalues[i + 1]) { // finding v0s with pt within the range of our bin edges + pthistos::kaonPt[i]->Fill(v0.mK0Short()); // filling the k0s namespace histograms + } + } + } + // lambda analysis + if (lambdaAnalysis == true) { + if (!acceptLambda(v0)) { // Lambda Selection + continue; + } + for (int i = 0; i < nmaxHistograms; i++) { + if (lambdaptedgevalues[i] <= v0.pt() && v0.pt() < lambdaptedgevalues[i + 1]) { + pthistos::lambdaPt[i]->Fill(v0.mLambda()); + } + } + } + // anti-lambda analysis + if (antiLambdaAnalysis == true) { + if (!acceptAntilambda(v0)) { // Antilambda Selection + continue; + } + for (int i = 0; i < nmaxHistograms; i++) { + if (lambdaptedgevalues[i] <= v0.pt() && v0.pt() < lambdaptedgevalues[i + 1]) { + pthistos::antilambdaPt[i]->Fill(v0.mAntiLambda()); } } } From 7f7d0adf79032f88ab64b9262922443f3e489fee Mon Sep 17 00:00:00 2001 From: nkaratze Date: Mon, 14 Jul 2025 22:51:35 +0200 Subject: [PATCH 2/4] Linter Error Fix --- PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx b/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx index 0f71b6c1705..5c0ff9bb3da 100644 --- a/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx +++ b/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx @@ -134,7 +134,7 @@ struct V0PtInvMassPlots { Configurable kaonshSettingcosPA{"kaonshSettingcosPA", 0.98, "V0 CosPA"}; // double -> N.B. dcos(x)/dx = 0 at x=0 Configurable kaonshSettingradius{"kaonshSettingradius", 0.50, "v0radius"}; Configurable kaonshmaxct{"kaonshmaxct", 20.00, "K0sh maximum ct value"}; - Configurable K0shparamArmenterosCut{"K0shparamArmenterosCut", 0.2, "K0sh Armenteros Cut on parameter"}; + Configurable k0shparamArmenterosCut{"k0shparamArmenterosCut", 0.2, "K0sh Armenteros Cut on parameter"}; // Configurable Lambda Cuts (best cuts determined by v0topologicalcuts task) Configurable lambdaSettingdcav0dau{"lambdaSettingdcav0dau", 0.3, "DCA V0 Daughters"}; From 04dbf0eaf4ed6dcf24ac4936eab6a67a5e914925 Mon Sep 17 00:00:00 2001 From: nkaratze Date: Tue, 15 Jul 2025 10:50:53 +0200 Subject: [PATCH 3/4] Fixed linter correction error --- PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx b/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx index 5c0ff9bb3da..90a39e991d4 100644 --- a/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx +++ b/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx @@ -449,7 +449,7 @@ struct V0PtInvMassPlots { rPtAnalysis.fill(HIST("hNK0sh"), 3.5); rPtAnalysis.get(HIST("hNK0sh"))->GetXaxis()->SetBinLabel(4, "Max_ct"); rPtAnalysis.fill(HIST("hMassK0ShortvsCuts"), 3.5, v0.mK0Short()); - if (v0.qtarm() < (K0shparamArmenterosCut * std::abs(v0.alpha())) && doK0shArmenterosCut) { // K0sh Armenteros Cut + if (v0.qtarm() < (k0shparamArmenterosCut * std::abs(v0.alpha())) && doK0shArmenterosCut) { // K0sh Armenteros Cut return false; } rPtAnalysis.fill(HIST("hNK0sh"), 4.5); From 74c70788f0569bb8d87b0f4ca7a46f57a00cde0b Mon Sep 17 00:00:00 2001 From: nkaratze Date: Tue, 15 Jul 2025 15:10:11 +0200 Subject: [PATCH 4/4] Fixed ITSAfterburner switch --- PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx b/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx index 90a39e991d4..b6a459fab70 100644 --- a/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx +++ b/PWGLF/Tasks/Strangeness/v0ptinvmassplots.cxx @@ -203,7 +203,7 @@ struct V0PtInvMassPlots { for (int i = 0; i < nmaxHistograms + 1; i++) { // Histos won't accept "." character so converting it to "_" std::string kaonptbin = pthistos::kaonPtBins[i]; // getting the value of the bin edge size_t pos = kaonptbin.find("."); // finding the "." character - kaonptbin[pos] = '_'; // changing the "." character of thestring-value to a "_" + kaonptbin[pos] = '_'; // changing the "." character of the string-value to a "_" kaonhistvalue[i] = kaonptbin; // filling bin edges list } // Lambda Histograms Pt Bin Edges (same as K0s above) @@ -404,7 +404,7 @@ struct V0PtInvMassPlots { } rPtAnalysis.fill(HIST("hNV0s"), 2.5); rPtAnalysis.get(HIST("hNV0s"))->GetXaxis()->SetBinLabel(3, "Dau Pseudorapidity"); - if ((posDaughterTrack.isITSAfterburner() || negDaughterTrack.isITSAfterburner()) && doisITSAfterburner) { // ITS After Burner on daughter tracks + if ((posDaughterTrack.isITSAfterburner() || negDaughterTrack.isITSAfterburner()) && !doisITSAfterburner) { // ITS After Burner on daughter tracks return false; } rPtAnalysis.fill(HIST("hNV0s"), 3.5); @@ -765,7 +765,7 @@ struct V0PtInvMassPlots { if (!acceptEvent(collision)) { // Event Selection return; } - rMCCorrections.fill(HIST("hNRecEvents_MC"), 1.0); // Event Split Numenator + rMCCorrections.fill(HIST("hNRecEvents_MC"), 0.5); // Event Split Numenator // v0 Signal Splitting Numenator Start for (const auto& mcParticle : mcParticles) {