#include <RecoVertex/KinematicFitPrimitives/interface/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 |
Cartesian (px,py,px,m) from extended perigee. | |
Private Member Functions | |
AlgebraicMatrix77 | jacobianParameters2Kinematic (const AlgebraicVector4 &momentum, const GlobalPoint &referencePoint, const TrackCharge &charge, const MagneticField *field) const |
Jacobians of tranformations from the parametrixation (x, y, z, transverse curvature, theta, phi,m) to kinematic parameters. |
Kirill Prokofiev, August 2003
Definition at line 17 of file KinematicPerigeeConversions.h.
KinematicPerigeeConversions::KinematicPerigeeConversions | ( | ) | [inline] |
ExtendedPerigeeTrajectoryParameters KinematicPerigeeConversions::extendedPerigeeFromKinematicParameters | ( | const KinematicState & | state, | |
const GlobalPoint & | point | |||
) | const |
Definition at line 6 of file KinematicPerigeeConversions.cc.
References geometryDiff::epsilon, KinematicState::globalMomentum(), KinematicState::globalPosition(), MagneticField::inInverseGeV(), KinematicState::magneticField(), KinematicState::mass(), KinematicState::particleCharge(), PV3DBase< T, PVType, FrameType >::phi(), phi, res, funct::sqrt(), theta, PV3DBase< T, PVType, FrameType >::theta(), PV3DBase< T, PVType, FrameType >::transverse(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::z(), and z.
Referenced by KinematicRefittedTrackState::momentumVector(), KinematicRefittedTrackState::parameters(), and PerigeeKinematicState::PerigeeKinematicState().
00008 { 00009 //making an extended perigee parametrization 00010 //out of kinematic state and point defined 00011 AlgebraicVector6 res; 00012 res(5) = state.mass(); 00013 // AlgebraicVector7 par = state.kinematicParameters().vector(); 00014 GlobalVector impactDistance = state.globalPosition() - point; 00015 double theta = state.globalMomentum().theta(); 00016 double phi = state.globalMomentum().phi(); 00017 double pt = state.globalMomentum().transverse(); 00018 // double field = MagneticField::inGeVPerCentimeter(state.globalPosition()).z(); 00019 double field = state.magneticField()->inInverseGeV(state.globalPosition()).z(); 00020 // double signTC = -state.particleCharge(); 00021 // double transverseCurvature = field/pt*signTC; 00022 00023 //making a proper sign for epsilon 00024 double positiveMomentumPhi = ((phi>0) ? phi : (2*M_PI + phi)); 00025 double positionPhi = impactDistance.phi(); 00026 double positivePositionPhi = 00027 ( (positionPhi>0) ? positionPhi : (2*M_PI+positionPhi) ); 00028 double phiDiff = positiveMomentumPhi - positivePositionPhi; 00029 if (phiDiff<0.0) phiDiff+= (2*M_PI); 00030 double signEpsilon = ( (phiDiff > M_PI) ? -1.0 : 1.0); 00031 00032 double epsilon = signEpsilon * 00033 sqrt(impactDistance.x()*impactDistance.x() + 00034 impactDistance.y()*impactDistance.y()); 00035 00036 double signTC = -state.particleCharge(); 00037 bool isCharged = (signTC!=0); 00038 00039 if (isCharged) { 00040 res(0) = field / pt*signTC; 00041 } else { 00042 res(0) = 1 / pt; 00043 } 00044 00045 res(1) = theta; 00046 res(2) = phi; 00047 res(3) = epsilon; 00048 res(4) = impactDistance.z(); 00049 return ExtendedPerigeeTrajectoryParameters(res,state.particleCharge()); 00050 }
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().
00101 { 00102 PerigeeConversions pc; 00103 AlgebraicMatrix66 param2cart = pc.jacobianParameters2Cartesian 00104 (AlgebraicVector3(momentum[0],momentum[1],momentum[2]), 00105 referencePoint, charge, field); 00106 AlgebraicMatrix77 frameTransJ; 00107 for (int i =0;i<6;++i) 00108 for (int j =0;j<6;++j) 00109 frameTransJ(i, j) = param2cart(i, j); 00110 frameTransJ(6, 6) = 1; 00111 00112 // double factor = 1; 00113 // if (charge != 0){ 00114 // double field = TrackingTools::FakeField::Field::inGeVPerCentimeter(referencePoint).z(); 00115 // factor = -field*charge; 00116 // } 00117 // AlgebraicMatrix frameTransJ(7, 7, 0); 00118 // frameTransJ[0][0] = 1; 00119 // frameTransJ[1][1] = 1; 00120 // frameTransJ[2][2] = 1; 00121 // frameTransJ[6][6] = 1; 00122 // frameTransJ[3][3] = - factor * cos(momentum[2]) / (momentum[0]*momentum[0]); 00123 // frameTransJ[4][3] = - factor * sin(momentum[2]) / (momentum[0]*momentum[0]); 00124 // frameTransJ[5][3] = - factor / tan(momentum[1]) / (momentum[0]*momentum[0]); 00125 // 00126 // frameTransJ[3][5] = - factor * sin(momentum[1]) / (momentum[0]); 00127 // frameTransJ[4][5] = factor * cos(momentum[1]) / (momentum[0]); 00128 // frameTransJ[5][4] = -factor/ (momentum[0]*sin(momentum[1])*sin(momentum[1])); 00129 00130 return frameTransJ; 00131 00132 }
KinematicParameters KinematicPerigeeConversions::kinematicParametersFromExPerigee | ( | const ExtendedPerigeeTrajectoryParameters & | pr, | |
const GlobalPoint & | point, | |||
const MagneticField * | field | |||
) | const |
Definition at line 52 of file KinematicPerigeeConversions.cc.
References funct::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().
00055 { 00056 AlgebraicVector7 par; 00057 AlgebraicVector6 theVector = pr.vector(); 00058 double pt; 00059 if(pr.charge() !=0){ 00060 pt = std::abs(field->inInverseGeV(point).z() / theVector(1)); 00061 }else{pt = 1/theVector(1);} 00062 par(6) = theVector[5]; 00063 par(0) = theVector[3]*sin(theVector[2])+point.x(); 00064 par(1) = -theVector[3]*cos(theVector[2])+point.y(); 00065 par(2) = theVector[4]+point.z(); 00066 par(3) = cos(theVector[2]) * pt; 00067 par(4) = sin(theVector[2]) * pt; 00068 par(5) = pt/tan(theVector[1]); 00069 00070 return KinematicParameters(par); 00071 }
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().
00078 { 00079 AlgebraicMatrix77 param2cart = jacobianParameters2Kinematic(momentum, 00080 referencePoint, charge, field); 00081 AlgebraicSymMatrix77 kinematicErrorMatrix = ROOT::Math::Similarity(param2cart,theCovarianceMatrix); 00082 // kinematicErrorMatrix.assign(param2cart*theCovarianceMatrix*param2cart.T()); 00083 00084 KinematicParametersError kinematicParamError(kinematicErrorMatrix); 00085 AlgebraicVector7 par; 00086 AlgebraicVector4 mm = momentumFromPerigee(momentum, referencePoint, charge, field); 00087 par(0) = referencePoint.x(); 00088 par(1) = referencePoint.y(); 00089 par(2) = referencePoint.z(); 00090 par(3) = mm(0); 00091 par(4) = mm(1); 00092 par(5) = mm(2); 00093 par(6) = mm(3); 00094 KinematicParameters kPar(par); 00095 return KinematicState(kPar, kinematicParamError, charge, field); 00096 }
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 136 of file KinematicPerigeeConversions.cc.
References funct::abs(), funct::cos(), MagneticField::inInverseGeV(), funct::sin(), funct::tan(), and PV3DBase< T, PVType, FrameType >::z().
Referenced by kinematicState().
00139 { 00140 AlgebraicVector4 mm; 00141 double pt; 00142 if(ch !=0){ 00143 // pt = abs(MagneticField::inGeVPerCentimeter(referencePoint).z() / momentum[0]); 00144 pt = std::abs(field->inInverseGeV(referencePoint).z() / momentum[0]); 00145 }else{pt = 1/ momentum[0];} 00146 mm(0) = cos(momentum[2]) * pt; 00147 mm(1) = sin(momentum[2]) * pt; 00148 mm(2) = pt/tan(momentum[1]); 00149 mm(3) = momentum[3]; 00150 return mm; 00151 }