CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
JacobianCurvilinearToCartesian.cc
Go to the documentation of this file.
3 
5 JacobianCurvilinearToCartesian(const GlobalTrajectoryParameters& globalParameters) : theJacobian() {
6  GlobalVector xt = globalParameters.momentum();
7  //GlobalVector yt(xt.y(), -xt.x(), 0.); \\wrong direction of the axis
8  //GlobalVector zt(xt.x()*xt.z(), xt.y()*xt.z(), -xt.perp2()); \\and then also on this one
9  GlobalVector yt(-xt.y(), xt.x(), 0.);
10  GlobalVector zt = xt.cross(yt);
11 
12  GlobalVector pvec = globalParameters.momentum();
13  double pt = pvec.perp();
14  TrackCharge q = globalParameters.charge();
15  // for neutrals: qbp is 1/p instead of q/p -
16  // equivalent to charge 1
17  if ( q==0 ) q = 1;
18 
19  xt = xt.unit();
20  if(fabs(pt) > 0){
21  yt = yt.unit();
22  zt = zt.unit();
23  }
24 
26  R(0,0) = xt.x(); R(0,1) = yt.x(); R(0,2) = zt.x();
27  R(1,0) = xt.y(); R(1,1) = yt.y(); R(1,2) = zt.y();
28  R(2,0) = xt.z(); R(2,1) = yt.z(); R(2,2) = zt.z();
29  R(3,3) = 1.;
30  R(4,4) = 1.;
31  R(5,5) = 1.;
32 
33  double p = pvec.mag(), p2 = p*p;
34  double lambda = 0.5 * M_PI - pvec.theta();
35  double phi = pvec.phi();
36  double sinlambda = sin(lambda), coslambda = cos(lambda);
37  double sinphi = sin(phi), cosphi = cos(phi);
38 
39  theJacobian(1,3) = 1.;
40  theJacobian(2,4) = 1.;
41  theJacobian(3,0) = -q * p2 * coslambda * cosphi;
42  theJacobian(3,1) = -p * sinlambda * cosphi;
43  theJacobian(3,2) = -p * coslambda * sinphi;
44  theJacobian(4,0) = -q * p2 * coslambda * sinphi;
45  theJacobian(4,1) = -p * sinlambda * sinphi;
46  theJacobian(4,2) = p * coslambda * cosphi;
47  theJacobian(5,0) = -q * p2 * sinlambda;
48  theJacobian(5,1) = p * coslambda;
49  theJacobian(5,2) = 0.;
50 
51  //ErrorPropagation:
52  // C(Cart) = R(6*6) * J(6*5) * C(Curvi) * J(5*6)_T * R(6*6)_T
54  //dbg::dbg_trace(1,"Cu2Ca", globalParameters.vector(),theJacobian);
55 }
T perp() const
Definition: PV3DBase.h:72
JacobianCurvilinearToCartesian(const GlobalTrajectoryParameters &globalParameters)
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepStd< double, 6, 6 > > AlgebraicMatrix66
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
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
int TrackCharge
Definition: TrackCharge.h:4
T mag() const
Definition: PV3DBase.h:67
Vector3DBase< typename PreciseFloatType< T, U >::Type, FrameTag > cross(const Vector3DBase< U, FrameTag > &v) const
Definition: Vector3DBase.h:119
T z() const
Definition: PV3DBase.h:64
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double p2[4]
Definition: TauolaWrapper.h:90
#define M_PI
Vector3DBase unit() const
Definition: Vector3DBase.h:57
T x() const
Definition: PV3DBase.h:62
Definition: DDAxes.h:10