File indexing completed on 2023-03-17 10:49:38
0001 #ifndef DTRecHit_DTRecSegment4D_h
0002 #define DTRecHit_DTRecSegment4D_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #include "DataFormats/TrackingRecHit/interface/RecSegment.h"
0015
0016
0017 #include "DataFormats/DTRecHit/interface/DTSLRecSegment2D.h"
0018 #include "DataFormats/DTRecHit/interface/DTChamberRecSegment2D.h"
0019
0020
0021 #include <iosfwd>
0022
0023 class DTRecSegment4D : public RecSegment {
0024 public:
0025 friend class DTSegmentUpdator;
0026
0027 DTRecSegment4D() : theProjection(none), theDimension(0) {}
0028
0029
0030 DTRecSegment4D(const DTChamberRecSegment2D& phiSeg,
0031 const DTSLRecSegment2D& zedSeg,
0032 const LocalPoint& posZInCh,
0033 const LocalVector& dirZInCh);
0034
0035
0036 DTRecSegment4D(const DTChamberRecSegment2D& phiSeg);
0037
0038
0039 DTRecSegment4D(const DTSLRecSegment2D& zedSeg, const LocalPoint& posZInCh, const LocalVector& dirZInCh);
0040
0041
0042 ~DTRecSegment4D() override;
0043
0044
0045
0046 DTRecSegment4D* clone() const override { return new DTRecSegment4D(*this); }
0047
0048
0049
0050
0051
0052 AlgebraicVector parameters() const override;
0053
0054
0055 AlgebraicSymMatrix parametersError() const override;
0056
0057
0058 AlgebraicMatrix projectionMatrix() const override;
0059
0060
0061 LocalPoint localPosition() const override { return thePosition; }
0062
0063
0064 LocalError localPositionError() const override;
0065
0066
0067 LocalVector localDirection() const override { return theDirection; }
0068
0069
0070 LocalError localDirectionError() const override;
0071
0072
0073 double chi2() const override;
0074
0075
0076 int degreesOfFreedom() const override;
0077
0078
0079 int dimension() const override { return theDimension; }
0080
0081
0082 std::vector<const TrackingRecHit*> recHits() const override;
0083
0084
0085 std::vector<TrackingRecHit*> recHits() override;
0086
0087
0088
0089
0090 bool hasPhi() const { return (theProjection == full || theProjection == phi); }
0091
0092
0093 bool hasZed() const { return (theProjection == full || theProjection == Z); }
0094
0095
0096 const DTChamberRecSegment2D* phiSegment() const { return hasPhi() ? &thePhiSeg : nullptr; }
0097
0098
0099 const DTSLRecSegment2D* zSegment() const { return hasZed() ? &theZedSeg : nullptr; }
0100
0101
0102 void setPosition(LocalPoint pos) { thePosition = pos; }
0103
0104
0105 void setDirection(LocalVector dir) { theDirection = dir; }
0106
0107
0108 void setCovMatrix(const AlgebraicSymMatrix& mat) { theCovMatrix = mat; }
0109
0110
0111 virtual DTChamberId chamberId() const;
0112
0113 private:
0114
0115 enum Projection { full, phi, Z, none };
0116 Projection theProjection;
0117
0118
0119 DTChamberRecSegment2D* phiSegment() { return &thePhiSeg; }
0120
0121
0122 DTSLRecSegment2D* zSegment() { return &theZedSeg; }
0123
0124 LocalPoint thePosition;
0125 LocalVector theDirection;
0126
0127 void setCovMatrixForZed(const LocalPoint& posZInCh);
0128
0129
0130
0131
0132
0133
0134
0135
0136 AlgebraicSymMatrix theCovMatrix;
0137
0138 DTChamberRecSegment2D thePhiSeg;
0139 DTSLRecSegment2D theZedSeg;
0140
0141 int theDimension;
0142 };
0143
0144 std::ostream& operator<<(std::ostream& os, const DTRecSegment4D& seg);
0145
0146 #endif