@@ -863,6 +863,44 @@ class CascadeBuilderDerivedToDerived
863863 }
864864 }
865865
866+ // / Same as processXis, but also resolves the daughters' MC labels (via the
867+ // / MC-aware trackBuilder.getDaughterIndex overload) and writes the xi's own
868+ // / FXiLabels row. xiTable must be joined with FXiLabels upstream.
869+ template <typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 , typename T10 , typename T11 , typename T12 , typename T13 , typename T14 >
870+ void processXisWithMc (T1 const & col, T2 const & /* xiTable*/ , T3 const & oldTrackTable, T4 & partitionXi, T5 & trackBuilder, T6 & cache, T7 & newXiTable, T8 & newTrackTable, T9 & newCollisionTable,
871+ T10 & mcBuilder, T11 const & mcCols, T12 const & mcParticles, T13 const & mcMothers, T14 const & mcPartonicMothers, auto & mcProducts)
872+ {
873+ if (mLimitXi == 0 ) { // xis disabled
874+ return ;
875+ }
876+
877+ auto xiSlice = partitionXi->sliceByCached (o2::aod::femtobase::stored::fColId , col.globalIndex (), cache);
878+
879+ for (auto const & xi : xiSlice) {
880+ auto bachelor = oldTrackTable.rawIteratorAt (utils::daughterRow (xi.bachelorId (), oldTrackTable));
881+ auto posDaughter = oldTrackTable.rawIteratorAt (utils::daughterRow (xi.posDauId (), oldTrackTable));
882+ auto negDaughter = oldTrackTable.rawIteratorAt (utils::daughterRow (xi.negDauId (), oldTrackTable));
883+
884+ int64_t bachelorIndex = trackBuilder.getDaughterIndex (bachelor, newTrackTable, newCollisionTable, mcBuilder, mcCols, mcParticles, mcMothers, mcPartonicMothers, mcProducts);
885+ int64_t posDaughterIndex = trackBuilder.getDaughterIndex (posDaughter, newTrackTable, newCollisionTable, mcBuilder, mcCols, mcParticles, mcMothers, mcPartonicMothers, mcProducts);
886+ int64_t negDaughterIndex = trackBuilder.getDaughterIndex (negDaughter, newTrackTable, newCollisionTable, mcBuilder, mcCols, mcParticles, mcMothers, mcPartonicMothers, mcProducts);
887+
888+ newXiTable.producedXis (newCollisionTable.producedCollision .lastIndex (),
889+ xi.signedPt (),
890+ xi.eta (),
891+ xi.phi (),
892+ xi.mass (),
893+ bachelorIndex,
894+ posDaughterIndex,
895+ negDaughterIndex);
896+ newXiTable.producedXiMasks (xi.mask ());
897+ if constexpr (utils::HasCascadeCosPa<decltype (xi)>) {
898+ newXiTable.producedXiFrac (xi.cascadeCosPa ());
899+ }
900+ mcBuilder.fillXiWithLabel (xi, mcCols, mcParticles, mcMothers, mcPartonicMothers, mcProducts);
901+ }
902+ }
903+
866904 template <typename T1 , typename T2 , typename T3 , typename T4 , typename T5 , typename T6 , typename T7 , typename T8 , typename T9 >
867905 void processOmegas (T1 const & col, T2 const & /* omegaTable*/ , T3 const & oldTrackTable, T4 & partitionOmega, T5 & trackBuilder, T6 & cache, T7 & newOmegaTable, T8 & newTrackTable, T9 & newCollisionTable)
868906 {
0 commit comments