CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
JacobianCartesianToCurvilinear.cc
Go to the documentation of this file.
3 
5 JacobianCartesianToCurvilinear(const GlobalTrajectoryParameters& globalParameters) : theJacobian() {
6 
7  GlobalVector xt = globalParameters.momentum();
8  //GlobalVector yt(xt.y(), -xt.x(), 0.); \\wrong direction of the axis
9  //GlobalVector zt(xt.x()*xt.z(), xt.y()*xt.z(), -xt.perp2()); \\and then also on this one
10  GlobalVector yt(-xt.y(), xt.x(), 0.);
11  GlobalVector zt = xt.cross(yt);
12  GlobalVector pvec = globalParameters.momentum();
13  double pt = pvec.perp(), p = pvec.mag();
14  double px = pvec.x(), py = pvec.y(), pz = pvec.z();
15  double pt2 = pt*pt, p2 = p*p, p3 = p*p*p;
16  TrackCharge q = globalParameters.charge();
17  // for neutrals: qbp is 1/p instead of q/p -
18  // equivalent to charge 1
19  if ( q==0 ) q = 1;
20  xt = xt.unit();
21  if(fabs(pt) > 0){
22  yt = yt.unit();
23  zt = zt.unit();
24  }
25 
27  R(0,0) = xt.x(); R(0,1) = xt.y(); R(0,2) = xt.z();
28  R(1,0) = yt.x(); R(1,1) = yt.y(); R(1,2) = yt.z();
29  R(2,0) = zt.x(); R(2,1) = zt.y(); R(2,2) = zt.z();
30  R(3,3) = 1.;
31  R(4,4) = 1.;
32  R(5,5) = 1.;
33 
34  theJacobian(0,3) = -q*px/p3; theJacobian(0,4) = -q*py/p3; theJacobian(0,5) = -q*pz/p3;
35  if(fabs(pt) > 0){
36  //theJacobian(1,3) = (px*pz)/(pt*p2); theJacobian(1,4) = (py*pz)/(pt*p2); theJacobian(1,5) = -pt/p2; //wrong sign
37  theJacobian(1,3) = -(px*pz)/(pt*p2); theJacobian(1,4) = -(py*pz)/(pt*p2); theJacobian(1,5) = pt/p2;
38  theJacobian(2,3) = -py/pt2; theJacobian(2,4) = px/pt2; theJacobian(2,5) = 0.;
39  }
40  theJacobian(3,1) = 1.;
41  theJacobian(4,2) = 1.;
43  //dbg::dbg_trace(1,"Ca2Cu", globalParameters.vector(),theJacobian);
44 }
T perp() const
Definition: PV3DBase.h:72
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepStd< double, 6, 6 > > AlgebraicMatrix66
T y() const
Definition: PV3DBase.h:63
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
double p2[4]
Definition: TauolaWrapper.h:90
Vector3DBase unit() const
Definition: Vector3DBase.h:57
T x() const
Definition: PV3DBase.h:62
JacobianCartesianToCurvilinear(const GlobalTrajectoryParameters &globalParameters)
double p3[4]
Definition: TauolaWrapper.h:91