CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripMatchedRecHit2D.cc
Go to the documentation of this file.
2 
3 
5  const DetId& id , const SiStripRecHit2D* rMono,const SiStripRecHit2D* rStereo): BaseSiTrackerRecHit2DLocalPos(pos, err, id), componentMono_(*rMono),componentStereo_(*rStereo){}
6 
9 {
10  return new SiStripMatchedRecHit2D( * this);
11 }
12 
13 bool
15  SharedInputType what) const
16 {
17  if (what==all && (geographicalId() != other->geographicalId())) return false;
18 
19  if ( typeid(*other)!=typeid(SiStripMatchedRecHit2D)){
20  if (what==all) return false;
21  else return (monoHit()->sharesInput( other,what)|| stereoHit()->sharesInput( other,what));
22  }
23  else{
24  const SiStripMatchedRecHit2D* otherMatched = static_cast<const SiStripMatchedRecHit2D*>(other);
25  if ( what == all) {
26  return (monoHit()->sharesInput( otherMatched->monoHit(),what) &&
27  stereoHit()->sharesInput( otherMatched->stereoHit(),what));
28  }
29  else {
30  return (monoHit()->sharesInput( otherMatched->monoHit(),what) ||
31  stereoHit()->sharesInput( otherMatched->stereoHit(),what));
32  }
33  }
34 }
35 
36 std::vector<const TrackingRecHit*>
38  std::vector<const TrackingRecHit*> rechits(2);
39  rechits[0]=&componentMono_;
40  rechits[1]=&componentStereo_;
41  return rechits;
42 }
43 
44 std::vector<TrackingRecHit*>
46  std::vector<TrackingRecHit*> rechits(2);
47  rechits[0]=&componentMono_;
48  rechits[1]=&componentStereo_;
49  return rechits;
50 }
51 
52 
SharedInputType
definition of equality via shared input
virtual std::vector< const TrackingRecHit * > recHits() const
Access to component RecHits (if any)
virtual SiStripMatchedRecHit2D * clone() const
const SiStripRecHit2D * stereoHit() const
virtual bool sharesInput(const TrackingRecHit *other, SharedInputType what) const
virtual bool sharesInput(const TrackingRecHit *other, SharedInputType what) const
Definition: DetId.h:20
DetId geographicalId() const
const SiStripRecHit2D * monoHit() const