Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:28:17

0001 #include "RecoVertex/KinematicFitPrimitives/interface/PerigeeKinematicState.h"
0002 #include "RecoVertex/KinematicFitPrimitives/interface/KinematicPerigeeConversions.h"
0003 #include "TrackingTools/AnalyticalJacobians/interface/JacobianCartesianToCurvilinear.h"
0004 #include "TrackingTools/TrajectoryState/interface/PerigeeConversions.h"
0005 
0006 PerigeeKinematicState::PerigeeKinematicState(const KinematicState& state, const GlobalPoint& pt)
0007     : point(pt), inState(state), errorIsAvailable(true), vl(true) {
0008   if (!(state.isValid()))
0009     throw VertexException("PerigeeKinematicState::kinematic state passed is not valid!");
0010 
0011   //working with parameters:
0012   KinematicPerigeeConversions conversions;
0013   par = conversions.extendedPerigeeFromKinematicParameters(state, pt);
0014 
0015   //creating the error
0016   AlgebraicSymMatrix77 const& err = state.kinematicParametersError().matrix();
0017 
0018   //making jacobian for curvilinear frame
0019   JacobianCartesianToCurvilinear jj(state.freeTrajectoryState().parameters());
0020   AlgebraicMatrix67 ki2cu;
0021   ki2cu.Place_at(jj.jacobian(), 0, 0);
0022   ki2cu(5, 6) = 1.;
0023   AlgebraicMatrix66 cu2pe;
0024   cu2pe.Place_at(PerigeeConversions::jacobianCurvilinear2Perigee(state.freeTrajectoryState()), 0, 0);
0025   cu2pe(5, 5) = 1.;
0026   AlgebraicMatrix67 jacobian = cu2pe * ki2cu;
0027 
0028   cov = ExtendedPerigeeTrajectoryError(ROOT::Math::Similarity(jacobian, err));
0029 }
0030 
0031 /*
0032 AlgebraicMatrix PerigeeKinematicState::jacobianKinematicToExPerigee(const KinematicState& state,
0033                                                                     const GlobalPoint& pt)const
0034 {
0035  
0036  AlgebraicMatrix jac(6,7,0);
0037  jac(6,7) = 1;
0038  jac(5,3) = 1;
0039  AlgebraicVector par = state.kinematicParameters().vector();
0040  GlobalVector impactDistance = state.globalPosition() - point;
0041  double field = TrackingTools::FakeField::Field::inGeVPerCentimeter(state.globalPosition()).z();
0042  double signTC = -state.particleCharge();
0043  double theta = state.globalMomentum().theta();
0044  double phi = state.globalMomentum().phi();
0045  double ptr  = state.globalMomentum().transverse();
0046  double transverseCurvature = field/ptr*signTC;
0047 //making a proper sign for epsilon
0048  double positiveMomentumPhi  = ((phi>0) ? phi : (2*M_PI + phi)); 
0049  double positionPhi = impactDistance.phi();
0050  double positivePositionPhi =
0051    ( (positionPhi>0) ? positionPhi : (2*M_PI+positionPhi) );
0052  double phiDiff = positiveMomentumPhi - positivePositionPhi;
0053  if (phiDiff<0.0) phiDiff+= (2*M_PI);
0054  double signEpsilon = ( (phiDiff > M_PI) ? -1.0 : 1.0);
0055 
0056  double epsilon = signEpsilon *
0057           sqrt(impactDistance.x()*impactDistance.x() +
0058                impactDistance.y()*impactDistance.y());
0059 
0060 //jacobian corrections
0061 
0062 //  jac(1,4) = -(field*signTC/(transverseCurvature*transverseCurvature))* cos(phi);
0063 //  jac(1,5) = -(field*signTC/(transverseCurvature*transverseCurvature))* sin(phi);
0064 //  jac(1,6) = -(field*signTC/(transverseCurvature*transverseCurvature))*tan(theta);
0065  
0066  jac(1,4) = (1/ptr*signTC) * cos(phi);
0067  jac(1,5) = (1/ptr*signTC) * sin(phi);
0068  jac(1,6) = (1/ptr*signTC) * tan(theta);
0069  
0070  jac(2,6) = (ptr)/(cos(theta) * cos(theta));
0071  jac(3,1) = - epsilon * cos(phi);
0072  jac(3,2) = - epsilon * sin(phi);
0073 
0074 
0075 // jac(3,4) = 
0076  jac(3,4) = - ptr * sin(phi);
0077  jac(3,5) =  ptr * cos(phi);
0078  jac(4,1) = - sin(phi);
0079  jac(4,2) =  cos(phi);
0080  return jac;
0081  
0082 }
0083 
0084 
0085 
0086 AlgebraicMatrix PerigeeKinematicState::jacobianExPerigeeToKinematic(const ExtendedPerigeeTrajectoryParameters& state, 
0087                                                                     const GlobalPoint& point)const
0088 {
0089 
0090  AlgebraicMatrix jac(7,6,0);
0091  return jac;
0092  
0093 }
0094 */
0095 //temporary method move