CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/DataFormats/TrackerRecHit2D/src/SiStripMatchedRecHit2D.cc

Go to the documentation of this file.
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 SiStripMatchedRecHit2D *
00008 SiStripMatchedRecHit2D::clone() const
00009 {
00010   return new SiStripMatchedRecHit2D( * this);
00011 }
00012 
00013 bool 
00014 SiStripMatchedRecHit2D::sharesInput( const TrackingRecHit* other, 
00015                                      SharedInputType what) const
00016 {
00017   if (what==all && (geographicalId() != other->geographicalId())) return false;
00018   
00019   if ( typeid(*other)!=typeid(SiStripMatchedRecHit2D)){
00020     if (what==all)  return false;
00021     else return (monoHit()->sharesInput( other,what)|| stereoHit()->sharesInput( other,what));
00022   }
00023   else{
00024     const SiStripMatchedRecHit2D* otherMatched = static_cast<const SiStripMatchedRecHit2D*>(other);
00025     if ( what == all) {
00026       return (monoHit()->sharesInput( otherMatched->monoHit(),what) && 
00027               stereoHit()->sharesInput( otherMatched->stereoHit(),what));
00028     }
00029     else {
00030       return (monoHit()->sharesInput( otherMatched->monoHit(),what) || 
00031               stereoHit()->sharesInput( otherMatched->stereoHit(),what));
00032     }
00033   }
00034 }
00035 
00036 std::vector<const TrackingRecHit*>
00037 SiStripMatchedRecHit2D::recHits()const {
00038   std::vector<const TrackingRecHit*> rechits(2);
00039   rechits[0]=&componentMono_;
00040   rechits[1]=&componentStereo_;
00041   return rechits;
00042 }
00043 
00044 std::vector<TrackingRecHit*>
00045 SiStripMatchedRecHit2D::recHits() {
00046   std::vector<TrackingRecHit*> rechits(2);
00047   rechits[0]=&componentMono_;
00048   rechits[1]=&componentStereo_;
00049   return rechits;
00050 }
00051 
00052