Back to home page

Project CMSSW displayed by LXR

 
 

    


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

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