CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TSiStripRecHit2DLocalPos.h
Go to the documentation of this file.
1 #ifndef RECOTRACKER_TRANSIENTRACKINGRECHIT_TSiStripRecHit2DLocalPos_H
2 #define RECOTRACKER_TRANSIENTRACKINGRECHIT_TSiStripRecHit2DLocalPos_H
3 
11 
12 class TSiStripRecHit2DLocalPos GCC11_FINAL : public TransientTrackingRecHit{
13 public:
14 
15  typedef SiStripRecHit2D::ClusterRef SiStripClusterRef;
16 
18 
20 
21 
22  virtual void getKfComponents( KfComponentsHolder & holder ) const {
23  HelpertRecHit2DLocalPos().getKfComponents(holder, theHitData, *det());
24  }
25 
26  virtual AlgebraicVector parameters() const {return theHitData.parameters();}
28  return HelpertRecHit2DLocalPos().parError( theHitData.localPositionError(), *det());
29  // return theHitData->parametersError();
30  }
31 
32  virtual AlgebraicMatrix projectionMatrix() const {return theHitData.projectionMatrix();}
33  virtual int dimension() const {return theHitData.dimension();}
34 
35  virtual LocalPoint localPosition() const {return theHitData.localPosition();}
36  virtual LocalError localPositionError() const {return theHitData.localPositionError();}
37 
38  virtual const TrackingRecHit * hit() const {return &theHitData;};
39 
40  virtual std::vector<const TrackingRecHit*> recHits() const {
41  return hit()->recHits();
42  }
43  virtual std::vector<TrackingRecHit*> recHits() {
44  return theHitData.recHits();
45  }
46 
47  virtual const GeomDetUnit* detUnit() const;
48 
49  virtual bool canImproveWithTrack() const {return true;}
50 
51  //RC virtual TSiStripRecHit2DLocalPos* clone(const TrajectoryStateOnSurface& ts) const;
52  virtual RecHitPointer clone(const TrajectoryStateOnSurface& ts) const;
53 
54  // Extension of the TransientTrackingRecHit interface
55 
56  const SiStripRecHit2D* specificHit() const {return &theHitData;};
57  const StripClusterParameterEstimator* cpe() const {return theCPE;}
58 
59  static RecHitPointer build( const GeomDet * geom, const SiStripRecHit2D* rh,
61  bool computeCoarseLocalPosition=false) {
62  return RecHitPointer( new TSiStripRecHit2DLocalPos( geom, rh, cpe,computeCoarseLocalPosition));
63  }
64 
65 
66  static RecHitPointer build( const LocalPoint& pos, const LocalError& err,
67  const GeomDet* det,
68  const OmniClusterRef & clust,
69  const StripClusterParameterEstimator* cpe) {
70  return RecHitPointer( new TSiStripRecHit2DLocalPos( pos, err, det, clust, cpe));
71  }
72 
73  static RecHitPointer build( const LocalPoint& pos, const LocalError& err,
74  const GeomDet* det,
75  const SiStripClusterRef & clust,
76  const StripClusterParameterEstimator* cpe) {
77  return RecHitPointer( new TSiStripRecHit2DLocalPos( pos, err, det, OmniClusterRef(clust), cpe));
78  }
79 
80  static RecHitPointer build( const LocalPoint& pos, const LocalError& err,
81  const GeomDet* det,
82  const SiStripRegionalClusterRef & clust,
83  const StripClusterParameterEstimator* cpe) {
84  return RecHitPointer( new TSiStripRecHit2DLocalPos( pos, err, det, OmniClusterRef(clust), cpe));
85  }
86 
87 
88 
89 private:
90 
91  const StripClusterParameterEstimator* theCPE;
92  SiStripRecHit2D theHitData;
93 
94 
95 
96  TSiStripRecHit2DLocalPos (const GeomDet * geom, const SiStripRecHit2D* rh,
98  bool computeCoarseLocalPosition) :
99  TransientTrackingRecHit(geom), theCPE(cpe)
100  {
101  if (rh->hasPositionAndError() || !computeCoarseLocalPosition) {
102  theHitData = SiStripRecHit2D(*rh);
103  return;
104  }
105 
106  if (computeCoarseLocalPosition && !cpe){
107  edm::LogError("TSiStripRecHit2DLocalPos")<<" trying to compute coarse local position but CPE is not provided. Not computing local position from disk for the transient tracking rechit.";
108  theHitData = SiStripRecHit2D(*rh);
109  return;
110  }
111 
112  const GeomDetUnit* gdu = dynamic_cast<const GeomDetUnit*>(geom);
113  LogDebug("TSiStripRecHit2DLocalPos")<<"calculating coarse position/error.";
114  if (gdu){
115  StripClusterParameterEstimator::LocalValues lval= theCPE->localParameters(rh->stripCluster(), *gdu);
116  theHitData = SiStripRecHit2D(lval.first, lval.second, geom->geographicalId(),rh->omniCluster());
117  } else{
118  edm::LogError("TSiStripRecHit2DLocalPos")<<" geomdet does not cast into geomdet unit. cannot create strip local parameters.";
119  theHitData = SiStripRecHit2D(*rh);
120  }
121  }
122 
125  const GeomDet* det,
126  const OmniClusterRef & clust,
127  const StripClusterParameterEstimator* cpe) :
129  theCPE(cpe), theHitData(pos, err, det->geographicalId(), clust) {}
130 
131  virtual TSiStripRecHit2DLocalPos* clone() const {
132  return new TSiStripRecHit2DLocalPos(*this);
133  }
134 
135  virtual ConstRecHitContainer transientHits() const;
136 
137 };
138 
139 #endif
#define LogDebug(id)
ReferenceCountingPointer< TransientTrackingRecHit > RecHitPointer
virtual TransientTrackingRecHit * clone() const =0
static void getKfComponents(KfComponentsHolder &holder, const TrackingRecHit &hit2dLocalPos, const GeomDet &det)
virtual const TrackingRecHit * hit() const =0
std::pair< LocalPoint, LocalError > LocalValues
const SiStripRecHit2D * specificHit() const
static RecHitPointer build(const GeomDet *geom, const SiStripRecHit2D *rh, const StripClusterParameterEstimator *cpe, bool computeCoarseLocalPosition=false)
CLHEP::HepMatrix AlgebraicMatrix
virtual const TrackingRecHit * hit() const
virtual std::vector< const TrackingRecHit * > recHits() const =0
Access to component RecHits (if any)
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:72
virtual LocalPoint localPosition() const
virtual void getKfComponents(KfComponentsHolder &holder) const
virtual ~TSiStripRecHit2DLocalPos()
edm::LazyGetter< SiStripCluster >::value_ref SiStripRegionalClusterRef
virtual int dimension() const
static RecHitPointer build(const LocalPoint &pos, const LocalError &err, const GeomDet *det, const SiStripClusterRef &clust, const StripClusterParameterEstimator *cpe)
CLHEP::HepVector AlgebraicVector
virtual LocalError localPositionError() const
virtual AlgebraicMatrix projectionMatrix() const
TSiStripRecHit2DLocalPos(const LocalPoint &pos, const LocalError &err, const GeomDet *det, const OmniClusterRef &clust, const StripClusterParameterEstimator *cpe)
Creates the TrackingRecHit internally, avoids redundent cloning.
virtual std::vector< const TrackingRecHit * > recHits() const
Access to component RecHits (if any)
SiStripRecHit1D::ClusterRef SiStripClusterRef
TSiStripRecHit2DLocalPos(const GeomDet *geom, const SiStripRecHit2D *rh, const StripClusterParameterEstimator *cpe, bool computeCoarseLocalPosition)
SiStripRecHit2D::ClusterRef SiStripClusterRef
const GeomDet * det() const
The GomeDet* can be zero for InvalidTransientRecHits and for TConstraintRecHit2Ds.
CLHEP::HepSymMatrix AlgebraicSymMatrix
virtual std::vector< TrackingRecHit * > recHits()
Non-const access to component RecHits (if any)
virtual const GeomDetUnit * detUnit() const
TransientTrackingRecHit::ConstRecHitContainer ConstRecHitContainer
const StripClusterParameterEstimator * cpe() const
virtual TSiStripRecHit2DLocalPos * clone() const
virtual bool canImproveWithTrack() const
SiStripRecHit2D theHitData
static RecHitPointer build(const LocalPoint &pos, const LocalError &err, const GeomDet *det, const SiStripRegionalClusterRef &clust, const StripClusterParameterEstimator *cpe)
static RecHitPointer build(const LocalPoint &pos, const LocalError &err, const GeomDet *det, const OmniClusterRef &clust, const StripClusterParameterEstimator *cpe)
virtual AlgebraicVector parameters() const
virtual AlgebraicSymMatrix parametersError() const
virtual ConstRecHitContainer transientHits() const
Composite interface: returns the component hits, if any.
static AlgebraicSymMatrix parError(const LocalError &le, const GeomDet &det)
Our base class.
Definition: SiPixelRecHit.h:22