From 043cd43b33fb12a856b09876706b492f16cc802c Mon Sep 17 00:00:00 2001 From: ddobrigk Date: Fri, 24 Nov 2023 15:41:38 +0100 Subject: [PATCH] [PWGLF] Fix subscriptions + add customizability (#3965) * fix subscription in cascadepid.cxx * fix subscription in lambdakzeropid.cxx * Add skipper for empty colls * Add skipper for empty colls * Please consider the following formatting changes (#190) --------- Co-authored-by: ALICE Builder --- PWGLF/TableProducer/cascadecollisionbuilder.cxx | 16 ++++++++++------ PWGLF/TableProducer/cascadepid.cxx | 2 +- .../lambdakzerocollisionbuilder.cxx | 14 +++++++++----- PWGLF/TableProducer/lambdakzeropid.cxx | 2 +- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/PWGLF/TableProducer/cascadecollisionbuilder.cxx b/PWGLF/TableProducer/cascadecollisionbuilder.cxx index 6cddbe4e47c..9b0d63e7bfc 100644 --- a/PWGLF/TableProducer/cascadecollisionbuilder.cxx +++ b/PWGLF/TableProducer/cascadecollisionbuilder.cxx @@ -50,6 +50,8 @@ struct cascadecollisionbuilder { Produces casccollref; // raw table for checks Produces casccoll; // table with Nsigmas + Configurable fillEmptyCollisions{"fillEmptyCollisions", false, "fill collision entries without candidates"}; + // For manual sliceBy Preslice perCollision = o2::aod::cascdata::collisionId; @@ -63,12 +65,14 @@ struct cascadecollisionbuilder { for (const auto& collision : collisions) { const uint64_t collIdx = collision.globalIndex(); auto CascTable_thisCollision = Cascades.sliceBy(perCollision, collIdx); - // V0 table sliced - if (currentCollIdx != collIdx) { - casccoll(collision.posX(), collision.posY(), collision.posZ(), - collision.centFT0M(), collision.centFT0A(), - collision.centFT0C(), collision.centFV0A()); - currentCollIdx = collIdx; + // casc table sliced + if (CascTable_thisCollision.size() > 0 || fillEmptyCollisions) { + if (currentCollIdx != collIdx) { + casccoll(collision.posX(), collision.posY(), collision.posZ(), + collision.centFT0M(), collision.centFT0A(), + collision.centFT0C(), collision.centFV0A()); + currentCollIdx = collIdx; + } } for (int i = 0; i < CascTable_thisCollision.size(); i++) { casccollref(casccoll.lastIndex()); diff --git a/PWGLF/TableProducer/cascadepid.cxx b/PWGLF/TableProducer/cascadepid.cxx index 543f976d7d8..575504d5bbc 100644 --- a/PWGLF/TableProducer/cascadepid.cxx +++ b/PWGLF/TableProducer/cascadepid.cxx @@ -233,7 +233,7 @@ struct cascadepid { return 0.0299792458 * TMath::Sqrt(lA / (1 + lA)); } - void processTPC(aod::Collisions const& collisions, aod::CascDatas const& Cascades, FullTracksExtIU const&, aod::BCsWithTimestamps const&, TaggedCascades const& allCascades) + void processTPC(aod::Collisions const& collisions, aod::CascDatas const& Cascades, TracksExtraWithPID const&, aod::BCsWithTimestamps const&, TaggedCascades const& allCascades) { for (const auto& collision : collisions) { // Fire up CCDB diff --git a/PWGLF/TableProducer/lambdakzerocollisionbuilder.cxx b/PWGLF/TableProducer/lambdakzerocollisionbuilder.cxx index 5bfedff9fad..aa05ae591ae 100644 --- a/PWGLF/TableProducer/lambdakzerocollisionbuilder.cxx +++ b/PWGLF/TableProducer/lambdakzerocollisionbuilder.cxx @@ -50,6 +50,8 @@ struct lambdakzerocollisionbuilder { Produces v0collref; // raw table for checks Produces v0coll; // table with Nsigmas + Configurable fillEmptyCollisions{"fillEmptyCollisions", false, "fill collision entries without candidates"}; + // For manual sliceBy Preslice perCollision = o2::aod::v0data::collisionId; @@ -64,11 +66,13 @@ struct lambdakzerocollisionbuilder { const uint64_t collIdx = collision.globalIndex(); auto V0Table_thisCollision = V0s.sliceBy(perCollision, collIdx); // V0 table sliced - if (currentCollIdx != collIdx) { - v0coll(collision.posX(), collision.posY(), collision.posZ(), - collision.centFT0M(), collision.centFT0A(), - collision.centFT0C(), collision.centFV0A()); - currentCollIdx = collIdx; + if (V0Table_thisCollision.size() > 0 || fillEmptyCollisions) { + if (currentCollIdx != collIdx) { + v0coll(collision.posX(), collision.posY(), collision.posZ(), + collision.centFT0M(), collision.centFT0A(), + collision.centFT0C(), collision.centFV0A()); + currentCollIdx = collIdx; + } } for (int i = 0; i < V0Table_thisCollision.size(); i++) { v0collref(v0coll.lastIndex()); diff --git a/PWGLF/TableProducer/lambdakzeropid.cxx b/PWGLF/TableProducer/lambdakzeropid.cxx index 7ce5218f977..7746a10b7c8 100644 --- a/PWGLF/TableProducer/lambdakzeropid.cxx +++ b/PWGLF/TableProducer/lambdakzeropid.cxx @@ -246,7 +246,7 @@ struct lambdakzeropid { return 0.0299792458 * TMath::Sqrt(lA / (1 + lA)); } - void processTPC(aod::Collisions const& collisions, aod::V0Datas const& V0s, FullTracksExtIU const&, aod::BCsWithTimestamps const&, TaggedV0s const& allV0s) + void processTPC(aod::Collisions const& collisions, aod::V0Datas const& V0s, TracksExtraWithPID const&, aod::BCsWithTimestamps const&, TaggedV0s const& allV0s) { for (const auto& collision : collisions) { // Fire up CCDB