From c9865a5798ec29a9e7ea5ded20d0b02d340d4d8b Mon Sep 17 00:00:00 2001 From: Katarzyna Gwizdziel Date: Thu, 10 Jul 2025 22:23:17 +0200 Subject: [PATCH 1/2] FemtoUniverse: EfficiencyBase task update --- .../Tasks/femtoUniverseEfficiencyBase.cxx | 45 ++++++++++++------- 1 file changed, 28 insertions(+), 17 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx index 5397acf05dc..080d4668c7c 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx @@ -14,15 +14,16 @@ /// \author Zuzanna Chochulska, WUT Warsaw & CTU Prague, zchochul@cern.ch /// \author Alicja Płachta, WUT Warsaw, alicja.plachta@cern.ch -#include +#include "PWGCF/FemtoUniverse/Core/FemtoUniverseEventHisto.h" +#include "PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h" +#include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" + #include "Framework/AnalysisTask.h" -#include "Framework/runDataProcessing.h" #include "Framework/HistogramRegistry.h" +#include "Framework/runDataProcessing.h" #include "Framework/RunningWorkflowInfo.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUniverseEventHisto.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" +#include using namespace o2; using namespace o2::analysis::femto_universe; @@ -36,6 +37,8 @@ struct FemtoUniverseEfficiencyBase { Preslice perCol = aod::femtouniverseparticle::fdCollisionId; Configurable confIsDebug{"confIsDebug", true, "Enable debug histograms"}; + Configurable confIsMCGen{"confIsMCGen", false, "Enable QA histograms for MC Gen"}; + Configurable confIsMCReco{"confIsMCReco", false, "Enable QA histograms for MC Reco"}; // Collisions Configurable confZVertex{"confZVertex", 10.f, "Event sel: Maximum z-Vertex (cm)"}; @@ -156,8 +159,8 @@ struct FemtoUniverseEfficiencyBase { { eventHisto.init(&qaRegistry); - trackHistoPartOneGen.init(&qaRegistry, confTempFitVarpTBins, confTempFitVarPDGBins, 0, confPDGCodePartOne, false); - trackHistoPartOneRec.init(&qaRegistry, confTempFitVarpTBins, confTempFitVarDCABins, 0, confPDGCodePartOne, confIsDebug); + trackHistoPartOneGen.init(&qaRegistry, confTempFitVarpTBins, confTempFitVarPDGBins, confIsMCGen, confPDGCodePartOne, false); + trackHistoPartOneRec.init(&qaRegistry, confTempFitVarpTBins, confTempFitVarDCABins, confIsMCReco, confPDGCodePartOne, confIsDebug); registryMCOrigin.add("part1/hPt", " ;#it{p}_{T} (GeV/c); Entries", {HistType::kTH1F, {{240, 0, 6}}}); registryPDG.add("part1/PDGvspT", "PDG;#it{p}_{T} (GeV/c); PDG", {HistType::kTH2F, {{500, 0, 5}, {16001, -8000.5, 8000.5}}}); registryPDG.add("part1/PDGvspTall", "PDG;#it{p}_{T} (GeV/c); PDG", {HistType::kTH2F, {{500, 0, 5}, {16001, -8000.5, 8000.5}}}); @@ -172,8 +175,8 @@ struct FemtoUniverseEfficiencyBase { registryPDG.add("part2/PDGvspT", "PDG;#it{p}_{T} (GeV/c); PDG", {HistType::kTH2F, {{500, 0, 5}, {16001, -8000.5, 8000.5}}}); registryPDG.add("part2/PDGvspTall", "PDG;#it{p}_{T} (GeV/c); PDG", {HistType::kTH2F, {{500, 0, 5}, {16001, -8000.5, 8000.5}}}); if (!confIsSame) { - trackHistoPartTwoGen.init(&qaRegistry, confTempFitVarpTBins, confTempFitVarPDGBins, 0, confPDGCodePartTwo, false); - trackHistoPartTwoRec.init(&qaRegistry, confTempFitVarpTBins, confTempFitVarDCABins, 0, confPDGCodePartTwo, confIsDebug); + trackHistoPartTwoGen.init(&qaRegistry, confTempFitVarpTBins, confTempFitVarPDGBins, confIsMCGen, confPDGCodePartTwo, false); + trackHistoPartTwoRec.init(&qaRegistry, confTempFitVarpTBins, confTempFitVarDCABins, confIsMCReco, confPDGCodePartTwo, confIsDebug); registryMCOrigin.add("part2/hPt", " ;#it{p}_{T} (GeV/c); Entries", {HistType::kTH1F, {{240, 0, 6}}}); if (confParticleTypePartTwo == uint8_t(aod::femtouniverseparticle::ParticleType::kV0)) { trackHistoV0TwoRec.init(&qaRegistry, confTempFitVarpTBins, confTempFitVarCPABins, 0, confPDGCodePartTwo, confIsDebug); @@ -371,17 +374,17 @@ struct FemtoUniverseEfficiencyBase { } const auto mcParticle = part.fdMCParticle(); + registryPDG.fill(HIST("part1/PDGvspTall"), part.pt(), mcParticle.pdgMCTruth()); + trackHistoPartOneRec.fillQA(part); + if (!(mcParticle.partOriginMCTruth() == aod::femtouniverse_mc_particle::ParticleOriginMCTruth::kPrimary)) { continue; } - registryPDG.fill(HIST("part1/PDGvspTall"), part.pt(), mcParticle.pdgMCTruth()); - if (!(std::abs(mcParticle.pdgMCTruth()) == std::abs(confPDGCodePartOne))) { continue; } - trackHistoPartOneRec.fillQA(part); registryPDG.fill(HIST("part1/PDGvspT"), part.pt(), mcParticle.pdgMCTruth()); registryMCOrigin.fill(HIST("part1/hPt"), mcParticle.pt()); } @@ -397,17 +400,17 @@ struct FemtoUniverseEfficiencyBase { } const auto mcParticle = part.fdMCParticle(); + registryPDG.fill(HIST("part2/PDGvspTall"), part.pt(), mcParticle.pdgMCTruth()); + trackHistoPartTwoRec.fillQA(part); + if (!(mcParticle.partOriginMCTruth() == aod::femtouniverse_mc_particle::ParticleOriginMCTruth::kPrimary)) { continue; } - registryPDG.fill(HIST("part2/PDGvspTall"), part.pt(), mcParticle.pdgMCTruth()); - if (!(std::abs(mcParticle.pdgMCTruth()) == std::abs(confPDGCodePartTwo))) { continue; } - trackHistoPartTwoRec.fillQA(part); registryPDG.fill(HIST("part2/PDGvspT"), part.pt(), mcParticle.pdgMCTruth()); registryMCOrigin.fill(HIST("part2/hPt"), mcParticle.pt()); } @@ -610,12 +613,20 @@ struct FemtoUniverseEfficiencyBase { // MCGen auto thegrouppartsOneMCGen = partsOneMCGen->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); auto thegrouppartsTwoMCGen = partsTwoMCGen->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - doMCGen(thegrouppartsOneMCGen, thegrouppartsTwoMCGen); + if(confIsMCGen) { + doMCGen(thegrouppartsOneMCGen, thegrouppartsTwoMCGen); + } else { + doMCGen(thegrouppartsOneMCGen, thegrouppartsTwoMCGen); + } // MCRec auto thegroupPartsTrackOneRec = partsTrackOneMCReco->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); auto thegroupPartsTrackTwoRec = partsTrackTwoMCReco->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); if (confIsDebug) { - doMCRecTrackTrack(thegroupPartsTrackOneRec, thegroupPartsTrackTwoRec); + if(confIsMCGen) { + doMCRecTrackTrack(thegroupPartsTrackOneRec, thegroupPartsTrackTwoRec); + } else { + doMCRecTrackTrack(thegroupPartsTrackOneRec, thegroupPartsTrackTwoRec); + } } else { doMCRecTrackTrack(thegroupPartsTrackOneRec, thegroupPartsTrackTwoRec); } From 2cb276e5bce72f42eb30272f1f322d874f4c06d8 Mon Sep 17 00:00:00 2001 From: Katarzyna Gwizdziel Date: Thu, 10 Jul 2025 22:34:52 +0200 Subject: [PATCH 2/2] EfficiencyBase - fixing clang --- PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx index 080d4668c7c..cc0ab0077c8 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx @@ -20,8 +20,8 @@ #include "Framework/AnalysisTask.h" #include "Framework/HistogramRegistry.h" -#include "Framework/runDataProcessing.h" #include "Framework/RunningWorkflowInfo.h" +#include "Framework/runDataProcessing.h" #include @@ -613,7 +613,7 @@ struct FemtoUniverseEfficiencyBase { // MCGen auto thegrouppartsOneMCGen = partsOneMCGen->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); auto thegrouppartsTwoMCGen = partsTwoMCGen->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); - if(confIsMCGen) { + if (confIsMCGen) { doMCGen(thegrouppartsOneMCGen, thegrouppartsTwoMCGen); } else { doMCGen(thegrouppartsOneMCGen, thegrouppartsTwoMCGen); @@ -622,7 +622,7 @@ struct FemtoUniverseEfficiencyBase { auto thegroupPartsTrackOneRec = partsTrackOneMCReco->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); auto thegroupPartsTrackTwoRec = partsTrackTwoMCReco->sliceByCached(aod::femtouniverseparticle::fdCollisionId, col.globalIndex(), cache); if (confIsDebug) { - if(confIsMCGen) { + if (confIsMCGen) { doMCRecTrackTrack(thegroupPartsTrackOneRec, thegroupPartsTrackTwoRec); } else { doMCRecTrackTrack(thegroupPartsTrackOneRec, thegroupPartsTrackTwoRec);