Skip to content

Commit d10e854

Browse files
committed
Add missing protection in femto dream container in case of HF-V0 combinations
1 parent dd03005 commit d10e854

2 files changed

Lines changed: 13 additions & 13 deletions

File tree

PWGCF/FemtoDream/Core/femtoDreamContainer.h

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -367,18 +367,21 @@ class FemtoDreamContainer
367367
if constexpr (isMC) {
368368
if constexpr (isHF) {
369369
// calculate the femto observable and the mT with MC truth information
370-
if constexpr (mFemtoObs == femtoDreamContainer::Observable::kstar) {
371-
femtoObsMC = FemtoDreamMath::getkstar(part1.fdMCParticle(), mMassOne, part2, mMassTwo);
372-
}
373-
const float mTMC = FemtoDreamMath::getmT(part1.fdMCParticle(), mMassOne, part2, mMassTwo);
374-
375-
if (std::abs(part1.fdMCParticle().pdgMCTruth()) == mPDGOne) { // Note: all pair-histogramms are filled with MC truth information ONLY in case of non-fake candidates
376-
setPair_base<o2::aod::femtodreamMCparticle::MCType::kTruth>(femtoObsMC, mTMC, part1.fdMCParticle(), part2, mult, multPercentile, use4dplots, extendedplots);
377-
setPair_MC(femtoObsMC, femtoObs, mT, mult, part1.fdMCParticle().partOriginMCTruth(), part2.flagMc(), smearingByOrigin);
370+
if (part1.has_fdMCParticle()) {
371+
if constexpr (mFemtoObs == femtoDreamContainer::Observable::kstar) {
372+
femtoObsMC = FemtoDreamMath::getkstar(part1.fdMCParticle(), mMassOne, part2, mMassTwo);
373+
}
374+
const float mTMC = FemtoDreamMath::getmT(part1.fdMCParticle(), mMassOne, part2, mMassTwo);
375+
376+
if (std::abs(part1.fdMCParticle().pdgMCTruth()) == mPDGOne) { // Note: all pair-histogramms are filled with MC truth information ONLY in case of non-fake candidates
377+
setPair_base<o2::aod::femtodreamMCparticle::MCType::kTruth>(femtoObsMC, mTMC, part1.fdMCParticle(), part2, mult, multPercentile, use4dplots, extendedplots);
378+
setPair_MC(femtoObsMC, femtoObs, mT, mult, part1.fdMCParticle().partOriginMCTruth(), part2.flagMc(), smearingByOrigin);
379+
} else {
380+
mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtodreamMCparticle::MCTypeName[o2::aod::femtodreamMCparticle::MCType::kTruth]) + HIST("/hFakePairsCounter"), 0);
381+
}
378382
} else {
379-
mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtodreamMCparticle::MCTypeName[o2::aod::femtodreamMCparticle::MCType::kTruth]) + HIST("/hFakePairsCounter"), 0);
383+
mHistogramRegistry->fill(HIST(mFolderSuffix[mEventType]) + HIST(o2::aod::femtodreamMCparticle::MCTypeName[o2::aod::femtodreamMCparticle::MCType::kTruth]) + HIST("/hNoMCtruthPairsCounter"), 0);
380384
}
381-
382385
} else if (part1.has_fdMCParticle() && part2.has_fdMCParticle()) {
383386
// calculate the femto observable and the mT with MC truth information
384387
if constexpr (mFemtoObs == femtoDreamContainer::Observable::kstar) {

PWGHF/HFC/TableProducer/producerCharmHadronsV0FemtoDream.cxx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -579,21 +579,18 @@ struct HfProducerCharmHadronsV0FemtoDream {
579579
}
580580
} else {
581581
// positive daughter
582-
outputPartsMc(aod::femtodreamMCparticle::ParticleOriginMCTruth::kFake, 0, -1.f, -1.f, -1.f);
583582
outputPartsMcLabels(-1);
584583
if (isDebug) {
585584
outputPartsExtMcLabels(-1);
586585
outputDebugPartsMc(0);
587586
}
588587
// negative daughter
589-
outputPartsMc(aod::femtodreamMCparticle::ParticleOriginMCTruth::kFake, 0, -1.f, -1.f, -1.f);
590588
outputPartsMcLabels(-1);
591589
if (isDebug) {
592590
outputPartsExtMcLabels(-1);
593591
outputDebugPartsMc(0);
594592
}
595593
// V0
596-
outputPartsMc(aod::femtodreamMCparticle::ParticleOriginMCTruth::kFake, 0, -1.f, -1.f, -1.f);
597594
outputPartsMcLabels(-1);
598595
if (isDebug) {
599596
outputPartsExtMcLabels(-1);

0 commit comments

Comments
 (0)