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
LocalTrajectoryParameters Class Reference

#include <LocalTrajectoryParameters.h>

Public Member Functions

float absdz () const
 
TrackCharge charge () const
 Charge (-1, 0 or 1) More...
 
LocalVector direction () const
 Momentum vector unit in the local frame. More...
 
float dxdz () const
 
float dydz () const
 
 LocalTrajectoryParameters ()
 
 LocalTrajectoryParameters (const AlgebraicVector5 &v, float aPzSign, bool charged=true)
 
 LocalTrajectoryParameters (float aQbp, float aDxdz, float aDydz, float aX, float aY, float aPzSign, bool charged=true)
 
 LocalTrajectoryParameters (const LocalPoint &pos, const LocalVector &p, TrackCharge charge)
 Constructor from local position, momentum and charge. More...
 
AlgebraicVector5 mixedFormatVector () const
 
LocalVector momentum () const
 Momentum vector in the local frame. More...
 
LocalPoint position () const
 Local x and y position coordinates. More...
 
float pzSign () const
 Sign of the z-component of the momentum in the local frame. More...
 
float qbp () const
 
float signedInverseMomentum () const
 Signed inverse momentum q/p (zero for neutrals). More...
 
bool updateP (float dP)
 Update of momentum by a scalar dP. More...
 
AlgebraicVector5 vector () const
 

Private Attributes

short theCharge
 charge More...
 
float theDxdz
 tangent of direction in local x vs. z More...
 
float theDydz
 tangent of direction in local y vs. z More...
 
short thePzSign
 sign of local pz More...
 
float theQbp
 q/p (charged) or 1/p (neutral) More...
 
float theX
 local x position More...
 
float theY
 local y position More...
 

Detailed Description

Class providing access to a set of relevant parameters of a trajectory in a local, Cartesian frame. The set consists of the following parameters:

q/p : charged particles: charge (plus or minus one) divided by magnitude of momentum
neutral particles: inverse magnitude of momentum
dxdz : direction tangent in local xz-plane
dydz : direction tangent in local yz-plane
x : local x-coordinate
y : local y-coordinate

In addition, the sign of local p_z is needed to fully define the direction of the track in this local frame.

Definition at line 25 of file LocalTrajectoryParameters.h.

Constructor & Destructor Documentation

LocalTrajectoryParameters::LocalTrajectoryParameters ( )
inline

Definition at line 29 of file LocalTrajectoryParameters.h.

29 {}
LocalTrajectoryParameters::LocalTrajectoryParameters ( const AlgebraicVector5 v,
float  aPzSign,
bool  charged = true 
)
inline

Constructor from vector of parameters.

Expects a vector of parameters as defined above, plus the sign of p_z. For charged particles the charge will be determined by the sign of the first element. For neutral particles the last argument should be false, in which case the charge of the first element will be neglected.

Definition at line 38 of file LocalTrajectoryParameters.h.

References theCharge, theDxdz, theDydz, thePzSign, theQbp, theX, and theY.

38  {
39  theQbp = v[0];
40  theDxdz = v[1];
41  theDydz = v[2];
42  theX = v[3];
43  theY = v[4];
44  thePzSign = aPzSign;
45  if ( charged )
46  theCharge = theQbp>0 ? 1 : -1;
47  else
48  theCharge = 0;
49  }
float theQbp
q/p (charged) or 1/p (neutral)
float theDxdz
tangent of direction in local x vs. z
float theDydz
tangent of direction in local y vs. z
LocalTrajectoryParameters::LocalTrajectoryParameters ( float  aQbp,
float  aDxdz,
float  aDydz,
float  aX,
float  aY,
float  aPzSign,
bool  charged = true 
)
inline

Constructor from individual parameters.

Expects parameters as defined above, plus the sign of p_z. For charged particles the charge will be determined by the sign of the first argument. For neutral particles the last argument should be false, in which case the charge of the first argument will be neglected.

Definition at line 59 of file LocalTrajectoryParameters.h.

References theCharge, and theQbp.

60  :
61  theDxdz(aDxdz), theDydz(aDydz),
62  theX(aX), theY(aY), thePzSign(aPzSign>0 ? 1 : -1) {
63  if ( charged ) {
64  theQbp = aQbp;
65  theCharge = theQbp>0 ? 1 : -1;
66  }
67  else {
68  theQbp = aQbp;
69  theCharge = 0;
70  }
71  }
float theQbp
q/p (charged) or 1/p (neutral)
float theDxdz
tangent of direction in local x vs. z
float theDydz
tangent of direction in local y vs. z
LocalTrajectoryParameters::LocalTrajectoryParameters ( const LocalPoint pos,
const LocalVector p,
TrackCharge  charge 
)
inline

Constructor from local position, momentum and charge.

Definition at line 74 of file LocalTrajectoryParameters.h.

References PV3DBase< T, PVType, FrameType >::mag(), and theQbp.

75  :
76  theQbp( charge/p.mag()), theDxdz( p.x()/p.z()), theDydz( p.y()/p.z()),
77  theX( pos.x()), theY(pos.y()), thePzSign( p.z()>0. ? 1:-1), theCharge(charge) {
78  if ( charge==0 ) theQbp = 1.f/p.mag();
79  }
T y() const
Definition: PV3DBase.h:63
float theQbp
q/p (charged) or 1/p (neutral)
T mag() const
Definition: PV3DBase.h:67
T z() const
Definition: PV3DBase.h:64
float theDxdz
tangent of direction in local x vs. z
float theDydz
tangent of direction in local y vs. z
TrackCharge charge() const
Charge (-1, 0 or 1)
T x() const
Definition: PV3DBase.h:62

Member Function Documentation

float LocalTrajectoryParameters::absdz ( ) const
inline

Definition at line 163 of file LocalTrajectoryParameters.h.

References f, mathSSE::sqrt(), theDxdz, and theDydz.

Referenced by siStripClusterTools::chargePerCM().

163 { return 1.f/std::sqrt(1.f + theDxdz*theDxdz + theDydz*theDydz); }
T sqrt(T t)
Definition: SSEVec.h:48
double f[11][100]
float theDxdz
tangent of direction in local x vs. z
float theDydz
tangent of direction in local y vs. z
TrackCharge LocalTrajectoryParameters::charge ( ) const
inline
LocalVector LocalTrajectoryParameters::direction ( ) const
inline

Momentum vector unit in the local frame.

Definition at line 99 of file LocalTrajectoryParameters.h.

References f, mathSSE::sqrt(), theDxdz, theDydz, and thePzSign.

Referenced by JacobianCurvilinearToLocal::JacobianCurvilinearToLocal(), and JacobianLocalToCurvilinear::JacobianLocalToCurvilinear().

99  {
100  float dz = float(thePzSign)/std::sqrt(1.f + theDxdz*theDxdz + theDydz*theDydz);
101  float dx = dz*theDxdz;
102  float dy = dz*theDydz;
103  return LocalVector(dx, dy, dz);
104  }
Local3DVector LocalVector
Definition: LocalVector.h:12
T sqrt(T t)
Definition: SSEVec.h:48
double f[11][100]
float theDxdz
tangent of direction in local x vs. z
float theDydz
tangent of direction in local y vs. z
float LocalTrajectoryParameters::dxdz ( ) const
inline

Definition at line 161 of file LocalTrajectoryParameters.h.

References theDxdz.

Referenced by TrackCandidateProducer::isDuplicateCandidate(), and JacobianLocalToCartesian::JacobianLocalToCartesian().

161 { return theDxdz;}
float theDxdz
tangent of direction in local x vs. z
float LocalTrajectoryParameters::dydz ( ) const
inline

Definition at line 162 of file LocalTrajectoryParameters.h.

References theDydz.

Referenced by JacobianLocalToCartesian::JacobianLocalToCartesian().

162 { return theDydz;}
float theDydz
tangent of direction in local y vs. z
AlgebraicVector5 LocalTrajectoryParameters::mixedFormatVector ( ) const
inline

Vector of parameters in internal representation.

Vector of parameters as defined above, with the first element = q/p for charged and = 1/p for neutral.

Definition at line 135 of file LocalTrajectoryParameters.h.

References theDxdz, theDydz, theQbp, theX, theY, and findQualityFiles::v.

Referenced by BzeroReferenceTrajectory::BzeroReferenceTrajectory(), PixelCPEBase::computeAnglesFromTrajectory(), SiStripBackplaneCalibration::derivatives(), TwoBowedSurfacesAlignmentParameters::derivatives(), DualBzeroReferenceTrajectory::extractParameters(), DualReferenceTrajectory::extractParameters(), MuonKinkFinder::getChi2(), MatcherUsingTracksAlgorithm::getChi2(), SegmentAlignmentDerivatives4D::operator()(), KarimakiAlignmentDerivatives::operator()(), BowedSurfaceAlignmentDerivatives::operator()(), operator<<(), and ReferenceTrajectory::ReferenceTrajectory().

135  {
137  v[0] = theQbp; // signed in case of charged particles, 1/p for neutrals
138  v[1] = theDxdz;
139  v[2] = theDydz;
140  v[3] = theX;
141  v[4] = theY;
142  return v;
143  }
float theQbp
q/p (charged) or 1/p (neutral)
float theDxdz
tangent of direction in local x vs. z
ROOT::Math::SVector< double, 5 > AlgebraicVector5
float theDydz
tangent of direction in local y vs. z
LocalVector LocalTrajectoryParameters::momentum ( ) const
inline

Momentum vector in the local frame.

Definition at line 89 of file LocalTrajectoryParameters.h.

References funct::abs(), alignCSCRings::e, f, mathSSE::sqrt(), theDxdz, theDydz, thePzSign, and theQbp.

Referenced by SiPixelTrackResidualSource::analyze(), SiPixelErrorEstimation::analyze(), MuonSeedSimpleCleaner::checkPt(), PixelCPEBase::computeAnglesFromTrajectory(), TwoBodyDecayTrajectory::constructSingleTsosWithErrors(), display_seed(), SiPixelHitEfficiencyModule::fill(), JacobianCartesianToLocal::JacobianCartesianToLocal(), BasicTrajectoryState::localMomentum(), StripCPEgeometric::localParameters(), StripCPEfromTemplate::localParameters(), StripCPEfromTrackAngle::localParameters(), reco::TrackInfo::localTrackMomentum(), PrintRecoObjects::print(), TrackCandidateProducer::produce(), KalmanAlignmentTrackRefitter::refitSingleTracklet(), TrackInfoProducerAlgorithm::run(), TrackClusterSplitter::splitCluster(), and InOutConversionTrackFinder::tracks().

89  {
90  float op = std::abs(theQbp);
91  if ( op<1.e-9f ) op = 1.e-9f;
92  float pz = float(thePzSign)/(op*std::sqrt(1.f + theDxdz*theDxdz + theDydz*theDydz));
93  float px = pz*theDxdz;
94  float py = pz*theDydz;
95  return LocalVector(px, py, pz);
96  }
Local3DVector LocalVector
Definition: LocalVector.h:12
float theQbp
q/p (charged) or 1/p (neutral)
T sqrt(T t)
Definition: SSEVec.h:48
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
float theDxdz
tangent of direction in local x vs. z
float theDydz
tangent of direction in local y vs. z
LocalPoint LocalTrajectoryParameters::position ( ) const
inline
float LocalTrajectoryParameters::pzSign ( ) const
inline
float LocalTrajectoryParameters::qbp ( ) const
inline
float LocalTrajectoryParameters::signedInverseMomentum ( ) const
inline

Signed inverse momentum q/p (zero for neutrals).

Definition at line 111 of file LocalTrajectoryParameters.h.

References charge(), and theQbp.

Referenced by ReferenceTrajectory::construct(), TwoBodyDecayTrajectory::constructSingleTsosWithErrors(), JacobianCurvilinearToLocal::JacobianCurvilinearToLocal(), JacobianLocalToCurvilinear::JacobianLocalToCurvilinear(), NuclearInteractionFinder::rescaleError(), and vector().

111  {
112  return charge()==0 ? 0.f : theQbp;
113  }
float theQbp
q/p (charged) or 1/p (neutral)
TrackCharge charge() const
Charge (-1, 0 or 1)
bool LocalTrajectoryParameters::updateP ( float  dP)
inline

Update of momentum by a scalar dP.

Definition at line 151 of file LocalTrajectoryParameters.h.

References funct::abs(), f, AlCaHLTBitMon_ParallelJobs::p, and theQbp.

Referenced by GsfMaterialEffectsUpdator::updateState(), VolumeMaterialEffectsUpdator::updateState(), and MaterialEffectsUpdator::updateStateInPlace().

151  {
152  float p = 1.f/std::abs(theQbp);
153  if ((p += dP) <= 0.f) return false;
154  float newQbp = theQbp > 0. ? 1.f/p : -1.f/p;
155  theQbp = newQbp;
156  return true;
157  }
float theQbp
q/p (charged) or 1/p (neutral)
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
AlgebraicVector5 LocalTrajectoryParameters::vector ( ) const
inline

Vector of parameters with signed inverse momentum.

Vector of parameters as defined above, with the first element = q/p .

Definition at line 120 of file LocalTrajectoryParameters.h.

References signedInverseMomentum(), theDxdz, theDydz, theX, theY, and findQualityFiles::v.

Referenced by GlobalTrackerMuonAlignment::analyzeTrackTrack(), GlobalTrackerMuonAlignment::analyzeTrackTrajectory(), CollinearFitAtTM2::CollinearFitAtTM2(), TrajectoryStateCombiner::combine(), GsfTrackProducerBase::computeModeAtTM(), PFGsfHelper::computeQpMode(), GlobalTrackerMuonAlignment::debugTrajectorySOS(), GlobalTrackerMuonAlignment::debugTrajectorySOSv(), CollinearFitAtTM::fit(), StripCPEgeometric::localParameters(), StripCPEfromTemplate::localParameters(), StripCPEfromTrackAngle::localParameters(), GsfTrackProducerBase::localParametersFromQpMode(), GlobalMuonTrackMatcher::match_Chi2(), MeasurementExtractor::measuredParameters(), GlobalTrackerMuonAlignment::misalignMuonL(), TRecHit5DParamConstraint::parameters(), TrackCandidateProducer::produce(), TrackAssociatorByPosition::quality(), ChargeSignificanceTrajectoryFilter::TBC(), CkfDebugger::testSeed(), Strip1DMeasurementTransformator::trajectoryParameters(), Tsos2DPhi::Tsos2DPhi(), Tsos2DZed::Tsos2DZed(), and Tsos4D::Tsos4D().

120  {
122  v[0] = signedInverseMomentum();
123  v[1] = theDxdz;
124  v[2] = theDydz;
125  v[3] = theX;
126  v[4] = theY;
127  return v;
128  }
float signedInverseMomentum() const
Signed inverse momentum q/p (zero for neutrals).
float theDxdz
tangent of direction in local x vs. z
ROOT::Math::SVector< double, 5 > AlgebraicVector5
float theDydz
tangent of direction in local y vs. z

Member Data Documentation

short LocalTrajectoryParameters::theCharge
private

charge

Definition at line 175 of file LocalTrajectoryParameters.h.

Referenced by charge(), and LocalTrajectoryParameters().

float LocalTrajectoryParameters::theDxdz
private

tangent of direction in local x vs. z

Definition at line 168 of file LocalTrajectoryParameters.h.

Referenced by absdz(), direction(), dxdz(), LocalTrajectoryParameters(), mixedFormatVector(), momentum(), and vector().

float LocalTrajectoryParameters::theDydz
private

tangent of direction in local y vs. z

Definition at line 169 of file LocalTrajectoryParameters.h.

Referenced by absdz(), direction(), dydz(), LocalTrajectoryParameters(), mixedFormatVector(), momentum(), and vector().

short LocalTrajectoryParameters::thePzSign
private

sign of local pz

Definition at line 173 of file LocalTrajectoryParameters.h.

Referenced by direction(), LocalTrajectoryParameters(), momentum(), and pzSign().

float LocalTrajectoryParameters::theQbp
private

q/p (charged) or 1/p (neutral)

Definition at line 167 of file LocalTrajectoryParameters.h.

Referenced by LocalTrajectoryParameters(), mixedFormatVector(), momentum(), qbp(), signedInverseMomentum(), and updateP().

float LocalTrajectoryParameters::theX
private

local x position

Definition at line 170 of file LocalTrajectoryParameters.h.

Referenced by LocalTrajectoryParameters(), mixedFormatVector(), position(), and vector().

float LocalTrajectoryParameters::theY
private

local y position

Definition at line 171 of file LocalTrajectoryParameters.h.

Referenced by LocalTrajectoryParameters(), mixedFormatVector(), position(), and vector().