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 }
Vector3DBase
Definition: Vector3DBase.h:8
GhostTrackPrediction.h
VertexGhostTrackState.h
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
conv
static HepMC::IO_HEPEVT conv
Definition: BeamHaloProducer.cc:48
pos
Definition: PixelAliasList.h:18
sqr
int sqr(const T &t)
Definition: pfalgo_common_ref.h:9
reco::VertexGhostTrackState::position_
GlobalPoint position_
Definition: VertexGhostTrackState.h:29
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
relativeConstraints.error
error
Definition: relativeConstraints.py:53
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
reco::VertexGhostTrackState::vertexStateOnGhostTrack
Vertex vertexStateOnGhostTrack(const GhostTrackPrediction &pred, bool withMeasurementError) const override
Definition: VertexGhostTrackState.cc:37
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
b
double b
Definition: hdecay.h:118
ROOT::Math
Definition: Transform3DPJ.h:41
reco::BasicGhostTrackState::Vertex
std::pair< GlobalPoint, GlobalError > Vertex
Definition: BasicGhostTrackState.h:27
reco::GhostTrackPrediction::direction
const GlobalVector direction() const
Definition: GhostTrackPrediction.h:63
reco::GhostTrackPrediction::rho2
double rho2() const
Definition: GhostTrackPrediction.h:53
math::GlobalVector
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< float >, ROOT::Math::GlobalCoordinateSystemTag > GlobalVector
vector in glovbal coordinate system
Definition: Vector3D.h:28
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
reco::VertexGhostTrackState::vertexStateOnMeasurement
Vertex vertexStateOnMeasurement(const GhostTrackPrediction &pred, bool withGhostTrackError) const override
Definition: VertexGhostTrackState.cc:66
reco::VertexGhostTrackState::covariance_
CovarianceMatrix covariance_
Definition: VertexGhostTrackState.h:30
GlobalVector.h
reco::GhostTrackPrediction::origin
const GlobalPoint origin() const
Definition: GhostTrackPrediction.h:62
reco::GhostTrackPrediction::cartesianError
CartesianError cartesianError(double lambda=0.) const
Definition: GhostTrackPrediction.cc:146
reco::BasicGhostTrackState::lambda
double lambda() const
Definition: BasicGhostTrackState.h:40
math::GlobalPoint
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< float >, ROOT::Math::GlobalCoordinateSystemTag > GlobalPoint
point in global coordinate system
Definition: Point3D.h:18
funct::arg
A arg
Definition: Factorize.h:31
reco::GhostTrackPrediction
Definition: GhostTrackPrediction.h:21
mps_fire.result
result
Definition: mps_fire.py:311
GlobalPoint.h