CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public 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 &direction, float transverseCurvature, int, const MagneticField *fieldProvider)
 
const MagneticFieldmagneticField () const
 
GlobalVector magneticFieldInInverseGeV (const GlobalPoint &x) const
 
GlobalVector momentum () const
 
GlobalPoint position () const
 
float signedInverseMomentum () const
 
float signedInverseTransverseMomentum () const
 
float transverseCurvature () const
 
AlgebraicVector6 vector () const
 

Private Attributes

float cachedCurvature_
 
bool hasCurvature_
 
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 16 of file GlobalTrajectoryParameters.h.

Constructor & Destructor Documentation

GlobalTrajectoryParameters::GlobalTrajectoryParameters ( )
inline

Definition at line 19 of file GlobalTrajectoryParameters.h.

19  :
20  theField(0),
21  theX(), theP(),
22  cachedCurvature_(0.0),
23  theCharge(0),
24  hasCurvature_(false) {} // 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 29 of file GlobalTrajectoryParameters.h.

32  :
33  theField(fieldProvider),
34  theX(aX), theP(aP),
35  cachedCurvature_(aCharge),
36  theCharge(aCharge),
37  hasCurvature_(false) {
38  } // we must initialize cache to non-NAN to avoid FPE
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 abs, f, MagneticField::inTesla(), PV3DBase< T, PVType, FrameType >::perp(), theCharge, theField, theP, theX, transverseCurvature(), and PV3DBase< T, PVType, FrameType >::z().

8  :
9  theField(fieldProvider),
11 {
12  float bza = -2.99792458e-3f * theField->inTesla(theX).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:72
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
#define abs(x)
Definition: mlp_lapack.h:159
T z() const
Definition: PV3DBase.h:64
double f[11][100]

Member Function Documentation

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

Definition at line 64 of file GlobalTrajectoryParameters.h.

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

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

Definition at line 28 of file GlobalTrajectoryParameters.cc.

References f, MagneticField::inTesla(), and theField.

Referenced by ReferenceTrajectory::addMaterialEffectsBrl(), AnalyticalCurvilinearJacobian::AnalyticalCurvilinearJacobian(), and operator<<().

29 {
30  return 2.99792458e-3f * theField->inTesla(x);
31 }
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
double f[11][100]
GlobalVector GlobalTrajectoryParameters::momentum ( ) const
inline

Global momentum.

Definition at line 60 of file GlobalTrajectoryParameters.h.

References theP.

Referenced by ReferenceTrajectory::addMaterialEffectsBrl(), MuonTrackLoader::buildTrackExtra(), TwoTrackMinimumDistanceLineLine::calculate(), VZeroFinder::checkTrackPair(), PixelClusterShapeSeedComparitor::compatible(), AnalyticalCurvilinearJacobian::computeFullJacobian(), AnalyticalCurvilinearJacobian::computeInfinitesimalJacobian(), AnalyticalCurvilinearJacobian::computeStraightLineJacobian(), NuclearTrackCorrector::getNewTrackExtra(), SeedFromConsecutiveHitsCreator::initialKinematic(), SeedForPhotonConversion1Leg::initialKinematic(), SeedForPhotonConversionFromQuadruplets::initialKinematic(), JacobianCartesianToCurvilinear::JacobianCartesianToCurvilinear(), JacobianCurvilinearToCartesian::JacobianCurvilinearToCartesian(), JacobianCurvilinearToLocal::JacobianCurvilinearToLocal(), PerigeeConversions::jacobianPerigee2Curvilinear(), SeedFromConsecutiveHitsCreator::makeSeed(), FreeTrajectoryState::momentum(), AnalyticalErrorPropagation::operator()(), ConvBremSeedProducer::produce(), TrackingRecHitProjector< ResultingHit >::project(), KfTrackProducerBase::putInEvt(), GsfTrackProducerBase::putInEvt(), TrackProducerWithSCAssociation::putInEvt(), KalmanAlignmentTrackRefitter::refitSingleTracklet(), TangentApproachInRPhi::trajectoryParameters(), SeedForPhotonConversion1Leg::trajectorySeed(), and TwoTrackMinimumDistanceHelixHelix::updateCoeffs().

60  {
61  return theP;
62  }
GlobalPoint GlobalTrajectoryParameters::position ( ) const
inline

Global position.

Definition at line 53 of file GlobalTrajectoryParameters.h.

References theX.

Referenced by ReferenceTrajectory::addMaterialEffectsBrl(), AnalyticalCurvilinearJacobian::AnalyticalCurvilinearJacobian(), MuonTrackLoader::buildTrackExtra(), TwoTrackMinimumDistanceHelixHelix::calculate(), TwoTrackMinimumDistanceLineLine::calculate(), PixelClusterShapeSeedComparitor::compatible(), PixelHitMatcher::compatibleSeeds(), AnalyticalCurvilinearJacobian::computeFullJacobian(), ConversionForwardEstimator::estimate(), ConversionBarrelEstimator::estimate(), ForwardMeasurementEstimator::estimate(), BarrelMeasurementEstimator::estimate(), AnalyticalImpactPointExtrapolator::extrapolateSingleState(), AnalyticalTrajectoryExtrapolatorToLine::extrapolateSingleState(), TwoTrackMinimumDistanceHelixHelix::finalPoints(), NuclearTrackCorrector::getNewTrackExtra(), SeedFromConsecutiveHitsCreator::initialKinematic(), SeedForPhotonConversion1Leg::initialKinematic(), SeedForPhotonConversionFromQuadruplets::initialKinematic(), JacobianCurvilinearToLocal::JacobianCurvilinearToLocal(), JacobianLocalToCurvilinear::JacobianLocalToCurvilinear(), PerigeeConversions::jacobianPerigee2Curvilinear(), AnalyticalErrorPropagation::operator()(), FreeTrajectoryState::position(), ConvBremSeedProducer::produce(), TauTagTools::propagTrackECALSurfContactPoint(), KfTrackProducerBase::putInEvt(), GsfTrackProducerBase::putInEvt(), TrackProducerWithSCAssociation::putInEvt(), TangentApproachInRPhi::trajectoryParameters(), and TwoTrackMinimumDistanceHelixHelix::updateCoeffs().

53  {
54  return theX;
55  }
float GlobalTrajectoryParameters::signedInverseMomentum ( ) const
inline
float GlobalTrajectoryParameters::signedInverseTransverseMomentum ( ) const
inline

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

Definition at line 85 of file GlobalTrajectoryParameters.h.

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

Referenced by transverseCurvature().

85  {
86  return theCharge/theP.perp();
87  }
T perp() const
Definition: PV3DBase.h:72
float GlobalTrajectoryParameters::transverseCurvature ( ) const

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 18 of file GlobalTrajectoryParameters.cc.

References cachedCurvature_, f, hasCurvature_, MagneticField::inTesla(), signedInverseTransverseMomentum(), theField, theX, unlikely, and PV3DBase< T, PVType, FrameType >::z().

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

19 {
20  if unlikely(!hasCurvature_) {
21  float bza = -2.99792458e-3f * theField->inTesla(theX).z();
23  hasCurvature_ = true;
24  }
25  return cachedCurvature_;
26 }
virtual GlobalVector inTesla(const GlobalPoint &gp) const =0
Field value ad specified global point, in Tesla.
#define unlikely(x)
Definition: Likely.h:21
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 100 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<<(), MinPtTrajectoryFilter::test(), and ThresholdPtTrajectoryFilter::test().

100  {
101  //AlgebraicVector6 v;
102  //v[0] = theX.x();
103  //v[1] = theX.y();
104  //v[2] = theX.z();
105  //v[3] = theP.x();
106  //v[4] = theP.y();
107  //v[5] = theP.z();
108  return AlgebraicVector6(theX.x(),theX.y(),theX.z(),theP.x(),theP.y(),theP.z());
109  }
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

float GlobalTrajectoryParameters::cachedCurvature_
mutableprivate

Definition at line 120 of file GlobalTrajectoryParameters.h.

Referenced by transverseCurvature().

bool GlobalTrajectoryParameters::hasCurvature_
mutableprivate

Definition at line 122 of file GlobalTrajectoryParameters.h.

Referenced by transverseCurvature().

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