From 1894eff9ef2785872e1cf88b4ec87707ad8b3769 Mon Sep 17 00:00:00 2001 From: shahoian Date: Sun, 2 Feb 2025 21:03:44 +0100 Subject: [PATCH] Enhance DCAFitterN::print, allow resetting log throttlers --- Common/DCAFitter/include/DCAFitter/DCAFitterN.h | 17 +++++++++++++++-- Common/DCAFitter/test/testDCAFitterN.cxx | 6 +++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/Common/DCAFitter/include/DCAFitter/DCAFitterN.h b/Common/DCAFitter/include/DCAFitter/DCAFitterN.h index 6bd143eae44d6..97ea6d206247b 100644 --- a/Common/DCAFitter/include/DCAFitter/DCAFitterN.h +++ b/Common/DCAFitter/include/DCAFitter/DCAFitterN.h @@ -324,6 +324,13 @@ class DCAFitterN pnt[2] = tr.getZ(); } + GPUdi() void clearLogThrottlers() + { + mLoggerBadCov.clear(); + mLoggerBadInv.clear(); + mLoggerBadProp.clear(); + } + void setBadCovPolicy(BadCovPolicy v) { mBadCovPolicy = v; } BadCovPolicy getBadCovPolicy() const { return mBadCovPolicy; } @@ -1084,10 +1091,16 @@ template GPUd() void DCAFitterN::print() const { #ifndef GPUCA_GPUCODE_DEVICE - LOG(info) << N << "-prong vertex fitter in " << (mUseAbsDCA ? "abs." : "weighted") << " distance minimization mode"; - LOG(info) << "Bz: " << mBz << " MaxIter: " << mMaxIter << " MaxChi2: " << mMaxChi2; + LOG(info) << N << "-prong vertex fitter in " << (mUseAbsDCA ? "abs." : "weighted") << " distance minimization mode, collinear tracks mode: " << (mIsCollinear ? "ON" : "OFF"); + LOG(info) << "Bz: " << mBz << " MaxIter: " << mMaxIter << " MaxChi2: " << mMaxChi2 << " MatCorrType: " << int(mMatCorr); LOG(info) << "Stopping condition: Max.param change < " << mMinParamChange << " Rel.Chi2 change > " << mMinRelChi2Change; LOG(info) << "Discard candidates for : Rvtx > " << getMaxR() << " DZ between tracks > " << mMaxDZIni; + LOG(info) << "PropagateToPCA:" << mPropagateToPCA << " WeightedFinalPCA:" << mWeightedFinalPCA << " UsePropagator:" << mUsePropagator << " RefitWithMatCorr:" << mRefitWithMatCorr; + std::string rep{}; + for (int i = 0; i < mCrossings.nDCA; i++) { + rep += fmt::format("seed{}:{}/{} ", i, mTrPropDone[i], mPropFailed[i]); + } + LOG(info) << "Last call: NCand:" << mCurHyp << " from " << mCrossings.nDCA << " seeds, prop.done/failed: " << rep; #else if (mUseAbsDCA) { printf("%d-prong vertex fitter in abs. distance minimization mode\n", N); diff --git a/Common/DCAFitter/test/testDCAFitterN.cxx b/Common/DCAFitter/test/testDCAFitterN.cxx index 2f9c4d455376e..a102a0a4253e3 100644 --- a/Common/DCAFitter/test/testDCAFitterN.cxx +++ b/Common/DCAFitter/test/testDCAFitterN.cxx @@ -238,6 +238,7 @@ BOOST_AUTO_TEST_CASE(DCAFitterNProngs) BOOST_CHECK(meanDA < 0.1); BOOST_CHECK(meanDAW < 0.1); BOOST_CHECK(meanDW < 0.1); + ft.print(); } // 2 prongs vertices with collinear tracks (gamma conversion) @@ -316,6 +317,7 @@ BOOST_AUTO_TEST_CASE(DCAFitterNProngs) BOOST_CHECK(meanDA < 2.1); BOOST_CHECK(meanDAW < 2.1); BOOST_CHECK(meanDW < 2.1); + ft.print(); } // 2 prongs vertices with one of charges set to 0: Helix : Line @@ -394,6 +396,7 @@ BOOST_AUTO_TEST_CASE(DCAFitterNProngs) BOOST_CHECK(meanDA < 0.1); BOOST_CHECK(meanDAW < 0.1); BOOST_CHECK(meanDW < 0.1); + ft.print(); } // 2 prongs vertices with both of charges set to 0: Line : Line @@ -471,6 +474,7 @@ BOOST_AUTO_TEST_CASE(DCAFitterNProngs) BOOST_CHECK(meanDA < 0.1); BOOST_CHECK(meanDAW < 0.1); BOOST_CHECK(meanDW < 0.1); + ft.print(); } // 3 prongs vertices @@ -547,8 +551,8 @@ BOOST_AUTO_TEST_CASE(DCAFitterNProngs) BOOST_CHECK(meanDA < 0.1); BOOST_CHECK(meanDAW < 0.1); BOOST_CHECK(meanDW < 0.1); + ft.print(); } - outStream.Close(); }