Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:29:07

0001 #ifndef GsfVertexFitter_H
0002 #define GsfVertexFitter_H
0003 
0004 #include "RecoVertex/VertexPrimitives/interface/VertexFitter.h"
0005 // #include "RecoVertex/VertexPrimitives/interface/VertexSmoother.h"
0006 // #include "RecoVertex/GaussianSumVertexFit/interface/GsfVertexUpdator.h"
0007 // #include "RecoVertex/VertexTools/interface/VertexTrackFactory.h"
0008 #include "RecoVertex/LinearizationPointFinders/interface/DefaultLinearizationPointFinder.h"
0009 // #include "RecoVertex/GaussianSumVertexFit/interface/GsfVertexMerger.h"
0010 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0011 // #include "DataFormats/GeometryCommonDetAlgo/interface/DeepCopyPointerByClone.h"
0012 #include "RecoVertex/VertexTools/interface/SequentialVertexFitter.h"
0013 
0014 /** 
0015  * Sequential vertex fitter, to be used with the Gaussian Sum Vertex Filter
0016  * After the vertes fit, the tracks can be refit with the additional 
0017  * constraint of the vertex position.
0018  */
0019 
0020 class GsfVertexFitter : public VertexFitter<5> {
0021 public:
0022   typedef CachingVertex<5>::RefCountedVertexTrack RefCountedVertexTrack;
0023 
0024   /** Default constructor, using the given linearization point finder.
0025    *  \param linP   The LinearizationPointFinder to use
0026    *  \param useSmoothing  Specifies whether the tracks sould be refit.
0027    */
0028 
0029   GsfVertexFitter(const edm::ParameterSet& pSet,
0030                   const LinearizationPointFinder& linP = DefaultLinearizationPointFinder());
0031 
0032   ~GsfVertexFitter() override;
0033 
0034   /**
0035    * Copy constructor
0036    */
0037 
0038   GsfVertexFitter(const GsfVertexFitter& original);
0039 
0040   GsfVertexFitter* clone() const override { return new GsfVertexFitter(*this); }
0041 
0042 public:
0043   /** Fit vertex out of a set of RecTracks
0044    */
0045   inline CachingVertex<5> vertex(const std::vector<reco::TransientTrack>& tracks) const override {
0046     return theSequentialFitter->vertex(tracks);
0047   }
0048 
0049   /** Fit vertex out of a set of VertexTracks
0050    */
0051   inline CachingVertex<5> vertex(const std::vector<RefCountedVertexTrack>& tracks) const override {
0052     return theSequentialFitter->vertex(tracks);
0053   }
0054 
0055   /** Fit vertex out of a set of RecTracks. 
0056    *  Uses the specified linearization point.
0057    */
0058   inline CachingVertex<5> vertex(const std::vector<reco::TransientTrack>& tracks,
0059                                  const GlobalPoint& linPoint) const override {
0060     return theSequentialFitter->vertex(tracks, linPoint);
0061   }
0062 
0063   /** Fit vertex out of a set of RecTracks. 
0064    *  Uses the specified point as both the linearization point AND as prior
0065    *  estimate of the vertex position. The error is used for the 
0066    *  weight of the prior estimate.
0067    */
0068   inline CachingVertex<5> vertex(const std::vector<reco::TransientTrack>& tracks,
0069                                  const GlobalPoint& priorPos,
0070                                  const GlobalError& priorError) const override {
0071     return theSequentialFitter->vertex(tracks, priorPos, priorError);
0072   }
0073 
0074   /** Fit vertex out of a set of TransientTracks. 
0075    *  The specified BeamSpot will be used as priot, but NOT for the linearization.
0076    * The specified LinearizationPointFinder will be used to find the linearization point.
0077    */
0078   inline CachingVertex<5> vertex(const std::vector<reco::TransientTrack>& tracks,
0079                                  const reco::BeamSpot& beamSpot) const override {
0080     return theSequentialFitter->vertex(tracks, beamSpot);
0081   }
0082 
0083   inline CachingVertex<5> vertex(const std::vector<RefCountedVertexTrack>& tracks,
0084                                  const reco::BeamSpot& spot) const override {
0085     return theSequentialFitter->vertex(tracks, spot);
0086   }
0087 
0088   /** Fit vertex out of a set of VertexTracks.
0089    *  Uses the specified point and error as the prior estimate of the vertex.
0090    *  This position is not used to relinearize the tracks.
0091    */
0092   inline CachingVertex<5> vertex(const std::vector<RefCountedVertexTrack>& tracks,
0093                                  const GlobalPoint& priorPos,
0094                                  const GlobalError& priorError) const override {
0095     return theSequentialFitter->vertex(tracks, priorPos, priorError);
0096   }
0097 
0098 private:
0099   SequentialVertexFitter<5>* theSequentialFitter;
0100 };
0101 
0102 #endif