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
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
modules
Definition: ZHLTMatchFilter.cc:17
HLTSiStripMonitoring_cff.Fitter
Fitter
Definition: HLTSiStripMonitoring_cff.py:207
CandCommonVertexFitterBase::ndof_
double ndof_
number of degrees of freedom
Definition: CandCommonVertexFitter.h:37
CovarianceMatrix
Definition: CovarianceMatrix.h:27
reco::Vertex::CovarianceMatrix
math::Error< dimension >::type CovarianceMatrix
covariance error matrix (3x3)
Definition: Vertex.h:46
reco::VertexCompositeCandidate
Definition: VertexCompositeCandidate.h:16
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
TransientTrack.h
RecoCandidate.h
CandCommonVertexFitterBase::fill
void fill(std::vector< reco::TransientTrack > &, std::vector< reco::Candidate * > &, std::vector< reco::RecoCandidate::TrackType > &, reco::Candidate &) const
Definition: CandCommonVertexFitter.cc:60
cppFunctionSkipper.exception
exception
Definition: cppFunctionSkipper.py:10
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
edm::ParameterSet
Definition: ParameterSet.h:36
CandCommonVertexFitterBase::CandCommonVertexFitterBase
CandCommonVertexFitterBase(const edm::ParameterSet &)
Definition: CandCommonVertexFitter.h:22
runTheMatrix.err
err
Definition: runTheMatrix.py:288
beam_dqm_sourceclient-live_cfg.cerr
cerr
Definition: beam_dqm_sourceclient-live_cfg.py:17
CandCommonVertexFitterBase::cov_
CovarianceMatrix cov_
covariance matrix (3x3)
Definition: CandCommonVertexFitter.h:39
CandCommonVertexFitter::CandCommonVertexFitter
CandCommonVertexFitter(const edm::ParameterSet &cfg)
Definition: CandCommonVertexFitter.h:47
TransientVertex
Definition: TransientVertex.h:18
CandCommonVertexFitterBase::fit
virtual bool fit(TransientVertex &, const std::vector< reco::TransientTrack > &) const =0
ParameterAdapter.h
reco::modules::make
S make(const edm::ParameterSet &cfg)
Definition: ParameterAdapter.h:21
looper.cfg
cfg
Definition: looper.py:297
reco::Candidate
Definition: Candidate.h:27
CandCommonVertexFitterBase::~CandCommonVertexFitterBase
virtual ~CandCommonVertexFitterBase()
Definition: CandCommonVertexFitter.h:23
CandCommonVertexFitterBase::CovarianceMatrix
reco::Vertex::CovarianceMatrix CovarianceMatrix
Definition: CandCommonVertexFitter.h:21
TransientVertex.h
Calorimetry_cff.bField
bField
Definition: Calorimetry_cff.py:292
CandCommonVertexFitter::fitter_
Fitter fitter_
Definition: CandCommonVertexFitter.h:62
ParameterSetfwd.h
CandCommonVertexFitterBase::bField_
const MagneticField * bField_
Definition: CandCommonVertexFitter.h:28
CandCommonVertexFitter::fit
bool fit(TransientVertex &vertex, const std::vector< reco::TransientTrack > &tracks) const override
Definition: CandCommonVertexFitter.h:49
CandCommonVertexFitterBase::set
void set(const MagneticField *bField)
Definition: CandCommonVertexFitter.h:24
CandCommonVertexFitterBase
Definition: CandCommonVertexFitter.h:19
CandCommonVertexFitterBase::chi2_
double chi2_
chi-sqared
Definition: CandCommonVertexFitter.h:35
CandCommonVertexFitter
Definition: CandCommonVertexFitter.h:45
MagneticField
Definition: MagneticField.h:19