CMS 3D CMS Logo

Public Types | Public Member Functions

TrajectoryStateCombiner Class Reference

#include <TrajectoryStateCombiner.h>

List of all members.

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

Date:
2007/05/09 14:17:57
Revision:
1.2
Author:
todorov, cerati

Definition at line 15 of file TrajectoryStateCombiner.h.


Member Typedef Documentation

Definition at line 18 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()(), AlignmentMuonHIPTrajectorySelector::produce(), HIPAlignmentAlgorithm::run(), TrackInfoProducerAlgorithm::run(), and TrajectoryAtInvalidHit::TrajectoryAtInvalidHit().

                                                                           {

  double pzSign = Tsos1.localParameters().pzSign();
  AlgebraicVector5 x1(Tsos1.localParameters().vector());
  AlgebraicVector5 x2(Tsos2.localParameters().vector());
  const AlgebraicSymMatrix55 &C1 = (Tsos1.localError().matrix());
  const AlgebraicSymMatrix55 &C2 = (Tsos2.localError().matrix());

  AlgebraicSymMatrix55 Csum = C1 + C2;
  bool ok = invertPosDefMatrix(Csum);
  AlgebraicMatrix55 K = C1*Csum;

  if(!ok) {
    edm::LogError("MatrixInversionFailure")
      <<"the inversion of the combined error matrix failed. Impossible to get a combined state."
      <<"\nmatrix 1:"<<C1
      <<"\nmatrix 2:"<<C2;
    return TSOS();
  }

  AlgebraicVector5 xcomb = x1 + K*(x2 - x1);
  //AlgebraicSymMatrix55 Ccomb; Ccomb.assign(K*C2);
  AlgebraicSymMatrix55 Ccomb = (AlgebraicMatrix55(K*C2)).LowerBlock();

  TSOS combTsos( LocalTrajectoryParameters(xcomb, pzSign),
                 LocalTrajectoryError(Ccomb), Tsos1.surface(),
                 &(Tsos1.globalParameters().magneticField()));
  return combTsos;  
}
TSOS TrajectoryStateCombiner::operator() ( const TSOS pTsos1,
const TSOS pTsos2 
) const [inline]

Definition at line 22 of file TrajectoryStateCombiner.h.

References combine().

                                                                {
    return combine( pTsos1, pTsos2);
  }