Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:52:55

0001 #include "DataFormats/Candidate/interface/VertexCompositeCandidate.h"
0002 
0003 using namespace reco;
0004 
0005 VertexCompositeCandidate::VertexCompositeCandidate(Charge q,
0006                                                    const LorentzVector& p4,
0007                                                    const Point& vtx,
0008                                                    const CovarianceMatrix& err,
0009                                                    double chi2,
0010                                                    double ndof,
0011                                                    int pdgId,
0012                                                    int status,
0013                                                    bool integerCharge)
0014     : CompositeCandidate(q, p4, vtx, pdgId, status, integerCharge), chi2_(chi2), ndof_(ndof) {
0015   setCovariance(err);
0016 }
0017 
0018 VertexCompositeCandidate::~VertexCompositeCandidate() {}
0019 
0020 VertexCompositeCandidate* VertexCompositeCandidate::clone() const { return new VertexCompositeCandidate(*this); }
0021 
0022 void VertexCompositeCandidate::fillVertexCovariance(CovarianceMatrix& err) const {
0023   index idx = 0;
0024   for (index i = 0; i < dimension; ++i)
0025     for (index j = 0; j <= i; ++j)
0026       err(i, j) = covariance_[idx++];
0027 }
0028 
0029 void VertexCompositeCandidate::setCovariance(const CovarianceMatrix& err) {
0030   index idx = 0;
0031   for (index i = 0; i < dimension; ++i)
0032     for (index j = 0; j <= i; ++j)
0033       covariance_[idx++] = err(i, j);
0034 }