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 
10 public:
11 
13 
14  AlgebraicVector parameters() const override {
17  result[0] = lp.x();
18  result[1] = lp.y();
19  return result;
20  }
21 
25  m[0][0] = le.xx();
26  m[0][1] = le.xy();
27  m[1][1] = le.yy();
28  return m;
29  }
30 
31  AlgebraicMatrix projectionMatrix() const override {
33  theProjectionMatrix = AlgebraicMatrix( 2, 5, 0);
34  theProjectionMatrix[0][3] = 1;
35  theProjectionMatrix[1][4] = 1;
36  return theProjectionMatrix;
37  }
38  int dimension() const override {return 2;}
39 
40  LocalPoint localPosition() const override {return pos_;}
41  LocalError localPositionError() const override {return err_;}
42 
43  const TrackingRecHit * hit() const override {return nullptr;}//fixme return invalid
44  TrackingRecHit * cloneHit() const override { return nullptr;}
45 
46  std::vector<const TrackingRecHit*> recHits() const override { return std::vector<const TrackingRecHit*>(); }
47  std::vector<TrackingRecHit*> recHits() override { return std::vector<TrackingRecHit*>(); }
48  bool sharesInput( const TrackingRecHit*, SharedInputType) const override { return false;}
49 
50  bool canImproveWithTrack() const override {return false;}
51 
52  virtual RecHitPointer clone (const TrajectoryStateOnSurface& ts) const {return RecHitPointer(clone());}
53 
54  const GeomDetUnit* detUnit() const override {return nullptr;}
55 
56  static RecHitPointer build( const LocalPoint& pos, const LocalError& err,
57  const Surface* surface) {
58  return RecHitPointer( new TRecHit2DPosConstraint( pos, err, surface));
59  }
60 
61  const Surface * surface() const override {return &(*surface_);}
62 
63  GlobalPoint globalPosition() const override { return surface()->toGlobal(localPosition());}
65  float errorGlobalR() const override { return std::sqrt(globalPositionError().rerr(globalPosition()));}
66  float errorGlobalZ() const override { return std::sqrt(globalPositionError().czz()); }
67  float errorGlobalRPhi() const override { return globalPosition().perp()*sqrt(globalPositionError().phierr(globalPosition())); }
68 
69 
70 private:
76  const LocalError& err,
77  const Surface* surface):
78  pos_(pos),err_(err),surface_(surface) {}
79 
81  pos_( other.localPosition() ),err_( other.localPositionError() ), surface_((other.surface())) {}
82 
83  TRecHit2DPosConstraint * clone() const override {
84  return new TRecHit2DPosConstraint(*this);
85  }
86 
87 };
88 
89 #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)
const TrackingRecHit * hit() const override
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
int dimension() const override
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
float errorGlobalR() const override
virtual RecHitPointer clone(const TrajectoryStateOnSurface &ts) const
TrackingRecHit * cloneHit() const override
T sqrt(T t)
Definition: SSEVec.h:18
const GeomDetUnit * detUnit() const override
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
TRecHit2DPosConstraint(const TRecHit2DPosConstraint &other)
T x() const
Definition: PV3DBase.h:62
float errorGlobalRPhi() const override
TRecHit2DPosConstraint(const LocalPoint &pos, const LocalError &err, const Surface *surface)
Creates the TrackingRecHit internally, avoids redundent cloning.
AlgebraicSymMatrix parametersError() const override