From 070150451360914380002f0568bdeba760d67fe7 Mon Sep 17 00:00:00 2001 From: alicja-pp <101565842+alicja-pp@users.noreply.github.com> Date: Mon, 12 Aug 2024 14:11:37 +0200 Subject: [PATCH] Changes in femtoUniverseEfficiencyBase task (#7266) --- .../Tasks/femtoUniverseEfficiencyBase.cxx | 104 +++++++----------- 1 file changed, 42 insertions(+), 62 deletions(-) diff --git a/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx b/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx index dbd4b368ea5..c857a7321ce 100644 --- a/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx +++ b/PWGCF/FemtoUniverse/Tasks/femtoUniverseEfficiencyBase.cxx @@ -15,21 +15,13 @@ /// \author Alicja PÅ‚achta, WUT Warsaw, alicja.plachta@cern.ch #include -#include #include "Framework/AnalysisTask.h" #include "Framework/runDataProcessing.h" #include "Framework/HistogramRegistry.h" -#include "Framework/ASoAHelpers.h" #include "Framework/RunningWorkflowInfo.h" -#include "Framework/StepTHn.h" -#include "Framework/O2DatabasePDGPlugin.h" -#include "TDatabasePDG.h" -#include "PWGCF/FemtoUniverse/DataModel/FemtoDerived.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseParticleHisto.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseEventHisto.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUniverseContainer.h" -#include "PWGCF/FemtoUniverse/Core/FemtoUtils.h" #include "PWGCF/FemtoUniverse/Core/FemtoUniverseTrackSelection.h" using namespace o2; @@ -43,15 +35,22 @@ struct femtoUniverseEfficiencyBase { using FemtoFullParticles = soa::Join; Preslice perCol = aod::femtouniverseparticle::fdCollisionId; + // Collisions + Configurable ConfZVertex{"ConfZVertex", 10.f, "Event sel: Maximum z-Vertex (cm)"}; + + Filter collisionFilter = (nabs(aod::collision::posZ) < ConfZVertex); + using FilteredFDCollisions = soa::Filtered; + using FilteredFDCollision = FilteredFDCollisions::iterator; + /// Particle selection part /// Configurables for both particles Configurable ConfEtaMax{"ConfEtaMax", 0.8f, "Higher limit for |Eta| (the same for both particles)"}; - Configurable ConfMomProton{"ConfMomProton", 0.75, "momentum threshold for proton identification using TOF"}; + Configurable ConfMomProton{"ConfMomProton", 0.75, "Momentum threshold for proton identification using TOF"}; /// Particle 1 Configurable ConfPDGCodePartOne{"ConfPDGCodePartOne", 2212, "Particle 1 - PDG code"}; Configurable ConfParticleTypePartOne{"ConfParticleTypePartOne", aod::femtouniverseparticle::ParticleType::kTrack, "Particle 1 - particle type"}; - Configurable ConfNoPDGPartOne{"ConfNoPDGPartOne", false, "0: selecting part by PDG, 1: no PID selection"}; + Configurable ConfNoPDGPartOne{"ConfNoPDGPartOne", false, "0: selecting part one by PDG, 1: no PID selection"}; Configurable ConfPtLowPart1{"ConfPtLowPart1", 0.2, "Lower limit for Pt for the first particle"}; Configurable ConfPtHighPart1{"ConfPtHighPart1", 2.5, "Higher limit for Pt for the first particle"}; Configurable ConfChargePart1{"ConfChargePart1", 1, "Charge of the first particle"}; @@ -72,6 +71,7 @@ struct femtoUniverseEfficiencyBase { Configurable ConfIsSame{"ConfIsSame", false, "Pairs of the same particle"}; Configurable ConfPDGCodePartTwo{"ConfPDGCodePartTwo", 333, "Particle 2 - PDG code"}; Configurable ConfParticleTypePartTwo{"ConfParticleTypePartTwo", aod::femtouniverseparticle::ParticleType::kTrack, "Particle 2 - particle type"}; + Configurable ConfNoPDGPartTwo{"ConfNoPDGPartTwo", false, "0: selecting part two by PDG, 1: no PID selection"}; Configurable ConfPtLowPart2{"ConfPtLowPart2", 0.2, "Lower limit for Pt for the second particle"}; Configurable ConfPtHighPart2{"ConfPtHighPart2", 2.5, "Higher limit for Pt for the second particle"}; Configurable ConfChargePart2{"ConfChargePart2", 1, "Charge of the second particle"}; @@ -87,20 +87,19 @@ struct femtoUniverseEfficiencyBase { FemtoUniverseParticleHisto trackHistoV0TwoRec; FemtoUniverseParticleHisto trackHistoV0TwoChildPosRec; FemtoUniverseParticleHisto trackHistoV0TwoChildNegRec; + /// Histogramming for Event FemtoUniverseEventHisto eventHisto; - /// The configurables need to be passed to an std::vector - int vPIDPartOne, vPIDPartTwo; - std::vector kNsigma; - - /// particle part - ConfigurableAxis ConfTempFitVarpTBins{"ConfTempFitVarpTBins", {20, 0.5, 4.05}, "pT binning of the pT vs. TempFitVar plot"}; - ConfigurableAxis ConfTempFitVarPDGBins{"ConfTempFitVarPDGBins", {6000, -2300, 2300}, "binning of the TempFitVar in the pT vs. TempFitVar plot"}; + /// Particle part + ConfigurableAxis ConfTempFitVarpTBins{"ConfTempFitVarpTBins", {20, 0.5, 4.05}, "Binning of the pT in the pT vs. TempFitVar plot"}; + ConfigurableAxis ConfTempFitVarPDGBins{"ConfTempFitVarPDGBins", {6000, -2300, 2300}, "Binning of the PDG code in the pT vs. TempFitVar plot"}; + ConfigurableAxis ConfTempFitVarCPABins{"ConfTempFitVarCPABins", {1000, 0.9, 1}, "Binning of the pointing angle cosinus in the pT vs. TempFitVar plot"}; + ConfigurableAxis ConfTempFitVarDCABins{"ConfTempFitVarDCABins", {1000, -5, 5}, "Binning of the PDG code in the pT vs. TempFitVar plot"}; struct : o2::framework::ConfigurableGroup { - Configurable ConfNsigmaCombinedProton{"ConfNsigmaCombinedProton", 3.0, "TPC and TOF Proton Sigma (combined) for momentum > 0.5"}; - Configurable ConfNsigmaTPCProton{"ConfNsigmaTPCProton", 3.0, "TPC Proton Sigma for momentum < 0.5"}; + Configurable ConfNsigmaCombinedProton{"ConfNsigmaCombinedProton", 3.0, "TPC and TOF Proton Sigma (combined) for momentum > ConfMomProton"}; + Configurable ConfNsigmaTPCProton{"ConfNsigmaTPCProton", 3.0, "TPC Proton Sigma for momentum < ConfMomProton"}; Configurable ConfNsigmaCombinedPion{"ConfNsigmaCombinedPion", 3.0, "TPC and TOF Pion Sigma (combined) for momentum > 0.5"}; Configurable ConfNsigmaTPCPion{"ConfNsigmaTPCPion", 3.0, "TPC Pion Sigma for momentum < 0.5"}; } ConfBothTracks; @@ -110,6 +109,7 @@ struct femtoUniverseEfficiencyBase { Configurable ConfV0InvMassUpLimit{"ConfV0InvV0MassUpLimit", 1.13, "Upper limit of the V0 invariant mass"}; FemtoUniverseTrackSelection trackCuts; + /// Histogram output HistogramRegistry qaRegistry{"TrackQA", {}, OutputObjHandlingPolicy::AnalysisObject}; HistogramRegistry registryPDG{"PDGHistos", {}, OutputObjHandlingPolicy::AnalysisObject, false, true}; @@ -120,13 +120,13 @@ struct femtoUniverseEfficiencyBase { eventHisto.init(&qaRegistry); trackHistoPartOneGen.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarPDGBins, 0, ConfPDGCodePartOne, false); - trackHistoPartOneRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarPDGBins, 0, ConfPDGCodePartOne, false); - registryMCOrigin.add("part1/hPt", "PDG;#it{p}_{T} (GeV/c); PDG", {HistType::kTH1F, {{240, 0, 6}}}); + trackHistoPartOneRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarDCABins, 0, ConfPDGCodePartOne, false); + 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}}}); if (ConfParticleTypePartOne == uint8_t(aod::femtouniverseparticle::ParticleType::kV0)) { - trackHistoV0OneRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarPDGBins, 0, ConfPDGCodePartOne, true); - trackHistoV0OneChildPosRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarPDGBins, 0, 0, true, "posChildV0_1"); - trackHistoV0OneChildNegRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarPDGBins, 0, 0, true, "negChildV0_1"); + trackHistoV0OneRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarCPABins, 0, ConfPDGCodePartOne, true); + trackHistoV0OneChildPosRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarDCABins, 0, 0, true, "posChildV0_1"); + trackHistoV0OneChildNegRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarDCABins, 0, 0, true, "negChildV0_1"); registryPDG.add("part1/dpositive/PDGvspT", "PDG;#it{p}_{T} (GeV/c); PDG", {HistType::kTH2F, {{500, 0, 5}, {16001, -8000.5, 8000.5}}}); registryPDG.add("part1/dnegative/PDGvspT", "PDG;#it{p}_{T} (GeV/c); PDG", {HistType::kTH2F, {{500, 0, 5}, {16001, -8000.5, 8000.5}}}); } @@ -134,12 +134,12 @@ struct femtoUniverseEfficiencyBase { registryPDG.add("part2/PDGvspT", "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, ConfTempFitVarPDGBins, 0, ConfPDGCodePartTwo, false); - registryMCOrigin.add("part2/hPt", "PDG;#it{p}_{T} (GeV/c); PDG", {HistType::kTH1F, {{240, 0, 6}}}); + trackHistoPartTwoRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarDCABins, 0, ConfPDGCodePartTwo, false); + 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, ConfTempFitVarPDGBins, 0, ConfPDGCodePartTwo, true); - trackHistoV0TwoChildPosRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarPDGBins, 0, 0, true, "posChildV0_2"); - trackHistoV0TwoChildNegRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarPDGBins, 0, 0, true, "negChildV0_2"); + trackHistoV0TwoRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarCPABins, 0, ConfPDGCodePartTwo, true); + trackHistoV0TwoChildPosRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarDCABins, 0, 0, true, "posChildV0_2"); + trackHistoV0TwoChildNegRec.init(&qaRegistry, ConfTempFitVarpTBins, ConfTempFitVarDCABins, 0, 0, true, "negChildV0_2"); registryPDG.add("part2/dpositive/PDGvspT", "PDG;#it{p}_{T} (GeV/c); PDG", {HistType::kTH2F, {{500, 0, 5}, {16001, -8000.5, 8000.5}}}); registryPDG.add("part2/dnegative/PDGvspT", "PDG;#it{p}_{T} (GeV/c); PDG", {HistType::kTH2F, {{500, 0, 5}, {16001, -8000.5, 8000.5}}}); } @@ -256,15 +256,10 @@ struct femtoUniverseEfficiencyBase { } /// This function processes the same event and takes care of all the histogramming - /// \todo the trivial loops over the tracks should be factored out since they will be common to all combinations of T-T, T-V0, V0-V0, ... /// @tparam PartitionType - /// @tparam PartType /// @tparam isMC: enables Monte Carlo truth specific histograms /// @param grouppartsOneMCGen partition for the first particle passed by the process function /// @param grouppartsTwoGen partition for the second particle passed by the process function - /// @param parts femtoUniverseParticles table (in case of Monte Carlo joined with FemtoUniverseMCLabels) - /// @param magFieldTesla magnetic field of the collision - /// @param multCol multiplicity of the collision template void doMCGen(PartitionType grouppartsOneMCGen, PartitionType grouppartsTwoGen) { @@ -278,7 +273,7 @@ struct femtoUniverseEfficiencyBase { if (!ConfIsSame) { for (auto& part : grouppartsTwoGen) { - if (!ConfNoPDGPartOne && part.pidcut() != ConfPDGCodePartTwo) { + if (!ConfNoPDGPartTwo && part.pidcut() != ConfPDGCodePartTwo) { continue; } trackHistoPartTwoGen.fillQA(part); @@ -287,15 +282,10 @@ struct femtoUniverseEfficiencyBase { } /// This function processes the same event and takes care of all the histogramming - /// \todo the trivial loops over the tracks should be factored out since they will be common to all combinations of T-T, T-V0, V0-V0, ... /// @tparam PartitionType - /// @tparam PartType /// @tparam isMC: enables Monte Carlo truth specific histograms /// @param grouppartsOneMCGen partition for the first particle passed by the process function /// @param grouppartsTwoGen partition for the second particle passed by the process function - /// @param parts femtoUniverseParticles table (in case of Monte Carlo joined with FemtoUniverseMCLabels) - /// @param magFieldTesla magnetic field of the collision - /// @param multCol multiplicity of the collision template void doMCRecTrackTrack(PartitionType grouppartsOneMCGen, PartitionType grouppartsTwoGen) { @@ -335,15 +325,10 @@ struct femtoUniverseEfficiencyBase { } /// This function processes the same event and takes care of all the histogramming - /// \todo the trivial loops over the tracks should be factored out since they will be common to all combinations of T-T, T-V0, V0-V0, ... /// @tparam PartitionType - /// @tparam PartType /// @tparam isMC: enables Monte Carlo truth specific histograms /// @param grouppartsOneMCGen partition for the first particle passed by the process function /// @param grouppartsTwoGen partition for the second particle passed by the process function - /// @param parts femtoUniverseParticles table (in case of Monte Carlo joined with FemtoUniverseMCLabels) - /// @param magFieldTesla magnetic field of the collision - /// @param multCol multiplicity of the collision template void doMCRecTrackPhi(PartitionType grouppartsOneMCGen, PartitionType grouppartsTwoGen) { // part1 is track and part2 is Phi @@ -384,15 +369,12 @@ struct femtoUniverseEfficiencyBase { } /// This function processes the same event and takes care of all the histogramming - /// \todo the trivial loops over the tracks should be factored out since they will be common to all combinations of T-T, T-V0, V0-V0, ... /// @tparam PartitionType - /// @tparam PartType + /// @tparam ParticlesType /// @tparam isMC: enables Monte Carlo truth specific histograms /// @param grouppartsOneMCGen partition for the first particle passed by the process function /// @param grouppartsTwoGen partition for the second particle passed by the process function - /// @param parts femtoUniverseParticles table (in case of Monte Carlo joined with FemtoUniverseMCLabels) - /// @param magFieldTesla magnetic field of the collision - /// @param multCol multiplicity of the collision + /// @param parts all tracks template void doMCRecV0V0(PartitionType grouppartsOneMCGen, PartitionType grouppartsTwoGen, ParticlesType parts) { @@ -467,13 +449,12 @@ struct femtoUniverseEfficiencyBase { } /// This function processes the same event and takes care of all the histogramming - /// \todo the trivial loops over the tracks should be factored out since they will be common to all combinations of T-T, T-V0, V0-V0, ... /// @tparam PartitionType - /// @tparam PartType + /// @tparam ParticlesType /// @tparam isMC: enables Monte Carlo truth specific histograms /// @param grouppartsOneMCGen partition for the first particle passed by the process function /// @param grouppartsTwoGen partition for the second particle passed by the process function - /// @param parts femtoUniverseParticles table (in case of Monte Carlo joined with FemtoUniverseMCLabels) + /// @param parts all tracks template void doMCRecTrackV0(PartitionType grouppartsOneMCGen, PartitionType grouppartsTwoGen, ParticlesType const& parts) { // part1 is track and part2 is V0 @@ -528,10 +509,9 @@ struct femtoUniverseEfficiencyBase { } } - /// process function for to call doMCPlots with Data + /// process function for to call doMCRecTrackTrack with Data /// \param col subscribe to the collision table (Data) - /// \param parts subscribe to the femtoUniverseParticleTable - void processTrackTrack(o2::aod::FDCollision& col, + void processTrackTrack(FilteredFDCollision& col, FemtoFullParticles&, aod::FDMCParticles const&) { fillCollision(col); @@ -546,10 +526,9 @@ struct femtoUniverseEfficiencyBase { } PROCESS_SWITCH(femtoUniverseEfficiencyBase, processTrackTrack, "Enable processing track-track efficiency task", true); - /// process function for to call doMCPlots with Data + /// process function for to call doMCRecTrackPhi with Data /// \param col subscribe to the collision table (Data) - /// \param parts subscribe to the femtoUniverseParticleTable - void processTrackPhi(o2::aod::FDCollision& col, + void processTrackPhi(FilteredFDCollision& col, FemtoFullParticles&, aod::FDMCParticles const&) { fillCollision(col); @@ -564,10 +543,10 @@ struct femtoUniverseEfficiencyBase { } PROCESS_SWITCH(femtoUniverseEfficiencyBase, processTrackPhi, "Enable processing track-phi efficiency task", false); - /// process function for to call doMCPlots with Data + /// process function for to call doMCRecV0V0 with Data /// \param col subscribe to the collision table (Data) /// \param parts subscribe to the femtoUniverseParticleTable - void processV0V0(o2::aod::FDCollision& col, + void processV0V0(FilteredFDCollision& col, FemtoFullParticles& parts, aod::FDMCParticles const&) { fillCollision(col); @@ -583,9 +562,10 @@ struct femtoUniverseEfficiencyBase { } PROCESS_SWITCH(femtoUniverseEfficiencyBase, processV0V0, "Enable processing V0-V0 efficiency task", false); + /// process function for to call doMCRecTrackV0 with Data /// \param col subscribe to the collision table (Data) /// \param parts subscribe to the femtoUniverseParticleTable - void processTrackV0(o2::aod::FDCollision& col, + void processTrackV0(FilteredFDCollision& col, FemtoFullParticles& parts, aod::FDMCParticles const&) { fillCollision(col);