Skip to content

Commit

Permalink
[PWGLF] Fix subscriptions + add customizability (AliceO2Group#3965)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
ddobrigk and alibuild authored Nov 24, 2023
1 parent 7511843 commit 043cd43
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 13 deletions.
16 changes: 10 additions & 6 deletions PWGLF/TableProducer/cascadecollisionbuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ struct cascadecollisionbuilder {
Produces<aod::CascCollRefs> casccollref; // raw table for checks
Produces<aod::CascCollision> casccoll; // table with Nsigmas

Configurable<bool> fillEmptyCollisions{"fillEmptyCollisions", false, "fill collision entries without candidates"};

// For manual sliceBy
Preslice<aod::CascDatas> perCollision = o2::aod::cascdata::collisionId;

Expand All @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion PWGLF/TableProducer/cascadepid.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
14 changes: 9 additions & 5 deletions PWGLF/TableProducer/lambdakzerocollisionbuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ struct lambdakzerocollisionbuilder {
Produces<aod::V0CollRefs> v0collref; // raw table for checks
Produces<aod::V0Collision> v0coll; // table with Nsigmas

Configurable<bool> fillEmptyCollisions{"fillEmptyCollisions", false, "fill collision entries without candidates"};

// For manual sliceBy
Preslice<aod::V0Datas> perCollision = o2::aod::v0data::collisionId;

Expand All @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion PWGLF/TableProducer/lambdakzeropid.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 043cd43

Please sign in to comment.