CMS 3D CMS Logo

BeamSpotAlignmentDerivatives.cc
Go to the documentation of this file.
1 
9 
11 
14 
16 
18  AlgebraicMatrix aliderivs(4, 2);
19 
20  if (!tsos.isValid())
21  return aliderivs;
22 
23  // lp.x = transverse impact parameter
24  // lp.y = longitudinal impact parameter
25  LocalPoint lp = tsos.localPosition();
26  double phi = tsos.globalMomentum().phi();
27  double dz = lp.y();
28  double sinphi = sin(phi);
29  double cosphi = cos(phi);
30 
31  aliderivs[0][0] = sinphi;
32  aliderivs[0][1] = 0.0;
33  aliderivs[1][0] = -cosphi;
34  aliderivs[1][1] = 0.0;
35  aliderivs[2][0] = sinphi * dz;
36  aliderivs[2][1] = 0.0;
37  aliderivs[3][0] = -cosphi * dz;
38  aliderivs[3][1] = 0.0;
39 
40  return (aliderivs);
41 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
T y() const
Definition: PV3DBase.h:63
CLHEP::HepMatrix AlgebraicMatrix
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
AlgebraicMatrix operator()(const TrajectoryStateOnSurface &tsos) const
Returns 4x2 jacobian matrix.
GlobalVector globalMomentum() const