CMS 3D CMS Logo

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