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 (const AlgebraicSymMatrix55 &aCovarianceMatrix)
 
 LocalTrajectoryError (float dx, float dy, float dxdir, float dydir, float dpinv)
 
 LocalTrajectoryError (InvalidError)
 
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.

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

References 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() {}

◆ 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.

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 }

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

Member Function Documentation

◆ invalid()

bool LocalTrajectoryError::invalid ( ) const
inline

Definition at line 31 of file LocalTrajectoryError.h.

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

References theCovarianceMatrix.

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

◆ matrix()

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

Returns the covariance matrix.

Definition at line 60 of file LocalTrajectoryError.h.

60 { return theCovarianceMatrix; }

References theCovarianceMatrix.

Referenced by MuonResidualsFromTrack::addTrkCovMatrix(), OverlapValidation::analyze(), GlobalTrackerMuonAlignment::analyzeTrackTrack(), GlobalTrackerMuonAlignment::analyzeTrackTrajectory(), 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(), TSGForOI::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().

◆ 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.

69  {
71  if ((theWeightMatrixPtr.get() != nullptr) && (factor != 0.0)) {
72  (*theWeightMatrixPtr) /= factor;
73  }
74  return *this;
75  }

References DQMScaleToClient_cfi::factor, theCovarianceMatrix, and theWeightMatrixPtr.

◆ posDef()

bool LocalTrajectoryError::posDef ( ) const
inline

Definition at line 35 of file LocalTrajectoryError.h.

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  }

References theCovarianceMatrix.

Referenced by KFTrajectoryFitter::fitOne().

◆ 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.

81  {
83  }

References theCovarianceMatrix.

Referenced by CkfDebugger::analyseCompatibleMeasurements(), GEMEfficiencyAnalyzer::analyze(), 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(), ShallowGainCalibration::isFarFromBorder(), SiStripGainFromData::IsFarFromBorder(), DeDxTools::IsFarFromBorder(), TRecHit5DParamConstraint::localPositionError(), GlobalMuonTrackMatcher::match_dist(), Chi2MeasurementEstimatorBase::maximalLocalDisplacement(), TkPixelMeasurementDet::measurements(), TkStripMeasurementDet::measurements(), MuonResidualsFromTrack::MuonResidualsFromTrack(), HIPAlignmentAlgorithm::processHit1D(), HIPAlignmentAlgorithm::processHit2D(), ShallowTrackClustersProducer::produce(), AlignmentMuonHIPTrajectorySelector::produce(), TkPhase2OTMeasurementDet::recHits(), TkGluedMeasurementDet::testStrips(), TrackEfficiencyMonitor::testTrackerTracks(), trajectoryToResiduals(), SimpleNavigableLayer::wellInside(), MTDTrayBarrelLayer::xError(), and MuRodBarrelLayer::xError().

◆ 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.

14  {
15  if
16  UNLIKELY(theWeightMatrixPtr.get() == nullptr) {
19  }
20  return *theWeightMatrixPtr;
21 }

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

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().

LocalTrajectoryError::theCovarianceMatrix
AlgebraicSymMatrix55 theCovarianceMatrix
Definition: LocalTrajectoryError.h:86
LocalTrajectoryError::invalid
bool invalid() const
Definition: LocalTrajectoryError.h:31
UNLIKELY
#define UNLIKELY(x)
Definition: Likely.h:21
DQMScaleToClient_cfi.factor
factor
Definition: DQMScaleToClient_cfi.py:8
LocalError
Definition: LocalError.h:12
invertPosDefMatrix
bool invertPosDefMatrix(ROOT::Math::SMatrix< T, N, N, ROOT::Math::MatRepSym< T, N > > &m)
Definition: invertPosDefMatrix.h:10
PVValHelper::dy
Definition: PVValidationHelpers.h:49
LocalTrajectoryError::theWeightMatrixPtr
std::shared_ptr< AlgebraicSymMatrix55 > theWeightMatrixPtr
Definition: LocalTrajectoryError.h:87
AlgebraicSymMatrix55
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
Definition: AlgebraicROOTObjects.h:23
PVValHelper::dx
Definition: PVValidationHelpers.h:48