CMS 3D CMS Logo

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 
65  const Point & position() const {return vertex();}
66  Error error() const { Error m; fillVertexCovariance( m ); return m; }
67 
68  private:
70  Double32_t chi2_;
72  Double32_t ndof_;
74  Double32_t covariance_[size];
76  index idx(index i, index j) const {
77  int a = (i <= j ? i : j), b = (i <= j ? j : i);
78  return b * (b + 1)/2 + a;
79  }
80  };
81 
82 }
83 
84 #endif
int Charge
electric charge type
Definition: Candidate.h:35
virtual void fillVertexCovariance(CovarianceMatrix &v) const
fill SMatrix
virtual double vertexChi2() const
chi-squares
virtual const Point & vertex() const
vertex position (overwritten by PF...)
Double32_t ndof_
number of degrees of freedom
math::Error< dimension >::type Error
the following functions are implemented to have a more consistent interface with the one of reco::Ver...
ErrorD< N >::type type
Definition: Error.h:33
virtual int status() const final
status word
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
CovarianceMatrix vertexCovariance() const final
return SMatrix
virtual int pdgId() const final
PDG identifier.
index idx(index i, index j) const
position index
virtual double p() const final
magnitude of momentum vector
VertexCompositePtrCandidate(const CompositePtrCandidate &p)
constructor from values
unsigned int index
index type
Definition: Candidate.h:51
double b
Definition: hdecay.h:120
Double32_t covariance_[size]
covariance matrix (3x3) as vector
math::XYZTLorentzVector LorentzVector
Lorentz vector.
Definition: Candidate.h:37
fixed size matrix
double a
Definition: hdecay.h:121
void setCovariance(const CovarianceMatrix &m)
set covariance matrix
math::XYZPoint Point
point in the space
Definition: Candidate.h:41
void setChi2AndNdof(double chi2, double ndof)
set chi2 and ndof
virtual const LorentzVector & p4() const final
four-momentum Lorentz vector
Definition: LeafCandidate.h:99
virtual double vertexNormalizedChi2() const
chi-squared divided by n.d.o.f.
virtual VertexCompositePtrCandidate * clone() const
returns a clone of the candidate
VertexCompositePtrCandidate(Charge q, const LorentzVector &p4, const Point &vtx, int pdgId=0, int status=0, bool integerCharge=true)
constructor from values