00001 #include "DataFormats/TrackerRecHit2D/interface/SiStripMatchedRecHit2D.h" 00002 00003 00004 SiStripMatchedRecHit2D::SiStripMatchedRecHit2D( const LocalPoint& pos, const LocalError& err, 00005 const DetId& id , const SiStripRecHit2D* rMono,const SiStripRecHit2D* rStereo): BaseSiTrackerRecHit2DLocalPos(pos, err, id), componentMono_(*rMono),componentStereo_(*rStereo){} 00006 00007 bool 00008 SiStripMatchedRecHit2D::sharesInput( const TrackingRecHit* other, 00009 SharedInputType what) const 00010 { 00011 if (what==all && (geographicalId() != other->geographicalId())) return false; 00012 00013 if ( typeid(*other)!=typeid(SiStripMatchedRecHit2D)){ 00014 if (what==all) return false; 00015 else return (monoHit()->sharesInput( other,what)|| stereoHit()->sharesInput( other,what)); 00016 } 00017 else{ 00018 const SiStripMatchedRecHit2D* otherMatched = static_cast<const SiStripMatchedRecHit2D*>(other); 00019 if ( what == all) { 00020 return (monoHit()->sharesInput( otherMatched->monoHit(),what) && 00021 stereoHit()->sharesInput( otherMatched->stereoHit(),what)); 00022 } 00023 else { 00024 return (monoHit()->sharesInput( otherMatched->monoHit(),what) || 00025 stereoHit()->sharesInput( otherMatched->stereoHit(),what)); 00026 } 00027 } 00028 } 00029 00030 std::vector<const TrackingRecHit*> 00031 SiStripMatchedRecHit2D::recHits()const { 00032 std::vector<const TrackingRecHit*> rechits(2); 00033 rechits[0]=&componentMono_; 00034 rechits[1]=&componentStereo_; 00035 return rechits; 00036 } 00037 00038 std::vector<TrackingRecHit*> 00039 SiStripMatchedRecHit2D::recHits() { 00040 std::vector<TrackingRecHit*> rechits(2); 00041 rechits[0]=&componentMono_; 00042 rechits[1]=&componentStereo_; 00043 return rechits; 00044 } 00045 00046