CMS 3D CMS Logo

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

KinematicStatePropagatorclone () const override
 
KinematicState propagateToTheTransversePCA (const KinematicState &state, const GlobalPoint &referencePoint) const override
 
 TrackKinematicStatePropagator ()
 
bool willPropagateToTheTransversePCA (const KinematicState &state, const GlobalPoint &point) const override
 
 ~TrackKinematicStatePropagator () override
 
- Public Member Functions inherited from KinematicStatePropagator
 KinematicStatePropagator ()
 
virtual ~KinematicStatePropagator ()
 

Private Types

typedef Point3DBase< double, GlobalTagGlobalPointDouble
 
typedef Vector3DBase< double, GlobalTagGlobalVectorDouble
 

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 17 of file TrackKinematicStatePropagator.h.

Member Typedef Documentation

◆ GlobalPointDouble

Definition at line 49 of file TrackKinematicStatePropagator.h.

◆ GlobalVectorDouble

Definition at line 50 of file TrackKinematicStatePropagator.h.

Constructor & Destructor Documentation

◆ TrackKinematicStatePropagator()

TrackKinematicStatePropagator::TrackKinematicStatePropagator ( )
inline

Definition at line 19 of file TrackKinematicStatePropagator.h.

Referenced by clone().

19 {}

◆ ~TrackKinematicStatePropagator()

TrackKinematicStatePropagator::~TrackKinematicStatePropagator ( )
inlineoverride

Definition at line 21 of file TrackKinematicStatePropagator.h.

21 {}

Member Function Documentation

◆ clone()

KinematicStatePropagator* TrackKinematicStatePropagator::clone ( void  ) const
inlineoverridevirtual

Clone method reimplemented from abstract class

Implements KinematicStatePropagator.

Definition at line 36 of file TrackKinematicStatePropagator.h.

References TrackKinematicStatePropagator().

◆ propagateToTheTransversePCA()

KinematicState TrackKinematicStatePropagator::propagateToTheTransversePCA ( const KinematicState state,
const GlobalPoint referencePoint 
) const
overridevirtual

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

Implements KinematicStatePropagator.

Definition at line 11 of file TrackKinematicStatePropagator.cc.

12  {
13  if (state.particleCharge() == 0.) {
14  return propagateToTheTransversePCANeutral(state, referencePoint);
15  } else {
16  return propagateToTheTransversePCACharged(state, referencePoint);
17  }
18 }
virtual KinematicState propagateToTheTransversePCACharged(const KinematicState &state, const GlobalPoint &referencePoint) const
virtual KinematicState propagateToTheTransversePCANeutral(const KinematicState &state, const GlobalPoint &referencePoint) const

◆ propagateToTheTransversePCACharged()

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

References HelixBarrelPlaneCrossingByCircle::direction(), hcaldqm::quantity::fState, mps_fire::i, JacobianCartesianToCurvilinear::jacobian(), JacobianCurvilinearToCartesian::jacobian(), AnalyticalCurvilinearJacobian::jacobian(), LogDebug, PV3DBase< T, PVType, FrameType >::mag(), EgHLTOffHistBins_cfi::mass, HelixBarrelPlaneCrossingByCircle::pathLength(), HelixBarrelPlaneCrossingByCircle::position(), alignCSCRings::s, mathSSE::sqrt(), PV3DBase< T, PVType, FrameType >::x(), Basic3DVector< T >::x(), Basic3DVector< T >::y(), and Basic3DVector< T >::z().

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

◆ propagateToTheTransversePCANeutral()

KinematicState TrackKinematicStatePropagator::propagateToTheTransversePCANeutral ( const KinematicState state,
const GlobalPoint referencePoint 
) const
privatevirtual

Definition at line 195 of file TrackKinematicStatePropagator.cc.

References funct::cos(), hcaldqm::quantity::fState, JacobianCurvilinearToCartesian::jacobian(), alignCSCRings::s, funct::sin(), funct::tan(), theta(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

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

◆ willPropagateToTheTransversePCA()

bool TrackKinematicStatePropagator::willPropagateToTheTransversePCA ( const KinematicState state,
const GlobalPoint point 
) const
overridevirtual

Reimplemented from KinematicStatePropagator.

Definition at line 58 of file TrackKinematicStatePropagator.cc.

References hcaldqm::quantity::fState, HelixBarrelPlaneCrossingByCircle::pathLength(), and point.

Referenced by KinematicParticleVertexFitter::fit().

59  {
60  if (state.particleCharge() == 0.)
61  return true;
62 
63  // copied from below...
64  FreeTrajectoryState const& fState = state.freeTrajectoryState();
65  std::pair<HelixBarrelPlaneCrossingByCircle, BoundPlane::BoundPlanePointer> cros = planeCrossing(fState, point);
66  if (cros.second == nullptr)
67  return false;
68 
69  HelixBarrelPlaneCrossingByCircle planeCrossing = cros.first;
70  BoundPlane::BoundPlanePointer plane = cros.second;
71  std::pair<bool, double> propResult = planeCrossing.pathLength(*plane);
72  return propResult.first;
73 }
std::pair< bool, double > pathLength(const Plane &) override
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5