diff --git a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx index 7b8a0b00a77..2609a03fcc9 100644 --- a/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx +++ b/PWGCF/FemtoUniverse/TableProducer/femtoUniverseProducerTask.cxx @@ -188,6 +188,7 @@ struct FemtoUniverseProducerTask { Configurable> confTrkDCAzMax{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kDCAzMax, "ConfTrk"), std::vector{0.2f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kDCAzMax, "Track selection: ")}; /// \todo Reintegrate PID to the general selection container Configurable> confTrkPIDnSigmaMax{FemtoUniverseTrackSelection::getSelectionName(femto_universe_track_selection::kPIDnSigmaMax, "ConfTrk"), std::vector{3.5f, 3.f, 2.5f}, FemtoUniverseTrackSelection::getSelectionHelper(femto_universe_track_selection::kPIDnSigmaMax, "Track selection: ")}; Configurable> confTrkPIDspecies{"confTrkPIDspecies", std::vector{o2::track::PID::Pion, o2::track::PID::Kaon, o2::track::PID::Proton, o2::track::PID::Deuteron}, "Trk sel: Particles species for PID (Pion=2, Kaon=3, Proton=4, Deuteron=5)"}; + Configurable confIsOnlyMCTrack{"confIsOnlyMCTrack", false, "Enable filling of only MC Tracks"}; // Numbers from ~/alice/O2/DataFormats/Reconstruction/include/ReconstructionDataFormats/PID.h //static constexpr ID Pion = 2; static constexpr ID Kaon = 3; static constexpr ID Proton = 4; static constexpr ID Deuteron = 5; } ConfTrkSelection; @@ -1349,6 +1350,27 @@ struct FemtoUniverseProducerTask { } } + template + void fillTracksMCTruth(MCParticlesType const& mcParticles) + { + for (const auto& mc : mcParticles) { // Loop over all MC Truth particles + + std::vector childIDs = {0, 0}; + outputParts(outputCollision.lastIndex(), + mc.pt(), + mc.eta(), + mc.phi(), + aod::femtouniverseparticle::ParticleType::kMCTruthTrack, + 0, + 0, + mc.pdgCode(), + childIDs, + 0, + 0); + fillMCTruthParticle(mc, aod::femtouniverseparticle::ParticleType::kMCTruthTrack); + } + } + template void fillCascade(CollisionType const& col, CascadeType const& fullCascades, TrackType const&) { @@ -2534,7 +2556,11 @@ struct FemtoUniverseProducerTask { if (colcheck) { auto groupedMCParticles = mcParticles.sliceBy(perMCCollision, mccol.globalIndex()); outputCollExtra(1.0, 1.0); - fillParticles(groupedMCParticles, recoMcIds); // fills mc particles + if (!ConfTrkSelection.confIsOnlyMCTrack) { + fillParticles(groupedMCParticles, recoMcIds); // fills mc particles + } else { + fillTracksMCTruth(groupedMCParticles); + } } } }