CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions
TrajectoryStateCombiner Class Reference

#include <TrajectoryStateCombiner.h>

Public Types

typedef TrajectoryStateOnSurface TSOS
 

Public Member Functions

TSOS combine (const TSOS &pTsos1, const TSOS &pTsos2) const
 
TSOS operator() (const TSOS &pTsos1, const TSOS &pTsos2) const
 

Detailed Description

Combines the information from two trajectory states via a weighted mean. The input states should not be correlated. Ported from ORCA

Author
todorov, cerati

Definition at line 13 of file TrajectoryStateCombiner.h.

Member Typedef Documentation

Definition at line 16 of file TrajectoryStateCombiner.h.

Member Function Documentation

TrajectoryStateOnSurface TrajectoryStateCombiner::combine ( const TSOS pTsos1,
const TSOS pTsos2 
) const

Definition at line 7 of file TrajectoryStateCombiner.cc.

References TrajectoryStateOnSurface::globalParameters(), invertPosDefMatrix(), TrajectoryStateOnSurface::localError(), TrajectoryStateOnSurface::localParameters(), GlobalTrajectoryParameters::magneticField(), LocalTrajectoryError::matrix(), convertSQLiteXML::ok, LocalTrajectoryParameters::pzSign(), TrajectoryStateOnSurface::surface(), and LocalTrajectoryParameters::vector().

Referenced by CSCPairResidualsConstraint::dphidzFromTrack(), AlignmentMonitorTemplate::event(), AlignmentMonitorMuonResiduals::event(), operator()(), TrackInfoProducerAlgorithm::run(), HIPAlignmentAlgorithm::run(), and TrajectoryAtInvalidHit::TrajectoryAtInvalidHit().

7  {
8 
9  auto pzSign = Tsos1.localParameters().pzSign();
10  AlgebraicVector5 && x1 = Tsos1.localParameters().vector();
11  AlgebraicVector5 && x2 = Tsos2.localParameters().vector();
12  const AlgebraicSymMatrix55 &C1 = (Tsos1.localError().matrix());
13  const AlgebraicSymMatrix55 &C2 = (Tsos2.localError().matrix());
14 
15  AlgebraicSymMatrix55 && Csum = C1 + C2;
16  bool ok = invertPosDefMatrix(Csum);
17  AlgebraicMatrix55 && K = C1*Csum;
18 
19  if(!ok) {
20  if (! (C1(0,0) == 0.0 && C2(0,0) == 0.0) )//do not make noise about obviously bad input
21  edm::LogWarning("MatrixInversionFailure")
22  <<"the inversion of the combined error matrix failed. Impossible to get a combined state."
23  <<"\nmatrix 1:"<<C1
24  <<"\nmatrix 2:"<<C2;
25  return TSOS();
26  }
27 
28  AlgebraicVector5 && xcomb = x1 + K*(x2 - x1);
29  //AlgebraicSymMatrix55 Ccomb; Ccomb.assign(K*C2);
30  AlgebraicSymMatrix55 && Ccomb = (AlgebraicMatrix55(K*C2)).LowerBlock();
31 
32  return TSOS( LocalTrajectoryParameters(xcomb, pzSign),
33  LocalTrajectoryError(Ccomb), Tsos1.surface(),
34  &(Tsos1.globalParameters().magneticField())
35  );
36 }
TrajectoryStateOnSurface TSOS
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
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::MatRepStd< double, 5, 5 > > AlgebraicMatrix55
TSOS TrajectoryStateCombiner::operator() ( const TSOS pTsos1,
const TSOS pTsos2 
) const
inline

Definition at line 20 of file TrajectoryStateCombiner.h.

References combine().

20  {
21  return combine( pTsos1, pTsos2);
22  }
TSOS combine(const TSOS &pTsos1, const TSOS &pTsos2) const