CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_0/src/RecoVertex/VertexTools/src/VertexDistance.cc

Go to the documentation of this file.
00001 #include "RecoVertex/VertexTools/interface/VertexDistance.h"
00002 #include "RecoVertex/VertexPrimitives/interface/VertexState.h"
00003 #include "FWCore/Utilities/interface/Exception.h"
00004 #include <cfloat>
00005 
00006 
00007 using namespace reco;
00008 
00009 Measurement1D VertexDistance::distance(const VertexState & vtx1, 
00010                                          const VertexState & vtx2) const
00011 {
00012   return distance(vtx1.position(), vtx1.error(),
00013                   vtx2.position(), vtx2.error());
00014 }
00015 
00016 Measurement1D VertexDistance::distance(const Vertex & vtx1, 
00017                                          const VertexState & vtx2) const
00018 {
00019   return distance(GlobalPoint(Basic3DVector<float> (vtx1.position())), 
00020                   GlobalError(vtx1.covariance()),
00021                   vtx2.position(), vtx2.error());
00022 }
00023 
00024 
00025 Measurement1D VertexDistance::distance(const VertexState & vtx1, 
00026                                          const Vertex & vtx2) const
00027 {
00028   return distance(vtx1.position(), vtx1.error(),
00029                   GlobalPoint(Basic3DVector<float> (vtx2.position())), 
00030                   GlobalError(vtx2.covariance()));
00031 }
00032 
00033 
00034 Measurement1D 
00035 VertexDistance::distance(const Vertex & vtx1, const Vertex & vtx2) const
00036 {
00037   return distance(GlobalPoint(Basic3DVector<float> (vtx1.position())), 
00038                   GlobalError(vtx1.covariance()),
00039                   GlobalPoint(Basic3DVector<float> (vtx2.position())), 
00040                   GlobalError(vtx2.covariance()));
00041 }
00042 
00043 
00044 float VertexDistance::compatibility(const VertexState & vtx1, 
00045                                       const VertexState & vtx2) const
00046 {
00047   return compatibility(vtx1.position(), vtx1.error(),
00048                        vtx2.position(), vtx2.error());
00049 }
00050 
00051 float VertexDistance::compatibility(const Vertex & vtx1, 
00052                                       const VertexState & vtx2) const
00053 {
00054   return compatibility(GlobalPoint(Basic3DVector<float> (vtx1.position())), 
00055                        GlobalError(vtx1.covariance()),
00056                        vtx2.position(), vtx2.error());
00057 }
00058 
00059 float VertexDistance::compatibility(const VertexState & vtx1, 
00060                                       const Vertex & vtx2) const
00061 {
00062   return compatibility(vtx1.position(), vtx1.error(),
00063                   GlobalPoint(Basic3DVector<float> (vtx2.position())), 
00064                   GlobalError(vtx2.covariance()));
00065 }
00066 
00067 
00068 float VertexDistance::compatibility(const Vertex & vtx1, 
00069                                       const Vertex & vtx2) const
00070 {
00071   return compatibility(GlobalPoint(Basic3DVector<float> (vtx1.position())), 
00072                        GlobalError(vtx1.covariance()),
00073                        GlobalPoint(Basic3DVector<float> (vtx2.position())), 
00074                        GlobalError(vtx2.covariance()));
00075 }