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
 
GlobalVector magneticFieldInInverseGeV (const GlobalPoint &x) 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.

28  : theField(fieldProvider), theX(aX), theP(aP), theCharge(aCharge) {
29  setCache();
30  }

References setCache().

◆ GlobalTrajectoryParameters() [3/5]

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

Definition at line 32 of file GlobalTrajectoryParameters.h.

37  : theField(fieldProvider), theX(aX), theP(aP), cachedMagneticField(fieldValue), theCharge(aCharge) {}

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

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 }

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

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

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 }

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

Member Function Documentation

◆ charge()

TrackCharge GlobalTrajectoryParameters::charge ( void  ) const
inline

◆ direction()

GlobalVector GlobalTrajectoryParameters::direction ( ) const
inline

Definition at line 67 of file GlobalTrajectoryParameters.h.

67 { return theP.unit(); }

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

Referenced by GlobalTrajectoryParameters().

◆ magneticField()

const MagneticField& GlobalTrajectoryParameters::magneticField ( ) const
inline

◆ magneticFieldInInverseGeV() [1/2]

GlobalVector GlobalTrajectoryParameters::magneticFieldInInverseGeV ( ) const
inline

Definition at line 102 of file GlobalTrajectoryParameters.h.

102 { return 2.99792458e-3f * cachedMagneticField; }

References cachedMagneticField, and f.

◆ magneticFieldInInverseGeV() [2/2]

GlobalVector GlobalTrajectoryParameters::magneticFieldInInverseGeV ( const GlobalPoint x) const

◆ magneticFieldInTesla()

GlobalVector GlobalTrajectoryParameters::magneticFieldInTesla ( ) const
inline

Definition at line 104 of file GlobalTrajectoryParameters.h.

104 { return cachedMagneticField; }

References cachedMagneticField.

Referenced by BasicTrajectoryState::update().

◆ momentum()

GlobalVector GlobalTrajectoryParameters::momentum ( ) const
inline

Global momentum.

Definition at line 65 of file GlobalTrajectoryParameters.h.

65 { return theP; }

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(), SeedForPhotonConversion1Leg::initialKinematic(), SeedFromConsecutiveHitsCreator::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().

◆ position()

GlobalPoint GlobalTrajectoryParameters::position ( ) const
inline

Global position.

Definition at line 60 of file GlobalTrajectoryParameters.h.

60 { return theX; }

References theX.

Referenced by ReferenceTrajectory::addMaterialEffectsBrl(), analyticalErrorPropagation(), MuonTrackLoader::buildTrackExtra(), TrackExtenderWithMTDT< TrackCollection >::buildTrackExtra(), TwoTrackMinimumDistanceHelixHelix::calculate(), TwoTrackMinimumDistanceLineLine::calculate(), TwoTrackMinimumDistance::calculate(), PixelClusterShapeSeedComparitor::compatible(), StripSubClusterShapeSeedFilter::compatible(), AnalyticalCurvilinearJacobian::computeFullJacobian(), MkFitInputConverter::convertSeeds(), ConversionForwardEstimator::estimate(), ConversionBarrelEstimator::estimate(), AnalyticalImpactPointExtrapolator::extrapolateSingleState(), AnalyticalTrajectoryExtrapolatorToLine::extrapolateSingleState(), TwoTrackMinimumDistanceHelixHelix::finalPoints(), NuclearTrackCorrector::getNewTrackExtra(), SeedFromConsecutiveHitsTripletOnlyCreator::initialKinematic(), SeedForPhotonConversion1Leg::initialKinematic(), SeedFromConsecutiveHitsCreator::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().

◆ setCache()

void GlobalTrajectoryParameters::setCache ( )
private

Definition at line 31 of file GlobalTrajectoryParameters.cc.

31  {
33 } // we must initialize cache to non-NAN to avoid FPE

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

Referenced by GlobalTrajectoryParameters().

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

82 { return theCharge / theP.perp(); }

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.

89  {
90  return -2.99792458e-3f * signedInverseTransverseMomentum() * cachedMagneticField.z();
91  }

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

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

97  {
98  return AlgebraicVector6(theX.x(), theX.y(), theX.z(), theP.x(), theP.y(), theP.z());
99  }

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

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
GlobalTrajectoryParameters::theField
const MagneticField * theField
Definition: GlobalTrajectoryParameters.h:112
MagneticField::inTesla
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
GlobalTrajectoryParameters::theX
GlobalPoint theX
Definition: GlobalTrajectoryParameters.h:113
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
GlobalTrajectoryParameters::signedInverseTransverseMomentum
float signedInverseTransverseMomentum() const
Definition: GlobalTrajectoryParameters.h:82
DDAxes::x
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
Vector3DBase::unit
Vector3DBase unit() const
Definition: Vector3DBase.h:54
GlobalTrajectoryParameters::direction
GlobalVector direction() const
Definition: GlobalTrajectoryParameters.h:67
GlobalTrajectoryParameters::transverseCurvature
float transverseCurvature() const
Definition: GlobalTrajectoryParameters.h:89
GlobalTrajectoryParameters::theCharge
signed char theCharge
Definition: GlobalTrajectoryParameters.h:116
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
GlobalTrajectoryParameters::cachedMagneticField
GlobalVector cachedMagneticField
Definition: GlobalTrajectoryParameters.h:115
GlobalTrajectoryParameters::setCache
void setCache()
Definition: GlobalTrajectoryParameters.cc:31
AlgebraicVector6
ROOT::Math::SVector< double, 6 > AlgebraicVector6
Definition: AlgebraicROOTObjects.h:15
PV3DBase::mag
T mag() const
Definition: PV3DBase.h:64
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
GlobalTrajectoryParameters::theP
GlobalVector theP
Definition: GlobalTrajectoryParameters.h:114
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69