Go to the documentation of this file.00001 #ifndef TrackingRecHit_DTRecSegment2D_h
00002 #define TrackingRecHit_DTRecSegment2D_h
00003
00028
00029 #include "DataFormats/TrackingRecHit/interface/RecSegment.h"
00030
00031
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
00038 #include <iosfwd>
00039
00040
00041 class DTSegmentUpdator;
00042
00043
00044
00045
00046
00047 class DTRecSegment2D : public RecSegment{
00048
00049 public:
00050
00053 DTRecSegment2D(): theChi2(0.0), theT0(0.), theVdrift(0.) {}
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
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
00078 virtual AlgebraicSymMatrix parametersError() const;
00079
00083 virtual AlgebraicMatrix projectionMatrix() const {
00084 if ( !isInitialized) initialize();
00085 return theProjectionMatrix;
00086 }
00087
00089 virtual int dimension() const { return 2;}
00090
00092 virtual LocalPoint localPosition() const {return thePosition; }
00093
00095 virtual LocalError localPositionError() const ;
00096
00098 virtual LocalVector localDirection() const { return theDirection; }
00099
00101 virtual LocalError localDirectionError() const;
00102
00104 virtual double chi2() const { return theChi2; }
00105
00107 virtual int degreesOfFreedom() const ;
00108
00109
00110 virtual std::vector<const TrackingRecHit*> recHits() const ;
00111
00112
00113 virtual std::vector<TrackingRecHit*> recHits() ;
00114
00116 std::vector<DTRecHit1D> specificRecHits() const ;
00117
00119 AlgebraicSymMatrix covMatrix() const {return theCovMatrix;}
00120
00122 double t0() const {return theT0;}
00123 bool ist0Valid() const {return (theT0 > -998.) ? true : false;}
00124
00127 double vDrift() const {return theVdrift;}
00128
00129 protected:
00130 friend class DTSegmentUpdator;
00131 void setPosition(const LocalPoint& pos);
00132 void setDirection(const LocalVector& dir);
00133 void setCovMatrix(const AlgebraicSymMatrix& cov);
00134 void setChi2(const double& chi2);
00135 void update(std::vector<DTRecHit1D> & updatedRecHits);
00136 void setT0(const double& t0);
00137 void setVdrift(const double& vdrift);
00138
00139 LocalPoint thePosition;
00140 LocalVector theDirection;
00141
00145 AlgebraicSymMatrix theCovMatrix;
00146
00147 double theChi2;
00148 double theT0;
00149 double theVdrift;
00150
00151 std::vector<DTRecHit1D> theHits;
00152
00153
00154 private:
00155
00156 static bool isInitialized;
00157 static AlgebraicMatrix theProjectionMatrix;
00158
00159 void initialize() const {
00160 isInitialized=true;
00161 theProjectionMatrix = AlgebraicMatrix( 2, 5, 0);
00162 theProjectionMatrix[0][1]=1;
00163 theProjectionMatrix[1][3]=1;
00164 }
00165
00166 AlgebraicVector param( const LocalPoint& lp, const LocalVector& lv) const {
00167 AlgebraicVector result(2);
00168 result[1]=lp.x();
00169 result[0]=lv.x()/lv.z();
00170 return result;
00171 }
00172
00173 };
00174 std::ostream& operator<<(std::ostream& os, const DTRecSegment2D& seg);
00175 #endif // TrackingRecHit_DTRecSegment2D_h
00176