Skip to content

Commit 9649dea

Browse files
fgrosaalibuild
andauthored
EventFiltering/PWGHF: fix sign of pion bachelor in B+ -> D0bar pi+ (#8187)
Co-authored-by: ALICE Action Bot <alibuild@cern.ch>
1 parent 926cf55 commit 9649dea

1 file changed

Lines changed: 41 additions & 39 deletions

File tree

EventFiltering/PWGHF/HFFilter.cxx

Lines changed: 41 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ struct HfFilter { // Main struct for HF triggers
428428

429429
if (!keepEvent[kBeauty3P] && isBeautyTagged) {
430430
auto isTrackSelected = helper.isSelectedTrackForSoftPionOrBeauty(track, trackParThird, dcaThird, kBeauty3P);
431-
if (isTrackSelected && ((TESTBIT(selD0, 0) && track.sign() > 0) || (TESTBIT(selD0, 1) && track.sign() < 0))) {
431+
if (TESTBIT(isTrackSelected, kForBeauty) && ((TESTBIT(selD0, 0) && track.sign() < 0) || (TESTBIT(selD0, 1) && track.sign() > 0))) { // D0 pi- and D0bar pi+
432432
auto massCand = RecoDecay::m(std::array{pVec2Prong, pVecThird}, std::array{massD0, massPi});
433433
auto pVecBeauty3Prong = RecoDecay::pVec(pVec2Prong, pVecThird);
434434
auto ptCand = RecoDecay::pt(pVecBeauty3Prong);
@@ -441,47 +441,49 @@ struct HfFilter { // Main struct for HF triggers
441441
if (activateQA) {
442442
hMassVsPtB[kBplus]->Fill(ptCand, massCand);
443443
}
444-
} else if (TESTBIT(isTrackSelected, kSoftPionForBeauty)) {
445-
std::array<float, 2> massDausD0{massPi, massKa};
446-
auto massD0dau = massD0Cand;
447-
if (track.sign() < 0) {
448-
massDausD0[0] = massKa;
449-
massDausD0[1] = massPi;
450-
massD0dau = massD0BarCand;
444+
}
445+
} else if (TESTBIT(isTrackSelected, kSoftPionForBeauty) && ((TESTBIT(selD0, 0) && track.sign() > 0) || (TESTBIT(selD0, 1) && track.sign() < 0))) { // D0 pi+ and D0bar pi-
446+
auto pVecBeauty3Prong = RecoDecay::pVec(pVec2Prong, pVecThird);
447+
auto ptCand = RecoDecay::pt(pVecBeauty3Prong);
448+
std::array<float, 2> massDausD0{massPi, massKa};
449+
auto massD0dau = massD0Cand;
450+
if (track.sign() < 0) {
451+
massDausD0[0] = massKa;
452+
massDausD0[1] = massPi;
453+
massD0dau = massD0BarCand;
454+
}
455+
auto massDstarCand = RecoDecay::m(std::array{pVecPos, pVecNeg, pVecThird}, std::array{massDausD0[0], massDausD0[1], massPi});
456+
auto massDiffDstar = massDstarCand - massD0dau;
457+
if (cutsPtDeltaMassCharmReso->get(0u, 0u) <= massDiffDstar && massDiffDstar <= cutsPtDeltaMassCharmReso->get(1u, 0u) && ptCand > cutsPtDeltaMassCharmReso->get(2u, 0u)) { // additional check for B0->D*pi polarization studies
458+
if (activateQA) {
459+
hMassVsPtC[kNCharmParticles]->Fill(ptCand, massDiffDstar);
451460
}
452-
auto massDstarCand = RecoDecay::m(std::array{pVecPos, pVecNeg, pVecThird}, std::array{massDausD0[0], massDausD0[1], massPi});
453-
auto massDiffDstar = massDstarCand - massD0dau;
454-
if (cutsPtDeltaMassCharmReso->get(0u, 0u) <= massDiffDstar && massDiffDstar <= cutsPtDeltaMassCharmReso->get(1u, 0u) && ptCand > cutsPtDeltaMassCharmReso->get(2u, 0u)) { // additional check for B0->D*pi polarization studies
455-
if (activateQA) {
456-
hMassVsPtC[kNCharmParticles]->Fill(ptCand, massDiffDstar);
461+
for (const auto& trackIdB : trackIdsThisCollision) { // start loop over tracks
462+
auto trackB = trackIdB.track_as<BigTracksPID>();
463+
if (track.globalIndex() == trackB.globalIndex()) {
464+
continue;
465+
}
466+
auto trackParFourth = getTrackPar(trackB);
467+
o2::gpu::gpustd::array<float, 2> dcaFourth{trackB.dcaXY(), trackB.dcaZ()};
468+
std::array<float, 3> pVecFourth = trackB.pVector();
469+
if (trackB.collisionId() != thisCollId) {
470+
o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackParFourth, 2.f, noMatCorr, &dcaFourth);
471+
getPxPyPz(trackParFourth, pVecFourth);
457472
}
458-
for (const auto& trackIdB : trackIdsThisCollision) { // start loop over tracks
459-
auto trackB = trackIdB.track_as<BigTracksPID>();
460-
if (track.globalIndex() == trackB.globalIndex()) {
461-
continue;
462-
}
463-
auto trackParFourth = getTrackPar(trackB);
464-
o2::gpu::gpustd::array<float, 2> dcaFourth{trackB.dcaXY(), trackB.dcaZ()};
465-
std::array<float, 3> pVecFourth = trackB.pVector();
466-
if (trackB.collisionId() != thisCollId) {
467-
o2::base::Propagator::Instance()->propagateToDCABxByBz({collision.posX(), collision.posY(), collision.posZ()}, trackParFourth, 2.f, noMatCorr, &dcaFourth);
468-
getPxPyPz(trackParFourth, pVecFourth);
469-
}
470473

471-
auto isTrackFourthSelected = helper.isSelectedTrackForSoftPionOrBeauty(trackB, trackParFourth, dcaFourth, kBeauty3P);
472-
if (track.sign() * trackB.sign() < 0 && TESTBIT(isTrackFourthSelected, kForBeauty)) {
473-
auto massCandB0 = RecoDecay::m(std::array{pVecBeauty3Prong, pVecFourth}, std::array{massDStar, massPi});
474-
if (std::fabs(massCandB0 - massB0) <= deltaMassBeauty->get(0u, 2u)) {
475-
keepEvent[kBeauty3P] = true;
476-
// fill optimisation tree for D0
477-
if (applyOptimisation) {
478-
optimisationTreeBeauty(thisCollId, 413, pt2Prong, scores[0], scores[1], scores[2], dcaFourth[0]); // pdgCode of D*(2010)+: 413
479-
}
480-
if (activateQA) {
481-
auto pVecBeauty4Prong = RecoDecay::pVec(pVec2Prong, pVecThird, pVecFourth);
482-
auto ptCandBeauty4Prong = RecoDecay::pt(pVecBeauty4Prong);
483-
hMassVsPtB[kB0toDStar]->Fill(ptCandBeauty4Prong, massCandB0);
484-
}
474+
auto isTrackFourthSelected = helper.isSelectedTrackForSoftPionOrBeauty(trackB, trackParFourth, dcaFourth, kBeauty3P);
475+
if (track.sign() * trackB.sign() < 0 && TESTBIT(isTrackFourthSelected, kForBeauty)) {
476+
auto massCandB0 = RecoDecay::m(std::array{pVecBeauty3Prong, pVecFourth}, std::array{massDStar, massPi});
477+
if (std::fabs(massCandB0 - massB0) <= deltaMassBeauty->get(0u, 2u)) {
478+
keepEvent[kBeauty3P] = true;
479+
// fill optimisation tree for D0
480+
if (applyOptimisation) {
481+
optimisationTreeBeauty(thisCollId, 413, pt2Prong, scores[0], scores[1], scores[2], dcaFourth[0]); // pdgCode of D*(2010)+: 413
482+
}
483+
if (activateQA) {
484+
auto pVecBeauty4Prong = RecoDecay::pVec(pVec2Prong, pVecThird, pVecFourth);
485+
auto ptCandBeauty4Prong = RecoDecay::pt(pVecBeauty4Prong);
486+
hMassVsPtB[kB0toDStar]->Fill(ptCandBeauty4Prong, massCandB0);
485487
}
486488
}
487489
}

0 commit comments

Comments
 (0)