diff --git a/PWGHF/HFC/TableProducer/producerCharmHadronsV0FemtoDream.cxx b/PWGHF/HFC/TableProducer/producerCharmHadronsV0FemtoDream.cxx index b89a974f220..c490ea599ba 100644 --- a/PWGHF/HFC/TableProducer/producerCharmHadronsV0FemtoDream.cxx +++ b/PWGHF/HFC/TableProducer/producerCharmHadronsV0FemtoDream.cxx @@ -506,6 +506,10 @@ struct HfProducerCharmHadronsV0FemtoDream { constexpr int GenFromTransport = -1; // -1 if a particle produced during transport // get list of mothers, but it could be empty (for example in case of injected light nuclei) auto motherparticlesMc = particleMc.template mothers_as(); + float ptPos{-1.f}, ptNeg{-1.f}; + float etaPos{-1.f}, etaNeg{-1.f}; + float phiPos{-1.f}, phiNeg{-1.f}; + int pdgCodePos{0}, pdgCodeNeg{0}; // check pdg code // if this fails, the particle is a fake if (std::abs(pdgCode) == std::abs(v0PDGCode.value)) { @@ -534,11 +538,39 @@ struct HfProducerCharmHadronsV0FemtoDream { } else { particleOrigin = aod::femtodreamMCparticle::ParticleOriginMCTruth::kElse; } + for (auto const& dauMc : particleMc.template daughters_as()) { + if (dauMc.pdgCode() > 0) { + ptPos = dauMc.pt(); + etaPos = dauMc.eta(); + phiPos = dauMc.phi(); + pdgCodePos = dauMc.pdgCode(); + } else { + ptNeg = dauMc.pt(); + etaNeg = dauMc.eta(); + phiNeg = dauMc.phi(); + pdgCodeNeg = dauMc.pdgCode(); + } + } // if pdg code is wrong, particle is fake } else { particleOrigin = aod::femtodreamMCparticle::ParticleOriginMCTruth::kFake; } + // positive daughter + outputPartsMc(particleOrigin, pdgCodePos, ptPos, etaPos, phiPos); + outputPartsMcLabels(outputPartsMc.lastIndex()); + if (isDebug) { + outputPartsExtMcLabels(outputPartsMc.lastIndex()); + outputDebugPartsMc(pdgCode); + } + // negative daughter + outputPartsMc(particleOrigin, pdgCodeNeg, ptNeg, etaNeg, phiNeg); + outputPartsMcLabels(outputPartsMc.lastIndex()); + if (isDebug) { + outputPartsExtMcLabels(outputPartsMc.lastIndex()); + outputDebugPartsMc(pdgCode); + } + // V0 outputPartsMc(particleOrigin, pdgCode, particleMc.pt(), particleMc.eta(), particleMc.phi()); outputPartsMcLabels(outputPartsMc.lastIndex()); if (isDebug) { @@ -546,9 +578,26 @@ struct HfProducerCharmHadronsV0FemtoDream { outputDebugPartsMc(pdgCodeMother); } } else { + // positive daughter + outputPartsMc(aod::femtodreamMCparticle::ParticleOriginMCTruth::kFake, 0, -1.f, -1.f, -1.f); + outputPartsMcLabels(-1); + if (isDebug) { + outputPartsExtMcLabels(-1); + outputDebugPartsMc(0); + } + // negative daughter + outputPartsMc(aod::femtodreamMCparticle::ParticleOriginMCTruth::kFake, 0, -1.f, -1.f, -1.f); + outputPartsMcLabels(-1); + if (isDebug) { + outputPartsExtMcLabels(-1); + outputDebugPartsMc(0); + } + // V0 + outputPartsMc(aod::femtodreamMCparticle::ParticleOriginMCTruth::kFake, 0, -1.f, -1.f, -1.f); outputPartsMcLabels(-1); if (isDebug) { outputPartsExtMcLabels(-1); + outputDebugPartsMc(0); } } } diff --git a/PWGHF/HFC/Tasks/taskCharmHadronsV0FemtoDream.cxx b/PWGHF/HFC/Tasks/taskCharmHadronsV0FemtoDream.cxx index 67705a92a94..30adbcdd49a 100644 --- a/PWGHF/HFC/Tasks/taskCharmHadronsV0FemtoDream.cxx +++ b/PWGHF/HFC/Tasks/taskCharmHadronsV0FemtoDream.cxx @@ -9,7 +9,7 @@ // granted to it by virtue of its status as an Intergovernmental Organization // or submit itself to any jurisdiction. -/// \file taskCharmHadronsTrackFemtoDream.cxx +/// \file taskCharmHadronsV0FemtoDream.cxx /// \brief Tasks that reads the V0 and CharmHadrons tables used for the pairing and builds pairs /// \author Biao Zhang, Heidelberg University, biao.zhang@cern.ch @@ -177,8 +177,8 @@ struct HfTaskCharmHadronsV0FemtoDream { using FilteredMcCollisions = soa::Filtered>; using FilteredMcColision = FilteredMcCollisions::iterator; - using FilteredFDMcParts = soa::Filtered>; - using FilteredFDMcPart = FilteredFDMcParts::iterator; + using FDMcV0Particles = soa::Join; + using FDMcV0Particle = FDMcV0Particles::iterator; using FDV0Particles = soa::Join; using FDV0Particle = FDV0Particles::iterator; @@ -189,7 +189,7 @@ struct HfTaskCharmHadronsV0FemtoDream { Filter hfMcSelFilter = (nabs(aod::fdhf::flagMc) == charmSel.charmHadMcSel); Preslice perCol = aod::femtodreamparticle::fdCollisionId; - Preslice perColMc = aod::femtodreamparticle::fdCollisionId; + Preslice perColMc = aod::femtodreamparticle::fdCollisionId; Preslice perHf3ProngByCol = aod::femtodreamparticle::fdCollisionId; Preslice perHf2ProngByCol = aod::femtodreamparticle::fdCollisionId; Preslice perHfDstarByCol = aod::femtodreamparticle::fdCollisionId; @@ -206,16 +206,16 @@ struct HfTaskCharmHadronsV0FemtoDream { (aod::femtodreamparticle::mAntiLambda > v0Sel.invMassAntiV0Min) && (aod::femtodreamparticle::mAntiLambda < v0Sel.invMassAntiV0Max); - Partition partitionMcLambda = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0)) && - ((aod::femtodreamparticle::cut & v0Sel.cutBit) == v0Sel.cutBit) && - (aod::femtodreamparticle::pt > v0Sel.ptV0Min) && - (aod::femtodreamparticle::pt < v0Sel.ptV0Max) && - (aod::femtodreamparticle::eta > v0Sel.etaV0Min) && - (aod::femtodreamparticle::eta < v0Sel.etaV0Max) && - (aod::femtodreamparticle::mLambda > v0Sel.invMassV0Min) && - (aod::femtodreamparticle::mLambda < v0Sel.invMassV0Max) && - (aod::femtodreamparticle::mAntiLambda > v0Sel.invMassAntiV0Min) && - (aod::femtodreamparticle::mAntiLambda < v0Sel.invMassAntiV0Max); + Partition partitionMcLambda = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0)) && + ((aod::femtodreamparticle::cut & v0Sel.cutBit) == v0Sel.cutBit) && + (aod::femtodreamparticle::pt > v0Sel.ptV0Min) && + (aod::femtodreamparticle::pt < v0Sel.ptV0Max) && + (aod::femtodreamparticle::eta > v0Sel.etaV0Min) && + (aod::femtodreamparticle::eta < v0Sel.etaV0Max) && + (aod::femtodreamparticle::mLambda > v0Sel.invMassV0Min) && + (aod::femtodreamparticle::mLambda < v0Sel.invMassV0Max) && + (aod::femtodreamparticle::mAntiLambda > v0Sel.invMassAntiV0Min) && + (aod::femtodreamparticle::mAntiLambda < v0Sel.invMassAntiV0Max); /// Partitions for particle K0Short Partition partitionK0Short = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0K0Short)) && @@ -229,16 +229,16 @@ struct HfTaskCharmHadronsV0FemtoDream { (aod::femtodreamparticle::mAntiLambda > v0Sel.invMassAntiV0Min) && (aod::femtodreamparticle::mAntiLambda < v0Sel.invMassAntiV0Max); - Partition partitionMcK0Short = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0K0Short)) && - ((aod::femtodreamparticle::cut & v0Sel.cutBit) == v0Sel.cutBit) && - (aod::femtodreamparticle::pt > v0Sel.ptV0Min) && - (aod::femtodreamparticle::pt < v0Sel.ptV0Max) && - (aod::femtodreamparticle::eta > v0Sel.etaV0Min) && - (aod::femtodreamparticle::eta < v0Sel.etaV0Max) && - (aod::femtodreamparticle::mLambda > v0Sel.invMassV0Min) && - (aod::femtodreamparticle::mLambda < v0Sel.invMassV0Max) && - (aod::femtodreamparticle::mAntiLambda > v0Sel.invMassAntiV0Min) && - (aod::femtodreamparticle::mAntiLambda < v0Sel.invMassAntiV0Max); + Partition partitionMcK0Short = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0K0Short)) && + ((aod::femtodreamparticle::cut & v0Sel.cutBit) == v0Sel.cutBit) && + (aod::femtodreamparticle::pt > v0Sel.ptV0Min) && + (aod::femtodreamparticle::pt < v0Sel.ptV0Max) && + (aod::femtodreamparticle::eta > v0Sel.etaV0Min) && + (aod::femtodreamparticle::eta < v0Sel.etaV0Max) && + (aod::femtodreamparticle::mLambda > v0Sel.invMassV0Min) && + (aod::femtodreamparticle::mLambda < v0Sel.invMassV0Max) && + (aod::femtodreamparticle::mAntiLambda > v0Sel.invMassAntiV0Min) && + (aod::femtodreamparticle::mAntiLambda < v0Sel.invMassAntiV0Max); /// Partition for particle 2 Partition partitionCharmHadron3Prong = aod::fdhf::bdtBkg < charmSel.charmHadBkgBDTmax && aod::fdhf::bdtFD < charmSel.charmHadFdBDTmax && aod::fdhf::bdtFD > charmSel.charmHadFdBDTmin&& aod::fdhf::bdtPrompt charmSel.charmHadPromptBDTmin; @@ -930,7 +930,7 @@ struct HfTaskCharmHadronsV0FemtoDream { PROCESS_SWITCH(HfTaskCharmHadronsV0FemtoDream, processDataDstarV0, "Enable processing DstarToD0Pi and V0 correlation", false); void processMcDplusV0(FilteredMcCollisions const& cols, - FilteredFDMcParts const& parts, + FDMcV0Particles const& parts, o2::aod::FDMCParticles const&, o2::aod::FDExtMCParticles const&, FilteredCharmMcCand3Prongs const&)