Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:28:25

0001 #ifndef VertexTrackFactory_H
0002 #define VertexTrackFactory_H
0003 
0004 #include "DataFormats/GeometrySurface/interface/ReferenceCounted.h"
0005 #include "RecoVertex/VertexPrimitives/interface/VertexTrack.h"
0006 #include "RecoVertex/VertexPrimitives/interface/LinearizedTrackState.h"
0007 
0008 /** 
0009  *  Concrete class to encapsulate the creation of a RefCountedVertexTrack, 
0010  *  which is a reference-counting pointer. 
0011  *  Should always be used in order to create a new RefCountedVertexTrack, 
0012  *  so that the reference-counting mechanism works well. 
0013  */
0014 
0015 template <unsigned int N>
0016 class VertexTrackFactory {
0017 public:
0018   typedef ReferenceCountingPointer<RefittedTrackState<N> > RefCountedRefittedTrackState;
0019   typedef ReferenceCountingPointer<VertexTrack<N> > RefCountedVertexTrack;
0020   typedef ReferenceCountingPointer<LinearizedTrackState<N> > RefCountedLinearizedTrackState;
0021   typedef ROOT::Math::SMatrix<double, 3, N - 2, ROOT::Math::MatRepStd<double, 3, N - 2> > AlgebraicMatrix3M;
0022   typedef ROOT::Math::SMatrix<double, N + 1, N + 1, ROOT::Math::MatRepSym<double, N + 1> > AlgebraicSymMatrixOO;
0023 
0024   VertexTrackFactory() {}
0025   ~VertexTrackFactory() {}
0026 
0027   RefCountedVertexTrack vertexTrack(const RefCountedLinearizedTrackState lt,
0028                                     const VertexState vs,
0029                                     float weight = 1.0) const {
0030     return RefCountedVertexTrack(new VertexTrack<N>(lt, vs, weight));
0031   };
0032 
0033   RefCountedVertexTrack vertexTrack(const RefCountedLinearizedTrackState lt,
0034                                     const VertexState vs,
0035                                     const RefCountedRefittedTrackState& refittedState,
0036                                     float smoothedChi2,
0037                                     float weight = 1.0) const {
0038     return RefCountedVertexTrack(new VertexTrack<N>(lt, vs, weight, refittedState, smoothedChi2));
0039   };
0040 
0041   RefCountedVertexTrack vertexTrack(const RefCountedLinearizedTrackState lt,
0042                                     const VertexState vs,
0043                                     const RefCountedRefittedTrackState& refittedState,
0044                                     float smoothedChi2,
0045                                     const AlgebraicSymMatrixOO& tVCov,
0046                                     float weight = 1.0) const {
0047     return RefCountedVertexTrack(new VertexTrack<N>(lt, vs, weight, refittedState, smoothedChi2, tVCov));
0048   };
0049 };
0050 
0051 #endif