diff --git a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx index 804ca8d5975..bbe97866aed 100644 --- a/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx +++ b/PWGCF/GenericFramework/Tasks/flowGenericFramework.cxx @@ -13,22 +13,14 @@ /// \brief Task to analyse angular and transverse momentum correlations with GFW /// \author Emil Gorm Nielsen, NBI, emil.gorm.nielsen@cern.ch -#include "FlowContainer.h" -#include "FlowPtContainer.h" -#include "GFW.h" -#include "GFWConfig.h" -#include "GFWCumulant.h" -#include "GFWPowerArray.h" -#include "GFWWeights.h" -#include "GFWWeightsList.h" - -#include "PWGLF/DataModel/EPCalibrationTables.h" +#include "PWGCF/GenericFramework/Core/FlowContainer.h" +#include "PWGCF/GenericFramework/Core/FlowPtContainer.h" +#include "PWGCF/GenericFramework/Core/GFW.h" +#include "PWGCF/GenericFramework/Core/GFWConfig.h" +#include "PWGCF/GenericFramework/Core/GFWWeights.h" #include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/CCDB/EventSelectionParams.h" -#include "Common/Core/RecoDecay.h" -#include "Common/Core/TrackSelection.h" -#include "Common/Core/trackUtilities.h" #include "Common/DataModel/Centrality.h" #include "Common/DataModel/EventSelection.h" #include "Common/DataModel/Multiplicity.h" @@ -37,36 +29,59 @@ #include "Common/DataModel/PIDResponseTPC.h" #include "Common/DataModel/TrackSelectionTables.h" -#include "CommonConstants/PhysicsConstants.h" -#include "Framework/ASoAHelpers.h" -#include "Framework/AnalysisDataModel.h" -#include "Framework/AnalysisTask.h" -#include "Framework/HistogramRegistry.h" -#include "Framework/RunningWorkflowInfo.h" -#include "Framework/StepTHn.h" -#include "Framework/runDataProcessing.h" -#include "ReconstructionDataFormats/PID.h" -#include "ReconstructionDataFormats/Track.h" #include +#include +#include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include #include #include #include +#include + +#include + +#include #include +#include +#include #include +#include +#include +#include #include +#include +#include #include +#include #include +#include #include +#include #include #include using namespace o2; using namespace o2::framework; +using namespace o2::analysis::genericframework; #define O2_DEFINE_CONFIGURABLE(NAME, TYPE, DEFAULT, HELP) Configurable NAME{#NAME, DEFAULT, HELP}; @@ -88,10 +103,10 @@ float nchlow = 0; float nchup = 3000; std::vector centbinning(90); int nBootstrap = 10; -genericframework::GFWRegions regions; -genericframework::GFWCorrConfigs configs; -genericframework::GFWCorrConfigs configsV02; -genericframework::GFWCorrConfigs configsV0; +GFWRegions regions; +GFWCorrConfigs configs; +GFWCorrConfigs configsV02; +GFWCorrConfigs configsV0; std::vector> etagapsPtPt; std::vector multGlobalCorrCutPars; std::vector multPVCorrCutPars; @@ -103,10 +118,10 @@ std::vector multGlobalT0ACutPars; template auto projectMatrix(Array2D const& mat, std::array& array1, std::array& array2, std::array& array3) { - for (auto j = 0; j < static_cast(mat.cols); ++j) { - array1[j] = mat(0, j); - array2[j] = mat(1, j); - array3[j] = mat(2, j); + for (auto j = 0; j < static_cast(mat.rows); ++j) { + array1[j] = mat(j, 0); + array2[j] = mat(j, 1); + array3[j] = mat(j, 2); } return; } @@ -122,12 +137,13 @@ auto readMatrix(Array2D const& mat, P& array) return; } -static constexpr float LongArrayFloat[3][20] = {{1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2}, {2.1, 2.2, 2.3, -2.1, -2.2, -2.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2}, {3.1, 3.2, 3.3, -3.1, -3.2, -3.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2}}; -static constexpr int LongArrayInt[3][20] = {{1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1}, {2, 2, 2, -2, -2, -2, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1}, {3, 3, 3, -3, -3, -3, 1, 1, 1, -1, -1, -1, 1, 1, 1, -1, -1, -1, 1, 1}}; +// static constexpr float LongArrayFloat[3][20] = {{1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2}, {2.1, 2.2, 2.3, -2.1, -2.2, -2.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2}, {3.1, 3.2, 3.3, -3.1, -3.2, -3.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2, 1.3, -1.1, -1.2, -1.3, 1.1, 1.2}}; +// static constexpr int LongArrayInt[3][20] = {{1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1}, {2, 2, 2, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1}, {3, 3, 3, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1}}; +static constexpr float LongArrayFloat[20][3] = {{1.1, 2.1, 3.1}, {1.2, 2.2, 3.2}, {1.3, 2.3, 3.3}, {-1.1, -2.1, -3.1}, {-1.2, -2.2, -3.2}, {-1.3, -2.3, -3.3}, {1.1, 1.1, 1.1}, {1.2, 1.2, 1.2}, {1.3, 1.3, 1.3}, {-1.1, -1.1, -1.1}, {-1.2, -1.2, -1.2}, {-1.3, -1.3, -1.3}, {1.1, 1.1, 1.1}, {1.2, 1.2, 1.2}, {1.3, 1.3, 1.3}, {-1.1, -1.1, -1.1}, {-1.2, -1.2, -1.2}, {-1.3, -1.3, -1.3}, {1.1, 1.1, 1.1}, {1.2, 1.2, 1.2}}; +static constexpr int LongArrayInt[20][3] = {{1, 2, 3}, {1, 2, 3}, {1, 2, 3}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {1, 1, 1}, {1, 1, 1}}; static constexpr double LongArrayDouble[4][2] = {{-0.8, -0.5}, {0.5, 0.8}, {-2, -2}, {-2, -2}}; struct FlowGenericFramework { - O2_DEFINE_CONFIGURABLE(cfgUseNewNpt, bool, true, "Use alternative filling for fractions") O2_DEFINE_CONFIGURABLE(cfgNbootstrap, int, 10, "Number of subsamples") O2_DEFINE_CONFIGURABLE(cfgMpar, int, 8, "Highest order of pt-pt correlations") O2_DEFINE_CONFIGURABLE(cfgCentEstimator, int, 0, "0:FT0C; 1:FT0CVariant1; 2:FT0M; 3:FT0A, 4:NTPV, 5:NGlobal, 6:MFT") @@ -196,9 +212,9 @@ struct FlowGenericFramework { O2_DEFINE_CONFIGURABLE(cfgGlobalT0AHighSigma, float, 4, "Number of sigma deviations above expected value in global vs T0A correlation"); } cfgMultCorrCuts; struct : ConfigurableGroup { - Configurable> nSigmas{"nSigmas", {LongArrayFloat[0], 3, 6, {"TPC", "TOF", "ITS"}, {"pos_pi", "pos_ka", "pos_pr", "neg_pi", "neg_ka", "neg_pr"}}, "Labeled array for n-sigma values for TPC, TOF, ITS for pions, kaons, protons (positive and negative)"}; - Configurable> resonanceCuts{"resonanceCuts", {LongArrayFloat[0], 3, 11, {"K0", "Lambda", "Phi"}, {"cos_PAs", "massMin", "massMax", "PosTrackPt", "NegTrackPt", "DCAPosToPVMin", "DCANegToPVMin", "Lifetime", "RadiusMin", "RadiusMax", "Rapidity"}}, "Labeled array (float) for various cuts on resonances"}; - Configurable> resonanceSwitches{"resonanceSwitches", {LongArrayInt[0], 3, 6, {"K0", "Lambda", "Phi"}, {"UseParticle", "UseCosPA", "NMassBins", "DCABetDaug", "UseProperLifetime", "UseV0Radius"}}, "Labeled array (int) for various cuts on resonances"}; + Configurable> nSigmas{"nSigmas", {LongArrayFloat[0], 6, 3, {"pos_pi", "pos_ka", "pos_pr", "neg_pi", "neg_ka", "neg_pr"}, {"TPC", "TOF", "ITS"}}, "Labeled array for n-sigma values for TPC, TOF, ITS for pions, kaons, protons (positive and negative)"}; + Configurable> resonanceCuts{"resonanceCuts", {LongArrayFloat[0], 13, 3, {"cos_PAs", "massMin", "massMax", "PosTrackPt", "NegTrackPt", "DCAPosToPVMin", "DCANegToPVMin", "Lifetime", "RadiusMin", "RadiusMax", "Rapidity", "ArmPodMin", "MassRejection"}, {"K0", "Lambda", "Phi"}}, "Labeled array (float) for various cuts on resonances"}; + Configurable> resonanceSwitches{"resonanceSwitches", {LongArrayInt[0], 8, 3, {"UseParticle", "UseCosPA", "NMassBins", "DCABetDaug", "UseProperLifetime", "UseV0Radius", "UseArmPodCut", "UseCompetingMassRejection"}, {"K0", "Lambda", "Phi"}}, "Labeled array (int) for various cuts on resonances"}; O2_DEFINE_CONFIGURABLE(cfgUseLsPhi, bool, true, "Use LikeSign for Phi v2") O2_DEFINE_CONFIGURABLE(cfgUseOnlyTPC, bool, true, "Use only TPC PID for daughter selection") O2_DEFINE_CONFIGURABLE(cfgFakeKaonCut, float, 0.1f, "Maximum difference in measured momentum and TPC inner ring momentum of particle") @@ -221,12 +237,12 @@ struct FlowGenericFramework { O2_DEFINE_CONFIGURABLE(cfgLambdaSideBand2Max, float, 1.6, "Maximum cut on Lambda side band 2"); } cfgPIDCuts; - Configurable cfgGFWBinning{"cfgGFWBinning", {40, 16, 72, 300, 0, 3000, 0.2, 10.0, 0.2, 3.0, {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.25, 1.5, 1.75, 2, 2.25, 2.5, 2.75, 3, 3.25, 3.5, 3.75, 4, 4.5, 5, 5.5, 6, 7, 8, 9, 10}, {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90}}, "Configuration for binning"}; - Configurable cfgRegions{"cfgRegions", {{"refN", "refP", "refFull"}, {-0.8, 0.4, -0.8}, {-0.4, 0.8, 0.8}, {0, 0, 0}, {1, 1, 1}}, "Configurations for GFW regions"}; + Configurable cfgGFWBinning{"cfgGFWBinning", {40, 16, 72, 300, 0, 3000, 0.2, 10.0, 0.2, 3.0, {0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.25, 1.5, 1.75, 2, 2.25, 2.5, 2.75, 3, 3.25, 3.5, 3.75, 4, 4.5, 5, 5.5, 6, 7, 8, 9, 10}, {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90}}, "Configuration for binning"}; + Configurable cfgRegions{"cfgRegions", {{"refN", "refP", "refFull"}, {-0.8, 0.4, -0.8}, {-0.4, 0.8, 0.8}, {0, 0, 0}, {1, 1, 1}}, "Configurations for GFW regions"}; - Configurable cfgCorrConfig{"cfgCorrConfig", {{"refP {2} refN {-2}", "refP {3} refN {-3}", "refP {4} refN {-4}", "refFull {2 -2}", "refFull {2 2 -2 -2}"}, {"ChGap22", "ChGap32", "ChGap42", "ChFull22", "ChFull24"}, {0, 0, 0, 0, 0}, {15, 1, 1, 0, 0}}, "Configurations for each correlation to calculate"}; - Configurable cfgCorrConfigV02{"cfgCorrConfigV02", {{"refP {2} refN {-2}", "refP {3} refN {-3}", "refP {4} refN {-4}"}, {"ChGap22", "ChGap32", "ChGap42"}, {1, 1, 1}, {0, 0, 0}}, "Configurations for each radial flow correlation to calculate"}; - Configurable cfgCorrConfigV0{"cfgCorrConfigV0", {{"refP {2} refN {-2}", "refP {3} refN {-3}", "refP {4} refN {-4}"}, {"ChGap22", "ChGap32", "ChGap42"}, {1, 1, 1}, {0, 0, 0}}, "Configurations for each radial flow correlation to calculate"}; + Configurable cfgCorrConfig{"cfgCorrConfig", {{"refP {2} refN {-2}", "refP {3} refN {-3}", "refP {4} refN {-4}", "refFull {2 -2}", "refFull {2 2 -2 -2}"}, {"ChGap22", "ChGap32", "ChGap42", "ChFull22", "ChFull24"}, {0, 0, 0, 0, 0}, {15, 1, 1, 0, 0}}, "Configurations for each correlation to calculate"}; + Configurable cfgCorrConfigV02{"cfgCorrConfigV02", {{"refP {2} refN {-2}", "refP {3} refN {-3}", "refP {4} refN {-4}"}, {"ChGap22", "ChGap32", "ChGap42"}, {1, 1, 1}, {0, 0, 0}}, "Configurations for each radial flow correlation to calculate"}; + Configurable cfgCorrConfigV0{"cfgCorrConfigV0", {{"refP {2} refN {-2}", "refP {3} refN {-3}", "refP {4} refN {-4}"}, {"ChGap22", "ChGap32", "ChGap42"}, {1, 1, 1}, {0, 0, 0}}, "Configurations for each radial flow correlation to calculate"}; ConfigurableAxis axisNsigmaTPC{"axisNsigmaTPC", {80, -5, 5}, "nsigmaTPC axis"}; ConfigurableAxis axisNsigmaTOF{"axisNsigmaTOF", {80, -5, 5}, "nsigmaTOF axis"}; @@ -248,9 +264,10 @@ struct FlowGenericFramework { OutputObj fFCpt{FlowPtContainer("FlowPtContainer")}; OutputObj fFCgen{FlowContainer("FlowContainer_gen")}; HistogramRegistry registry{"registry"}; + HistogramRegistry registryQA{"registryQA"}; - std::array, 3> resoCutVals; - std::array, 3> resoSwitchVals; + std::array, 13> resoCutVals; + std::array, 8> resoSwitchVals; std::array tofNsigmaCut; std::array itsNsigmaCut; std::array tpcNsigmaCut; @@ -353,7 +370,9 @@ struct FlowGenericFramework { kLifeTime, kRadiusMin, kRadiusMax, - kRapidity + kRapidity, + kArmPodMin, + kMassRejection }; enum ParticleSwitches { kUseParticle = 0, @@ -361,7 +380,9 @@ struct FlowGenericFramework { kMassBins, kDCABetDaug, kUseProperLifetime, - kUseV0Radius + kUseV0Radius, + kUseArmPodCut, + kUseCompetingMassRejection }; enum V0Selection { kFillCandidate = 1, @@ -373,6 +394,8 @@ struct FlowGenericFramework { kFillV0Radius, kFillCosPA, kFillProperLifetime, + kFillArmPodCut, + kFillCompetingMass, kFillDaughterTrackSelection }; @@ -533,38 +556,37 @@ struct FlowGenericFramework { fPtAxis = new TAxis(ptbins, &o2::analysis::gfw::ptbinning[0]); if (doprocessMCGen || doprocessOnTheFly) { - registry.add("MCGen/before/pt_gen", "", {HistType::kTH1D, {ptAxis}}); - registry.add("MCGen/before/phi_eta_vtxZ_gen", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); - registry.addClone("MCGen/before/", "MCGen/after/"); + registryQA.add("MCGen/before/pt_gen", "", {HistType::kTH1D, {ptAxis}}); + registryQA.add("MCGen/before/phi_eta_vtxZ_gen", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); + registryQA.addClone("MCGen/before/", "MCGen/after/"); if (doprocessOnTheFly) - registry.add("MCGen/impactParameter", "", {HistType::kTH2D, {{bAxis, nchAxis}}}); + registryQA.add("MCGen/impactParameter", "", {HistType::kTH2D, {{bAxis, nchAxis}}}); } if (doprocessMCReco || doprocessData || doprocessRun2) { - registry.add("trackQA/before/phi_eta_vtxZ", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); - registry.add("trackQA/before/pt_dcaXY_dcaZ", "", {HistType::kTH3D, {ptAxis, dcaXYAXis, dcaZAXis}}); - registry.add("trackQA/before/pt_phi", "", {HistType::kTH2D, {ptAxis, phiModAxis}}); - registry.add("trackQA/before/chi2prTPCcls", "#chi^{2}/cluster for the TPC track segment", {HistType::kTH1D, {{100, 0., 5.}}}); - registry.add("trackQA/before/chi2prITScls", "#chi^{2}/cluster for the ITS track", {HistType::kTH1D, {{100, 0., 50.}}}); - registry.add("trackQA/before/nTPCClusters", "Number of found TPC clusters", {HistType::kTH1D, {{100, 40, 180}}}); - registry.add("trackQA/before/nITSClusters", "Number of found ITS clusters", {HistType::kTH1D, {{100, 0, 20}}}); - registry.add("trackQA/before/nTPCCrossedRows", "Number of crossed TPC Rows", {HistType::kTH1D, {{100, 40, 180}}}); - - registry.addClone("trackQA/before/", "trackQA/after/"); - registry.add("trackQA/after/pt_ref", "; #it{p}_{T}; Counts", {HistType::kTH1D, {{100, o2::analysis::gfw::ptreflow, o2::analysis::gfw::ptrefup}}}); - registry.add("trackQA/after/pt_poi", "; #it{p}_{T}; Counts", {HistType::kTH1D, {{100, o2::analysis::gfw::ptpoilow, o2::analysis::gfw::ptpoiup}}}); - registry.add("trackQA/after/Nch_corrected", "; N_{ch}; Counts", {HistType::kTH1D, {nchAxis}}); - registry.add("trackQA/after/Nch_uncorrected", "; N_{ch}; Counts", {HistType::kTH1D, {nchAxis}}); - registry.add("trackQA/after/etaNch", "; #eta; Counts", {HistType::kTH1D, {etaAxis}}); - registry.add("trackQA/after/etaPtPt", "; #eta; Counts", {HistType::kTH1D, {etaAxis}}); - registry.add("trackQA/after/etaV0Daughters", "; #eta; Counts", {HistType::kTH1D, {etaAxis}}); - - LOGF(info, "Using alternative filling for pt fractions: %d", static_cast(cfgUseNewNpt)); - histosNpt.reserve(SPECIESCOUNT); + registryQA.add("trackQA/before/phi_eta_vtxZ", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); + registryQA.add("trackQA/before/pt_dcaXY_dcaZ", "", {HistType::kTH3D, {ptAxis, dcaXYAXis, dcaZAXis}}); + registryQA.add("trackQA/before/pt_phi", "", {HistType::kTH2D, {ptAxis, phiModAxis}}); + registryQA.add("trackQA/before/chi2prTPCcls", "#chi^{2}/cluster for the TPC track segment", {HistType::kTH1D, {{100, 0., 5.}}}); + registryQA.add("trackQA/before/chi2prITScls", "#chi^{2}/cluster for the ITS track", {HistType::kTH1D, {{100, 0., 50.}}}); + registryQA.add("trackQA/before/nTPCClusters", "Number of found TPC clusters", {HistType::kTH1D, {{100, 40, 180}}}); + registryQA.add("trackQA/before/nITSClusters", "Number of found ITS clusters", {HistType::kTH1D, {{100, 0, 20}}}); + registryQA.add("trackQA/before/nTPCCrossedRows", "Number of crossed TPC Rows", {HistType::kTH1D, {{100, 40, 180}}}); + + registryQA.addClone("trackQA/before/", "trackQA/after/"); + registryQA.add("trackQA/after/pt_ref", "; #it{p}_{T}; Counts", {HistType::kTH1D, {{100, o2::analysis::gfw::ptreflow, o2::analysis::gfw::ptrefup}}}); + registryQA.add("trackQA/after/pt_poi", "; #it{p}_{T}; Counts", {HistType::kTH1D, {{100, o2::analysis::gfw::ptpoilow, o2::analysis::gfw::ptpoiup}}}); + registryQA.add("trackQA/after/Nch_corrected", "; N_{ch}; Counts", {HistType::kTH1D, {nchAxis}}); + registryQA.add("trackQA/after/Nch_uncorrected", "; N_{ch}; Counts", {HistType::kTH1D, {nchAxis}}); + registryQA.add("trackQA/after/etaNch", "; #eta; Counts", {HistType::kTH1D, {etaAxis}}); + registryQA.add("trackQA/after/etaPtPt", "; #eta; Counts", {HistType::kTH1D, {etaAxis}}); + registryQA.add("trackQA/after/etaV0Daughters", "; #eta; Counts", {HistType::kTH1D, {etaAxis}}); + + histosNpt.resize(SPECIESCOUNT); histosNpt[CHARGEDID] = registry.add("nptCh", "; #it{p}_{T} (GeV/#it{c}; Count)", {HistType::kTH1D, {ptAxis}}); histosNpt[PIONID] = registry.add("nptPi", "; #it{p}_{T} (GeV/#it{c}; Count)", {HistType::kTH1D, {ptAxis}}); histosNpt[KAONID] = registry.add("nptKa", "; #it{p}_{T} (GeV/#it{c}; Count)", {HistType::kTH1D, {ptAxis}}); histosNpt[PROTONID] = registry.add("nptPr", "; #it{p}_{T} (GeV/#it{c}; Count)", {HistType::kTH1D, {ptAxis}}); - histosResoNpt.reserve(RESOCOUNT); + histosResoNpt.resize(RESOCOUNT); histosResoNpt[K0SIDEBAND1] = registry.add("nptK0SB1", "; #it{p}_{T} (GeV/#it{c}; Count", {HistType::kTH1D, {ptAxis}}); histosResoNpt[K0SIGNAL] = registry.add("nptK0Sig", "; #it{p}_{T} (GeV/#it{c}; Count", {HistType::kTH1D, {ptAxis}}); histosResoNpt[K0SIDEBAND2] = registry.add("nptK0SB2", "; #it{p}_{T} (GeV/#it{c}; Count", {HistType::kTH1D, {ptAxis}}); @@ -572,33 +594,33 @@ struct FlowGenericFramework { histosResoNpt[LAMBDASIGNAL] = registry.add("nptLambdaSig", "; #it{p}_{T} (GeV/#it{c}; Count", {HistType::kTH1D, {ptAxis}}); histosResoNpt[LAMBDASIDEBAND2] = registry.add("nptLambdaSB2", "; #it{p}_{T} (GeV/#it{c}; Count", {HistType::kTH1D, {ptAxis}}); - registry.add("eventQA/before/centrality", "; centrality (%); Counts", {HistType::kTH1D, {centAxis}}); - registry.add("eventQA/before/multiplicity", "; N_{ch}; Counts", {HistType::kTH1D, {nchAxis}}); - registry.add("eventQA/before/globalTracks_centT0C", "; FT0C centrality (%); N_{global}", {HistType::kTH2D, {centAxis, nchAxis}}); - registry.add("eventQA/before/PVTracks_centT0C", "; FT0C centrality (%); N_{PV}", {HistType::kTH2D, {centAxis, multpvAxis}}); - registry.add("eventQA/before/globalTracks_PVTracks", "; N_{PV}; N_{global}", {HistType::kTH2D, {multpvAxis, nchAxis}}); - registry.add("eventQA/before/globalTracks_multT0A", "; multT0A; N_{global}", {HistType::kTH2D, {t0aAxis, nchAxis}}); - registry.add("eventQA/before/globalTracks_multV0A", "; multV0A; N_{global}", {HistType::kTH2D, {v0aAxis, nchAxis}}); - registry.add("eventQA/before/multV0A_multT0A", "; multV0A; multT0A", {HistType::kTH2D, {t0aAxis, v0aAxis}}); - registry.add("eventQA/before/multT0C_centT0C", "; multT0C; FT0C centrality (%)", {HistType::kTH2D, {centAxis, t0cAxis}}); - registry.add("eventQA/before/occ_mult_cent", "; occupancy; N_{ch}; centrality (%)", {HistType::kTH3D, {occAxis, nchAxis, centAxis}}); - registry.addClone("eventQA/before/", "eventQA/after/"); - registry.add("eventQA/eventSel", "Number of Events;; Counts", {HistType::kTH1D, {{15, 0.5, 15.5}}}); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kFilteredEvent, "Filtered event"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kSel8, "sel8"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kOccupancy, "occupancy"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kTVXinTRD, "kTVXinTRD"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoSameBunchPileup, "kNoSameBunchPileup"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kIsGoodZvtxFT0vsPV, "kIsGoodZvtxFT0vsPV"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoCollInTimeRangeStandard, "kNoCollInTimeRangeStandard"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoCollInRofStandard, "kNoCollInRofStandard"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoHighMultCollInPrevRof, "kNoHighMultCollInPrevRof"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoTimeFrameBorder, "kNoTimeFrameBorder"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoITSROFrameBorder, "kNoITSROFrameBorder"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kIsVertexITSTPC, "kIsVertexITSTPC"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kIsGoodITSLayersAll, "kIsGoodITSLayersAll"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kMultCuts, "after Mult cuts"); - registry.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kTrackCent, "has track + within cent"); + registryQA.add("eventQA/before/centrality", "; centrality (%); Counts", {HistType::kTH1D, {centAxis}}); + registryQA.add("eventQA/before/multiplicity", "; N_{ch}; Counts", {HistType::kTH1D, {nchAxis}}); + registryQA.add("eventQA/before/globalTracks_centT0C", "; FT0C centrality (%); N_{global}", {HistType::kTH2D, {centAxis, nchAxis}}); + registryQA.add("eventQA/before/PVTracks_centT0C", "; FT0C centrality (%); N_{PV}", {HistType::kTH2D, {centAxis, multpvAxis}}); + registryQA.add("eventQA/before/globalTracks_PVTracks", "; N_{PV}; N_{global}", {HistType::kTH2D, {multpvAxis, nchAxis}}); + registryQA.add("eventQA/before/globalTracks_multT0A", "; multT0A; N_{global}", {HistType::kTH2D, {t0aAxis, nchAxis}}); + registryQA.add("eventQA/before/globalTracks_multV0A", "; multV0A; N_{global}", {HistType::kTH2D, {v0aAxis, nchAxis}}); + registryQA.add("eventQA/before/multV0A_multT0A", "; multV0A; multT0A", {HistType::kTH2D, {t0aAxis, v0aAxis}}); + registryQA.add("eventQA/before/multT0C_centT0C", "; multT0C; FT0C centrality (%)", {HistType::kTH2D, {centAxis, t0cAxis}}); + registryQA.add("eventQA/before/occ_mult_cent", "; occupancy; N_{ch}; centrality (%)", {HistType::kTH3D, {occAxis, nchAxis, centAxis}}); + registryQA.addClone("eventQA/before/", "eventQA/after/"); + registryQA.add("eventQA/eventSel", "Number of Events;; Counts", {HistType::kTH1D, {{15, 0.5, 15.5}}}); + registryQA.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kFilteredEvent, "Filtered event"); + registryQA.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kSel8, "sel8"); + registryQA.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kOccupancy, "occupancy"); + registryQA.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kTVXinTRD, "kTVXinTRD"); + registryQA.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoSameBunchPileup, "kNoSameBunchPileup"); + registryQA.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kIsGoodZvtxFT0vsPV, "kIsGoodZvtxFT0vsPV"); + registryQA.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoCollInTimeRangeStandard, "kNoCollInTimeRangeStandard"); + registryQA.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoCollInRofStandard, "kNoCollInRofStandard"); + registryQA.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoHighMultCollInPrevRof, "kNoHighMultCollInPrevRof"); + registryQA.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoTimeFrameBorder, "kNoTimeFrameBorder"); + registryQA.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kNoITSROFrameBorder, "kNoITSROFrameBorder"); + registryQA.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kIsVertexITSTPC, "kIsVertexITSTPC"); + registryQA.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kIsGoodITSLayersAll, "kIsGoodITSLayersAll"); + registryQA.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kMultCuts, "after Mult cuts"); + registryQA.get(HIST("eventQA/eventSel"))->GetXaxis()->SetBinLabel(kTrackCent, "has track + within cent"); registry.add("npt_ch", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}}); registry.add("npt_pi", "; #it{p}_{T} (GeV/#it{c}; ; centrality (%); fraction)", {HistType::kTProfile2D, {ptAxis, centAxis}}); @@ -613,73 +635,77 @@ struct FlowGenericFramework { if (!cfgRunByRun) { if (cfgUsePID) { - registry.add("phi_eta_vtxz_ref", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); - registry.add("phi_eta_vtxz_ch", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); - registry.add("phi_eta_vtxz_pi", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); - registry.add("phi_eta_vtxz_ka", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); - registry.add("phi_eta_vtxz_pr", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); + registryQA.add("phi_eta_vtxz_ref", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); + registryQA.add("phi_eta_vtxz_ch", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); + registryQA.add("phi_eta_vtxz_pi", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); + registryQA.add("phi_eta_vtxz_ka", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); + registryQA.add("phi_eta_vtxz_pr", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); } else { - registry.add("phi_eta_vtxz_ref", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); + registryQA.add("phi_eta_vtxz_ref", "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); } } - AxisSpec axisK0Mass = {resoSwitchVals[K0][kMassBins], resoCutVals[K0][kMassMin], resoCutVals[K0][kMassMax]}; - AxisSpec axisLambdaMass = {resoSwitchVals[LAMBDA][kMassBins], resoCutVals[LAMBDA][kMassMin], resoCutVals[LAMBDA][kMassMax]}; + AxisSpec axisK0Mass = {resoSwitchVals[kMassBins][K0], resoCutVals[kMassMin][K0], resoCutVals[kMassMax][K0]}; + AxisSpec axisLambdaMass = {resoSwitchVals[kMassBins][LAMBDA], resoCutVals[kMassMin][LAMBDA], resoCutVals[kMassMax][LAMBDA]}; // QA histograms for V0s - if (resoSwitchVals[K0][kUseParticle]) { - registry.add("K0/PiPlusTPC_K0", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTPC}}}); - registry.add("K0/PiMinusTPC_K0", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTPC}}}); - registry.add("K0/PiPlusTOF_K0", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTOF}}}); - registry.add("K0/PiMinusTOF_K0", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTOF}}}); - registry.add("K0/hK0Phi", "", {HistType::kTH1D, {phiAxis}}); - registry.add("K0/hK0Eta", "", {HistType::kTH1D, {etaAxis}}); - registry.add("K0/hK0Mass_sparse", "", {HistType::kTHnSparseF, {{axisK0Mass, ptAxis, nchAxis}}}); - registry.add("K0/hK0s", "", {HistType::kTH1D, {singleCount}}); - registry.add("K0/hK0s_corrected", "", {HistType::kTH1D, {singleCount}}); - - registry.add("K0/hK0Count", "Number of K0;; Count", {HistType::kTH1D, {{10, 0.5, 10.5}}}); - registry.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillCandidate, "K0 candidates"); - registry.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillDaughterPt, "Daughter pt"); - registry.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillMassCut, "Mass cut"); - registry.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillRapidityCut, "Rapidity cut"); - registry.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillDCAtoPV, "DCA to PV"); - registry.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillDCAxDaughters, "DCA between daughters"); - registry.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillV0Radius, "V0radius"); - registry.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillCosPA, "CosPA"); - registry.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillProperLifetime, "Proper lifetime"); - registry.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillDaughterTrackSelection, "Daughter track selection"); + if (resoSwitchVals[kUseParticle][K0]) { + registryQA.add("K0/PiPlusTPC_K0", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTPC}}}); + registryQA.add("K0/PiMinusTPC_K0", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTPC}}}); + registryQA.add("K0/PiPlusTOF_K0", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTOF}}}); + registryQA.add("K0/PiMinusTOF_K0", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTOF}}}); + registryQA.add("K0/hK0Phi", "", {HistType::kTH1D, {phiAxis}}); + registryQA.add("K0/hK0Eta", "", {HistType::kTH1D, {etaAxis}}); + registryQA.add("K0/hK0Mass_sparse", "", {HistType::kTHnSparseF, {{axisK0Mass, ptAxis, nchAxis}}}); + registryQA.add("K0/hK0s", "", {HistType::kTH1D, {singleCount}}); + registryQA.add("K0/hK0s_corrected", "", {HistType::kTH1D, {singleCount}}); + + registryQA.add("K0/hK0Count", "Number of K0;; Count", {HistType::kTH1D, {{12, 0.5, 12.5}}}); + registryQA.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillCandidate, "K0 candidates"); + registryQA.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillDaughterPt, "Daughter pt"); + registryQA.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillMassCut, "Mass cut"); + registryQA.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillRapidityCut, "Rapidity cut"); + registryQA.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillDCAtoPV, "DCA to PV"); + registryQA.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillDCAxDaughters, "DCA between daughters"); + registryQA.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillV0Radius, "V0radius"); + registryQA.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillCosPA, "CosPA"); + registryQA.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillProperLifetime, "Proper lifetime"); + registryQA.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillArmPodCut, "Armenteros-Podolanski cut"); + registryQA.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillCompetingMass, "Competing mass rejection"); + registryQA.get(HIST("K0/hK0Count"))->GetXaxis()->SetBinLabel(kFillDaughterTrackSelection, "Daughter track selection"); } - if (resoSwitchVals[LAMBDA][kUseParticle]) { - registry.add("Lambda/PrPlusTPC_L", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTPC}}}); - registry.add("Lambda/PiMinusTPC_L", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTPC}}}); - registry.add("Lambda/PrPlusTOF_L", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTOF}}}); - registry.add("Lambda/PiMinusTOF_L", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTOF}}}); - registry.add("Lambda/hLambdaPhi", "", {HistType::kTH1D, {phiAxis}}); - registry.add("Lambda/hLambdaEta", "", {HistType::kTH1D, {etaAxis}}); - registry.add("Lambda/hLambdaMass_sparse", "", {HistType::kTHnSparseF, {{axisLambdaMass, ptAxis, nchAxis}}}); - registry.add("Lambda/PiPlusTPC_AL", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTPC}}}); - registry.add("Lambda/PrMinusTPC_AL", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTPC}}}); - registry.add("Lambda/PiPlusTOF_AL", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTOF}}}); - registry.add("Lambda/PrMinusTOF_AL", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTOF}}}); - registry.add("Lambda/hAntiLambdaPhi", "", {HistType::kTH1D, {phiAxis}}); - registry.add("Lambda/hAntiLambdaEta", "", {HistType::kTH1D, {etaAxis}}); - registry.add("Lambda/hAntiLambdaMass_sparse", "", {HistType::kTHnSparseF, {{axisLambdaMass, ptAxis, nchAxis}}}); - registry.add("Lambda/hLambdas", "", {HistType::kTH1D, {singleCount}}); - registry.add("Lambda/hLambdas_corrected", "", {HistType::kTH1D, {singleCount}}); - - registry.add("Lambda/hLambdaCount", "Number of Lambda;; Count", {HistType::kTH1D, {{10, 0.5, 10.5}}}); - registry.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillCandidate, "Lambda candidates"); - registry.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillDaughterPt, "Daughter pt"); - registry.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillMassCut, "Mass cut"); - registry.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillRapidityCut, "Rapidity cut"); - registry.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillDCAtoPV, "DCA to PV"); - registry.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillDCAxDaughters, "DCA between daughters"); - registry.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillV0Radius, "V0radius"); - registry.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillCosPA, "CosPA"); - registry.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillProperLifetime, "Proper lifetime"); - registry.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillDaughterTrackSelection, "Daughter track selection"); + if (resoSwitchVals[kUseParticle][LAMBDA]) { + registryQA.add("Lambda/PrPlusTPC_L", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTPC}}}); + registryQA.add("Lambda/PiMinusTPC_L", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTPC}}}); + registryQA.add("Lambda/PrPlusTOF_L", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTOF}}}); + registryQA.add("Lambda/PiMinusTOF_L", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTOF}}}); + registryQA.add("Lambda/hLambdaPhi", "", {HistType::kTH1D, {phiAxis}}); + registryQA.add("Lambda/hLambdaEta", "", {HistType::kTH1D, {etaAxis}}); + registryQA.add("Lambda/hLambdaMass_sparse", "", {HistType::kTHnSparseF, {{axisLambdaMass, ptAxis, nchAxis}}}); + registryQA.add("Lambda/PiPlusTPC_AL", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTPC}}}); + registryQA.add("Lambda/PrMinusTPC_AL", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTPC}}}); + registryQA.add("Lambda/PiPlusTOF_AL", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTOF}}}); + registryQA.add("Lambda/PrMinusTOF_AL", "", {HistType::kTH2D, {{ptAxis, axisNsigmaTOF}}}); + registryQA.add("Lambda/hAntiLambdaPhi", "", {HistType::kTH1D, {phiAxis}}); + registryQA.add("Lambda/hAntiLambdaEta", "", {HistType::kTH1D, {etaAxis}}); + registryQA.add("Lambda/hAntiLambdaMass_sparse", "", {HistType::kTHnSparseF, {{axisLambdaMass, ptAxis, nchAxis}}}); + registryQA.add("Lambda/hLambdas", "", {HistType::kTH1D, {singleCount}}); + registryQA.add("Lambda/hLambdas_corrected", "", {HistType::kTH1D, {singleCount}}); + + registryQA.add("Lambda/hLambdaCount", "Number of Lambda;; Count", {HistType::kTH1D, {{12, 0.5, 12.5}}}); + registryQA.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillCandidate, "Lambda candidates"); + registryQA.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillDaughterPt, "Daughter pt"); + registryQA.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillMassCut, "Mass cut"); + registryQA.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillRapidityCut, "Rapidity cut"); + registryQA.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillDCAtoPV, "DCA to PV"); + registryQA.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillDCAxDaughters, "DCA between daughters"); + registryQA.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillV0Radius, "V0radius"); + registryQA.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillCosPA, "CosPA"); + registryQA.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillProperLifetime, "Proper lifetime"); + registryQA.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillArmPodCut, "Armenteros-Podolanski cut"); + registryQA.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillCompetingMass, "Competing mass rejection"); + registryQA.get(HIST("Lambda/hLambdaCount"))->GetXaxis()->SetBinLabel(kFillDaughterTrackSelection, "Daughter track selection"); } } @@ -814,7 +840,7 @@ struct FlowGenericFramework { size_t maxValLen = 0; for (size_t r = 0; r < nRows; ++r) { std::ostringstream oss; - oss << std::fixed << std::setprecision(2) << valuesMatrix[r][c]; + oss << std::fixed << std::setprecision(3) << valuesMatrix[r][c]; maxValLen = std::max(maxValLen, oss.str().length()); } colWidths[c] = std::max(lbl.labels_cols[c].size(), maxValLen); @@ -838,7 +864,7 @@ struct FlowGenericFramework { std::ostringstream line; line << std::setw(rowLabelWidth) << (lbl.labels_rows[r] + ":"); for (size_t c = 0; c < nCols; ++c) { - line << std::setw(colWidths[c]) << std::fixed << std::setprecision(2) << valuesMatrix[r][c] << " "; + line << std::setw(colWidths[c]) << std::fixed << std::setprecision(3) << valuesMatrix[r][c] << " "; } LOGF(info, "%s", line.str().c_str()); } @@ -846,10 +872,12 @@ struct FlowGenericFramework { // ----- nSigma PID ----- // Map arrays into a 2D vector - std::vector> nSigmaVals = { - std::vector(tpcNsigmaCut.begin(), tpcNsigmaCut.end()), - std::vector(tofNsigmaCut.begin(), tofNsigmaCut.end()), - std::vector(itsNsigmaCut.begin(), itsNsigmaCut.end())}; + std::vector> nSigmaVals(6, std::vector(3)); + for (size_t i = 0; i < 6; i++) { + nSigmaVals[i][0] = tpcNsigmaCut[i]; // TPC + nSigmaVals[i][1] = tofNsigmaCut[i]; // TOF + nSigmaVals[i][2] = itsNsigmaCut[i]; // ITS + } printTable(cfgPIDCuts.nSigmas.value, nSigmaVals, "nSigma PID Cuts"); // ----- Resonance Cuts ----- @@ -1056,7 +1084,7 @@ struct FlowGenericFramework { // "CMTVX-B-NOPF-TRD,minbias_TVX" return false; } - registry.fill(HIST("eventQA/eventSel"), kTVXinTRD); + registryQA.fill(HIST("eventQA/eventSel"), kTVXinTRD); if (cfgRunByRun) th1sList[run][hEventSel]->Fill(kTVXinTRD); } @@ -1066,7 +1094,7 @@ struct FlowGenericFramework { continue; if (!collision.selection_bit(cut.flag)) return false; - registry.fill(HIST("eventQA/eventSel"), cut.histBin); + registryQA.fill(HIST("eventQA/eventSel"), cut.histBin); if (cfgRunByRun) th1sList[run][hEventSel]->Fill(cut.histBin); } @@ -1122,7 +1150,7 @@ struct FlowGenericFramework { return false; if (!(cfgMultCorrCuts.cfgMultGlobalASideCorrCutFunction->empty()) && static_cast(collision.multFT0A()) > fMultGlobalT0ACutHigh->Eval(multTrk)) return false; - registry.fill(HIST("eventQA/eventSel"), kMultCuts); + registryQA.fill(HIST("eventQA/eventSel"), kMultCuts); if (cfgRunByRun) th1sList[run][hEventSel]->Fill(kMultCuts); return true; @@ -1143,11 +1171,11 @@ struct FlowGenericFramework { phimodn += o2::constants::math::PI / 18.0; // to center gap in the middle phimodn = fmod(phimodn, o2::constants::math::PI / 9.0); if (cfgFillQA) - registry.fill(HIST("trackQA/before/pt_phi"), track.pt(), phimodn); + registryQA.fill(HIST("trackQA/before/pt_phi"), track.pt(), phimodn); if (phimodn < fPhiCutHigh->Eval(track.pt()) && phimodn > fPhiCutLow->Eval(track.pt())) return false; // reject track if (cfgFillQA) - registry.fill(HIST("trackQA/after/pt_phi"), track.pt(), phimodn); + registryQA.fill(HIST("trackQA/after/pt_phi"), track.pt(), phimodn); } if (cfgTrackCuts.cfgDCAxyNSigma && (std::fabs(track.dcaXY()) > cfgTrackCuts.cfgDCAxyNSigma / 7. * (0.0105f + 0.0350f / std::pow(track.pt(), 1.1)))) return false; @@ -1182,20 +1210,20 @@ struct FlowGenericFramework { th3sList[run][hNUAch + pid_index]->Fill(track.phi(), track.eta(), vtxz); // charged and id'ed particle weights } else { if (withinPtRef && !pid_index) - registry.fill(HIST("phi_eta_vtxz_ref"), track.phi(), track.eta(), vtxz); // pt-subset of charged particles for ref flow + registryQA.fill(HIST("phi_eta_vtxz_ref"), track.phi(), track.eta(), vtxz); // pt-subset of charged particles for ref flow if (withinPtPOI) { switch (pid_index) { case 0: - registry.fill(HIST("phi_eta_vtxz_ch"), track.phi(), track.eta(), vtxz); // charged particle weights + registryQA.fill(HIST("phi_eta_vtxz_ch"), track.phi(), track.eta(), vtxz); // charged particle weights break; case 1: - registry.fill(HIST("phi_eta_vtxz_pi"), track.phi(), track.eta(), vtxz); // pion weights + registryQA.fill(HIST("phi_eta_vtxz_pi"), track.phi(), track.eta(), vtxz); // pion weights break; case 2: - registry.fill(HIST("phi_eta_vtxz_ka"), track.phi(), track.eta(), vtxz); // kaon weights + registryQA.fill(HIST("phi_eta_vtxz_ka"), track.phi(), track.eta(), vtxz); // kaon weights break; case 3: - registry.fill(HIST("phi_eta_vtxz_pr"), track.phi(), track.eta(), vtxz); // proton weights + registryQA.fill(HIST("phi_eta_vtxz_pr"), track.phi(), track.eta(), vtxz); // proton weights break; } } @@ -1204,7 +1232,7 @@ struct FlowGenericFramework { if (cfgRunByRun) th3sList[run][hNUAref]->Fill(track.phi(), track.eta(), vtxz); else - registry.fill(HIST("phi_eta_vtxz_ref"), track.phi(), track.eta(), vtxz); + registryQA.fill(HIST("phi_eta_vtxz_ref"), track.phi(), track.eta(), vtxz); } return; } @@ -1219,12 +1247,12 @@ struct FlowGenericFramework { AxisSpec centAxis = {o2::analysis::gfw::centbinning, "Centrality (%)"}; AxisSpec ptAxis = {o2::analysis::gfw::ptbinning, "#it{p}_{T} GeV/#it{c}"}; std::vector> histos(kCount_TH1Names); - histos[hPhi] = registry.add(Form("%d/phi", run), "", {HistType::kTH1D, {phiAxis}}); - histos[hEta] = registry.add(Form("%d/eta", run), "", {HistType::kTH1D, {etaAxis}}); - histos[hVtxZ] = registry.add(Form("%d/vtxz", run), "", {HistType::kTH1D, {vtxAxis}}); - histos[hMult] = registry.add(Form("%d/mult", run), "", {HistType::kTH1D, {nchAxis}}); - histos[hCent] = registry.add(Form("%d/cent", run), "", {HistType::kTH1D, {centAxis}}); - histos[hEventSel] = registry.add(Form("%d/eventSel", run), "Number of Events;; Counts", {HistType::kTH1D, {{11, 0, 11}}}); + histos[hPhi] = registryQA.add(Form("%d/phi", run), "", {HistType::kTH1D, {phiAxis}}); + histos[hEta] = registryQA.add(Form("%d/eta", run), "", {HistType::kTH1D, {etaAxis}}); + histos[hVtxZ] = registryQA.add(Form("%d/vtxz", run), "", {HistType::kTH1D, {vtxAxis}}); + histos[hMult] = registryQA.add(Form("%d/mult", run), "", {HistType::kTH1D, {nchAxis}}); + histos[hCent] = registryQA.add(Form("%d/cent", run), "", {HistType::kTH1D, {centAxis}}); + histos[hEventSel] = registryQA.add(Form("%d/eventSel", run), "Number of Events;; Counts", {HistType::kTH1D, {{11, 0, 11}}}); histos[hEventSel]->GetXaxis()->SetBinLabel(1, "Filtered event"); histos[hEventSel]->GetXaxis()->SetBinLabel(2, "sel8"); histos[hEventSel]->GetXaxis()->SetBinLabel(3, "occupancy"); @@ -1239,41 +1267,26 @@ struct FlowGenericFramework { th1sList.insert(std::make_pair(run, histos)); std::vector> histos3d(kCount_TH3Names); if (cfgUsePID) { - histos3d[hNUAref] = registry.add(Form("%d/phi_eta_vtxz_ref", run), "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); - histos3d[hNUAch] = registry.add(Form("%d/phi_eta_vtxz_ch", run), "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); - histos3d[hNUApi] = registry.add(Form("%d/phi_eta_vtxz_pi", run), "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); - histos3d[hNUAka] = registry.add(Form("%d/phi_eta_vtxz_ka", run), "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); - histos3d[hNUApr] = registry.add(Form("%d/phi_eta_vtxz_pr", run), "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); + histos3d[hNUAref] = registryQA.add(Form("%d/phi_eta_vtxz_ref", run), "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); + histos3d[hNUAch] = registryQA.add(Form("%d/phi_eta_vtxz_ch", run), "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); + histos3d[hNUApi] = registryQA.add(Form("%d/phi_eta_vtxz_pi", run), "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); + histos3d[hNUAka] = registryQA.add(Form("%d/phi_eta_vtxz_ka", run), "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); + histos3d[hNUApr] = registryQA.add(Form("%d/phi_eta_vtxz_pr", run), "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); } else { - histos3d[hNUAref] = registry.add(Form("%d/phi_eta_vtxz_ref", run), "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); + histos3d[hNUAref] = registryQA.add(Form("%d/phi_eta_vtxz_ref", run), "", {HistType::kTH3D, {phiAxis, etaAxis, vtxAxis}}); } - histos3d[hPtPhiMult] = registry.add(Form("%d/pt_phi_mult", run), "", {HistType::kTH3D, {ptAxis, phiModAxis, (cfgUseNch) ? nchAxis : centAxis}}); + histos3d[hPtPhiMult] = registryQA.add(Form("%d/pt_phi_mult", run), "", {HistType::kTH3D, {ptAxis, phiModAxis, (cfgUseNch) ? nchAxis : centAxis}}); th3sList.insert(std::make_pair(run, histos3d)); return; } struct AcceptedTracks { - explicit AcceptedTracks(std::size_t nptbins) - : pidtotal{0, 0, 0}, - nch(nptbins, 0.f), - npi(nptbins, 0.f), - nka(nptbins, 0.f), - npr(nptbins, 0.f) - { - } - float total = 0; unsigned int totaluncorr = 0; - - std::vector pidtotal; - std::vector nch; - std::vector npi; - std::vector nka; - std::vector npr; }; template - void fillOutputContainers(const float& centmult, const double& rndm, AcceptedTracks acceptedtracks) + void fillOutputContainers(const float& centmult, const double& rndm) { fFCpt->calculateCorrelations(); fFCpt->calculateSubeventCorrelations(); @@ -1308,58 +1321,43 @@ struct FlowGenericFramework { } } - double chtotal = (cfgUseNchCorrection) ? acceptedtracks.total : acceptedtracks.totaluncorr; - // calculate fractions - std::vector> inputs = {acceptedtracks.nch, acceptedtracks.npi, acceptedtracks.nka, acceptedtracks.npr}; - std::vector> fractions; - fractions.reserve(inputs.size()); - int pidcounter = 0; - for (auto& vec : inputs) { // o2-linter: disable=const-ref-in-for-loop (modified through transform) - fractions.emplace_back(); - fractions.back().reserve(vec.size()); + if (histosNpt[CHARGEDID]->Integral() <= 0) + return; - double total = chtotal; - if (cfgUsePIDTotal) - total = (pidcounter) ? acceptedtracks.pidtotal[pidcounter - 1] : chtotal; + double dnPi = histosNpt[CHARGEDID]->Integral(); + double dnKa = histosNpt[CHARGEDID]->Integral(); + double dnPr = histosNpt[CHARGEDID]->Integral(); - if (total == 0.) { - ++pidcounter; - continue; - } - std::transform(vec.begin(), vec.end(), - std::back_inserter(fractions.back()), - [&](double x) { return x / total; }); - ++pidcounter; - } - - if (cfgUseNewNpt) { - for (int i = 1; i <= fPtAxis->GetNbins(); ++i) { - registry.fill(HIST("npt_ch"), fPtAxis->GetBinCenter(i), centmult, histosNpt[CHARGEDID]->GetBinContent(i) / histosNpt[CHARGEDID]->Integral()); - registry.fill(HIST("npt_pi"), fPtAxis->GetBinCenter(i), centmult, histosNpt[PIONID]->GetBinContent(i) / histosNpt[CHARGEDID]->Integral()); - registry.fill(HIST("npt_ka"), fPtAxis->GetBinCenter(i), centmult, histosNpt[KAONID]->GetBinContent(i) / histosNpt[CHARGEDID]->Integral()); - registry.fill(HIST("npt_pr"), fPtAxis->GetBinCenter(i), centmult, histosNpt[PROTONID]->GetBinContent(i) / histosNpt[CHARGEDID]->Integral()); - } - } else { - for (std::size_t i = 0; i < fractions[0].size(); ++i) - registry.fill(HIST("npt_ch"), fPtAxis->GetBinCenter(i + 1), centmult, fractions[0][i]); - for (std::size_t i = 0; i < fractions[1].size(); ++i) - registry.fill(HIST("npt_pi"), fPtAxis->GetBinCenter(i + 1), centmult, fractions[1][i]); - for (std::size_t i = 0; i < fractions[2].size(); ++i) - registry.fill(HIST("npt_ka"), fPtAxis->GetBinCenter(i + 1), centmult, fractions[2][i]); - for (std::size_t i = 0; i < fractions[3].size(); ++i) - registry.fill(HIST("npt_pr"), fPtAxis->GetBinCenter(i + 1), centmult, fractions[3][i]); - } - if (corrconfigsV02.size() < SPECIESCOUNT) // + if (cfgUsePIDTotal) { + dnPi = histosNpt[PIONID]->Integral(); + dnKa = histosNpt[KAONID]->Integral(); + dnPr = histosNpt[PROTONID]->Integral(); + } + + for (int i = 1; i <= fPtAxis->GetNbins(); ++i) { + registry.fill(HIST("npt_ch"), fPtAxis->GetBinCenter(i), centmult, histosNpt[CHARGEDID]->GetBinContent(i) / histosNpt[CHARGEDID]->Integral()); + if (dnPi > 0) + registry.fill(HIST("npt_pi"), fPtAxis->GetBinCenter(i), centmult, histosNpt[PIONID]->GetBinContent(i) / dnPi); + if (dnKa > 0) + registry.fill(HIST("npt_ka"), fPtAxis->GetBinCenter(i), centmult, histosNpt[KAONID]->GetBinContent(i) / dnKa); + if (dnPr > 0) + registry.fill(HIST("npt_pr"), fPtAxis->GetBinCenter(i), centmult, histosNpt[PROTONID]->GetBinContent(i) / dnPr); + } + + if (corrconfigsV02.size() < SPECIESCOUNT) return; + // For alternative normalisation with integrated pid spectra + std::vector dns = {histosNpt[CHARGEDID]->Integral(), dnPi, dnKa, dnPr}; + for (uint l_ind = 0; l_ind < SPECIESCOUNT; ++l_ind) { for (int i = 1; i <= fPtAxis->GetNbins(); i++) { auto dnx = fGFW->Calculate(corrconfigsV02.at(l_ind), i - 1, kTRUE).real(); if (dnx == 0) continue; auto val = fGFW->Calculate(corrconfigsV02.at(l_ind), i - 1, kFALSE).real() / dnx; - if (std::abs(val) < 1) - (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsV02.at(l_ind).Head.c_str(), i), centmult, val * ((cfgUseNewNpt) ? histosNpt[l_ind]->GetBinContent(i) / histosNpt[CHARGEDID]->Integral() : fractions[l_ind][i - 1]), dnx, rndm) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsV02.at(l_ind).Head.c_str(), i), centmult, val * ((cfgUseNewNpt) ? histosNpt[l_ind]->GetBinContent(i) / histosNpt[CHARGEDID]->Integral() : fractions[l_ind][i - 1]), dnx, rndm); + if (std::abs(val) < 1 && dns[l_ind] > 0) + (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsV02.at(l_ind).Head.c_str(), i), centmult, val * histosNpt[l_ind]->GetBinContent(i) / dns[l_ind], dnx, rndm) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsV02.at(l_ind).Head.c_str(), i), centmult, val * histosNpt[l_ind]->GetBinContent(i) / dns[l_ind], dnx, rndm); } } @@ -1382,7 +1380,8 @@ struct FlowGenericFramework { return; for (uint l_ind = 0; l_ind < SPECIESCOUNT; ++l_ind) { for (int i = 1; i <= fPtAxis->GetNbins(); i++) { - (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsV0.at(l_ind).Head.c_str(), i), centmult, mpt * ((cfgUseNewNpt) ? histosNpt[l_ind]->GetBinContent(i) / histosNpt[CHARGEDID]->Integral() : fractions[l_ind][i - 1]), 1., rndm) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsV0.at(l_ind).Head.c_str(), i), centmult, mpt * ((cfgUseNewNpt) ? histosNpt[l_ind]->GetBinContent(i) / histosNpt[CHARGEDID]->Integral() : fractions[l_ind][i - 1]), 1., rndm); + if (dns[l_ind] > 0) + (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsV0.at(l_ind).Head.c_str(), i), centmult, mpt * histosNpt[l_ind]->GetBinContent(i) / dns[l_ind], 1., rndm) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsV0.at(l_ind).Head.c_str(), i), centmult, mpt * histosNpt[l_ind]->GetBinContent(i) / dns[l_ind], 1., rndm); } } return; @@ -1396,7 +1395,7 @@ struct FlowGenericFramework { if (dt != kGen && (centrality < o2::analysis::gfw::centbinning.front() || centrality > o2::analysis::gfw::centbinning.back())) return; if (dt != kGen) { - registry.fill(HIST("eventQA/eventSel"), kTrackCent); + registryQA.fill(HIST("eventQA/eventSel"), kTrackCent); if (cfgRunByRun) th1sList[run][hEventSel]->Fill(kTrackCent); } @@ -1445,15 +1444,15 @@ struct FlowGenericFramework { densitycorrections.density = tracks.size(); } // process tracks - AcceptedTracks acceptedTracks(o2::analysis::gfw::ptbinning.size() - 1); + AcceptedTracks acceptedTracks; // Reset fraction histograms per event for (const auto& h : histosNpt) h->Reset("ICESM"); for (const auto& track : tracks) { processTrack(track, vtxz, field, run, densitycorrections, acceptedTracks); } - registry.fill(HIST("trackQA/after/Nch_corrected"), acceptedTracks.total); - registry.fill(HIST("trackQA/after/Nch_uncorrected"), acceptedTracks.totaluncorr); + registryQA.fill(HIST("trackQA/after/Nch_corrected"), acceptedTracks.total); + registryQA.fill(HIST("trackQA/after/Nch_uncorrected"), acceptedTracks.totaluncorr); int multiplicity = 0; switch (cfgUseNchCorrection) { @@ -1474,110 +1473,82 @@ struct FlowGenericFramework { if (cfgFillWeights) return; - fillOutputContainers
((cfgUseNch) ? multiplicity : centrality, lRandom, acceptedTracks); + fillOutputContainers
((cfgUseNch) ? multiplicity : centrality, lRandom); // Reset fraction histograms per event for (const auto& h : histosResoNpt) h->Reset("ICESM"); - std::vector> nptResonances(6, std::vector(o2::analysis::gfw::ptbinning.size())); // Process V0s for (const auto& v0 : v0s) { - if (resoSwitchVals[K0][kUseParticle]) { + if (resoSwitchVals[kUseParticle][K0]) { double weff = 1; if (selectK0(collision, v0, centrality, weff)) { - int ptBinIndex = fPtAxis->FindBin(v0.pt()) - 1; - if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { - if (v0.mK0Short() > cfgPIDCuts.cfgK0SideBand1Min && v0.mK0Short() < cfgPIDCuts.cfgK0SideBand1Max) { - nptResonances[0][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; - histosResoNpt[K0SIDEBAND1]->Fill(v0.pt(), (cfgUseNchCorrection) ? weff : 1.0); - } - if (v0.mK0Short() > cfgPIDCuts.cfgK0SignalMin && v0.mK0Short() < cfgPIDCuts.cfgK0SignalMax) { - nptResonances[1][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; - histosResoNpt[K0SIGNAL]->Fill(v0.pt(), (cfgUseNchCorrection) ? weff : 1.0); - } - if (v0.mK0Short() > cfgPIDCuts.cfgK0SideBand2Min && v0.mK0Short() < cfgPIDCuts.cfgK0SideBand2Max) { - nptResonances[2][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; - histosResoNpt[K0SIDEBAND2]->Fill(v0.pt(), (cfgUseNchCorrection) ? weff : 1.0); - } - } + if (v0.mK0Short() > cfgPIDCuts.cfgK0SideBand1Min && v0.mK0Short() < cfgPIDCuts.cfgK0SideBand1Max) + histosResoNpt[K0SIDEBAND1]->Fill(v0.pt(), (cfgUseNchCorrection) ? weff : 1.0); + if (v0.mK0Short() > cfgPIDCuts.cfgK0SignalMin && v0.mK0Short() < cfgPIDCuts.cfgK0SignalMax) + histosResoNpt[K0SIGNAL]->Fill(v0.pt(), (cfgUseNchCorrection) ? weff : 1.0); + if (v0.mK0Short() > cfgPIDCuts.cfgK0SideBand2Min && v0.mK0Short() < cfgPIDCuts.cfgK0SideBand2Max) + histosResoNpt[K0SIDEBAND2]->Fill(v0.pt(), (cfgUseNchCorrection) ? weff : 1.0); } } - // Add lambdabar - if (resoSwitchVals[LAMBDA][kUseParticle]) { + if (resoSwitchVals[kUseParticle][LAMBDA]) { double weff = 1.; if (selectLambda(collision, v0, centrality, weff)) { - int ptBinIndex = fPtAxis->FindBin(v0.pt()) - 1; - if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { - if (v0.mLambda() > cfgPIDCuts.cfgLambdaSideBand1Min && v0.mLambda() < cfgPIDCuts.cfgLambdaSideBand1Max) { - nptResonances[3][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; - histosResoNpt[LAMBDASIDEBAND1]->Fill(v0.pt(), (cfgUseNchCorrection) ? weff : 1.0); - } - if (v0.mLambda() > cfgPIDCuts.cfgLambdaSignalMin && v0.mLambda() < cfgPIDCuts.cfgLambdaSignalMax) { - nptResonances[4][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; - histosResoNpt[LAMBDASIGNAL]->Fill(v0.pt(), (cfgUseNchCorrection) ? weff : 1.0); - } - if (v0.mLambda() > cfgPIDCuts.cfgLambdaSideBand2Min && v0.mLambda() < cfgPIDCuts.cfgLambdaSideBand2Max) { - nptResonances[5][ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; - histosResoNpt[LAMBDASIDEBAND2]->Fill(v0.pt(), (cfgUseNchCorrection) ? weff : 1.0); - } - } + if (v0.mLambda() > cfgPIDCuts.cfgLambdaSideBand1Min && v0.mLambda() < cfgPIDCuts.cfgLambdaSideBand1Max) + histosResoNpt[LAMBDASIDEBAND1]->Fill(v0.pt(), (cfgUseNchCorrection) ? weff : 1.0); + if (v0.mLambda() > cfgPIDCuts.cfgLambdaSignalMin && v0.mLambda() < cfgPIDCuts.cfgLambdaSignalMax) + histosResoNpt[LAMBDASIGNAL]->Fill(v0.pt(), (cfgUseNchCorrection) ? weff : 1.0); + if (v0.mLambda() > cfgPIDCuts.cfgLambdaSideBand2Min && v0.mLambda() < cfgPIDCuts.cfgLambdaSideBand2Max) + histosResoNpt[LAMBDASIDEBAND2]->Fill(v0.pt(), (cfgUseNchCorrection) ? weff : 1.0); } } } - double chtotal = (cfgUseNchCorrection) ? acceptedTracks.total : acceptedTracks.totaluncorr; - // calculate fractions - std::vector> fractions_resonances = nptResonances; - int pidcounter = 0; - for (auto& vec : fractions_resonances) { // o2-linter: disable=const-ref-in-for-loop (modified through transform) - double total = chtotal; - if (cfgUsePIDTotal) - total = (pidcounter) ? std::accumulate(vec.begin(), vec.end(), 0.f) : chtotal; - - if (total == 0.) { - ++pidcounter; - continue; - } - std::transform(vec.begin(), vec.end(), vec.begin(), - [&](float x) { return x / total; }); - ++pidcounter; - } - if (cfgUseNewNpt) { - for (int i = 1; i <= fPtAxis->GetNbins(); ++i) { - if (histosNpt[CHARGEDID]->Integral() <= 0) - continue; - registry.fill(HIST("npt_K0_sb1"), fPtAxis->GetBinCenter(i), centrality, histosResoNpt[K0SIDEBAND1]->GetBinContent(i) / histosNpt[CHARGEDID]->Integral()); - registry.fill(HIST("npt_K0_sig"), fPtAxis->GetBinCenter(i), centrality, histosResoNpt[K0SIGNAL]->GetBinContent(i) / histosNpt[CHARGEDID]->Integral()); - registry.fill(HIST("npt_K0_sb2"), fPtAxis->GetBinCenter(i), centrality, histosResoNpt[K0SIDEBAND2]->GetBinContent(i) / histosNpt[CHARGEDID]->Integral()); - registry.fill(HIST("npt_Lambda_sb1"), fPtAxis->GetBinCenter(i), centrality, histosResoNpt[LAMBDASIDEBAND1]->GetBinContent(i) / histosNpt[CHARGEDID]->Integral()); - registry.fill(HIST("npt_Lambda_sig"), fPtAxis->GetBinCenter(i), centrality, histosResoNpt[LAMBDASIGNAL]->GetBinContent(i) / histosNpt[CHARGEDID]->Integral()); - registry.fill(HIST("npt_Lambda_sb2"), fPtAxis->GetBinCenter(i), centrality, histosResoNpt[LAMBDASIDEBAND2]->GetBinContent(i) / histosNpt[CHARGEDID]->Integral()); - } - } else { - for (std::size_t i = 0; i < fractions_resonances[0].size(); ++i) - registry.fill(HIST("npt_K0_sb1"), fPtAxis->GetBinCenter(i + 1), centrality, fractions_resonances[0][i]); - for (std::size_t i = 0; i < fractions_resonances[2].size(); ++i) - registry.fill(HIST("npt_K0_sb2"), fPtAxis->GetBinCenter(i + 1), centrality, fractions_resonances[2][i]); - for (std::size_t i = 0; i < fractions_resonances[1].size(); ++i) - registry.fill(HIST("npt_K0_sig"), fPtAxis->GetBinCenter(i + 1), centrality, fractions_resonances[1][i]); - for (std::size_t i = 0; i < fractions_resonances[3].size(); ++i) - registry.fill(HIST("npt_Lambda_sb1"), fPtAxis->GetBinCenter(i + 1), centrality, fractions_resonances[3][i]); - for (std::size_t i = 0; i < fractions_resonances[5].size(); ++i) - registry.fill(HIST("npt_Lambda_sb2"), fPtAxis->GetBinCenter(i + 1), centrality, fractions_resonances[5][i]); - for (std::size_t i = 0; i < fractions_resonances[4].size(); ++i) - registry.fill(HIST("npt_Lambda_sig"), fPtAxis->GetBinCenter(i + 1), centrality, fractions_resonances[4][i]); - } + if (histosNpt[CHARGEDID]->Integral() <= 0) + return; + + double dnK0SB1 = histosNpt[CHARGEDID]->Integral(); + double dnK0Sig = histosNpt[CHARGEDID]->Integral(); + double dnK0SB2 = histosNpt[CHARGEDID]->Integral(); + double dnLambdaSB1 = histosNpt[CHARGEDID]->Integral(); + double dnLambdaSig = histosNpt[CHARGEDID]->Integral(); + double dnLambdaSB2 = histosNpt[CHARGEDID]->Integral(); + + if (cfgUsePIDTotal) { + dnK0SB1 = histosResoNpt[K0SIDEBAND1]->Integral(); + dnK0Sig = histosResoNpt[K0SIGNAL]->Integral(); + dnK0SB2 = histosResoNpt[K0SIDEBAND2]->Integral(); + dnLambdaSB1 = histosResoNpt[LAMBDASIDEBAND1]->Integral(); + dnLambdaSig = histosResoNpt[LAMBDASIGNAL]->Integral(); + dnLambdaSB2 = histosResoNpt[LAMBDASIDEBAND2]->Integral(); + } + + for (int i = 1; i <= fPtAxis->GetNbins(); ++i) { + if (dnK0SB1 > 0) + registry.fill(HIST("npt_K0_sb1"), fPtAxis->GetBinCenter(i), centrality, histosResoNpt[K0SIDEBAND1]->GetBinContent(i) / dnK0SB1); + if (dnK0Sig > 0) + registry.fill(HIST("npt_K0_sig"), fPtAxis->GetBinCenter(i), centrality, histosResoNpt[K0SIGNAL]->GetBinContent(i) / dnK0Sig); + if (dnK0SB2 > 0) + registry.fill(HIST("npt_K0_sb2"), fPtAxis->GetBinCenter(i), centrality, histosResoNpt[K0SIDEBAND2]->GetBinContent(i) / dnK0SB2); + if (dnLambdaSB1 > 0) + registry.fill(HIST("npt_Lambda_sb1"), fPtAxis->GetBinCenter(i), centrality, histosResoNpt[LAMBDASIDEBAND1]->GetBinContent(i) / dnLambdaSB1); + if (dnLambdaSig > 0) + registry.fill(HIST("npt_Lambda_sig"), fPtAxis->GetBinCenter(i), centrality, histosResoNpt[LAMBDASIGNAL]->GetBinContent(i) / dnLambdaSig); + if (dnLambdaSB2 > 0) + registry.fill(HIST("npt_Lambda_sb2"), fPtAxis->GetBinCenter(i), centrality, histosResoNpt[LAMBDASIDEBAND2]->GetBinContent(i) / dnLambdaSB2); + } + + std::vector dns = {dnK0SB1, dnK0Sig, dnK0SB2, dnLambdaSB1, dnLambdaSig, dnLambdaSB2}; + for (uint l_ind = 4; l_ind < corrconfigsV02.size(); ++l_ind) { - if (histosNpt[CHARGEDID]->Integral() <= 0 && cfgUseNewNpt) - continue; for (int i = 1; i <= fPtAxis->GetNbins(); i++) { auto dnx = fGFW->Calculate(corrconfigsV02.at(l_ind), i - 1, kTRUE).real(); if (dnx == 0) continue; auto val = fGFW->Calculate(corrconfigsV02.at(l_ind), i - 1, kFALSE).real() / dnx; - if (std::abs(val) < 1) - (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsV02.at(l_ind).Head.c_str(), i), centrality, val * ((cfgUseNewNpt) ? histosResoNpt[l_ind - 4]->GetBinContent(i) / histosNpt[CHARGEDID]->Integral() : fractions_resonances[l_ind - 4][i - 1]), dnx, lRandom) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsV02.at(l_ind).Head.c_str(), i), centrality, val * ((cfgUseNewNpt) ? histosResoNpt[l_ind - 4]->GetBinContent(i) / histosNpt[CHARGEDID]->Integral() : fractions_resonances[l_ind - 4][i - 1]), dnx, lRandom); + if (std::abs(val) < 1 && dns[l_ind - 4] > 0) + (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsV02.at(l_ind).Head.c_str(), i), centrality, val * histosResoNpt[l_ind - 4]->GetBinContent(i) / dns[l_ind - 4], dnx, lRandom) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsV02.at(l_ind).Head.c_str(), i), centrality, val * histosResoNpt[l_ind - 4]->GetBinContent(i) / dns[l_ind - 4], dnx, lRandom); } } @@ -1591,10 +1562,9 @@ struct FlowGenericFramework { return; for (uint l_ind = 4; l_ind < corrconfigsV0.size(); ++l_ind) { - if (histosNpt[CHARGEDID]->Integral() <= 0 && cfgUseNewNpt) - continue; for (int i = 1; i <= fPtAxis->GetNbins(); i++) { - (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsV0.at(l_ind).Head.c_str(), i), centrality, mpt * ((cfgUseNewNpt) ? histosResoNpt[l_ind - 4]->GetBinContent(i) / histosNpt[CHARGEDID]->Integral() : fractions_resonances[l_ind - 4][i - 1]), 1.0, lRandom) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsV0.at(l_ind).Head.c_str(), i), centrality, mpt * ((cfgUseNewNpt) ? histosResoNpt[l_ind - 4]->GetBinContent(i) / histosNpt[CHARGEDID]->Integral() : fractions_resonances[l_ind - 4][i - 1]), 1.0, lRandom); + if (dns[l_ind] > 0) + (dt == kGen) ? fFCgen->FillProfile(Form("%s_pt_%i", corrconfigsV0.at(l_ind).Head.c_str(), i), centrality, mpt * histosResoNpt[l_ind - 4]->GetBinContent(i) / dns[l_ind - 4], 1.0, lRandom) : fFC->FillProfile(Form("%s_pt_%i", corrconfigsV0.at(l_ind).Head.c_str(), i), centrality, mpt * histosResoNpt[l_ind - 4]->GetBinContent(i) / dns[l_ind - 4], 1.0, lRandom); } } } @@ -1642,28 +1612,14 @@ struct FlowGenericFramework { if (track.eta() > cfgEtaNch->first && track.eta() < cfgEtaNch->second) { double weff = getEfficiency(track, pidIndex); - if (pidIndex && weff > 0) - acceptedTracks.pidtotal[pidIndex - 1] += weff; - - int ptBinIndex = fPtAxis->FindBin(track.pt()) - 1; - if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { - if (weffCh > 0) { - acceptedTracks.nch[ptBinIndex] += (cfgUseNchCorrection) ? weffCh : 1.0; - histosNpt[CHARGEDID]->Fill(track.pt(), (cfgUseNchCorrection) ? weffCh : 1.0); - } - if (pidIndex == PIONID && weff > 0) { - acceptedTracks.npi[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; - histosNpt[PIONID]->Fill(track.pt(), (cfgUseNchCorrection) ? weff : 1.0); - } - if (pidIndex == KAONID && weff > 0) { - acceptedTracks.nka[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; - histosNpt[KAONID]->Fill(track.pt(), (cfgUseNchCorrection) ? weff : 1.0); - } - if (pidIndex == PROTONID && weff > 0) { - acceptedTracks.npr[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; - histosNpt[PROTONID]->Fill(track.pt(), (cfgUseNchCorrection) ? weff : 1.0); - } - } + if (weffCh > 0) + histosNpt[CHARGEDID]->Fill(track.pt(), (cfgUseNchCorrection) ? weffCh : 1.0); + if (pidIndex == PIONID && weff > 0) + histosNpt[PIONID]->Fill(track.pt(), (cfgUseNchCorrection) ? weff : 1.0); + if (pidIndex == KAONID && weff > 0) + histosNpt[KAONID]->Fill(track.pt(), (cfgUseNchCorrection) ? weff : 1.0); + if (pidIndex == PROTONID && weff > 0) + histosNpt[PROTONID]->Fill(track.pt(), (cfgUseNchCorrection) ? weff : 1.0); } if (cfgFillWeights) { @@ -1704,26 +1660,13 @@ struct FlowGenericFramework { ++acceptedTracks.total; ++acceptedTracks.totaluncorr; - if (pidIndex) - acceptedTracks.pidtotal[pidIndex - 1] += 1; - int ptBinIndex = fPtAxis->FindBin(track.pt()) - 1; - - if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { - acceptedTracks.nch[ptBinIndex] += 1.0; - histosNpt[CHARGEDID]->Fill(track.pt()); - if (pidIndex == PIONID) { - acceptedTracks.npi[ptBinIndex] += 1.0; - histosNpt[PIONID]->Fill(track.pt()); - } - if (pidIndex == KAONID) { - acceptedTracks.nka[ptBinIndex] += 1.0; - histosNpt[KAONID]->Fill(track.pt()); - } - if (pidIndex == PROTONID) { - acceptedTracks.npr[ptBinIndex] += 1.0; - histosNpt[PROTONID]->Fill(track.pt()); - } - } + histosNpt[CHARGEDID]->Fill(track.pt()); + if (pidIndex == PIONID) + histosNpt[PIONID]->Fill(track.pt()); + if (pidIndex == KAONID) + histosNpt[KAONID]->Fill(track.pt()); + if (pidIndex == PROTONID) + histosNpt[PROTONID]->Fill(track.pt()); } fillPtSums(track, vtxz); @@ -1753,29 +1696,15 @@ struct FlowGenericFramework { if (track.eta() > cfgEtaNch->first && track.eta() < cfgEtaNch->second) { double weff = getEfficiency(track, pidIndex); - if (pidIndex && weff > 0) - acceptedTracks.pidtotal[pidIndex - 1] += weff; - int ptBinIndex = fPtAxis->FindBin(track.pt()) - 1; - - if (!(ptBinIndex < 0 || ptBinIndex >= static_cast(o2::analysis::gfw::ptbinning.size()))) { - if (weffCh > 0) { - acceptedTracks.nch[ptBinIndex] += (cfgUseNchCorrection) ? weffCh : 1.0; - histosNpt[CHARGEDID]->Fill(track.pt(), (cfgUseNchCorrection) ? weffCh : 1.0); - } - if (pidIndex == PIONID && weff > 0) { - acceptedTracks.npi[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; - histosNpt[PIONID]->Fill(track.pt(), (cfgUseNchCorrection) ? weff : 1.0); - } - if (pidIndex == KAONID && weff > 0) { - acceptedTracks.nka[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; - histosNpt[KAONID]->Fill(track.pt(), (cfgUseNchCorrection) ? weff : 1.0); - } - if (pidIndex == PROTONID && weff > 0) { - acceptedTracks.npr[ptBinIndex] += (cfgUseNchCorrection) ? weff : 1.0; - histosNpt[PROTONID]->Fill(track.pt(), (cfgUseNchCorrection) ? weff : 1.0); - } - } + if (weffCh > 0) + histosNpt[CHARGEDID]->Fill(track.pt(), (cfgUseNchCorrection) ? weffCh : 1.0); + if (pidIndex == PIONID && weff > 0) + histosNpt[PIONID]->Fill(track.pt(), (cfgUseNchCorrection) ? weff : 1.0); + if (pidIndex == KAONID && weff > 0) + histosNpt[KAONID]->Fill(track.pt(), (cfgUseNchCorrection) ? weff : 1.0); + if (pidIndex == PROTONID && weff > 0) + histosNpt[PROTONID]->Fill(track.pt(), (cfgUseNchCorrection) ? weff : 1.0); } if (cfgFillWeights) { @@ -1823,7 +1752,7 @@ struct FlowGenericFramework { // Eta cuts on daughter particles to remove self-correlations with correlated observables if (track.eta() < cfgEtaV0Daughters->first || track.eta() > cfgEtaV0Daughters->second) return false; - registry.fill(HIST("trackQA/after/etaV0Daughters"), track.eta()); + registryQA.fill(HIST("trackQA/after/etaV0Daughters"), track.eta()); return true; } @@ -1836,55 +1765,66 @@ struct FlowGenericFramework { auto postrack = v0.template posTrack_as(); auto negtrack = v0.template negTrack_as(); - registry.fill(HIST("K0/hK0Count"), kFillCandidate); - if (postrack.pt() < resoCutVals[K0][kPosTrackPt] || negtrack.pt() < resoCutVals[K0][kNegTrackPt]) + registryQA.fill(HIST("K0/hK0Count"), kFillCandidate); + if (postrack.pt() < resoCutVals[kPosTrackPt][K0] || negtrack.pt() < resoCutVals[kNegTrackPt][K0]) return false; - registry.fill(HIST("K0/hK0Count"), kFillDaughterPt); - if (massK0s < resoCutVals[K0][kMassMin] && massK0s > resoCutVals[K0][kMassMax]) + registryQA.fill(HIST("K0/hK0Count"), kFillDaughterPt); + if (massK0s < resoCutVals[kMassMin][K0] && massK0s > resoCutVals[kMassMax][K0]) return false; - registry.fill(HIST("K0/hK0Count"), kFillMassCut); + registryQA.fill(HIST("K0/hK0Count"), kFillMassCut); // Rapidity correction - if (v0.yK0Short() > resoCutVals[K0][kRapidity]) + if (v0.yK0Short() > resoCutVals[kRapidity][K0]) return false; - registry.fill(HIST("K0/hK0Count"), kFillRapidityCut); + registryQA.fill(HIST("K0/hK0Count"), kFillRapidityCut); // DCA cuts for K0short - if (std::abs(v0.dcapostopv()) < resoCutVals[K0][kDCAPosToPVMin] || std::abs(v0.dcanegtopv()) < resoCutVals[K0][kDCANegToPVMin]) + if (std::abs(v0.dcapostopv()) < resoCutVals[kDCAPosToPVMin][K0] || std::abs(v0.dcanegtopv()) < resoCutVals[kDCANegToPVMin][K0]) return false; - registry.fill(HIST("K0/hK0Count"), kFillDCAtoPV); - if (std::abs(v0.dcaV0daughters()) > resoSwitchVals[K0][kDCABetDaug]) + registryQA.fill(HIST("K0/hK0Count"), kFillDCAtoPV); + if (std::abs(v0.dcaV0daughters()) > resoSwitchVals[kDCABetDaug][K0]) return false; - registry.fill(HIST("K0/hK0Count"), kFillDCAxDaughters); + registryQA.fill(HIST("K0/hK0Count"), kFillDCAxDaughters); // v0 radius cuts - if (resoSwitchVals[K0][kUseV0Radius] && (v0.v0radius() < resoCutVals[K0][kRadiusMin] || v0.v0radius() > resoCutVals[K0][kRadiusMax])) + if (resoSwitchVals[kUseV0Radius][K0] && (v0.v0radius() < resoCutVals[kRadiusMin][K0] || v0.v0radius() > resoCutVals[kRadiusMax][K0])) return false; - registry.fill(HIST("K0/hK0Count"), kFillV0Radius); + registryQA.fill(HIST("K0/hK0Count"), kFillV0Radius); // cosine pointing angle cuts - if (v0.v0cosPA() < resoCutVals[K0][kCosPA]) + if (v0.v0cosPA() < resoCutVals[kCosPA][K0]) return false; - registry.fill(HIST("K0/hK0Count"), kFillCosPA); + registryQA.fill(HIST("K0/hK0Count"), kFillCosPA); // Proper lifetime - if (resoSwitchVals[K0][kUseProperLifetime] && v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * massK0Short > resoCutVals[K0][kLifeTime]) + if (resoSwitchVals[kUseProperLifetime][K0] && v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * massK0Short > resoCutVals[kLifeTime][K0]) + return false; + registryQA.fill(HIST("K0/hK0Count"), kFillProperLifetime); + // ArmenterosPodolanskiCut + if (resoSwitchVals[kUseArmPodCut][K0] && (v0.qtarm() / std::abs(v0.alpha())) < resoCutVals[kArmPodMin][K0]) return false; - registry.fill(HIST("K0/hK0Count"), kFillProperLifetime); + registryQA.fill(HIST("K0/hK0Count"), kFillArmPodCut); + if (resoSwitchVals[kUseCompetingMassRejection][K0]) { + if (std::abs(v0.mLambda() - o2::constants::physics::MassLambda0) < resoCutVals[kMassRejection][K0]) + return false; + if (std::abs(v0.mAntiLambda() - o2::constants::physics::MassLambda0) < resoCutVals[kMassRejection][K0]) + return false; + } + registryQA.fill(HIST("K0/hK0Count"), kFillCompetingMass); if (!selectionV0Daughter(postrack, PIONS) || !selectionV0Daughter(negtrack, PIONS)) return false; - registry.fill(HIST("K0/hK0Count"), kFillDaughterTrackSelection); + registryQA.fill(HIST("K0/hK0Count"), kFillDaughterTrackSelection); - registry.fill(HIST("K0/hK0Mass_sparse"), massK0s, v0.pt(), centrality); - registry.fill(HIST("K0/hK0Phi"), v0.phi()); - registry.fill(HIST("K0/hK0Eta"), v0.eta()); - registry.fill(HIST("K0/PiPlusTPC_K0"), postrack.pt(), postrack.tpcNSigmaKa()); - registry.fill(HIST("K0/PiPlusTOF_K0"), postrack.pt(), postrack.tofNSigmaKa()); - registry.fill(HIST("K0/PiMinusTPC_K0"), negtrack.pt(), negtrack.tpcNSigmaKa()); - registry.fill(HIST("K0/PiMinusTOF_K0"), negtrack.pt(), negtrack.tofNSigmaKa()); + registryQA.fill(HIST("K0/hK0Mass_sparse"), massK0s, v0.pt(), centrality); + registryQA.fill(HIST("K0/hK0Phi"), v0.phi()); + registryQA.fill(HIST("K0/hK0Eta"), v0.eta()); + registryQA.fill(HIST("K0/PiPlusTPC_K0"), postrack.pt(), postrack.tpcNSigmaKa()); + registryQA.fill(HIST("K0/PiPlusTOF_K0"), postrack.pt(), postrack.tofNSigmaKa()); + registryQA.fill(HIST("K0/PiMinusTPC_K0"), negtrack.pt(), negtrack.tpcNSigmaKa()); + registryQA.fill(HIST("K0/PiMinusTOF_K0"), negtrack.pt(), negtrack.tofNSigmaKa()); - registry.fill(HIST("K0/hK0s"), 0.5, 1); + registryQA.fill(HIST("K0/hK0s"), 0.5, 1); if (cfgUsePIDEfficiencies) { double weffDaughter1 = getEfficiency(postrack, 1); double weffDaughter2 = getEfficiency(negtrack, 1); weff = weffDaughter1 * weffDaughter2; if (weff > 0) - registry.fill(HIST("K0/hK0s_corrected"), 0.5, weff); + registryQA.fill(HIST("K0/hK0s_corrected"), 0.5, weff); } return true; @@ -1903,50 +1843,59 @@ struct FlowGenericFramework { auto postrack = v0.template posTrack_as(); auto negtrack = v0.template negTrack_as(); - registry.fill(HIST("Lambda/hLambdaCount"), kFillCandidate); - if (postrack.pt() < resoCutVals[LAMBDA][kPosTrackPt] || negtrack.pt() < resoCutVals[LAMBDA][kNegTrackPt]) + registryQA.fill(HIST("Lambda/hLambdaCount"), kFillCandidate); + if (postrack.pt() < resoCutVals[kPosTrackPt][LAMBDA] || negtrack.pt() < resoCutVals[kNegTrackPt][LAMBDA]) return false; - registry.fill(HIST("Lambda/hLambdaCount"), kFillDaughterPt); - if (mlambda > resoCutVals[LAMBDA][kMassMin] && mlambda < resoCutVals[LAMBDA][kMassMax]) + registryQA.fill(HIST("Lambda/hLambdaCount"), kFillDaughterPt); + if (mlambda > resoCutVals[kMassMin][LAMBDA] && mlambda < resoCutVals[kMassMax][LAMBDA]) isL = true; - if (mantilambda > resoCutVals[LAMBDA][kMassMin] && mantilambda < resoCutVals[LAMBDA][kMassMax]) + if (mantilambda > resoCutVals[kMassMin][LAMBDA] && mantilambda < resoCutVals[kMassMax][LAMBDA]) isAL = true; if (!isL && !isAL) { return false; } - registry.fill(HIST("Lambda/hLambdaCount"), kFillMassCut); + registryQA.fill(HIST("Lambda/hLambdaCount"), kFillMassCut); // Rapidity correction - if (v0.yLambda() > resoCutVals[LAMBDA][kRapidity]) + if (v0.yLambda() > resoCutVals[kRapidity][LAMBDA]) return false; - registry.fill(HIST("Lambda/hLambdaCount"), kFillRapidityCut); + registryQA.fill(HIST("Lambda/hLambdaCount"), kFillRapidityCut); // DCA cuts for lambda and antilambda if (isL) { - if (std::abs(v0.dcapostopv()) < resoCutVals[LAMBDA][kDCAPosToPVMin] || std::abs(v0.dcanegtopv()) < resoCutVals[LAMBDA][kDCANegToPVMin]) + if (std::abs(v0.dcapostopv()) < resoCutVals[kDCAPosToPVMin][LAMBDA] || std::abs(v0.dcanegtopv()) < resoCutVals[kDCANegToPVMin][LAMBDA]) return false; } if (isAL) { - if (std::abs(v0.dcapostopv()) < resoCutVals[LAMBDA][kDCANegToPVMin] || std::abs(v0.dcanegtopv()) < resoCutVals[LAMBDA][kDCAPosToPVMin]) + if (std::abs(v0.dcapostopv()) < resoCutVals[kDCANegToPVMin][LAMBDA] || std::abs(v0.dcanegtopv()) < resoCutVals[kDCAPosToPVMin][LAMBDA]) return false; } - registry.fill(HIST("Lambda/hLambdaCount"), kFillDCAtoPV); - if (std::abs(v0.dcaV0daughters()) > resoSwitchVals[LAMBDA][kDCABetDaug]) + registryQA.fill(HIST("Lambda/hLambdaCount"), kFillDCAtoPV); + if (std::abs(v0.dcaV0daughters()) > resoSwitchVals[kDCABetDaug][LAMBDA]) return false; - registry.fill(HIST("Lambda/hLambdaCount"), kFillDCAxDaughters); + registryQA.fill(HIST("Lambda/hLambdaCount"), kFillDCAxDaughters); // v0 radius cuts - if (resoSwitchVals[LAMBDA][kUseV0Radius] && (v0.v0radius() < resoCutVals[LAMBDA][kRadiusMin] || v0.v0radius() > resoCutVals[LAMBDA][kRadiusMax])) + if (resoSwitchVals[kUseV0Radius][LAMBDA] && (v0.v0radius() < resoCutVals[kRadiusMin][LAMBDA] || v0.v0radius() > resoCutVals[kRadiusMax][LAMBDA])) return false; - registry.fill(HIST("Lambda/hLambdaCount"), kFillV0Radius); + registryQA.fill(HIST("Lambda/hLambdaCount"), kFillV0Radius); // cosine pointing angle cuts - if (v0.v0cosPA() < resoCutVals[LAMBDA][kCosPA]) + if (v0.v0cosPA() < resoCutVals[kCosPA][LAMBDA]) return false; - registry.fill(HIST("Lambda/hLambdaCount"), kFillCosPA); + registryQA.fill(HIST("Lambda/hLambdaCount"), kFillCosPA); // Proper lifetime - if (resoSwitchVals[LAMBDA][kUseProperLifetime] && v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * massLambda > resoCutVals[LAMBDA][kLifeTime]) + if (resoSwitchVals[kUseProperLifetime][LAMBDA] && v0.distovertotmom(collision.posX(), collision.posY(), collision.posZ()) * massLambda > resoCutVals[kLifeTime][LAMBDA]) + return false; + registryQA.fill(HIST("Lambda/hLambdaCount"), kFillProperLifetime); + // ArmenterosPodolanskiCut + if (resoSwitchVals[kUseArmPodCut][LAMBDA] && (v0.qtarm() / std::abs(v0.alpha())) < resoCutVals[kArmPodMin][LAMBDA]) return false; - registry.fill(HIST("Lambda/hLambdaCount"), kFillProperLifetime); + registryQA.fill(HIST("Lambda/hLambdaCount"), kFillArmPodCut); + if (resoSwitchVals[kUseCompetingMassRejection][LAMBDA]) { + if (std::abs(v0.mK0Short() - o2::constants::physics::MassK0Short) < resoCutVals[kMassRejection][LAMBDA]) + return false; + } + registryQA.fill(HIST("Lambda/hLambdaCount"), kFillCompetingMass); if (isL) { if (!selectionV0Daughter(postrack, PROTONS) || !selectionV0Daughter(negtrack, PIONS)) return false; @@ -1955,42 +1904,42 @@ struct FlowGenericFramework { if (!selectionV0Daughter(postrack, PIONS) || !selectionV0Daughter(negtrack, PROTONS)) return false; } - registry.fill(HIST("Lambda/hLambdaCount"), kFillDaughterTrackSelection); + registryQA.fill(HIST("Lambda/hLambdaCount"), kFillDaughterTrackSelection); if (isL) { - registry.fill(HIST("Lambda/hLambdaMass_sparse"), mlambda, v0.pt(), centrality); - registry.fill(HIST("Lambda/hLambdaPhi"), v0.phi()); - registry.fill(HIST("Lambda/hLambdaEta"), v0.eta()); - registry.fill(HIST("Lambda/PrPlusTPC_L"), postrack.pt(), postrack.tpcNSigmaKa()); - registry.fill(HIST("Lambda/PrPlusTOF_L"), postrack.pt(), postrack.tofNSigmaKa()); - registry.fill(HIST("Lambda/PiMinusTPC_L"), negtrack.pt(), negtrack.tpcNSigmaKa()); - registry.fill(HIST("Lambda/PiMinusTOF_L"), negtrack.pt(), negtrack.tofNSigmaKa()); - - registry.fill(HIST("Lambda/hLambdas"), 0.5, 1); + registryQA.fill(HIST("Lambda/hLambdaMass_sparse"), mlambda, v0.pt(), centrality); + registryQA.fill(HIST("Lambda/hLambdaPhi"), v0.phi()); + registryQA.fill(HIST("Lambda/hLambdaEta"), v0.eta()); + registryQA.fill(HIST("Lambda/PrPlusTPC_L"), postrack.pt(), postrack.tpcNSigmaKa()); + registryQA.fill(HIST("Lambda/PrPlusTOF_L"), postrack.pt(), postrack.tofNSigmaKa()); + registryQA.fill(HIST("Lambda/PiMinusTPC_L"), negtrack.pt(), negtrack.tpcNSigmaKa()); + registryQA.fill(HIST("Lambda/PiMinusTOF_L"), negtrack.pt(), negtrack.tofNSigmaKa()); + + registryQA.fill(HIST("Lambda/hLambdas"), 0.5, 1); if (cfgUsePIDEfficiencies) { double weffDaughter1 = getEfficiency(postrack, 3); double weffDaughter2 = getEfficiency(negtrack, 1); weff = weffDaughter1 * weffDaughter2; if (weff > 0) - registry.fill(HIST("Lambda/hLambdas_corrected"), 0.5, weff); + registryQA.fill(HIST("Lambda/hLambdas_corrected"), 0.5, weff); } } if (isAL) { - registry.fill(HIST("Lambda/hAntiLambdaMass_sparse"), mantilambda, v0.pt(), centrality); - registry.fill(HIST("Lambda/hAntiLambdaPhi"), v0.phi()); - registry.fill(HIST("Lambda/hAntiLambdaEta"), v0.eta()); - registry.fill(HIST("Lambda/PiPlusTPC_AL"), postrack.pt(), postrack.tpcNSigmaKa()); - registry.fill(HIST("Lambda/PiPlusTOF_AL"), postrack.pt(), postrack.tofNSigmaKa()); - registry.fill(HIST("Lambda/PrMinusTPC_AL"), negtrack.pt(), negtrack.tpcNSigmaKa()); - registry.fill(HIST("Lambda/PrMinusTOF_AL"), negtrack.pt(), negtrack.tofNSigmaKa()); - - registry.fill(HIST("Lambda/hLambdas"), 0.5, 1); + registryQA.fill(HIST("Lambda/hAntiLambdaMass_sparse"), mantilambda, v0.pt(), centrality); + registryQA.fill(HIST("Lambda/hAntiLambdaPhi"), v0.phi()); + registryQA.fill(HIST("Lambda/hAntiLambdaEta"), v0.eta()); + registryQA.fill(HIST("Lambda/PiPlusTPC_AL"), postrack.pt(), postrack.tpcNSigmaKa()); + registryQA.fill(HIST("Lambda/PiPlusTOF_AL"), postrack.pt(), postrack.tofNSigmaKa()); + registryQA.fill(HIST("Lambda/PrMinusTPC_AL"), negtrack.pt(), negtrack.tpcNSigmaKa()); + registryQA.fill(HIST("Lambda/PrMinusTOF_AL"), negtrack.pt(), negtrack.tofNSigmaKa()); + + registryQA.fill(HIST("Lambda/hLambdas"), 0.5, 1); if (cfgUsePIDEfficiencies) { double weffDaughter1 = getEfficiency(postrack, 1); double weffDaughter2 = getEfficiency(negtrack, 3); weff = weffDaughter1 * weffDaughter2; if (weff > 0) - registry.fill(HIST("Lambda/hLambdas_corrected"), 0.5, weff); + registryQA.fill(HIST("Lambda/hLambdas_corrected"), 0.5, weff); } } return true; @@ -2086,27 +2035,27 @@ struct FlowGenericFramework { inline void fillTrackQA(TTrack track, const float vtxz) { if constexpr (dt == kGen) { - registry.fill(HIST("MCGen/") + HIST(FillTimeName[ft]) + HIST("phi_eta_vtxZ_gen"), track.phi(), track.eta(), vtxz); - registry.fill(HIST("MCGen/") + HIST(FillTimeName[ft]) + HIST("pt_gen"), track.pt()); + registryQA.fill(HIST("MCGen/") + HIST(FillTimeName[ft]) + HIST("phi_eta_vtxZ_gen"), track.phi(), track.eta(), vtxz); + registryQA.fill(HIST("MCGen/") + HIST(FillTimeName[ft]) + HIST("pt_gen"), track.pt()); } else { double wacc = getAcceptance(track, vtxz, 0); - registry.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("phi_eta_vtxZ"), track.phi(), track.eta(), vtxz, (ft == kAfter) ? wacc : 1.0); - registry.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("pt_dcaXY_dcaZ"), track.pt(), track.dcaXY(), track.dcaZ()); + registryQA.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("phi_eta_vtxZ"), track.phi(), track.eta(), vtxz, (ft == kAfter) ? wacc : 1.0); + registryQA.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("pt_dcaXY_dcaZ"), track.pt(), track.dcaXY(), track.dcaZ()); - registry.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("chi2prTPCcls"), track.tpcChi2NCl()); - registry.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("chi2prITScls"), track.itsChi2NCl()); - registry.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("nTPCClusters"), track.tpcNClsFound()); - registry.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("nITSClusters"), track.itsNCls()); - registry.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("nTPCCrossedRows"), track.tpcNClsCrossedRows()); + registryQA.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("chi2prTPCcls"), track.tpcChi2NCl()); + registryQA.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("chi2prITScls"), track.itsChi2NCl()); + registryQA.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("nTPCClusters"), track.tpcNClsFound()); + registryQA.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("nITSClusters"), track.itsNCls()); + registryQA.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("nTPCCrossedRows"), track.tpcNClsCrossedRows()); if (ft == kAfter) { - registry.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("pt_ref"), track.pt()); - registry.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("pt_poi"), track.pt()); + registryQA.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("pt_ref"), track.pt()); + registryQA.fill(HIST("trackQA/") + HIST(FillTimeName[ft]) + HIST("pt_poi"), track.pt()); if (track.eta() > cfgEtaNch->first && track.eta() < cfgEtaNch->second) - registry.fill(HIST("trackQA/after/etaNch"), track.eta()); + registryQA.fill(HIST("trackQA/after/etaNch"), track.eta()); if (track.eta() > cfgEtaPtPt->first && track.eta() < cfgEtaPtPt->second) - registry.fill(HIST("trackQA/after/etaPtPt"), track.eta()); + registryQA.fill(HIST("trackQA/after/etaPtPt"), track.eta()); } } } @@ -2137,13 +2086,13 @@ struct FlowGenericFramework { template inline void fillEventQA(CollisionObject collision, TracksObject tracks) { - registry.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("globalTracks_centT0C"), collision.centFT0C(), tracks.size()); - registry.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("PVTracks_centT0C"), collision.centFT0C(), collision.multNTracksPV()); - registry.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("globalTracks_PVTracks"), collision.multNTracksPV(), tracks.size()); - registry.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("globalTracks_multT0A"), collision.multFT0A(), tracks.size()); - registry.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("globalTracks_multV0A"), collision.multFV0A(), tracks.size()); - registry.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("multV0A_multT0A"), collision.multFT0A(), collision.multFV0A()); - registry.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("multT0C_centT0C"), collision.centFT0C(), collision.multFT0C()); + registryQA.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("globalTracks_centT0C"), collision.centFT0C(), tracks.size()); + registryQA.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("PVTracks_centT0C"), collision.centFT0C(), collision.multNTracksPV()); + registryQA.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("globalTracks_PVTracks"), collision.multNTracksPV(), tracks.size()); + registryQA.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("globalTracks_multT0A"), collision.multFT0A(), tracks.size()); + registryQA.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("globalTracks_multV0A"), collision.multFV0A(), tracks.size()); + registryQA.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("multV0A_multT0A"), collision.multFT0A(), collision.multFV0A()); + registryQA.fill(HIST("eventQA/") + HIST(FillTimeName[ft]) + HIST("multT0C_centT0C"), collision.centFT0C(), collision.multFT0C()); return; } @@ -2183,41 +2132,36 @@ struct FlowGenericFramework { } if (!cfgFillWeights && !cfgRunByRun) loadCorrections(bc); - - registry.fill(HIST("eventQA/eventSel"), 0.5); + registryQA.fill(HIST("eventQA/eventSel"), 0.5); if (cfgRunByRun) th1sList[run][hEventSel]->Fill(0.5); - if (!collision.sel8()) return; - - registry.fill(HIST("eventQA/eventSel"), 1.5); + registryQA.fill(HIST("eventQA/eventSel"), 1.5); if (cfgRunByRun) th1sList[run][hEventSel]->Fill(1.5); float centrality = getCentrality(collision); - if (cfgDoOccupancySel) { int occupancy = collision.trackOccupancyInTimeRange(); - registry.fill(HIST("eventQA/before/occ_mult_cent"), occupancy, tracks.size(), centrality); + registryQA.fill(HIST("eventQA/before/occ_mult_cent"), occupancy, tracks.size(), centrality); if (occupancy < 0 || occupancy > cfgOccupancySelection) return; - registry.fill(HIST("eventQA/after/occ_mult_cent"), occupancy, tracks.size(), centrality); + registryQA.fill(HIST("eventQA/after/occ_mult_cent"), occupancy, tracks.size(), centrality); } - registry.fill(HIST("eventQA/eventSel"), 2.5); + registryQA.fill(HIST("eventQA/eventSel"), 2.5); if (cfgRunByRun) th1sList[run][hEventSel]->Fill(2.5); if (cfgFillQA) fillEventQA(collision, tracks); - registry.fill(HIST("eventQA/before/centrality"), centrality); - registry.fill(HIST("eventQA/before/multiplicity"), tracks.size()); + registryQA.fill(HIST("eventQA/before/centrality"), centrality); + registryQA.fill(HIST("eventQA/before/multiplicity"), tracks.size()); if (!eventSelected(collision, tracks.size(), centrality, run)) return; if (cfgFillQA) fillEventQA(collision, tracks); - registry.fill(HIST("eventQA/after/centrality"), centrality); - registry.fill(HIST("eventQA/after/multiplicity"), tracks.size()); - + registryQA.fill(HIST("eventQA/after/centrality"), centrality); + registryQA.fill(HIST("eventQA/after/multiplicity"), tracks.size()); // Get magnetic field polarity auto field = (cfgMagField == 99999) ? getMagneticField(bc.timestamp()) : cfgMagField; // o2-linter: disable=magic-number (hard coded default cut) @@ -2235,14 +2179,14 @@ struct FlowGenericFramework { createRunByRunHistograms(run); } - registry.fill(HIST("eventQA/eventSel"), 0.5); + registryQA.fill(HIST("eventQA/eventSel"), 0.5); if (cfgRunByRun) th1sList[run][hEventSel]->Fill(0.5); if (!collision.sel8()) return; - registry.fill(HIST("eventQA/eventSel"), 1.5); + registryQA.fill(HIST("eventQA/eventSel"), 1.5); if (cfgRunByRun) th1sList[run][hEventSel]->Fill(1.5); @@ -2250,12 +2194,12 @@ struct FlowGenericFramework { if (cfgDoOccupancySel) { int occupancy = collision.trackOccupancyInTimeRange(); - registry.fill(HIST("eventQA/before/occ_mult_cent"), occupancy, tracks.size(), centrality); + registryQA.fill(HIST("eventQA/before/occ_mult_cent"), occupancy, tracks.size(), centrality); if (occupancy < 0 || occupancy > cfgOccupancySelection) return; - registry.fill(HIST("eventQA/after/occ_mult_cent"), occupancy, tracks.size(), centrality); + registryQA.fill(HIST("eventQA/after/occ_mult_cent"), occupancy, tracks.size(), centrality); } - registry.fill(HIST("eventQA/eventSel"), 2.5); + registryQA.fill(HIST("eventQA/eventSel"), 2.5); if (cfgRunByRun) th1sList[run][hEventSel]->Fill(2.5); @@ -2291,7 +2235,7 @@ struct FlowGenericFramework { void processOnTheFly(soa::Filtered::iterator const& mcCollision, aod::McParticles const& mcParticles, aod::V0Datas const& v0s) { int run = 0; - registry.fill(HIST("MCGen/impactParameter"), mcCollision.impactParameter(), mcParticles.size()); + registryQA.fill(HIST("MCGen/impactParameter"), mcCollision.impactParameter(), mcParticles.size()); processCollision(mcCollision, mcParticles, v0s, mcCollision.impactParameter(), -999, run); } PROCESS_SWITCH(FlowGenericFramework, processOnTheFly, "Process analysis for MC on-the-fly generated events", false);