CMS 3D CMS Logo

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 ParticleMass KinematicState::mass() const
00020 {return param.vector()[6];}
00021 
00022 KinematicParameters KinematicState::kinematicParameters() const
00023 {return param;}
00024 
00025 KinematicParametersError KinematicState::kinematicParametersError() const
00026 {return err;}
00027 
00028 GlobalVector KinematicState::globalMomentum() const
00029 {return param.momentum();}
00030 
00031 GlobalPoint KinematicState::globalPosition() const
00032 {return param.position();}
00033 
00034 TrackCharge KinematicState::particleCharge() const
00035 {return ch;}
00036 
00037 FreeTrajectoryState KinematicState::freeTrajectoryState() const
00038 {
00039  GlobalTrajectoryParameters globalPar(globalPosition(), globalMomentum(),
00040         particleCharge(), theField);
00041  AlgebraicSymMatrix66 cError =
00042         kinematicParametersError().matrix().Sub<AlgebraicSymMatrix66>(0,0);
00043  CartesianTrajectoryError cartError(cError);
00044 // cout<<"conversion called"<<endl;
00045 // cout<<"parameters::position"<<globalPosition()<<endl;
00046 // cout<<"parameters::momentum"<<globalMomentum()<<endl;
00047 // cout<<"parameters::error"<<cError<<endl;
00048  return FreeTrajectoryState(globalPar,cartError);
00049 }
00050 /*
00051 AlgebraicSymMatrix KinematicState::weightMatrix() const
00052 {
00053  GlobalTrajectoryParameters gtp = freeTrajectoryState().parameters();
00054  cout<<"curvilinear error is"<<freeTrajectoryState().curvilinearError().matrix()<<endl;
00055  return err.weightMatrix(gtp);
00056 }
00057 */

Generated on Tue Jun 9 17:46:11 2009 for CMSSW by  doxygen 1.5.4