CMS 3D CMS Logo

TRecHit2DPosConstraint.h
Go to the documentation of this file.
1 #ifndef RECOTRACKER_TRANSIENTRACKINGRECHIT_TRecHit2DPosConstraint_H
2 #define RECOTRACKER_TRANSIENTRACKINGRECHIT_TRecHit2DPosConstraint_H
3 
6 
7 
8 
9 class TRecHit2DPosConstraint final : public TrackingRecHit {
10 public:
11 
13  const LocalError& err,
14  const Surface* surface):
16  pos_(pos),err_(err),surface_(surface) {}
17 
19  const LocalPoint& pos,
20  const LocalError& err,
21  const Surface* surface):
23  pos_(pos),err_(err) {}
24 
27 
29 
30  AlgebraicVector parameters() const override {
33  result[0] = lp.x();
34  result[1] = lp.y();
35  return result;
36  }
37 
41  m[0][0] = le.xx();
42  m[0][1] = le.xy();
43  m[1][1] = le.yy();
44  return m;
45  }
46 
47  AlgebraicMatrix projectionMatrix() const override {
49  theProjectionMatrix = AlgebraicMatrix( 2, 5, 0);
50  theProjectionMatrix[0][3] = 1;
51  theProjectionMatrix[1][4] = 1;
52  return theProjectionMatrix;
53  }
54  int dimension() const override {return 2;}
55 
56  LocalPoint localPosition() const override {return pos_;}
57  LocalError localPositionError() const override {return err_;}
58 
59 
60  std::vector<const TrackingRecHit*> recHits() const override { return std::vector<const TrackingRecHit*>(); }
61  std::vector<TrackingRecHit*> recHits() override { return std::vector<TrackingRecHit*>(); }
62 
63  // use position?
64  bool sharesInput( const TrackingRecHit*, SharedInputType) const override { return false;}
65 
66  bool canImproveWithTrack() const override {return false;}
67 
68  virtual RecHitPointer clone (const TrajectoryStateOnSurface& ts) const {return RecHitPointer(clone());}
69 
70  static RecHitPointer build( const LocalPoint& pos, const LocalError& err,
71  const Surface* surface) {
72  return RecHitPointer( new TRecHit2DPosConstraint( pos, err, surface));
73  }
74 
75  const Surface * surface() const override {return det() ? &(det()->surface()) : &(*surface_);}
76 
77  GlobalPoint globalPosition() const override { return surface()->toGlobal(localPosition());}
79  float errorGlobalR() const override { return std::sqrt(globalPositionError().rerr(globalPosition()));}
80  float errorGlobalZ() const override { return std::sqrt(globalPositionError().czz()); }
81  float errorGlobalRPhi() const override { return globalPosition().perp()*sqrt(globalPositionError().phierr(globalPosition())); }
82 
83 
84 private:
88 
89  TRecHit2DPosConstraint * clone() const override {
90  return new TRecHit2DPosConstraint(*this);
91  }
92 
93 };
94 
95 #endif
SharedInputType
definition of equality via shared input
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:106
static GlobalError transform(const LocalError &le, const Surface &surf)
float xx() const
Definition: LocalError.h:24
const Surface * surface() const override
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
T perp() const
Definition: PV3DBase.h:72
static RecHitPointer build(const LocalPoint &pos, const LocalError &err, const Surface *surface)
LocalPoint localPosition() const override
T y() const
Definition: PV3DBase.h:63
bool canImproveWithTrack() const override
GlobalPoint globalPosition() const override
static const AlgebraicMatrix theProjectionMatrix
Definition: CSCSegment.cc:80
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
int dimension() const override
TRecHit2DPosConstraint(const GeomDet &idet, const LocalPoint &pos, const LocalError &err, const Surface *surface)
ConstReferenceCountingPointer< Surface > surface_
float xy() const
Definition: LocalError.h:25
LocalError localPositionError() const override
CLHEP::HepMatrix AlgebraicMatrix
TRecHit2DPosConstraint * clone() const override
float yy() const
Definition: LocalError.h:26
const GeomDet * det() const
float errorGlobalR() const override
virtual RecHitPointer clone(const TrajectoryStateOnSurface &ts) const
T sqrt(T t)
Definition: SSEVec.h:18
AlgebraicMatrix projectionMatrix() const override
std::shared_ptr< TrackingRecHit const > RecHitPointer
float errorGlobalZ() const override
CLHEP::HepVector AlgebraicVector
GlobalError globalPositionError() const override
bool sharesInput(const TrackingRecHit *, SharedInputType) const override
CLHEP::HepSymMatrix AlgebraicSymMatrix
std::vector< TrackingRecHit * > recHits() override
Non-const access to component RecHits (if any)
AlgebraicVector parameters() const override
T x() const
Definition: PV3DBase.h:62
float errorGlobalRPhi() const override
TRecHit2DPosConstraint(const LocalPoint &pos, const LocalError &err, const Surface *surface)
AlgebraicSymMatrix parametersError() const override