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
00045
00046
00047
00048 return FreeTrajectoryState(globalPar,cartError);
00049 }
00050
00051
00052
00053
00054
00055
00056
00057