diff --git a/Tutorials/PWGLF/Strangeness/Derived/AnalysisV0/strangeness_derived_v0_step0.cxx b/Tutorials/PWGLF/Strangeness/Derived/AnalysisV0/strangeness_derived_v0_step0.cxx index 91839e54a54..7268d5f4597 100644 --- a/Tutorials/PWGLF/Strangeness/Derived/AnalysisV0/strangeness_derived_v0_step0.cxx +++ b/Tutorials/PWGLF/Strangeness/Derived/AnalysisV0/strangeness_derived_v0_step0.cxx @@ -74,8 +74,9 @@ struct StrangenessDerivedV0Step0 { Filter eventFilter = (o2::aod::evsel::sel8 == true); Filter posZFilter = (nabs(o2::aod::collision::posZ) < cutzvertex); + // V0CollRefs carries the index to the collision: without it the V0s are not grouped per collision void process(soa::Filtered>::iterator const& collision, - aod::V0Cores const& V0s) + soa::Join const& V0s) { // Fill the event counter rEventSelection.fill(HIST("hVertexZRec"), collision.posZ()); diff --git a/Tutorials/PWGLF/Strangeness/Derived/AnalysisV0/strangeness_derived_v0_step1.cxx b/Tutorials/PWGLF/Strangeness/Derived/AnalysisV0/strangeness_derived_v0_step1.cxx index 09d7e29eb72..9c76cfc5969 100644 --- a/Tutorials/PWGLF/Strangeness/Derived/AnalysisV0/strangeness_derived_v0_step1.cxx +++ b/Tutorials/PWGLF/Strangeness/Derived/AnalysisV0/strangeness_derived_v0_step1.cxx @@ -100,8 +100,9 @@ struct StrangenessDerivedV0Step1 { nabs(aod::v0data::dcapostopv) > v0setting_dcapostopv && nabs(aod::v0data::dcanegtopv) > v0setting_dcanegtopv); + // V0CollRefs carries the index to the collision: without it the V0s are not grouped per collision void process(soa::Filtered>::iterator const& collision, - soa::Filtered const& V0s) + soa::Filtered> const& V0s) { // Fill the event counter rEventSelection.fill(HIST("hVertexZRec"), collision.posZ()); diff --git a/Tutorials/PWGLF/Strangeness/Derived/AnalysisV0/strangeness_derived_v0_step2.cxx b/Tutorials/PWGLF/Strangeness/Derived/AnalysisV0/strangeness_derived_v0_step2.cxx index 18f2e22ecf8..13c8c465b44 100644 --- a/Tutorials/PWGLF/Strangeness/Derived/AnalysisV0/strangeness_derived_v0_step2.cxx +++ b/Tutorials/PWGLF/Strangeness/Derived/AnalysisV0/strangeness_derived_v0_step2.cxx @@ -117,8 +117,9 @@ struct StrangenessDerivedV0Step2 { // Defining the type of the daughter tracks using dauTracks = soa::Join; + // V0CollRefs carries the index to the collision: without it the V0s are not grouped per collision void process(soa::Filtered>::iterator const& collision, - soa::Filtered> const& V0s, + soa::Filtered> const& V0s, dauTracks const&) { // Fill the event counter diff --git a/Tutorials/PWGLF/Strangeness/Derived/AnalysisV0/strangeness_derived_v0_step3.cxx b/Tutorials/PWGLF/Strangeness/Derived/AnalysisV0/strangeness_derived_v0_step3.cxx index 5ac5ed34f86..aae469a901e 100644 --- a/Tutorials/PWGLF/Strangeness/Derived/AnalysisV0/strangeness_derived_v0_step3.cxx +++ b/Tutorials/PWGLF/Strangeness/Derived/AnalysisV0/strangeness_derived_v0_step3.cxx @@ -126,8 +126,9 @@ struct StrangenessDerivedV0Step3 { // Defining the type of the daughter tracks using dauTracks = soa::Join; + // V0CollRefs carries the index to the collision: without it the V0s are not grouped per collision void process(soa::Filtered>::iterator const& collision, - soa::Filtered> const& V0s, + soa::Filtered> const& V0s, dauTracks const&) { // Fill the event counter diff --git a/Tutorials/PWGLF/Strangeness/Derived/AnalysisV0/strangeness_derived_v0_step4.cxx b/Tutorials/PWGLF/Strangeness/Derived/AnalysisV0/strangeness_derived_v0_step4.cxx index e602921b6df..67d918b959a 100644 --- a/Tutorials/PWGLF/Strangeness/Derived/AnalysisV0/strangeness_derived_v0_step4.cxx +++ b/Tutorials/PWGLF/Strangeness/Derived/AnalysisV0/strangeness_derived_v0_step4.cxx @@ -150,8 +150,9 @@ struct StrangenessDerivedV0Step4 { // Defining the type of the daughter tracks using dauTracks = soa::Join; + // V0CollRefs carries the index to the collision: without it the V0s are not grouped per collision void processRecMC(soa::Filtered>::iterator const& collision, - soa::Filtered> const& V0s, + soa::Filtered> const& V0s, dauTracks const&, aod::V0MCCores const& /*v0mccores*/) { @@ -272,28 +273,29 @@ struct StrangenessDerivedV0Step4 { } // Checking that the V0 is a true K0S / Lambda / AntiLambda + // The generated pT is used, consistently with the denominator of the efficiency if (v0mccore.pdgCode() == PDG_t::kK0Short && isK0Short) { rK0Short.fill(HIST("hMassK0ShortTrueRec"), v0.mK0Short()); - rK0Short.fill(HIST("hPtK0ShortTrueRec"), v0.pt()); + rK0Short.fill(HIST("hPtK0ShortTrueRec"), v0mccore.ptMC()); if (k0ShortPassTOFSelection) { rK0Short.fill(HIST("hMassK0ShortTrueRecWithTOF"), v0.mK0Short()); - rK0Short.fill(HIST("hPtK0ShortTrueRecWithTOF"), v0.pt()); + rK0Short.fill(HIST("hPtK0ShortTrueRecWithTOF"), v0mccore.ptMC()); } } if (v0mccore.pdgCode() == PDG_t::kLambda0 && isLambda) { rLambda.fill(HIST("hMassLambdaTrueRec"), v0.mLambda()); - rLambda.fill(HIST("hPtLambdaTrueRec"), v0.pt()); + rLambda.fill(HIST("hPtLambdaTrueRec"), v0mccore.ptMC()); if (lambdaPassTOFSelection) { rLambda.fill(HIST("hMassLambdaTrueRecWithTOF"), v0.mLambda()); - rLambda.fill(HIST("hPtLambdaTrueRecWithTOF"), v0.pt()); + rLambda.fill(HIST("hPtLambdaTrueRecWithTOF"), v0mccore.ptMC()); } } if (v0mccore.pdgCode() == PDG_t::kLambda0Bar && isAntiLambda) { rLambda.fill(HIST("hMassAntiLambdaTrueRec"), v0.mAntiLambda()); - rLambda.fill(HIST("hPtAntiLambdaTrueRec"), v0.pt()); + rLambda.fill(HIST("hPtAntiLambdaTrueRec"), v0mccore.ptMC()); if (antiLambdaPassTOFSelection) { rLambda.fill(HIST("hMassAntiLambdaTrueRecWithTOF"), v0.mAntiLambda()); - rLambda.fill(HIST("hPtAntiLambdaTrueRecWithTOF"), v0.pt()); + rLambda.fill(HIST("hPtAntiLambdaTrueRecWithTOF"), v0mccore.ptMC()); } } } @@ -303,7 +305,16 @@ struct StrangenessDerivedV0Step4 { const soa::SmallGroups>& collisions, const soa::SmallGroups>& v0MC) { - if (collisions.size() < 1) { // to process generated collisions that've been reconstructed at least once + // Process only generated collisions reconstructed at least once by a collision + // passing the same event selection as in processRecMC (sel8 and z-vertex cut) + bool hasSelectedCollision = false; + for (const auto& collision : collisions) { + if (collision.sel8() && std::abs(collision.posZ()) < cutzvertex) { + hasSelectedCollision = true; + break; + } + } + if (!hasSelectedCollision) { return; } rEventSelection.fill(HIST("hVertexZGen"), mcCollision.posZ());