Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:54:53

0001 #include "DataFormats/TrackReco/interface/TrackExtra.h"
0002 #include "DataFormats/TrackReco/interface/fillCovariance.h"
0003 
0004 using namespace reco;
0005 
0006 TrackExtra::TrackExtra(const Point &outerPosition,
0007                        const Vector &outerMomentum,
0008                        bool ok,
0009                        const Point &innerPosition,
0010                        const Vector &innerMomentum,
0011                        bool iok,
0012                        const CovarianceMatrix &outerCov,
0013                        unsigned int outerId,
0014                        const CovarianceMatrix &innerCov,
0015                        unsigned int innerId,
0016                        PropagationDirection seedDir,
0017                        edm::RefToBase<TrajectorySeed> seedRef)
0018     :
0019 
0020       TrackExtraBase(),
0021       outerPosition_(outerPosition),
0022       outerMomentum_(outerMomentum),
0023       outerOk_(ok),
0024       outerDetId_(outerId),
0025       innerPosition_(innerPosition),
0026       innerMomentum_(innerMomentum),
0027       innerOk_(iok),
0028       innerDetId_(innerId),
0029       seedDir_(seedDir),
0030       seedRef_(seedRef) {
0031   index idx = 0;
0032   for (index i = 0; i < dimension; ++i) {
0033     for (index j = 0; j <= i; ++j) {
0034       outerCovariance_[idx] = outerCov(i, j);
0035       innerCovariance_[idx] = innerCov(i, j);
0036       ++idx;
0037     }
0038   }
0039 }
0040 
0041 TrackExtra::CovarianceMatrix TrackExtra::outerStateCovariance() const {
0042   CovarianceMatrix v;
0043   fillCovariance(v, outerCovariance_);
0044   return v;
0045 }
0046 
0047 TrackExtra::CovarianceMatrix TrackExtra::innerStateCovariance() const {
0048   CovarianceMatrix v;
0049   fillCovariance(v, innerCovariance_);
0050   return v;
0051 }
0052 
0053 TrackExtra::CovarianceMatrix &TrackExtra::fillOuter(CovarianceMatrix &v) const {
0054   return fillCovariance(v, outerCovariance_);
0055 }
0056 
0057 TrackExtra::CovarianceMatrix &TrackExtra::fillInner(CovarianceMatrix &v) const {
0058   return fillCovariance(v, innerCovariance_);
0059 }