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 
9 class TRecHit2DPosConstraint GCC11_FINAL : public TransientTrackingRecHit {
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 
80  TRecHit2DPosConstraint( const TRecHit2DPosConstraint& other ):
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
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:114
virtual LocalError localPositionError() const
static GlobalError transform(const LocalError &le, const Surface &surf)
virtual GlobalError globalPositionError() const
float xx() const
Definition: LocalError.h:24
virtual const Surface * surface() const
virtual const Surface * surface() const
T perp() const
Definition: PV3DBase.h:72
virtual bool sharesInput(const TrackingRecHit *, SharedInputType) const
virtual AlgebraicSymMatrix parametersError() const
virtual TrackingRecHit * cloneHit() const
GloballyPositioned< float >::GlobalPoint GlobalPoint
Definition: MagVolume.h:20
T y() const
Definition: PV3DBase.h:63
const LocalError err_
virtual bool canImproveWithTrack() const
virtual std::vector< TrackingRecHit * > recHits()
Non-const access to component RecHits (if any)
virtual GlobalPoint globalPosition() const
static const AlgebraicMatrix theProjectionMatrix
Definition: CSCSegment.cc:80
ConstReferenceCountingPointer< Surface > surface_
virtual AlgebraicMatrix projectionMatrix() const
const LocalPoint pos_
float xy() const
Definition: LocalError.h:25
virtual ~TRecHit2DPosConstraint()
CLHEP::HepMatrix AlgebraicMatrix
virtual const TrackingRecHit * hit() const
float yy() const
Definition: LocalError.h:26
T sqrt(T t)
Definition: SSEVec.h:48
TRecHit2DPosConstraint(const LocalPoint &pos, const LocalError &err, const Surface *surface)
Creates the TrackingRecHit internally, avoids redundent cloning.
static RecHitPointer build(const LocalPoint &pos, const LocalError &err, const Surface *surface)
tuple result
Definition: query.py:137
virtual const GeomDetUnit * detUnit() const
virtual AlgebraicVector parameters() const
virtual TRecHit2DPosConstraint * clone() const
std::shared_ptr< TrackingRecHit const > RecHitPointer
virtual float errorGlobalZ() const
virtual LocalPoint localPosition() const
CLHEP::HepVector AlgebraicVector
virtual LocalError localPositionError() const =0
virtual RecHitPointer clone(const TrajectoryStateOnSurface &ts) const
CLHEP::HepSymMatrix AlgebraicSymMatrix
virtual float errorGlobalR() const
virtual GlobalPoint globalPosition() const
T x() const
Definition: PV3DBase.h:62
virtual LocalPoint localPosition() const =0
virtual float errorGlobalRPhi() const
TRecHit2DPosConstraint(const TRecHit2DPosConstraint &other)
virtual GlobalError globalPositionError() const
virtual int dimension() const
virtual std::vector< const TrackingRecHit * > recHits() const
Access to component RecHits (if any)
Unlimited (trivial) bounds.