File indexing completed on 2023-10-25 09:39:02
0001 #ifndef GEMRecHit_GEMCSCSegment_h
0002 #define GEMRecHit_GEMCSCSegment_h
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014 #include "DataFormats/TrackingRecHit/interface/RecSegment.h"
0015
0016 #include "DataFormats/GEMRecHit/interface/GEMRecHitCollection.h"
0017 #include "DataFormats/CSCRecHit/interface/CSCRecHit2DCollection.h"
0018 #include "DataFormats/CSCRecHit/interface/CSCSegmentCollection.h"
0019
0020 #include <iosfwd>
0021
0022 class CSCDetId;
0023
0024 class GEMCSCSegment final : public RecSegment {
0025 public:
0026
0027 GEMCSCSegment() : theChi2(0.) {}
0028
0029
0030 GEMCSCSegment(const CSCSegment* csc_segment,
0031 const std::vector<const GEMRecHit*> gem_rhs,
0032 LocalPoint origin,
0033 LocalVector direction,
0034 AlgebraicSymMatrix errors,
0035 double chi2);
0036
0037
0038 ~GEMCSCSegment() override;
0039
0040
0041 GEMCSCSegment* clone() const override { return new GEMCSCSegment(*this); }
0042
0043 LocalPoint localPosition() const override { return theOrigin; }
0044 LocalError localPositionError() const override;
0045
0046 LocalVector localDirection() const override { return theLocalDirection; }
0047 LocalError localDirectionError() const override;
0048
0049
0050 AlgebraicVector parameters() const override;
0051
0052
0053 AlgebraicSymMatrix parametersError() const override { return theCovMatrix; }
0054
0055
0056 AlgebraicMatrix projectionMatrix() const 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 int nRecHits() const { return (theGEMRecHits.size() + theCSCSegment.specificRecHits().size()); }
0065
0066
0067 const CSCSegment cscSegment() const { return theCSCSegment; }
0068 const std::vector<GEMRecHit>& gemRecHits() const { return theGEMRecHits; }
0069 const std::vector<CSCRecHit2D>& cscRecHits() const { return theCSCSegment.specificRecHits(); }
0070 std::vector<const TrackingRecHit*> recHits() const override;
0071 std::vector<TrackingRecHit*> recHits() override;
0072
0073 CSCDetId cscDetId() const { return geographicalId(); }
0074
0075 void print() const;
0076
0077 private:
0078 std::vector<GEMRecHit> theGEMRecHits;
0079 CSCSegment theCSCSegment;
0080
0081
0082
0083
0084 LocalPoint theOrigin;
0085 LocalVector theLocalDirection;
0086 AlgebraicSymMatrix theCovMatrix;
0087 double theChi2;
0088 };
0089
0090 std::ostream& operator<<(std::ostream& os, const GEMCSCSegment& seg);
0091
0092 #endif