CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ProjectedSiStripRecHit2D.h
Go to the documentation of this file.
1 #ifndef ProjectedSiStripRecHit2D_H
2 #define ProjectedSiStripRecHit2D_H
3 
5 
6 #include<iostream>
7 
8 class ProjectedSiStripRecHit2D GCC11_FINAL : public TrackerSingleRecHit {
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 
18  ProjectedSiStripRecHit2D() : theOriginalDet(nullptr) {}
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,
36  isMono(idet,originalDet) ? trackerHitRTTI::projMono: trackerHitRTTI::projStereo,
37  clus),
38  theOriginalDet(&originalDet) {
39  assert(originalId()==originalDet.geographicalId());
40  }
41 
42 
43  virtual bool canImproveWithTrack() const {return true;}
44 
45  virtual ProjectedSiStripRecHit2D* clone() const {return new ProjectedSiStripRecHit2D( *this); }
46 
47 
48  virtual int dimension() const {return 2;}
49  virtual void getKfComponents( KfComponentsHolder & holder ) const { getKfComponents2D(holder); }
50 
52  ClusterRef cluster() const { return cluster_strip() ; }
53  const GeomDetUnit* originalDet() const {
54  return static_cast<const GeomDetUnit*>(theOriginalDet);
55  }
56  unsigned int originalId() const { return trackerHitRTTI::projId(*this);}
57 
58  // not useful only for backward compatibility
59  SiStripRecHit2D originalHit() const { return SiStripRecHit2D(originalId(), omniClusterRef());}
60 
61 
62  virtual std::vector<const TrackingRecHit*> recHits() const{
63  std::vector<const TrackingRecHit*> rechits;
64  return rechits;
65  }
66  virtual std::vector<TrackingRecHit*> recHits() {
67  std::vector<TrackingRecHit*> rechits;
68  return rechits;
69  }
70 
71 
72 private:
73  // double dispatch
74  virtual ProjectedSiStripRecHit2D * clone(TkCloner const& cloner, TrajectoryStateOnSurface const& tsos) const {
75  return cloner(*this,tsos);
76  }
77 #ifdef NO_DICT
78  virtual ConstRecHitPointer cloneSH(TkCloner const& cloner, TrajectoryStateOnSurface const& tsos) const {
79  return cloner.makeShared(*this,tsos);
80  }
81 #endif
82 
83 private:
85 
86 };
87 
88 #endif
ClusterStripRef cluster_strip() const
virtual void getKfComponents(KfComponentsHolder &holder) const
virtual RecHitPointer cloneSH() const
#define nullptr
virtual ProjectedSiStripRecHit2D * clone() const
TrackerSingleRecHit Base
virtual bool canImproveWithTrack() const
virtual std::vector< TrackingRecHit * > recHits()
Non-const access to component RecHits (if any)
TransientTrackingRecHit::ConstRecHitPointer ConstRecHitPointer
unsigned int projId(TrackingRecHit const &hit)
virtual ProjectedSiStripRecHit2D * clone(TkCloner const &cloner, TrajectoryStateOnSurface const &tsos) const
void getKfComponents2D(KfComponentsHolder &holder) const
unsigned int originalId() const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:72
OmniClusterRef::ClusterStripRef ClusterRef
const GeomDetUnit * originalDet() const
ProjectedSiStripRecHit2D(const LocalPoint &pos, const LocalError &err, GeomDet const &idet, SiStripRecHit2D const &originalHit)
OmniClusterRef const & omniClusterRef() const
ClusterRef cluster() const
static bool isMono(GeomDet const &gdet, GeomDet const &sdet)
ProjectedSiStripRecHit2D(const LocalPoint &pos, const LocalError &err, GeomDet const &idet, GeomDet const &originalDet, CluRef const &clus)
const GeomDet * theOriginalDet
SiStripRecHit2D originalHit() const
virtual int dimension() const
virtual std::vector< const TrackingRecHit * > recHits() const
Access to component RecHits (if any)
Unlimited (trivial) bounds.