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 Attributes
JacobianCurvilinearToCartesian Class Reference

#include <JacobianCurvilinearToCartesian.h>

Public Member Functions

const AlgebraicMatrix65jacobian () const
 
 JacobianCurvilinearToCartesian (const GlobalTrajectoryParameters &globalParameters)
 

Private Attributes

AlgebraicMatrix65 theJacobian
 

Detailed Description

Class which calculates the Jacobian matrix of the transformation from the curvilinear to the Cartesian frame. The Jacobian is calculated during construction and thereafter cached, enabling reuse of the same Jacobian without calculating it again.

Definition at line 14 of file JacobianCurvilinearToCartesian.h.

Constructor & Destructor Documentation

JacobianCurvilinearToCartesian::JacobianCurvilinearToCartesian ( const GlobalTrajectoryParameters globalParameters)

Constructor from global trajectory parameters. NB!! No default constructor exists!

Definition at line 5 of file JacobianCurvilinearToCartesian.cc.

References GlobalTrajectoryParameters::charge(), funct::cos(), Vector3DBase< T, FrameTag >::cross(), M_PI, PV3DBase< T, PVType, FrameType >::mag(), GlobalTrajectoryParameters::momentum(), AlCaHLTBitMon_ParallelJobs::p, p2, PV3DBase< T, PVType, FrameType >::perp(), phi, PV3DBase< T, PVType, FrameType >::phi(), RecoTauCleanerPlugins::pt, lumiQueryAPI::q, dttmaxenums::R, funct::sin(), theJacobian, PV3DBase< T, PVType, FrameType >::theta(), Vector3DBase< T, FrameTag >::unit(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

5  : 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
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

Member Function Documentation

const AlgebraicMatrix65& JacobianCurvilinearToCartesian::jacobian ( ) const
inline

Member Data Documentation

AlgebraicMatrix65 JacobianCurvilinearToCartesian::theJacobian
private

Definition at line 31 of file JacobianCurvilinearToCartesian.h.

Referenced by jacobian(), and JacobianCurvilinearToCartesian().