CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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) { }
25  VertexCompositeCandidate(Charge q, const LorentzVector & p4, const Point & vtx,
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  virtual ~VertexCompositeCandidate();
37  virtual VertexCompositeCandidate * 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 double vertexNormalizedChi2() const
chi-squared divided by n.d.o.f.
VertexCompositeCandidate(const CompositeCandidate &p)
constructor from values
VertexCompositeCandidate(const Candidate &p)
constructor from values
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.
math::XYZTLorentzVector LorentzVector
virtual ~VertexCompositeCandidate()
destructor
Double32_t ndof_
number of degrees of freedom
void setChi2AndNdof(double chi2, double ndof)
set chi2 and ndof
virtual double vertexChi2() const
chi-squares
virtual VertexCompositeCandidate * clone() const
returns a clone of the candidate
virtual int status() const GCC11_FINAL
status word
void setCovariance(const CovarianceMatrix &m)
set covariance matrix
math::XYZPoint Point
int j
Definition: DBlmapReader.cc:9
index idx(index i, index j) const
position index
VertexCompositeCandidate(Charge q, const LorentzVector &p4, const Point &vtx, int pdgId=0, int status=0, bool integerCharge=true)
constructor from values
virtual double vertexCovariance(int i, int j) const
(i, j)-th element of error matrix, i, j = 0, ... 2
unsigned int index
index type
Definition: Candidate.h:55
Double32_t covariance_[size]
covariance matrix (3x3) as vector
CovarianceMatrix vertexCovariance() const GCC11_FINAL
return SMatrix
double b
Definition: hdecay.h:120
virtual void fillVertexCovariance(CovarianceMatrix &v) const
fill SMatrix
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:41
double a
Definition: hdecay.h:121
math::XYZPoint Point
point in the space
Definition: Candidate.h:45
int Charge
electric charge type
Definition: LeafCandidate.h:24