From 2837b08a89b40d76226b7ea8e431476605cc6993 Mon Sep 17 00:00:00 2001 From: nepeivodaRS Date: Thu, 2 Nov 2023 14:26:10 +0100 Subject: [PATCH 1/8] StrangenessTutorialUpdate Update of the Strangeness Tutorial --- .../PWGLF/Strangeness/strangeness_step0.cxx | 45 +++- .../PWGLF/Strangeness/strangeness_step1.cxx | 71 ++++-- .../PWGLF/Strangeness/strangeness_step2.cxx | 84 ++++--- .../PWGLF/Strangeness/strangeness_step3.cxx | 139 +++++++---- .../PWGLF/Strangeness/strangeness_step4.cxx | 226 ++++++++++++++---- 5 files changed, 401 insertions(+), 164 deletions(-) diff --git a/Tutorials/PWGLF/Strangeness/strangeness_step0.cxx b/Tutorials/PWGLF/Strangeness/strangeness_step0.cxx index e4b52bb8e58..d66e2e94591 100644 --- a/Tutorials/PWGLF/Strangeness/strangeness_step0.cxx +++ b/Tutorials/PWGLF/Strangeness/strangeness_step0.cxx @@ -10,8 +10,8 @@ // or submit itself to any jurisdiction. /// /// \brief this is a starting point for the Strangeness tutorial -/// \author -/// \since 12/05/2023 +/// \author Nepeivoda Roman (roman.nepeivoda@cern.ch) +/// \author Chiara De Martin (chiara.de.martin@cern.ch) #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -24,30 +24,51 @@ using namespace o2::framework::expressions; // STEP 0 // Starting point: loop over all V0s and fill invariant mass histogram + struct strangeness_tutorial { + // Histograms are defined with HistogramRegistry + HistogramRegistry rEventSelection{"eventSelection", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry rKzeroShort{"kzeroShort", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - // Configurable for number of bins + // Configurable for histograms Configurable nBins{"nBins", 100, "N bins in all histos"}; - // histogram defined with HistogramRegistry - HistogramRegistry registry{"registry", - {{"hVertexZ", "hVertexZ", {HistType::kTH1F, {{nBins, -15., 15.}}}}, - {"hMassK0Short", "hMassK0Short", {HistType::kTH1F, {{200, 0.45f, 0.55f}}}}}}; + // Configurable for event selection + Configurable cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"}; + + void init(InitContext const&) + { + // Axes + AxisSpec K0ShortMassAxis = {200, 0.45f, 0.55f, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; + AxisSpec vertexZAxis = {nBins, -15., 15., "vrtx_{Z} [cm]"}; + + // Histograms + // Event selection + rEventSelection.add("hVertexZRec", "hVertexZRec", {HistType::kTH1F, {vertexZAxis}}); + + // K0s reconstruction + rKzeroShort.add("hMassK0Short", "hMassK0Short", {HistType::kTH1F, {K0ShortMassAxis}}); + } // Defining filters for events (event selection) - // Processed events will be already fulfulling the event selection requirements + // Processed events will be already fulfilling the event selection requirements Filter eventFilter = (o2::aod::evsel::sel8 == true); + Filter posZFilter = (nabs(o2::aod::collision::posZ) < cutzvertex); void process(soa::Filtered>::iterator const& collision, aod::V0Datas const& V0s) { // Fill the event counter - registry.fill(HIST("hVertexZ"), collision.posZ()); + rEventSelection.fill(HIST("hVertexZRec"), collision.posZ()); - for (auto& v0 : V0s) { - registry.fill(HIST("hMassK0Short"), v0.mK0Short()); + for (const auto& v0 : V0s) { + rKzeroShort.fill(HIST("hMassK0Short"), v0.mK0Short()); } } }; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} diff --git a/Tutorials/PWGLF/Strangeness/strangeness_step1.cxx b/Tutorials/PWGLF/Strangeness/strangeness_step1.cxx index eaf4dc436ee..f56e54a3547 100644 --- a/Tutorials/PWGLF/Strangeness/strangeness_step1.cxx +++ b/Tutorials/PWGLF/Strangeness/strangeness_step1.cxx @@ -9,11 +9,9 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. /// -/// \brief this is a starting point for the Strangeness tutorial -/// \author -/// \since 12/05/2023 -/// \file strangeness_step1.cxx -/// +/// \brief Step1 of the Strangeness tutorial +/// \author Nepeivoda Roman (roman.nepeivoda@cern.ch) +/// \author Chiara De Martin (chiara.de.martin@cern.ch) #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -28,53 +26,80 @@ using namespace o2::framework::expressions; // Starting point: loop over all V0s and fill invariant mass histogram // STEP 1 // Apply selections on topological variables of V0s + struct strangeness_tutorial { + // Histograms are defined with HistogramRegistry + HistogramRegistry rEventSelection{"eventSelection", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry rKzeroShort{"kzeroShort", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - // Configurable for number of bins + // Configurable for histograms Configurable nBins{"nBins", 100, "N bins in all histos"}; - // Configurables parameters for V0 selection + // Configurable for event selection + Configurable cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"}; + + // Configurable parameters for V0 selection Configurable v0setting_dcav0dau{"v0setting_dcav0dau", 1, "DCA V0 Daughters"}; Configurable v0setting_dcapostopv{"v0setting_dcapostopv", 0.06, "DCA Pos To PV"}; Configurable v0setting_dcanegtopv{"v0setting_dcanegtopv", 0.06, "DCA Neg To PV"}; Configurable v0setting_cospa{"v0setting_cospa", 0.98, "V0 CosPA"}; // double -> N.B. dcos(x)/dx = 0 at x=0 Configurable v0setting_radius{"v0setting_radius", 0.5, "v0radius"}; - // histogram defined with HistogramRegistry - HistogramRegistry registry{"registry", - {{"hVertexZ", "hVertexZ", {HistType::kTH1F, {{nBins, -15., 15.}}}}, - {"hMassK0Short", "hMassK0Short", {HistType::kTH1F, {{200, 0.45f, 0.55f}}}}, - {"hMassK0ShortSelected", "hMassK0ShortSelected", {HistType::kTH1F, {{200, 0.45f, 0.55f}}}}, - {"hDCAV0Daughters", "hDCAV0Daughters", {HistType::kTH1F, {{55, 0.0f, 2.2f}}}}, - {"hV0CosPA", "hV0CosPA", {HistType::kTH1F, {{100, 0.95f, 1.f}}}}}}; + void init(InitContext const&) + { + // Axes + AxisSpec K0ShortMassAxis = {200, 0.45f, 0.55f, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; + AxisSpec vertexZAxis = {nBins, -15., 15., "vrtx_{Z} [cm]"}; + + // Histograms + // Event selection + rEventSelection.add("hVertexZRec", "hVertexZRec", {HistType::kTH1F, {vertexZAxis}}); + + // K0s reconstruction + // Mass + rKzeroShort.add("hMassK0Short", "hMassK0Short", {HistType::kTH1F, {K0ShortMassAxis}}); + rKzeroShort.add("hMassK0ShortSelected", "hMassK0ShortSelected", {HistType::kTH1F, {K0ShortMassAxis}}); + + // K0s topological/PID cuts + rKzeroShort.add("hDCAV0Daughters", "hDCAV0Daughters", {HistType::kTH1F, {{55, 0.0f, 2.2f}}}); + rKzeroShort.add("hV0CosPA", "hV0CosPA", {HistType::kTH1F, {{100, 0.95f, 1.f}}}); + } // Defining filters for events (event selection) - // Processed events will be already fulfulling the event selection requirements + // Processed events will be already fulfilling the event selection requirements Filter eventFilter = (o2::aod::evsel::sel8 == true); + Filter posZFilter = (nabs(o2::aod::collision::posZ) < cutzvertex); // Filters on V0s // Cannot filter on dynamic columns, so we cut on DCA to PV and DCA between daughters only - Filter preFilterV0 = nabs(aod::v0data::dcapostopv) > v0setting_dcapostopv&& nabs(aod::v0data::dcanegtopv) > v0setting_dcanegtopv&& aod::v0data::dcaV0daughters < v0setting_dcav0dau; + Filter preFilterV0 = (nabs(aod::v0data::dcapostopv) > v0setting_dcapostopv && + nabs(aod::v0data::dcanegtopv) > v0setting_dcanegtopv && + aod::v0data::dcaV0daughters < v0setting_dcav0dau); void process(soa::Filtered>::iterator const& collision, soa::Filtered const& V0s) { // Fill the event counter - registry.fill(HIST("hVertexZ"), collision.posZ()); + rEventSelection.fill(HIST("hVertexZRec"), collision.posZ()); - for (auto& v0 : V0s) { - registry.fill(HIST("hMassK0Short"), v0.mK0Short()); + for (const auto& v0 : V0s) { + rKzeroShort.fill(HIST("hMassK0Short"), v0.mK0Short()); + // Cut on dynamic columns if (v0.v0cosPA(collision.posX(), collision.posY(), collision.posZ()) < v0setting_cospa) continue; if (v0.v0radius() < v0setting_radius) continue; - registry.fill(HIST("hMassK0ShortSelected"), v0.mK0Short()); - registry.fill(HIST("hDCAV0Daughters"), v0.dcaV0daughters()); - registry.fill(HIST("hV0CosPA"), v0.v0cosPA(collision.posX(), collision.posY(), collision.posZ())); + rKzeroShort.fill(HIST("hMassK0ShortSelected"), v0.mK0Short()); + rKzeroShort.fill(HIST("hDCAV0Daughters"), v0.dcaV0daughters()); + rKzeroShort.fill(HIST("hV0CosPA"), v0.v0cosPA(collision.posX(), collision.posY(), collision.posZ())); } } }; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} diff --git a/Tutorials/PWGLF/Strangeness/strangeness_step2.cxx b/Tutorials/PWGLF/Strangeness/strangeness_step2.cxx index 9972d8289d7..685a712dbcd 100644 --- a/Tutorials/PWGLF/Strangeness/strangeness_step2.cxx +++ b/Tutorials/PWGLF/Strangeness/strangeness_step2.cxx @@ -9,11 +9,9 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. /// -/// \brief this is a starting point for the Strangeness tutorial -/// \author -/// \since 12/05/2023 -/// \file strangeness_step2.cxx -/// +/// \brief Step2 of the Strangeness tutorial +/// \author Nepeivoda Roman (roman.nepeivoda@cern.ch) +/// \author Chiara De Martin (chiara.de.martin@cern.ch) #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -33,37 +31,59 @@ using namespace o2::framework::expressions; // Apply PID selections on V0 daughter tracks struct strangeness_tutorial { + // Histograms are defined with HistogramRegistry + HistogramRegistry rEventSelection{"eventSelection", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry rKzeroShort{"kzeroShort", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - // Configurable for number of bins + // Configurable for histograms Configurable nBins{"nBins", 100, "N bins in all histos"}; - // Configurables parameters for V0 selection + // Configurable for event selection + Configurable cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"}; + + // Configurable parameters for V0 selection Configurable v0setting_dcav0dau{"v0setting_dcav0dau", 1, "DCA V0 Daughters"}; Configurable v0setting_dcapostopv{"v0setting_dcapostopv", 0.06, "DCA Pos To PV"}; Configurable v0setting_dcanegtopv{"v0setting_dcanegtopv", 0.06, "DCA Neg To PV"}; Configurable v0setting_cospa{"v0setting_cospa", 0.98, "V0 CosPA"}; // double -> N.B. dcos(x)/dx = 0 at x=0 Configurable v0setting_radius{"v0setting_radius", 0.5, "v0radius"}; - Configurable NSigmaTPCPion{"NSigmaTPCPion", 4, "NSigmaTPCPion"}; - AxisSpec ptAxis = {100, 0.0f, 10.0f, "#it{p}_{T} (GeV/#it{c})"}; // Definition of axis + // Configurable parameters for PID selection + Configurable NSigmaTPCPion{"NSigmaTPCPion", 4, "NSigmaTPCPion"}; - // histogram defined with HistogramRegistry - HistogramRegistry registry{"registry", - {{"hVertexZ", "hVertexZ", {HistType::kTH1F, {{nBins, -15., 15.}}}}, - {"hMassK0Short", "hMassK0Short", {HistType::kTH1F, {{200, 0.45f, 0.55f}}}}, - {"hMassK0ShortSelected", "hMassK0ShortSelected", {HistType::kTH1F, {{200, 0.45f, 0.55f}}}}, - {"hDCAV0Daughters", "hDCAV0Daughters", {HistType::kTH1F, {{55, 0.0f, 2.2f}}}}, - {"hV0CosPA", "hV0CosPA", {HistType::kTH1F, {{100, 0.95f, 1.f}}}}, - {"hNSigmaPosPionFromK0s", "hNSigmaPosPionFromK0s", {HistType::kTH2F, {{100, -5.f, 5.f}, {ptAxis}}}}, - {"hNSigmaNegPionFromK0s", "hNSigmaNegPionFromK0s", {HistType::kTH2F, {{100, -5.f, 5.f}, {ptAxis}}}}}}; + void init(InitContext const&) + { + // Axes + AxisSpec K0ShortMassAxis = {200, 0.45f, 0.55f, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; + AxisSpec vertexZAxis = {nBins, -15., 15., "vrtx_{Z} [cm]"}; + AxisSpec ptAxis = {100, 0.0f, 10.0f, "#it{p}_{T} (GeV/#it{c})"}; + + // Histograms + // Event selection + rEventSelection.add("hVertexZRec", "hVertexZRec", {HistType::kTH1F, {vertexZAxis}}); + + // K0s reconstruction + // Mass + rKzeroShort.add("hMassK0Short", "hMassK0Short", {HistType::kTH1F, {K0ShortMassAxis}}); + rKzeroShort.add("hMassK0ShortSelected", "hMassK0ShortSelected", {HistType::kTH1F, {K0ShortMassAxis}}); + + // K0s topological/PID cuts + rKzeroShort.add("hDCAV0Daughters", "hDCAV0Daughters", {HistType::kTH1F, {{55, 0.0f, 2.2f}}}); + rKzeroShort.add("hV0CosPA", "hV0CosPA", {HistType::kTH1F, {{100, 0.95f, 1.f}}}); + rKzeroShort.add("hNSigmaPosPionFromK0s", "hNSigmaPosPionFromK0s", {HistType::kTH2F, {{100, -5.f, 5.f}, {ptAxis}}}); + rKzeroShort.add("hNSigmaNegPionFromK0s", "hNSigmaNegPionFromK0s", {HistType::kTH2F, {{100, -5.f, 5.f}, {ptAxis}}}); + } // Defining filters for events (event selection) - // Processed events will be already fulfulling the event selection requirements + // Processed events will be already fulfilling the event selection requirements Filter eventFilter = (o2::aod::evsel::sel8 == true); + Filter posZFilter = (nabs(o2::aod::collision::posZ) < cutzvertex); // Filters on V0s // Cannot filter on dynamic columns, so we cut on DCA to PV and DCA between daughters only - Filter preFilterV0 = nabs(aod::v0data::dcapostopv) > v0setting_dcapostopv&& nabs(aod::v0data::dcanegtopv) > v0setting_dcanegtopv&& aod::v0data::dcaV0daughters < v0setting_dcav0dau; + Filter preFilterV0 = (nabs(aod::v0data::dcapostopv) > v0setting_dcapostopv && + nabs(aod::v0data::dcanegtopv) > v0setting_dcanegtopv && + aod::v0data::dcaV0daughters < v0setting_dcav0dau); // Defining the type of the daughter tracks using DaughterTracks = soa::Join; @@ -73,19 +93,21 @@ struct strangeness_tutorial { DaughterTracks const&) { // Fill the event counter - registry.fill(HIST("hVertexZ"), collision.posZ()); + rEventSelection.fill(HIST("hVertexZRec"), collision.posZ()); for (const auto& v0 : V0s) { const auto& posDaughterTrack = v0.posTrack_as(); const auto& negDaughterTrack = v0.negTrack_as(); - registry.fill(HIST("hMassK0Short"), v0.mK0Short()); + rKzeroShort.fill(HIST("hMassK0Short"), v0.mK0Short()); + // Cut on dynamic columns if (v0.v0cosPA(collision.posX(), collision.posY(), collision.posZ()) < v0setting_cospa) continue; if (v0.v0radius() < v0setting_radius) continue; + if (TMath::Abs(posDaughterTrack.tpcNSigmaPi()) > NSigmaTPCPion) { continue; } @@ -93,17 +115,21 @@ struct strangeness_tutorial { continue; } - registry.fill(HIST("hMassK0ShortSelected"), v0.mK0Short()); - registry.fill(HIST("hDCAV0Daughters"), v0.dcaV0daughters()); - registry.fill(HIST("hV0CosPA"), v0.v0cosPA(collision.posX(), collision.posY(), collision.posZ())); + rKzeroShort.fill(HIST("hMassK0ShortSelected"), v0.mK0Short()); + rKzeroShort.fill(HIST("hDCAV0Daughters"), v0.dcaV0daughters()); + rKzeroShort.fill(HIST("hV0CosPA"), v0.v0cosPA(collision.posX(), collision.posY(), collision.posZ())); // Filling the PID of the V0 daughters in the region of the K0 peak - if (0.45 > v0.mK0Short() && v0.mK0Short() < 0.55) { - registry.fill(HIST("hNSigmaPosPionFromK0s"), posDaughterTrack.tpcNSigmaPi(), posDaughterTrack.tpcInnerParam()); - registry.fill(HIST("hNSigmaNegPionFromK0s"), negDaughterTrack.tpcNSigmaPi(), negDaughterTrack.tpcInnerParam()); + if (0.45 < v0.mK0Short() && v0.mK0Short() < 0.55) { + rKzeroShort.fill(HIST("hNSigmaPosPionFromK0s"), posDaughterTrack.tpcNSigmaPi(), posDaughterTrack.tpcInnerParam()); + rKzeroShort.fill(HIST("hNSigmaNegPionFromK0s"), negDaughterTrack.tpcNSigmaPi(), negDaughterTrack.tpcInnerParam()); } } } }; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} diff --git a/Tutorials/PWGLF/Strangeness/strangeness_step3.cxx b/Tutorials/PWGLF/Strangeness/strangeness_step3.cxx index 4e63f63da40..90ee6374f13 100644 --- a/Tutorials/PWGLF/Strangeness/strangeness_step3.cxx +++ b/Tutorials/PWGLF/Strangeness/strangeness_step3.cxx @@ -9,11 +9,9 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. /// -/// \brief this is a starting point for the Strangeness tutorial -/// \author -/// \since 12/05/2023 -/// \file strangeness_step3.cxx -/// +/// \brief Step3 of the Strangeness tutorial +/// \author Nepeivoda Roman (roman.nepeivoda@cern.ch) +/// \author Chiara De Martin (chiara.de.martin@cern.ch) #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" @@ -32,66 +30,98 @@ using namespace o2::framework::expressions; // STEP 2 // Apply PID selections on V0 daughter tracks // STEP 3 -// Check the MC information of the V0s and verify with the PID information of daughter tracks +// Check the MC information of the V0s struct strangeness_tutorial { + // Histograms are defined with HistogramRegistry + HistogramRegistry rEventSelection{"eventSelection", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry rKzeroShort{"kzeroShort", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry rGenParticles{"genParticles", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - // Configurable for number of bins + // Configurable for histograms Configurable nBins{"nBins", 100, "N bins in all histos"}; - // Configurables parameters for V0 selection + // Configurable for event selection + Configurable cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"}; + + // Configurable parameters for V0 selection Configurable v0setting_dcav0dau{"v0setting_dcav0dau", 1, "DCA V0 Daughters"}; Configurable v0setting_dcapostopv{"v0setting_dcapostopv", 0.06, "DCA Pos To PV"}; Configurable v0setting_dcanegtopv{"v0setting_dcanegtopv", 0.06, "DCA Neg To PV"}; Configurable v0setting_cospa{"v0setting_cospa", 0.98, "V0 CosPA"}; // double -> N.B. dcos(x)/dx = 0 at x=0 Configurable v0setting_radius{"v0setting_radius", 0.5, "v0radius"}; + + // Configurable parameters for PID selection Configurable NSigmaTPCPion{"NSigmaTPCPion", 4, "NSigmaTPCPion"}; - AxisSpec ptAxis = {100, 0.0f, 10.0f, "#it{p}_{T} (GeV/#it{c})"}; // Definition of axis - - // histogram defined with HistogramRegistry - HistogramRegistry registry{"registry", - {{"hVertexZ", "hVertexZ", {HistType::kTH1F, {{nBins, -15., 15.}}}}, - {"hMassK0Short", "hMassK0Short", {HistType::kTH1F, {{200, 0.45f, 0.55f}}}}, - {"hMassK0ShortSelected", "hMassK0ShortSelected", {HistType::kTH1F, {{200, 0.45f, 0.55f}}}}, - {"hDCAV0Daughters", "hDCAV0Daughters", {HistType::kTH1F, {{55, 0.0f, 2.2f}}}}, - {"hV0CosPA", "hV0CosPA", {HistType::kTH1F, {{100, 0.95f, 1.f}}}}, - {"hNSigmaPosPionFromK0s", "hNSigmaPosPionFromK0s", {HistType::kTH2F, {{100, -5.f, 5.f}, {ptAxis}}}}, - {"hNSigmaNegPionFromK0s", "hNSigmaNegPionFromK0s", {HistType::kTH2F, {{100, -5.f, 5.f}, {ptAxis}}}}, - {"hMassK0ShortTruePions", "hMassK0ShortTruePions", {HistType::kTH1F, {{200, 0.45f, 0.55f}}}}, - {"hMassK0ShortMCTrue", "hMassK0ShortMCTrue", {HistType::kTH1F, {{200, 0.45f, 0.55f}}}}, - {"hPtK0ShortTrue", "hPtK0ShortTrue", {HistType::kTH1F, {{ptAxis}}}}}}; + void init(InitContext const&) + { + // Axes + AxisSpec K0ShortMassAxis = {200, 0.45f, 0.55f, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; + AxisSpec vertexZAxis = {nBins, -15., 15., "vrtx_{Z} [cm]"}; + AxisSpec ptAxis = {100, 0.0f, 10.0f, "#it{p}_{T} (GeV/#it{c})"}; + + // Histograms + // Event selection + rEventSelection.add("hVertexZRec", "hVertexZRec", {HistType::kTH1F, {vertexZAxis}}); + + // K0s reconstruction + // Mass + rKzeroShort.add("hMassK0Short", "hMassK0Short", {HistType::kTH1F, {K0ShortMassAxis}}); + rKzeroShort.add("hMassK0ShortSelected", "hMassK0ShortSelected", {HistType::kTH1F, {K0ShortMassAxis}}); + rKzeroShort.add("hMassK0ShortSelectedTruePions", "hMassK0ShortSelectedTruePions", {HistType::kTH1F, {{200, 0.45f, 0.55f}}}); + rKzeroShort.add("hMassK0ShortTrueRec", "hMassK0ShortTrueRec", {HistType::kTH1F, {{200, 0.45f, 0.55f}}}); + // Pt + rKzeroShort.add("hPtK0ShortSelected", "hPtK0ShortSelected", {HistType::kTH1F, {{ptAxis}}}); + rKzeroShort.add("hPtK0ShortTrueRec", "hPtK0ShortTrueRec", {HistType::kTH1F, {{ptAxis}}}); + + // K0s topological/PID cuts + rKzeroShort.add("hDCAV0Daughters", "hDCAV0Daughters", {HistType::kTH1F, {{55, 0.0f, 2.2f}}}); + rKzeroShort.add("hV0CosPA", "hV0CosPA", {HistType::kTH1F, {{100, 0.95f, 1.f}}}); + rKzeroShort.add("hNSigmaPosPionFromK0s", "hNSigmaPosPionFromK0s", {HistType::kTH2F, {{100, -5.f, 5.f}, {ptAxis}}}); + rKzeroShort.add("hNSigmaNegPionFromK0s", "hNSigmaNegPionFromK0s", {HistType::kTH2F, {{100, -5.f, 5.f}, {ptAxis}}}); + + // Generated level histograms + rEventSelection.add("hVertexZGen", "hVertexZGen", {HistType::kTH1F, {vertexZAxis}}); + rGenParticles.add("hPtK0ShortGen", "hPtK0ShortGen", {HistType::kTH1F, {{ptAxis}}}); + } // Defining filters for events (event selection) - // Processed events will be already fulfulling the event selection requirements + // Processed events will be already fulfilling the event selection requirements Filter eventFilter = (o2::aod::evsel::sel8 == true); + Filter posZFilter = (nabs(o2::aod::collision::posZ) < cutzvertex); + Filter posZFilterMC = (nabs(o2::aod::mccollision::posZ) < cutzvertex); // Filters on V0s - // Cannot filter on dynamic columns, so we cut on DCA to PV and DCA between daughters only - Filter preFilterV0 = nabs(aod::v0data::dcapostopv) > v0setting_dcapostopv&& nabs(aod::v0data::dcanegtopv) > v0setting_dcanegtopv&& aod::v0data::dcaV0daughters < v0setting_dcav0dau; + // Cannot filter on dynamic columns + Filter preFilterV0 = (nabs(aod::v0data::dcapostopv) > v0setting_dcapostopv && + nabs(aod::v0data::dcanegtopv) > v0setting_dcanegtopv && + aod::v0data::dcaV0daughters < v0setting_dcav0dau); // Defining the type of the daughter tracks using DaughterTracks = soa::Join; - void process(soa::Filtered>::iterator const& collision, - soa::Filtered> const& V0s, - DaughterTracks const&, // no need to define a variable for tracks, if we don't access them directly - aod::McParticles const& mcParticles) + void processRecMC(soa::Filtered>::iterator const& collision, + soa::Filtered> const& V0s, + DaughterTracks const&, // no need to define a variable for tracks, if we don't access them directly + aod::McParticles const&) { // Fill the event counter - registry.fill(HIST("hVertexZ"), collision.posZ()); - - for (auto& v0 : V0s) { + rEventSelection.fill(HIST("hVertexZRec"), collision.posZ()); + // V0s + for (const auto& v0 : V0s) { const auto& posDaughterTrack = v0.posTrack_as(); const auto& negDaughterTrack = v0.negTrack_as(); - registry.fill(HIST("hMassK0Short"), v0.mK0Short()); + rKzeroShort.fill(HIST("hMassK0Short"), v0.mK0Short()); + // Cut on dynamic columns if (v0.v0cosPA(collision.posX(), collision.posY(), collision.posZ()) < v0setting_cospa) continue; if (v0.v0radius() < v0setting_radius) continue; + if (TMath::Abs(posDaughterTrack.tpcNSigmaPi()) > NSigmaTPCPion) { continue; } @@ -99,39 +129,54 @@ struct strangeness_tutorial { continue; } - registry.fill(HIST("hMassK0ShortSelected"), v0.mK0Short()); - registry.fill(HIST("hDCAV0Daughters"), v0.dcaV0daughters()); - registry.fill(HIST("hV0CosPA"), v0.v0cosPA(collision.posX(), collision.posY(), collision.posZ())); + rKzeroShort.fill(HIST("hMassK0ShortSelected"), v0.mK0Short()); + rKzeroShort.fill(HIST("hPtK0ShortSelected"), v0.pt()); + + rKzeroShort.fill(HIST("hDCAV0Daughters"), v0.dcaV0daughters()); + rKzeroShort.fill(HIST("hV0CosPA"), v0.v0cosPA(collision.posX(), collision.posY(), collision.posZ())); // Filling the PID of the V0 daughters in the region of the K0 peak - if (0.45 > v0.mK0Short() && v0.mK0Short() < 0.55) { - registry.fill(HIST("hNSigmaPosPionFromK0s"), posDaughterTrack.tpcNSigmaPi(), posDaughterTrack.tpcInnerParam()); - registry.fill(HIST("hNSigmaNegPionFromK0s"), negDaughterTrack.tpcNSigmaPi(), negDaughterTrack.tpcInnerParam()); + if (0.45 < v0.mK0Short() && v0.mK0Short() < 0.55) { + rKzeroShort.fill(HIST("hNSigmaPosPionFromK0s"), posDaughterTrack.tpcNSigmaPi(), posDaughterTrack.tpcInnerParam()); + rKzeroShort.fill(HIST("hNSigmaNegPionFromK0s"), negDaughterTrack.tpcNSigmaPi(), negDaughterTrack.tpcInnerParam()); } if (posDaughterTrack.has_mcParticle() && negDaughterTrack.has_mcParticle()) { // Checking that the daughter tracks come from particles and are not fake auto posParticle = posDaughterTrack.mcParticle(); auto negParticle = negDaughterTrack.mcParticle(); if (posParticle.pdgCode() == 211 && negParticle.pdgCode() == -211) { // Checking that the daughter tracks are true pions - registry.fill(HIST("hMassK0ShortTruePions"), v0.mK0Short()); + rKzeroShort.fill(HIST("hMassK0ShortSelectedTruePions"), v0.mK0Short()); } } - // Checking that the V0 is a true K0s in the MC + // Checking that the V0 is a true K0s if (v0.has_mcParticle()) { - auto v0mcparticle = v0.mcParticle(); - if (v0mcparticle.pdgCode() == 310) { - registry.fill(HIST("hMassK0ShortMCTrue"), v0.mK0Short()); - } + auto v0mcParticle = v0.mcParticle(); + if (v0mcParticle.pdgCode() == 310) { + rKzeroShort.fill(HIST("hMassK0ShortTrueRec"), v0.mK0Short()); + rKzeroShort.fill(HIST("hPtK0ShortTrueRec"), v0.pt()); // To mimic distribution after the signal extraction + } } } + } + void processGenMC(soa::Filtered::iterator const& mcCollision, + aod::McParticles const& mcParticles) + { + rEventSelection.fill(HIST("hVertexZGen"), mcCollision.posZ()); for (const auto& mcParticle : mcParticles) { if (mcParticle.pdgCode() == 310) { - registry.fill(HIST("hPtK0ShortTrue"), mcParticle.pt()); + rGenParticles.fill(HIST("hPtK0ShortGen"), mcParticle.pt()); } } } + + PROCESS_SWITCH(strangeness_tutorial, processRecMC, "Process Run 3 mc, reconstructed", true); + PROCESS_SWITCH(strangeness_tutorial, processGenMC, "Process Run 3 mc, generated", true); }; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} diff --git a/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx b/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx index 1f0d5e692e9..95fde7c53cb 100644 --- a/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx +++ b/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx @@ -9,17 +9,16 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. /// -/// \brief this is a starting point for the Strangeness tutorial -/// \author -/// \since 12/05/2023 -/// \file strangeness_step4.cxx -/// +/// \brief Step4 of the Strangeness tutorial +/// \author Nepeivoda Roman (roman.nepeivoda@cern.ch) +/// \author Chiara De Martin (chiara.de.martin@cern.ch) #include "Framework/runDataProcessing.h" #include "Framework/AnalysisTask.h" #include "Common/DataModel/EventSelection.h" #include "PWGLF/DataModel/LFStrangenessTables.h" #include "Common/DataModel/PIDResponse.h" +#include "Framework/O2DatabasePDGPlugin.h" using namespace o2; using namespace o2::framework; @@ -31,73 +30,138 @@ using namespace o2::framework::expressions; // Apply selections on topological variables of V0s // STEP 2 // Apply PID selections on V0 daughter tracks -// STEP Cascades +// STEP 3 +// Check the MC information of the V0s +// STEP 4 // Apply selections on topological variables of Cascades struct strangeness_tutorial { + // Histograms are defined with HistogramRegistry + HistogramRegistry rEventSelection{"eventSelection", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry rKzeroShort{"kzeroShort", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry rXi{"xi", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; + HistogramRegistry rGenParticles{"genParticles", {}, OutputObjHandlingPolicy::AnalysisObject, true, true}; - // Configurable for number of bins + // Configurable for histograms Configurable nBins{"nBins", 100, "N bins in all histos"}; - // Configurables parameters for V0 selection + // Configurable for event selection + Configurable cutzvertex{"cutzvertex", 10.0f, "Accepted z-vertex range (cm)"}; + + // Configurable parameters for V0 selection Configurable v0setting_dcav0dau{"v0setting_dcav0dau", 1, "DCA V0 Daughters"}; Configurable v0setting_dcapostopv{"v0setting_dcapostopv", 0.06, "DCA Pos To PV"}; Configurable v0setting_dcanegtopv{"v0setting_dcanegtopv", 0.06, "DCA Neg To PV"}; Configurable v0setting_cospa{"v0setting_cospa", 0.98, "V0 CosPA"}; // double -> N.B. dcos(x)/dx = 0 at x=0 Configurable v0setting_radius{"v0setting_radius", 0.5, "v0radius"}; + + // Configurable parameters for cascade selection Configurable cascadesetting_cospa{"cascadesetting_cospa", 0.98, "Casc CosPA"}; // double -> N.B. dcos(x)/dx = 0 at x=0 + Configurable cascadesetting_dcacascdau{"cascadesetting_dcacascdau", 1.0, "DCA cascade daughters"}; + Configurable cascadesetting_dcabachtopv{"cascadesetting_dcabachtopv", 0.1, "DCA bachelor to PV"}; + Configurable cascadesetting_mindcav0topv{"cascadesetting_mindcav0topv", 0.01, "minimum V0 DCA to PV"}; Configurable cascadesetting_cascradius{"cascadesetting_cascradius", 0.5, "cascradius"}; + Configurable cascadesetting_v0masswindow{"cascadesetting_v0masswindow", 0.01, "v0 mass window"}; + + Configurable cascade_dcanegtopv{"dcanegtopv", 0.06, "DCA Neg To PV"}; + Configurable cascade_dcapostopv{"dcapostopv", 0.06, "DCA Pos To PV"}; + + // Configurable parameters for PID selection Configurable NSigmaTPCPion{"NSigmaTPCPion", 4, "NSigmaTPCPion"}; Configurable NSigmaTPCProton{"NSigmaTPCProton", 4, "NSigmaTPCProton"}; - AxisSpec ptAxis = {100, 0.0f, 10.0f, "#it{p}_{T} (GeV/#it{c})"}; // Definition of axis - - // histogram defined with HistogramRegistry - HistogramRegistry registry{"registry", - { - {"hVertexZ", "hVertexZ", {HistType::kTH1F, {{nBins, -15., 15.}}}}, - {"hMassK0Short", "hMassK0Short", {HistType::kTH1F, {{200, 0.45f, 0.55f}}}}, - {"hMassK0ShortSelected", "hMassK0ShortSelected", {HistType::kTH1F, {{200, 0.45f, 0.55f}}}}, - {"hDCAV0Daughters", "hDCAV0Daughters", {HistType::kTH1F, {{55, 0.0f, 2.2f}}}}, - {"hV0CosPA", "hV0CosPA", {HistType::kTH1F, {{100, 0.95f, 1.f}}}}, - {"hNSigmaPosPionFromK0s", "hNSigmaPosPionFromK0s", {HistType::kTH2F, {{100, -5.f, 5.f}, {ptAxis}}}}, - {"hNSigmaNegPionFromK0s", "hNSigmaNegPionFromK0s", {HistType::kTH2F, {{100, -5.f, 5.f}, {ptAxis}}}}, - {"hMassXi", "hMassXi", {HistType::kTH1F, {{200, 1.28f, 1.36f}}}}, - {"hMassXiSelected", "hMassXiSelected", {HistType::kTH1F, {{200, 1.28f, 1.36f}}}}, - {"hCascCosPA", "hCascCosPA", {HistType::kTH1F, {{100, 0.95f, 1.f}}}}, - {"hCascDCAV0Daughters", "hCascDCAV0Daughters", {HistType::kTH1F, {{55, 0.0f, 2.2f}}}}, - }}; + // PDG data base + Service pdgDB; + + void init(InitContext const&) + { + // Axes + AxisSpec K0ShortMassAxis = {200, 0.45f, 0.55f, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; + AxisSpec vertexZAxis = {nBins, -15., 15., "vrtx_{Z} [cm]"}; + AxisSpec ptAxis = {100, 0.0f, 10.0f, "#it{p}_{T} (GeV/#it{c})"}; + + // Histograms + // Event selection + rEventSelection.add("hVertexZRec", "hVertexZRec", {HistType::kTH1F, {vertexZAxis}}); + + // K0s reconstruction + // Mass + rKzeroShort.add("hMassK0Short", "hMassK0Short", {HistType::kTH1F, {K0ShortMassAxis}}); + rKzeroShort.add("hMassK0ShortSelected", "hMassK0ShortSelected", {HistType::kTH1F, {K0ShortMassAxis}}); + rKzeroShort.add("hMassK0ShortSelectedTruePions", "hMassK0ShortSelectedTruePions", {HistType::kTH1F, {{200, 0.45f, 0.55f}}}); + rKzeroShort.add("hMassK0ShortTrueRec", "hMassK0ShortTrueRec", {HistType::kTH1F, {{200, 0.45f, 0.55f}}}); + // Pt + rKzeroShort.add("hPtK0ShortSelected", "hPtK0ShortSelected", {HistType::kTH1F, {{ptAxis}}}); + rKzeroShort.add("hPtK0ShortTrueRec", "hPtK0ShortTrueRec", {HistType::kTH1F, {{ptAxis}}}); + + // Xi reconstruction + rXi.add("hMassXi", "hMassXi", {HistType::kTH1F, {{200, 1.28f, 1.36f}}}); + rXi.add("hMassXiSelected", "hMassXiSelected", {HistType::kTH1F, {{200, 1.28f, 1.36f}}}); + rXi.add("hMassXiTrueRec", "hMassXiTrueRec", {HistType::kTH1F, {{200, 1.28f, 1.36f}}}); + + // K0s topological/PID cuts + rKzeroShort.add("hDCAV0Daughters", "hDCAV0Daughters", {HistType::kTH1F, {{55, 0.0f, 2.2f}}}); + rKzeroShort.add("hV0CosPA", "hV0CosPA", {HistType::kTH1F, {{100, 0.95f, 1.f}}}); + rKzeroShort.add("hNSigmaPosPionFromK0s", "hNSigmaPosPionFromK0s", {HistType::kTH2F, {{100, -5.f, 5.f}, {ptAxis}}}); + rKzeroShort.add("hNSigmaNegPionFromK0s", "hNSigmaNegPionFromK0s", {HistType::kTH2F, {{100, -5.f, 5.f}, {ptAxis}}}); + + // Xi topological cuts + rXi.add("hCascDCAV0Daughters", "hCascDCAV0Daughters", {HistType::kTH1F, {{55, 0.0f, 2.2f}}}); + rXi.add("hCascCosPA", "hCascCosPA", {HistType::kTH1F, {{100, 0.95f, 1.f}}}); + + // Generated level histograms + rEventSelection.add("hVertexZGen", "hVertexZGen", {HistType::kTH1F, {vertexZAxis}}); + rGenParticles.add("hPtK0ShortGen", "hPtK0ShortGen", {HistType::kTH1F, {{ptAxis}}}); + rGenParticles.add("hPtXiGen", "hPtXiGen", {HistType::kTH1F, {{ptAxis}}}); + } // Defining filters for events (event selection) - // Processed events will be already fulfulling the event selection requirements + // Processed events will be already fulfilling the event selection requirements Filter eventFilter = (o2::aod::evsel::sel8 == true); + Filter posZFilter = (nabs(o2::aod::collision::posZ) < cutzvertex); + Filter posZFilterMC = (nabs(o2::aod::mccollision::posZ) < cutzvertex); // Filters on V0s - // Cannot filter on dynamic columns, so we cut on DCA to PV and DCA between daughters only - Filter preFilterV0 = nabs(aod::v0data::dcapostopv) > v0setting_dcapostopv&& nabs(aod::v0data::dcanegtopv) > v0setting_dcanegtopv&& aod::v0data::dcaV0daughters < v0setting_dcav0dau; + // Cannot filter on dynamic columns + Filter preFilterV0 = (nabs(aod::v0data::dcapostopv) > v0setting_dcapostopv && + nabs(aod::v0data::dcanegtopv) > v0setting_dcanegtopv && + aod::v0data::dcaV0daughters < v0setting_dcav0dau); + + // Filters on Cascades + Filter preFilterCascades = (nabs(aod::cascdata::dcabachtopv) > cascadesetting_dcabachtopv && + aod::cascdata::dcaV0daughters < v0setting_dcav0dau && + nabs(aod::cascdata::dcapostopv) > cascade_dcapostopv && + nabs(aod::cascdata::dcanegtopv) > cascade_dcanegtopv && + nabs(aod::cascdata::dcabachtopv) > cascadesetting_dcabachtopv && + aod::cascdata::dcacascdaughters < cascadesetting_dcacascdau); // Defining the type of the daughter tracks - using DaughterTracks = soa::Join; + using DaughterTracks = soa::Join; - void process(soa::Filtered>::iterator const& collision, - soa::Filtered const& V0s, - aod::CascDataExt const& Cascades, aod::V0sLinked const&, - DaughterTracks const&) + void processRecMC(soa::Filtered>::iterator const& collision, + soa::Filtered> const& Cascades, + soa::Filtered> const& V0s, + aod::V0Datas const&, // it's needed to access the full info of V0s related to cascades + aod::V0sLinked const&, + DaughterTracks const&, + aod::McParticles const&) { // Fill the event counter - registry.fill(HIST("hVertexZ"), collision.posZ()); + rEventSelection.fill(HIST("hVertexZRec"), collision.posZ()); + // V0s for (const auto& v0 : V0s) { - const auto& posDaughterTrack = v0.posTrack_as(); const auto& negDaughterTrack = v0.negTrack_as(); - registry.fill(HIST("hMassK0Short"), v0.mK0Short()); + rKzeroShort.fill(HIST("hMassK0Short"), v0.mK0Short()); + // Cut on dynamic columns if (v0.v0cosPA(collision.posX(), collision.posY(), collision.posZ()) < v0setting_cospa) continue; if (v0.v0radius() < v0setting_radius) continue; + if (TMath::Abs(posDaughterTrack.tpcNSigmaPi()) > NSigmaTPCPion) { continue; } @@ -105,34 +169,60 @@ struct strangeness_tutorial { continue; } - registry.fill(HIST("hMassK0ShortSelected"), v0.mK0Short()); - registry.fill(HIST("hDCAV0Daughters"), v0.dcaV0daughters()); - registry.fill(HIST("hV0CosPA"), v0.v0cosPA(collision.posX(), collision.posY(), collision.posZ())); + rKzeroShort.fill(HIST("hMassK0ShortSelected"), v0.mK0Short()); + rKzeroShort.fill(HIST("hPtK0ShortSelected"), v0.pt()); + + rKzeroShort.fill(HIST("hDCAV0Daughters"), v0.dcaV0daughters()); + rKzeroShort.fill(HIST("hV0CosPA"), v0.v0cosPA(collision.posX(), collision.posY(), collision.posZ())); // Filling the PID of the V0 daughters in the region of the K0 peak - if (0.45 > v0.mK0Short() && v0.mK0Short() < 0.55) { - registry.fill(HIST("hNSigmaPosPionFromK0s"), posDaughterTrack.tpcNSigmaPi(), posDaughterTrack.tpcInnerParam()); - registry.fill(HIST("hNSigmaNegPionFromK0s"), negDaughterTrack.tpcNSigmaPi(), negDaughterTrack.tpcInnerParam()); + if (0.45 < v0.mK0Short() && v0.mK0Short() < 0.55) { + rKzeroShort.fill(HIST("hNSigmaPosPionFromK0s"), posDaughterTrack.tpcNSigmaPi(), posDaughterTrack.tpcInnerParam()); + rKzeroShort.fill(HIST("hNSigmaNegPionFromK0s"), negDaughterTrack.tpcNSigmaPi(), negDaughterTrack.tpcInnerParam()); + } + + if (posDaughterTrack.has_mcParticle() && negDaughterTrack.has_mcParticle()) { // Checking that the daughter tracks come from particles and are not fake + auto posParticle = posDaughterTrack.mcParticle(); + auto negParticle = negDaughterTrack.mcParticle(); + if (posParticle.pdgCode() == 211 && negParticle.pdgCode() == -211) { // Checking that the daughter tracks are true pions + rKzeroShort.fill(HIST("hMassK0ShortSelectedTruePions"), v0.mK0Short()); + } + } + + // Checking that the V0 is a true K0s + if (v0.has_mcParticle()) { + auto v0mcParticle = v0.mcParticle(); + if (v0mcParticle.pdgCode() == 310) { + rKzeroShort.fill(HIST("hMassK0ShortTrueRec"), v0.mK0Short()); + rKzeroShort.fill(HIST("hPtK0ShortTrueRec"), v0.pt()); // To mimic distribution after the signal extraction + } } } + // Cascades for (const auto& casc : Cascades) { - - auto v0index = casc.v0_as(); + const auto& v0index = casc.v0_as(); if (!(v0index.has_v0Data())) { continue; // skip those cascades for which V0 doesn't exist } - auto v0Casc = v0index.v0Data(); // de-reference index to correct v0data in case it exists - auto bachDaughterTrackCasc = casc.bachelor_as(); - auto posDaughterTrackCasc = v0Casc.posTrack_as(); - auto negDaughterTrackCasc = v0Casc.negTrack_as(); - registry.fill(HIST("hMassXi"), casc.mXi()); + const auto& v0Casc = v0index.v0Data(); // de-reference index to correct v0data in case it exists + const auto& bachDaughterTrackCasc = casc.bachelor_as(); + const auto& posDaughterTrackCasc = v0Casc.posTrack_as(); + const auto& negDaughterTrackCasc = v0Casc.negTrack_as(); + rXi.fill(HIST("hMassXi"), casc.mXi()); + + // Cut on dynamic columns if (casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()) < cascadesetting_cospa) continue; + if(TMath::Abs(casc.mLambda() - pdgDB->Mass(3122)) > cascadesetting_v0masswindow) + continue; + if(casc.dcav0topv(collision.posX(), collision.posY(), collision.posZ()) < cascadesetting_mindcav0topv) + continue; if (casc.cascradius() < cascadesetting_cascradius) continue; + if (casc.sign() < 0) { if (TMath::Abs(posDaughterTrackCasc.tpcNSigmaPr()) > NSigmaTPCProton) { continue; @@ -152,11 +242,41 @@ struct strangeness_tutorial { continue; } - registry.fill(HIST("hMassXiSelected"), casc.mXi()); - registry.fill(HIST("hCascDCAV0Daughters"), casc.dcaV0daughters()); - registry.fill(HIST("hCascCosPA"), casc.casccosPA(collision.posX(), collision.posY(), collision.posZ())); + rXi.fill(HIST("hMassXiSelected"), casc.mXi()); + rXi.fill(HIST("hCascDCAV0Daughters"), casc.dcaV0daughters()); + rXi.fill(HIST("hCascCosPA"), casc.casccosPA(collision.posX(), collision.posY(), collision.posZ())); + + // Checking that the cascade is a true Xi + if (casc.has_mcParticle()) { + const auto cascmcParticle = casc.mcParticle(); + if (TMath::Abs(cascmcParticle.pdgCode()) == 3312) { + rXi.fill(HIST("hMassXiTrueRec"), casc.mXi()); + } + } } } + + void processGenMC(soa::Filtered::iterator const& mcCollision, + aod::McParticles const& mcParticles) + { + rEventSelection.fill(HIST("hVertexZGen"), mcCollision.posZ()); + for (const auto& mcParticle : mcParticles) { + if (mcParticle.pdgCode() == 310) { + rGenParticles.fill(HIST("hPtK0ShortGen"), mcParticle.pt()); + } + if (TMath::Abs(mcParticle.pdgCode()) == 3312) { + rGenParticles.fill(HIST("hPtXiGen"), mcParticle.pt()); + } + } + } + + PROCESS_SWITCH(strangeness_tutorial, processRecMC, "Process Run 3 mc, reconstructed", true); + PROCESS_SWITCH(strangeness_tutorial, processGenMC, "Process Run 3 mc, generated", true); + }; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) { return WorkflowSpec{adaptAnalysisTask(cfgc)}; } +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ + return WorkflowSpec{ + adaptAnalysisTask(cfgc)}; +} From 89f6887e837b1e2d855ea8ee75b260936429013d Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Thu, 2 Nov 2023 13:35:14 +0000 Subject: [PATCH 2/8] Please consider the following formatting changes --- .../PWGLF/Strangeness/strangeness_step0.cxx | 6 ++--- .../PWGLF/Strangeness/strangeness_step1.cxx | 12 +++++----- .../PWGLF/Strangeness/strangeness_step2.cxx | 12 +++++----- .../PWGLF/Strangeness/strangeness_step3.cxx | 16 ++++++------- .../PWGLF/Strangeness/strangeness_step4.cxx | 23 +++++++++---------- 5 files changed, 34 insertions(+), 35 deletions(-) diff --git a/Tutorials/PWGLF/Strangeness/strangeness_step0.cxx b/Tutorials/PWGLF/Strangeness/strangeness_step0.cxx index d66e2e94591..a14b0a5aa3f 100644 --- a/Tutorials/PWGLF/Strangeness/strangeness_step0.cxx +++ b/Tutorials/PWGLF/Strangeness/strangeness_step0.cxx @@ -67,8 +67,8 @@ struct strangeness_tutorial { } }; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc)}; } diff --git a/Tutorials/PWGLF/Strangeness/strangeness_step1.cxx b/Tutorials/PWGLF/Strangeness/strangeness_step1.cxx index f56e54a3547..4c388e36768 100644 --- a/Tutorials/PWGLF/Strangeness/strangeness_step1.cxx +++ b/Tutorials/PWGLF/Strangeness/strangeness_step1.cxx @@ -56,7 +56,7 @@ struct strangeness_tutorial { rEventSelection.add("hVertexZRec", "hVertexZRec", {HistType::kTH1F, {vertexZAxis}}); // K0s reconstruction - // Mass + // Mass rKzeroShort.add("hMassK0Short", "hMassK0Short", {HistType::kTH1F, {K0ShortMassAxis}}); rKzeroShort.add("hMassK0ShortSelected", "hMassK0ShortSelected", {HistType::kTH1F, {K0ShortMassAxis}}); @@ -72,8 +72,8 @@ struct strangeness_tutorial { // Filters on V0s // Cannot filter on dynamic columns, so we cut on DCA to PV and DCA between daughters only - Filter preFilterV0 = (nabs(aod::v0data::dcapostopv) > v0setting_dcapostopv && - nabs(aod::v0data::dcanegtopv) > v0setting_dcanegtopv && + Filter preFilterV0 = (nabs(aod::v0data::dcapostopv) > v0setting_dcapostopv && + nabs(aod::v0data::dcanegtopv) > v0setting_dcanegtopv && aod::v0data::dcaV0daughters < v0setting_dcav0dau); void process(soa::Filtered>::iterator const& collision, @@ -98,8 +98,8 @@ struct strangeness_tutorial { } }; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc)}; } diff --git a/Tutorials/PWGLF/Strangeness/strangeness_step2.cxx b/Tutorials/PWGLF/Strangeness/strangeness_step2.cxx index 685a712dbcd..2aaf6a3a04c 100644 --- a/Tutorials/PWGLF/Strangeness/strangeness_step2.cxx +++ b/Tutorials/PWGLF/Strangeness/strangeness_step2.cxx @@ -63,7 +63,7 @@ struct strangeness_tutorial { rEventSelection.add("hVertexZRec", "hVertexZRec", {HistType::kTH1F, {vertexZAxis}}); // K0s reconstruction - // Mass + // Mass rKzeroShort.add("hMassK0Short", "hMassK0Short", {HistType::kTH1F, {K0ShortMassAxis}}); rKzeroShort.add("hMassK0ShortSelected", "hMassK0ShortSelected", {HistType::kTH1F, {K0ShortMassAxis}}); @@ -81,8 +81,8 @@ struct strangeness_tutorial { // Filters on V0s // Cannot filter on dynamic columns, so we cut on DCA to PV and DCA between daughters only - Filter preFilterV0 = (nabs(aod::v0data::dcapostopv) > v0setting_dcapostopv && - nabs(aod::v0data::dcanegtopv) > v0setting_dcanegtopv && + Filter preFilterV0 = (nabs(aod::v0data::dcapostopv) > v0setting_dcapostopv && + nabs(aod::v0data::dcanegtopv) > v0setting_dcanegtopv && aod::v0data::dcaV0daughters < v0setting_dcav0dau); // Defining the type of the daughter tracks @@ -128,8 +128,8 @@ struct strangeness_tutorial { } }; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc)}; } diff --git a/Tutorials/PWGLF/Strangeness/strangeness_step3.cxx b/Tutorials/PWGLF/Strangeness/strangeness_step3.cxx index 90ee6374f13..b0fca259f35 100644 --- a/Tutorials/PWGLF/Strangeness/strangeness_step3.cxx +++ b/Tutorials/PWGLF/Strangeness/strangeness_step3.cxx @@ -66,12 +66,12 @@ struct strangeness_tutorial { rEventSelection.add("hVertexZRec", "hVertexZRec", {HistType::kTH1F, {vertexZAxis}}); // K0s reconstruction - // Mass + // Mass rKzeroShort.add("hMassK0Short", "hMassK0Short", {HistType::kTH1F, {K0ShortMassAxis}}); rKzeroShort.add("hMassK0ShortSelected", "hMassK0ShortSelected", {HistType::kTH1F, {K0ShortMassAxis}}); rKzeroShort.add("hMassK0ShortSelectedTruePions", "hMassK0ShortSelectedTruePions", {HistType::kTH1F, {{200, 0.45f, 0.55f}}}); rKzeroShort.add("hMassK0ShortTrueRec", "hMassK0ShortTrueRec", {HistType::kTH1F, {{200, 0.45f, 0.55f}}}); - // Pt + // Pt rKzeroShort.add("hPtK0ShortSelected", "hPtK0ShortSelected", {HistType::kTH1F, {{ptAxis}}}); rKzeroShort.add("hPtK0ShortTrueRec", "hPtK0ShortTrueRec", {HistType::kTH1F, {{ptAxis}}}); @@ -94,8 +94,8 @@ struct strangeness_tutorial { // Filters on V0s // Cannot filter on dynamic columns - Filter preFilterV0 = (nabs(aod::v0data::dcapostopv) > v0setting_dcapostopv && - nabs(aod::v0data::dcanegtopv) > v0setting_dcanegtopv && + Filter preFilterV0 = (nabs(aod::v0data::dcapostopv) > v0setting_dcapostopv && + nabs(aod::v0data::dcanegtopv) > v0setting_dcanegtopv && aod::v0data::dcaV0daughters < v0setting_dcav0dau); // Defining the type of the daughter tracks @@ -155,7 +155,7 @@ struct strangeness_tutorial { if (v0mcParticle.pdgCode() == 310) { rKzeroShort.fill(HIST("hMassK0ShortTrueRec"), v0.mK0Short()); rKzeroShort.fill(HIST("hPtK0ShortTrueRec"), v0.pt()); // To mimic distribution after the signal extraction - } + } } } } @@ -175,8 +175,8 @@ struct strangeness_tutorial { PROCESS_SWITCH(strangeness_tutorial, processGenMC, "Process Run 3 mc, generated", true); }; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc)}; } diff --git a/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx b/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx index 95fde7c53cb..36abb27dde8 100644 --- a/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx +++ b/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx @@ -85,12 +85,12 @@ struct strangeness_tutorial { rEventSelection.add("hVertexZRec", "hVertexZRec", {HistType::kTH1F, {vertexZAxis}}); // K0s reconstruction - // Mass + // Mass rKzeroShort.add("hMassK0Short", "hMassK0Short", {HistType::kTH1F, {K0ShortMassAxis}}); rKzeroShort.add("hMassK0ShortSelected", "hMassK0ShortSelected", {HistType::kTH1F, {K0ShortMassAxis}}); rKzeroShort.add("hMassK0ShortSelectedTruePions", "hMassK0ShortSelectedTruePions", {HistType::kTH1F, {{200, 0.45f, 0.55f}}}); rKzeroShort.add("hMassK0ShortTrueRec", "hMassK0ShortTrueRec", {HistType::kTH1F, {{200, 0.45f, 0.55f}}}); - // Pt + // Pt rKzeroShort.add("hPtK0ShortSelected", "hPtK0ShortSelected", {HistType::kTH1F, {{ptAxis}}}); rKzeroShort.add("hPtK0ShortTrueRec", "hPtK0ShortTrueRec", {HistType::kTH1F, {{ptAxis}}}); @@ -123,8 +123,8 @@ struct strangeness_tutorial { // Filters on V0s // Cannot filter on dynamic columns - Filter preFilterV0 = (nabs(aod::v0data::dcapostopv) > v0setting_dcapostopv && - nabs(aod::v0data::dcanegtopv) > v0setting_dcanegtopv && + Filter preFilterV0 = (nabs(aod::v0data::dcapostopv) > v0setting_dcapostopv && + nabs(aod::v0data::dcanegtopv) > v0setting_dcanegtopv && aod::v0data::dcaV0daughters < v0setting_dcav0dau); // Filters on Cascades @@ -132,7 +132,7 @@ struct strangeness_tutorial { aod::cascdata::dcaV0daughters < v0setting_dcav0dau && nabs(aod::cascdata::dcapostopv) > cascade_dcapostopv && nabs(aod::cascdata::dcanegtopv) > cascade_dcanegtopv && - nabs(aod::cascdata::dcabachtopv) > cascadesetting_dcabachtopv && + nabs(aod::cascdata::dcabachtopv) > cascadesetting_dcabachtopv && aod::cascdata::dcacascdaughters < cascadesetting_dcacascdau); // Defining the type of the daughter tracks @@ -216,9 +216,9 @@ struct strangeness_tutorial { // Cut on dynamic columns if (casc.casccosPA(collision.posX(), collision.posY(), collision.posZ()) < cascadesetting_cospa) continue; - if(TMath::Abs(casc.mLambda() - pdgDB->Mass(3122)) > cascadesetting_v0masswindow) + if (TMath::Abs(casc.mLambda() - pdgDB->Mass(3122)) > cascadesetting_v0masswindow) continue; - if(casc.dcav0topv(collision.posX(), collision.posY(), collision.posZ()) < cascadesetting_mindcav0topv) + if (casc.dcav0topv(collision.posX(), collision.posY(), collision.posZ()) < cascadesetting_mindcav0topv) continue; if (casc.cascradius() < cascadesetting_cascradius) continue; @@ -251,7 +251,7 @@ struct strangeness_tutorial { const auto cascmcParticle = casc.mcParticle(); if (TMath::Abs(cascmcParticle.pdgCode()) == 3312) { rXi.fill(HIST("hMassXiTrueRec"), casc.mXi()); - } + } } } } @@ -272,11 +272,10 @@ struct strangeness_tutorial { PROCESS_SWITCH(strangeness_tutorial, processRecMC, "Process Run 3 mc, reconstructed", true); PROCESS_SWITCH(strangeness_tutorial, processGenMC, "Process Run 3 mc, generated", true); - }; -WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) -{ +WorkflowSpec defineDataProcessing(ConfigContext const& cfgc) +{ return WorkflowSpec{ - adaptAnalysisTask(cfgc)}; + adaptAnalysisTask(cfgc)}; } From ce57abeeaead230a0d36c5fa6fd186ef53f44055 Mon Sep 17 00:00:00 2001 From: nepeivodaRS Date: Thu, 2 Nov 2023 14:46:27 +0100 Subject: [PATCH 3/8] Comment fix --- Tutorials/PWGLF/Strangeness/strangeness_step4.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx b/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx index 95fde7c53cb..92966aac95e 100644 --- a/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx +++ b/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx @@ -141,7 +141,7 @@ struct strangeness_tutorial { void processRecMC(soa::Filtered>::iterator const& collision, soa::Filtered> const& Cascades, soa::Filtered> const& V0s, - aod::V0Datas const&, // it's needed to access the full info of V0s related to cascades + aod::V0Datas const&, // it's needed to access the full table of V0s (not the filtered one) to make sure all the V0s related to cascades are present aod::V0sLinked const&, DaughterTracks const&, aod::McParticles const&) From 7f463ed48c006259bd89e8b650b216592b9e84e7 Mon Sep 17 00:00:00 2001 From: nepeivodaRS Date: Fri, 3 Nov 2023 17:48:00 +0100 Subject: [PATCH 4/8] Update 1. processGenMC now processes only generated collisions that've been reconstructed at least once 2. binding names for cascades and v0s in corresponding builders are fixed to make autodetect feature work correctly --- PWGLF/TableProducer/cascadebuilder.cxx | 5 ++--- PWGLF/TableProducer/lambdakzerobuilder.cxx | 3 ++- Tutorials/PWGLF/Strangeness/strangeness_step4.cxx | 6 +++++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/PWGLF/TableProducer/cascadebuilder.cxx b/PWGLF/TableProducer/cascadebuilder.cxx index b565b3baeac..4094472d8df 100644 --- a/PWGLF/TableProducer/cascadebuilder.cxx +++ b/PWGLF/TableProducer/cascadebuilder.cxx @@ -465,12 +465,11 @@ struct cascadeBuilder { for (auto const& input : device.inputs) { if (device.name.compare("cascade-initializer") == 0) continue; // don't listen to the initializer, it's just to extend stuff - const std::string CascDataName = "CascData"; - const std::string CascDataExtName = "CascDataExt"; + const std::string CascDataName = "StoredCascDatas"; + const std::string CascDataExtName = "CascDatasExtension"; if (input.matcher.binding == CascDataName || input.matcher.binding == CascDataExtName) { LOGF(info, "Device named %s has subscribed to CascData table! Will now scan for desired settings...", device.name); for (auto const& option : device.options) { - // 5 V0 topological selections + 1 mass if (option.name.compare("cascadesetting_cospa") == 0) { detected_casccospa = option.defaultValue.get(); diff --git a/PWGLF/TableProducer/lambdakzerobuilder.cxx b/PWGLF/TableProducer/lambdakzerobuilder.cxx index 2dc23bf5f01..283f7894a18 100644 --- a/PWGLF/TableProducer/lambdakzerobuilder.cxx +++ b/PWGLF/TableProducer/lambdakzerobuilder.cxx @@ -337,7 +337,8 @@ struct lambdakzeroBuilder { if (device.name.compare("lambdakzero-initializer") == 0) continue; // don't listen to the initializer, it's just to extend stuff const std::string v0DataName = "V0Datas"; - if (input.matcher.binding == v0DataName && device.name.compare("multistrange-builder") != 0) { + const std::string v0DataExtName = "V0DatasExtension"; + if ((input.matcher.binding == v0DataName || input.matcher.binding == v0DataExtName) && device.name.compare("multistrange-builder") != 0) { LOGF(info, "Device named %s has subscribed to V0datas table! Will now scan for desired settings...", device.name); for (auto const& option : device.options) { // 5 V0 topological selections diff --git a/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx b/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx index eaed276d494..672acbee21b 100644 --- a/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx +++ b/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx @@ -110,6 +110,7 @@ struct strangeness_tutorial { rXi.add("hCascCosPA", "hCascCosPA", {HistType::kTH1F, {{100, 0.95f, 1.f}}}); // Generated level histograms + rEventSelection.add("hVertexZRecAssoc", "hVertexZRecAssoc", {HistType::kTH1F, {vertexZAxis}}); rEventSelection.add("hVertexZGen", "hVertexZGen", {HistType::kTH1F, {vertexZAxis}}); rGenParticles.add("hPtK0ShortGen", "hPtK0ShortGen", {HistType::kTH1F, {{ptAxis}}}); rGenParticles.add("hPtXiGen", "hPtXiGen", {HistType::kTH1F, {{ptAxis}}}); @@ -139,7 +140,7 @@ struct strangeness_tutorial { using DaughterTracks = soa::Join; void processRecMC(soa::Filtered>::iterator const& collision, - soa::Filtered> const& Cascades, + soa::Filtered> const& Cascades, soa::Filtered> const& V0s, aod::V0Datas const&, // it's needed to access the full table of V0s (not the filtered one) to make sure all the V0s related to cascades are present aod::V0sLinked const&, @@ -257,8 +258,11 @@ struct strangeness_tutorial { } void processGenMC(soa::Filtered::iterator const& mcCollision, + const soa::SmallGroups>& collisions, aod::McParticles const& mcParticles) { + if(collisions.size() < 1) // to process generated collisions that've been reconstructed at least once + return; rEventSelection.fill(HIST("hVertexZGen"), mcCollision.posZ()); for (const auto& mcParticle : mcParticles) { if (mcParticle.pdgCode() == 310) { From ea2cc0b871c443a23d1b46d51373d6e82c7f81e1 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Fri, 3 Nov 2023 16:48:42 +0000 Subject: [PATCH 5/8] Please consider the following formatting changes --- Tutorials/PWGLF/Strangeness/strangeness_step4.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx b/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx index 672acbee21b..a0403c64087 100644 --- a/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx +++ b/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx @@ -261,7 +261,7 @@ struct strangeness_tutorial { const soa::SmallGroups>& collisions, aod::McParticles const& mcParticles) { - if(collisions.size() < 1) // to process generated collisions that've been reconstructed at least once + if (collisions.size() < 1) // to process generated collisions that've been reconstructed at least once return; rEventSelection.fill(HIST("hVertexZGen"), mcCollision.posZ()); for (const auto& mcParticle : mcParticles) { From c0342d840b3accee0160ae1539ca96a86dce2390 Mon Sep 17 00:00:00 2001 From: nepeivodaRS Date: Fri, 3 Nov 2023 18:06:53 +0100 Subject: [PATCH 6/8] Xi axis --- Tutorials/PWGLF/Strangeness/strangeness_step4.cxx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx b/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx index 672acbee21b..2e2943d0efd 100644 --- a/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx +++ b/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx @@ -77,6 +77,7 @@ struct strangeness_tutorial { { // Axes AxisSpec K0ShortMassAxis = {200, 0.45f, 0.55f, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; + AxisSpec XiMassAxis = {200, 1.28f, 1.36f, "#it{M}_{inv} [GeV/#it{c}^{2}]"}; AxisSpec vertexZAxis = {nBins, -15., 15., "vrtx_{Z} [cm]"}; AxisSpec ptAxis = {100, 0.0f, 10.0f, "#it{p}_{T} (GeV/#it{c})"}; @@ -95,9 +96,9 @@ struct strangeness_tutorial { rKzeroShort.add("hPtK0ShortTrueRec", "hPtK0ShortTrueRec", {HistType::kTH1F, {{ptAxis}}}); // Xi reconstruction - rXi.add("hMassXi", "hMassXi", {HistType::kTH1F, {{200, 1.28f, 1.36f}}}); - rXi.add("hMassXiSelected", "hMassXiSelected", {HistType::kTH1F, {{200, 1.28f, 1.36f}}}); - rXi.add("hMassXiTrueRec", "hMassXiTrueRec", {HistType::kTH1F, {{200, 1.28f, 1.36f}}}); + rXi.add("hMassXi", "hMassXi", {HistType::kTH1F, {XiMassAxis}}); + rXi.add("hMassXiSelected", "hMassXiSelected", {HistType::kTH1F, {XiMassAxis}}); + rXi.add("hMassXiTrueRec", "hMassXiTrueRec", {HistType::kTH1F, {XiMassAxis}}); // K0s topological/PID cuts rKzeroShort.add("hDCAV0Daughters", "hDCAV0Daughters", {HistType::kTH1F, {{55, 0.0f, 2.2f}}}); From b9ab4a577da1d03b3b82c6487fe17a2791338d5e Mon Sep 17 00:00:00 2001 From: nepeivodaRS Date: Fri, 3 Nov 2023 18:09:10 +0100 Subject: [PATCH 7/8] Clean histo --- Tutorials/PWGLF/Strangeness/strangeness_step4.cxx | 1 - 1 file changed, 1 deletion(-) diff --git a/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx b/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx index 0ffacf49213..7f20727132b 100644 --- a/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx +++ b/Tutorials/PWGLF/Strangeness/strangeness_step4.cxx @@ -111,7 +111,6 @@ struct strangeness_tutorial { rXi.add("hCascCosPA", "hCascCosPA", {HistType::kTH1F, {{100, 0.95f, 1.f}}}); // Generated level histograms - rEventSelection.add("hVertexZRecAssoc", "hVertexZRecAssoc", {HistType::kTH1F, {vertexZAxis}}); rEventSelection.add("hVertexZGen", "hVertexZGen", {HistType::kTH1F, {vertexZAxis}}); rGenParticles.add("hPtK0ShortGen", "hPtK0ShortGen", {HistType::kTH1F, {{ptAxis}}}); rGenParticles.add("hPtXiGen", "hPtXiGen", {HistType::kTH1F, {{ptAxis}}}); From bfa99d3d1fc5b88df25d3f3794874b61e03caebd Mon Sep 17 00:00:00 2001 From: nepeivodaRS Date: Sun, 5 Nov 2023 17:22:04 +0100 Subject: [PATCH 8/8] gen. MC event selection --- Tutorials/PWGLF/Strangeness/strangeness_step3.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Tutorials/PWGLF/Strangeness/strangeness_step3.cxx b/Tutorials/PWGLF/Strangeness/strangeness_step3.cxx index b0fca259f35..cb370345002 100644 --- a/Tutorials/PWGLF/Strangeness/strangeness_step3.cxx +++ b/Tutorials/PWGLF/Strangeness/strangeness_step3.cxx @@ -161,8 +161,11 @@ struct strangeness_tutorial { } void processGenMC(soa::Filtered::iterator const& mcCollision, + const soa::SmallGroups>& collisions, aod::McParticles const& mcParticles) { + if (collisions.size() < 1) // to process generated collisions that've been reconstructed at least once + return; rEventSelection.fill(HIST("hVertexZGen"), mcCollision.posZ()); for (const auto& mcParticle : mcParticles) { if (mcParticle.pdgCode() == 310) {