4 #include <Math/SVector.h>
5 #include <Math/SMatrix.h>
6 #include <Math/MatrixFunctions.h>
20 static inline double sqr(
double arg) {
return arg *
arg; }
22 using namespace ROOT::Math;
24 typedef SVector<double, 4> Vector4;
25 typedef SVector<double, 2> Vector2;
27 typedef SMatrix<double, 4, 4, MatRepSym<double, 4> > Matrix4S;
28 typedef SMatrix<double, 3, 3, MatRepSym<double, 3> > Matrix3S;
29 typedef SMatrix<double, 2, 2, MatRepSym<double, 2> > Matrix2S;
30 typedef SMatrix<double, 4, 4> Matrix44;
31 typedef SMatrix<double, 4, 2> Matrix42;
32 typedef SMatrix<double, 2, 4> Matrix24;
33 typedef SMatrix<double, 2, 3> Matrix23;
34 typedef SMatrix<double, 2, 2> Matrix22;
41 Matrix2S measErr, measPredErr;
49 using namespace ROOT::Math;
62 measToLocal(0, 0) = - dz *
x;
63 measToLocal(0, 1) = - dz *
y;
64 measToLocal(0, 2) = 1.;
65 measToLocal(1, 0) =
y;
66 measToLocal(1, 1) = -
x;
82 residual[0] =
point.z() - pred.
z() - dz * lip;
83 residual[1] = pred.
ip() - tip;
89 double &ndof,
double &chi2)
const
91 using namespace ROOT::Math;
93 KalmanState kalmanState(pred, state);
95 if (state.
weight() < 1.0e-3)
99 Matrix2S invErr = kalmanState.measPredErr +
100 (1.0 / state.
weight()) * kalmanState.measErr;
101 if (!invErr.Invert())
105 Matrix42 gain = pred.
covariance() * Transpose(kalmanState.h) * invErr;
108 Vector4 newPred = pred.
prediction() + (gain * kalmanState.residual);
109 Matrix44 tmp44 = SMatrixIdentity();
110 tmp44 = (tmp44 - gain * kalmanState.h) * pred.
covariance();
111 Matrix4S newError(tmp44.LowerBlock());
114 Matrix22 tmp22 = SMatrixIdentity();
115 tmp22 = tmp22 - kalmanState.h * gain;
116 Vector2 filtRes = tmp22 * kalmanState.residual;
117 tmp22 *= kalmanState.measErr;
118 Matrix2S filtResErr(tmp22.LowerBlock());
119 if (!filtResErr.Invert())
122 ndof += state.
weight() * 2.;
123 chi2 += state.
weight() * Similarity(filtRes, filtResErr);
131 double &ndof,
double &chi2,
132 bool withPredError)
const
134 using namespace ROOT::Math;
136 KalmanState kalmanState(pred, state);
142 Matrix2S invErr = kalmanState.measErr;
144 invErr += kalmanState.measPredErr;
145 if (!invErr.Invert()) {
151 chi2 = Similarity(kalmanState.residual, invErr);
Sin< T >::type sin(const T &t)
GhostTrackPrediction update(const GhostTrackPrediction &pred, const GhostTrackState &state, double &ndof, double &chi2) const
Cos< T >::type cos(const T &t)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
void contribution(const GhostTrackPrediction &pred, const GhostTrackState &state, double &ndof, double &chi2, bool withPredError=false) const
const Vector & prediction() const
const Error & covariance() const
Square< F >::type sqr(const F &f)
CovarianceMatrix cartesianCovariance() const
GlobalPoint globalPosition() const
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point