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 Referencefinal

#include <TrackKinematicStatePropagator.h>

Inheritance diagram for TrackKinematicStatePropagator:
KinematicStatePropagator

Public Member Functions

virtual KinematicStatePropagatorclone () const
 
virtual KinematicState propagateToTheTransversePCA (const KinematicState &state, const GlobalPoint &referencePoint) const
 
 TrackKinematicStatePropagator ()
 
virtual bool willPropagateToTheTransversePCA (const KinematicState &state, const GlobalPoint &point) const
 
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().

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 74 of file TrackKinematicStatePropagator.cc.

References FreeTrajectoryState::curvilinearError(), HelixBarrelPlaneCrossingByCircle::direction(), KinematicState::freeTrajectoryState(), KinematicState::globalMomentum(), i, JacobianCurvilinearToCartesian::jacobian(), JacobianCartesianToCurvilinear::jacobian(), AnalyticalCurvilinearJacobian::jacobian(), KinematicState::kinematicParametersError(), LogDebug, PV3DBase< T, PVType, FrameType >::mag(), KinematicState::magneticField(), KinematicState::mass(), KinematicParametersError::matrix(), CurvilinearTrajectoryError::matrix(), KinematicState::particleCharge(), HelixBarrelPlaneCrossingByCircle::pathLength(), HelixBarrelPlaneCrossingByCircle::position(), alignCSCRings::s, mathSSE::sqrt(), KinematicState::trajectoryParameters(), PV3DBase< T, PVType, FrameType >::x(), Basic3DVector< T >::x(), Basic3DVector< T >::y(), and Basic3DVector< T >::z().

74  {
75  //first use the existing FTS propagator to obtain parameters at PCA
76  //in transverse plane to the given point
77 
78  //final parameters and covariance
79 
80  //initial parameters as class and vectors:
81  //making a free trajectory state and looking
82  //for helix barrel plane crossing
83  FreeTrajectoryState const & fState = state.freeTrajectoryState();
84  GlobalPoint iP = referencePoint;
85  std::pair<HelixBarrelPlaneCrossingByCircle, BoundPlane::BoundPlanePointer> cros = planeCrossing(fState,iP);
86 
87  HelixBarrelPlaneCrossingByCircle planeCrossing = cros.first;
88  BoundPlane::BoundPlanePointer plane = cros.second;
89  std::pair<bool,double> propResult = planeCrossing.pathLength(*plane);
90  if ( !propResult.first ) {
91  LogDebug("RecoVertex/TrackKinematicStatePropagator")
92  << "Propagation failed! State is invalid\n";
93  return KinematicState();
94  }
95  double s = propResult.second;
96 
97 
98  GlobalTrajectoryParameters const & inPar = state.trajectoryParameters();
99  ParticleMass mass = state.mass();
100  GlobalVector inMom = state.globalMomentum();
101 
102  HelixPlaneCrossing::PositionType xGen = planeCrossing.position(s);
103  GlobalPoint nPosition(xGen.x(),xGen.y(),xGen.z());
104  HelixPlaneCrossing::DirectionType pGen = planeCrossing.direction(s);
105  pGen *= inMom.mag()/pGen.mag();
106  GlobalVector nMomentum(pGen.x(),pGen.y(),pGen.z());
107  AlgebraicVector7 par;
109  par(0) = nPosition.x();
110  par(1) = nPosition.y();
111  par(2) = nPosition.z();
112  par(3) = nMomentum.x();
113  par(4) = nMomentum.y();
114  par(5) = nMomentum.z();
115  par(6) = mass;
116 
117  //covariance matrix business
118  //elements of 7x7 covariance matrix responcible for the mass and
119  //mass - momentum projections corellations do change under such a transformation:
120  //special Jacobian needed
121  GlobalTrajectoryParameters fPar(nPosition, nMomentum, state.particleCharge(),
122  state.magneticField());
123 
124  // check if correlation are present between mass and others
125  bool thereIsNoCorr=true;
126 
127  for (auto i=0; i<6; ++i) thereIsNoCorr &= (0==state.kinematicParametersError().matrix()(i,6));
128 
129  if (thereIsNoCorr) {
130  // easy life
131  AnalyticalCurvilinearJacobian prop(inPar,nPosition,nMomentum,s);
132  AlgebraicSymMatrix55 cov2 = ROOT::Math::Similarity(prop.jacobian(), fState.curvilinearError().matrix());
134 
135  return KinematicState(fts, state.mass(), std::sqrt(state.kinematicParametersError().matrix()(6,6)));
136 
137  //KinematicState kRes(fts, state.mass(), std::sqrt(state.kinematicParametersError().matrix()(6,6)));
138  //std::cout << "\n\ncart from final Kstate\n" << kRes.kinematicParametersError().matrix() << std::endl;
139  // std::cout << "curv from final K\n" << kRes.freeTrajectoryState().curvilinearError().matrix() << std::endl;
140 
141  } else {
142 
143 
144  JacobianCartesianToCurvilinear cart2curv(inPar);
145  JacobianCurvilinearToCartesian curv2cart(fPar);
146 
147 
148  AlgebraicMatrix67 ca2cu;
149  AlgebraicMatrix76 cu2ca;
150  ca2cu.Place_at(cart2curv.jacobian(),0,0);
151  cu2ca.Place_at(curv2cart.jacobian(),0,0);
152  ca2cu(5,6) = 1;
153  cu2ca(6,5) = 1;
154 
155  //now both transformation jacobians: cartesian to curvilinear and back are done
156  //We transform matrix to curv frame, then propagate it and translate it back to
157  //cartesian frame.
158  AlgebraicSymMatrix66 cov1 = ROOT::Math::Similarity(ca2cu, state.kinematicParametersError().matrix());
159 
160  /*
161  std::cout << "\n\ncurv from Kstate\n" << cov1 << std::endl;
162  std::cout << "curv from fts\n" << fState.curvilinearError().matrix() << std::endl;
163  */
164 
165 
166  //propagation jacobian
167  AnalyticalCurvilinearJacobian prop(inPar,nPosition,nMomentum,s);
169  pr(5,5) = 1;
170  pr.Place_at(prop.jacobian(),0,0);
171 
172  //transportation
173  AlgebraicSymMatrix66 cov2 = ROOT::Math::Similarity(pr, cov1);
174 
175  //now geting back to 7-parametrization from curvilinear
176  cov = ROOT::Math::Similarity(cu2ca, cov2);
177 
178  /*
179  std::cout << "curv prop \n" << cov2 << std::endl;
180  std::cout << "cart prop\n" << cov << std::endl;
181  */
182 
183  //return parameters as a kiematic state
184  KinematicParameters resPar(par);
185  KinematicParametersError resEr(cov);
186 
187  return KinematicState(resPar,resEr,state.particleCharge(), state.magneticField());
188 
189  /*
190  KinematicState resK(resPar,resEr,state.particleCharge(), state.magneticField());
191  std::cout << "\ncurv from K prop\n" << resK.freeTrajectoryState().curvilinearError().matrix() << std::endl;
192  return resK;
193  */
194  }
195 
196  }
#define LogDebug(id)
virtual PositionType position(double s) const
int i
Definition: DBlmapReader.cc:9
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:12
double ParticleMass
Definition: ParticleMass.h:5
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > AlgebraicSymMatrix66
GlobalVector globalMomentum() const
AlgebraicSymMatrix77 const & matrix() const
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
const CurvilinearTrajectoryError & curvilinearError() const
ParticleMass mass() const
ROOT::Math::SMatrix< double, 7, 7, ROOT::Math::MatRepSym< double, 7 > > AlgebraicSymMatrix77
Definition: Matrices.h:9
T mag() const
Definition: PV3DBase.h:67
ROOT::Math::SVector< double, 7 > AlgebraicVector7
Definition: Matrices.h:8
T z() const
Cartesian z coordinate.
T sqrt(T t)
Definition: SSEVec.h:18
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:11
TrackCharge particleCharge() const
const AlgebraicSymMatrix55 & matrix() const
FreeTrajectoryState freeTrajectoryState() const
T x() const
Definition: PV3DBase.h:62
GlobalTrajectoryParameters const & trajectoryParameters() const
virtual DirectionType direction(double s) const
KinematicState TrackKinematicStatePropagator::propagateToTheTransversePCANeutral ( const KinematicState state,
const GlobalPoint referencePoint 
) const
privatevirtual

Definition at line 199 of file TrackKinematicStatePropagator.cc.

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

200 {
201 //new parameters vector and covariance:
202  AlgebraicVector7 par;
204 
205  //AlgebraicVector7 inStatePar = state.kinematicParameters().vector();
206  GlobalTrajectoryParameters const & inPar = state.trajectoryParameters();
207 
208  //first making a free trajectory state and propagating it according
209  //to the algorithm provided by Thomas Speer and Wolfgang Adam
210  FreeTrajectoryState const & fState = state.freeTrajectoryState();
211 
212  GlobalPoint xvecOrig = fState.position();
213  double phi = fState.momentum().phi();
214  double theta = fState.momentum().theta();
215  double xOrig = xvecOrig.x();
216  double yOrig = xvecOrig.y();
217  double zOrig = xvecOrig.z();
218  double xR = referencePoint.x();
219  double yR = referencePoint.y();
220 
221  double s2D = (xR - xOrig) * cos(phi) + (yR - yOrig) * sin(phi);
222  double s = s2D / sin(theta);
223  double xGen = xOrig + s2D*cos(phi);
224  double yGen = yOrig + s2D*sin(phi);
225  double zGen = zOrig + s2D/tan(theta);
226  GlobalPoint xPerigee = GlobalPoint(xGen, yGen, zGen);
227 
228 //new parameters
229  GlobalVector pPerigee = fState.momentum();
230  par(0) = xPerigee.x();
231  par(1) = xPerigee.y();
232  par(2) = xPerigee.z();
233  par(3) = pPerigee.x();
234  par(4) = pPerigee.y();
235  par(5) = pPerigee.z();
236  // par(6) = inStatePar(7);
237  par(6) = state.mass();
238 
239 //covariance matrix business:
240 //everything lake it was before: jacobains are smart enouhg to
241 //distinguish between neutral and charged states themselves
242 
243  GlobalTrajectoryParameters fPar(xPerigee, pPerigee, state.particleCharge(),
244  state.magneticField());
245 
246  JacobianCartesianToCurvilinear cart2curv(inPar);
247  JacobianCurvilinearToCartesian curv2cart(fPar);
248 
249  AlgebraicMatrix67 ca2cu;
250  AlgebraicMatrix76 cu2ca;
251  ca2cu.Place_at(cart2curv.jacobian(),0,0);
252  cu2ca.Place_at(curv2cart.jacobian(),0,0);
253  ca2cu(5,6) = 1;
254  cu2ca(6,5) = 1;
255 
256  //now both transformation jacobians: cartesian to curvilinear and back are done
257  //We transform matrix to curv frame, then propagate it and translate it back to
258  //cartesian frame.
259  AlgebraicSymMatrix66 cov1 = ROOT::Math::Similarity(ca2cu, state.kinematicParametersError().matrix());
260 
261  //propagation jacobian
262  AnalyticalCurvilinearJacobian prop(inPar,xPerigee,pPerigee,s);
264  pr(5,5) = 1;
265  pr.Place_at(prop.jacobian(),0,0);
266 
267  //transportation
268  AlgebraicSymMatrix66 cov2 = ROOT::Math::Similarity(pr, cov1);
269 
270  //now geting back to 7-parametrization from curvilinear
271  cov = ROOT::Math::Similarity(cu2ca, cov2);
272 
273  // FreeTrajectoryState fts(fPar);
274 
275  //return parameters as a kiematic state
276  KinematicParameters resPar(par);
277  KinematicParametersError resEr(cov);
278  return KinematicState(resPar,resEr,state.particleCharge(), state.magneticField());
279 
280  //return KinematicState(fts,state.mass(), cov(6,6));
281 
282 }
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:12
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepSym< double, 6 > > AlgebraicSymMatrix66
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Geom::Theta< T > theta() const
T y() const
Definition: PV3DBase.h:63
AlgebraicSymMatrix77 const & matrix() const
ParticleMass mass() const
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
ROOT::Math::SMatrix< double, 7, 7, ROOT::Math::MatRepSym< double, 7 > > AlgebraicSymMatrix77
Definition: Matrices.h:9
ROOT::Math::SVector< double, 7 > AlgebraicVector7
Definition: Matrices.h:8
T z() const
Definition: PV3DBase.h:64
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
GlobalVector momentum() const
GlobalPoint position() const
const MagneticField * magneticField() const
ROOT::Math::SMatrix< double, 6, 7, ROOT::Math::MatRepStd< double, 6, 7 > > AlgebraicMatrix67
Definition: Matrices.h:11
TrackCharge particleCharge() const
FreeTrajectoryState freeTrajectoryState() const
T x() const
Definition: PV3DBase.h:62
GlobalTrajectoryParameters const & trajectoryParameters() const
bool TrackKinematicStatePropagator::willPropagateToTheTransversePCA ( const KinematicState state,
const GlobalPoint point 
) const
virtual

Reimplemented from KinematicStatePropagator.

Definition at line 58 of file TrackKinematicStatePropagator.cc.

References KinematicState::freeTrajectoryState(), KinematicState::particleCharge(), and HelixBarrelPlaneCrossingByCircle::pathLength().

Referenced by KinematicParticleVertexFitter::fit().

58  {
59  if( state.particleCharge() == 0. ) return true;
60 
61  // copied from below...
62  FreeTrajectoryState const & fState = state.freeTrajectoryState();
63  std::pair<HelixBarrelPlaneCrossingByCircle, BoundPlane::BoundPlanePointer> cros = planeCrossing(fState,point);
64 
65  HelixBarrelPlaneCrossingByCircle planeCrossing = cros.first;
66  BoundPlane::BoundPlanePointer plane = cros.second;
67  std::pair<bool,double> propResult = planeCrossing.pathLength(*plane);
68  return propResult.first;
69 
70 }
virtual std::pair< bool, double > pathLength(const Plane &)
TrackCharge particleCharge() const
FreeTrajectoryState freeTrajectoryState() const