Skip to content

Commit 6f14fea

Browse files
authored
[PWGLF] Fix filling H3L absorption point (#17268)
1 parent 624b326 commit 6f14fea

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

PWGLF/TableProducer/Nuspex/hyperRecoTask.cxx

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -964,23 +964,26 @@ struct hyperRecoTask {
964964
// now we fill only the signal candidates that were not reconstructed
965965
for (const auto& mcPart : particlesMC) {
966966

967-
if (std::abs(mcPart.pdgCode()) != hyperPdg)
967+
if (std::abs(mcPart.pdgCode()) != hyperPdg) {
968968
continue;
969-
std::array<float, 3> secVtx;
969+
}
970+
std::array<float, 3> secVtx{0.f, 0.f, 0.f};
971+
std::array<float, 3> lastDaugVtx{0.f, 0.f, 0.f};
970972
std::array<float, 3> primVtx = {mcPart.vx(), mcPart.vy(), mcPart.vz()};
971973
std::array<float, 3> momMother = {mcPart.px(), mcPart.py(), mcPart.pz()};
972-
std::array<float, 3> momHe3;
974+
std::array<float, 3> momHe3{0.f, 0.f, 0.f};
973975
bool isHeFound = false;
974976
int mcProcess = {0};
975977
for (const auto& mcDaught : mcPart.daughters_as<aod::McParticles>()) {
978+
if (mcDaught.pdgCode() != PDG_t::kElectron) { // we do not care about delta electrons
979+
lastDaugVtx = {mcDaught.vx(), mcDaught.vy(), mcDaught.vz()};
980+
mcProcess = mcDaught.getProcess();
981+
}
976982
if (std::abs(mcDaught.pdgCode()) == heDauPdg) {
977-
secVtx = {mcDaught.vx(), mcDaught.vy(), mcDaught.vz()};
983+
secVtx = lastDaugVtx;
978984
momHe3 = {mcDaught.px(), mcDaught.py(), mcDaught.pz()};
979985
isHeFound = true;
980986
}
981-
if (mcDaught.pdgCode() != PDG_t::kElectron) { // we do not care about delta electrons
982-
mcProcess = mcDaught.getProcess();
983-
}
984987
}
985988
if (mcPart.pdgCode() > 0) {
986989
hIsMatterGen->Fill(0.);
@@ -1005,7 +1008,7 @@ struct hyperRecoTask {
10051008
hypCand.isSurvEvSelection = isSurvEvSelCollision[mcPart.mcCollisionId()];
10061009
int chargeFactor = -1 + 2 * (hypCand.pdgCode > 0);
10071010
for (int i = 0; i < 3; i++) {
1008-
hypCand.gDecVtx[i] = secVtx[i] - primVtx[i];
1011+
hypCand.gDecVtx[i] = (isHeFound ? secVtx[i] : lastDaugVtx[i]) - primVtx[i];
10091012
hypCand.gMom[i] = momMother[i];
10101013
hypCand.gMomHe3[i] = momHe3[i];
10111014
}

0 commit comments

Comments
 (0)