CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/RecoVertex/KinematicFitPrimitives/src/PerigeeKinematicState.cc

Go to the documentation of this file.
00001 #include "RecoVertex/KinematicFitPrimitives/interface/PerigeeKinematicState.h"
00002 #include "RecoVertex/KinematicFitPrimitives/interface/KinematicPerigeeConversions.h"
00003 #include "TrackingTools/AnalyticalJacobians/interface/JacobianCartesianToCurvilinear.h"
00004 #include "TrackingTools/TrajectoryState/interface/PerigeeConversions.h"
00005 
00006 PerigeeKinematicState::PerigeeKinematicState(const KinematicState& state, const GlobalPoint& pt):
00007  point(pt), inState(state),  errorIsAvailable(true),vl(true)
00008 {
00009  if(!(state.isValid())) throw VertexException("PerigeeKinematicState::kinematic state passed is not valid!");
00010 
00011 //working with parameters:
00012  KinematicPerigeeConversions conversions;
00013  par  = conversions.extendedPerigeeFromKinematicParameters(state,pt);
00014    
00015 //creating the error
00016  AlgebraicSymMatrix77 err = state.kinematicParametersError().matrix();
00017 
00018 //making jacobian for curvilinear frame
00019  JacobianCartesianToCurvilinear jj(state.freeTrajectoryState().parameters());  
00020  AlgebraicMatrix67 ki2cu;
00021  ki2cu.Place_at(jj.jacobian(),0,0);
00022  ki2cu(5,6) = 1.;
00023  AlgebraicMatrix66 cu2pe;
00024  cu2pe.Place_at(PerigeeConversions::jacobianCurvilinear2Perigee(state.freeTrajectoryState()),0,0);
00025  cu2pe(5,5) = 1.;
00026  AlgebraicMatrix67 jacobian = cu2pe*ki2cu;
00027 
00028  cov = ExtendedPerigeeTrajectoryError(ROOT::Math::Similarity(jacobian, err));
00029 
00030 }
00031 
00032 /*
00033 AlgebraicMatrix PerigeeKinematicState::jacobianKinematicToExPerigee(const KinematicState& state,
00034                                                                     const GlobalPoint& pt)const
00035 {
00036  
00037  AlgebraicMatrix jac(6,7,0);
00038  jac(6,7) = 1;
00039  jac(5,3) = 1;
00040  AlgebraicVector par = state.kinematicParameters().vector();
00041  GlobalVector impactDistance = state.globalPosition() - point;
00042  double field = TrackingTools::FakeField::Field::inGeVPerCentimeter(state.globalPosition()).z();
00043  double signTC = -state.particleCharge();
00044  double theta = state.globalMomentum().theta();
00045  double phi = state.globalMomentum().phi();
00046  double ptr  = state.globalMomentum().transverse();
00047  double transverseCurvature = field/ptr*signTC;
00048 //making a proper sign for epsilon
00049  double positiveMomentumPhi  = ((phi>0) ? phi : (2*M_PI + phi)); 
00050  double positionPhi = impactDistance.phi();
00051  double positivePositionPhi =
00052    ( (positionPhi>0) ? positionPhi : (2*M_PI+positionPhi) );
00053  double phiDiff = positiveMomentumPhi - positivePositionPhi;
00054  if (phiDiff<0.0) phiDiff+= (2*M_PI);
00055  double signEpsilon = ( (phiDiff > M_PI) ? -1.0 : 1.0);
00056 
00057  double epsilon = signEpsilon *
00058                   sqrt(impactDistance.x()*impactDistance.x() +
00059                        impactDistance.y()*impactDistance.y());
00060 
00061 //jacobian corrections
00062 
00063 //  jac(1,4) = -(field*signTC/(transverseCurvature*transverseCurvature))* cos(phi);
00064 //  jac(1,5) = -(field*signTC/(transverseCurvature*transverseCurvature))* sin(phi);
00065 //  jac(1,6) = -(field*signTC/(transverseCurvature*transverseCurvature))*tan(theta);
00066  
00067  jac(1,4) = (1/ptr*signTC) * cos(phi);
00068  jac(1,5) = (1/ptr*signTC) * sin(phi);
00069  jac(1,6) = (1/ptr*signTC) * tan(theta);
00070  
00071  jac(2,6) = (ptr)/(cos(theta) * cos(theta));
00072  jac(3,1) = - epsilon * cos(phi);
00073  jac(3,2) = - epsilon * sin(phi);
00074 
00075 
00076 // jac(3,4) = 
00077  jac(3,4) = - ptr * sin(phi);
00078  jac(3,5) =  ptr * cos(phi);
00079  jac(4,1) = - sin(phi);
00080  jac(4,2) =  cos(phi);
00081  return jac;
00082  
00083 }
00084 
00085 
00086 
00087 AlgebraicMatrix PerigeeKinematicState::jacobianExPerigeeToKinematic(const ExtendedPerigeeTrajectoryParameters& state, 
00088                                                                     const GlobalPoint& point)const
00089 {
00090 
00091  AlgebraicMatrix jac(7,6,0);
00092  return jac;
00093  
00094 }
00095 */
00096 //temporary method move