CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
LocalTrajectoryError Class Reference

#include <LocalTrajectoryError.h>

Public Member Functions

bool invalid () const
 
 LocalTrajectoryError ()
 
 LocalTrajectoryError (InvalidError)
 
 LocalTrajectoryError (const AlgebraicSymMatrix55 &aCovarianceMatrix)
 
 LocalTrajectoryError (float dx, float dy, float dxdir, float dydir, float dpinv)
 
const AlgebraicSymMatrix55matrix () const
 
LocalTrajectoryErroroperator*= (double factor)
 
bool posDef () const
 
LocalError positionError () const
 
bool valid () const
 
const AlgebraicSymMatrix55weightMatrix () const
 
 ~LocalTrajectoryError ()
 

Private Attributes

AlgebraicSymMatrix55 theCovarianceMatrix
 
std::shared_ptr< AlgebraicSymMatrix55theWeightMatrixPtr
 

Detailed Description

Class providing access to the covariance matrix of a set of relevant parameters of a trajectory in a local, Cartesian frame. The errors provided are:

sigma^2(q/p) : charge (plus or minus one) divided by magnitude of momentum
sigma^2(dxdz) : direction tangent in local xz-plane
sigma^2(dydz) : direction tangent in local yz-plane
sigma^2(x) : local x-coordinate
sigma^2(y) : local y-coordinate

plus the relevant correlation terms.

Definition at line 20 of file LocalTrajectoryError.h.

Constructor & Destructor Documentation

◆ LocalTrajectoryError() [1/4]

LocalTrajectoryError::LocalTrajectoryError ( )
inline

Definition at line 23 of file LocalTrajectoryError.h.

23 {}

◆ LocalTrajectoryError() [2/4]

LocalTrajectoryError::LocalTrajectoryError ( InvalidError  )
inline

Definition at line 25 of file LocalTrajectoryError.h.

References theCovarianceMatrix.

25  : theCovarianceMatrix(ROOT::Math::SMatrixNoInit()) {
26  theCovarianceMatrix(0, 0) = -99999.e10;
27  }
AlgebraicSymMatrix55 theCovarianceMatrix

◆ ~LocalTrajectoryError()

LocalTrajectoryError::~LocalTrajectoryError ( )
inline

Definition at line 29 of file LocalTrajectoryError.h.

29 {}

◆ LocalTrajectoryError() [3/4]

LocalTrajectoryError::LocalTrajectoryError ( const AlgebraicSymMatrix55 aCovarianceMatrix)
inline

Constructing class from a full covariance matrix. The sequence of the parameters is the same as the one described above.

Definition at line 44 of file LocalTrajectoryError.h.

45  : theCovarianceMatrix(aCovarianceMatrix), theWeightMatrixPtr() {}
std::shared_ptr< AlgebraicSymMatrix55 > theWeightMatrixPtr
AlgebraicSymMatrix55 theCovarianceMatrix

◆ LocalTrajectoryError() [4/4]

LocalTrajectoryError::LocalTrajectoryError ( float  dx,
float  dy,
float  dxdir,
float  dydir,
float  dpinv 
)

Constructing class from standard deviations of the individual parameters, making the covariance matrix diagonal. The sequence of the input parameters is sigma(x), sigma(y), sigma(dxdz), sigma(dydz), sigma(q/p), but the resulting covariance matrix has the same structure as the one described above.

Definition at line 5 of file LocalTrajectoryError.cc.

References PVValHelper::dx, PVValHelper::dy, and theCovarianceMatrix.

7  theCovarianceMatrix(3, 3) = dx * dx;
8  theCovarianceMatrix(4, 4) = dy * dy;
9  theCovarianceMatrix(1, 1) = dxdir * dxdir;
10  theCovarianceMatrix(2, 2) = dydir * dydir;
11  theCovarianceMatrix(0, 0) = dpinv * dpinv;
12 }
std::shared_ptr< AlgebraicSymMatrix55 > theWeightMatrixPtr
AlgebraicSymMatrix55 theCovarianceMatrix

Member Function Documentation

◆ invalid()

bool LocalTrajectoryError::invalid ( ) const
inline

Definition at line 31 of file LocalTrajectoryError.h.

References theCovarianceMatrix.

Referenced by BasicTrajectoryState::localError(), and valid().

31 { return theCovarianceMatrix(0, 0) < -1.e10; }
AlgebraicSymMatrix55 theCovarianceMatrix

◆ matrix()

const AlgebraicSymMatrix55& LocalTrajectoryError::matrix ( void  ) const
inline

Returns the covariance matrix.

Definition at line 60 of file LocalTrajectoryError.h.

References theCovarianceMatrix.

Referenced by MuonResidualsFromTrack::addTrkCovMatrix(), GlobalTrackerMuonAlignment::analyzeTrackTrack(), GlobalTrackerMuonAlignment::analyzeTrackTrajectory(), OverlapValidation::analyzeTrajectory(), SiTrackerMultiRecHitUpdator::calcParameters(), BasicTrajectoryState::checkCurvilinError(), CollinearFitAtTM2::CollinearFitAtTM2(), TrajectoryStateCombiner::combine(), MultipleScatteringUpdator::compute(), GsfTrackProducerBase::computeModeAtTM(), PFGsfHelper::computeQpMode(), SiTrackerMultiRecHitUpdator::ComputeWeight(), ReferenceTrajectory::construct(), GlobalTrackerMuonAlignment::debugTrajectorySOS(), GlobalTrackerMuonAlignment::debugTrajectorySOSv(), MRHChi2MeasurementEstimator::estimate(), CollinearFitAtTM::fit(), GsfTrackProducerBase::localParametersFromQpMode(), GlobalMuonTrackMatcher::match_Chi2(), TSGForOIFromL2::match_Chi2(), SeedMatcher::matchSimTrack(), MeasurementExtractor::measuredError(), BasicTrajectoryState::missingError(), GlobalTrackerMuonAlignment::muonFitter(), oldMUcompute(), operator<<(), TRecHit5DParamConstraint::parametersError(), trajectoryStateTransform::persistentState(), TrackAssociatorByPositionImpl::quality(), BasicTrajectoryState::rescaleError(), TrajectorySegmentBuilder::segments(), CRackTrajectoryBuilder::SortHits(), FastTSGFromPropagation::stateOnDet(), ChargeSignificanceTrajectoryFilter::TBC(), GlobalTrackerMuonAlignment::trackFitter(), DualTrajectoryFactory::trajectories(), DualBzeroTrajectoryFactory::trajectories(), Strip1DMeasurementTransformator::trajectoryError(), Tsos2DPhi::Tsos2DPhi(), Tsos2DZed::Tsos2DZed(), Tsos4D::Tsos4D(), GsfMaterialEffectsUpdator::updateState(), and MaterialEffectsUpdator::updateStateInPlace().

60 { return theCovarianceMatrix; }
AlgebraicSymMatrix55 theCovarianceMatrix

◆ operator*=()

LocalTrajectoryError& LocalTrajectoryError::operator*= ( double  factor)
inline

Enables the multiplication of the covariance matrix with the scalar "factor".

Definition at line 69 of file LocalTrajectoryError.h.

References theCovarianceMatrix, and theWeightMatrixPtr.

69  {
71  if ((theWeightMatrixPtr.get() != nullptr) && (factor != 0.0)) {
72  (*theWeightMatrixPtr) /= factor;
73  }
74  return *this;
75  }
std::shared_ptr< AlgebraicSymMatrix55 > theWeightMatrixPtr
AlgebraicSymMatrix55 theCovarianceMatrix

◆ posDef()

bool LocalTrajectoryError::posDef ( ) const
inline

Definition at line 35 of file LocalTrajectoryError.h.

References theCovarianceMatrix.

Referenced by KFTrajectoryFitter::fitOne(), and GsfMultiStateUpdator::update().

35  {
36  return (theCovarianceMatrix(0, 0) >= 0) && (theCovarianceMatrix(1, 1) >= 0) && (theCovarianceMatrix(2, 2) >= 0) &&
37  (theCovarianceMatrix(3, 3) >= 0) && (theCovarianceMatrix(4, 4) >= 0);
38  }
AlgebraicSymMatrix55 theCovarianceMatrix

◆ positionError()

LocalError LocalTrajectoryError::positionError ( ) const
inline

Returns the two-by-two submatrix of the covariance matrix which yields the local position errors as well as the correlation between them.

Definition at line 81 of file LocalTrajectoryError.h.

References theCovarianceMatrix.

Referenced by CkfDebugger::analyseCompatibleMeasurements(), TkGluedMeasurementDet::checkHitProjection(), MTDSectorForwardDoubleLayer::compatible(), ForwardDetLayer::compatible(), MuRingForwardDoubleLayer::compatible(), MTDRingForwardDoubleLayer::compatible(), MTDSectorForwardLayer::compatibleDets(), MuRingForwardLayer::compatibleDets(), MTDRingForwardLayer::compatibleDets(), CaloDetIdAssociator::crossedElement(), OutsideInMuonSeeder::doLayer(), Chi2MeasurementEstimatorBase::estimate(), AlignmentMonitorGeneric::event(), AlignmentMonitorMuonResiduals::event(), TrackerValidationVariables::fillHitQuantities(), ApeEstimator::fillHitVariables(), TrackDetectorAssociator::getTAMuonChamberMatches(), TkPixelMeasurementDet::hasBadComponents(), deDxTools::isFarFromBorder(), ShallowGainCalibration::isFarFromBorder(), SiStripGainFromData::IsFarFromBorder(), TRecHit5DParamConstraint::localPositionError(), GlobalMuonTrackMatcher::match_dist(), Chi2MeasurementEstimatorBase::maximalLocalDisplacement(), TkPixelMeasurementDet::measurements(), TkStripMeasurementDet::measurements(), MuonResidualsFromTrack::MuonResidualsFromTrack(), HIPAlignmentAlgorithm::processHit1D(), HIPAlignmentAlgorithm::processHit2D(), AlignmentMuonHIPTrajectorySelector::produce(), TkPhase2OTMeasurementDet::recHits(), TkGluedMeasurementDet::testStrips(), TrackEfficiencyMonitor::testTrackerTracks(), trajectoryToResiduals(), SimpleNavigableLayer::wellInside(), MuRodBarrelLayer::xError(), and MTDTrayBarrelLayer::xError().

81  {
83  }
AlgebraicSymMatrix55 theCovarianceMatrix

◆ valid()

bool LocalTrajectoryError::valid ( ) const
inline

◆ weightMatrix()

const AlgebraicSymMatrix55 & LocalTrajectoryError::weightMatrix ( void  ) const

Returns the inverse of covariance matrix.

Definition at line 14 of file LocalTrajectoryError.cc.

References invertPosDefMatrix(), theCovarianceMatrix, theWeightMatrixPtr, and UNLIKELY.

14  {
15  if UNLIKELY (theWeightMatrixPtr.get() == nullptr) {
18  }
19  return *theWeightMatrixPtr;
20 }
std::shared_ptr< AlgebraicSymMatrix55 > theWeightMatrixPtr
bool invertPosDefMatrix(ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > &m)
AlgebraicSymMatrix55 theCovarianceMatrix
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
#define UNLIKELY(x)
Definition: Likely.h:21

Member Data Documentation

◆ theCovarianceMatrix

AlgebraicSymMatrix55 LocalTrajectoryError::theCovarianceMatrix
private

◆ theWeightMatrixPtr

std::shared_ptr<AlgebraicSymMatrix55> LocalTrajectoryError::theWeightMatrixPtr
mutableprivate

Definition at line 87 of file LocalTrajectoryError.h.

Referenced by operator*=(), and weightMatrix().