test
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 
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...
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
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 #ifndef __GCCXML__
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 #ifndef __GCCXML__
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
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
OmniClusterRef & stereoClusterRef()
virtual std::vector< const TrackingRecHit * > recHits() const
Access to component RecHits (if any)
unsigned int stereoId() const
virtual int dimension() const
SiStripCluster const & monoCluster() const
OmniClusterRef const & stereoClusterRef() const
virtual RecHitPointer cloneSH(TkCloner const &cloner, TrajectoryStateOnSurface const &tsos) const
virtual bool sharesInput(const TrackingRecHit *other, SharedInputType what) const
SiStripCluster const & stripCluster() const
virtual RecHitPointer cloneSH() const
virtual bool canImproveWithTrack() const
void getKfComponents2D(KfComponentsHolder &holder) const
OmniClusterRef const & monoClusterRef() const
std::shared_ptr< TrackingRecHit const > RecHitPointer
virtual void getKfComponents(KfComponentsHolder &holder) const
SiStripRecHit2D stereoHit() const
virtual OmniClusterRef const & firstClusterRef() const
TrackingRecHit *operator()[[cms TrackingRecHit::ConstRecHitPointer makeShared(TrackingRecHit::ConstRecHitPointer const &hit, TrajectoryStateOnSurface const &tsos) const
Definition: TkCloner.h:22
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:10
unsigned int monoId() const
virtual SiStripMatchedRecHit2D * clone() const
virtual SiStripMatchedRecHit2D * clone(TkCloner const &cloner, TrajectoryStateOnSurface const &tsos) const
id_type rawId() const
bool sharesClusters(SiStripMatchedRecHit2D const &h1, SiStripMatchedRecHit2D const &h2, TrackingRecHit::SharedInputType what)
SiStripMatchedRecHit2D(const LocalPoint &pos, const LocalError &err, GeomDet const &idet, const SiStripRecHit2D *rMono, const SiStripRecHit2D *rStereo)