64 if (!tA.isValid() || !tB.isValid() || tA.getAlpha() != tB.getAlpha() || tA.getX() != tB.getX()) {
68 auto unpack = [](
const std::array<T, track::kCovMatSize>&
c) {
70 for (
int i = 0, k = 0;
i < 5; ++
i) {
71 for (
int j = 0;
j <=
i; ++
j, ++k) {
72 m(
i,
j) =
m(
j,
i) = (double)
c[k];
77 Mat55 cA = unpack(tA.getCov());
78 Mat55 cB = unpack(tB.getCov());
79 Eigen::LLT<Mat55> lltA(cA), lltB(cB);
80 Mat55 wA = lltA.solve(Mat55::Identity());
81 Mat55 wB = lltB.solve(Mat55::Identity());
83 Eigen::LLT<Mat55> lltTot(wTot);
84 Mat55 cTot = lltTot.solve(Mat55::Identity());
86 for (
int i = 0;
i < 5; ++
i) {
87 pA(
i) = tA.getParam(
i);
88 pB(
i) = tB.getParam(
i);
90 Mat51 pTot = cTot * (wA * pA + wB * pB);
92 for (
int i = 0;
i < 5; ++
i) {
93 res.setParam(pTot(
i),
i);
95 for (
int i = 0, k = 0;
i < 5; ++
i) {
96 for (
int j = 0;
j <=
i; ++
j, ++k) {
97 res.setCov(
static_cast<T
>(cTot(
i,
j)), k);
119 const auto bz = prop->getNominalBz();
122 return refLin ? tr.rotate(
alpha, *refLin, bz) : tr.rotate(
alpha);
126 bool outward = tr.getX() < clArr[
i]->getX();
131 chi2 += tr.getPredictedChi2Quiet(*clArr[
i]);
134 if (!tr.update(*clArr[
i])) {
138 extrapDest[
i].invalidate();
143 auto trFitInw = convertTrack<T>(iTrack.getParamOut());
144 auto trFitOut = convertTrack<T>(iTrack.getParamIn());
153 refLinOut = &(refLinOut0 = trFitOut);
154 refLinInw = &(refLinInw0 = trFitInw);
157 auto resetTrackCov = [bz](
auto& trk) {
158 trk.resetCovariance();
159 float qptB5Scale = std::abs(bz) > 0.1f ? std::abs(bz) / 5.006680f : 1.f;
160 float q2pt2 = trk.getQ2Pt() * trk.getQ2Pt(), q2pt2Wgh = q2pt2 * qptB5Scale * qptB5Scale;
161 float err2 = (100.f + q2pt2Wgh) / (1.f + q2pt2Wgh) * q2pt2;
162 trk.setCov(err2, 14);
164 resetTrackCov(trFitOut);
165 resetTrackCov(trFitInw);
167 for (
int i = 0;
i <= 7;
i++) {
168 if (!accountCluster(
i, extrapOut, trFitOut, refLinOut) || !accountCluster(7 -
i, extrapInw, trFitInw, refLinInw)) {
bool doBidirRefit(const o2::its::TrackITS &iTrack, std::array< const TrackingCluster< T > *, 8 > &clArr, std::array< o2::track::TrackParametrizationWithError< T >, 8 > &extrapOut, std::array< o2::track::TrackParametrizationWithError< T >, 8 > &extrapInw, T &chi2, bool useStableRef, typename o2::base::PropagatorImpl< T >::MatCorrType corrType)