Skip to content

Commit e276a40

Browse files
committed
Add generated matching
1 parent 6d2954c commit e276a40

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

PWGHF/D2H/TableProducer/dataCreatorCharmHadPiReduced.cxx

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,6 +1665,39 @@ struct HfDataCreatorCharmHadPiReduced {
16651665
tables.rowHfLbMcGenReduced(flag, ptParticle, yParticle, etaParticle,
16661666
ptProngs[0], yProngs[0], etaProngs[0],
16671667
ptProngs[1], yProngs[1], etaProngs[1], hfRejMap, centFT0C, centFT0M);
1668+
} else if constexpr (decayChannel == DecayChannel::B0ToDstarPi) {
1669+
// B0 → D* π+
1670+
if (RecoDecay::isMatchedMCGen<true>(particlesMc, particle, Pdg::kB0, std::array{+static_cast<int>(Pdg::kDStar), -kPiPlus}, true)) {
1671+
// Match D- -> π- K+ π-
1672+
auto candCMC = particlesMc.rawIteratorAt(particle.daughtersIds().front());
1673+
// Printf("Checking D- -> π- K+ π-");
1674+
if (RecoDecay::isMatchedMCGen(particlesMc, candCMC, +static_cast<int>(Pdg::kDStar), std::array{+kPiPlus, -kKPlus, +kPiPlus}, true, &sign, 3)) {
1675+
flag = sign * BIT(hf_cand_b0::DecayType::B0ToDstarPi);
1676+
}
1677+
}
1678+
1679+
// save information for B0 task
1680+
if (!TESTBIT(std::abs(flag), hf_cand_b0::DecayType::B0ToDstarPi)) {
1681+
continue;
1682+
}
1683+
1684+
auto ptParticle = particle.pt();
1685+
auto yParticle = RecoDecay::y(particle.pVector(), massB);
1686+
auto etaParticle = particle.eta();
1687+
1688+
std::array<float, 2> ptProngs;
1689+
std::array<float, 2> yProngs;
1690+
std::array<float, 2> etaProngs;
1691+
int counter = 0;
1692+
for (const auto& daught : particle.daughters_as<aod::McParticles>()) {
1693+
ptProngs[counter] = daught.pt();
1694+
etaProngs[counter] = daught.eta();
1695+
yProngs[counter] = RecoDecay::y(daught.pVector(), pdg->Mass(daught.pdgCode()));
1696+
counter++;
1697+
}
1698+
tables.rowHfB0McGenReduced(flag, -1 /*channel*/, ptParticle, yParticle, etaParticle,
1699+
ptProngs[0], yProngs[0], etaProngs[0],
1700+
ptProngs[1], yProngs[1], etaProngs[1], hfRejMap, centFT0C, centFT0M);
16681701
}
16691702
} // gen
16701703
}

PWGHF/DataModel/CandidateReconstructionTables.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2191,7 +2191,8 @@ DECLARE_SOA_COLUMN(FlagWrongCollision, flagWrongCollision, int8_t); // reconstru
21912191
DECLARE_SOA_COLUMN(DebugMcRec, debugMcRec, int8_t); // debug flag for mis-association reconstruction level
21922192

21932193
// mapping of decay types
2194-
enum DecayType { B0ToDPi = 0 };
2194+
enum DecayType { B0ToDPi = 0,
2195+
B0ToDstarPi};
21952196

21962197
enum DecayTypeMc : uint8_t { B0ToDplusPiToPiKPiPi = 0,
21972198
B0ToDsPiToKKPiPi,

0 commit comments

Comments
 (0)