CMS 3D CMS Logo

ProjectedSiStripRecHit2D.h
Go to the documentation of this file.
1 #ifndef ProjectedSiStripRecHit2D_H
2 #define ProjectedSiStripRecHit2D_H
3 
5 
6 // #include<iostream>
7 
9 public:
10  inline static bool isMono(GeomDet const& gdet, GeomDet const& sdet) {
11  return (sdet.geographicalId() - gdet.geographicalId()) == 2;
12  }
13 
15 
17 
19  const LocalError& err,
20  GeomDet const& idet,
22  : TrackerSingleRecHit(pos,
23  err,
24  idet,
25  isMono(idet, *originalHit.det()) ? trackerHitRTTI::projMono : trackerHitRTTI::projStereo,
26  originalHit.omniCluster()),
27  theOriginalDet(originalHit.det()) {
28  // std::cout << getRTTI() << ' ' << originalHit.rawId() << ' ' << idet.geographicalId().rawId() << ' ' << originalId() << std::endl;
29  assert(originalId() == originalHit.rawId());
30  }
31 
32  template <typename CluRef>
34  const LocalPoint& pos, const LocalError& err, GeomDet const& idet, GeomDet const& originalDet, CluRef const& clus)
36  pos, err, idet, isMono(idet, originalDet) ? trackerHitRTTI::projMono : trackerHitRTTI::projStereo, clus),
37  theOriginalDet(&originalDet) {
38  assert(originalId() == originalDet.geographicalId());
39  }
40 
41  void setDet(const GeomDet& idet) override;
42 
43  bool canImproveWithTrack() const override { return true; }
44 
45  ProjectedSiStripRecHit2D* clone() const override { return new ProjectedSiStripRecHit2D(*this); }
46 
47  int dimension() const override { return 2; }
48  void getKfComponents(KfComponentsHolder& holder) const override { getKfComponents2D(holder); }
49 
51  ClusterRef cluster() const { return cluster_strip(); }
52  const GeomDetUnit* originalDet() const { return static_cast<const GeomDetUnit*>(theOriginalDet); }
53  unsigned int originalId() const { return trackerHitRTTI::projId(*this); }
54 
55  // not useful only for backward compatibility
57 
58  std::vector<const TrackingRecHit*> recHits() const override {
59  std::vector<const TrackingRecHit*> rechits;
60  return rechits;
61  }
62  std::vector<TrackingRecHit*> recHits() override {
63  std::vector<TrackingRecHit*> rechits;
64  return rechits;
65  }
66 
67 private:
68  // double dispatch
69  ProjectedSiStripRecHit2D* clone_(TkCloner const& cloner, TrajectoryStateOnSurface const& tsos) const override {
70  return cloner(*this, tsos).release();
71  }
72 #ifndef __GCCXML__
73  ConstRecHitPointer cloneSH_(TkCloner const& cloner, TrajectoryStateOnSurface const& tsos) const override {
74  return cloner.makeShared(*this, tsos);
75  }
76 #endif
77 
78 private:
80 };
81 
82 #endif
ClusterStripRef cluster_strip() const
ProjectedSiStripRecHit2D * clone() const override
#define nullptr
void setDet(const GeomDet &idet) override
TrackingRecHit::ConstRecHitPointer makeShared(TrackingRecHit::ConstRecHitPointer const &hit, TrajectoryStateOnSurface const &tsos) const
Definition: TkCloner.h:23
unsigned int originalId() const
unsigned int projId(TrackingRecHit const &hit)
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
const GeomDet * det() const
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
void getKfComponents2D(KfComponentsHolder &holder) const
OmniClusterRef const & omniCluster() const
ConstRecHitPointer cloneSH_(TkCloner const &cloner, TrajectoryStateOnSurface const &tsos) const override
const GeomDetUnit * originalDet() const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:64
void getKfComponents(KfComponentsHolder &holder) const override
SiStripRecHit2D originalHit() const
OmniClusterRef const & omniClusterRef() const
std::vector< TrackingRecHit * > recHits() override
Non-const access to component RecHits (if any)
bool canImproveWithTrack() const override
ProjectedSiStripRecHit2D(const LocalPoint &pos, const LocalError &err, GeomDet const &idet, GeomDet const &originalDet, CluRef const &clus)
ProjectedSiStripRecHit2D * clone_(TkCloner const &cloner, TrajectoryStateOnSurface const &tsos) const override
static bool isMono(GeomDet const &gdet, GeomDet const &sdet)
ProjectedSiStripRecHit2D(const LocalPoint &pos, const LocalError &err, GeomDet const &idet, SiStripRecHit2D const &originalHit)
OmniClusterRef::ClusterStripRef ClusterRef
id_type rawId() const