CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/RecoVertex/VertexPrimitives/interface/CachingVertex.h

Go to the documentation of this file.
00001 #ifndef CachingVertex_H
00002 #define CachingVertex_H
00003 
00004 #include "DataFormats/GeometryVector/interface/GlobalPoint.h"
00005 #include "DataFormats/GeometryCommonDetAlgo/interface/GlobalError.h"
00006 #include "DataFormats/GeometryCommonDetAlgo/interface/GlobalWeight.h"
00007 
00008 #include "RecoVertex/VertexPrimitives/interface/VertexState.h"
00009 #include "RecoVertex/VertexPrimitives/interface/TransientVertex.h"
00010 
00011 #include "DataFormats/GeometrySurface/interface/ReferenceCounted.h"
00012 #include "RecoVertex/VertexPrimitives/interface/VertexTrack.h"
00013 
00014 #include <vector>
00015 #include <map>
00016 
00017 
00018 
00024 template <unsigned int N>
00025 class CachingVertex {
00026 
00027 public:
00028 
00029   typedef ReferenceCountingPointer<VertexTrack<N> > RefCountedVertexTrack;
00030   typedef ROOT::Math::SMatrix<double,N,N,ROOT::Math::MatRepSym<double,N> > AlgebraicSymMatrixNN;
00031   typedef ROOT::Math::SMatrix<double,N-2,N-2,ROOT::Math::MatRepStd<double,N-2,N-2> > AlgebraicMatrixMM;
00032   typedef std::map<RefCountedVertexTrack, AlgebraicMatrixMM > TrackMap;
00033   typedef std::map<RefCountedVertexTrack, TrackMap > TrackToTrackMap;
00034 
00037   CachingVertex(const GlobalPoint & pos, const GlobalError & posErr, 
00038                 const std::vector<RefCountedVertexTrack> & tks, float totalChiSq);
00039 
00040   CachingVertex(const GlobalPoint & pos, const GlobalWeight & posWeight, 
00041                 const std::vector<RefCountedVertexTrack> & tks, float totalChiSq);
00042 
00043   CachingVertex(const AlgebraicVector3 & weightTimesPosition, 
00044                 const GlobalWeight & posWeight, 
00045                 const std::vector<RefCountedVertexTrack> & tks, 
00046                 float totalChiSq);
00047 
00048   CachingVertex(const GlobalPoint & priorPos, const GlobalError & priorErr,
00049                 const GlobalPoint & pos, const GlobalError & posErr, 
00050                 const std::vector<RefCountedVertexTrack> & tks, float totalChiSq);
00051 
00052   CachingVertex(const GlobalPoint & priorPos, const GlobalError & priorErr,
00053                 const GlobalPoint & pos, const GlobalWeight & posWeight, 
00054                 const std::vector<RefCountedVertexTrack> & tks, float totalChiSq);
00055 
00056   CachingVertex(const GlobalPoint & priorPos, const GlobalError & priorErr,
00057                 const AlgebraicVector3 & weightTimesPosition, 
00058                 const GlobalWeight & posWeight, 
00059                 const std::vector<RefCountedVertexTrack> & tks, 
00060                 float totalChiSq);
00061 
00062 
00063   CachingVertex(const VertexState & aVertexState, 
00064                 const std::vector<RefCountedVertexTrack> & tks, float totalChiSq);
00065 
00066   CachingVertex(const VertexState & priorVertexState, 
00067                 const VertexState & aVertexState,
00068                 const std::vector<RefCountedVertexTrack> & tks, float totalChiSq);
00069 
00070   CachingVertex(const VertexState & aVertexState,
00071                 const std::vector<RefCountedVertexTrack> & tks, 
00072                 float totalChiSq, const TrackToTrackMap & covMap);
00073 
00074   CachingVertex(const VertexState & priorVertexState, 
00075                 const VertexState & aVertexState,
00076                 const std::vector<RefCountedVertexTrack> & tks, 
00077                 float totalChiSq, const TrackToTrackMap & covMap);
00078 
00081   CachingVertex();
00082 
00085   VertexState vertexState() const {return theVertexState;}
00086   VertexState priorVertexState() const {return thePriorVertexState;}
00087   GlobalPoint position() const;
00088   GlobalError error() const;
00089   GlobalWeight weight() const;
00090   AlgebraicVector3 weightTimesPosition() const;
00091   std::vector<RefCountedVertexTrack> tracks() const { return theTracks; }
00092   const std::vector<RefCountedVertexTrack> &tracksRef() const { return theTracks; }
00093   GlobalPoint priorPosition() const {return priorVertexState().position();}
00094   GlobalError priorError() const {return priorVertexState().error();}
00095   bool hasPrior() const {return withPrior;}
00096   bool isValid() const {return theValid;}
00097 
00100   float totalChiSquared() const { return theChiSquared; }
00101   float degreesOfFreedom() const;
00102 
00105   AlgebraicMatrixMM tkToTkCovariance(const RefCountedVertexTrack t1, 
00106                                    const RefCountedVertexTrack t2) const;
00107   bool tkToTkCovarianceIsAvailable() const { return theCovMapAvailable; }
00108 
00109   operator TransientVertex() const;
00110 
00111 private:
00112 
00113   void computeNDF() const;
00114 
00115   mutable VertexState theVertexState;
00116   float theChiSquared;
00117   mutable float theNDF;
00118   mutable bool theNDFAvailable;
00119   std::vector<RefCountedVertexTrack> theTracks;
00120   TrackToTrackMap theCovMap;
00121   bool theCovMapAvailable;
00122   mutable VertexState thePriorVertexState;
00123   bool withPrior;
00124 
00125   bool theValid;
00126 };
00127 
00128 
00129 #endif