@@ -523,8 +523,8 @@ struct HfCandidateCreatorXic0Omegac0Qa {
523523
524524 float phi, theta;
525525 getPointDirection (std::array{primaryVertex.getX (), primaryVertex.getY (), primaryVertex.getZ ()}, secondaryVertex, phi, theta);
526- auto errorDecayLength = std::sqrt (getRotatedCovMatrixXX (covMatrixPV, phi, theta) + getRotatedCovMatrixXX (covMatrixSV, phi, theta));
527- auto errorDecayLengthXY = std::sqrt (getRotatedCovMatrixXX (covMatrixPV, phi, 0 .) + getRotatedCovMatrixXX (covMatrixSV, phi, 0 .));
526+ float errorDecayLength = std::sqrt (getRotatedCovMatrixXX (covMatrixPV, phi, theta) + getRotatedCovMatrixXX (covMatrixSV, phi, theta));
527+ float errorDecayLengthXY = std::sqrt (getRotatedCovMatrixXX (covMatrixPV, phi, 0 .) + getRotatedCovMatrixXX (covMatrixSV, phi, 0 .));
528528
529529 // Impact parameters computed with propagatToDCABxByBz method
530530 auto trackParCovV0DauPos = getTrackParCov (posTrack);
@@ -833,6 +833,13 @@ struct HfCandidateCreatorXic0Omegac0Qa {
833833 kfCharmBaryonToPv.SetProductionVertex (kfPv);
834834
835835 // ----------Calculate physical quantities -------------
836+ std::array<float , 3 > pvCoord = {collision.posX (), collision.posY (), collision.posZ ()};
837+ std::array<float , 3 > svCoord = {kfCharmBaryon.GetX (), kfCharmBaryon.GetY (), kfCharmBaryon.GetZ ()};
838+ std::array<float , 3 > vertexV0 = {kfV0.GetX (), kfV0.GetY (), kfV0.GetZ ()};
839+ std::array<float , 3 > vertexCasc = {kfCasc.GetX (), kfCasc.GetY (), kfCasc.GetZ ()};
840+ std::array<float , 3 > pVecV0 = {kfV0.GetPx (), kfV0.GetPy (), kfV0.GetPz ()};
841+ std::array<float , 3 > pVecCasc = {kfCasc.GetPx (), kfCasc.GetPy (), kfCasc.GetPz ()};
842+
836843 auto trackParCovV0DauPos = getTrackParCovFromKFP (kfPos, convertPDGIntoPID (kfPos.GetPDG ()), 1 );
837844 auto trackParCovV0DauNeg = getTrackParCovFromKFP (kfNeg, convertPDGIntoPID (kfNeg.GetPDG ()), -1 );
838845 auto trackParCovBach = getTrackParCovFromKFP (kfBachToCasc, convertPDGIntoPID (kfBachToCasc.GetPDG ()), bachCharge);
@@ -860,6 +867,17 @@ struct HfCandidateCreatorXic0Omegac0Qa {
860867 float kfDcaCascDaughters = kfBachToCasc.GetDistanceFromParticle (kfV0ToCasc);
861868 float kfDcaCharmBaryonDaughters = kfCharmBachToCharmBaryon.GetDistanceFromParticle (kfCascToCharmBaryon);
862869
870+ // Calculate error of decay length using covariance matrix of PV and SV, same as in DCAFitter
871+ float covMatrixPv[6 ];
872+ kfVertex.GetCovarianceMatrix (covMatrixPv);
873+ auto * covMatrixSV = kfCharmBaryon.CovarianceMatrix ();
874+
875+ double phi, theta;
876+ getPointDirection (pvCoord, svCoord, phi, theta);
877+ float errorDecayLength = std::sqrt (getRotatedCovMatrixXX (covMatrixPv, phi, theta) + getRotatedCovMatrixXX (covMatrixSV, phi, theta));
878+ float errorDecayLengthXY = std::sqrt (getRotatedCovMatrixXX (covMatrixPv, phi, 0 .) + getRotatedCovMatrixXX (covMatrixSV, phi, 0 .));
879+
880+ // Calculate normalised decay length using KFParticle
863881 float dlV0, errDlV0;
864882 kfV0ToPv.GetDecayLength (dlV0, errDlV0);
865883 dlV0 = std::abs (dlV0); // KFParticle returns a signed decay length
@@ -873,13 +891,6 @@ struct HfCandidateCreatorXic0Omegac0Qa {
873891 kfCharmBaryonToPv.GetDecayLengthXY (dlXYCharmBaryon, errDlXYCharmBaryon);
874892 dlCharmBaryon = std::abs (dlCharmBaryon);
875893
876- std::array<float , 3 > pvCoord = {collision.posX (), collision.posY (), collision.posZ ()};
877- std::array<float , 3 > svCoord = {kfCharmBaryon.GetX (), kfCharmBaryon.GetY (), kfCharmBaryon.GetZ ()};
878- std::array<float , 3 > vertexV0 = {kfV0.GetX (), kfV0.GetY (), kfV0.GetZ ()};
879- std::array<float , 3 > vertexCasc = {kfCasc.GetX (), kfCasc.GetY (), kfCasc.GetZ ()};
880- std::array<float , 3 > pVecV0 = {kfV0.GetPx (), kfV0.GetPy (), kfV0.GetPz ()};
881- std::array<float , 3 > pVecCasc = {kfCasc.GetPx (), kfCasc.GetPy (), kfCasc.GetPz ()};
882-
883894 float cosPaCascToPv = RecoDecay::cpa (pvCoord, vertexCasc, pVecCasc);
884895 float cosPaXYCascToPv = RecoDecay::cpaXY (pvCoord, vertexCasc, pVecCasc);
885896 float cosPaV0ToPv = RecoDecay::cpa (pvCoord, vertexV0, pVecV0);
@@ -896,7 +907,7 @@ struct HfCandidateCreatorXic0Omegac0Qa {
896907 kfCharmBaryon.GetX (), kfCharmBaryon.GetY (), kfCharmBaryon.GetZ (),
897908 kfCasc.GetX (), kfCasc.GetY (), kfCasc.GetZ (),
898909 kfV0.GetX (), kfV0.GetY (), kfV0.GetZ (),
899- errDlCharmBaryon, errDlXYCharmBaryon ,
910+ errorDecayLength, errorDecayLengthXY ,
900911 kfCascToCharmBaryon.GetPx (), kfCascToCharmBaryon.GetPy (), kfCascToCharmBaryon.GetPz (),
901912 kfCharmBachToCharmBaryon.GetPx (), kfCharmBachToCharmBaryon.GetPy (), kfCharmBachToCharmBaryon.GetPz (),
902913 impactParameterCasc.getY (), impactParameterCharmBach.getY (),
0 commit comments