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

◆ TSOS

Definition at line 15 of file TrajectoryStateCombiner.h.

Member Function Documentation

◆ combine()

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

Definition at line 6 of file TrajectoryStateCombiner.cc.

6  {
7  auto pzSign = Tsos1.localParameters().pzSign();
8  AlgebraicVector5&& x1 = Tsos1.localParameters().vector();
9  AlgebraicVector5&& x2 = Tsos2.localParameters().vector();
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 }

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

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

◆ operator()()

TSOS TrajectoryStateCombiner::operator() ( const TSOS pTsos1,
const TSOS pTsos2 
) const
inline

Definition at line 19 of file TrajectoryStateCombiner.h.

19 { return combine(pTsos1, pTsos2); }

References combine().

testProducerWithPsetDescEmpty_cfi.x2
x2
Definition: testProducerWithPsetDescEmpty_cfi.py:28
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
LocalTrajectoryParameters
Definition: LocalTrajectoryParameters.h:25
testProducerWithPsetDescEmpty_cfi.x1
x1
Definition: testProducerWithPsetDescEmpty_cfi.py:33
AlgebraicMatrix55
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepStd< double, 5, 5 > > AlgebraicMatrix55
Definition: AlgebraicROOTObjects.h:55
edm::LogWarning
Definition: MessageLogger.h:141
LocalTrajectoryError
Definition: LocalTrajectoryError.h:20
invertPosDefMatrix
bool invertPosDefMatrix(ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > &m)
Definition: invertPosDefMatrix.h:10
AlgebraicVector5
ROOT::Math::SVector< double, 5 > AlgebraicVector5
Definition: AlgebraicROOTObjects.h:14
TrajectoryStateCombiner::combine
TSOS combine(const TSOS &pTsos1, const TSOS &pTsos2) const
Definition: TrajectoryStateCombiner.cc:6
AlgebraicSymMatrix55
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
Definition: AlgebraicROOTObjects.h:23
TrajectoryStateCombiner::TSOS
TrajectoryStateOnSurface TSOS
Definition: TrajectoryStateCombiner.h:15