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 
11  inline static bool isMono(GeomDet const & gdet, GeomDet const & sdet) {
12  return (sdet.geographicalId()-gdet.geographicalId())==2;
13  }
14 
15 
17 
19 
21  GeomDet const & idet,
22  SiStripRecHit2D const & originalHit) :
23  TrackerSingleRecHit(pos, err, idet,
24  isMono(idet,*originalHit.det()) ? trackerHitRTTI::projMono: trackerHitRTTI::projStereo,
25  originalHit.omniCluster()),
26  theOriginalDet(originalHit.det()) {
27 // std::cout << getRTTI() << ' ' << originalHit.rawId() << ' ' << idet.geographicalId().rawId() << ' ' << originalId() << std::endl;
28  assert(originalId()==originalHit.rawId());
29  }
30 
31  template<typename CluRef>
33  GeomDet const & idet, GeomDet const & originalDet,
34  CluRef const& clus) :
35  TrackerSingleRecHit(pos, err, idet,
37  clus),
38  theOriginalDet(&originalDet) {
39  assert(originalId()==originalDet.geographicalId());
40  }
41 
42 
43  void setDet(const GeomDet & idet) override;
44 
45  bool canImproveWithTrack() const override {return true;}
46 
47  ProjectedSiStripRecHit2D* clone() const override {return new ProjectedSiStripRecHit2D( *this); }
48 
49 
50  int dimension() const override {return 2;}
51  void getKfComponents( KfComponentsHolder & holder ) const override { getKfComponents2D(holder); }
52 
54  ClusterRef cluster() const { return cluster_strip() ; }
55  const GeomDetUnit* originalDet() const {
56  return static_cast<const GeomDetUnit*>(theOriginalDet);
57  }
58  unsigned int originalId() const { return trackerHitRTTI::projId(*this);}
59 
60  // not useful only for backward compatibility
62 
63 
64  std::vector<const TrackingRecHit*> recHits() const override{
65  std::vector<const TrackingRecHit*> rechits;
66  return rechits;
67  }
68  std::vector<TrackingRecHit*> recHits() override {
69  std::vector<TrackingRecHit*> rechits;
70  return rechits;
71  }
72 
73 
74 private:
75  // double dispatch
76  ProjectedSiStripRecHit2D * clone_(TkCloner const& cloner, TrajectoryStateOnSurface const& tsos) const override {
77  return cloner(*this,tsos).release();
78  }
79 #ifndef __GCCXML__
80  ConstRecHitPointer cloneSH_(TkCloner const& cloner, TrajectoryStateOnSurface const& tsos) const override {
81  return cloner.makeShared(*this,tsos);
82  }
83 #endif
84 
85 private:
87 
88 };
89 
90 #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:79
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