CMS 3D CMS Logo

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::KinematicPerigeeConversions ( )
inline

Definition at line 19 of file KinematicPerigeeConversions.h.

19 {}

Member Function Documentation

◆ extendedPerigeeFromKinematicParameters()

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

Definition at line 4 of file KinematicPerigeeConversions.cc.

References geometryDiff::epsilon, M_PI, phi, PV3DBase< T, PVType, FrameType >::phi(), point, DiDispStaMuonMonitor_cfi::pt, mathSSE::sqrt(), theta(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

5  {
6  //making an extended perigee parametrization
7  //out of kinematic state and point defined
9  res(5) = state.mass();
10  // AlgebraicVector7 par = state.kinematicParameters().vector();
11  GlobalVector impactDistance = state.globalPosition() - point;
12  double theta = state.globalMomentum().theta();
13  double phi = state.globalMomentum().phi();
14  double pt = state.globalMomentum().transverse();
15  // double field = MagneticField::inGeVPerCentimeter(state.globalPosition()).z();
16  double field = state.magneticFieldInInverseGeV().z();
17  // double signTC = -state.particleCharge();
18  // double transverseCurvature = field/pt*signTC;
19 
20  //making a proper sign for epsilon
21  // FIXME use scalar product...
22  double positiveMomentumPhi = ((phi > 0) ? phi : (2 * M_PI + phi));
23  double positionPhi = impactDistance.phi();
24  double positivePositionPhi = ((positionPhi > 0) ? positionPhi : (2 * M_PI + positionPhi));
25  double phiDiff = positiveMomentumPhi - positivePositionPhi;
26  if (phiDiff < 0.0)
27  phiDiff += (2 * M_PI);
28  double signEpsilon = ((phiDiff > M_PI) ? -1.0 : 1.0);
29 
30  double epsilon =
31  signEpsilon * sqrt(impactDistance.x() * impactDistance.x() + impactDistance.y() * impactDistance.y());
32 
33  double signTC = -state.particleCharge();
34  bool isCharged = (signTC != 0);
35 
36  if (isCharged) {
37  res(0) = field / pt * signTC;
38  } else {
39  res(0) = 1 / pt;
40  }
41 
42  res(1) = theta;
43  res(2) = phi;
44  res(3) = epsilon;
45  res(4) = impactDistance.z();
46  return ExtendedPerigeeTrajectoryParameters(res, state.particleCharge());
47 }
T z() const
Definition: PV3DBase.h:61
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
Definition: Electron.h:6
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
T sqrt(T t)
Definition: SSEVec.h:23
#define M_PI
ROOT::Math::SVector< double, 6 > AlgebraicVector6
Geom::Theta< T > theta() 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

◆ jacobianParameters2Kinematic()

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 93 of file KinematicPerigeeConversions.cc.

References ALCARECOTkAlJpsiMuMu_cff::charge, mps_fire::i, dqmiolumiharvest::j, and PerigeeConversions::jacobianParameters2Cartesian().

Referenced by kinematicState().

96  {
98  AlgebraicVector3(momentum[0], momentum[1], momentum[2]), referencePoint, charge, field);
99  AlgebraicMatrix77 frameTransJ;
100  for (int i = 0; i < 6; ++i)
101  for (int j = 0; j < 6; ++j)
102  frameTransJ(i, j) = param2cart(i, j);
103  frameTransJ(6, 6) = 1;
104 
105  // double factor = 1;
106  // if (charge != 0){
107  // double field = TrackingTools::FakeField::Field::inGeVPerCentimeter(referencePoint).z();
108  // factor = -field*charge;
109  // }
110  // AlgebraicMatrix frameTransJ(7, 7, 0);
111  // frameTransJ[0][0] = 1;
112  // frameTransJ[1][1] = 1;
113  // frameTransJ[2][2] = 1;
114  // frameTransJ[6][6] = 1;
115  // frameTransJ[3][3] = - factor * cos(momentum[2]) / (momentum[0]*momentum[0]);
116  // frameTransJ[4][3] = - factor * sin(momentum[2]) / (momentum[0]*momentum[0]);
117  // frameTransJ[5][3] = - factor / tan(momentum[1]) / (momentum[0]*momentum[0]);
118  //
119  // frameTransJ[3][5] = - factor * sin(momentum[1]) / (momentum[0]);
120  // frameTransJ[4][5] = factor * cos(momentum[1]) / (momentum[0]);
121  // frameTransJ[5][4] = -factor/ (momentum[0]*sin(momentum[1])*sin(momentum[1]));
122 
123  return frameTransJ;
124 }
ROOT::Math::SMatrix< double, 7, 7, ROOT::Math::MatRepStd< double, 7, 7 > > AlgebraicMatrix77
Definition: Matrices.h:10
AlgebraicMatrix66 jacobianParameters2Cartesian(const AlgebraicVector3 &momentum, const GlobalPoint &position, const TrackCharge &charge, const MagneticField *field)
ROOT::Math::SMatrix< double, 6, 6, ROOT::Math::MatRepStd< double, 6, 6 > > AlgebraicMatrix66
ROOT::Math::SVector< double, 3 > AlgebraicVector3

◆ kinematicParametersFromExPerigee()

KinematicParameters KinematicPerigeeConversions::kinematicParametersFromExPerigee ( const ExtendedPerigeeTrajectoryParameters pr,
const GlobalPoint point,
const MagneticField field 
) const

Definition at line 49 of file KinematicPerigeeConversions.cc.

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

50  {
51  AlgebraicVector7 par;
52  AlgebraicVector6 theVector = pr.vector();
53  double pt;
54  if (pr.charge() != 0) {
55  pt = std::abs(field->inInverseGeV(point).z() / theVector(1));
56  } else {
57  pt = 1 / theVector(1);
58  }
59  par(6) = theVector[5];
60  par(0) = theVector[3] * sin(theVector[2]) + point.x();
61  par(1) = -theVector[3] * cos(theVector[2]) + point.y();
62  par(2) = theVector[4] + point.z();
63  par(3) = cos(theVector[2]) * pt;
64  par(4) = sin(theVector[2]) * pt;
65  par(5) = pt / tan(theVector[1]);
66 
67  return KinematicParameters(par);
68 }
T z() const
Definition: PV3DBase.h:61
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
ROOT::Math::SVector< double, 7 > AlgebraicVector7
Definition: Matrices.h:8
GlobalVector inInverseGeV(const GlobalPoint &gp) const
Field value ad specified global point, in 1/Gev.
Definition: MagneticField.h:36
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ROOT::Math::SVector< double, 6 > AlgebraicVector6
*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

◆ kinematicState()

KinematicState KinematicPerigeeConversions::kinematicState ( const AlgebraicVector4 momentum,
const GlobalPoint referencePoint,
const TrackCharge charge,
const AlgebraicSymMatrix77 theCovarianceMatrix,
const MagneticField field 
) const

Definition at line 70 of file KinematicPerigeeConversions.cc.

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

74  {
75  AlgebraicMatrix77 param2cart = jacobianParameters2Kinematic(momentum, referencePoint, charge, field);
76  AlgebraicSymMatrix77 kinematicErrorMatrix = ROOT::Math::Similarity(param2cart, theCovarianceMatrix);
77  // kinematicErrorMatrix.assign(param2cart*theCovarianceMatrix*param2cart.T());
78 
79  KinematicParametersError kinematicParamError(kinematicErrorMatrix);
80  AlgebraicVector7 par;
81  AlgebraicVector4 mm = momentumFromPerigee(momentum, referencePoint, charge, field);
82  par(0) = referencePoint.x();
83  par(1) = referencePoint.y();
84  par(2) = referencePoint.z();
85  par(3) = mm(0);
86  par(4) = mm(1);
87  par(5) = mm(2);
88  par(6) = mm(3);
89  KinematicParameters kPar(par);
90  return KinematicState(kPar, kinematicParamError, charge, field);
91 }
T z() const
Definition: PV3DBase.h:61
ROOT::Math::SVector< double, 7 > AlgebraicVector7
Definition: Matrices.h:8
ROOT::Math::SMatrix< double, 7, 7, ROOT::Math::MatRepStd< double, 7, 7 > > AlgebraicMatrix77
Definition: Matrices.h:10
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
ROOT::Math::SVector< double, 4 > AlgebraicVector4
AlgebraicVector4 momentumFromPerigee(const AlgebraicVector4 &momentum, const GlobalPoint &referencePoint, const TrackCharge &ch, const MagneticField *field) const
ROOT::Math::SMatrix< double, 7, 7, ROOT::Math::MatRepSym< double, 7 > > AlgebraicSymMatrix77
Definition: Matrices.h:9
AlgebraicMatrix77 jacobianParameters2Kinematic(const AlgebraicVector4 &momentum, const GlobalPoint &referencePoint, const TrackCharge &charge, const MagneticField *field) const

◆ momentumFromPerigee()

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 127 of file KinematicPerigeeConversions.cc.

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

Referenced by kinematicState().

130  {
131  AlgebraicVector4 mm;
132  double pt;
133  if (ch != 0) {
134  // pt = abs(MagneticField::inGeVPerCentimeter(referencePoint).z() / momentum[0]);
135  pt = std::abs(field->inInverseGeV(referencePoint).z() / momentum[0]);
136  } else {
137  pt = 1 / momentum[0];
138  }
139  mm(0) = cos(momentum[2]) * pt;
140  mm(1) = sin(momentum[2]) * pt;
141  mm(2) = pt / tan(momentum[1]);
142  mm(3) = momentum[3];
143  return mm;
144 }
T z() const
Definition: PV3DBase.h:61
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
GlobalVector inInverseGeV(const GlobalPoint &gp) const
Field value ad specified global point, in 1/Gev.
Definition: MagneticField.h:36
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ROOT::Math::SVector< double, 4 > AlgebraicVector4