20 m_observationModel(observationModel),
21 m_observationNoise(observationNoise),
26 const double zDistance = secondCluster->
zLocal() - firstCluster->
zLocal();
29 positionAndSlope[0] = secondCluster->
xLocal();
30 positionAndSlope[1] = (secondCluster->
xLocal() - firstCluster->
xLocal())/zDistance;
31 positionAndSlope[2] = secondCluster->
yLocal();
32 positionAndSlope[3] = (secondCluster->
yLocal() - firstCluster->
yLocal())/zDistance;
51 CLHEP::HepVector newPoint (2);
52 newPoint[0] = cluster->
xLocal();
53 newPoint[1] = cluster->
yLocal();
56 const double newZ = cluster->
zLocal();
62 const CLHEP::HepVector residualPredicted = newPoint -
m_observationModel*predictedTruePosition;
66 const CLHEP::HepMatrix kalmanGain = predictedCovariance*
m_observationModel.T()*qr_inverse(residualPredictedCov);
70 const CLHEP::HepVector newPosition = predictedTruePosition + kalmanGain*residualPredicted;
77 const CLHEP::HepVector chi2Vector = newResidual.T()*qr_inverse(newResidualCov)*newResidual;
80 if (chi2Vector[0] < clusterMaxChi2) {
99 double minDisntace = maxAllowedDistance;
102 const CLHEP::HepVector predictedPoint =
predictNextPoint(theCluster->zLocal());
103 const double xDiff = predictedPoint[0] - theCluster->xLocal();
104 const double yDiff = predictedPoint[2] - theCluster->yLocal();
105 const double distance = std::sqrt(xDiff*xDiff + yDiff*yDiff);
108 nearestCluster = theCluster;
112 return nearestCluster;
130 if (positionIter != positionBegin) {
133 std::list< const xAOD::AFPSiHitsCluster* >::const_iterator clustersIter =
m_clustersInTrack.end();
140 const CLHEP::HepVector& lastPosition = *(--positionIter);
141 const CLHEP::HepMatrix& lastCovariance = *(--covIter);
148 CLHEP::HepVector lastPoint (2);
149 lastPoint[0] = lastCluster->
xLocal();
150 lastPoint[1] = lastCluster->
yLocal();
154 const CLHEP::HepVector
chi2Smooth = residualSmooth.T()*qr_inverse(residualSmoothCov)*residualSmooth;
158 while (positionIter != positionBegin) {
160 const CLHEP::HepVector& position = *(--positionIter);
161 const CLHEP::HepMatrix& covariance = *(--covIter);
165 const CLHEP::HepVector& prevPositionPred = *(--positionPredictIter);
166 const CLHEP::HepMatrix& prevCovPred = *(--covPredictIter);
167 const CLHEP::HepMatrix& prevTransition = *(--transitionIter);
170 const CLHEP::HepMatrix Ai = qr_inverse(prevTransition);
176 CLHEP::HepVector point (2);
177 point[0] = cluster->
xLocal();
178 point[1] = cluster->
yLocal();
181 CLHEP::HepVector
chi2Smooth = residualSmooth.T()*qr_inverse(residualCovSmooth)*residualSmooth;
196 const CLHEP::HepMatrix Ai = qr_inverse(firstTransition);
202 CLHEP::HepVector firstPoint (2);
203 firstPoint[0] = firstCluster->
xLocal();
204 firstPoint[1] = firstCluster->
yLocal();
207 CLHEP::HepVector firstChi2 = firstResidual.T()*qr_inverse(firstResidualCov)*firstResidual;