@@ -183,6 +183,7 @@ constexpr float charges[5]{1.f, 1.f, 1.f, 2.f, 2.f};
183183constexpr float masses[5 ]{MassProton, MassDeuteron, MassTriton, MassHelium3, MassAlpha};
184184static const std::vector<std::string> matter{" M" , " A" };
185185static const std::vector<std::string> pidName{" TPC" , " TOF" };
186+ static const std::vector<int > hfMothCodes{511 , 521 , 531 , 541 , 5122 }; // b-mesons + Lambda_b
186187static const std::vector<std::string> names{" proton" , " deuteron" , " triton" , " He3" , " alpha" };
187188static const std::vector<std::string> treeConfigNames{" Filter trees" , " Use TOF selection" };
188189static const std::vector<std::string> flowConfigNames{" Save flow hists" };
@@ -948,6 +949,17 @@ struct nucleiSpectra {
948949 if (particle.getProcess () == 4 ) {
949950 c.fromWeakDecay = true ;
950951 }
952+ } else {
953+ // if the particle has a hf mother it is flagged as secondary
954+ if (particle.has_mothers ()) {
955+ for (auto & motherparticle : particle.mothers_as <aod::McParticles>()) {
956+ if (std::find (nuclei::hfMothCodes.begin (), nuclei::hfMothCodes.end (), std::abs (motherparticle.pdgCode ())) != nuclei::hfMothCodes.end ()) {
957+ c.isSecondary = true ;
958+ c.fromWeakDecay = true ;
959+ break ;
960+ }
961+ }
962+ }
951963 }
952964
953965 if (c.fillDCAHist && cfgDCAHists->get (iS, c.pt < 0 )) {
@@ -962,6 +974,15 @@ struct nucleiSpectra {
962974 isReconstructed[particle.globalIndex ()] = true ;
963975 if (particle.isPhysicalPrimary ()) {
964976 c.flags |= kIsPhysicalPrimary ;
977+ if (particle.has_mothers ()) {
978+ for (auto & motherparticle : particle.mothers_as <aod::McParticles>()) {
979+ if (std::find (nuclei::hfMothCodes.begin (), nuclei::hfMothCodes.end (), std::abs (motherparticle.pdgCode ())) != nuclei::hfMothCodes.end ()) {
980+ c.flags |= kIsSecondaryFromWeakDecay ;
981+ MotherpdgCode = motherparticle.pdgCode ();
982+ break ;
983+ }
984+ }
985+ }
965986 } else if (particle.has_mothers ()) {
966987 c.flags |= kIsSecondaryFromWeakDecay ;
967988 for (auto & motherparticle : particle.mothers_as <aod::McParticles>()) {
0 commit comments