Skip to content

Commit

Permalink
EventFiltering/PWGHF: fix sign of pion bachelor in B+ -> D0bar pi+ (#…
Browse files Browse the repository at this point in the history
…8187)

Co-authored-by: ALICE Action Bot <[email protected]>
  • Loading branch information
fgrosa and alibuild authored Oct 29, 2024
1 parent 926cf55 commit 9649dea
Showing 1 changed file with 41 additions and 39 deletions.
80 changes: 41 additions & 39 deletions EventFiltering/PWGHF/HFFilter.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ struct HfFilter { // Main struct for HF triggers

if (!keepEvent[kBeauty3P] && isBeautyTagged) {
auto isTrackSelected = helper.isSelectedTrackForSoftPionOrBeauty(track, trackParThird, dcaThird, kBeauty3P);
if (isTrackSelected && ((TESTBIT(selD0, 0) && track.sign() > 0) || (TESTBIT(selD0, 1) && track.sign() < 0))) {
if (TESTBIT(isTrackSelected, kForBeauty) && ((TESTBIT(selD0, 0) && track.sign() < 0) || (TESTBIT(selD0, 1) && track.sign() > 0))) { // D0 pi- and D0bar pi+
auto massCand = RecoDecay::m(std::array{pVec2Prong, pVecThird}, std::array{massD0, massPi});
auto pVecBeauty3Prong = RecoDecay::pVec(pVec2Prong, pVecThird);
auto ptCand = RecoDecay::pt(pVecBeauty3Prong);
Expand All @@ -441,47 +441,49 @@ struct HfFilter { // Main struct for HF triggers
if (activateQA) {
hMassVsPtB[kBplus]->Fill(ptCand, massCand);
}
} else if (TESTBIT(isTrackSelected, kSoftPionForBeauty)) {
std::array<float, 2> massDausD0{massPi, massKa};
auto massD0dau = massD0Cand;
if (track.sign() < 0) {
massDausD0[0] = massKa;
massDausD0[1] = massPi;
massD0dau = massD0BarCand;
}
} else if (TESTBIT(isTrackSelected, kSoftPionForBeauty) && ((TESTBIT(selD0, 0) && track.sign() > 0) || (TESTBIT(selD0, 1) && track.sign() < 0))) { // D0 pi+ and D0bar pi-
auto pVecBeauty3Prong = RecoDecay::pVec(pVec2Prong, pVecThird);
auto ptCand = RecoDecay::pt(pVecBeauty3Prong);
std::array<float, 2> massDausD0{massPi, massKa};
auto massD0dau = massD0Cand;
if (track.sign() < 0) {
massDausD0[0] = massKa;
massDausD0[1] = massPi;
massD0dau = massD0BarCand;
}
auto massDstarCand = RecoDecay::m(std::array{pVecPos, pVecNeg, pVecThird}, std::array{massDausD0[0], massDausD0[1], massPi});
auto massDiffDstar = massDstarCand - massD0dau;
if (cutsPtDeltaMassCharmReso->get(0u, 0u) <= massDiffDstar && massDiffDstar <= cutsPtDeltaMassCharmReso->get(1u, 0u) && ptCand > cutsPtDeltaMassCharmReso->get(2u, 0u)) { // additional check for B0->D*pi polarization studies
if (activateQA) {
hMassVsPtC[kNCharmParticles]->Fill(ptCand, massDiffDstar);
}
auto massDstarCand = RecoDecay::m(std::array{pVecPos, pVecNeg, pVecThird}, std::array{massDausD0[0], massDausD0[1], massPi});
auto massDiffDstar = massDstarCand - massD0dau;
if (cutsPtDeltaMassCharmReso->get(0u, 0u) <= massDiffDstar && massDiffDstar <= cutsPtDeltaMassCharmReso->get(1u, 0u) && ptCand > cutsPtDeltaMassCharmReso->get(2u, 0u)) { // additional check for B0->D*pi polarization studies
if (activateQA) {
hMassVsPtC[kNCharmParticles]->Fill(ptCand, massDiffDstar);
for (const auto& trackIdB : trackIdsThisCollision) { // start loop over tracks
auto trackB = trackIdB.track_as<BigTracksPID>();
if (track.globalIndex() == trackB.globalIndex()) {
continue;
}
auto trackParFourth = getTrackPar(trackB);
o2::gpu::gpustd::array<float, 2> dcaFourth{trackB.dcaXY(), trackB.dcaZ()};
std::array<float, 3> pVecFourth = trackB.pVector();
if (trackB.collisionId() != thisCollId) {
o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackParFourth, 2.f, noMatCorr, &dcaFourth);
getPxPyPz(trackParFourth, pVecFourth);
}
for (const auto& trackIdB : trackIdsThisCollision) { // start loop over tracks
auto trackB = trackIdB.track_as<BigTracksPID>();
if (track.globalIndex() == trackB.globalIndex()) {
continue;
}
auto trackParFourth = getTrackPar(trackB);
o2::gpu::gpustd::array<float, 2> dcaFourth{trackB.dcaXY(), trackB.dcaZ()};
std::array<float, 3> pVecFourth = trackB.pVector();
if (trackB.collisionId() != thisCollId) {
o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackParFourth, 2.f, noMatCorr, &dcaFourth);
getPxPyPz(trackParFourth, pVecFourth);
}

auto isTrackFourthSelected = helper.isSelectedTrackForSoftPionOrBeauty(trackB, trackParFourth, dcaFourth, kBeauty3P);
if (track.sign() * trackB.sign() < 0 && TESTBIT(isTrackFourthSelected, kForBeauty)) {
auto massCandB0 = RecoDecay::m(std::array{pVecBeauty3Prong, pVecFourth}, std::array{massDStar, massPi});
if (std::fabs(massCandB0 - massB0) <= deltaMassBeauty->get(0u, 2u)) {
keepEvent[kBeauty3P] = true;
// fill optimisation tree for D0
if (applyOptimisation) {
optimisationTreeBeauty(thisCollId, 413, pt2Prong, scores[0], scores[1], scores[2], dcaFourth[0]); // pdgCode of D*(2010)+: 413
}
if (activateQA) {
auto pVecBeauty4Prong = RecoDecay::pVec(pVec2Prong, pVecThird, pVecFourth);
auto ptCandBeauty4Prong = RecoDecay::pt(pVecBeauty4Prong);
hMassVsPtB[kB0toDStar]->Fill(ptCandBeauty4Prong, massCandB0);
}
auto isTrackFourthSelected = helper.isSelectedTrackForSoftPionOrBeauty(trackB, trackParFourth, dcaFourth, kBeauty3P);
if (track.sign() * trackB.sign() < 0 && TESTBIT(isTrackFourthSelected, kForBeauty)) {
auto massCandB0 = RecoDecay::m(std::array{pVecBeauty3Prong, pVecFourth}, std::array{massDStar, massPi});
if (std::fabs(massCandB0 - massB0) <= deltaMassBeauty->get(0u, 2u)) {
keepEvent[kBeauty3P] = true;
// fill optimisation tree for D0
if (applyOptimisation) {
optimisationTreeBeauty(thisCollId, 413, pt2Prong, scores[0], scores[1], scores[2], dcaFourth[0]); // pdgCode of D*(2010)+: 413
}
if (activateQA) {
auto pVecBeauty4Prong = RecoDecay::pVec(pVec2Prong, pVecThird, pVecFourth);
auto ptCandBeauty4Prong = RecoDecay::pt(pVecBeauty4Prong);
hMassVsPtB[kB0toDStar]->Fill(ptCandBeauty4Prong, massCandB0);
}
}
}
Expand Down

0 comments on commit 9649dea

Please sign in to comment.