|
| 1 | +<!-- doxy |
| 2 | +\page refDetectorsVertexing Detectors Vertexing |
| 3 | +/doxy --> |
| 4 | + |
| 5 | +# Classes for Vertexing |
| 6 | + |
| 7 | +## DCAFitterN |
| 8 | + |
| 9 | +Templated class to fit the Point of Closest Approach (PCA) of secondary vertex with N prongs. Allows minimization of either absolute or weighted Distances of Closest Approach (DCA) of N tracks to their common PCA. |
| 10 | + |
| 11 | +For every N (prongs) a separate specialization must be instantiated, e.g. |
| 12 | +```cpp |
| 13 | +using Track = o2::track::TrackParCov; |
| 14 | +o2::vertexing::DCAFitterN<2,Track> ft2; // 2-prongs fitter |
| 15 | +// or, to set at once some parameters |
| 16 | +float bz = 5.; // field in kGauss |
| 17 | +bool useAbsDCA = true; // use abs. DCA minimizaition instead of default weighted |
| 18 | +bool propToDCA = true; // after fit, create a copy of tracks at the found PCA |
| 19 | +o2::vertexing::DCAFitterN<3,Track> ft3(bz, useAbsDCA, propToDCA); // 3-prongs fitter |
| 20 | +``` |
| 21 | +One can also use predefined aliases ``o2::vertexing::DCAFitter2`` and ``o2::vertexing::DCAFitter3``; |
| 22 | +The main processing method is |
| 23 | +```cpp |
| 24 | +o2::vertexing::DCAFitterN<N,Track>::process(const Track& trc1,..., cons Track& trcN); |
| 25 | +``` |
| 26 | + |
| 27 | +The typical use case is (for e.g. 3-prong fitter): |
| 28 | +```cpp |
| 29 | +using Vec3D = ROOT::Math::SVector<double,3>; // this is a type of the fitted vertex |
| 30 | +o2::vertexing::DCAFitter3 ft; |
| 31 | +ft.setBz(5.0); |
| 32 | +ft.setPropagateToPCA(true); // After finding the vertex, propagate tracks to the DCA. This is default anyway |
| 33 | +ft.setMaxR(200); // do not consider V0 seeds with 2D circles crossing above this R. This is default anyway |
| 34 | +ft.setMaxDZIni(4); // do not consider V0 seeds with tracks Z-distance exceeding this. This is default anyway |
| 35 | +ft.setMinParamChange(1e-3); // stop iterations if max correction is below this value. This is default anyway |
| 36 | +ft.setMinRelChi2Change(0.9);// stop iterations if chi2 improves by less that this factor |
| 37 | +ft.setMaxChi2(10); // discard vertices with chi2/Nprongs (or sum{DCAi^2}/Nprongs for abs. distance minimization) |
| 38 | + |
| 39 | +Track tr0,tr1,tr2; // decide candidate tracks |
| 40 | +int nc = ft.process(tr0,tr1,tr2); // one can have up to 2 candidates, though the 2nd (if any) will have worse quality |
| 41 | +if (nc) { |
| 42 | + Vec3D vtx = ft.getPCACandidate(); // same as ft.getPCACandidate(0); |
| 43 | + LOG(INFO) << "found vertex " << vtx[0] << ' ' << vtx[1] << ' ' << vtx[2]; |
| 44 | + // access the track's X parameters at PCA |
| 45 | + for (int i=0;i<3;i++) { |
| 46 | + LOG(INFO) << "Track " << i << " at PCA for X = " << ft.getTrackX(i); |
| 47 | + } |
| 48 | + // access directly the tracks propagated to the DCA |
| 49 | + for (int i=0;i<3;i++) { |
| 50 | + const auto& track = ft.getTrack(i); |
| 51 | + track.print(); |
| 52 | + } |
| 53 | +} |
| 54 | +``` |
| 55 | + |
| 56 | +See ``O2/Detectors/Base/test/testDCAFitterN.cxx`` for more extended example. |
| 57 | +Currently only 2 and 3 prongs permitted, thought this can be changed by modifying ``DCAFitterN::NMax`` constant. |
0 commit comments