CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2_patch1/src/DataFormats/Candidate/interface/VertexCompositeCandidate.h

Go to the documentation of this file.
00001 #ifndef DataFormats_Candidate_VertexCompositeCandidate_H
00002 #define DataFormats_Candidate_VertexCompositeCandidate_H
00003 
00013 #include "DataFormats/Candidate/interface/VertexCompositeCandidateFwd.h"
00014 #include "DataFormats/Candidate/interface/CompositeCandidate.h"
00015 
00016 namespace reco {
00017   class VertexCompositeCandidate : public CompositeCandidate {
00018   public:
00019     VertexCompositeCandidate() : CompositeCandidate() { }
00021     VertexCompositeCandidate(Charge q, const LorentzVector & p4, const Point & vtx,
00022                              int pdgId = 0, int status = 0, bool integerCharge = true) :
00023       CompositeCandidate(q, p4, vtx, pdgId, status, integerCharge),
00024       chi2_(0), ndof_(0) { }
00026     VertexCompositeCandidate(Charge q, const LorentzVector & p4, const Point & vtx,
00027                              const CovarianceMatrix & err, double chi2, double ndof,
00028                              int pdgId = 0, int status = 0, bool integerCharge = true);
00030     explicit VertexCompositeCandidate(const Candidate & p) :
00031       CompositeCandidate(p), chi2_(0), ndof_(0) { }
00033     explicit VertexCompositeCandidate(const CompositeCandidate & p) :
00034       CompositeCandidate(p), chi2_(0), ndof_(0) { }
00036     virtual ~VertexCompositeCandidate();
00038     virtual VertexCompositeCandidate * clone() const;
00040     virtual double vertexChi2() const { return chi2_; }
00047     virtual double vertexNdof() const { return ndof_; }
00049     virtual double vertexNormalizedChi2() const { return chi2_ / ndof_; }
00051     virtual double vertexCovariance(int i, int j) const { 
00052       return covariance_[idx(i, j)]; 
00053     }
00054     using reco::LeafCandidate::vertexCovariance; // avoid hiding the
00056     virtual void fillVertexCovariance(CovarianceMatrix & v) const;
00058     void setChi2AndNdof(double chi2, double ndof) {
00059       chi2_ = chi2; ndof_ = ndof;
00060     }
00062     void setCovariance(const CovarianceMatrix &m);
00063   private:
00065     Double32_t chi2_;
00067     Double32_t ndof_;
00069     Double32_t covariance_[size];
00071     index idx(index i, index j) const {
00072       int a = (i <= j ? i : j), b = (i <= j ? j : i);
00073       return b * (b + 1)/2 + a;
00074     }
00075   };
00076 
00077 }
00078 
00079 #endif