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 Types | Private Member Functions
TrackKinematicStatePropagator Class Reference

#include <TrackKinematicStatePropagator.h>

Inheritance diagram for TrackKinematicStatePropagator:
KinematicStatePropagator

Public Member Functions

virtual KinematicStatePropagatorclone () const
 
virtual std::pair
< HelixBarrelPlaneCrossingByCircle,
BoundPlane::BoundPlanePointer
planeCrossing (const FreeTrajectoryState &par, const GlobalPoint &point) const
 
virtual KinematicState propagateToTheTransversePCA (const KinematicState &state, const GlobalPoint &referencePoint) const
 
 TrackKinematicStatePropagator ()
 
virtual ~TrackKinematicStatePropagator ()
 
- Public Member Functions inherited from KinematicStatePropagator
 KinematicStatePropagator ()
 
virtual ~KinematicStatePropagator ()
 

Private Types

typedef Point3DBase< double,
GlobalTag
GlobalPointDouble
 
typedef Vector3DBase< double,
GlobalTag
GlobalVectorDouble
 

Private Member Functions

virtual KinematicState propagateToTheTransversePCACharged (const KinematicState &state, const GlobalPoint &referencePoint) const
 
virtual KinematicState propagateToTheTransversePCANeutral (const KinematicState &state, const GlobalPoint &referencePoint) const
 

Detailed Description

Propagator for TransientTrack based KinematicStates. Does not include the material.

Definition at line 18 of file TrackKinematicStatePropagator.h.

Member Typedef Documentation

Definition at line 53 of file TrackKinematicStatePropagator.h.

Definition at line 54 of file TrackKinematicStatePropagator.h.

Constructor & Destructor Documentation

TrackKinematicStatePropagator::TrackKinematicStatePropagator ( )
inline

Definition at line 22 of file TrackKinematicStatePropagator.h.

Referenced by clone().

22 {}
virtual TrackKinematicStatePropagator::~TrackKinematicStatePropagator ( )
inlinevirtual

Definition at line 24 of file TrackKinematicStatePropagator.h.

24 {}

Member Function Documentation

virtual KinematicStatePropagator* TrackKinematicStatePropagator::clone ( void  ) const
inlinevirtual

Clone method reimplemented from abstract class

Implements KinematicStatePropagator.

Definition at line 40 of file TrackKinematicStatePropagator.h.

References TrackKinematicStatePropagator().

pair< HelixBarrelPlaneCrossingByCircle, BoundPlane::BoundPlanePointer > TrackKinematicStatePropagator::planeCrossing ( const FreeTrajectoryState par,
const GlobalPoint point 
) const
virtual

Definition at line 23 of file TrackKinematicStatePropagator.cc.

References anyDirection, BoundPlane::build(), FreeTrajectoryState::charge(), MagneticField::inInverseGeV(), GlobalTrajectoryParameters::magneticField(), FreeTrajectoryState::momentum(), FreeTrajectoryState::parameters(), pos, FreeTrajectoryState::position(), makeMuonMisalignmentScenario::rot, FreeTrajectoryState::transverseCurvature(), Vector3DBase< T, FrameTag >::unit(), X, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

25 {
26  GlobalPoint inPos = state.position();
27  GlobalVector inMom = state.momentum();
28  double kappa = state.transverseCurvature();
29  double fac = 1./state.charge()/state.parameters().magneticField().inInverseGeV(point).z();
30 
31  GlobalVectorDouble xOrig2Centre = GlobalVectorDouble(fac * inMom.y(), -fac * inMom.x(), 0.);
32  GlobalVectorDouble xOrigProj = GlobalVectorDouble(inPos.x(), inPos.y(), 0.);
33  GlobalVectorDouble xRefProj = GlobalVectorDouble(point.x(), point.y(), 0.);
34  GlobalVectorDouble deltax = xRefProj-xOrigProj-xOrig2Centre;
35  GlobalVectorDouble ndeltax = deltax.unit();
36 
39 
40 // Need to define plane with orientation as the ImpactPointSurface
41  GlobalVector X(ndeltax.x(), ndeltax.y(), ndeltax.z());
42  GlobalVector Y(0.,0.,1.);
46  planeCrossing(HelixPlaneCrossing::PositionType(inPos.x(), inPos.y(), inPos.z()),
47  HelixPlaneCrossing::DirectionType(inMom.x(), inMom.y(), inMom.z()),
48  kappa, direction);
49  return std::pair<HelixBarrelPlaneCrossingByCircle,BoundPlane::BoundPlanePointer>(planeCrossing,plane);
50 }
Vector3DBase< double, GlobalTag > GlobalVectorDouble
T y() const
Definition: PV3DBase.h:62
#define X(str)
Definition: MuonsGrabber.cc:49
PropagationDirection
static BoundPlanePointer build(const PositionType &pos, const RotationType &rot, const Bounds *bounds, MediumProperties *mp=0)
Definition: BoundPlane.h:26
T z() const
Definition: PV3DBase.h:63
char state
Definition: procUtils.cc:75
Unlimited (trivial) bounds.
Definition: OpenBounds.h:10
virtual std::pair< HelixBarrelPlaneCrossingByCircle, BoundPlane::BoundPlanePointer > planeCrossing(const FreeTrajectoryState &par, const GlobalPoint &point) const
T x() const
Definition: PV3DBase.h:61
KinematicState TrackKinematicStatePropagator::propagateToTheTransversePCA ( const KinematicState state,
const GlobalPoint referencePoint 
) const
virtual

Propagation to the point of closest approach in transverse plane to the given point

Implements KinematicStatePropagator.

Definition at line 13 of file TrackKinematicStatePropagator.cc.

References KinematicState::particleCharge().

14 {
15  if( state.particleCharge() == 0. ) {
16  return propagateToTheTransversePCANeutral(state, referencePoint);
17  } else {
18  return propagateToTheTransversePCACharged(state, referencePoint);
19  }
20 }
virtual KinematicState propagateToTheTransversePCANeutral(const KinematicState &state, const GlobalPoint &referencePoint) const
TrackCharge particleCharge() const
virtual KinematicState propagateToTheTransversePCACharged(const KinematicState &state, const GlobalPoint &referencePoint) const
KinematicState TrackKinematicStatePropagator::propagateToTheTransversePCACharged ( const KinematicState state,
const GlobalPoint referencePoint 
) const
privatevirtual

Internal private methods, distinguishing between the propagation of neutrals and propagation of cahrged tracks.

Definition at line 55 of file TrackKinematicStatePropagator.cc.

References HelixBarrelPlaneCrossingByCircle::direction(), KinematicState::freeTrajectoryState(), KinematicState::globalMomentum(), KinematicState::globalPosition(), JacobianCurvilinearToCartesian::jacobian(), KinematicState::kinematicParametersError(), LogDebug, PV3DBase< T, PVType, FrameType >::mag(), KinematicState::magneticField(), scaleCards::mass, KinematicState::mass(), KinematicParametersError::matrix(), KinematicState::particleCharge(), HelixBarrelPlaneCrossingByCircle::pathLength(), HelixBarrelPlaneCrossingByCircle::position(), alignCSCRings::s, PV3DBase< T, PVType, FrameType >::x(), Basic3DVector< T >::x(), Basic3DVector< T >::y(), and Basic3DVector< T >::z().

56 {
57 //first use the existing FTS propagator to obtain parameters at PCA
58 //in transverse plane to the given point
59 
60 //final parameters and covariance
61  AlgebraicVector7 par;
63 
64 //initial parameters as class and vectors:
66  state.particleCharge(), state.magneticField());
67  ParticleMass mass = state.mass();
68  GlobalVector inMom = state.globalMomentum();
69 
70 //making a free trajectory state and looking
71 //for helix barrel plane crossing
72  FreeTrajectoryState fState = state.freeTrajectoryState();
73  GlobalPoint iP = referencePoint;
74  std::pair<HelixBarrelPlaneCrossingByCircle, BoundPlane::BoundPlanePointer> cros = planeCrossing(fState,iP);
75 
77  BoundPlane::BoundPlanePointer plane = cros.second;
78  std::pair<bool,double> propResult = planeCrossing.pathLength(*plane);
79  if ( !propResult.first ) {
80  LogDebug("RecoVertex/TrackKinematicStatePropagator")
81  << "Propagation failed! State is invalid\n";
82  return KinematicState();
83  }
84  double s = propResult.second;
85 
86  HelixPlaneCrossing::PositionType xGen = planeCrossing.position(s);
87  GlobalPoint nPosition(xGen.x(),xGen.y(),xGen.z());
88  HelixPlaneCrossing::DirectionType pGen = planeCrossing.direction(s);
89  pGen *= inMom.mag()/pGen.mag();
90  GlobalVector nMomentum(pGen.x(),pGen.y(),pGen.z());
91  par(0) = nPosition.x();
92  par(1) = nPosition.y();
93  par(2) = nPosition.z();
94  par(3) = nMomentum.x();
95  par(4) = nMomentum.y();
96  par(5) = nMomentum.z();
97  par(6) = mass;
98 
99 //covariance matrix business
100 //elements of 7x7 covariance matrix responcible for the mass and
101 //mass - momentum projections corellations do change under such a transformation:
102 //special Jacobian needed
103  GlobalTrajectoryParameters fPar(nPosition, nMomentum, state.particleCharge(),
104  state.magneticField());
105 
106  JacobianCartesianToCurvilinear cart2curv(inPar);
107  JacobianCurvilinearToCartesian curv2cart(fPar);
108 
109  AlgebraicMatrix67 ca2cu;
110  AlgebraicMatrix76 cu2ca;
111  ca2cu.Place_at(cart2curv.jacobian(),0,0);
112  cu2ca.Place_at(curv2cart.jacobian(),0,0);
113  ca2cu(5,6) = 1;
114  cu2ca(6,5) = 1;
115 
116 //now both transformation jacobians: cartesian to curvilinear and back are done
117 //We transform matrix to curv frame, then propagate it and translate it back to
118 //cartesian frame.
119  AlgebraicSymMatrix66 cov1 = ROOT::Math::Similarity(ca2cu, state.kinematicParametersError().matrix());
120 
121 //propagation jacobian
122  AnalyticalCurvilinearJacobian prop(inPar,nPosition,nMomentum,s);
124  pr(5,5) = 1;
125  pr.Place_at(prop.jacobian(),0,0);
126 
127 //transportation
128  AlgebraicSymMatrix66 cov2 = ROOT::Math::Similarity(pr, cov1);
129 
130 //now geting back to 7-parametrization from curvilinear
131  cov = ROOT::Math::Similarity(cu2ca, cov2);
132 
133 //return parameters as a kiematic state
134  KinematicParameters resPar(par);
135  KinematicParametersError resEr(cov);
136  return KinematicState(resPar,resEr,state.particleCharge(), state.magneticField());
137  }
#define LogDebug(id)
virtual PositionType position(double s) const
T y() const
Cartesian y coordinate.
T x() const
Cartesian x coordinate.
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepStd< double, 6, 6 > > AlgebraicMatrix66
ROOT::Math::SMatrix< double, 7, 6, ROOT::Math::MatRepStd< double, 7, 6 > > AlgebraicMatrix76
Definition: Matrices.h:11
double ParticleMass
Definition: ParticleMass.h:5
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > AlgebraicSymMatrix66
GlobalVector globalMomentum() const
ParticleMass mass() const
ROOT::Math::SMatrix< double, 7, 7, ROOT::Math::MatRepSym< double, 7 > > AlgebraicSymMatrix77
Definition: Matrices.h:8
T mag() const
Definition: PV3DBase.h:66
ROOT::Math::SVector< double, 7 > AlgebraicVector7
Definition: Matrices.h:7
T z() const
Cartesian z coordinate.
KinematicParametersError const & kinematicParametersError() const
virtual std::pair< bool, double > pathLength(const Plane &)
const MagneticField * magneticField() const
ROOT::Math::SMatrix< double, 6, 7, ROOT::Math::MatRepStd< double, 6, 7 > > AlgebraicMatrix67
Definition: Matrices.h:10
TrackCharge particleCharge() const
virtual std::pair< HelixBarrelPlaneCrossingByCircle, BoundPlane::BoundPlanePointer > planeCrossing(const FreeTrajectoryState &par, const GlobalPoint &point) const
tuple mass
Definition: scaleCards.py:27
FreeTrajectoryState freeTrajectoryState() const
T x() const
Definition: PV3DBase.h:61
GlobalPoint globalPosition() const
virtual DirectionType direction(double s) const
AlgebraicSymMatrix77 matrix() const
KinematicState TrackKinematicStatePropagator::propagateToTheTransversePCANeutral ( const KinematicState state,
const GlobalPoint referencePoint 
) const
privatevirtual

Definition at line 140 of file TrackKinematicStatePropagator.cc.

References funct::cos(), KinematicState::freeTrajectoryState(), KinematicState::globalMomentum(), KinematicState::globalPosition(), JacobianCurvilinearToCartesian::jacobian(), KinematicState::kinematicParametersError(), KinematicState::magneticField(), KinematicState::mass(), KinematicParametersError::matrix(), KinematicState::particleCharge(), phi, alignCSCRings::s, funct::sin(), funct::tan(), theta(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

141 {
142 //new parameters vector and covariance:
143  AlgebraicVector7 par;
145 
146  //AlgebraicVector7 inStatePar = state.kinematicParameters().vector();
148  state.particleCharge(), state.magneticField());
149 
150 //first making a free trajectory state and propagating it according
151 //to the algorithm provided by Thomas Speer and Wolfgang Adam
152  FreeTrajectoryState fState = state.freeTrajectoryState();
153 
154  GlobalPoint xvecOrig = fState.position();
155  double phi = fState.momentum().phi();
156  double theta = fState.momentum().theta();
157  double xOrig = xvecOrig.x();
158  double yOrig = xvecOrig.y();
159  double zOrig = xvecOrig.z();
160  double xR = referencePoint.x();
161  double yR = referencePoint.y();
162 
163  double s2D = (xR - xOrig) * cos(phi) + (yR - yOrig) * sin(phi);
164  double s = s2D / sin(theta);
165  double xGen = xOrig + s2D*cos(phi);
166  double yGen = yOrig + s2D*sin(phi);
167  double zGen = zOrig + s2D/tan(theta);
168  GlobalPoint xPerigee = GlobalPoint(xGen, yGen, zGen);
169 
170 //new parameters
171  GlobalVector pPerigee = fState.momentum();
172  par(0) = xPerigee.x();
173  par(1) = xPerigee.y();
174  par(2) = xPerigee.z();
175  par(3) = pPerigee.x();
176  par(4) = pPerigee.y();
177  par(5) = pPerigee.z();
178  // par(6) = inStatePar(7);
179  par(6) = state.mass();
180 
181 //covariance matrix business:
182 //everything lake it was before: jacobains are smart enouhg to
183 //distinguish between neutral and charged states themselves
184 
185  GlobalTrajectoryParameters fPar(xPerigee, pPerigee, state.particleCharge(),
186  state.magneticField());
187 
188  JacobianCartesianToCurvilinear cart2curv(inPar);
189  JacobianCurvilinearToCartesian curv2cart(fPar);
190 
191  AlgebraicMatrix67 ca2cu;
192  AlgebraicMatrix76 cu2ca;
193  ca2cu.Place_at(cart2curv.jacobian(),0,0);
194  cu2ca.Place_at(curv2cart.jacobian(),0,0);
195  ca2cu(5,6) = 1;
196  cu2ca(6,5) = 1;
197 
198 //now both transformation jacobians: cartesian to curvilinear and back are done
199 //We transform matrix to curv frame, then propagate it and translate it back to
200 //cartesian frame.
201  AlgebraicSymMatrix66 cov1 = ROOT::Math::Similarity(ca2cu, state.kinematicParametersError().matrix());
202 
203 //propagation jacobian
204  AnalyticalCurvilinearJacobian prop(inPar,xPerigee,pPerigee,s);
206  pr(5,5) = 1;
207  pr.Place_at(prop.jacobian(),0,0);
208 
209 //transportation
210  AlgebraicSymMatrix66 cov2 = ROOT::Math::Similarity(pr, cov1);
211 
212 //now geting back to 7-parametrization from curvilinear
213  cov = ROOT::Math::Similarity(cu2ca, cov2);
214 
215 //return parameters as a kiematic state
216  KinematicParameters resPar(par);
217  KinematicParametersError resEr(cov);
218  return KinematicState(resPar,resEr,state.particleCharge(), state.magneticField());
219 }
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepStd< double, 6, 6 > > AlgebraicMatrix66
ROOT::Math::SMatrix< double, 7, 6, ROOT::Math::MatRepStd< double, 7, 6 > > AlgebraicMatrix76
Definition: Matrices.h:11
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > AlgebraicSymMatrix66
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Geom::Theta< T > theta() const
T y() const
Definition: PV3DBase.h:62
GlobalVector globalMomentum() const
ParticleMass mass() const
ROOT::Math::SMatrix< double, 7, 7, ROOT::Math::MatRepSym< double, 7 > > AlgebraicSymMatrix77
Definition: Matrices.h:8
ROOT::Math::SVector< double, 7 > AlgebraicVector7
Definition: Matrices.h:7
T z() const
Definition: PV3DBase.h:63
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
KinematicParametersError const & kinematicParametersError() const
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
const MagneticField * magneticField() const
ROOT::Math::SMatrix< double, 6, 7, ROOT::Math::MatRepStd< double, 6, 7 > > AlgebraicMatrix67
Definition: Matrices.h:10
TrackCharge particleCharge() const
FreeTrajectoryState freeTrajectoryState() const
T x() const
Definition: PV3DBase.h:61
GlobalPoint globalPosition() const
AlgebraicSymMatrix77 matrix() const
Definition: DDAxes.h:10