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::GlobalTrajectoryParameters ( )
inline

Definition at line 18 of file GlobalTrajectoryParameters.h.

Referenced by GlobalTrajectoryParameters().

18  :
19  theField(nullptr),
20  theX(), theP(),
21  theCharge(0)
22  {} // we must initialize cache to non-NAN to avoid FPE
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 27 of file GlobalTrajectoryParameters.h.

References setCache().

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

Definition at line 37 of file GlobalTrajectoryParameters.h.

References direction(), GlobalTrajectoryParameters(), and transverseCurvature().

41  :
42  theField(fieldProvider),
43  theX(aX), theP(aP),
44  cachedMagneticField(fieldValue),
45  theCharge(aCharge)
46  {}
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, f, MagneticField::inTesla(), PV3DBase< T, PVType, FrameType >::perp(), theCharge, theField, theP, theX, transverseCurvature(), and PV3DBase< T, PVType, FrameType >::z().

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

Definition at line 20 of file GlobalTrajectoryParameters.cc.

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

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

Member Function Documentation

TrackCharge GlobalTrajectoryParameters::charge ( void  ) const
inline
GlobalVector GlobalTrajectoryParameters::direction ( ) const
inline

Definition at line 82 of file GlobalTrajectoryParameters.h.

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

Referenced by GlobalTrajectoryParameters().

82  {
83  return theP.unit();
84  }
Vector3DBase unit() const
Definition: Vector3DBase.h:57
const MagneticField& GlobalTrajectoryParameters::magneticField ( ) const
inline
GlobalVector GlobalTrajectoryParameters::magneticFieldInInverseGeV ( const GlobalPoint x) const
GlobalVector GlobalTrajectoryParameters::magneticFieldInInverseGeV ( ) const
inline

Definition at line 126 of file GlobalTrajectoryParameters.h.

References cachedMagneticField, and f.

Referenced by vector().

126  {
127  return 2.99792458e-3f * cachedMagneticField;
128  }
double f[11][100]
GlobalVector GlobalTrajectoryParameters::magneticFieldInTesla ( ) const
inline

Definition at line 130 of file GlobalTrajectoryParameters.h.

References cachedMagneticField.

Referenced by BasicTrajectoryState::notValid(), and BasicTrajectoryState::update().

130  {
131  return cachedMagneticField;
132  }
GlobalVector GlobalTrajectoryParameters::momentum ( ) const
inline

Global momentum.

Definition at line 78 of file GlobalTrajectoryParameters.h.

References theP.

Referenced by ReferenceTrajectory::addMaterialEffectsBrl(), analyticalErrorPropagation(), MuonTrackLoader::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(), TkClonerImpl::makeShared(), 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().

78  {
79  return theP;
80  }
GlobalPoint GlobalTrajectoryParameters::position ( ) const
inline

Global position.

Definition at line 71 of file GlobalTrajectoryParameters.h.

References theX.

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

71  {
72  return theX;
73  }
void GlobalTrajectoryParameters::setCache ( )
private

Definition at line 35 of file GlobalTrajectoryParameters.cc.

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

Referenced by GlobalTrajectoryParameters(), and magneticField().

35  {
37 } // 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
float GlobalTrajectoryParameters::signedInverseMomentum ( ) const
inline
float GlobalTrajectoryParameters::signedInverseTransverseMomentum ( ) const
inline

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

Definition at line 103 of file GlobalTrajectoryParameters.h.

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

Referenced by transverseCurvature().

103  {
104  return theCharge/theP.perp();
105  }
T perp() const
Definition: PV3DBase.h:72
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 112 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().

112  {
113  return -2.99792458e-3f * signedInverseTransverseMomentum() * cachedMagneticField.z();
114  }
T z() const
Definition: PV3DBase.h:64
double f[11][100]
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 120 of file GlobalTrajectoryParameters.h.

References magneticFieldInInverseGeV(), theP, theX, x, 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().

120  {
121  return AlgebraicVector6(theX.x(),theX.y(),theX.z(),theP.x(),theP.y(),theP.z());
122  }
T y() const
Definition: PV3DBase.h:63
ROOT::Math::SVector< double, 6 > AlgebraicVector6
T z() const
Definition: PV3DBase.h:64
T x() const
Definition: PV3DBase.h:62

Member Data Documentation

GlobalVector GlobalTrajectoryParameters::cachedMagneticField
private
signed char GlobalTrajectoryParameters::theCharge
private
const MagneticField* GlobalTrajectoryParameters::theField
private
GlobalVector GlobalTrajectoryParameters::theP
private
GlobalPoint GlobalTrajectoryParameters::theX
private