File indexing completed on 2024-04-06 12:04:02
0001 #ifndef TrackingRecHit_DTRecSegment2D_h
0002 #define TrackingRecHit_DTRecSegment2D_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 #include "DataFormats/TrackingRecHit/interface/RecSegment.h"
0028
0029
0030 #include "DataFormats/GeometrySurface/interface/LocalError.h"
0031 #include "DataFormats/GeometryVector/interface/LocalVector.h"
0032 #include "DataFormats/GeometryVector/interface/LocalPoint.h"
0033
0034 #include "DataFormats/DTRecHit/interface/DTRecHit1D.h"
0035
0036 #include <iosfwd>
0037
0038
0039 class DTSegmentUpdator;
0040
0041
0042
0043
0044
0045 class DTRecSegment2D : public RecSegment {
0046 public:
0047
0048
0049 DTRecSegment2D() : theChi2(0.0), theT0(0.), theVdrift(0.) {}
0050
0051
0052 DTRecSegment2D(DetId id, const std::vector<DTRecHit1D>& hits);
0053
0054
0055 DTRecSegment2D(DetId id,
0056 LocalPoint& position,
0057 LocalVector& direction,
0058 AlgebraicSymMatrix& covMatrix,
0059 double chi2,
0060 std::vector<DTRecHit1D>& hits1D);
0061
0062
0063 ~DTRecSegment2D() override;
0064
0065
0066
0067 DTRecSegment2D* clone() const override { return new DTRecSegment2D(*this); }
0068
0069
0070 AlgebraicVector parameters() const override { return param(localPosition(), localDirection()); }
0071
0072
0073 AlgebraicSymMatrix parametersError() const override;
0074
0075
0076
0077
0078 AlgebraicMatrix projectionMatrix() const override { return theProjectionMatrix; }
0079
0080
0081 int dimension() const override { return 2; }
0082
0083
0084 LocalPoint localPosition() const override { return thePosition; }
0085
0086
0087 LocalError localPositionError() const override;
0088
0089
0090 LocalVector localDirection() const override { return theDirection; }
0091
0092
0093 LocalError localDirectionError() const override;
0094
0095
0096 double chi2() const override { return theChi2; }
0097
0098
0099 int degreesOfFreedom() const override;
0100
0101
0102 std::vector<const TrackingRecHit*> recHits() const override;
0103
0104
0105 std::vector<TrackingRecHit*> recHits() override;
0106
0107
0108 std::vector<DTRecHit1D> specificRecHits() const;
0109
0110
0111 AlgebraicSymMatrix covMatrix() const { return theCovMatrix; }
0112
0113
0114 double t0() const { return theT0; }
0115 bool ist0Valid() const { return (theT0 > -998.) ? true : false; }
0116
0117
0118
0119 double vDrift() const { return theVdrift; }
0120
0121 protected:
0122 friend class DTSegmentUpdator;
0123 void setPosition(const LocalPoint& pos);
0124 void setDirection(const LocalVector& dir);
0125 void setCovMatrix(const AlgebraicSymMatrix& cov);
0126 void setChi2(const double& chi2);
0127 void update(std::vector<DTRecHit1D>& updatedRecHits);
0128 void setT0(const double& t0);
0129 void setVdrift(const double& vdrift);
0130
0131 LocalPoint thePosition;
0132 LocalVector theDirection;
0133
0134
0135
0136
0137 AlgebraicSymMatrix theCovMatrix;
0138
0139 double theChi2;
0140 double theT0;
0141 double theVdrift;
0142
0143 std::vector<DTRecHit1D> theHits;
0144
0145 private:
0146 static const AlgebraicMatrix theProjectionMatrix;
0147
0148 AlgebraicVector param(const LocalPoint& lp, const LocalVector& lv) const {
0149 AlgebraicVector result(2);
0150 result[1] = lp.x();
0151 result[0] = lv.x() / lv.z();
0152 return result;
0153 }
0154 };
0155 std::ostream& operator<<(std::ostream& os, const DTRecSegment2D& seg);
0156 #endif