@@ -46,6 +46,9 @@ enum Observable { kstar ///< kstar
4646enum EventType { same, // /< Pair from same event
4747 mixed // /< Pair from mixed event
4848};
49+
50+ static constexpr int nMinMomComponents{4 }; // /< Minimum number of momentum components to compute the femto observable
51+
4952}; // namespace femtoDreamContainer
5053
5154// / \class FemtoDreamContainer
@@ -367,18 +370,21 @@ class FemtoDreamContainer
367370 if constexpr (isMC) {
368371 if constexpr (isHF) {
369372 // 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);
373+ if (part1.has_fdMCParticle ()) {
374+ if constexpr (mFemtoObs == femtoDreamContainer::Observable::kstar) {
375+ femtoObsMC = FemtoDreamMath::getkstar (part1.fdMCParticle (), mMassOne , part2, mMassTwo );
376+ }
377+ const float mTMC = FemtoDreamMath::getmT (part1.fdMCParticle (), mMassOne , part2, mMassTwo );
378+
379+ if (std::abs (part1.fdMCParticle ().pdgMCTruth ()) == mPDGOne ) { // Note: all pair-histogramms are filled with MC truth information ONLY in case of non-fake candidates
380+ setPair_base<o2::aod::femtodreamMCparticle::MCType::kTruth >(femtoObsMC, mTMC , part1.fdMCParticle (), part2, mult, multPercentile, use4dplots, extendedplots);
381+ setPair_MC (femtoObsMC, femtoObs, mT , mult, part1.fdMCParticle ().partOriginMCTruth (), part2.flagMc (), smearingByOrigin);
382+ } else {
383+ mHistogramRegistry ->fill (HIST (mFolderSuffix [mEventType ]) + HIST (o2::aod::femtodreamMCparticle::MCTypeName[o2::aod::femtodreamMCparticle::MCType::kTruth ]) + HIST (" /hFakePairsCounter" ), 0 );
384+ }
378385 } else {
379- mHistogramRegistry ->fill (HIST (mFolderSuffix [mEventType ]) + HIST (o2::aod::femtodreamMCparticle::MCTypeName[o2::aod::femtodreamMCparticle::MCType::kTruth ]) + HIST (" /hFakePairsCounter " ), 0 );
386+ mHistogramRegistry ->fill (HIST (mFolderSuffix [mEventType ]) + HIST (o2::aod::femtodreamMCparticle::MCTypeName[o2::aod::femtodreamMCparticle::MCType::kTruth ]) + HIST (" /hNoMCtruthPairsCounter " ), 0 );
380387 }
381-
382388 } else if (part1.has_fdMCParticle () && part2.has_fdMCParticle ()) {
383389 // calculate the femto observable and the mT with MC truth information
384390 if constexpr (mFemtoObs == femtoDreamContainer::Observable::kstar) {
@@ -517,7 +523,7 @@ class FemtoDreamContainer
517523 {
518524
519525 std::vector<double > k3d = FemtoDreamMath::newpairfunc (part1, mMassOne , part2, mMassTwo , IsSameSpecies);
520- if (k3d.size () < 4 ) {
526+ if (k3d.size () < femtoDreamContainer::nMinMomComponents ) {
521527 LOG (error) << " newpairfunc returned size=" << k3d.size ();
522528 return ;
523529 }
@@ -536,7 +542,7 @@ class FemtoDreamContainer
536542 if (part1.has_fdMCParticle () && part2.has_fdMCParticle ()) {
537543
538544 std::vector<double > k3dMC = FemtoDreamMath::newpairfuncMC (part1.fdMCParticle (), mMassOne , part2.fdMCParticle (), mMassTwo , IsSameSpecies);
539- if (k3dMC.size () < 4 ) {
545+ if (k3dMC.size () < femtoDreamContainer::nMinMomComponents ) {
540546 LOG (error) << " newpairfunc returned size=" << k3d.size ();
541547 return ;
542548 }
@@ -562,7 +568,7 @@ class FemtoDreamContainer
562568 {
563569
564570 std::vector<double > k3d = FemtoDreamMath::newpairfunc (part1, mMassOne , part2, mMassTwo , IsSameSpecies);
565- if (k3d.size () < 4 ) {
571+ if (k3d.size () < femtoDreamContainer::nMinMomComponents ) {
566572 LOG (error) << " newpairfunc returned size=" << k3d.size ();
567573 return ;
568574 }
@@ -581,7 +587,7 @@ class FemtoDreamContainer
581587 if (part1.has_fdMCParticle () && part2.has_fdMCParticle ()) {
582588
583589 std::vector<double > k3dMC = FemtoDreamMath::newpairfuncMC (part1.fdMCParticle (), mMassOne , part2.fdMCParticle (), mMassTwo , IsSameSpecies);
584- if (k3dMC.size () < 4 ) {
590+ if (k3dMC.size () < femtoDreamContainer::nMinMomComponents ) {
585591 LOG (error) << " newpairfunc returned size=" << k3d.size ();
586592 return ;
587593 }
0 commit comments