Skip to content

Commit

Permalink
PWGLF: Fix PV cov matrix entry and gen decay vertex array in KF hyper…
Browse files Browse the repository at this point in the history
…triton 3-body reconstruction (#8148)
  • Loading branch information
creetz16 authored Oct 25, 2024
1 parent 1e20dde commit 74941af
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 18 deletions.
2 changes: 1 addition & 1 deletion PWGLF/TableProducer/Nuspex/decay3bodybuilder.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -768,7 +768,7 @@ struct decay3bodyBuilder {
auto trackParCovPVNeg = trackParCovNeg;
auto trackParCovPVBach = trackParCovBach;
mPV.setPos({collision.posX(), collision.posY(), collision.posZ()});
mPV.setCov(collision.covXX(), collision.covXX(), collision.covYY(), collision.covXZ(), collision.covYZ(), collision.covZZ());
mPV.setCov(collision.covXX(), collision.covXY(), collision.covYY(), collision.covXZ(), collision.covYZ(), collision.covZZ());
o2::base::Propagator::Instance()->propagateToDCABxByBz(mPV, trackParCovPVPos, 2.f, matCorr, &mDcaInfoCovPos);
o2::base::Propagator::Instance()->propagateToDCABxByBz(mPV, trackParCovPVNeg, 2.f, matCorr, &mDcaInfoCovNeg);
o2::base::Propagator::Instance()->propagateToDCABxByBz(mPV, trackParCovPVBach, 2.f, matCorr, &mDcaInfoCovBach);
Expand Down
24 changes: 7 additions & 17 deletions PWGLF/TableProducer/Nuspex/threebodyKFTask.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,7 @@ struct threebodyKFTask {
if ((MCvtx3body.pdgCode() == motherPdgCode && lMCTrack0.pdgCode() == 2212 && lMCTrack1.pdgCode() == -211 && lMCTrack2.pdgCode() == bachelorPdgCode) ||
(MCvtx3body.pdgCode() == -motherPdgCode && lMCTrack0.pdgCode() == 211 && lMCTrack1.pdgCode() == -2212 && lMCTrack2.pdgCode() == -bachelorPdgCode)) {
vtx3bodyPDGcode = MCvtx3body.pdgCode();
genDecVtx[0] = lMCTrack0.vx();
genDecVtx[0] = lMCTrack0.vy();
genDecVtx[0] = lMCTrack0.vz();
genDecVtx = {lMCTrack0.vx(), lMCTrack0.vy(), lMCTrack0.vz()};
MClifetime = RecoDecay::sqrtSumOfSquares(lMCTrack2.vx() - MCvtx3body.vx(), lMCTrack2.vy() - MCvtx3body.vy(), lMCTrack2.vz() - MCvtx3body.vz()) * o2::constants::physics::MassHyperTriton / MCvtx3body.p();
genPhi = MCvtx3body.phi();
genEta = MCvtx3body.eta();
Expand Down Expand Up @@ -318,16 +316,12 @@ struct threebodyKFTask {
std::array<float, 3> piMinusMom{0.f};
for (auto& mcparticleDaughter : mcparticle.template daughters_as<aod::McParticles>()) {
if (mcparticleDaughter.pdgCode() == 2212) {
protonMom[0] = mcparticleDaughter.px();
protonMom[1] = mcparticleDaughter.py();
protonMom[2] = mcparticleDaughter.pz();
protonMom = {mcparticleDaughter.px(), mcparticleDaughter.py(), mcparticleDaughter.pz()};
} else if (mcparticleDaughter.pdgCode() == -211) {
piMinusMom[0] = mcparticleDaughter.px();
piMinusMom[1] = mcparticleDaughter.py();
piMinusMom[2] = mcparticleDaughter.pz();
piMinusMom = {mcparticleDaughter.px(), mcparticleDaughter.py(), mcparticleDaughter.pz()};
}
}
genMCmassPrPi = RecoDecay::m(array{array{protonMom[0], protonMom[1], protonMom[2]}, array{piMinusMom[0], piMinusMom[1], piMinusMom[2]}}, array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged});
genMCmassPrPi = RecoDecay::m(array{protonMom, piMinusMom}, array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged});
registry.fill(HIST("hTrueHypertritonMCMassPrPi_nonReco"), genMCmassPrPi);
registry.fill(HIST("hTrueHypertritonMCPtProton_nonReco"), RecoDecay::sqrtSumOfSquares(protonMom[0], protonMom[1]));
registry.fill(HIST("hTrueHypertritonMCPtPion_nonReco"), RecoDecay::sqrtSumOfSquares(piMinusMom[0], piMinusMom[1]));
Expand All @@ -338,16 +332,12 @@ struct threebodyKFTask {
std::array<float, 3> piPlusMom{0.f};
for (auto& mcparticleDaughter : mcparticle.template daughters_as<aod::McParticles>()) {
if (mcparticleDaughter.pdgCode() == -2212) {
antiProtonMom[0] = mcparticleDaughter.px();
antiProtonMom[1] = mcparticleDaughter.py();
antiProtonMom[2] = mcparticleDaughter.pz();
antiProtonMom = {mcparticleDaughter.px(), mcparticleDaughter.py(), mcparticleDaughter.pz()};
} else if (mcparticleDaughter.pdgCode() == 211) {
piPlusMom[0] = mcparticleDaughter.px();
piPlusMom[1] = mcparticleDaughter.py();
piPlusMom[2] = mcparticleDaughter.pz();
piPlusMom = {mcparticleDaughter.px(), mcparticleDaughter.py(), mcparticleDaughter.pz()};
}
}
genMCmassPrPi = RecoDecay::m(array{array{antiProtonMom[0], antiProtonMom[1], antiProtonMom[2]}, array{piPlusMom[0], piPlusMom[1], piPlusMom[2]}}, array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged});
genMCmassPrPi = RecoDecay::m(array{antiProtonMom, piPlusMom}, array{o2::constants::physics::MassProton, o2::constants::physics::MassPionCharged});
registry.fill(HIST("hTrueAntiHypertritonMCMassPrPi_nonReco"), genMCmassPrPi);
registry.fill(HIST("hTrueAntiHypertritonMCPtProton_nonReco"), RecoDecay::sqrtSumOfSquares(antiProtonMom[0], antiProtonMom[1]));
registry.fill(HIST("hTrueAntiHypertritonMCPtPion_nonReco"), RecoDecay::sqrtSumOfSquares(piPlusMom[0], piPlusMom[1]));
Expand Down

0 comments on commit 74941af

Please sign in to comment.