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 #include "TkCloner.h"
7 
8 class SiStripMatchedRecHit2D GCC11_FINAL : public BaseTrackerRecHit {
9  public:
11 
14 
15  SiStripMatchedRecHit2D( const LocalPoint& pos, const LocalError& err, GeomDet const & idet,
16  const SiStripRecHit2D* rMono,const SiStripRecHit2D* rStereo):
17  BaseTrackerRecHit(pos, err, idet, trackerHitRTTI::match), clusterMono_(rMono->omniClusterRef()), clusterStereo_(rStereo->omniClusterRef()){}
18 
19  // by value, as they will not exists anymore...
20  SiStripRecHit2D stereoHit() const { return SiStripRecHit2D(stereoId(),stereoClusterRef()) ;}
21  SiStripRecHit2D monoHit() const { return SiStripRecHit2D(monoId(),monoClusterRef());}
22 
23  unsigned int stereoId() const { return rawId()+1;}
24  unsigned int monoId() const { return rawId()+2;}
25 
26  // (to be improved)
27  virtual OmniClusterRef const & firstClusterRef() const { return monoClusterRef();}
28 
29 
30  OmniClusterRef const & stereoClusterRef() const { return clusterStereo_;}
31  OmniClusterRef const & monoClusterRef() const { return clusterMono_;}
32  // Non const variants needed for cluster re-keying
33  OmniClusterRef & stereoClusterRef() { return clusterStereo_;}
34  OmniClusterRef & monoClusterRef() { return clusterMono_;}
35 
36  SiStripCluster const & stereoCluster() const {
37  return stereoClusterRef().stripCluster();
38  }
39  SiStripCluster const & monoCluster() const {
40  return monoClusterRef().stripCluster();
41  }
42 
43 
44  virtual SiStripMatchedRecHit2D * clone() const {return new SiStripMatchedRecHit2D( * this);}
45 #ifdef NO_DICT
46  virtual RecHitPointer cloneSH() const { return std::make_shared<SiStripMatchedRecHit2D>(*this);}
47 #endif
48 
49 
50  virtual int dimension() const {return 2;}
51  virtual void getKfComponents( KfComponentsHolder & holder ) const { getKfComponents2D(holder); }
52 
53 
54 
55  virtual bool sharesInput( const TrackingRecHit* other, SharedInputType what) const;
56 
57  bool sharesInput(TrackerSingleRecHit const & other) const;
58 
59  virtual std::vector<const TrackingRecHit*> recHits() const;
60 
61  virtual std::vector<TrackingRecHit*> recHits();
62 
63  virtual bool canImproveWithTrack() const {return true;}
64 private:
65  // double dispatch
66  virtual SiStripMatchedRecHit2D * clone(TkCloner const& cloner, TrajectoryStateOnSurface const& tsos) const {
67  return cloner(*this,tsos).release();
68  }
69 #ifdef NO_DICT
70  virtual RecHitPointer cloneSH(TkCloner const& cloner, TrajectoryStateOnSurface const& tsos) const {
71  return cloner.makeShared(*this,tsos);
72  }
73 #endif
74 
75  private:
77 };
78 
79 
80 inline
81 bool sharesClusters(SiStripMatchedRecHit2D const & h1, SiStripMatchedRecHit2D const & h2,
83  bool mono = h1.monoClusterRef()== h2.monoClusterRef();
84  bool stereo = h1.stereoClusterRef()== h2.stereoClusterRef();
85 
86  return (what==TrackingRecHit::all) ? (mono&&stereo) : (mono||stereo);
87 
88 }
89 
90 #endif
SharedInputType
definition of equality via shared input
virtual void getKfComponents(KfComponentsHolder &holder) const
SiStripCluster const & stereoCluster() const
OmniClusterRef clusterStereo_
virtual RecHitPointer cloneSH() const
virtual bool sharesInput(const TrackingRecHit *other, SharedInputType what) const
SiStripRecHit2D stereoHit() const
virtual bool canImproveWithTrack() const
virtual OmniClusterRef const & firstClusterRef() const
OmniClusterRef & stereoClusterRef()
SiStripRecHit2D monoHit() const
OmniClusterRef const & monoClusterRef() const
SiStripMatchedRecHit2D(const LocalPoint &pos, const LocalError &err, GeomDet const &idet, const SiStripRecHit2D *rMono, const SiStripRecHit2D *rStereo)
void getKfComponents2D(KfComponentsHolder &holder) const
virtual std::vector< const TrackingRecHit * > recHits() const =0
Access to component RecHits (if any)
unsigned int stereoId() const
virtual SiStripMatchedRecHit2D * clone(TkCloner const &cloner, TrajectoryStateOnSurface const &tsos) const
unsigned int monoId() const
virtual SiStripMatchedRecHit2D * clone() const
SiStripCluster const & monoCluster() const
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:6
GloballyPositioned< float >::LocalPoint LocalPoint
OmniClusterRef & monoClusterRef()
OmniClusterRef const & stereoClusterRef() const
virtual int dimension() const
id_type rawId() const
BaseTrackerRecHit Base
bool sharesClusters(SiStripMatchedRecHit2D const &h1, SiStripMatchedRecHit2D const &h2, TrackingRecHit::SharedInputType what)
Unlimited (trivial) bounds.