diff --git a/Common/DCAFitter/include/DCAFitter/DCAFitterN.h b/Common/DCAFitter/include/DCAFitter/DCAFitterN.h index 2e36f7588e8be..8ded804751de1 100644 --- a/Common/DCAFitter/include/DCAFitter/DCAFitterN.h +++ b/Common/DCAFitter/include/DCAFitter/DCAFitterN.h @@ -41,19 +41,20 @@ struct TrackCovI { // (otherwise for quazi-collinear tracks the X will not be constrained) float cyy = trc.getSigmaY2(), czz = trc.getSigmaZ2(), cyz = trc.getSigmaZY(), cxx = cyy * xerrFactor; float detYZ = cyy * czz - cyz * cyz; - if (detYZ > 0.) { - auto detYZI = 1. / detYZ; - sxx = 1. / cxx; - syy = czz * detYZI; - syz = -cyz * detYZI; - szz = cyy * detYZI; - } else { + if (detYZ <= 0.) { #ifndef GPUCA_GPUCODE - throw std::runtime_error("invalid track covariance"); + printf("overriding invalid track covariance from %s\n", trc.asString().c_str()); #else - printf("invalid track covariance\n"); + printf("overriding invalid track covariance cyy:%e czz:%e cyz:%e\n", cyy, czz, cyz); #endif + cyz = o2::gpu::GPUCommonMath::Sqrt(cyy * czz) * (cyz > 0 ? 0.98f : -0.98f); + detYZ = cyy * czz - cyz * cyz; } + auto detYZI = 1. / detYZ; + sxx = 1. / cxx; + syy = czz * detYZI; + syz = -cyz * detYZI; + szz = cyy * detYZI; } }; diff --git a/Detectors/GLOQC/src/MatchITSTPCQC.cxx b/Detectors/GLOQC/src/MatchITSTPCQC.cxx index f0345175b9a59..6e14f9eb16c8b 100644 --- a/Detectors/GLOQC/src/MatchITSTPCQC.cxx +++ b/Detectors/GLOQC/src/MatchITSTPCQC.cxx @@ -477,6 +477,21 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx) if (mTimestamp == -1 && mDoK0QC) { // we have not yet initialized the SVertexer params; let's do it ctx.inputs().get("SVParam"); + const auto& svparam = o2::vertexing::SVertexerParams::Instance(); + mFitterV0.setUseAbsDCA(svparam.useAbsDCA); + mFitterV0.setMaxR(svparam.maxRIni); + mFitterV0.setMinParamChange(svparam.minParamChange); + mFitterV0.setMinRelChi2Change(svparam.minRelChi2Change); + mFitterV0.setMaxDZIni(svparam.maxDZIni); + mFitterV0.setMaxDXYIni(svparam.maxDXYIni); + mFitterV0.setMaxChi2(svparam.maxChi2); + mFitterV0.setMatCorrType(o2::base::Propagator::MatCorrType(svparam.matCorr)); + mFitterV0.setUsePropagator(svparam.usePropagator); + mFitterV0.setRefitWithMatCorr(svparam.refitWithMatCorr); + mFitterV0.setMaxStep(svparam.maxStep); + mFitterV0.setMaxSnp(svparam.maxSnp); + mFitterV0.setMinXSeed(svparam.minXSeed); + mTimestamp = ctx.services().get().creation; auto grplhcif = o2::base::GRPGeomHelper::instance().getGRPLHCIF(); if (grplhcif->getBeamZ(0) != 1 || grplhcif->getBeamZ(1) != 1) { @@ -962,6 +977,7 @@ void MatchITSTPCQC::run(o2::framework::ProcessingContext& ctx) if (mDoK0QC && mRecoCont.getPrimaryVertices().size() > 0) { // now doing K0S + mFitterV0.setBz(mBz); const auto pvertices = mRecoCont.getPrimaryVertices(); LOG(info) << "****** Number of PVs = " << pvertices.size();