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 
32  AlgebraicMatrix theProjectionMatrix;
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 clone();}
53 
54  virtual const GeomDetUnit* detUnit() const {return 0;}
55  virtual const GeomDet* det() const {return 0;}
56 
57  static RecHitPointer build( const LocalPoint& pos, const LocalError& err,
58  const Surface* surface) {
59  return RecHitPointer( new TRecHit2DPosConstraint( pos, err, surface));
60  }
61 
62  virtual const Surface * surface() const {return &(*surface_);}
63 
64  virtual GlobalPoint globalPosition() const { return surface()->toGlobal(localPosition());}
66  virtual float errorGlobalR() const { return std::sqrt(globalPositionError().rerr(globalPosition()));}
67  virtual float errorGlobalZ() const { return std::sqrt(globalPositionError().czz()); }
68  virtual float errorGlobalRPhi() const { return globalPosition().perp()*sqrt(globalPositionError().phierr(globalPosition())); }
69 
70 
71 private:
77  const LocalError& err,
78  const Surface* surface):
79  pos_(pos),err_(err),surface_(surface) {}
80 
81  TRecHit2DPosConstraint( const TRecHit2DPosConstraint& other ):
82  pos_( other.localPosition() ),err_( other.localPositionError() ), surface_((other.surface())) {}
83 
84  virtual TRecHit2DPosConstraint * clone() const {
85  return new TRecHit2DPosConstraint(*this);
86  }
87 
88 };
89 
90 #endif
ReferenceCountingPointer< TransientTrackingRecHit > RecHitPointer
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
The surface of the GeometricSearchDet.
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
virtual const GeomDet * det() const
The GomeDet* can be zero for InvalidTransientRecHits and for TConstraintRecHit2Ds.
const LocalError err_
virtual bool canImproveWithTrack() const
virtual std::vector< TrackingRecHit * > recHits()
Non-const access to component RecHits (if any)
ConstReferenceCountingPointer< Surface > surface_
virtual AlgebraicMatrix projectionMatrix() const
const LocalPoint pos_
float xy() const
Definition: LocalError.h:25
virtual ~TRecHit2DPosConstraint()
virtual GlobalPoint globalPosition() const =0
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.
virtual GlobalError globalPositionError() const =0
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
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 const Surface * surface() const
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 int dimension() const
virtual std::vector< const TrackingRecHit * > recHits() const
Access to component RecHits (if any)
Unlimited (trivial) bounds.