Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions PWGLF/DataModel/LFStrangenessTables.h
Original file line number Diff line number Diff line change
Expand Up @@ -950,6 +950,12 @@ DECLARE_SOA_TABLE(V0Indices, "AOD", "V0INDEX", //! index table when using AO2Ds
DECLARE_SOA_TABLE(V0CollRefs, "AOD", "V0COLLREF", //! optional table to refer back to a collision
o2::soa::Index<>, v0data::StraCollisionId);

// Joinable with aod::Collisions: the StraCollisions row of each AO2D collision, -1 for a collision not written. For the
// other tasks of a derivation train, which write tables of their own next to the strangeness ones (e.g. tracks) and
// need to point them to the same collisions; not meant to be saved.
DECLARE_SOA_TABLE(StraCollisionLink, "AOD", "STRACOLLLINK", //! AO2D collision -> StraCollisions
o2::soa::Index<>, v0data::StraCollisionId);

DECLARE_SOA_TABLE_STAGED(V0Extras, "V0EXTRA", //! optional table to refer to custom track extras
o2::soa::Index<>, v0data::PosTrackExtraId, v0data::NegTrackExtraId);

Expand Down
10 changes: 9 additions & 1 deletion PWGLF/TableProducer/Strangeness/strangederivedbuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ struct strangederivedbuilder {
Produces<aod::StraStamps> strangeStamps; // provides timestamps, run numbers
Produces<aod::StraEvTimes> straEvTimes; // provides event times (FT0, TOF)
Produces<aod::V0CollRefs> v0collref; // references collisions from V0s
Produces<aod::StraCollisionLink> strangeCollLink; // references StraCollisions from AO2D collisions, for other tasks
Produces<aod::CascCollRefs> casccollref; // references collisions from cascades
Produces<aod::KFCascCollRefs> kfcasccollref; // references collisions from KF cascades
Produces<aod::TraCascCollRefs> tracasccollref; // references collisions from tracked cascades
Expand Down Expand Up @@ -265,6 +266,7 @@ struct strangederivedbuilder {

// create collision indices beforehand
std::vector<uint64_t> TrackGlobalBc;
std::vector<int> StraCollIndices; // per AO2D collision; index -1: not written
std::vector<int> V0CollIndices; // index -1: no collision
std::vector<int> CascadeCollIndices; // index -1: no collision
std::vector<int> KFCascadeCollIndices; // index -1: no collision
Expand Down Expand Up @@ -316,7 +318,7 @@ struct strangederivedbuilder {
}
nSelected[o2::aod::straselections::kNoSameBunchPileup]++;

if (!cfgApplyRCTrequirement && !rctFlagsChecker(collision)) {
if (cfgApplyRCTrequirement && !rctFlagsChecker(collision)) {
return false;
}
nSelected[o2::aod::straselections::kIsGoodRCT]++;
Expand Down Expand Up @@ -553,12 +555,14 @@ struct strangederivedbuilder {
{
// create collision indices beforehand
TrackGlobalBc.clear();
StraCollIndices.clear();
V0CollIndices.clear();
CascadeCollIndices.clear();
KFCascadeCollIndices.clear();
TraCascadeCollIndices.clear();

TrackGlobalBc.resize(Tracks.size(), 0);
StraCollIndices.resize(collisions.size(), -1); // index -1: not written
V0CollIndices.resize(V0s.size(), -1); // index -1: no collision
CascadeCollIndices.resize(Cascades.size(), -1); // index -1: no collision
KFCascadeCollIndices.resize(KFCascades.size(), -1); // index -1: no collision
Expand Down Expand Up @@ -656,6 +660,7 @@ struct strangederivedbuilder {
if (strange || fillEmptyCollisions) {
products.strangeStamps(bc.runNumber(), bc.timestamp(), bc.globalBC());
products.strangeColl(collision.posX(), collision.posY(), collision.posZ());
StraCollIndices[collision.globalIndex()] = products.strangeColl.lastIndex();
if constexpr (requires { collision.mcCollisionId(); }) { // check if MC information is available and if so fill labels
products.strangeCollLabels(collision.mcCollisionId());
}
Expand Down Expand Up @@ -767,6 +772,9 @@ struct strangederivedbuilder {

// +-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+-<*>-+
// populate references, including those that might not be assigned
for (const auto& collision : collisions) {
products.strangeCollLink(StraCollIndices[collision.globalIndex()]);
}
for (const auto& v0 : V0s) {
products.v0collref(V0CollIndices[v0.globalIndex()]);
}
Expand Down
2 changes: 1 addition & 1 deletion PWGLF/Utils/strangenessBuilderModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ class BuilderModule
return false;
}

if (!eventSelectOpts.cfgApplyRCTrequirement && !rctFlagsChecker(collision)) {
if (eventSelectOpts.cfgApplyRCTrequirement && !rctFlagsChecker(collision)) {
return false;
}

Expand Down
Loading