File indexing completed on 2024-04-06 12:04:00
0001 #ifndef CSCRecHit_CSCSegment_h
0002 #define CSCRecHit_CSCSegment_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #include <DataFormats/TrackingRecHit/interface/RecSegment.h>
0015 #include <DataFormats/CSCRecHit/interface/CSCRecHit2DCollection.h>
0016
0017 #include <iosfwd>
0018
0019 class CSCDetId;
0020
0021 class CSCSegment final : public RecSegment {
0022 public:
0023
0024 CSCSegment() : theChi2(0.), aME11a_duplicate(false) {}
0025
0026
0027 CSCSegment(const std::vector<const CSCRecHit2D*>& proto_segment,
0028 LocalPoint origin,
0029 LocalVector direction,
0030 const AlgebraicSymMatrix& errors,
0031 double chi2);
0032
0033
0034 ~CSCSegment() override;
0035
0036
0037 CSCSegment* clone() const override { return new CSCSegment(*this); }
0038
0039 LocalPoint localPosition() const override { return theOrigin; }
0040 LocalError localPositionError() const override;
0041
0042 LocalVector localDirection() const override { return theLocalDirection; }
0043 LocalError localDirectionError() const override;
0044
0045
0046 AlgebraicVector parameters() const override;
0047
0048
0049 AlgebraicSymMatrix parametersError() const override { return theCovMatrix; }
0050
0051
0052 AlgebraicMatrix projectionMatrix() const override;
0053
0054 std::vector<const TrackingRecHit*> recHits() const override;
0055
0056 std::vector<TrackingRecHit*> recHits() override;
0057
0058 double chi2() const override { return theChi2; };
0059
0060 int dimension() const override { return 4; }
0061
0062 int degreesOfFreedom() const override { return 2 * nRecHits() - 4; }
0063
0064
0065
0066 const std::vector<CSCRecHit2D>& specificRecHits() const { return theCSCRecHits; }
0067
0068 int nRecHits() const { return theCSCRecHits.size(); }
0069
0070 CSCDetId cscDetId() const { return geographicalId(); }
0071
0072 void setDuplicateSegments(std::vector<CSCSegment*>& duplicates);
0073
0074 bool isME11a_duplicate() const { return (!theDuplicateSegments.empty() ? true : false); }
0075
0076 const std::vector<CSCSegment>& duplicateSegments() const { return theDuplicateSegments; }
0077
0078 bool testSharesAllInSpecificRecHits(const std::vector<CSCRecHit2D>& specificRecHits_1,
0079 const std::vector<CSCRecHit2D>& specificRecHits_2,
0080 CSCRecHit2D::SharedInputType) const;
0081
0082
0083
0084 bool sharesRecHits(const CSCSegment& anotherSegment, CSCRecHit2D::SharedInputType sharesInput) const;
0085
0086 bool sharesRecHits(const CSCSegment& anotherSegment) const;
0087
0088 float time() const;
0089
0090 void print() const;
0091
0092 private:
0093 std::vector<CSCRecHit2D> theCSCRecHits;
0094 LocalPoint theOrigin;
0095 LocalVector theLocalDirection;
0096 AlgebraicSymMatrix theCovMatrix;
0097 double theChi2;
0098 bool aME11a_duplicate;
0099 std::vector<CSCSegment> theDuplicateSegments;
0100 };
0101
0102 std::ostream& operator<<(std::ostream& os, const CSCSegment& seg);
0103
0104 #endif