CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/DataFormats/TrackReco/interface/TrackExtra.h

Go to the documentation of this file.
00001 #ifndef TrackReco_TrackExtra_h
00002 #define TrackReco_TrackExtra_h
00003 
00015 #include <Rtypes.h>
00016 #include "DataFormats/Math/interface/Vector3D.h"
00017 #include "DataFormats/Math/interface/Point3D.h"
00018 #include "DataFormats/Math/interface/Error.h"
00019 #include "DataFormats/TrackReco/interface/TrackExtraBase.h"
00020 #include "DataFormats/TrackReco/interface/TrackResiduals.h"
00021 #include "DataFormats/TrajectorySeed/interface/PropagationDirection.h"
00022 #include "DataFormats/TrajectorySeed/interface/TrajectorySeed.h"
00023 
00024 namespace reco {
00025   class TrackExtra : public TrackExtraBase {
00026   public:
00028     enum { dimension = 5 };
00030     enum { covarianceSize = dimension * ( dimension + 1 ) / 2 };
00032     typedef math::XYZPoint Point;
00034     typedef math::XYZVector Vector;
00036     typedef math::Error<5>::type CovarianceMatrix;
00038     typedef unsigned int index;
00039 
00041     TrackExtra(): 
00042       outerMomentum_(),
00043       outerOk_(false),
00044       outerDetId_(0),
00045       innerPosition_(),
00046       innerMomentum_(),
00047       innerOk_(false),
00048       innerDetId_(0),
00049       seedDir_(anyDirection),
00050       seedRef_(),
00051       trackResiduals_()
00052    {
00053      index idx = 0;
00054      for( index i = 0; i < dimension; ++ i ) {
00055        for( index j = 0; j <= i; ++ j ) {
00056          outerCovariance_[ idx ] = 0;
00057          innerCovariance_[ idx ] = 0;
00058          ++idx;
00059        }
00060      }
00061    }
00062 
00064     TrackExtra( const Point & outerPosition, const Vector & outerMomentum, bool ok ,
00065                 const Point & innerPosition, const Vector & innerMomentum, bool iok,
00066                 const CovarianceMatrix& outerState, unsigned int outerId,
00067                 const CovarianceMatrix& innerState, unsigned int innerId, 
00068                 PropagationDirection seedDir, 
00069                 edm::RefToBase<TrajectorySeed>  seedRef=edm::RefToBase<TrajectorySeed>());
00070 
00072     const Point & outerPosition() const { return outerPosition_; }
00074     const Vector & outerMomentum() const { return outerMomentum_; }
00076     bool outerOk() const { return outerOk_; }
00078     const Point & innerPosition() const { return innerPosition_; }
00080     const Vector & innerMomentum() const { return innerMomentum_; }
00082     bool innerOk() const { return innerOk_; }
00084     double outerPx() const { return outerMomentum_.X(); }
00086     double outerPy() const { return outerMomentum_.Y(); }
00088     double outerPz() const { return outerMomentum_.Z(); }
00090     double outerX() const { return outerPosition_.X(); }
00092     double outerY() const { return outerPosition_.Y(); }
00094     double outerZ() const { return outerPosition_.Z(); }
00096     double outerP() const { return outerMomentum().R(); }
00098     double outerPt() const { return outerMomentum().Rho(); }
00100     double outerPhi() const { return outerMomentum().Phi(); }
00102     double outerEta() const { return outerMomentum().Eta(); }
00104     double outerTheta() const { return outerMomentum().Theta(); }
00106     double outerRadius() const { return outerPosition().Rho(); }
00107 
00109     CovarianceMatrix outerStateCovariance() const;
00111     CovarianceMatrix innerStateCovariance() const;
00113     CovarianceMatrix & fillOuter( CovarianceMatrix & v ) const;
00115     CovarianceMatrix & fillInner( CovarianceMatrix & v ) const;
00117     unsigned int outerDetId() const { return outerDetId_; }
00119     unsigned int innerDetId() const { return innerDetId_; }
00120     // direction how the hits were sorted in the original seed
00121     PropagationDirection seedDirection() const {return seedDir_;}
00122 
00128     edm::RefToBase<TrajectorySeed> seedRef() const { return seedRef_; }
00129 
00131     void setResiduals (const TrackResiduals &r) { trackResiduals_ = r; }
00132 
00134     const TrackResiduals &residuals () const { return trackResiduals_; }
00135 
00136   private:
00137 
00139     Point outerPosition_;
00141     Vector outerMomentum_;
00143     bool outerOk_;
00145     float outerCovariance_[ covarianceSize ];
00146     unsigned int outerDetId_;
00147 
00148 
00150     Point innerPosition_;
00152     Vector innerMomentum_;
00154     bool innerOk_;
00156     float innerCovariance_[ covarianceSize ];
00157     unsigned int innerDetId_;
00158 
00159     PropagationDirection seedDir_;
00160     edm::RefToBase<TrajectorySeed> seedRef_;
00161 
00163     TrackResiduals trackResiduals_;
00164   };
00165 
00166 }
00167 
00168 #endif