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  int pdgId = 0, int status = 0, bool integerCharge = true) :
22  CompositeCandidate(q, p4, vtx, pdgId, status, integerCharge),
23  chi2_(0), ndof_(0) { }
26  const CovarianceMatrix & err, double chi2, double ndof,
27  int pdgId = 0, int status = 0, bool integerCharge = true);
29  explicit VertexCompositeCandidate(const Candidate & p) :
30  CompositeCandidate(p), chi2_(0), ndof_(0) { }
33  CompositeCandidate(p), chi2_(0), ndof_(0) { }
35  ~VertexCompositeCandidate() override;
37  VertexCompositeCandidate * clone() const override;
39  double vertexChi2() const override { return chi2_; }
46  double vertexNdof() const override { return ndof_; }
48  double vertexNormalizedChi2() const override { return chi2_ / ndof_; }
50  double vertexCovariance(int i, int j) const override {
51  return covariance_[idx(i, j)];
52  }
53  using reco::LeafCandidate::vertexCovariance; // avoid hiding the
55  void fillVertexCovariance(CovarianceMatrix & v) const override;
57  void setChi2AndNdof(double chi2, double ndof) {
58  chi2_ = chi2; ndof_ = ndof;
59  }
61  void setCovariance(const CovarianceMatrix &m);
62  private:
64  Double32_t chi2_;
66  Double32_t ndof_;
68  Double32_t covariance_[size];
70  index idx(index i, index j) const {
71  int a = (i <= j ? i : j), b = (i <= j ? j : i);
72  return b * (b + 1)/2 + a;
73  }
74  };
75 
76 }
77 
78 #endif
int pdgId() const final
PDG identifier.
int Charge
electric charge type
Definition: Candidate.h:35
double vertexChi2() const override
chi-squares
VertexCompositeCandidate(const CompositeCandidate &p)
constructor from values
double vertexCovariance(int i, int j) const override
(i, j)-th element of error matrix, i, j = 0, ... 2
VertexCompositeCandidate(const Candidate &p)
constructor from values
Double32_t ndof_
number of degrees of freedom
void setChi2AndNdof(double chi2, double ndof)
set chi2 and ndof
void fillVertexCovariance(CovarianceMatrix &v) const override
fill SMatrix
CovarianceMatrix vertexCovariance() const final
return SMatrix
VertexCompositeCandidate * clone() const override
returns a clone of the candidate
void setCovariance(const CovarianceMatrix &m)
set covariance matrix
index idx(index i, index j) const
position index
const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
VertexCompositeCandidate(Charge q, const LorentzVector &p4, const Point &vtx, int pdgId=0, int status=0, bool integerCharge=true)
constructor from values
double p() const final
magnitude of momentum vector
unsigned int index
index type
Definition: Candidate.h:51
Double32_t covariance_[size]
covariance matrix (3x3) as vector
double vertexNormalizedChi2() const override
chi-squared divided by n.d.o.f.
double b
Definition: hdecay.h:120
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
fixed size matrix
double a
Definition: hdecay.h:121
int status() const final
status word
math::XYZPoint Point
point in the space
Definition: Candidate.h:41
~VertexCompositeCandidate() override
destructor