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 
15 
16 namespace reco {
18  public:
22  int pdgId = 0, int status = 0, bool integerCharge = true) :
23  CompositeCandidate(q, p4, vtx, pdgId, status, integerCharge),
24  chi2_(0), ndof_(0) { }
26  VertexCompositeCandidate(Charge q, const LorentzVector & p4, const Point & vtx,
27  const CovarianceMatrix & err, double chi2, double ndof,
28  int pdgId = 0, int status = 0, bool integerCharge = true);
30  explicit VertexCompositeCandidate(const Candidate & p) :
31  CompositeCandidate(p), chi2_(0), ndof_(0) { }
34  CompositeCandidate(p), chi2_(0), ndof_(0) { }
36  virtual ~VertexCompositeCandidate();
38  virtual VertexCompositeCandidate * clone() const;
40  virtual double vertexChi2() const { return chi2_; }
47  virtual double vertexNdof() const { return ndof_; }
49  virtual double vertexNormalizedChi2() const { return chi2_ / ndof_; }
51  virtual double vertexCovariance(int i, int j) const {
52  return covariance_[idx(i, j)];
53  }
54  using reco::LeafCandidate::vertexCovariance; // avoid hiding the
56  virtual void fillVertexCovariance(CovarianceMatrix & v) const;
58  void setChi2AndNdof(double chi2, double ndof) {
59  chi2_ = chi2; ndof_ = ndof;
60  }
62  void setCovariance(const CovarianceMatrix &m);
63  private:
65  Double32_t chi2_;
67  Double32_t ndof_;
69  Double32_t covariance_[size];
71  index idx(index i, index j) const {
72  int a = (i <= j ? i : j), b = (i <= j ? j : i);
73  return b * (b + 1)/2 + a;
74  }
75  };
76 
77 }
78 
79 #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