Skip to content

Commit 9980aba

Browse files
[PWGCF] Fix derived to derived processing of femto tracks with mass (#17508)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 7be1c80 commit 9980aba

5 files changed

Lines changed: 26 additions & 16 deletions

File tree

PWGCF/Femto/Core/cascadeBuilder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -779,8 +779,8 @@ class CascadeBuilder
779779

780780
struct ConfCascadeTablesDerivedToDerived : o2::framework::ConfigurableGroup {
781781
std::string prefix = std::string("CascadeTables");
782-
o2::framework::Configurable<int> limitXi{"limitXi", 1, "At least this many xi need to be in the collision"};
783-
o2::framework::Configurable<int> limitOmega{"limitOmega", 0, "At least this many omega need to be in the collision"};
782+
o2::framework::Configurable<int> limitXi{"limitXi", 1, "Require at least this many Xis in the collision. Set to 0 to skip Xis entirely (not written to output)."};
783+
o2::framework::Configurable<int> limitOmega{"limitOmega", 0, "Require at least this many Omegas in the collision. Set to 0 to skip Omegas entirely (not written to output)."};
784784
};
785785

786786
struct CascadeBuilderDerivedToDerivedProducts : o2::framework::ProducesGroup {

PWGCF/Femto/Core/kinkBuilder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -725,8 +725,8 @@ class KinkBuilder
725725

726726
struct ConfKinkTablesDerivedToDerived : o2::framework::ConfigurableGroup {
727727
std::string prefix = std::string("KinkTables");
728-
o2::framework::Configurable<int> limitSigma{"limitSigma", 1, "At least this many sigmas need to be in the collision"};
729-
o2::framework::Configurable<int> limitSigmaPlus{"limitSigmaPlus", 0, "At least this many sigma pluses need to be in the collision"};
728+
o2::framework::Configurable<int> limitSigma{"limitSigma", 1, "Require at least this many Sigmas in the collision. Set to 0 to skip Sigmas entirely (not written to output)."};
729+
o2::framework::Configurable<int> limitSigmaPlus{"limitSigmaPlus", 0, "Require at least this many SigmaPlus in the collision. Set to 0 to skip SigmaPlus entirely (not written to output)."};
730730
};
731731

732732
struct KinkBuilderDerivedToDerivedProducts : o2::framework::ProducesGroup {

PWGCF/Femto/Core/trackBuilder.h

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -841,8 +841,8 @@ struct TrackBuilderDerivedToDerivedProducts : o2::framework::ProducesGroup {
841841

842842
struct ConfTrackTablesDerivedToDerived : o2::framework::ConfigurableGroup {
843843
std::string prefix = std::string("TrackTables");
844-
o2::framework::Configurable<int> limitTrack1{"limitTrack1", 1, "At least this many tracks of type 1 need to be in the collision. Ignored if set to 0."};
845-
o2::framework::Configurable<int> limitTrack2{"limitTrack2", 0, "At least this many tracks of type 2 need to be in the collision. Ignored if set to 0."};
844+
o2::framework::Configurable<int> limitTrack1{"limitTrack1", 1, "Require at least this many tracks of type 1 in the collision. Set to 0 to skip this track species entirely (not written to output)."};
845+
o2::framework::Configurable<int> limitTrack2{"limitTrack2", 1, "Require at least this many tracks of type 2 in the collision. Set to 0 to skip this track species entirely (not written to output)."};
846846
};
847847

848848
class TrackBuilderDerivedToDerived
@@ -863,13 +863,18 @@ class TrackBuilderDerivedToDerived
863863
}
864864

865865
template <typename T1, typename T2, typename T3, typename T4, typename T5>
866-
bool collisionHasTooFewTracks(T1& col, T2& /*trackTable*/, T3& partitionTrack1, T4& partitionTrack2, T5& cache)
866+
bool collisionHasTooFewTracks(T1 const& col, T2 const& /*tracks*/, T3& partitionTrack1, T4& partitionTrack2, T5& cache) const
867867
{
868-
auto trackSlice1 = partitionTrack1->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
869-
auto trackSlice2 = partitionTrack2->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
870-
871-
const bool tooFew1 = (mLimitTrack1 > 0) && (trackSlice1.size() < static_cast<int64_t>(mLimitTrack1));
872-
const bool tooFew2 = (mLimitTrack2 > 0) && (trackSlice2.size() < static_cast<int64_t>(mLimitTrack2));
868+
bool tooFew1 = false;
869+
if (mLimitTrack1 > 0) {
870+
auto slice1 = partitionTrack1->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
871+
tooFew1 = slice1.size() < static_cast<int64_t>(mLimitTrack1);
872+
}
873+
bool tooFew2 = false;
874+
if (mLimitTrack2 > 0) {
875+
auto slice2 = partitionTrack2->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
876+
tooFew2 = slice2.size() < static_cast<int64_t>(mLimitTrack2);
877+
}
873878
return tooFew1 || tooFew2;
874879
}
875880

PWGCF/Femto/Core/v0Builder.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -770,8 +770,9 @@ class V0Builder
770770

771771
struct ConfV0TablesDerivedToDerived : o2::framework::ConfigurableGroup {
772772
std::string prefix = std::string("V0Tables");
773-
o2::framework::Configurable<int> limitLambda{"limitLambda", 1, "At least this many lambdas need to be in the collision"};
774-
o2::framework::Configurable<int> limitK0short{"limitK0short", 0, "At least this many k0short need to be in the collision"};
773+
o2::framework::Configurable<int> limitLambda{"limitLambda", 1, "Require at least this many Lambdas in the collision. Set to 0 to skip Lambdas entirely (not written to output)."};
774+
775+
o2::framework::Configurable<int> limitK0short{"limitK0short", 0, "Require at least this many K0shorts in the collision. Set to 0 to skip K0shorts entirely (not written to output)."};
775776
};
776777

777778
struct V0BuilderDerivedToDerivedProducts : o2::framework::ProducesGroup {

PWGCF/Femto/TableProducer/femtoProducerDerivedToDerived.cxx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ struct FemtoProducerDerivedToDerived {
6767
o2::framework::Partition<FemtoTracks> trackPartition2 = MAKE_TRACK_PARTITION(trackSelections2);
6868
o2::framework::Preslice<FemtoTracks> perColTracks = o2::aod::femtobase::stored::fColId;
6969

70+
o2::framework::Partition<FemtoTracksWithMass> trackWithMassPartition1 = MAKE_TRACK_PARTITION_WITH_MASS(trackSelections1);
71+
o2::framework::Partition<FemtoTracksWithMass> trackWithMassPartition2 = MAKE_TRACK_PARTITION_WITH_MASS(trackSelections2);
72+
o2::framework::Preslice<FemtoTracksWithMass> perColTracksWithMass = o2::aod::femtobase::stored::fColId;
73+
7074
// v0 builder
7175
v0builder::V0BuilderDerivedToDerived v0Builder;
7276
v0builder::V0BuilderDerivedToDerivedProducts v0BuilderProducts;
@@ -138,12 +142,12 @@ struct FemtoProducerDerivedToDerived {
138142

139143
void processTracksWithMass(FilteredFemtoCollision const& col, FemtoTracksWithMass const& tracks)
140144
{
141-
if (trackBuilder.collisionHasTooFewTracks(col, tracks, trackPartition1, trackPartition2, cache)) {
145+
if (trackBuilder.collisionHasTooFewTracks(col, tracks, trackWithMassPartition1, trackWithMassPartition2, cache)) {
142146
return;
143147
}
144148
trackBuilder.reset(tracks);
145149
collisionBuilder.processCollision(col, collisionBuilderProducts);
146-
trackBuilder.processTracks(col, tracks, trackPartition1, trackPartition2, cache, trackBuilderProducts, collisionBuilderProducts);
150+
trackBuilder.processTracks(col, tracks, trackWithMassPartition1, trackWithMassPartition2, cache, trackBuilderProducts, collisionBuilderProducts);
147151
}
148152
PROCESS_SWITCH(FemtoProducerDerivedToDerived, processTracksWithMass, "Process tracks with mass", false);
149153

0 commit comments

Comments
 (0)