CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
VertexCompositePtrCandidate.h
Go to the documentation of this file.
1 #ifndef DataFormats_Candidate_VertexCompositePtrCandidate_H
2 #define DataFormats_Candidate_VertexCompositePtrCandidate_H
3 
14 
15 namespace reco {
17  public:
21  int pdgId = 0, int status = 0, bool integerCharge = true) :
22  CompositePtrCandidate(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);
30  CompositePtrCandidate(p), chi2_(0), ndof_(0) { }
33  CompositePtrCandidate(p), chi2_(0), ndof_(0) { }
37  virtual VertexCompositePtrCandidate * clone() const;
39  virtual double vertexChi2() const { return chi2_; }
46  virtual double vertexNdof() const { return ndof_; }
48  virtual double vertexNormalizedChi2() const { return chi2_ / ndof_; }
50  virtual double vertexCovariance(int i, int j) const {
51  return covariance_[idx(i, j)];
52  }
53  using reco::LeafCandidate::vertexCovariance; // avoid hiding the
55  virtual void fillVertexCovariance(CovarianceMatrix & v) const;
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 Charge
electric charge type
Definition: Candidate.h:39
int i
Definition: DBlmapReader.cc:9
virtual void fillVertexCovariance(CovarianceMatrix &v) const
fill SMatrix
virtual double vertexChi2() const
chi-squares
virtual double p() const GCC11_FINAL
magnitude of momentum vector
virtual const LorentzVector & p4() const GCC11_FINAL
four-momentum Lorentz vector
virtual int pdgId() const GCC11_FINAL
PDG identifier.
Double32_t ndof_
number of degrees of freedom
math::XYZTLorentzVector LorentzVector
virtual double vertexCovariance(int i, int j) const
(i, j)-th element of error matrix, i, j = 0, ... 2
VertexCompositePtrCandidate(const Candidate &p)
constructor from values
virtual int status() const GCC11_FINAL
status word
math::XYZPoint Point
index idx(index i, index j) const
position index
int j
Definition: DBlmapReader.cc:9
VertexCompositePtrCandidate(const CompositePtrCandidate &p)
constructor from values
unsigned int index
index type
Definition: Candidate.h:55
CovarianceMatrix vertexCovariance() const GCC11_FINAL
return SMatrix
double b
Definition: hdecay.h:120
Double32_t covariance_[size]
covariance matrix (3x3) as vector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:41
double a
Definition: hdecay.h:121
void setCovariance(const CovarianceMatrix &m)
set covariance matrix
math::XYZPoint Point
point in the space
Definition: Candidate.h:45
void setChi2AndNdof(double chi2, double ndof)
set chi2 and ndof
virtual double vertexNormalizedChi2() const
chi-squared divided by n.d.o.f.
virtual VertexCompositePtrCandidate * clone() const
returns a clone of the candidate
int Charge
electric charge type
Definition: LeafCandidate.h:24
VertexCompositePtrCandidate(Charge q, const LorentzVector &p4, const Point &vtx, int pdgId=0, int status=0, bool integerCharge=true)
constructor from values