CMS 3D CMS Logo

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

#include <GlobalTrajectoryParameters.h>

Public Member Functions

TrackCharge charge () const
 
GlobalVector direction () const
 
 GlobalTrajectoryParameters ()
 
 GlobalTrajectoryParameters (const GlobalPoint &aX, const GlobalVector &aP, TrackCharge aCharge, const MagneticField *fieldProvider)
 
 GlobalTrajectoryParameters (const GlobalPoint &aX, const GlobalVector &aP, TrackCharge aCharge, const MagneticField *fieldProvider, GlobalVector fieldValue)
 
 GlobalTrajectoryParameters (const GlobalPoint &aX, const GlobalVector &direction, float transverseCurvature, int, const MagneticField *fieldProvider)
 
 GlobalTrajectoryParameters (const GlobalPoint &aX, const GlobalVector &direction, float transverseCurvature, int, const MagneticField *fieldProvider, GlobalVector fieldValue)
 
const MagneticFieldmagneticField () const
 
GlobalVector magneticFieldInInverseGeV (const GlobalPoint &x) const
 
GlobalVector magneticFieldInInverseGeV () const
 
GlobalVector magneticFieldInTesla () const
 
GlobalVector momentum () const
 
GlobalPoint position () const
 
float signedInverseMomentum () const
 
float signedInverseTransverseMomentum () const
 
float transverseCurvature () const
 
AlgebraicVector6 vector () const
 

Private Member Functions

void setCache ()
 

Private Attributes

GlobalVector cachedMagneticField
 
signed char theCharge
 
const MagneticFieldtheField
 
GlobalVector theP
 
GlobalPoint theX
 

Detailed Description

Class providing access to a set of relevant parameters of a trajectory in the global, Cartesian frame. The basic data members used to calculate these parameters are the charge and global position and momentum.

Definition at line 15 of file GlobalTrajectoryParameters.h.

Constructor & Destructor Documentation

◆ GlobalTrajectoryParameters() [1/5]

GlobalTrajectoryParameters::GlobalTrajectoryParameters ( )
inline

Definition at line 18 of file GlobalTrajectoryParameters.h.

19  : theField(nullptr), theX(), theP(), theCharge(0) {} // we must initialize cache to non-NAN to avoid FPE

◆ GlobalTrajectoryParameters() [2/5]

GlobalTrajectoryParameters::GlobalTrajectoryParameters ( const GlobalPoint aX,
const GlobalVector aP,
TrackCharge  aCharge,
const MagneticField fieldProvider 
)
inline

Constructing class from global position, global momentum and charge.

Definition at line 24 of file GlobalTrajectoryParameters.h.

References setCache().

◆ GlobalTrajectoryParameters() [3/5]

GlobalTrajectoryParameters::GlobalTrajectoryParameters ( const GlobalPoint aX,
const GlobalVector aP,
TrackCharge  aCharge,
const MagneticField fieldProvider,
GlobalVector  fieldValue 
)
inline

◆ GlobalTrajectoryParameters() [4/5]

GlobalTrajectoryParameters::GlobalTrajectoryParameters ( const GlobalPoint aX,
const GlobalVector direction,
float  transverseCurvature,
int  ,
const MagneticField fieldProvider 
)

Constructing class from global position, direction (unit length) and transverse curvature. The fourth int argument is dummy, it serves only to distinguish this constructor from the one above.

Definition at line 5 of file GlobalTrajectoryParameters.cc.

References funct::abs(), cachedMagneticField, direction(), f, MagneticField::inTesla(), PV3DBase< T, PVType, FrameType >::perp(), theCharge, theField, theP, theX, transverseCurvature(), and PV3DBase< T, PVType, FrameType >::z().

10  : theField(fieldProvider), theX(aX) {
12  float bza = -2.99792458e-3f * cachedMagneticField.z();
13  float qbpi = bza / (direction.perp() * transverseCurvature);
14  theP = direction * std::abs(qbpi);
15  theCharge = qbpi > 0.f ? 1 : -1;
16 }
T perp() const
Definition: PV3DBase.h:69
T z() const
Definition: PV3DBase.h:61
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]

◆ GlobalTrajectoryParameters() [5/5]

GlobalTrajectoryParameters::GlobalTrajectoryParameters ( const GlobalPoint aX,
const GlobalVector direction,
float  transverseCurvature,
int  ,
const MagneticField fieldProvider,
GlobalVector  fieldValue 
)

Definition at line 18 of file GlobalTrajectoryParameters.cc.

References funct::abs(), cachedMagneticField, direction(), f, PV3DBase< T, PVType, FrameType >::perp(), theCharge, theP, transverseCurvature(), and PV3DBase< T, PVType, FrameType >::z().

24  : theField(fieldProvider), theX(aX), cachedMagneticField(fieldValue) {
25  float bza = -2.99792458e-3f * cachedMagneticField.z();
26  float qbpi = bza / (direction.perp() * transverseCurvature);
27  theP = direction * std::abs(qbpi);
28  theCharge = qbpi > 0.f ? 1 : -1;
29 }
T perp() const
Definition: PV3DBase.h:69
T z() const
Definition: PV3DBase.h:61
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]

Member Function Documentation

◆ charge()

TrackCharge GlobalTrajectoryParameters::charge ( void  ) const
inline

◆ direction()

GlobalVector GlobalTrajectoryParameters::direction ( ) const
inline

Definition at line 67 of file GlobalTrajectoryParameters.h.

References theP, and Vector3DBase< T, FrameTag >::unit().

Referenced by GlobalTrajectoryParameters().

67 { return theP.unit(); }
Vector3DBase unit() const
Definition: Vector3DBase.h:54

◆ magneticField()

const MagneticField& GlobalTrajectoryParameters::magneticField ( ) const
inline

◆ magneticFieldInInverseGeV() [1/2]

GlobalVector GlobalTrajectoryParameters::magneticFieldInInverseGeV ( const GlobalPoint x) const

◆ magneticFieldInInverseGeV() [2/2]

GlobalVector GlobalTrajectoryParameters::magneticFieldInInverseGeV ( ) const
inline

Definition at line 102 of file GlobalTrajectoryParameters.h.

References cachedMagneticField, and f.

102 { return 2.99792458e-3f * cachedMagneticField; }
double f[11][100]

◆ magneticFieldInTesla()

GlobalVector GlobalTrajectoryParameters::magneticFieldInTesla ( ) const
inline

Definition at line 104 of file GlobalTrajectoryParameters.h.

References cachedMagneticField.

Referenced by BasicTrajectoryState::update().

◆ momentum()

GlobalVector GlobalTrajectoryParameters::momentum ( ) const
inline

Global momentum.

Definition at line 65 of file GlobalTrajectoryParameters.h.

References theP.

Referenced by ReferenceTrajectory::addMaterialEffectsBrl(), analyticalErrorPropagation(), MuonTrackLoader::buildTrackExtra(), TrackExtenderWithMTDT< TrackCollection >::buildTrackExtra(), TwoTrackMinimumDistanceLineLine::calculate(), TkGluedMeasurementDet::checkHitProjection(), TkGluedMeasurementDet::collectRecHits(), PixelClusterShapeSeedComparitor::compatible(), StripSubClusterShapeSeedFilter::compatible(), AnalyticalCurvilinearJacobian::computeFullJacobian(), AnalyticalCurvilinearJacobian::computeInfinitesimalJacobian(), AnalyticalCurvilinearJacobian::computeStraightLineJacobian(), NuclearTrackCorrector::getNewTrackExtra(), SeedFromConsecutiveHitsTripletOnlyCreator::initialKinematic(), SeedFromConsecutiveHitsCreator::initialKinematic(), SeedForPhotonConversion1Leg::initialKinematic(), SeedForPhotonConversionFromQuadruplets::initialKinematic(), JacobianCurvilinearToLocal::JacobianCurvilinearToLocal(), PerigeeConversions::jacobianPerigee2Curvilinear(), SeedFromConsecutiveHitsCreator::makeSeed(), FreeTrajectoryState::momentum(), ClosestApproachInRPhi::newTrajectory(), TwoTrackMinimumDistance::pointsHelixHelix(), ConvBremSeedProducer::produce(), TkGluedMeasurementDet::projectOnGluedDet(), AnalyticalPropagator::propagatedStateWithPath(), KfTrackProducerBase::putInEvt(), GsfTrackProducerBase::putInEvt(), TrackProducerWithSCAssociation::putInEvt(), TkGluedMeasurementDet::testStrips(), TangentApproachInRPhi::trajectoryParameters(), SeedForPhotonConversion1Leg::trajectorySeed(), and TwoTrackMinimumDistanceHelixHelix::updateCoeffs().

65 { return theP; }

◆ position()

GlobalPoint GlobalTrajectoryParameters::position ( ) const
inline

Global position.

Definition at line 60 of file GlobalTrajectoryParameters.h.

References theX.

Referenced by ReferenceTrajectory::addMaterialEffectsBrl(), analyticalErrorPropagation(), MuonTrackLoader::buildTrackExtra(), TrackExtenderWithMTDT< TrackCollection >::buildTrackExtra(), TwoTrackMinimumDistanceHelixHelix::calculate(), TwoTrackMinimumDistanceLineLine::calculate(), TwoTrackMinimumDistance::calculate(), PixelClusterShapeSeedComparitor::compatible(), StripSubClusterShapeSeedFilter::compatible(), AnalyticalCurvilinearJacobian::computeFullJacobian(), MkFitSeedConverter::convertSeeds(), ConversionForwardEstimator::estimate(), ConversionBarrelEstimator::estimate(), AnalyticalImpactPointExtrapolator::extrapolateSingleState(), AnalyticalTrajectoryExtrapolatorToLine::extrapolateSingleState(), TwoTrackMinimumDistanceHelixHelix::finalPoints(), NuclearTrackCorrector::getNewTrackExtra(), SeedFromConsecutiveHitsTripletOnlyCreator::initialKinematic(), SeedFromConsecutiveHitsCreator::initialKinematic(), SeedForPhotonConversion1Leg::initialKinematic(), SeedForPhotonConversionFromQuadruplets::initialKinematic(), ClosestApproachInRPhi::newTrajectory(), PixelHitMatcher::BarrelMeasurementEstimator::operator()(), PixelHitMatcher::ForwardMeasurementEstimator::operator()(), TwoTrackMinimumDistance::pointsHelixHelix(), FreeTrajectoryState::position(), ConvBremSeedProducer::produce(), AnalyticalPropagator::propagatedStateWithPath(), KfTrackProducerBase::putInEvt(), GsfTrackProducerBase::putInEvt(), TrackProducerWithSCAssociation::putInEvt(), TangentApproachInRPhi::trajectoryParameters(), and TwoTrackMinimumDistanceHelixHelix::updateCoeffs().

60 { return theX; }

◆ setCache()

void GlobalTrajectoryParameters::setCache ( )
private

Definition at line 31 of file GlobalTrajectoryParameters.cc.

References cachedMagneticField, MagneticField::inTesla(), theField, and theX.

Referenced by GlobalTrajectoryParameters().

31  {
33 } // we must initialize cache to non-NAN to avoid FPE
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
Global3DVector GlobalVector
Definition: GlobalVector.h:10

◆ signedInverseMomentum()

float GlobalTrajectoryParameters::signedInverseMomentum ( ) const
inline

◆ signedInverseTransverseMomentum()

float GlobalTrajectoryParameters::signedInverseTransverseMomentum ( ) const
inline

Charge divided by transverse momentum, i.e. q/p_T.

Definition at line 82 of file GlobalTrajectoryParameters.h.

References PV3DBase< T, PVType, FrameType >::perp(), theCharge, and theP.

Referenced by transverseCurvature().

◆ transverseCurvature()

float GlobalTrajectoryParameters::transverseCurvature ( ) const
inline

Transverse curvature kappa (which is the inverse radius of curvature in the transverse plane) in cm^{-1}. Sign convention is such that positive kappa means counterclockwise rotation of the track with respect to the global z-axis.

Definition at line 89 of file GlobalTrajectoryParameters.h.

References cachedMagneticField, f, signedInverseTransverseMomentum(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by AnalyticalCurvilinearJacobian::AnalyticalCurvilinearJacobian(), GlobalTrajectoryParameters(), SeedForPhotonConversion1Leg::initialKinematic(), SeedForPhotonConversionFromQuadruplets::initialKinematic(), GeomDetCompatibilityChecker::isCompatible(), PerigeeConversions::jacobianPerigee2Curvilinear(), and FreeTrajectoryState::transverseCurvature().

89  {
90  return -2.99792458e-3f * signedInverseTransverseMomentum() * cachedMagneticField.z();
91  }
T z() const
Definition: PV3DBase.h:61
double f[11][100]

◆ vector()

AlgebraicVector6 GlobalTrajectoryParameters::vector ( ) const
inline

Vector whose first three elements are the global position coordinates and whose last three elements are the global momentum coordinates.

Definition at line 97 of file GlobalTrajectoryParameters.h.

References theP, theX, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by GlobalTrackerMuonAlignment::debugTrajectorySOS(), GlobalTrackerMuonAlignment::debugTrajectorySOSv(), operator<<(), and ThresholdPtTrajectoryFilter::test().

97  {
98  return AlgebraicVector6(theX.x(), theX.y(), theX.z(), theP.x(), theP.y(), theP.z());
99  }
T z() const
Definition: PV3DBase.h:61
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
ROOT::Math::SVector< double, 6 > AlgebraicVector6

Member Data Documentation

◆ cachedMagneticField

GlobalVector GlobalTrajectoryParameters::cachedMagneticField
private

◆ theCharge

signed char GlobalTrajectoryParameters::theCharge
private

◆ theField

const MagneticField* GlobalTrajectoryParameters::theField
private

◆ theP

GlobalVector GlobalTrajectoryParameters::theP
private

◆ theX

GlobalPoint GlobalTrajectoryParameters::theX
private