CMS 3D CMS Logo

VertexCompositeCandidate.h
Go to the documentation of this file.
1 #ifndef DataFormats_Candidate_VertexCompositeCandidate_H
2 #define DataFormats_Candidate_VertexCompositeCandidate_H
3 
14 
15 namespace reco {
17  public:
21  Charge q, const LorentzVector &p4, const Point &vtx, int pdgId = 0, int status = 0, bool integerCharge = true)
22  : CompositeCandidate(q, p4, vtx, pdgId, status, integerCharge), chi2_(0), ndof_(0) {}
25  const LorentzVector &p4,
26  const Point &vtx,
27  const CovarianceMatrix &err,
28  double chi2,
29  double ndof,
30  int pdgId = 0,
31  int status = 0,
32  bool integerCharge = true);
38  ~VertexCompositeCandidate() override;
40  VertexCompositeCandidate *clone() const override;
42  double vertexChi2() const override { return chi2_; }
49  double vertexNdof() const override { return ndof_; }
51  double vertexNormalizedChi2() const override { return chi2_ / ndof_; }
53  double vertexCovariance(int i, int j) const override { return covariance_[idx(i, j)]; }
54  using reco::LeafCandidate::vertexCovariance; // avoid hiding the
56  void fillVertexCovariance(CovarianceMatrix &v) const override;
58  void setChi2AndNdof(double chi2, double ndof) {
59  chi2_ = chi2;
60  ndof_ = ndof;
61  }
63  void setCovariance(const CovarianceMatrix &m);
64 
65  private:
67  Double32_t chi2_;
69  Double32_t ndof_;
71  Double32_t covariance_[size];
73  index idx(index i, index j) const {
74  int a = (i <= j ? i : j), b = (i <= j ? j : i);
75  return b * (b + 1) / 2 + a;
76  }
77  };
78 
79 } // namespace reco
80 
81 #endif
int Charge
electric charge type
Definition: Candidate.h:34
double vertexChi2() const override
chi-squares
void fillVertexCovariance(CovarianceMatrix &v) const override
fill SMatrix
VertexCompositeCandidate(const CompositeCandidate &p)
constructor from values
VertexCompositeCandidate(const Candidate &p)
constructor from values
int status() const final
status word
const LorentzVector & p4() const final
four-momentum Lorentz vector
Double32_t ndof_
number of degrees of freedom
int pdgId() const final
PDG identifier.
void setChi2AndNdof(double chi2, double ndof)
set chi2 and ndof
double p() const final
magnitude of momentum vector
VertexCompositeCandidate * clone() const override
returns a clone of the candidate
void setCovariance(const CovarianceMatrix &m)
set covariance matrix
math::XYZTLorentzVector LorentzVector
VertexCompositeCandidate(Charge q, const LorentzVector &p4, const Point &vtx, int pdgId=0, int status=0, bool integerCharge=true)
constructor from values
unsigned int index
index type
Definition: Candidate.h:50
Double32_t covariance_[size]
covariance matrix (3x3) as vector
CovarianceMatrix vertexCovariance() const final
return SMatrix
double b
Definition: hdecay.h:118
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:36
fixed size matrix
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:57
double a
Definition: hdecay.h:119
index idx(index i, index j) const
position index
double vertexNormalizedChi2() const override
chi-squared divided by n.d.o.f.
~VertexCompositeCandidate() override
destructor
double vertexCovariance(int i, int j) const override
(i, j)-th element of error matrix, i, j = 0, ... 2
int Charge
electric charge type
Definition: LeafCandidate.h:21