File indexing completed on 2023-03-17 10:49:55
0001 #ifndef GEMRecHit_GEMSegment_h
0002 #define GEMRecHit_GEMSegment_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #include "DataFormats/TrackingRecHit/interface/RecSegment.h"
0013 #include "DataFormats/GEMRecHit/interface/GEMRecHitCollection.h"
0014
0015 #include <iosfwd>
0016
0017 class GEMDetId;
0018
0019 class GEMSegment final : public RecSegment {
0020 public:
0021
0022 GEMSegment() : theChi2(0.) {}
0023
0024
0025 GEMSegment(const std::vector<const GEMRecHit*>& proto_segment,
0026 const LocalPoint& origin,
0027 const LocalVector& direction,
0028 const AlgebraicSymMatrix& errors,
0029 double chi2);
0030
0031 GEMSegment(const std::vector<const GEMRecHit*>& proto_segment,
0032 const LocalPoint& origin,
0033 const LocalVector& direction,
0034 const AlgebraicSymMatrix& errors,
0035 double chi2,
0036 float bx);
0037
0038 GEMSegment(const std::vector<const GEMRecHit*>& proto_segment,
0039 const LocalPoint& origin,
0040 const LocalVector& direction,
0041 const AlgebraicSymMatrix& errors,
0042 double chi2,
0043 float bx,
0044 float deltaPhi);
0045
0046
0047 ~GEMSegment() override;
0048
0049
0050 GEMSegment* clone() const override { return new GEMSegment(*this); }
0051
0052 LocalPoint localPosition() const override { return theOrigin; }
0053 LocalError localPositionError() const override;
0054
0055 LocalVector localDirection() const override { return theLocalDirection; }
0056 LocalError localDirectionError() const override;
0057
0058
0059 AlgebraicVector parameters() const override;
0060
0061
0062 AlgebraicSymMatrix parametersError() const override { return theCovMatrix; }
0063
0064
0065 AlgebraicMatrix projectionMatrix() const override;
0066
0067 std::vector<const TrackingRecHit*> recHits() const override;
0068
0069 std::vector<TrackingRecHit*> recHits() override;
0070
0071 double chi2() const override { return theChi2; };
0072
0073 int dimension() const override { return 4; }
0074
0075 int degreesOfFreedom() const override { return 2 * nRecHits() - 4; }
0076
0077
0078
0079 const std::vector<GEMRecHit>& specificRecHits() const { return theGEMRecHits; }
0080
0081 int nRecHits() const { return theGEMRecHits.size(); }
0082
0083 GEMDetId gemDetId() const { return geographicalId(); }
0084
0085 float bunchX() const { return theBX; }
0086
0087 float deltaPhi() const { return theDeltaPhi; }
0088
0089 void print() const;
0090
0091 private:
0092 std::vector<GEMRecHit> theGEMRecHits;
0093 LocalPoint theOrigin;
0094 LocalVector theLocalDirection;
0095 AlgebraicSymMatrix theCovMatrix;
0096 double theChi2;
0097 float theBX;
0098 float theDeltaPhi;
0099 };
0100
0101 std::ostream& operator<<(std::ostream& os, const GEMSegment& seg);
0102
0103 #endif