Skip to content

Commit 300b9b3

Browse files
[PWGCF] Add cascades to derived to derived producer (#17073)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent d1ad791 commit 300b9b3

4 files changed

Lines changed: 185 additions & 33 deletions

File tree

PWGCF/Femto/Core/cascadeBuilder.h

Lines changed: 110 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ struct ConfCascadeFilters : o2::framework::ConfigurableGroup {
7272
o2::framework::Configurable<std::vector<float>> lambdaTransRadMin{"lambdaTransRadMin", {0.9f}, "Minimum transverse radius (cm)"}; \
7373
o2::framework::Configurable<std::vector<float>> lambdaDcaDauMax{"lambdaDcaDauMax", {0.5f}, "Maximum DCA between the daughters at decay vertex (cm)"}; \
7474
o2::framework::Configurable<std::vector<float>> lambdaDcaToPvMin{"lambdaDcaToPvMin", {0.3f}, "Minimum DCA between the lambda and primary vertex"}; \
75-
o2::framework::Configurable<std::vector<float>> dauAbsEtaMax{"dauAbsEtaMax", {0.8f}, "Minimum DCA of the daughters from primary vertex (cm)"}; \
75+
o2::framework::Configurable<std::vector<float>> dauAbsEtaMax{"dauAbsEtaMax", {0.8f}, "Maximum |eta| of all daughters"}; \
7676
o2::framework::Configurable<std::vector<float>> dauDcaMin{"dauDcaMin", {0.05f}, "Minimum DCA of the daughters from primary vertex (cm)"}; \
7777
o2::framework::Configurable<std::vector<float>> dauTpcClustersMin{"dauTpcClustersMin", {80.f}, "Minimum number of TPC clusters for daughter tracks"}; \
7878
o2::framework::Configurable<std::vector<float>> posDauTpc{"posDauTpc", {5.f}, "Maximum |nsimga_Pion/Proton| TPC for positive daughter tracks"}; \
@@ -639,5 +639,114 @@ class CascadeBuilder
639639
bool mProduceOmegaExtras = false;
640640
};
641641

642+
struct ConfCascadeTablesDerivedToDerived : o2::framework::ConfigurableGroup {
643+
std::string prefix = std::string("CascadeTables");
644+
o2::framework::Configurable<int> limitXi{"limitXi", 1, "At least this many xi need to be in the collision"};
645+
o2::framework::Configurable<int> limitOmega{"limitOmega", 0, "At least this many omega need to be in the collision"};
646+
};
647+
648+
struct CascadeBuilderDerivedToDerivedProducts : o2::framework::ProducesGroup {
649+
o2::framework::Produces<o2::aod::StoredFXis> producedXis;
650+
o2::framework::Produces<o2::aod::StoredFXiMasks> producedXiMasks;
651+
o2::framework::Produces<o2::aod::StoredFOmegas> producedOmegas;
652+
o2::framework::Produces<o2::aod::StoredFOmegaMasks> producedOmegaMasks;
653+
};
654+
655+
class CascadeBuilderDerivedToDerived
656+
{
657+
public:
658+
CascadeBuilderDerivedToDerived() = default;
659+
~CascadeBuilderDerivedToDerived() = default;
660+
661+
template <typename T>
662+
void init(T& config)
663+
{
664+
mLimitXi = config.limitXi.value;
665+
mLimitOmega = config.limitOmega.value;
666+
667+
if (mLimitXi == 0 && mLimitOmega == 0) {
668+
LOG(fatal) << "Both xi limit and omega limit are 0. Breaking...";
669+
}
670+
}
671+
672+
template <typename T1, typename T2, typename T3, typename T4>
673+
bool collisionHasTooFewXis(T1 const& col, T2 const& /*xiTable*/, T3& partitionXi, T4& cache)
674+
{
675+
auto xiSlice = partitionXi->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
676+
return xiSlice.size() < mLimitXi;
677+
}
678+
679+
template <typename T1, typename T2, typename T3, typename T4>
680+
bool collisionHasTooFewOmegas(T1 const& col, T2 const& /*omegaTable*/, T3& partitionOmega, T4& cache)
681+
{
682+
auto omegaSlice = partitionOmega->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
683+
return omegaSlice.size() < mLimitOmega;
684+
}
685+
686+
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
687+
void processXis(T1 const& col, T2 const& /*xiTable*/, T3 const& oldTrackTable, T4& partitionXi, T5& trackBuilder, T6& cache, T7& newXiTable, T8& newTrackTable, T9& newCollisionTable)
688+
{
689+
auto xiSlice = partitionXi->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
690+
691+
for (auto const& xi : xiSlice) {
692+
693+
// auto bachelor = xi.template bachelor_as<T3>();
694+
// auto posDaughter = xi.template posDau_as<T3>();
695+
// auto negDaughter = xi.template negDau_as<T3>();
696+
auto bachelor = oldTrackTable.rawIteratorAt(xi.bachelorId() - oldTrackTable.offset());
697+
auto posDaughter = oldTrackTable.rawIteratorAt(xi.posDauId() - oldTrackTable.offset());
698+
auto negDaughter = oldTrackTable.rawIteratorAt(xi.negDauId() - oldTrackTable.offset());
699+
700+
int bachelorIndex = trackBuilder.getDaughterIndex(bachelor, newTrackTable, newCollisionTable);
701+
int posDaughterIndex = trackBuilder.getDaughterIndex(posDaughter, newTrackTable, newCollisionTable);
702+
int negDaughterIndex = trackBuilder.getDaughterIndex(negDaughter, newTrackTable, newCollisionTable);
703+
704+
newXiTable.producedXis(newCollisionTable.producedCollision.lastIndex(),
705+
xi.signedPt(),
706+
xi.eta(),
707+
xi.phi(),
708+
xi.mass(),
709+
bachelorIndex,
710+
posDaughterIndex,
711+
negDaughterIndex);
712+
newXiTable.producedXiMasks(xi.mask());
713+
}
714+
}
715+
716+
template <typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
717+
void processOmegas(T1 const& col, T2 const& /*omegaTable*/, T3 const& oldTrackTable, T4& partitionOmega, T5& trackBuilder, T6& cache, T7& newOmegaTable, T8& newTrackTable, T9& newCollisionTable)
718+
{
719+
auto omegaSlice = partitionOmega->sliceByCached(o2::aod::femtobase::stored::fColId, col.globalIndex(), cache);
720+
721+
for (auto const& omega : omegaSlice) {
722+
723+
// auto bachelor = omega.template bachelor_as<T3>();
724+
// auto posDaughter = omega.template posDau_as<T3>();
725+
// auto negDaughter = omega.template negDau_as<T3>();
726+
auto bachelor = oldTrackTable.rawIteratorAt(omega.bachelorId() - oldTrackTable.offset());
727+
auto posDaughter = oldTrackTable.rawIteratorAt(omega.posDauId() - oldTrackTable.offset());
728+
auto negDaughter = oldTrackTable.rawIteratorAt(omega.negDauId() - oldTrackTable.offset());
729+
730+
int bachelorIndex = trackBuilder.getDaughterIndex(bachelor, newTrackTable, newCollisionTable);
731+
int posDaughterIndex = trackBuilder.getDaughterIndex(posDaughter, newTrackTable, newCollisionTable);
732+
int negDaughterIndex = trackBuilder.getDaughterIndex(negDaughter, newTrackTable, newCollisionTable);
733+
734+
newOmegaTable.producedOmegas(newCollisionTable.producedCollision.lastIndex(),
735+
omega.signedPt(),
736+
omega.eta(),
737+
omega.phi(),
738+
omega.mass(),
739+
bachelorIndex,
740+
posDaughterIndex,
741+
negDaughterIndex);
742+
newOmegaTable.producedOmegaMasks(omega.mask());
743+
}
744+
}
745+
746+
private:
747+
int mLimitXi = 0;
748+
int mLimitOmega = 0;
749+
};
750+
642751
} // namespace o2::analysis::femto::cascadebuilder
643752
#endif // PWGCF_FEMTO_CORE_CASCADEBUILDER_H_

PWGCF/Femto/Core/v0Builder.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ struct ConfK0shortBits : o2::framework::ConfigurableGroup {
101101
o2::framework::Configurable<float> ptMax{"ptMax", 999.f, "Maximum pT"}; \
102102
o2::framework::Configurable<float> etaMin{"etaMin", -10.f, "Minimum eta"}; \
103103
o2::framework::Configurable<float> etaMax{"etaMax", 10.f, "Maximum eta"}; \
104-
o2::framework::Configurable<float> phiMin{"phiMin", 0.f, "Minimum eta"}; \
104+
o2::framework::Configurable<float> phiMin{"phiMin", 0.f, "Minimum phi"}; \
105105
o2::framework::Configurable<float> phiMax{"phiMax", 1.f * o2::constants::math::TwoPI, "Maximum phi"}; \
106-
o2::framework::Configurable<float> massMin{"massMin", (defaultMassMin), "Minimum invariant mass for Lambda"}; \
107-
o2::framework::Configurable<float> massMax{"massMax", (defaultMassMax), "Maximum invariant mass for Lambda"}; \
106+
o2::framework::Configurable<float> massMin{"massMin", (defaultMassMin), "Minimum invariant mass"}; \
107+
o2::framework::Configurable<float> massMax{"massMax", (defaultMassMax), "Maximum invariant mass"}; \
108108
o2::framework::Configurable<datatypes::V0MaskType> mask{"mask", 0, "Bitmask for v0 selection"};
109109

110110
// base selection for analysis task for lambdas
@@ -206,10 +206,10 @@ const std::unordered_map<V0Filters, std::string> v0FilterNames = {
206206
{kPhiMax, "phiMax"},
207207
{kRejectionK0shortMass, "rejectK0short"},
208208
{kK0shortMassMin, "k0shortMassMin"},
209-
{kK0shortMassMax, "k0shortMassMin"},
209+
{kK0shortMassMax, "k0shortMassMax"},
210210
{kRejectionLambdaMass, "rejectLambda"},
211211
{kLambdaMassMin, "lambdaMassMin"},
212-
{kLambdaMassMax, "lambdaMassMin"},
212+
{kLambdaMassMax, "lambdaMassMax"},
213213
};
214214

215215
/// \brief Cut class to contain and execute all cuts applied to v0s

PWGCF/Femto/DataModel/FemtoTables.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -653,10 +653,12 @@ DECLARE_SOA_TABLE_STAGED_VERSIONED(FXis_001, "FXI", 1, //! femto xis
653653
femtobase::dynamic::Pz<femtobase::stored::SignedPt, femtobase::stored::Eta>,
654654
femtobase::dynamic::Theta<femtobase::stored::Eta>);
655655
using FXis = FXis_001;
656+
using StoredFXis = StoredFXis_001;
656657

657658
DECLARE_SOA_TABLE_STAGED_VERSIONED(FXiMasks_001, "FXIMASK", 1, //! xi masks
658659
femtocascades::Mask);
659660
using FXiMasks = FXiMasks_001;
661+
using StoredFXiMasks = StoredFXiMasks_001;
660662

661663
DECLARE_SOA_TABLE_STAGED_VERSIONED(FXiExtras_001, "FXIEXTRA", 1, //! xi extra information
662664
femtocascades::MassOmega,
@@ -687,10 +689,12 @@ DECLARE_SOA_TABLE_STAGED_VERSIONED(FOmegas_001, "FOMEGA", 1, //! femto omegas
687689
femtobase::dynamic::Pz<femtobase::stored::SignedPt, femtobase::stored::Eta>,
688690
femtobase::dynamic::Theta<femtobase::stored::Eta>);
689691
using FOmegas = FOmegas_001;
692+
using StoredFOmegas = StoredFOmegas_001;
690693

691694
DECLARE_SOA_TABLE_STAGED_VERSIONED(FOmegaMasks_001, "FOMEGAMASK", 1, //! omega masks
692695
femtocascades::Mask);
693696
using FOmegaMasks = FOmegaMasks_001;
697+
using StoredFOmegaMasks = StoredFOmegaMasks_001;
694698

695699
DECLARE_SOA_TABLE_STAGED_VERSIONED(FOmegaExtras_001, "FOMEGAEXTRA", 1, //! omega extra information
696700
femtocascades::MassXi,

0 commit comments

Comments
 (0)