CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_2_9_HLT1_bphpatch4/src/RecoVertex/KinematicFitPrimitives/src/KinematicState.cc

Go to the documentation of this file.
00001 #include "RecoVertex/KinematicFitPrimitives/interface/KinematicState.h"
00002 #include "RecoVertex/KinematicFitPrimitives/interface/Matrices.h"
00003 
00004 KinematicState::KinematicState(const KinematicParameters& parameters,
00005         const KinematicParametersError& error, const TrackCharge& charge,
00006         const MagneticField* field) :
00007         theField(field), param(parameters),err(error), ch(charge), vl(true)
00008 {}
00009 
00010 
00011 bool KinematicState::operator==(const KinematicState& other) const
00012 {
00013  bool res = false;
00014  if((kinematicParameters().vector() == other.kinematicParameters().vector())&&
00015     (kinematicParametersError().matrix() == other.kinematicParametersError().matrix())) res = true;
00016  return res;
00017 }
00018 
00019 
00020 FreeTrajectoryState KinematicState::freeTrajectoryState() const
00021 {
00022  GlobalTrajectoryParameters globalPar(globalPosition(), globalMomentum(),
00023         particleCharge(), theField);
00024  AlgebraicSymMatrix66 cError =
00025         kinematicParametersError().matrix().Sub<AlgebraicSymMatrix66>(0,0);
00026  CartesianTrajectoryError cartError(cError);
00027 // cout<<"conversion called"<<endl;
00028 // cout<<"parameters::position"<<globalPosition()<<endl;
00029 // cout<<"parameters::momentum"<<globalMomentum()<<endl;
00030 // cout<<"parameters::error"<<cError<<endl;
00031  return FreeTrajectoryState(globalPar,cartError);
00032 }
00033 /*
00034 AlgebraicSymMatrix KinematicState::weightMatrix() const
00035 {
00036  GlobalTrajectoryParameters gtp = freeTrajectoryState().parameters();
00037  cout<<"curvilinear error is"<<freeTrajectoryState().curvilinearError().matrix()<<endl;
00038  return err.weightMatrix(gtp);
00039 }
00040 */