From 1ef2f87f2a9d6a4a0a6558aec4a4da03e9eddc0e Mon Sep 17 00:00:00 2001 From: Gyula Bencedi Date: Thu, 26 Mar 2026 16:15:47 +0100 Subject: [PATCH 1/2] Updated signal loss calculation --- .../GlobalEventProperties/flattenictyPikp.cxx | 395 +++++++++--------- 1 file changed, 202 insertions(+), 193 deletions(-) diff --git a/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx b/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx index e7ddece6c1f..9b88f17a5c2 100644 --- a/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx @@ -106,6 +106,8 @@ static constexpr std::string_view CprefixCleanV0 = "Tracks/CleanV0/"; static constexpr std::string_view CprefixV0qa = "Tracks/V0qa/"; static constexpr std::string_view Cstatus[] = {"preSel/", "postSel/"}; static constexpr std::string_view CstatCalib[] = {"preCalib/", "postCalib/"}; +static constexpr std::string_view CdEdxMcRecPrim = "/CdEdxMcRecPrim"; +static constexpr std::string_view CdEdxMcRecPrimF = "Tracks/{}/CdEdxMcRecPrim"; static constexpr std::string_view CpTvsDCAxy = "/hPtVsDCAxy"; static constexpr std::string_view CpTvsDCAxyF = "Tracks/{}/hPtVsDCAxy"; static constexpr std::string_view CpTvsDCAxyAll = "/hPtVsDCAxyAll"; @@ -122,12 +124,6 @@ static constexpr std::string_view CpTgenPrimSgnINEL = "/hPtGenPrimSgnINEL"; static constexpr std::string_view CpTgenPrimSgnINELF = "Tracks/{}/hPtGenPrimSgnINEL"; static constexpr std::string_view CpTrecCollPrimSgn = "/hPtRecCollPrimSgn"; static constexpr std::string_view CpTrecCollPrimSgnF = "Tracks/{}/hPtRecCollPrimSgn"; -static constexpr std::string_view CpTrecCollPrimSgnINEL = "/hPtRecCollPrimSgnINEL"; -static constexpr std::string_view CpTrecCollPrimSgnINELF = "Tracks/{}/hPtRecCollPrimSgnINEL"; -static constexpr std::string_view CpTGenRecCollPrimSgn = "/hPtGenRecCollPrimSgn"; -static constexpr std::string_view CpTGenRecCollPrimSgnF = "Tracks/{}/hPtGenRecCollPrimSgn"; -static constexpr std::string_view CpTGenRecCollPrimSgnINEL = "/hPtGenRecCollPrimSgnINEL"; -static constexpr std::string_view CpTGenRecCollPrimSgnINELF = "Tracks/{}/hPtGenRecCollPrimSgnINEL"; static constexpr std::string_view CpTmcClosurePrim = "/hPtMCclosurePrim"; static constexpr std::string_view CpTmcClosurePrimF = "Tracks/{}/hPtMCclosurePrim"; @@ -209,8 +205,8 @@ std::array, NpartChrg> hPtEffRecWeak{}; std::array, NpartChrg> hPtEffRecMat{}; std::array, NpartChrg> hPtEffRec{}; std::array, NpartChrg> hPtEffGen{}; -std::array, NpartChrg> hPtGenRecEvt{}; -std::array, NpartChrg> hPtGenPrimRecEvt{}; +std::array, NpartChrg> hPtGenRecEvt{}; +std::array, NpartChrg> hPtGenPrimRecEvt{}; std::array, NpartChrg> hPtEffGenPrim{}; std::array, NpartChrg> hPtEffGenWeak{}; std::array, NpartChrg> hPtEffGenMat{}; @@ -239,6 +235,7 @@ struct FlattenictyPikp { Configurable applyCalibDeDx{"applyCalibDeDx", false, "calibration of dedx signal"}; Configurable applyCalibDeDxFromCCDB{"applyCalibDeDxFromCCDB", false, "use CCDB-based calibration of dedx signal"}; Configurable cfgFillTrackQaHist{"cfgFillTrackQaHist", false, "fill track QA histograms"}; + Configurable cfgFillNclVsPhiCutQaHist{"cfgFillNclVsPhiCutQaHist", false, "fill TPC cluster vs geometrical cut QA histograms"}; Configurable cfgFilldEdxCalibHist{"cfgFilldEdxCalibHist", false, "fill dEdx calibration histograms"}; Configurable cfgFilldEdxQaHist{"cfgFilldEdxQaHist", false, "fill dEdx QA histograms"}; Configurable cfgFillDCAxyHist{"cfgFillDCAxyHist", false, "fill nsigma QA histograms"}; @@ -284,7 +281,7 @@ struct FlattenictyPikp { ConfigurableAxis axisPt{"axisPt", {VARIABLE_WIDTH, 0.1, 0.12, 0.14, 0.16, 0.18, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8, 0.85, 0.9, 0.95, 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9, 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9, 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.5, 5.0, 5.5, 6.0, 6.5, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 18.0, 20.0}, "pT binning"}; ConfigurableAxis axisPtV0s{"axisPtV0s", {VARIABLE_WIDTH, 0, 0.15, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.2, 1.4, 1.6, 1.8, 2, 2.5, 3.0, 3.5, 4, 5, 7, 9, 12, 15, 20}, "pT V0s binning"}; ConfigurableAxis axisFlatPerc{"axisFlatPerc", {102, -0.01, 1.01}, "Flattenicity percentiles binning"}; - ConfigurableAxis axisMultPerc{"axisMultPerc", {20, 0, 100}, "Multiplicity percentiles binning"}; + ConfigurableAxis axisMultPerc{"axisMultPerc", {VARIABLE_WIDTH, 0., 5., 10., 20., 30., 40., 50., 60., 70., 80., 90., 100.}, "T0 percentiles binning"}; ConfigurableAxis axisVertexZ{"axisVertexZ", {80, -20., 20.}, "Vertex z binning"}; ConfigurableAxis axisMult{"axisMult", {301, -0.5, 300.5}, "Multiplicity binning"}; ConfigurableAxis axisDCAxy{"axisDCAxy", {200, -5., 5.}, "DCAxy binning"}; @@ -523,6 +520,7 @@ struct FlattenictyPikp { const AxisSpec dEdxAxis{binOpt.axisDedx, "TPC dEdx (a.u.)"}; const AxisSpec vtxzAxis{binOpt.axisVertexZ, "Z_{vtx} (cm)"}; const AxisSpec flatAxis{binOpt.axisFlatPerc, "Flat FV0"}; + const AxisSpec nChAxis{binOpt.axisMult, "Nch, |eta|<0.8"}; const AxisSpec etaAxis{binOpt.axisEta, "#eta"}; const AxisSpec rapidityAxis{binOpt.axisRapidity, "#it{y}"}; const AxisSpec phiAxis{binOpt.axisPhi, "#varphi"}; @@ -598,33 +596,30 @@ struct FlattenictyPikp { flatchrg.add("Events/hVtxZ", "Measured vertex z position", kTH1F, {vtxzAxis}); flatchrg.add("Events/hFlatVsMultEst", "hFlatVsMultEst", kTH2F, {flatAxis, multAxis}); flatchrg.add("Tracks/postSel/hPVsPtEta", "; #it{p} (GeV/#it{c}); #it{p}_{T} (GeV/#it{c}); #eta;", {kTH3F, {pAxis, ptAxis, etaAxis}}); - if (cfgFillTrackQaHist || cfgFilldEdxQaHist || cfgFillDCAxyHist) { - if (cfgFillTrackQaHist) { + if (cfgFillNclVsPhiCutQaHist || cfgFillTrackQaHist || cfgFilldEdxQaHist || cfgFillDCAxyHist) { + if (cfgFillNclVsPhiCutQaHist) { flatchrg.add("Tracks/postSel/hPtPhi", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9)", {kTH2F, {ptAxis, phiAxisMod}}); - flatchrg.add("Tracks/postSel/hPtVsWOcutDCA", "hPtVsWOcutDCA", kTH2F, {ptAxis, dcaXYAxis}); - flatchrg.add("Tracks/postSel/hPt", "", kTH1F, {ptAxis}); - flatchrg.add("Tracks/postSel/hPhi", "", kTH1F, {phiAxis}); - flatchrg.add("Tracks/postSel/hEta", "", kTH1F, {etaAxis}); - flatchrg.add("Tracks/postSel/hDCAXYvsPt", "", kTH2F, {ptAxis, dcaXYAxis}); - flatchrg.add("Tracks/postSel/hDCAZvsPt", "", kTH2F, {ptAxis, dcaZAxis}); - // tpc - if (cfgStoreThnSparse) { - flatchrg.add("Tracks/postSel/hPtPhiNclTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{cluster}", {kTHnSparseF, {ptAxis, phiAxisMod, clTpcAxis}}); - flatchrg.add("Tracks/postSel/hPtPhiNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{PID cluster}", {kTHnSparseF, {ptAxis, phiAxisMod, clTpcAxis}}); - } else { - flatchrg.add("Tracks/postSel/hPtPhiNclTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{cluster}", {kTH3F, {ptAxis, phiAxisMod, clTpcAxis}}); - flatchrg.add("Tracks/postSel/hPtPhiNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{PID cluster}", {kTH3F, {ptAxis, phiAxisMod, clTpcAxis}}); - } + flatchrg.add("Tracks/postSel/hPtPhiNclTPC", "; #{eta}; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{cluster}", {kTHnSparseF, {etaAxis, ptAxis, phiAxisMod, clTpcAxis}}); + flatchrg.add("Tracks/postSel/hPtPhiNclPIDTPC", "; #{eta}; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{PID cluster}", {kTHnSparseF, {etaAxis, ptAxis, phiAxisMod, clTpcAxis}}); flatchrg.add("Tracks/postSel/hPtNclTPC", "; #it{p}_{T} (GeV/#it{c}); N_{cluster}", {kTH2F, {ptAxis, clTpcAxis}}); flatchrg.add("Tracks/postSel/pPtNclTPC", "; #it{p}_{T} (GeV/#it{c}); N_{cluster}", {kTProfile, {ptAxis}}); flatchrg.add("Tracks/postSel/hPtNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); N_{PID cluster}", {kTH2F, {ptAxis, clTpcAxis}}); flatchrg.add("Tracks/postSel/pPtNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); N_{PID cluster}", {kTProfile, {ptAxis}}); + } + if (cfgFillTrackQaHist) { flatchrg.add("Tracks/postSel/hShTpcClvsPt", "", {kTH2F, {ptAxis, shCluserAxis}}); flatchrg.add("Tracks/postSel/hNclTPCFoundvsPt", "", {kTH2F, {ptAxis, clTpcAxis}}); flatchrg.add("Tracks/postSel/hNClTPCPidvsPt", "", {kTH2F, {ptAxis, clTpcAxis}}); flatchrg.add("Tracks/postSel/hNclTPCFoundvsEta", "", {kTH2F, {etaAxis, clTpcAxis}}); flatchrg.add("Tracks/postSel/hNClTPCPidvsEta", "", {kTH2F, {etaAxis, clTpcAxis}}); flatchrg.add("Tracks/postSel/hTPCCluster", "N_{cluster}", kTH1F, {clTpcAxis}); + flatchrg.add("Tracks/postSel/hPtVsWOcutDCA", "hPtVsWOcutDCA", kTH2F, {ptAxis, dcaXYAxis}); + flatchrg.add("Tracks/postSel/hPt", "", kTH1F, {ptAxis}); + flatchrg.add("Tracks/postSel/hPhi", "", kTH1F, {phiAxis}); + flatchrg.add("Tracks/postSel/hEta", "", kTH1F, {etaAxis}); + flatchrg.add("Tracks/postSel/hDCAXYvsPt", "", kTH2F, {ptAxis, dcaXYAxis}); + flatchrg.add("Tracks/postSel/hDCAZvsPt", "", kTH2F, {ptAxis, dcaZAxis}); + // tpc flatchrg.add("Tracks/postSel/hTPCnClsShared", " ; # shared TPC clusters TPC", kTH1F, {{165, -0.5, 164.5}}); flatchrg.add("Tracks/postSel/hTPCcrossedRows", " ; # crossed TPC rows", kTH1F, {{165, -0.5, 164.5}}); flatchrg.add("Tracks/postSel/hTPCcrossedRowsOverFindableCls", " ; crossed rows / findable TPC clusters", kTH1F, {{60, 0.7, 1.3}}); @@ -633,11 +628,7 @@ struct FlattenictyPikp { flatchrg.add("Tracks/postSel/hChi2ITSTrkSegment", "chi2ITS", kTH1F, {{100, -0.5, 99.5}}); // tof flatchrg.add("Tracks/postSel/hTOFPvsBeta", "Beta from TOF; #it{p} (GeV/#it{c}); #beta", {kTH2F, {pAxis, {120, 0.0, 1.2}}}); - if (cfgStoreThnSparse) { - flatchrg.add("Tracks/postSel/hTOFpi", "Primary Pions from TOF; #eta; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, pAxis, dEdxAxis}}); - } else { - flatchrg.add("Tracks/postSel/hTOFpi", "Primary Pions from TOF; #eta; #it{p} (GeV/#it{c}); dEdx", {kTH3F, {etaAxis, pAxis, dEdxAxis}}); - } + flatchrg.add("Tracks/postSel/hTOFpi", "Primary Pions from TOF; #eta; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, pAxis, dEdxAxis}}); } if (cfgFilldEdxQaHist) { if (cfgStoreThnSparse) { @@ -735,15 +726,10 @@ struct FlattenictyPikp { flatchrg.add("Events/hVtxZRec", "MC Rec vertex z position", kTH1F, {vtxzAxis}); flatchrg.add("Events/hVtxZGen", "Generated vertex z position", kTH1F, {vtxzAxis}); - if (cfgFillTrackQaHist) { + if (cfgFillNclVsPhiCutQaHist) { flatchrg.add("Tracks/postSel/hPtPhi", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9)", {kTH2F, {ptAxis, phiAxisMod}}); - if (cfgStoreThnSparse) { - flatchrg.add("Tracks/postSel/hPtPhiNclTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{cluster}", {kTHnSparseF, {ptAxis, phiAxisMod, clTpcAxis}}); - flatchrg.add("Tracks/postSel/hPtPhiNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{PID cluster}", {kTHnSparseF, {ptAxis, phiAxisMod, clTpcAxis}}); - } else { - flatchrg.add("Tracks/postSel/hPtPhiNclTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{cluster}", {kTH3F, {ptAxis, phiAxisMod, clTpcAxis}}); - flatchrg.add("Tracks/postSel/hPtPhiNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{PID cluster}", {kTH3F, {ptAxis, phiAxisMod, clTpcAxis}}); - } + flatchrg.add("Tracks/postSel/hPtPhiNclTPC", "; #eta; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{cluster}", {kTHnSparseF, {etaAxis, ptAxis, phiAxisMod, clTpcAxis}}); + flatchrg.add("Tracks/postSel/hPtPhiNclPIDTPC", "; #eta; #it{p}_{T} (GeV/#it{c}); fmod(#varphi,#pi/9); N_{PID cluster}", {kTHnSparseF, {etaAxis, ptAxis, phiAxisMod, clTpcAxis}}); flatchrg.add("Tracks/postSel/hPtNclTPC", "; #it{p}_{T} (GeV/#it{c}); N_{cluster}", {kTH2F, {ptAxis, clTpcAxis}}); flatchrg.add("Tracks/postSel/pPtNclTPC", "; #it{p}_{T} (GeV/#it{c}); N_{cluster}", {kTProfile, {ptAxis}}); flatchrg.add("Tracks/postSel/hPtNclPIDTPC", "; #it{p}_{T} (GeV/#it{c}); N_{PID cluster}", {kTH2F, {ptAxis, clTpcAxis}}); @@ -753,31 +739,32 @@ struct FlattenictyPikp { for (int i = 0; i < NpartChrg; i++) { const std::string strID = Form("/%s/%s", (i < Npart) ? "pos" : "neg", Pid[i % Npart]); - hPtGenRecEvt[i] = flatchrg.add("Tracks/hPtGenRecEvt" + strID, " ; p_{T} (GeV/c)", kTH1F, {ptAxis}); - hPtGenPrimRecEvt[i] = flatchrg.add("Tracks/hPtGenPrimRecEvt" + strID, " ; p_{T} (GeV/c)", kTH1F, {ptAxis}); - hPtEffGenPrim[i] = flatchrg.add("Tracks/hPtEffGenPrim" + strID, " ; p_{T} (GeV/c)", kTH3F, {multAxis, flatAxis, ptAxis}); - hPtEffGenWeak[i] = flatchrg.add("Tracks/hPtEffGenWeak" + strID, " ; p_{T} (GeV/c)", kTH3F, {multAxis, flatAxis, ptAxis}); - hPtEffGenMat[i] = flatchrg.add("Tracks/hPtEffGenMat" + strID, " ; p_{T} (GeV/c)", kTH3F, {multAxis, flatAxis, ptAxis}); - hPtEffRecPrim[i] = flatchrg.add("Tracks/hPtEffRecPrim" + strID, " ; p_{T} (GeV/c)", kTH3F, {multAxis, flatAxis, ptAxis}); - hPtEffRecWeak[i] = flatchrg.add("Tracks/hPtEffRecWeak" + strID, " ; p_{T} (GeV/c)", kTH3F, {multAxis, flatAxis, ptAxis}); - hPtEffRecMat[i] = flatchrg.add("Tracks/hPtEffRecMat" + strID, " ; p_{T} (GeV/c)", kTH3F, {multAxis, flatAxis, ptAxis}); - hDCAxyBadCollPrim[i] = flatchrg.add("Tracks/hDCAxyBadCollPrim" + strID, " ; p_{T} (GeV/c)", kTH2F, {ptAxis, dcaXYAxis}); - hDCAxyBadCollWeak[i] = flatchrg.add("Tracks/hDCAxyBadCollWeak" + strID, " ; p_{T} (GeV/c)", kTH2F, {ptAxis, dcaXYAxis}); - hDCAxyBadCollMat[i] = flatchrg.add("Tracks/hDCAxyBadCollMat" + strID, " ; p_{T} (GeV/c)", kTH2F, {ptAxis, dcaXYAxis}); - hPtVsDCAxyPrim[i] = flatchrg.add("Tracks/hPtVsDCAxyPrim" + strID, " ; p_{T} (GeV/c)", kTH2F, {ptAxis, dcaXYAxis}); - hPtVsDCAxyWeak[i] = flatchrg.add("Tracks/hPtVsDCAxyWeak" + strID, " ; p_{T} (GeV/c)", kTH2F, {ptAxis, dcaXYAxis}); - hPtVsDCAxyMat[i] = flatchrg.add("Tracks/hPtVsDCAxyMat" + strID, " ; p_{T} (GeV/c)", kTH2F, {ptAxis, dcaXYAxis}); + hPtGenRecEvt[i] = flatchrg.add("Tracks/hPtGenRecEvt" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); + hPtGenPrimRecEvt[i] = flatchrg.add("Tracks/hPtGenPrimRecEvt" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); + hPtEffGenPrim[i] = flatchrg.add("Tracks/hPtEffGenPrim" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); + hPtEffGenWeak[i] = flatchrg.add("Tracks/hPtEffGenWeak" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); + hPtEffGenMat[i] = flatchrg.add("Tracks/hPtEffGenMat" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); + hPtEffRecPrim[i] = flatchrg.add("Tracks/hPtEffRecPrim" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); + hPtEffRecWeak[i] = flatchrg.add("Tracks/hPtEffRecWeak" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); + hPtEffRecMat[i] = flatchrg.add("Tracks/hPtEffRecMat" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH3F, {multAxis, flatAxis, ptAxis}); + hDCAxyBadCollPrim[i] = flatchrg.add("Tracks/hDCAxyBadCollPrim" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH2F, {ptAxis, dcaXYAxis}); + hDCAxyBadCollWeak[i] = flatchrg.add("Tracks/hDCAxyBadCollWeak" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH2F, {ptAxis, dcaXYAxis}); + hDCAxyBadCollMat[i] = flatchrg.add("Tracks/hDCAxyBadCollMat" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH2F, {ptAxis, dcaXYAxis}); + hPtVsDCAxyPrim[i] = flatchrg.add("Tracks/hPtVsDCAxyPrim" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH2F, {ptAxis, dcaXYAxis}); + hPtVsDCAxyWeak[i] = flatchrg.add("Tracks/hPtVsDCAxyWeak" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH2F, {ptAxis, dcaXYAxis}); + hPtVsDCAxyMat[i] = flatchrg.add("Tracks/hPtVsDCAxyMat" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH2F, {ptAxis, dcaXYAxis}); } for (int i = 0; i < Npart; i++) { - flatchrg.add({fmt::format(CpTvsDCAxyAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); - flatchrg.add({fmt::format(CpTvsDCAxyPrimAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); - flatchrg.add({fmt::format(CpTvsDCAxyWeakAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); - flatchrg.add({fmt::format(CpTvsDCAxyMatAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); + flatchrg.add({fmt::format(CpTvsDCAxyAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); + flatchrg.add({fmt::format(CpTvsDCAxyPrimAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); + flatchrg.add({fmt::format(CpTvsDCAxyWeakAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); + flatchrg.add({fmt::format(CpTvsDCAxyMatAllF.data(), CspeciesAll[i]).c_str(), "; mult; flat; #it{p}_{T} (GeV/#it{c}); DCA_{xy} (cm)", {kTHnSparseF, {multAxis, flatAxis, ptAxis, dcaXYAxis}}}); + flatchrg.add({fmt::format(CdEdxMcRecPrimF.data(), CspeciesAll[i]).c_str(), "; #eta; mult; flat; #it{p} (GeV/#it{c}); dEdx", {kTHnSparseF, {etaAxis, multAxis, flatAxis, pAxis, dEdxAxis}}}); } - flatchrg.add({"hPtOutNoEtaCut", " ; p_{T} (GeV/c)", {kTH1F, {ptAxis}}}); - flatchrg.add({"PtOutFakes", " ; p_{T} (GeV/c)", {kTH1F, {ptAxis}}}); + flatchrg.add({"hPtOutNoEtaCut", " ; #it{p}_{T} (GeV/#it{c})", {kTH1F, {ptAxis}}}); + flatchrg.add({"PtOutFakes", " ; #it{p}_{T} (GeV/#it{c})", {kTH1F, {ptAxis}}}); flatchrg.add({"ResponseGen", " ; N_{part}; F_{FV0};", {kTHnSparseF, {multAxis, flatAxis}}}); flatchrg.add("h1flatencityFV0MCGen", "", kTH1F, {{102, -0.01, 1.01, "1-flatencityFV0"}}); @@ -795,7 +782,7 @@ struct FlattenictyPikp { if (doprocessMCclosure) { for (int i = 0; i < Npart; i++) { - flatchrg.add({fmt::format(CpTmcClosurePrimF.data(), CspeciesAll[i]).c_str(), " ; p_{T} (GeV/c)", {kTH3F, {multAxis, flatAxis, ptAxis}}}); + flatchrg.add({fmt::format(CpTmcClosurePrimF.data(), CspeciesAll[i]).c_str(), " ; #it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {multAxis, flatAxis, ptAxis}}}); } } @@ -811,19 +798,20 @@ struct FlattenictyPikp { flatchrg.get(HIST("hEvtMCRec"))->GetXaxis()->SetBinLabel(1, "all"); flatchrg.get(HIST("hEvtMCRec"))->GetXaxis()->SetBinLabel(2, "evt sel"); flatchrg.get(HIST("hEvtMCRec"))->GetXaxis()->SetBinLabel(3, "INELgt0"); - flatchrg.add("hEvtMcGenRecColl", "hEvtMcGenRecColl", {kTH1F, {{2, 0.f, 2.f}}}); - flatchrg.get(HIST("hEvtMcGenRecColl"))->GetXaxis()->SetBinLabel(1, "INEL"); - flatchrg.get(HIST("hEvtMcGenRecColl"))->GetXaxis()->SetBinLabel(2, "INELgt0"); - - flatchrg.add("hFlatGenINELgt0", "hFlatGenINELgt0", {kTH1F, {flatAxis}}); - for (int i = 0; i < NpartChrg; ++i) { - flatchrg.add({fmt::format(CpTgenPrimSgnF.data(), Cspecies[i]).c_str(), " ; p_{T} (GeV/c)", {kTH3F, {multAxis, flatAxis, ptAxis}}}); - flatchrg.add({fmt::format(CpTgenPrimSgnINELF.data(), Cspecies[i]).c_str(), " ; p_{T} (GeV/c)", {kTH3F, {multAxis, flatAxis, ptAxis}}}); - flatchrg.add({fmt::format(CpTrecCollPrimSgnF.data(), Cspecies[i]).c_str(), " ; p_{T} (GeV/c)", {kTH3F, {multAxis, flatAxis, ptAxis}}}); - flatchrg.add({fmt::format(CpTrecCollPrimSgnINELF.data(), Cspecies[i]).c_str(), " ; p_{T} (GeV/c)", {kTH3F, {multAxis, flatAxis, ptAxis}}}); - flatchrg.add({fmt::format(CpTGenRecCollPrimSgnF.data(), Cspecies[i]).c_str(), " ; p_{T} (GeV/c)", {kTH3F, {multAxis, flatAxis, ptAxis}}}); - flatchrg.add({fmt::format(CpTGenRecCollPrimSgnINELF.data(), Cspecies[i]).c_str(), " ; p_{T} (GeV/c)", {kTH3F, {multAxis, flatAxis, ptAxis}}}); + flatchrg.add("hNchVsCent", "Gen Nch vs Cent;;Gen Nch (|#eta|<0.8)", {kTH2F, {multAxis, nChAxis}}); + // Event loss + flatchrg.add("hNchVsFlatGenINELgt0", "Gen Nch w/o Evt sel;;", {kTH2F, {nChAxis, flatAxis}}); + flatchrg.add("hNchVsFlatRecGt0INELgt0", "Gen Nch w/ Nrec > 0 + Evt. sel;;", {kTH2F, {nChAxis, flatAxis}}); + // Event split + flatchrg.add("hCentVsFlatRecINELgt0", "Gen evt w/o Evt sel;;", {kTH2F, {multAxis, flatAxis}}); + flatchrg.add("hCentVsFlatRecGt0INELgt0", "Gen evt w/ Nrec > 0 + Evt. sel;;", {kTH2F, {multAxis, flatAxis}}); + flatchrg.add("hCentVsFlatRecGt0", "Gen evt w/ Nrec > 0 w/o Evt sel;;", {kTH2F, {multAxis, flatAxis}}); + // Signal loss + for (int i = 0; i < Npart; ++i) { + flatchrg.add({fmt::format(CpTgenPrimSgnF.data(), CspeciesAll[i]).c_str(), "Gen evt w/o Evt sel;;#it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {nChAxis, flatAxis, ptAxis}}}); + flatchrg.add({fmt::format(CpTgenPrimSgnINELF.data(), CspeciesAll[i]).c_str(), "Gen evt w INELgt0 sel;;#it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {nChAxis, flatAxis, ptAxis}}}); + flatchrg.add({fmt::format(CpTrecCollPrimSgnF.data(), CspeciesAll[i]).c_str(), " ;;#it{p}_{T} (GeV/#it{c})", {kTHnSparseF, {nChAxis, flatAxis, ptAxis}}}); } } @@ -977,7 +965,9 @@ struct FlattenictyPikp { if (trkSelOpt.cfgApplyNclPID && track.tpcNClsPID() < trkSelOpt.cfgNclPidTPCMin) { continue; } - if (trkSelOpt.cfgRejectTrkAtTPCSector && !phiCut(track, magField, fPhiCutLow, fPhiCutHigh)) { + float phiModn = track.phi(); + phiMod(phiModn, magField, track.sign()); + if (trkSelOpt.cfgRejectTrkAtTPCSector && (track.pt() >= trkSelOpt.cfgPhiCutPtMin && phiModn < fPhiCutHigh->Eval(track.pt()) && phiModn > fPhiCutLow->Eval(track.pt()))) { continue; } if (!isDCAxyWoCut(track)) { @@ -1291,63 +1281,54 @@ struct FlattenictyPikp { return std::abs(charge) >= CminCharge; } - template - bool phiCut(T const& track, float mag, TF1* fphiCutLow, TF1* fphiCutHigh) + template + int countPart(P const& particles) + { + auto nCharged = 0; + for (auto const& particle : particles) { + if (!isChrgParticle(particle.pdgCode())) { + continue; + } + if (!particle.isPhysicalPrimary()) { + continue; + } + if (std::abs(particle.eta()) > trkSelOpt.cfgTrkEtaMax) { + continue; + } + nCharged++; + } + return nCharged; + } + + void phiMod(float& phimodn, const int& mag, const int& charge) { - if (track.pt() < trkSelOpt.cfgPhiCutPtMin) - return true; - // cut to remove tracks at TPC boundaries - double phimodn = track.phi(); if (mag < Cnull) // for negative polarity field phimodn = o2::constants::math::TwoPI - phimodn; - if (track.sign() < Cnull) // for negative charge + if (charge < Cnull) // for negative charge phimodn = o2::constants::math::TwoPI - phimodn; if (phimodn < Cnull) LOGF(warning, "phi < Cnull: %g", phimodn); phimodn += o2::constants::math::PI / 18.0f; // to center gap in the middle phimodn = std::fmod(phimodn, o2::constants::math::PI / 9.0f); + } - if (cfgFillTrackQaHist) { - flatchrg.fill(HIST("Tracks/preSel/hPtPhi"), track.pt(), phimodn); - if (track.hasTPC() && track.hasITS()) { - if (cfgStoreThnSparse) { - flatchrg.fill(HIST("Tracks/preSel/hPtPhiNclTPC"), track.pt(), phimodn, track.tpcNClsFound()); - flatchrg.fill(HIST("Tracks/preSel/hPtPhiNclPIDTPC"), track.pt(), phimodn, track.tpcNClsPID()); - } else { - flatchrg.fill(HIST("Tracks/preSel/hPtPhiNclTPC"), track.pt(), phimodn, track.tpcNClsFound()); - flatchrg.fill(HIST("Tracks/preSel/hPtPhiNclPIDTPC"), track.pt(), phimodn, track.tpcNClsPID()); - flatchrg.fill(HIST("Tracks/preSel/hPtNclTPC"), track.pt(), track.tpcNClsFound()); - flatchrg.fill(HIST("Tracks/preSel/pPtNclTPC"), track.pt(), track.tpcNClsFound()); - flatchrg.fill(HIST("Tracks/preSel/hPtNclPIDTPC"), track.pt(), track.tpcNClsPID()); - flatchrg.fill(HIST("Tracks/preSel/pPtNclPIDTPC"), track.pt(), track.tpcNClsPID()); - } - } - } - if (phimodn < fphiCutHigh->Eval(track.pt()) && phimodn > fphiCutLow->Eval(track.pt())) { - return false; - } - if (cfgFillTrackQaHist) { - flatchrg.fill(HIST("Tracks/postSel/hPtPhi"), track.pt(), phimodn); - if (track.hasTPC() && track.hasITS()) { - if (cfgStoreThnSparse) { - flatchrg.fill(HIST("Tracks/postSel/hPtPhiNclTPC"), track.pt(), phimodn, track.tpcNClsFound()); - flatchrg.fill(HIST("Tracks/postSel/hPtPhiNclPIDTPC"), track.pt(), phimodn, track.tpcNClsPID()); - } else { - flatchrg.fill(HIST("Tracks/postSel/hPtPhiNclTPC"), track.pt(), phimodn, track.tpcNClsFound()); - flatchrg.fill(HIST("Tracks/postSel/hPtPhiNclPIDTPC"), track.pt(), phimodn, track.tpcNClsPID()); - flatchrg.fill(HIST("Tracks/postSel/hPtNclTPC"), track.pt(), track.tpcNClsFound()); - flatchrg.fill(HIST("Tracks/postSel/pPtNclTPC"), track.pt(), track.tpcNClsFound()); - flatchrg.fill(HIST("Tracks/postSel/hPtNclPIDTPC"), track.pt(), track.tpcNClsPID()); - flatchrg.fill(HIST("Tracks/postSel/pPtNclPIDTPC"), track.pt(), track.tpcNClsPID()); - } - } + template + inline void fillNclVsPhiCutQaHist(T const& track, const float phimodn) + { + if (cfgFillNclVsPhiCutQaHist) { + flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtPhi"), track.pt(), phimodn); + flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtPhiNclTPC"), track.eta(), track.pt(), phimodn, track.tpcNClsFound()); + flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtPhiNclPIDTPC"), track.eta(), track.pt(), phimodn, track.tpcNClsPID()); + flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtNclTPC"), track.pt(), track.tpcNClsFound()); + flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("pPtNclTPC"), track.pt(), track.tpcNClsFound()); + flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("hPtNclPIDTPC"), track.pt(), track.tpcNClsPID()); + flatchrg.fill(HIST(Cprefix) + HIST(Cstatus[ft]) + HIST("pPtNclPIDTPC"), track.pt(), track.tpcNClsPID()); } - return true; } template - bool isGoodTrack(T const& track, int const magfield) + bool isGoodTrack(T const& track, const int magfield) { flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelAll); if (std::abs(track.eta()) > trkSelOpt.cfgTrkEtaMax) { @@ -1375,9 +1356,18 @@ struct FlattenictyPikp { return false; } flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelNClsPID); - if (trkSelOpt.cfgRejectTrkAtTPCSector && !phiCut(track, magfield, fPhiCutLow, fPhiCutHigh)) { + + float phimodn = track.phi(); + phiMod(phimodn, magfield, track.sign()); + if (cfgFillNclVsPhiCutQaHist) { + fillNclVsPhiCutQaHist(track, phimodn); + } + if (trkSelOpt.cfgRejectTrkAtTPCSector && (track.pt() >= trkSelOpt.cfgPhiCutPtMin && phimodn < fPhiCutHigh->Eval(track.pt()) && phimodn > fPhiCutLow->Eval(track.pt()))) { return false; } + if (cfgFillNclVsPhiCutQaHist) { + fillNclVsPhiCutQaHist(track, phimodn); + } flatchrg.fill(HIST("Tracks/hTrkSel"), trkSelTPCBndr); return true; } @@ -1485,7 +1475,7 @@ struct FlattenictyPikp { } template - bool isGoodV0Track(T1 const& v0, T2 const& /*track*/, int const magfield) + bool isGoodV0Track(T1 const& v0, T2 const& /*track*/, const int magfield) { const auto& posTrack = v0.template posTrack_as(); const auto& negTrack = v0.template negTrack_as(); @@ -1495,8 +1485,13 @@ struct FlattenictyPikp { return false; } flatchrg.fill(HIST("Tracks/V0qa/hV0Sel"), v0SelRejectSameSign); + + float posTrackPhiModn = posTrack.phi(); + float negTrackPhiModn = negTrack.phi(); + phiMod(posTrackPhiModn, magfield, posTrack.sign()); + phiMod(negTrackPhiModn, magfield, negTrack.sign()); if (v0SelOpt.cfgRejectV0sAtTPCSector) { - if (!(phiCut(posTrack, magfield, fPhiCutLow, fPhiCutHigh) && phiCut(negTrack, magfield, fPhiCutLow, fPhiCutHigh))) { + if ((posTrack.pt() >= trkSelOpt.cfgPhiCutPtMin && posTrackPhiModn < fPhiCutHigh->Eval(posTrack.pt()) && posTrackPhiModn > fPhiCutLow->Eval(posTrack.pt())) && (negTrack.pt() >= trkSelOpt.cfgPhiCutPtMin && negTrackPhiModn < fPhiCutHigh->Eval(negTrack.pt()) && negTrackPhiModn > fPhiCutLow->Eval(negTrack.pt()))) { return false; } } @@ -2020,8 +2015,8 @@ struct FlattenictyPikp { float maxPhi = 0; float dPhi = 0; - double etaMinFV0bins[CmaxRingsFV0] = {0.0}; - double etaMaxFV0bins[CmaxRingsFV0] = {0.0}; + float etaMinFV0bins[CmaxRingsFV0] = {0.0}; + float etaMaxFV0bins[CmaxRingsFV0] = {0.0}; for (int i = 0; i < CmaxRingsFV0; ++i) { etaMaxFV0bins[i] = CmaxEtaFV0 - i * CdEtaFV0; if (i < CmaxRingsFV0 - 1) { @@ -2082,8 +2077,8 @@ struct FlattenictyPikp { constexpr int ChistIdx = id + pidSgn * Npart; auto idx = static_cast(id); const std::string strID = Form("/%s/%s", (pidSgn == CnullInt && id < Npart) ? "pos" : "neg", Pid[idx]); - hPtEffRec[ChistIdx] = flatchrg.add("Tracks/hPtEffRec" + strID, " ; p_{T} (GeV/c)", kTH1F, {ptAxis}); - hPtEffGen[ChistIdx] = flatchrg.add("Tracks/hPtEffGen" + strID, " ; p_{T} (GeV/c)", kTH1F, {ptAxis}); + hPtEffRec[ChistIdx] = flatchrg.add("Tracks/hPtEffRec" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); + hPtEffGen[ChistIdx] = flatchrg.add("Tracks/hPtEffGen" + strID, " ; #it{p}_{T} (GeV/#it{c})", kTH1F, {ptAxis}); } template @@ -2188,6 +2183,15 @@ struct FlattenictyPikp { } } } + + if (!isDCAxyCut(track)) { + return; + } + if (std::fabs(mcParticle.pdgCode()) == PDGs[Cidx]) { + if (mcParticle.isPhysicalPrimary()) { + flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CdEdxMcRecPrim), track.eta(), mult, flat, track.p(), track.tpcSignal()); + } + } } template @@ -2201,9 +2205,9 @@ struct FlattenictyPikp { } if constexpr (recoEvt) { - hPtGenRecEvt[ChistIdx]->Fill(mcParticle.pt()); + hPtGenRecEvt[ChistIdx]->Fill(mult, flat, mcParticle.pt()); if (mcParticle.isPhysicalPrimary()) { - hPtGenPrimRecEvt[ChistIdx]->Fill(mcParticle.pt()); + hPtGenPrimRecEvt[ChistIdx]->Fill(mult, flat, mcParticle.pt()); } return; } @@ -2225,27 +2229,22 @@ struct FlattenictyPikp { aod::FV0As const& /*fv0s*/, aod::McParticles const& particles) { - float flat; - float mult; + float flat = 999.0; if (flatSelOpt.useFlatData) { float flatRec = 999.0; - float multRec = 999.0; for (const auto& collision : collisions) { - multRec = getMult(collision); flatRec = fillFlat(collision); } flat = flatRec; - mult = multRec; flatchrg.fill(HIST("hFlatMCGenRecColl"), flatRec); } else { float flatGen = fillFlatMC(particles); flat = flatGen; flatchrg.fill(HIST("hFlatMCGen"), flatGen); - float multGen = getMultMC(mcCollision); - mult = multGen; } - // Evt loss den + const float nCh08 = countPart(particles); // use generated Nch in ∣eta∣ < 0.8 + flatchrg.fill(HIST("hEvtMcGen"), 0.5); if (std::abs(mcCollision.posZ()) > evtSelOpt.cfgCutVtxZ) { return; @@ -2256,90 +2255,98 @@ struct FlattenictyPikp { if (pwglf::isINELgtNmc(particles, 0, pdg)) { isINELgt0mc = true; flatchrg.fill(HIST("hEvtMcGen"), 2.5); - flatchrg.fill(HIST("hFlatGenINELgt0"), flat); + flatchrg.fill(HIST("hNchVsFlatGenINELgt0"), nCh08, flat); // Evt loss den } - // Sgn loss den for (const auto& particle : particles) { + if (!isChrgParticle(particle.pdgCode())) { + continue; + } if (!particle.isPhysicalPrimary()) { continue; } - if (std::abs(particle.y()) > trkSelOpt.cfgRapMax) { + if (std::abs(particle.eta()) > trkSelOpt.cfgTrkEtaMax) { + continue; + } + if (particle.pt() < trkSelOpt.cfgTrkPtMin) { continue; } - static_for<0, 5>([&](auto i) { + static_for<0, 4>([&](auto i) { constexpr int Cidx = i.value; - if (particle.pdgCode() == PidSgn[Cidx]) { - flatchrg.fill(HIST(Cprefix) + HIST(Cspecies[Cidx]) + HIST(CpTgenPrimSgn), mult, flat, particle.pt()); + if (std::fabs(particle.pdgCode()) == PDGs[Cidx]) { + flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTgenPrimSgn), nCh08, flat, particle.pt()); if (isINELgt0mc) { - flatchrg.fill(HIST(Cprefix) + HIST(Cspecies[Cidx]) + HIST(CpTgenPrimSgnINEL), mult, flat, particle.pt()); + flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTgenPrimSgnINEL), nCh08, flat, particle.pt()); // Sgn loss den } } }); } - int nRecCollINEL = 0; - int nRecCollINELgt0 = 0; - for (const auto& collision : collisions) { - // Evt split num - flatchrg.fill(HIST("hEvtMCRec"), 0.5); - if (!isGoodEvent(collision)) { - continue; + const auto& nRecoColls = collisions.size(); + // Generated evets with >= 1 reco collisions + if (nRecoColls > CnullInt) { + auto maxNcontributors = -1; + auto bestCollIndex = -1; + auto multRecGt1 = -1; + for (auto const& collision : collisions) { + flatchrg.fill(HIST("hEvtMCRec"), 0.5); + if (!isGoodEvent(collision)) { + continue; + } + flatchrg.fill(HIST("hEvtMCRec"), 1.5); + if (collision.isInelGt0() && isINELgt0mc) { + flatchrg.fill(HIST("hEvtMCRec"), 2.5); + } + if (!collision.has_mcCollision()) { + continue; + } + if (maxNcontributors < collision.numContrib()) { + maxNcontributors = collision.numContrib(); + bestCollIndex = collision.globalIndex(); + multRecGt1 = getMultMC(mcCollision); // using McCentFT0Ms + } + flatchrg.fill(HIST("hCentVsFlatRecINELgt0"), multRecGt1, flat); // Evt split den } - flatchrg.fill(HIST("hEvtMCRec"), 1.5); - - nRecCollINEL++; - if (collision.isInelGt0() && isINELgt0mc) { - flatchrg.fill(HIST("hEvtMCRec"), 2.5); - nRecCollINELgt0++; - } - // Sgn split num - for (const auto& particle : particles) { - if (!particle.isPhysicalPrimary()) { + for (const auto& collision : collisions) { + // Select collisions with the largest number of contributors + if (bestCollIndex != collision.globalIndex()) { continue; } - if (std::abs(particle.y()) > trkSelOpt.cfgRapMax) { + if (!collision.has_mcCollision()) { continue; } - static_for<0, 5>([&](auto i) { - constexpr int Cidx = i.value; - if (particle.pdgCode() == PidSgn[Cidx]) { - flatchrg.fill(HIST(Cprefix) + HIST(Cspecies[Cidx]) + HIST(CpTrecCollPrimSgn), mult, flat, particle.pt()); - if (nRecCollINELgt0) { - flatchrg.fill(HIST(Cprefix) + HIST(Cspecies[Cidx]) + HIST(CpTrecCollPrimSgnINEL), mult, flat, particle.pt()); - } - } - }); - } - } + const float multNpvMax = getMultMC(mcCollision); // using McCentFT0Ms - if (nRecCollINEL < 1) { - return; - } - // Evt loss num - flatchrg.fill(HIST("hEvtMcGenRecColl"), 0.5); - if (nRecCollINELgt0 > Cnull) { - flatchrg.fill(HIST("hEvtMcGenRecColl"), 1.5); - } + flatchrg.fill(HIST("hCentVsFlatRecGt0"), multNpvMax, flat); // Evt split num, w/ Nrec > 0 + if (!isGoodEvent(collision)) { + continue; + } + flatchrg.fill(HIST("hCentVsFlatRecGt0INELgt0"), multNpvMax, flat); // Evt split num, w/ Nrec > 0 + Evt. sel + flatchrg.fill(HIST("hNchVsCent"), multNpvMax, nCh08); + flatchrg.fill(HIST("hNchVsFlatRecGt0INELgt0"), nCh08, flat); // Evt loss num, w/ Nrec > 0 + Evt. sel - // Sgn loss num - for (const auto& particle : particles) { - if (!particle.isPhysicalPrimary()) { - continue; - } - if (std::abs(particle.y()) > trkSelOpt.cfgRapMax) { - continue; - } - static_for<0, 5>([&](auto i) { - constexpr int Cidx = i.value; - if (particle.pdgCode() == PidSgn[Cidx]) { - flatchrg.fill(HIST(Cprefix) + HIST(Cspecies[Cidx]) + HIST(CpTGenRecCollPrimSgn), mult, flat, particle.pt()); - if (nRecCollINELgt0) { - flatchrg.fill(HIST(Cprefix) + HIST(Cspecies[Cidx]) + HIST(CpTGenRecCollPrimSgnINEL), mult, flat, particle.pt()); + for (const auto& particle : particles) { + if (!isChrgParticle(particle.pdgCode())) { + continue; + } + if (!particle.isPhysicalPrimary()) { + continue; + } + if (std::abs(particle.eta()) > trkSelOpt.cfgTrkEtaMax) { + continue; } + if (particle.pt() < trkSelOpt.cfgTrkPtMin) { + continue; + } + static_for<0, 4>([&](auto i) { + constexpr int Cidx = i.value; + if (std::fabs(particle.pdgCode()) == PDGs[Cidx]) { + flatchrg.fill(HIST(Cprefix) + HIST(CspeciesAll[Cidx]) + HIST(CpTrecCollPrimSgn), nCh08, flat, particle.pt()); // Sgn loss num + } + }); } - }); + } } } PROCESS_SWITCH(FlattenictyPikp, processSgnLoss, "process to calcuate signal/event lossses", false); @@ -2435,7 +2442,7 @@ struct FlattenictyPikp { flatchrg.fill(HIST("hEvtMcGenColls"), 2); for (const auto& collision : groupedColls) { flatchrg.fill(HIST("hEvtMcGenColls"), 3); - if (!isGoodEvent(collision)) { + if (!isGoodEvent(collision)) { continue; } // Select collisions with the largest number of contributors @@ -2462,7 +2469,9 @@ struct FlattenictyPikp { if (trkSelOpt.cfgApplyNclPID && track.tpcNClsPID() < trkSelOpt.cfgNclPidTPCMin) { continue; } - if (trkSelOpt.cfgRejectTrkAtTPCSector && !phiCut(track, magField, fPhiCutLow, fPhiCutHigh)) { + float phiModn = track.phi(); + phiMod(phiModn, magField, track.sign()); + if (trkSelOpt.cfgRejectTrkAtTPCSector && (track.pt() >= trkSelOpt.cfgPhiCutPtMin && phiModn < fPhiCutHigh->Eval(track.pt()) && phiModn > fPhiCutLow->Eval(track.pt()))) { continue; } if (!isDCAxyWoCut(track)) { From 9d2d72a4b10dcc1bd1321ec936dd8784c090e33f Mon Sep 17 00:00:00 2001 From: Gyula Bencedi Date: Thu, 26 Mar 2026 20:40:09 +0100 Subject: [PATCH 2/2] fix build error --- PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx b/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx index 9b88f17a5c2..d3af036e6d2 100644 --- a/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx +++ b/PWGLF/Tasks/GlobalEventProperties/flattenictyPikp.cxx @@ -94,7 +94,6 @@ static constexpr int PDGs[] = {11, 13, 211, 321, 2212}; static constexpr int PidSgn[NpartChrg] = {11, 13, 211, 321, 2212, -11, -13, -211, -321, -2212}; static constexpr const char* Pid[Npart] = {"el", "mu", "pi", "ka", "pr"}; static constexpr const char* PidChrg[NpartChrg] = {"e^{-}", "#mu^{-}", "#pi^{+}", "K^{+}", "p", "e^{+}", "#mu^{+}", "#pi^{-}", "K^{-}", "#bar{p}"}; -static constexpr std::string_view Cspecies[NpartChrg] = {"Elminus", "Muplus", "PiPlus", "KaPlus", "Pr", "ElPlus", "MuMinus", "PiMinus", "KaMinus", "PrBar"}; static constexpr std::string_view CspeciesAll[Npart] = {"El", "Mu", "Pi", "Ka", "Pr"}; // histogram naming static constexpr std::string_view PidDir[] = {"el/", "pi/", "pr/"};