File indexing completed on 2025-06-26 23:26:40
0001 #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2D.h"
0002
0003 bool SiStripMatchedRecHit2D::sharesInput(const TrackingRecHit* other, SharedInputType what) const {
0004 if (what == all && (geographicalId() != other->geographicalId()))
0005 return false;
0006
0007 if (!sameDetModule(*other))
0008 return false;
0009
0010 if (trackerHitRTTI::isMatched(*other)) {
0011 const SiStripMatchedRecHit2D* otherMatched = static_cast<const SiStripMatchedRecHit2D*>(other);
0012 return sharesClusters(*this, *otherMatched, what);
0013 }
0014
0015 if (what == all)
0016 return false;
0017
0018 if (!trackerHitRTTI::isFromDet(*other))
0019 return false;
0020
0021 auto const& otherClus = reinterpret_cast<const BaseTrackerRecHit*>(other)->firstClusterRef();
0022 if (monoClusterRef().id() == otherClus.id() || stereoClusterRef().id() == otherClus.id())
0023 return (otherClus == stereoClusterRef()) || (otherClus == monoClusterRef());
0024 else {
0025 const bool sameDetId = (geographicalId() == other->geographicalId());
0026 bool stereoOverlap = (sameDetId) ? otherClus.stripOverlap(stereoClusterRef()) : false;
0027 bool monoOverlap = (sameDetId) ? otherClus.stripOverlap(monoClusterRef()) : false;
0028 return (stereoOverlap || monoOverlap);
0029 }
0030 }
0031
0032 bool SiStripMatchedRecHit2D::sharesInput(TrackerSingleRecHit const& other) const {
0033 auto const& otherClus = other.firstClusterRef();
0034 if (monoClusterRef().id() == otherClus.id() || stereoClusterRef().id() == otherClus.id())
0035 return (otherClus == stereoClusterRef()) || (otherClus == monoClusterRef());
0036 else {
0037 const bool sameDetId = (geographicalId() == other.geographicalId());
0038 bool stereoOverlap = (sameDetId) ? otherClus.stripOverlap(stereoClusterRef()) : false;
0039 bool monoOverlap = (sameDetId) ? otherClus.stripOverlap(monoClusterRef()) : false;
0040 return (stereoOverlap || monoOverlap);
0041 }
0042 }
0043
0044
0045 std::vector<const TrackingRecHit*> SiStripMatchedRecHit2D::recHits() const {
0046 std::vector<const TrackingRecHit*> rechits;
0047 return rechits;
0048 }
0049
0050 std::vector<TrackingRecHit*> SiStripMatchedRecHit2D::recHits() {
0051 std::vector<TrackingRecHit*> rechits;
0052 return rechits;
0053 }