CMS 3D CMS Logo

SequentialPrimaryVertexFitterAdapter.h
Go to the documentation of this file.
1 #ifndef SequentialPrimaryVertexFitterAdapter_h
2 #define SequentialPrimaryVertexFitterAdapter_h
3 
14 
16 public:
18  SequentialPrimaryVertexFitterAdapter(const VertexFitter<5>* vertex_fitter) : fitter(vertex_fitter) {}
19  ~SequentialPrimaryVertexFitterAdapter() override = default;
20 
21  std::vector<TransientVertex> fit(const std::vector<reco::TransientTrack>& dummy,
22  const std::vector<TransientVertex>& clusters,
23  const reco::BeamSpot& beamspot,
24  const bool useBeamConstraint) override {
25  std::vector<TransientVertex> pvs;
26  for (auto& cluster : clusters) {
27  const std::vector<reco::TransientTrack>& tracklist = cluster.originalTracks();
29  if (useBeamConstraint && (tracklist.size() > 1)) {
30  v = fitter->vertex(tracklist, beamspot);
31  } else if (!(useBeamConstraint) && (tracklist.size() > 1)) {
32  v = fitter->vertex(tracklist);
33  } // else: no fit ==> v.isValid()=False
34 
35  if (v.isValid()) {
36  pvs.push_back(v);
37  }
38  }
39  return pvs;
40  };
41 
42 protected:
43  // configuration
44  const VertexFitter<5>* fitter; // Kalman or Adaptive
45 };
46 #endif
SequentialPrimaryVertexFitterAdapter(const VertexFitter< 5 > *vertex_fitter)
virtual CachingVertex< N > vertex(const std::vector< reco::TransientTrack > &tracks) const =0
std::vector< TransientVertex > fit(const std::vector< reco::TransientTrack > &dummy, const std::vector< TransientVertex > &clusters, const reco::BeamSpot &beamspot, const bool useBeamConstraint) override
~SequentialPrimaryVertexFitterAdapter() override=default