CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
SiStripMatchedRecHit2D.h
Go to the documentation of this file.
1 #ifndef SiStripMatchedRecHit2D_H
2 #define SiStripMatchedRecHit2D_H
3 
5 
7  public:
9 
12 
13  SiStripMatchedRecHit2D( const LocalPoint& pos, const LocalError& err, const DetId& id ,
14  const SiStripRecHit2D* rMono,const SiStripRecHit2D* rStereo):
15  BaseTrackerRecHit(pos, err, id, trackerHitRTTI::match), clusterMono_(rMono->omniClusterRef()), clusterStereo_(rStereo->omniClusterRef()){}
16 
17  // by value, as they will not exists anymore...
20 
21  unsigned int stereoId() const { return rawId()+1;}
22  unsigned int monoId() const { return rawId()+2;}
23 
24  // (to be improved)
25  virtual OmniClusterRef const & firstClusterRef() const { return monoClusterRef();}
26 
27 
28  OmniClusterRef const & stereoClusterRef() const { return clusterStereo_;}
29  OmniClusterRef const & monoClusterRef() const { return clusterMono_;}
30  // Non const variants needed for cluster re-keying
33 
34  SiStripCluster const & stereoCluster() const {
35  return stereoClusterRef().stripCluster();
36  }
37  SiStripCluster const & monoCluster() const {
38  return monoClusterRef().stripCluster();
39  }
40 
41 
42  virtual SiStripMatchedRecHit2D * clone() const {return new SiStripMatchedRecHit2D( * this);}
43 
44  virtual int dimension() const {return 2;}
45  virtual void getKfComponents( KfComponentsHolder & holder ) const { getKfComponents2D(holder); }
46 
47 
48 
49  virtual bool sharesInput( const TrackingRecHit* other, SharedInputType what) const;
50 
51  bool sharesInput(TrackerSingleRecHit const & other) const;
52 
53  virtual std::vector<const TrackingRecHit*> recHits() const;
54 
55  virtual std::vector<TrackingRecHit*> recHits();
56 
57  private:
59 };
60 
61 
62 inline
65  bool mono = h1.monoClusterRef()== h2.monoClusterRef();
66  bool stereo = h1.stereoClusterRef()== h2.stereoClusterRef();
67 
68  return (what==TrackingRecHit::all) ? (mono&&stereo) : (mono||stereo);
69 
70 }
71 
72 #endif
SharedInputType
definition of equality via shared input
OmniClusterRef & stereoClusterRef()
virtual std::vector< const TrackingRecHit * > recHits() const
Access to component RecHits (if any)
unsigned int stereoId() const
virtual int dimension() const
SiStripMatchedRecHit2D(const LocalPoint &pos, const LocalError &err, const DetId &id, const SiStripRecHit2D *rMono, const SiStripRecHit2D *rStereo)
SiStripCluster const & monoCluster() const
OmniClusterRef const & stereoClusterRef() const
virtual bool sharesInput(const TrackingRecHit *other, SharedInputType what) const
SiStripCluster const & stripCluster() const
#define GCC11_FINAL
void getKfComponents2D(KfComponentsHolder &holder) const
OmniClusterRef const & monoClusterRef() const
Definition: DetId.h:20
virtual void getKfComponents(KfComponentsHolder &holder) const
SiStripRecHit2D stereoHit() const
virtual OmniClusterRef const & firstClusterRef() const
OmniClusterRef & monoClusterRef()
SiStripRecHit2D monoHit() const
SiStripCluster const & stereoCluster() const
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:6
unsigned int monoId() const
virtual SiStripMatchedRecHit2D * clone() const
id_type rawId() const
bool sharesClusters(SiStripMatchedRecHit2D const &h1, SiStripMatchedRecHit2D const &h2, TrackingRecHit::SharedInputType what)