CMS 3D CMS Logo

CandCommonVertexFitter.h
Go to the documentation of this file.
1 #ifndef RecoCandUtils_CandCommonVertexFitter_h
2 #define RecoCandUtils_CandCommonVertexFitter_h
3 /* \class CandCommonVertexFitter
4  *
5  * \author Luca Lista, INFN
6  *
7  */
8 
13 #include <vector>
14 class MagneticField;
15 namespace reco {
16  class VertexCompositeCandidate;
17 }
18 
20 public:
24  void set(const MagneticField *bField) { bField_ = bField; }
25  void set(reco::VertexCompositeCandidate &) const;
26 
27 protected:
29  void fill(std::vector<reco::TransientTrack> &,
30  std::vector<reco::Candidate *> &,
31  std::vector<reco::RecoCandidate::TrackType> &,
32  reco::Candidate &) const;
33  virtual bool fit(TransientVertex &, const std::vector<reco::TransientTrack> &) const = 0;
35  mutable double chi2_;
37  mutable double ndof_;
40 };
41 
43 
44 template <typename Fitter>
46 public:
49  bool fit(TransientVertex &vertex, const std::vector<reco::TransientTrack> &tracks) const override {
50  try {
51  vertex = fitter_.vertex(tracks);
52  } catch (std::exception &err) {
53  std::cerr << ">>> exception thrown by KalmanVertexFitter:\n"
54  << err.what() << "\n"
55  << ">>> candidate not fitted to common vertex" << std::endl;
56  return false;
57  }
58  return vertex.isValid();
59  }
60 
61 private:
63 };
64 
65 #endif
CandCommonVertexFitter(const edm::ParameterSet &cfg)
S make(const edm::ParameterSet &cfg)
reco::Vertex::CovarianceMatrix CovarianceMatrix
bool fit(TransientVertex &vertex, const std::vector< reco::TransientTrack > &tracks) const override
void fill(std::vector< reco::TransientTrack > &, std::vector< reco::Candidate *> &, std::vector< reco::RecoCandidate::TrackType > &, reco::Candidate &) const
math::Error< dimension >::type CovarianceMatrix
covariance error matrix (3x3)
Definition: Vertex.h:46
CovarianceMatrix cov_
covariance matrix (3x3)
double ndof_
number of degrees of freedom
fixed size matrix
CandCommonVertexFitterBase(const edm::ParameterSet &)
virtual bool fit(TransientVertex &, const std::vector< reco::TransientTrack > &) const =0