3 #include <Math/Functions.h>
4 #include <Math/SVector.h>
5 #include <Math/SMatrix.h>
19 fillVertexCovariance(
err);
31 typedef ROOT::Math::SVector<double, 3> SVector1;
32 typedef ROOT::Math::SMatrix<double, 3, 3, ROOT::Math::MatRepSym<double, 3> > SMatrixSym1;
34 sv.fillVertexCovariance(covariance);
35 SMatrixSym1 cov = covariance;
37 cov +=
pv.covariance();
38 SVector1 vector(0, 0,
sv.vertex().Z() -
pv.position().Z());
40 double dist = ROOT::Math::Mag(vector);
41 double error = ROOT::Math::Similarity(cov, vector);
42 if (
error > 0.0 && dist > 1.0
e-9)
46 if ((vector[0] * direction.x() + vector[1] * direction.y() + vector[2] * direction.z()) < 0.0)
54 typedef ROOT::Math::SVector<double, 2> SVector2;
55 typedef ROOT::Math::SMatrix<double, 2, 2, ROOT::Math::MatRepSym<double, 2> > SMatrixSym2;
57 sv.fillVertexCovariance(covariance);
59 SMatrixSym2 cov = covariance.Sub<SMatrixSym2>(0, 0);
61 cov +=
pv.covariance().Sub<SMatrixSym2>(0, 0);
63 SVector2 vector(
sv.vertex().X() -
pv.position().X(),
sv.vertex().Y() -
pv.position().Y());
64 double dist = ROOT::Math::Mag(vector);
65 double error = ROOT::Math::Similarity(cov, vector);
66 if (
error > 0.0 && dist > 1.0
e-9)
71 if ((vector[0] * direction.x() + vector[1] * direction.y()) < 0.0)
79 typedef ROOT::Math::SVector<double, 3>
SVector3;
80 typedef ROOT::Math::SMatrix<double, 3, 3, ROOT::Math::MatRepSym<double, 3> > SMatrixSym3;
82 sv.fillVertexCovariance(covariance);
84 SMatrixSym3 cov = covariance;
86 cov +=
pv.covariance();
89 sv.vertex().X() -
pv.position().X(),
sv.vertex().Y() -
pv.position().Y(),
sv.vertex().Z() -
pv.position().Z());
91 double dist = ROOT::Math::Mag(vector);
92 double error = ROOT::Math::Similarity(cov, vector);
93 if (
error > 0.0 && dist > 1.0
e-9)
98 if ((vector[0] * direction.x() + vector[1] * direction.y() + vector[2] * direction.z()) < 0.0)
109 typedef ROOT::Math::SVector<double, 3> SVector1;
110 typedef ROOT::Math::SMatrix<double, 3, 3, ROOT::Math::MatRepSym<double, 3> > SMatrixSym1;
112 SMatrixSym1 cov =
sv.covariance();
114 cov +=
pv.covariance();
116 SVector1 vector(0.0, 0.0,
sv.position().Z() -
pv.position().Z());
118 double dist = ROOT::Math::Mag(vector);
119 double error = ROOT::Math::Similarity(cov, vector);
120 if (
error > 0.0 && dist > 1.0
e-9)
125 if ((vector[0] * direction.x() + vector[1] * direction.y() + vector[2] * direction.z()) < 0.0)
136 typedef ROOT::Math::SVector<double, 2> SVector2;
137 typedef ROOT::Math::SMatrix<double, 2, 2, ROOT::Math::MatRepSym<double, 2> > SMatrixSym2;
139 SMatrixSym2 cov =
sv.covariance().Sub<SMatrixSym2>(0, 0);
141 cov +=
pv.covariance().Sub<SMatrixSym2>(0, 0);
143 SVector2 vector(
sv.position().X() -
pv.position().X(),
sv.position().Y() -
pv.position().Y());
145 double dist = ROOT::Math::Mag(vector);
146 double error = ROOT::Math::Similarity(cov, vector);
147 if (
error > 0.0 && dist > 1.0
e-9)
152 if ((vector[0] * direction.x() + vector[1] * direction.y()) < 0.0)
162 typedef ROOT::Math::SVector<double, 3>
SVector3;
163 typedef ROOT::Math::SMatrix<double, 3, 3, ROOT::Math::MatRepSym<double, 3> > SMatrixSym3;
165 SMatrixSym3 cov =
sv.covariance();
167 cov +=
pv.covariance();
170 sv.position().Y() -
pv.position().Y(),
171 sv.position().Z() -
pv.position().Z());
173 double dist = ROOT::Math::Mag(vector);
174 double error = ROOT::Math::Similarity(cov, vector);
175 if (
error > 0.0 && dist > 1.0
e-9)
180 if ((vector[0] * direction.x() + vector[1] * direction.y() + vector[2] * direction.z()) < 0.0)