Skip to content

Commit 734097f

Browse files
committed
Fix filling MC tables for Charm+V0 femto
1 parent 32ac930 commit 734097f

2 files changed

Lines changed: 73 additions & 24 deletions

File tree

PWGHF/HFC/TableProducer/producerCharmHadronsV0FemtoDream.cxx

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,10 @@ struct HfProducerCharmHadronsV0FemtoDream {
506506
constexpr int GenFromTransport = -1; // -1 if a particle produced during transport
507507
// get list of mothers, but it could be empty (for example in case of injected light nuclei)
508508
auto motherparticlesMc = particleMc.template mothers_as<aod::McParticles>();
509+
float ptPos{-1.f}, ptNeg{-1.f};
510+
float etaPos{-1.f}, etaNeg{-1.f};
511+
float phiPos{-1.f}, phiNeg{-1.f};
512+
int pdgCodePos{0}, pdgCodeNeg{0};
509513
// check pdg code
510514
// if this fails, the particle is a fake
511515
if (std::abs(pdgCode) == std::abs(v0PDGCode.value)) {
@@ -534,21 +538,66 @@ struct HfProducerCharmHadronsV0FemtoDream {
534538
} else {
535539
particleOrigin = aod::femtodreamMCparticle::ParticleOriginMCTruth::kElse;
536540
}
541+
for (auto const& dauMc : particleMc.template daughters_as<aod::McParticles>()) {
542+
if (dauMc.pdgCode() > 0) {
543+
ptPos = dauMc.pt();
544+
etaPos = dauMc.eta();
545+
phiPos = dauMc.phi();
546+
pdgCodePos = dauMc.pdgCode();
547+
} else {
548+
ptNeg = dauMc.pt();
549+
etaNeg = dauMc.eta();
550+
phiNeg = dauMc.phi();
551+
pdgCodeNeg = dauMc.pdgCode();
552+
}
553+
}
537554
// if pdg code is wrong, particle is fake
538555
} else {
539556
particleOrigin = aod::femtodreamMCparticle::ParticleOriginMCTruth::kFake;
540557
}
541558

559+
// positive daughter
560+
outputPartsMc(particleOrigin, pdgCodePos, ptPos, etaPos, phiPos);
561+
outputPartsMcLabels(outputPartsMc.lastIndex());
562+
if (isDebug) {
563+
outputPartsExtMcLabels(outputPartsMc.lastIndex());
564+
outputDebugPartsMc(pdgCode);
565+
}
566+
// negative daughter
567+
outputPartsMc(particleOrigin, pdgCodeNeg, ptNeg, etaNeg, phiNeg);
568+
outputPartsMcLabels(outputPartsMc.lastIndex());
569+
if (isDebug) {
570+
outputPartsExtMcLabels(outputPartsMc.lastIndex());
571+
outputDebugPartsMc(pdgCode);
572+
}
573+
// V0
542574
outputPartsMc(particleOrigin, pdgCode, particleMc.pt(), particleMc.eta(), particleMc.phi());
543575
outputPartsMcLabels(outputPartsMc.lastIndex());
544576
if (isDebug) {
545577
outputPartsExtMcLabels(outputPartsMc.lastIndex());
546578
outputDebugPartsMc(pdgCodeMother);
547579
}
548580
} else {
581+
// positive daughter
582+
outputPartsMc(aod::femtodreamMCparticle::ParticleOriginMCTruth::kFake, 0, -1.f, -1.f, -1.f);
583+
outputPartsMcLabels(-1);
584+
if (isDebug) {
585+
outputPartsExtMcLabels(-1);
586+
outputDebugPartsMc(0);
587+
}
588+
// negative daughter
589+
outputPartsMc(aod::femtodreamMCparticle::ParticleOriginMCTruth::kFake, 0, -1.f, -1.f, -1.f);
590+
outputPartsMcLabels(-1);
591+
if (isDebug) {
592+
outputPartsExtMcLabels(-1);
593+
outputDebugPartsMc(0);
594+
}
595+
// V0
596+
outputPartsMc(aod::femtodreamMCparticle::ParticleOriginMCTruth::kFake, 0, -1.f, -1.f, -1.f);
549597
outputPartsMcLabels(-1);
550598
if (isDebug) {
551599
outputPartsExtMcLabels(-1);
600+
outputDebugPartsMc(0);
552601
}
553602
}
554603
}

PWGHF/HFC/Tasks/taskCharmHadronsV0FemtoDream.cxx

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ struct HfTaskCharmHadronsV0FemtoDream {
177177
using FilteredMcCollisions = soa::Filtered<soa::Join<aod::FDCollisions, FDColMasks, aod::FDMCCollLabels>>;
178178
using FilteredMcColision = FilteredMcCollisions::iterator;
179179

180-
using FilteredFDMcParts = soa::Filtered<soa::Join<aod::FDParticles, aod::FDParticlesIndex, aod::FDExtParticles, aod::FDMCLabels, aod::FDExtMCLabels, aod::FDTrkTimeStamp>>;
181-
using FilteredFDMcPart = FilteredFDMcParts::iterator;
180+
using FDMcV0Particles = soa::Join<aod::FDParticles, aod::FDParticlesIndex, aod::FDExtParticles, aod::FDMCLabels, aod::FDExtMCLabels, aod::FDTrkTimeStamp>;
181+
using FDMcV0Particle = FDMcV0Particles::iterator;
182182

183183
using FDV0Particles = soa::Join<aod::FDParticles, aod::FDExtParticles, aod::FDParticlesIndex, aod::FDTrkTimeStamp>;
184184
using FDV0Particle = FDV0Particles::iterator;
@@ -189,7 +189,7 @@ struct HfTaskCharmHadronsV0FemtoDream {
189189
Filter hfMcSelFilter = (nabs(aod::fdhf::flagMc) == charmSel.charmHadMcSel);
190190

191191
Preslice<FDV0Particles> perCol = aod::femtodreamparticle::fdCollisionId;
192-
Preslice<FilteredFDMcParts> perColMc = aod::femtodreamparticle::fdCollisionId;
192+
Preslice<FDMcV0Particles> perColMc = aod::femtodreamparticle::fdCollisionId;
193193
Preslice<FilteredCharmCand3Prongs> perHf3ProngByCol = aod::femtodreamparticle::fdCollisionId;
194194
Preslice<FilteredCharmCand2Prongs> perHf2ProngByCol = aod::femtodreamparticle::fdCollisionId;
195195
Preslice<FilteredCharmCandDstars> perHfDstarByCol = aod::femtodreamparticle::fdCollisionId;
@@ -206,16 +206,16 @@ struct HfTaskCharmHadronsV0FemtoDream {
206206
(aod::femtodreamparticle::mAntiLambda > v0Sel.invMassAntiV0Min) &&
207207
(aod::femtodreamparticle::mAntiLambda < v0Sel.invMassAntiV0Max);
208208

209-
Partition<FilteredFDMcParts> partitionMcLambda = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0)) &&
210-
((aod::femtodreamparticle::cut & v0Sel.cutBit) == v0Sel.cutBit) &&
211-
(aod::femtodreamparticle::pt > v0Sel.ptV0Min) &&
212-
(aod::femtodreamparticle::pt < v0Sel.ptV0Max) &&
213-
(aod::femtodreamparticle::eta > v0Sel.etaV0Min) &&
214-
(aod::femtodreamparticle::eta < v0Sel.etaV0Max) &&
215-
(aod::femtodreamparticle::mLambda > v0Sel.invMassV0Min) &&
216-
(aod::femtodreamparticle::mLambda < v0Sel.invMassV0Max) &&
217-
(aod::femtodreamparticle::mAntiLambda > v0Sel.invMassAntiV0Min) &&
218-
(aod::femtodreamparticle::mAntiLambda < v0Sel.invMassAntiV0Max);
209+
Partition<FDMcV0Particles> partitionMcLambda = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0)) &&
210+
((aod::femtodreamparticle::cut & v0Sel.cutBit) == v0Sel.cutBit) &&
211+
(aod::femtodreamparticle::pt > v0Sel.ptV0Min) &&
212+
(aod::femtodreamparticle::pt < v0Sel.ptV0Max) &&
213+
(aod::femtodreamparticle::eta > v0Sel.etaV0Min) &&
214+
(aod::femtodreamparticle::eta < v0Sel.etaV0Max) &&
215+
(aod::femtodreamparticle::mLambda > v0Sel.invMassV0Min) &&
216+
(aod::femtodreamparticle::mLambda < v0Sel.invMassV0Max) &&
217+
(aod::femtodreamparticle::mAntiLambda > v0Sel.invMassAntiV0Min) &&
218+
(aod::femtodreamparticle::mAntiLambda < v0Sel.invMassAntiV0Max);
219219

220220
/// Partitions for particle K0Short
221221
Partition<FDV0Particles> partitionK0Short = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0K0Short)) &&
@@ -229,16 +229,16 @@ struct HfTaskCharmHadronsV0FemtoDream {
229229
(aod::femtodreamparticle::mAntiLambda > v0Sel.invMassAntiV0Min) &&
230230
(aod::femtodreamparticle::mAntiLambda < v0Sel.invMassAntiV0Max);
231231

232-
Partition<FilteredFDMcParts> partitionMcK0Short = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0K0Short)) &&
233-
((aod::femtodreamparticle::cut & v0Sel.cutBit) == v0Sel.cutBit) &&
234-
(aod::femtodreamparticle::pt > v0Sel.ptV0Min) &&
235-
(aod::femtodreamparticle::pt < v0Sel.ptV0Max) &&
236-
(aod::femtodreamparticle::eta > v0Sel.etaV0Min) &&
237-
(aod::femtodreamparticle::eta < v0Sel.etaV0Max) &&
238-
(aod::femtodreamparticle::mLambda > v0Sel.invMassV0Min) &&
239-
(aod::femtodreamparticle::mLambda < v0Sel.invMassV0Max) &&
240-
(aod::femtodreamparticle::mAntiLambda > v0Sel.invMassAntiV0Min) &&
241-
(aod::femtodreamparticle::mAntiLambda < v0Sel.invMassAntiV0Max);
232+
Partition<FDMcV0Particles> partitionMcK0Short = (aod::femtodreamparticle::partType == uint8_t(aod::femtodreamparticle::ParticleType::kV0K0Short)) &&
233+
((aod::femtodreamparticle::cut & v0Sel.cutBit) == v0Sel.cutBit) &&
234+
(aod::femtodreamparticle::pt > v0Sel.ptV0Min) &&
235+
(aod::femtodreamparticle::pt < v0Sel.ptV0Max) &&
236+
(aod::femtodreamparticle::eta > v0Sel.etaV0Min) &&
237+
(aod::femtodreamparticle::eta < v0Sel.etaV0Max) &&
238+
(aod::femtodreamparticle::mLambda > v0Sel.invMassV0Min) &&
239+
(aod::femtodreamparticle::mLambda < v0Sel.invMassV0Max) &&
240+
(aod::femtodreamparticle::mAntiLambda > v0Sel.invMassAntiV0Min) &&
241+
(aod::femtodreamparticle::mAntiLambda < v0Sel.invMassAntiV0Max);
242242

243243
/// Partition for particle 2
244244
Partition<FilteredCharmCand3Prongs> partitionCharmHadron3Prong = aod::fdhf::bdtBkg < charmSel.charmHadBkgBDTmax && aod::fdhf::bdtFD < charmSel.charmHadFdBDTmax && aod::fdhf::bdtFD > charmSel.charmHadFdBDTmin&& aod::fdhf::bdtPrompt<charmSel.charmHadPromptBDTmax && aod::fdhf::bdtPrompt> charmSel.charmHadPromptBDTmin;
@@ -930,7 +930,7 @@ struct HfTaskCharmHadronsV0FemtoDream {
930930
PROCESS_SWITCH(HfTaskCharmHadronsV0FemtoDream, processDataDstarV0, "Enable processing DstarToD0Pi and V0 correlation", false);
931931

932932
void processMcDplusV0(FilteredMcCollisions const& cols,
933-
FilteredFDMcParts const& parts,
933+
FDMcV0Particles const& parts,
934934
o2::aod::FDMCParticles const&,
935935
o2::aod::FDExtMCParticles const&,
936936
FilteredCharmMcCand3Prongs const&)

0 commit comments

Comments
 (0)