CMS 3D CMS Logo

TrajectoryStateCombiner.cc
Go to the documentation of this file.
3 
5 
7  auto pzSign = Tsos1.localParameters().pzSign();
10  const AlgebraicSymMatrix55& C1 = (Tsos1.localError().matrix());
11  const AlgebraicSymMatrix55& C2 = (Tsos2.localError().matrix());
12 
13  AlgebraicSymMatrix55&& Csum = C1 + C2;
14  bool ok = invertPosDefMatrix(Csum);
15  AlgebraicMatrix55&& K = C1 * Csum;
16 
17  if (!ok) {
18  if (!(C1(0, 0) == 0.0 && C2(0, 0) == 0.0)) //do not make noise about obviously bad input
19  edm::LogWarning("MatrixInversionFailure")
20  << "the inversion of the combined error matrix failed. Impossible to get a combined state."
21  << "\nmatrix 1:" << C1 << "\nmatrix 2:" << C2;
22  return TSOS();
23  }
24 
25  AlgebraicVector5&& xcomb = x1 + K * (x2 - x1);
26  //AlgebraicSymMatrix55 Ccomb; Ccomb.assign(K*C2);
27  AlgebraicSymMatrix55&& Ccomb = (AlgebraicMatrix55(K * C2)).LowerBlock();
28 
29  return TSOS(LocalTrajectoryParameters(xcomb, pzSign),
30  LocalTrajectoryError(Ccomb),
31  Tsos1.surface(),
32  &(Tsos1.globalParameters().magneticField()));
33 }
float pzSign() const
Sign of the z-component of the momentum in the local frame.
TrajectoryStateOnSurface TSOS
const LocalTrajectoryError & localError() const
const GlobalTrajectoryParameters & globalParameters() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepStd< double, 5, 5 > > AlgebraicMatrix55
const LocalTrajectoryParameters & localParameters() const
const SurfaceType & surface() const
AlgebraicVector5 vector() const
bool invertPosDefMatrix(ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > &m)
ROOT::Math::SVector< double, 5 > AlgebraicVector5
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
const MagneticField & magneticField() const
const AlgebraicSymMatrix55 & matrix() const
Log< level::Warning, false > LogWarning
TSOS combine(const TSOS &pTsos1, const TSOS &pTsos2) const