CMS 3D CMS Logo

VertexGhostTrackState.cc
Go to the documentation of this file.
1 #include <cmath>
2 
3 #include <Math/SMatrix.h>
4 #include <Math/MatrixFunctions.h>
5 
8 
10 
12 
13 using namespace reco;
14 
15 namespace {
16 #ifndef __clang__
17  static inline double sqr(double arg) { return arg * arg; }
18 #endif
19  using namespace ROOT::Math;
20 
21  typedef SVector<double, 3> Vector3;
22 
23  typedef SMatrix<double, 3, 3, MatRepSym<double, 3> > Matrix3S;
24  typedef SMatrix<double, 6, 6, MatRepSym<double, 6> > Matrix6S;
25  typedef SMatrix<double, 3, 3> Matrix33;
26  typedef SMatrix<double, 3, 6> Matrix36;
27 
28  inline Vector3 conv(const GlobalVector &vec) {
29  Vector3 result;
30  result[0] = vec.x();
31  result[1] = vec.y();
32  result[2] = vec.z();
33  return result;
34  }
35 } // namespace
36 
38  bool withMeasurementError) const {
39  using namespace ROOT::Math;
40 
41  GlobalPoint origin = pred.origin();
42  GlobalVector direction = pred.direction();
43 
44  double rho2 = pred.rho2();
45  double rho = std::sqrt(rho2);
46  double lambda = (position_ - origin) * direction / rho2;
47  GlobalPoint pos = origin + lambda * direction;
48 
49  Vector3 b = conv(direction) / rho;
50  Vector3 ca = conv(position_ - pos);
51 
52  Matrix33 pA = TensorProd(b, b);
53  Matrix33 pB = TensorProd(b, ca);
54 
55  Matrix36 jacobian;
56  jacobian.Place_at(-pA + Matrix33(SMatrixIdentity()), 0, 0);
57  jacobian.Place_at(pB / rho, 0, 3);
58  Matrix3S error = Similarity(jacobian, pred.cartesianError(lambda));
59 
60  if (withMeasurementError)
61  error += Similarity(pA, covariance_);
62 
63  return Vertex(pos, error);
64 }
65 
67  bool withGhostTrackError) const {
68  return Vertex(position_, covariance_);
69 }
std::pair< GlobalPoint, GlobalError > Vertex
T z() const
Definition: PV3DBase.h:61
Vertex vertexStateOnGhostTrack(const GhostTrackPrediction &pred, bool withMeasurementError) const override
int sqr(const T &t)
A arg
Definition: Factorize.h:31
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
const GlobalVector direction() const
Vertex vertexStateOnMeasurement(const GhostTrackPrediction &pred, bool withGhostTrackError) const override
T sqrt(T t)
Definition: SSEVec.h:19
CartesianError cartesianError(double lambda=0.) const
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float >, ROOT::Math::GlobalCoordinateSystemTag > GlobalVector
vector in glovbal coordinate system
Definition: Vector3D.h:28
const GlobalPoint origin() const
double b
Definition: hdecay.h:118
EPOS::IO_EPOS conv
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float >, ROOT::Math::GlobalCoordinateSystemTag > GlobalPoint
point in global coordinate system
Definition: Point3D.h:18
fixed size matrix