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 Member Functions
KinematicPerigeeConversions Class Reference

#include <KinematicPerigeeConversions.h>

Public Member Functions

ExtendedPerigeeTrajectoryParameters extendedPerigeeFromKinematicParameters (const KinematicState &state, const GlobalPoint &point) const
 
KinematicParameters kinematicParametersFromExPerigee (const ExtendedPerigeeTrajectoryParameters &pr, const GlobalPoint &point, const MagneticField *field) const
 
 KinematicPerigeeConversions ()
 
KinematicState kinematicState (const AlgebraicVector4 &momentum, const GlobalPoint &referencePoint, const TrackCharge &charge, const AlgebraicSymMatrix77 &theCovarianceMatrix, const MagneticField *field) const
 
AlgebraicVector4 momentumFromPerigee (const AlgebraicVector4 &momentum, const GlobalPoint &referencePoint, const TrackCharge &ch, const MagneticField *field) const
 

Private Member Functions

AlgebraicMatrix77 jacobianParameters2Kinematic (const AlgebraicVector4 &momentum, const GlobalPoint &referencePoint, const TrackCharge &charge, const MagneticField *field) const
 

Detailed Description

Helper class to simplify parameters conversions between kinematic and extended perigee parametrization

Kirill Prokofiev, August 2003

Definition at line 17 of file KinematicPerigeeConversions.h.

Constructor & Destructor Documentation

KinematicPerigeeConversions::KinematicPerigeeConversions ( )
inline

Definition at line 21 of file KinematicPerigeeConversions.h.

22  {}

Member Function Documentation

ExtendedPerigeeTrajectoryParameters KinematicPerigeeConversions::extendedPerigeeFromKinematicParameters ( const KinematicState state,
const GlobalPoint point 
) const

Definition at line 6 of file KinematicPerigeeConversions.cc.

References epsilon, KinematicState::globalMomentum(), KinematicState::globalPosition(), MagneticField::inInverseGeV(), M_PI, KinematicState::magneticField(), KinematicState::mass(), KinematicState::particleCharge(), phi, PV3DBase< T, PVType, FrameType >::phi(), point, mathSSE::sqrt(), PV3DBase< T, PVType, FrameType >::theta(), theta(), PV3DBase< T, PVType, FrameType >::transverse(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), detailsBasic3DVector::z, and PV3DBase< T, PVType, FrameType >::z().

Referenced by KinematicRefittedTrackState::parameters(), and PerigeeKinematicState::PerigeeKinematicState().

8 {
9 //making an extended perigee parametrization
10 //out of kinematic state and point defined
11  AlgebraicVector6 res;
12  res(5) = state.mass();
13 // AlgebraicVector7 par = state.kinematicParameters().vector();
14  GlobalVector impactDistance = state.globalPosition() - point;
15  double theta = state.globalMomentum().theta();
16  double phi = state.globalMomentum().phi();
17  double pt = state.globalMomentum().transverse();
18 // double field = MagneticField::inGeVPerCentimeter(state.globalPosition()).z();
19  double field = state.magneticField()->inInverseGeV(state.globalPosition()).z();
20 // double signTC = -state.particleCharge();
21 // double transverseCurvature = field/pt*signTC;
22 
23 //making a proper sign for epsilon
24  double positiveMomentumPhi = ((phi>0) ? phi : (2*M_PI + phi));
25  double positionPhi = impactDistance.phi();
26  double positivePositionPhi =
27  ( (positionPhi>0) ? positionPhi : (2*M_PI+positionPhi) );
28  double phiDiff = positiveMomentumPhi - positivePositionPhi;
29  if (phiDiff<0.0) phiDiff+= (2*M_PI);
30  double signEpsilon = ( (phiDiff > M_PI) ? -1.0 : 1.0);
31 
32  double epsilon = signEpsilon *
33  sqrt(impactDistance.x()*impactDistance.x() +
34  impactDistance.y()*impactDistance.y());
35 
36  double signTC = -state.particleCharge();
37  bool isCharged = (signTC!=0);
38 
39  if (isCharged) {
40  res(0) = field / pt*signTC;
41  } else {
42  res(0) = 1 / pt;
43  }
44 
45  res(1) = theta;
46  res(2) = phi;
47  res(3) = epsilon;
48  res(4) = impactDistance.z();
50 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
Geom::Theta< T > theta() const
T y() const
Definition: PV3DBase.h:63
GlobalVector globalMomentum() const
ROOT::Math::SVector< double, 6 > AlgebraicVector6
float float float z
ParticleMass mass() const
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
T transverse() const
Definition: PV3DBase.h:73
GlobalVector inInverseGeV(const GlobalPoint &gp) const
Field value ad specified global point, in 1/Gev.
Definition: MagneticField.h:40
T sqrt(T t)
Definition: SSEVec.h:48
T z() const
Definition: PV3DBase.h:64
const MagneticField * magneticField() const
#define M_PI
Definition: BFit3D.cc:3
TrackCharge particleCharge() const
const double epsilon
T x() const
Definition: PV3DBase.h:62
GlobalPoint globalPosition() const
*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
Definition: DDAxes.h:10
AlgebraicMatrix77 KinematicPerigeeConversions::jacobianParameters2Kinematic ( const AlgebraicVector4 momentum,
const GlobalPoint referencePoint,
const TrackCharge charge,
const MagneticField field 
) const
private

Jacobians of tranformations from the parametrixation (x, y, z, transverse curvature, theta, phi,m) to kinematic parameters

Definition at line 98 of file KinematicPerigeeConversions.cc.

References i, j, and PerigeeConversions::jacobianParameters2Cartesian().

Referenced by kinematicState().

101 {
103  (AlgebraicVector3(momentum[0],momentum[1],momentum[2]),
104  referencePoint, charge, field);
105  AlgebraicMatrix77 frameTransJ;
106  for (int i =0;i<6;++i)
107  for (int j =0;j<6;++j)
108  frameTransJ(i, j) = param2cart(i, j);
109  frameTransJ(6, 6) = 1;
110 
111 // double factor = 1;
112 // if (charge != 0){
113 // double field = TrackingTools::FakeField::Field::inGeVPerCentimeter(referencePoint).z();
114 // factor = -field*charge;
115 // }
116 // AlgebraicMatrix frameTransJ(7, 7, 0);
117 // frameTransJ[0][0] = 1;
118 // frameTransJ[1][1] = 1;
119 // frameTransJ[2][2] = 1;
120 // frameTransJ[6][6] = 1;
121 // frameTransJ[3][3] = - factor * cos(momentum[2]) / (momentum[0]*momentum[0]);
122 // frameTransJ[4][3] = - factor * sin(momentum[2]) / (momentum[0]*momentum[0]);
123 // frameTransJ[5][3] = - factor / tan(momentum[1]) / (momentum[0]*momentum[0]);
124 //
125 // frameTransJ[3][5] = - factor * sin(momentum[1]) / (momentum[0]);
126 // frameTransJ[4][5] = factor * cos(momentum[1]) / (momentum[0]);
127 // frameTransJ[5][4] = -factor/ (momentum[0]*sin(momentum[1])*sin(momentum[1]));
128 
129  return frameTransJ;
130 
131 }
int i
Definition: DBlmapReader.cc:9
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepStd< double, 6, 6 > > AlgebraicMatrix66
double charge(const std::vector< uint8_t > &Ampls)
AlgebraicMatrix66 jacobianParameters2Cartesian(const AlgebraicVector3 &momentum, const GlobalPoint &position, const TrackCharge &charge, const MagneticField *field)
ROOT::Math::SVector< double, 3 > AlgebraicVector3
int j
Definition: DBlmapReader.cc:9
ROOT::Math::SMatrix< double, 7, 7, ROOT::Math::MatRepStd< double, 7, 7 > > AlgebraicMatrix77
Definition: Matrices.h:9
KinematicParameters KinematicPerigeeConversions::kinematicParametersFromExPerigee ( const ExtendedPerigeeTrajectoryParameters pr,
const GlobalPoint point,
const MagneticField field 
) const

Definition at line 52 of file KinematicPerigeeConversions.cc.

References abs, ExtendedPerigeeTrajectoryParameters::charge(), funct::cos(), MagneticField::inInverseGeV(), funct::sin(), funct::tan(), ExtendedPerigeeTrajectoryParameters::vector(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

55 {
56  AlgebraicVector7 par;
57  AlgebraicVector6 theVector = pr.vector();
58  double pt;
59  if(pr.charge() !=0){
60  pt = std::abs(field->inInverseGeV(point).z() / theVector(1));
61  }else{pt = 1/theVector(1);}
62  par(6) = theVector[5];
63  par(0) = theVector[3]*sin(theVector[2])+point.x();
64  par(1) = -theVector[3]*cos(theVector[2])+point.y();
65  par(2) = theVector[4]+point.z();
66  par(3) = cos(theVector[2]) * pt;
67  par(4) = sin(theVector[2]) * pt;
68  par(5) = pt/tan(theVector[1]);
69 
70  return KinematicParameters(par);
71 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
T y() const
Definition: PV3DBase.h:63
#define abs(x)
Definition: mlp_lapack.h:159
ROOT::Math::SVector< double, 6 > AlgebraicVector6
GlobalVector inInverseGeV(const GlobalPoint &gp) const
Field value ad specified global point, in 1/Gev.
Definition: MagneticField.h:40
ROOT::Math::SVector< double, 7 > AlgebraicVector7
Definition: Matrices.h:7
T z() const
Definition: PV3DBase.h:64
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
T x() const
Definition: PV3DBase.h:62
KinematicState KinematicPerigeeConversions::kinematicState ( const AlgebraicVector4 momentum,
const GlobalPoint referencePoint,
const TrackCharge charge,
const AlgebraicSymMatrix77 theCovarianceMatrix,
const MagneticField field 
) const

Definition at line 75 of file KinematicPerigeeConversions.cc.

References jacobianParameters2Kinematic(), momentumFromPerigee(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by ParticleKinematicLinearizedTrackState::createRefittedTrackState().

78 {
79  AlgebraicMatrix77 param2cart = jacobianParameters2Kinematic(momentum,
80  referencePoint, charge, field);
81  AlgebraicSymMatrix77 kinematicErrorMatrix = ROOT::Math::Similarity(param2cart,theCovarianceMatrix);
82 // kinematicErrorMatrix.assign(param2cart*theCovarianceMatrix*param2cart.T());
83 
84  KinematicParametersError kinematicParamError(kinematicErrorMatrix);
85  AlgebraicVector7 par;
86  AlgebraicVector4 mm = momentumFromPerigee(momentum, referencePoint, charge, field);
87  par(0) = referencePoint.x();
88  par(1) = referencePoint.y();
89  par(2) = referencePoint.z();
90  par(3) = mm(0);
91  par(4) = mm(1);
92  par(5) = mm(2);
93  par(6) = mm(3);
94  KinematicParameters kPar(par);
95  return KinematicState(kPar, kinematicParamError, charge, field);
96 }
T y() const
Definition: PV3DBase.h:63
double charge(const std::vector< uint8_t > &Ampls)
ROOT::Math::SMatrix< double, 7, 7, ROOT::Math::MatRepSym< double, 7 > > AlgebraicSymMatrix77
Definition: Matrices.h:8
ROOT::Math::SVector< double, 7 > AlgebraicVector7
Definition: Matrices.h:7
T z() const
Definition: PV3DBase.h:64
AlgebraicVector4 momentumFromPerigee(const AlgebraicVector4 &momentum, const GlobalPoint &referencePoint, const TrackCharge &ch, const MagneticField *field) const
ROOT::Math::SMatrix< double, 7, 7, ROOT::Math::MatRepStd< double, 7, 7 > > AlgebraicMatrix77
Definition: Matrices.h:9
AlgebraicMatrix77 jacobianParameters2Kinematic(const AlgebraicVector4 &momentum, const GlobalPoint &referencePoint, const TrackCharge &charge, const MagneticField *field) const
ROOT::Math::SVector< double, 4 > AlgebraicVector4
T x() const
Definition: PV3DBase.h:62
AlgebraicVector4 KinematicPerigeeConversions::momentumFromPerigee ( const AlgebraicVector4 momentum,
const GlobalPoint referencePoint,
const TrackCharge ch,
const MagneticField field 
) const

Cartesian (px,py,px,m) from extended perigee

Definition at line 135 of file KinematicPerigeeConversions.cc.

References abs, funct::cos(), MagneticField::inInverseGeV(), funct::sin(), funct::tan(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by kinematicState().

138 {
139  AlgebraicVector4 mm;
140  double pt;
141  if(ch !=0){
142 // pt = abs(MagneticField::inGeVPerCentimeter(referencePoint).z() / momentum[0]);
143  pt = std::abs(field->inInverseGeV(referencePoint).z() / momentum[0]);
144  }else{pt = 1/ momentum[0];}
145  mm(0) = cos(momentum[2]) * pt;
146  mm(1) = sin(momentum[2]) * pt;
147  mm(2) = pt/tan(momentum[1]);
148  mm(3) = momentum[3];
149  return mm;
150 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
#define abs(x)
Definition: mlp_lapack.h:159
GlobalVector inInverseGeV(const GlobalPoint &gp) const
Field value ad specified global point, in 1/Gev.
Definition: MagneticField.h:40
T z() const
Definition: PV3DBase.h:64
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
ROOT::Math::SVector< double, 4 > AlgebraicVector4