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 
6 class SiStripMatchedRecHit2D GCC11_FINAL : public BaseTrackerRecHit {
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...
18  SiStripRecHit2D stereoHit() const { return SiStripRecHit2D(stereoId(),stereoClusterRef()) ;}
19  SiStripRecHit2D monoHit() const { return SiStripRecHit2D(monoId(),monoClusterRef());}
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
31  OmniClusterRef & stereoClusterRef() { return clusterStereo_;}
32  OmniClusterRef & monoClusterRef() { return clusterMono_;}
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
63 bool sharesClusters(SiStripMatchedRecHit2D const & h1, SiStripMatchedRecHit2D const & h2,
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 const & monoClusterRef() const
OmniClusterRef & monoClusterRef()
OmniClusterRef const & stereoClusterRef() const
virtual bool sharesInput(const TrackingRecHit *other, SharedInputType what) const
unsigned int stereoId() const
BaseTrackerRecHit Base
unsigned int monoId() const
SiStripRecHit2D monoHit() const
void getKfComponents2D(KfComponentsHolder &holder) const
virtual std::vector< const TrackingRecHit * > recHits() const =0
Access to component RecHits (if any)
virtual void getKfComponents(KfComponentsHolder &holder) const
SiStripMatchedRecHit2D(const LocalPoint &pos, const LocalError &err, const DetId &id, const SiStripRecHit2D *rMono, const SiStripRecHit2D *rStereo)
virtual int dimension() const
Definition: DetId.h:20
SiStripCluster const & monoCluster() const
OmniClusterRef clusterStereo_
SiStripCluster const & stereoCluster() const
OmniClusterRef & stereoClusterRef()
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:6
SiStripRecHit2D stereoHit() const
virtual OmniClusterRef const & firstClusterRef() const
virtual SiStripMatchedRecHit2D * clone() const
id_type rawId() const
bool sharesClusters(SiStripMatchedRecHit2D const &h1, SiStripMatchedRecHit2D const &h2, TrackingRecHit::SharedInputType what)
Our base class.
Definition: SiPixelRecHit.h:22