CMS 3D CMS Logo

DTRecSegment2D.h

Go to the documentation of this file.
00001 #ifndef TrackingRecHit_DTRecSegment2D_h
00002 #define TrackingRecHit_DTRecSegment2D_h
00003 
00028 /* Base Class Headers */
00029 #include "DataFormats/TrackingRecHit/interface/RecSegment.h"
00030 
00031 /* Collaborating Class Declarations */
00032 #include "DataFormats/GeometrySurface/interface/LocalError.h"
00033 #include "DataFormats/GeometryVector/interface/LocalVector.h"
00034 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
00035 
00036 #include "DataFormats/DTRecHit/interface/DTRecHit1D.h"
00037 /* C++ Headers */
00038 #include <iosfwd>
00039 
00040 /* Fwd declaration */
00041 class DTSegmentUpdator;
00042 
00043 /* ====================================================================== */
00044 
00045 /* Class DTRecSegment2D Interface */
00046 
00047 class DTRecSegment2D : public RecSegment{
00048 
00049  public:
00050 
00053   DTRecSegment2D() {}
00054   
00056   DTRecSegment2D(DetId id, const std::vector<DTRecHit1D>& hits) ;
00057   
00059   DTRecSegment2D(DetId id, 
00060                  LocalPoint &position, LocalVector &direction,
00061                  AlgebraicSymMatrix & covMatrix, double chi2, 
00062                  std::vector<DTRecHit1D> &hits1D);
00063 
00065   virtual ~DTRecSegment2D() {};
00066 
00067   /* Operations */ 
00068 
00069   virtual DTRecSegment2D* clone() const { return new DTRecSegment2D(*this);}
00070 
00071 
00073   virtual AlgebraicVector parameters() const {
00074     return param( localPosition(), localDirection());
00075   }
00076 
00077   // The parameter error matrix 
00078   virtual AlgebraicSymMatrix parametersError() const {
00079     return parError( localPositionError(), localDirectionError());
00080   }
00081 
00085   virtual AlgebraicMatrix projectionMatrix() const {
00086     if ( !isInitialized) initialize();
00087     return theProjectionMatrix;
00088   }
00089     
00091   virtual int dimension() const { return 2;}
00092     
00094   virtual LocalPoint localPosition() const {return thePosition; }
00095   
00097   virtual LocalError localPositionError() const ;
00098   
00100   virtual LocalVector localDirection() const { return theDirection; }
00101 
00103   virtual LocalError localDirectionError() const;
00104 
00106   virtual double chi2() const { return theChi2; }
00107     
00109   virtual int degreesOfFreedom() const ;
00110 
00111   // Access to component RecHits (if any)
00112   virtual std::vector<const TrackingRecHit*> recHits() const ;
00113 
00114   // Non-const access to component RecHits (if any)
00115   virtual std::vector<TrackingRecHit*> recHits() ;
00116 
00118   std::vector<DTRecHit1D> specificRecHits() const ;
00119   
00121   AlgebraicSymMatrix covMatrix() const {return theCovMatrix;}
00122 
00124   double t0() const {return theT0;}
00125 
00126  protected:
00127   friend class DTSegmentUpdator;
00128   void setPosition(const LocalPoint& pos);
00129   void setDirection(const LocalVector& dir);
00130   void setCovMatrix(const AlgebraicSymMatrix& cov);
00131   void setChi2(const double& chi2);
00132   void update(std::vector<DTRecHit1D> & updatedRecHits);
00133   void setT0(const double& t0);
00134 
00135   LocalPoint  thePosition;  // in SL frame
00136   LocalVector theDirection; // in SL frame
00137   
00141   AlgebraicSymMatrix theCovMatrix; // the covariance matrix
00142 
00143   double theChi2;           // chi2 of the fit
00144   double theT0;             // T0 as coming from the fit
00145 
00146   std::vector<DTRecHit1D> theHits; // the hits with defined R/L
00147   
00148 
00149  private:
00150 
00151   static bool isInitialized;
00152   static AlgebraicMatrix theProjectionMatrix;
00153   
00154   void initialize() const {
00155     isInitialized=true;
00156     theProjectionMatrix = AlgebraicMatrix( 2, 5, 0);
00157     theProjectionMatrix[0][1]=1;
00158     theProjectionMatrix[1][3]=1;
00159   }
00160   
00161   AlgebraicVector param( const LocalPoint& lp, const LocalVector& lv) const {
00162     AlgebraicVector result(2);
00163     result[1]=lp.x();
00164     result[0]=lv.x()/lv.z();
00165     return result;
00166   }
00167 
00168   AlgebraicSymMatrix parError( const LocalError& lp,
00169                                const LocalError& lv) const;
00170 
00171 };
00172 std::ostream& operator<<(std::ostream& os, const DTRecSegment2D& seg);
00173 #endif // TrackingRecHit_DTRecSegment2D_h
00174 

Generated on Tue Jun 9 17:30:41 2009 for CMSSW by  doxygen 1.5.4