CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TRecHit2DPosConstraint.h
Go to the documentation of this file.
1 #ifndef RECOTRACKER_TRANSIENTRACKINGRECHIT_TRecHit2DPosConstraint_H
2 #define RECOTRACKER_TRANSIENTRACKINGRECHIT_TRecHit2DPosConstraint_H
3 
6 
7 class GeomDetUnit;
8 
10 public:
11 
13 
14  virtual AlgebraicVector parameters() const {
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 
33  theProjectionMatrix = AlgebraicMatrix( 2, 5, 0);
34  theProjectionMatrix[0][3] = 1;
35  theProjectionMatrix[1][4] = 1;
36  return theProjectionMatrix;
37  }
38  virtual int dimension() const {return 2;}
39 
40  virtual LocalPoint localPosition() const {return pos_;}
41  virtual LocalError localPositionError() const {return err_;}
42 
43  virtual const TrackingRecHit * hit() const {return 0;}//fixme return invalid
44  virtual TrackingRecHit * cloneHit() const { return 0;}
45 
46  virtual std::vector<const TrackingRecHit*> recHits() const { return std::vector<const TrackingRecHit*>(); }
47  virtual std::vector<TrackingRecHit*> recHits() { return std::vector<TrackingRecHit*>(); }
48  virtual bool sharesInput( const TrackingRecHit*, SharedInputType) const { return false;}
49 
50  virtual bool canImproveWithTrack() const {return false;}
51 
52  virtual RecHitPointer clone (const TrajectoryStateOnSurface& ts) const {return RecHitPointer(clone());}
53 
54  virtual const GeomDetUnit* detUnit() const {return 0;}
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  virtual const Surface * surface() const {return &(*surface_);}
62 
63  virtual GlobalPoint globalPosition() const { return surface()->toGlobal(localPosition());}
65  virtual float errorGlobalR() const { return std::sqrt(globalPositionError().rerr(globalPosition()));}
66  virtual float errorGlobalZ() const { return std::sqrt(globalPositionError().czz()); }
67  virtual float errorGlobalRPhi() const { 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  virtual TRecHit2DPosConstraint * clone() const {
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:114
static GlobalError transform(const LocalError &le, const Surface &surf)
float xx() const
Definition: LocalError.h:24
#define GCC11_FINAL
T perp() const
Definition: PV3DBase.h:72
virtual TrackingRecHit * cloneHit() const
virtual LocalPoint localPosition() const
static RecHitPointer build(const LocalPoint &pos, const LocalError &err, const Surface *surface)
virtual GlobalPoint globalPosition() const
virtual AlgebraicMatrix projectionMatrix() const
T y() const
Definition: PV3DBase.h:63
static const AlgebraicMatrix theProjectionMatrix
Definition: CSCSegment.cc:80
virtual float errorGlobalRPhi() const
ConstReferenceCountingPointer< Surface > surface_
virtual const TrackingRecHit * hit() const
float xy() const
Definition: LocalError.h:25
virtual TRecHit2DPosConstraint * clone() const
virtual std::vector< const TrackingRecHit * > recHits() const
Access to component RecHits (if any)
CLHEP::HepMatrix AlgebraicMatrix
float yy() const
Definition: LocalError.h:26
virtual RecHitPointer clone(const TrajectoryStateOnSurface &ts) const
T sqrt(T t)
Definition: SSEVec.h:48
tuple result
Definition: query.py:137
virtual const GeomDetUnit * detUnit() const
virtual float errorGlobalR() const
virtual const Surface * surface() const
virtual float errorGlobalZ() const
std::shared_ptr< TrackingRecHit const > RecHitPointer
virtual std::vector< TrackingRecHit * > recHits()
Non-const access to component RecHits (if any)
virtual bool sharesInput(const TrackingRecHit *, SharedInputType) const
virtual bool canImproveWithTrack() const
CLHEP::HepVector AlgebraicVector
virtual int dimension() const
virtual AlgebraicSymMatrix parametersError() const
CLHEP::HepSymMatrix AlgebraicSymMatrix
virtual LocalError localPositionError() const
TRecHit2DPosConstraint(const TRecHit2DPosConstraint &other)
virtual AlgebraicVector parameters() const
virtual GlobalError globalPositionError() const
T x() const
Definition: PV3DBase.h:62
TRecHit2DPosConstraint(const LocalPoint &pos, const LocalError &err, const Surface *surface)
Creates the TrackingRecHit internally, avoids redundent cloning.