From 073905f1fcacb5f02e28e16259116536f7560b2b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=B2=20Jacazio?= Date: Tue, 18 Aug 2026 10:04:10 +0200 Subject: [PATCH] Refactor MC condition and histogram registration --- .../Tasks/Nuspex/hadronnucleicorrelation.cxx | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx index 32edfd80aa6..33d9ee0e40d 100644 --- a/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx +++ b/PWGLF/Tasks/Nuspex/hadronnucleicorrelation.cxx @@ -316,7 +316,7 @@ struct HadronNucleiCorrelation { } } - if (isMC) { + if (isMC && doprocessMC) { registry.add("hPrimPrDCAxy", "DCAxy p", {HistType::kTH2D, {{600, -3.f, 3.f, "DCA xy (cm)"}, {100, 0.f, 10.f, "p_{T} GeV/c"}}}); registry.add("hPrimAntiPrDCAxy", "DCAxy #bar{p}", {HistType::kTH2D, {{600, -3.f, 3.f, "DCA xy (cm)"}, {100, 0.f, 10.f, "p_{T} GeV/c"}}}); registry.add("hPrimDeDCAxy", "DCAxy d", {HistType::kTH2D, {{600, -3.f, 3.f, "DCA xy (cm)"}, {100, 0.f, 10.f, "p_{T} GeV/c"}}}); @@ -409,17 +409,17 @@ struct HadronNucleiCorrelation { registry.add("hGen_EtaPhiPt_Proton", "Gen (anti)protons in gen collisions", {HistType::kTH3F, {etaAxis, phiAxis, pTAxis_small}}); registry.add("hGen_EtaPhiPt_Deuteron", "Gen (anti)deuteron in gen collisions", {HistType::kTH3F, {etaAxis, phiAxis, pTAxis_small}}); - registry.add("Generated/hQAProtons", "hQAProtons", {HistType::kTH1D, {{5, 0.f, 5.f}}}); - registry.get(HIST("Generated/hQAProtons"))->GetXaxis()->SetBinLabel(1, "All"); - registry.get(HIST("Generated/hQAProtons"))->GetXaxis()->SetBinLabel(2, "PhysicalPrimary"); - registry.get(HIST("Generated/hQAProtons"))->GetXaxis()->SetBinLabel(3, "|#eta|<0.8"); - registry.get(HIST("Generated/hQAProtons"))->GetXaxis()->SetBinLabel(4, "no daughters"); - registry.get(HIST("Generated/hQAProtons"))->GetXaxis()->SetBinLabel(5, "d daughter"); - - registry.add("Generated/hQADeuterons", "hQADeuterons", {HistType::kTH1D, {{3, 0.f, 3.f}}}); - registry.get(HIST("Generated/hQADeuterons"))->GetXaxis()->SetBinLabel(1, "All"); - registry.get(HIST("Generated/hQADeuterons"))->GetXaxis()->SetBinLabel(2, "PhysicalPrimary"); - registry.get(HIST("Generated/hQADeuterons"))->GetXaxis()->SetBinLabel(3, "|#eta|<0.8"); + auto hp = registry.add("Generated/hQAProtons", "hQAProtons", {HistType::kTH1D, {{5, 0.f, 5.f}}}); + hp->GetXaxis()->SetBinLabel(1, "All"); + hp->GetXaxis()->SetBinLabel(2, "PhysicalPrimary"); + hp->GetXaxis()->SetBinLabel(3, "|#eta|<0.8"); + hp->GetXaxis()->SetBinLabel(4, "no daughters"); + hp->GetXaxis()->SetBinLabel(5, "d daughter"); + + auto hd = registry.add("Generated/hQADeuterons", "hQADeuterons", {HistType::kTH1D, {{3, 0.f, 3.f}}}); + hd->GetXaxis()->SetBinLabel(1, "All"); + hd->GetXaxis()->SetBinLabel(2, "PhysicalPrimary"); + hd->GetXaxis()->SetBinLabel(3, "|#eta|<0.8"); registry.add("Generated/hDeuteronsVsPt", "hDeuteronsVsPt; p_{T} (GeV/c);", {HistType::kTH1D, {{100, 0.f, 10.f}}}); registry.add("Generated/hAntiDeuteronsVsPt", "hAntiDeuteronsVsPt; p_{T} (GeV/c);", {HistType::kTH1D, {{100, 0.f, 10.f}}});