File indexing completed on 2024-04-06 12:03:49
0001 #ifndef DataFormats_Candidate_VertexCompositeCandidate_H
0002 #define DataFormats_Candidate_VertexCompositeCandidate_H
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include "DataFormats/Candidate/interface/VertexCompositeCandidateFwd.h"
0013 #include "DataFormats/Candidate/interface/CompositeCandidate.h"
0014
0015 namespace reco {
0016 class VertexCompositeCandidate : public CompositeCandidate {
0017 public:
0018 VertexCompositeCandidate() : CompositeCandidate() {}
0019
0020 VertexCompositeCandidate(
0021 Charge q, const LorentzVector &p4, const Point &vtx, int pdgId = 0, int status = 0, bool integerCharge = true)
0022 : CompositeCandidate(q, p4, vtx, pdgId, status, integerCharge), chi2_(0), ndof_(0) {}
0023
0024 VertexCompositeCandidate(Charge q,
0025 const LorentzVector &p4,
0026 const Point &vtx,
0027 const CovarianceMatrix &err,
0028 double chi2,
0029 double ndof,
0030 int pdgId = 0,
0031 int status = 0,
0032 bool integerCharge = true);
0033
0034 explicit VertexCompositeCandidate(const Candidate &p) : CompositeCandidate(p), chi2_(0), ndof_(0) {}
0035
0036 explicit VertexCompositeCandidate(const CompositeCandidate &p) : CompositeCandidate(p), chi2_(0), ndof_(0) {}
0037
0038 ~VertexCompositeCandidate() override;
0039
0040 VertexCompositeCandidate *clone() const override;
0041
0042 double vertexChi2() const override { return chi2_; }
0043
0044
0045
0046
0047
0048
0049 double vertexNdof() const override { return ndof_; }
0050
0051 double vertexNormalizedChi2() const override { return chi2_ / ndof_; }
0052
0053 double vertexCovariance(int i, int j) const override { return covariance_[idx(i, j)]; }
0054 using reco::LeafCandidate::vertexCovariance;
0055
0056 void fillVertexCovariance(CovarianceMatrix &v) const override;
0057
0058 void setChi2AndNdof(double chi2, double ndof) {
0059 chi2_ = chi2;
0060 ndof_ = ndof;
0061 }
0062
0063 void setCovariance(const CovarianceMatrix &m);
0064
0065 private:
0066
0067 Double32_t chi2_;
0068
0069 Double32_t ndof_;
0070
0071 Double32_t covariance_[size];
0072
0073 index idx(index i, index j) const {
0074 int a = (i <= j ? i : j), b = (i <= j ? j : i);
0075 return b * (b + 1) / 2 + a;
0076 }
0077 };
0078
0079 }
0080
0081 #endif