#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 |
Combines the information from two trajectory states via a weighted mean. The input states should not be correlated. Ported from ORCA
Definition at line 15 of file TrajectoryStateCombiner.h.
Definition at line 18 of file TrajectoryStateCombiner.h.
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 SiPixelTrackResidualSource::analyze(), CSCPairResidualsConstraint::dphidzFromTrack(), AlignmentMonitorTemplate::event(), AlignmentMonitorMuonResiduals::event(), TrackerValidationVariables::fillHitQuantities(), SimpleMTFHitCollector::getTSOS(), operator()(), AlignmentMuonHIPTrajectorySelector::produce(), HIPAlignmentAlgorithm::run(), TrackInfoProducerAlgorithm::run(), TrajectoryAtInvalidHit::TrajectoryAtInvalidHit(), and MTFTrackProducerAlgorithm::updateHits().
{ 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; }