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
SiStripMatchedRecHit2D::monoId
unsigned int monoId() const
Definition: SiStripMatchedRecHit2D.h:29
TrackingRecHit::rawId
id_type rawId() const
Definition: TrackingRecHit.h:119
GeomDet
Definition: GeomDet.h:27
SiStripMatchedRecHit2D::stereoCluster
SiStripCluster const & stereoCluster() const
Definition: SiStripMatchedRecHit2D.h:40
SiStripMatchedRecHit2D::getKfComponents
void getKfComponents(KfComponentsHolder &holder) const override
Definition: SiStripMatchedRecHit2D.h:49
pos
Definition: PixelAliasList.h:18
SiStripMatchedRecHit2D::SiStripMatchedRecHit2D
SiStripMatchedRecHit2D()
Definition: SiStripMatchedRecHit2D.h:12
SiStripMatchedRecHit2D::clone
SiStripMatchedRecHit2D * clone() const override
Definition: SiStripMatchedRecHit2D.h:43
SiStripMatchedRecHit2D::dimension
int dimension() const override
Definition: SiStripMatchedRecHit2D.h:48
SiStripRecHit2D
Definition: SiStripRecHit2D.h:7
TrackingRecHit::RecHitPointer
std::shared_ptr< TrackingRecHit const > RecHitPointer
Definition: TrackingRecHit.h:24
OmniClusterRef
Definition: OmniClusterRef.h:12
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
SiStripMatchedRecHit2D::clusterMono_
OmniClusterRef clusterMono_
Definition: SiStripMatchedRecHit2D.h:73
TrackingRecHit::SharedInputType
SharedInputType
definition of equality via shared input
Definition: TrackingRecHit.h:59
TkCloner
Definition: TkCloner.h:16
BaseTrackerRecHit
Definition: BaseTrackerRecHit.h:15
OmniClusterRef::stripCluster
SiStripCluster const & stripCluster() const
Definition: OmniClusterRef.h:55
SiStripMatchedRecHit2D::stereoHit
SiStripRecHit2D stereoHit() const
Definition: SiStripMatchedRecHit2D.h:25
trackingPlots.other
other
Definition: trackingPlots.py:1467
Point3DBase< float, LocalTag >
SiStripMatchedRecHit2D::monoClusterRef
OmniClusterRef & monoClusterRef()
Definition: SiStripMatchedRecHit2D.h:38
SiStripMatchedRecHit2D::stereoId
unsigned int stereoId() const
Definition: SiStripMatchedRecHit2D.h:28
TrackingRecHit::all
Definition: TrackingRecHit.h:59
SiStripMatchedRecHit2D::Base
BaseTrackerRecHit Base
Definition: SiStripMatchedRecHit2D.h:10
LocalError
Definition: LocalError.h:12
SiStripMatchedRecHit2D::stereoClusterRef
OmniClusterRef const & stereoClusterRef() const
Definition: SiStripMatchedRecHit2D.h:34
SiStripMatchedRecHit2D::firstClusterRef
OmniClusterRef const & firstClusterRef() const override
Definition: SiStripMatchedRecHit2D.h:32
match
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
Definition: Utils.h:10
SiStripMatchedRecHit2D::monoHit
SiStripRecHit2D monoHit() const
Definition: SiStripMatchedRecHit2D.h:26
SiStripMatchedRecHit2D::clone_
SiStripMatchedRecHit2D * clone_(TkCloner const &cloner, TrajectoryStateOnSurface const &tsos) const override
Definition: SiStripMatchedRecHit2D.h:63
TkCloner.h
TkCloner::makeShared
TrackingRecHit::ConstRecHitPointer makeShared(TrackingRecHit::ConstRecHitPointer const &hit, TrajectoryStateOnSurface const &tsos) const
Definition: TkCloner.h:24
SiStripMatchedRecHit2D::clusterStereo_
OmniClusterRef clusterStereo_
Definition: SiStripMatchedRecHit2D.h:73
SiStripMatchedRecHit2D::stereoClusterRef
OmniClusterRef & stereoClusterRef()
Definition: SiStripMatchedRecHit2D.h:37
SiStripMatchedRecHit2D::cloneSH_
RecHitPointer cloneSH_(TkCloner const &cloner, TrajectoryStateOnSurface const &tsos) const override
Definition: SiStripMatchedRecHit2D.h:67
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
KfComponentsHolder
Definition: KfComponentsHolder.h:13
SiStripMatchedRecHit2D::monoClusterRef
OmniClusterRef const & monoClusterRef() const
Definition: SiStripMatchedRecHit2D.h:35
TrackingRecHit
Definition: TrackingRecHit.h:21
SiStripMatchedRecHit2D::SiStripMatchedRecHit2D
SiStripMatchedRecHit2D(const LocalPoint &pos, const LocalError &err, GeomDet const &idet, const SiStripRecHit2D *rMono, const SiStripRecHit2D *rStereo)
Definition: SiStripMatchedRecHit2D.h:15
SiStripMatchedRecHit2D::sharesInput
bool sharesInput(const TrackingRecHit *other, SharedInputType what) const override
Definition: SiStripMatchedRecHit2D.cc:3
SiStripMatchedRecHit2D
Definition: SiStripMatchedRecHit2D.h:8
SiStripMatchedRecHit2D::~SiStripMatchedRecHit2D
~SiStripMatchedRecHit2D() override
Definition: SiStripMatchedRecHit2D.h:13
SiStripMatchedRecHit2D::monoCluster
SiStripCluster const & monoCluster() const
Definition: SiStripMatchedRecHit2D.h:41
TrackerSingleRecHit
Definition: TrackerSingleRecHit.h:11
SiStripMatchedRecHit2D::canImproveWithTrack
bool canImproveWithTrack() const override
Definition: SiStripMatchedRecHit2D.h:59
BaseTrackerRecHit::getKfComponents2D
void getKfComponents2D(KfComponentsHolder &holder) const
Definition: BaseTrackerRecHit.cc:53
SiStripMatchedRecHit2D::cloneSH
RecHitPointer cloneSH() const override
Definition: SiStripMatchedRecHit2D.h:45
SiStripMatchedRecHit2D::recHits
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
Definition: SiStripMatchedRecHit2D.cc:30
trackerHitRTTI
Definition: trackerHitRTTI.h:6
sharesClusters
bool sharesClusters(SiStripMatchedRecHit2D const &h1, SiStripMatchedRecHit2D const &h2, TrackingRecHit::SharedInputType what)
Definition: SiStripMatchedRecHit2D.h:76
SiStripCluster
Definition: SiStripCluster.h:9
SiStripRecHit2D.h