Go to the documentation of this file.00001 #ifndef DTRecHit_DTRecSegment4D_h
00002 #define DTRecHit_DTRecSegment4D_h
00003
00015
00016 #include "DataFormats/TrackingRecHit/interface/RecSegment.h"
00017
00018
00019 #include "DataFormats/DTRecHit/interface/DTSLRecSegment2D.h"
00020 #include "DataFormats/DTRecHit/interface/DTChamberRecSegment2D.h"
00021
00022
00023 #include <iosfwd>
00024
00025 class DTRecSegment4D : public RecSegment {
00026
00027 public:
00028 friend class DTSegmentUpdator;
00030 DTRecSegment4D() : theProjection(none), theDimension(0) {}
00031
00033 DTRecSegment4D(const DTChamberRecSegment2D& phiSeg, const DTSLRecSegment2D& zedSeg, const LocalPoint& posZInCh, const LocalVector& dirZInCh);
00034
00036 DTRecSegment4D(const DTChamberRecSegment2D& phiSeg);
00037
00039 DTRecSegment4D(const DTSLRecSegment2D& zedSeg, const LocalPoint& posZInCh, const LocalVector& dirZInCh);
00040
00042 ~DTRecSegment4D() ;
00043
00044
00045
00046 virtual DTRecSegment4D* clone() const { return new DTRecSegment4D(*this);}
00047
00052 AlgebraicVector parameters() const ;
00053
00055 AlgebraicSymMatrix parametersError() const ;
00056
00058 virtual AlgebraicMatrix projectionMatrix() const;
00059
00061 virtual LocalPoint localPosition() const { return thePosition;}
00062
00064 virtual LocalError localPositionError() const ;
00065
00067 virtual LocalVector localDirection() const { return theDirection; }
00068
00070 virtual LocalError localDirectionError() const ;
00071
00072
00073 virtual double chi2() const ;
00074
00075
00076 virtual int degreesOfFreedom() const ;
00077
00078
00079 virtual int dimension() const { return theDimension; }
00080
00081
00082 virtual std::vector<const TrackingRecHit*> recHits() const ;
00083
00084
00085 virtual std::vector<TrackingRecHit*> recHits() ;
00086
00087
00088
00089
00090
00092 bool hasPhi() const {return (theProjection==full || theProjection==phi);}
00093
00095 bool hasZed() const {return (theProjection==full || theProjection==Z);}
00096
00098 const DTChamberRecSegment2D *phiSegment() const {
00099 return hasPhi()? &thePhiSeg: 0;
00100 }
00101
00103 const DTSLRecSegment2D *zSegment() const {
00104 return hasZed()? &theZedSeg : 0;
00105 }
00106
00108 void setPosition(LocalPoint pos) { thePosition = pos; }
00109
00111 void setDirection(LocalVector dir) { theDirection = dir; }
00112
00114 void setCovMatrix(AlgebraicSymMatrix mat) { theCovMatrix = mat; }
00115
00117 virtual DTChamberId chamberId() const;
00118
00119 private:
00121 enum Projection {full, phi, Z, none};
00122 Projection theProjection;
00123
00125 DTChamberRecSegment2D *phiSegment() {return &thePhiSeg;}
00126
00128 DTSLRecSegment2D *zSegment() {return &theZedSeg;}
00129
00130 LocalPoint thePosition;
00131 LocalVector theDirection;
00132
00133 void setCovMatrixForZed(const LocalPoint& posZInCh);
00134
00135
00136
00137
00138
00139
00140
00141
00142 AlgebraicSymMatrix theCovMatrix;
00143
00144 DTChamberRecSegment2D thePhiSeg;
00145 DTSLRecSegment2D theZedSeg;
00146
00147 int theDimension;
00148
00149 };
00150
00151 std::ostream& operator<<(std::ostream& os, const DTRecSegment4D& seg);
00152
00153 #endif // DTRecHit_DTRecSegment4D_h
00154