Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions Common/DCAFitter/DCAFitterN_derivation.md
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,11 @@ I_XX -> I_XX + 1/sigma_X,prior^2 .
In code this is implemented as

```cpp
constexpr float XRegErrFactor = 10.f;
const float sigmaX2 = C_YY * XRegErrFactor;
sxx += 1.f / sigmaX2;
static constexpr float XRegErrFactor = 10.f;
...
if (xRegErrFactor > 0.f) {
sxx += 1.f / (cyy * xRegErrFactor);
}
```

This is different from multiplying `I_XX` by a number below one. A reduction of
Expand All @@ -491,7 +493,15 @@ not alter `I_YY`, `I_YZ`, or `I_ZZ`.

The regularization should remain weak. It is a numerical stabilizer for badly
conditioned geometries, not an additional detector measurement of the local
track `X` coordinate.
track `X` coordinate. For this reason it is applied **only** where an invertible
single-track contribution is actually required, i.e. for the `I_i` entering the
chi2 minimization (`mTrcEInv`, hence `calcInverseWeight()`, `calcPCACoefs()`,
`calcChi2()` and the Newton Hessian). `calcPCACovMatrix()` rebuilds the `I_i`
with `TrackCovI::XRegNone`: there the prior is not needed (the sum over prongs is
inverted, not the individual terms, and a genuinely ill-conditioned sum is
detected and replaced by a loose dummy covariance), and including it would make
the reported longitudinal vertex error follow the dummy `XRegErrFactor * C_YY`
instead of the track slopes.

### `calcPCACovMatrix()`

Expand Down
266 changes: 168 additions & 98 deletions Common/DCAFitter/include/DCAFitter/DCAFitterN.h

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions Common/DCAFitter/test/testDCAFitterN.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ inline void printStat(const FitStatusArray& a)

BOOST_AUTO_TEST_CASE(DCAFitterNProngs)
{
constexpr bool oldMode = false; // if true, use the old mode of DCAFitterN, which is less correct but faster
constexpr int NTest = 10000;
o2::utils::TreeStreamRedirector outStream("dcafitterNTest.root");

Expand All @@ -196,6 +197,7 @@ BOOST_AUTO_TEST_CASE(DCAFitterNProngs)
std::memset(fitstat.data(), 0, sizeof(fitstat));

o2::vertexing::DCAFitterN<2> ft; // 2 prong fitter
ft.setOldMode(oldMode); // use the old mode of DCAFitterN
ft.setBz(bz);
ft.setPropagateToPCA(true); // After finding the vertex, propagate tracks to the DCA. This is default anyway
ft.setMaxR(200); // do not consider V0 seeds with 2D circles crossing above this R. This is default anyway
Expand Down Expand Up @@ -280,6 +282,7 @@ BOOST_AUTO_TEST_CASE(DCAFitterNProngs)
std::memset(fitstat.data(), 0, sizeof(fitstat));

o2::vertexing::DCAFitterN<2> ft; // 2 prong fitter
ft.setOldMode(oldMode); // use the old mode of DCAFitterN
ft.setBz(bz);
ft.setPropagateToPCA(true); // After finding the vertex, propagate tracks to the DCA. This is default anyway
ft.setMaxR(200); // do not consider V0 seeds with 2D circles crossing above this R. This is default anyway
Expand Down Expand Up @@ -366,6 +369,7 @@ BOOST_AUTO_TEST_CASE(DCAFitterNProngs)
std::memset(fitstat.data(), 0, sizeof(fitstat));

o2::vertexing::DCAFitterN<2> ft; // 2 prong fitter
ft.setOldMode(oldMode); // use the old mode of DCAFitterN
ft.setBz(bz);
ft.setPropagateToPCA(true); // After finding the vertex, propagate tracks to the DCA. This is default anyway
ft.setMaxR(200); // do not consider V0 seeds with 2D circles crossing above this R. This is default anyway
Expand Down Expand Up @@ -451,6 +455,7 @@ BOOST_AUTO_TEST_CASE(DCAFitterNProngs)
std::memset(fitstat.data(), 0, sizeof(fitstat));

o2::vertexing::DCAFitterN<2> ft; // 2 prong fitter
ft.setOldMode(oldMode); // use the old mode of DCAFitterN
ft.setBz(bz);
ft.setPropagateToPCA(true); // After finding the vertex, propagate tracks to the DCA. This is default anyway
ft.setMaxR(200); // do not consider V0 seeds with 2D circles crossing above this R. This is default anyway
Expand Down Expand Up @@ -535,6 +540,7 @@ BOOST_AUTO_TEST_CASE(DCAFitterNProngs)
std::memset(fitstat.data(), 0, sizeof(fitstat));

o2::vertexing::DCAFitterN<3> ft; // 3 prong fitter
ft.setOldMode(oldMode); // use the old mode of DCAFitterN
ft.setBz(bz);
ft.setPropagateToPCA(true); // After finding the vertex, propagate tracks to the DCA. This is default anyway
ft.setMaxR(200); // do not consider V0 seeds with 2D circles crossing above this R. This is default anyway
Expand Down
1 change: 1 addition & 0 deletions Detectors/GlobalTrackingWorkflow/study/src/SVStudy.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ void SVStudySpec::updateTimeDependentParams(ProcessingContext& pc)
const auto& svparam = o2::vertexing::SVertexerParams::Instance();
// Note: reading of the ITS AlpideParam needed for ITS timing is done by the RecoContainer
mFitterV0.setBz(mBz);
mFitterV0.setOldMode(svparam.oldDCAFitterMode);
mFitterV0.setUseAbsDCA(svparam.useAbsDCA);
mFitterV0.setPropagateToPCA(false);
mFitterV0.setMaxR(svparam.maxRIni);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ void TrackMCStudy::updateTimeDependentParams(ProcessingContext& pc)
if (mCheckSV) {
const auto& svparam = o2::vertexing::SVertexerParams::Instance();
mFitterV0.setBz(o2::base::Propagator::Instance()->getNominalBz());
mFitterV0.setOldMode(svparam.oldDCAFitterMode);
mFitterV0.setUseAbsDCA(svparam.useAbsDCA);
mFitterV0.setPropagateToPCA(false);
mFitterV0.setMaxR(svparam.maxRIni);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ namespace vertexing
struct SVertexerParams : public o2::conf::ConfigurableParamHelper<SVertexerParams> {

// parameters
bool oldDCAFitterMode = true; ///< pre(old) or post(new) PR15610+15784 behaviour of DCAFitter
bool createFullV0s = false; ///< fill V0s prongs/kinematics
bool createFullCascades = false; ///< fill cascades prongs/kinematics
bool createFull3Bodies = false; ///< fill 3-body decays prongs/kinematics
Expand Down
3 changes: 3 additions & 0 deletions Detectors/Vertexing/src/SVertexer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ void SVertexer::setupThreads()
mBz = o2::base::Propagator::Instance()->getNominalBz();
int fitCounter = 0;
for (auto& fitter : mFitterV0) {
fitter.setOldMode(mSVParams->oldDCAFitterMode);
fitter.setFitterID(fitCounter++);
fitter.setBz(mBz);
fitter.setUseAbsDCA(mSVParams->useAbsDCA);
Expand All @@ -372,6 +373,7 @@ void SVertexer::setupThreads()
mFitterCasc.resize(mNThreads);
fitCounter = 1000;
for (auto& fitter : mFitterCasc) {
fitter.setOldMode(mSVParams->oldDCAFitterMode);
fitter.setFitterID(fitCounter++);
fitter.setBz(mBz);
fitter.setUseAbsDCA(mSVParams->useAbsDCA);
Expand All @@ -393,6 +395,7 @@ void SVertexer::setupThreads()
mFitter3body.resize(mNThreads);
fitCounter = 2000;
for (auto& fitter : mFitter3body) {
fitter.setOldMode(mSVParams->oldDCAFitterMode);
fitter.setFitterID(fitCounter++);
fitter.setBz(mBz);
fitter.setUseAbsDCA(mSVParams->useAbsDCA);
Expand Down