CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch1/src/DataFormats/GsfTrackReco/src/GsfTrack.cc

Go to the documentation of this file.
00001 #include "DataFormats/GsfTrackReco/interface/GsfTrack.h"
00002 using namespace reco;
00003 
00004 GsfTrack::GsfTrack ()
00005 {
00006   chargeMode_ = 0;
00007   momentumMode_ = Vector(0.,0.,0.);
00008   typedef unsigned int index;
00009   index idx = 0;
00010   for( index i = 0; i < dimensionMode; ++ i )
00011     for( index j = 0; j <= i; ++ j )
00012       covarianceMode_[ idx ++ ] = 0.;  
00013 }
00014 
00015 GsfTrack::GsfTrack( double chi2, double ndof, const Point & vertex, const Vector & momentum, int charge,
00016                     const CovarianceMatrix & cov ) :
00017   Track( chi2, ndof, vertex, momentum, charge, cov ),
00018   chargeMode_(charge), momentumMode_(momentum) {
00019   typedef unsigned int index;
00020   index idx = 0;
00021   for( index i = 0; i < dimensionMode; ++ i )
00022     for( index j = 0; j <= i; ++ j )
00023       covarianceMode_[ idx ++ ] = cov(i,j);
00024 }
00025 
00026 void 
00027 GsfTrack::setMode (int chargeMode, const Vector& momentumMode,
00028                    const CovarianceMatrixMode& covarianceMode)
00029 {
00030   chargeMode_ = chargeMode;
00031   momentumMode_ = momentumMode;
00032   typedef unsigned int index;
00033   index idx = 0;
00034   for( index i = 0; i < dimensionMode; ++ i )
00035     for( index j = 0; j <= i; ++ j )
00036       covarianceMode_[ idx ++ ] = covarianceMode(i,j);
00037 }
00038 
00039 GsfTrack::CovarianceMatrixMode&
00040 GsfTrack::fill (CovarianceMatrixMode& v) const
00041 {
00042   typedef unsigned int index;
00043   index idx = 0;
00044   for( index i = 0; i < dimensionMode; ++ i ) 
00045     for( index j = 0; j <= i; ++ j )
00046       v( i, j ) = covarianceMode_[ idx ++ ];
00047   return v;
00048 }
00049