CMS 3D CMS Logo

ProxyPixelTopology.cc
Go to the documentation of this file.
3 
6 
9  : theType(type), theLength(bp->bounds().length()), theWidth(bp->bounds().width()) {}
10 
13  return specificTopology().localPosition(mp);
14 }
15 
18  const Topology::LocalTrackPred &trkPred) const {
19  if (!this->surfaceDeformation())
20  return specificTopology().localPosition(mp);
21 
22  // add correction from SurfaceDeformation
23  const LocalPoint posOld(specificTopology().localPosition(mp)); // 'original position'
25 
26  return LocalPoint(posOld.x() + corr.x(), posOld.y() + corr.y(), posOld.z());
27 }
28 
31  return specificTopology().localError(mp, me);
32 }
33 
36  const MeasurementError &me,
37  const Topology::LocalTrackPred &trkPred) const {
38  // The topology knows to calculate the cartesian error from measurement frame.
39  // But assuming no uncertainty on the SurfaceDeformation variables,
40  // the errors do not change from a simple shift to compensate
41  // that the track 'sees' the surface at another place than it thinks...
42  return specificTopology().localError(mp, me);
43 }
44 
48 }
49 
52  const Topology::LocalTrackAngles &dir) const {
53  if (!this->surfaceDeformation())
55 
56  // subtract correction from SurfaceDeformation
58  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
59 
60  return specificTopology().measurementPosition(posOrig);
61 }
62 
65  return specificTopology().measurementError(lp, le);
66 }
67 
70  const LocalError &le,
71  const Topology::LocalTrackAngles &dir) const {
72  if (!this->surfaceDeformation())
73  return specificTopology().measurementError(lp, le);
74 
75  // subtract correction from SurfaceDeformation
77  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
78 
79  return specificTopology().measurementError(posOrig, le);
80 }
81 
83 int ProxyPixelTopology::channel(const LocalPoint &lp) const { return specificTopology().channel(lp); }
84 
87  if (!this->surfaceDeformation())
88  return specificTopology().channel(lp);
89 
90  // subtract correction from SurfaceDeformation
92  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
93 
94  return specificTopology().channel(posOrig);
95 }
96 
98 std::pair<float, float> ProxyPixelTopology::pixel(const LocalPoint &lp) const { return specificTopology().pixel(lp); }
99 
101 std::pair<float, float> ProxyPixelTopology::pixel(const LocalPoint &lp, const Topology::LocalTrackAngles &dir) const {
102  if (!this->surfaceDeformation())
103  return specificTopology().pixel(lp);
104 
105  // subtract correction from SurfaceDeformation
107  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
108 
109  return specificTopology().pixel(posOrig);
110 }
111 
113 float ProxyPixelTopology::localX(const float mpX) const { return specificTopology().localX(mpX); }
114 
116 float ProxyPixelTopology::localX(const float mpX, const Topology::LocalTrackPred &trkPred) const {
117  if (!this->surfaceDeformation())
118  return specificTopology().localX(mpX);
119 
120  // add correction from SurfaceDeformation
121  float xOld = specificTopology().localX(mpX); // 'original position'
123 
124  return xOld + corr.x();
125 }
126 
128 float ProxyPixelTopology::localY(const float mpY) const { return specificTopology().localY(mpY); }
129 
131 float ProxyPixelTopology::localY(const float mpY, const Topology::LocalTrackPred &trkPred) const {
132  if (!this->surfaceDeformation())
133  return specificTopology().localY(mpY);
134 
135  // add correction from SurfaceDeformation
136  float yOld = specificTopology().localY(mpY); // 'original position'
138 
139  return yOld + corr.y();
140 }
141 
144  theSurfaceDeformation.reset(deformation);
145 }
146 
149  const Topology::LocalTrackAngles &dir) const {
150  const SurfaceDeformation::Local2DPoint pos2D(pos.x(), pos.y()); // change precision and dimension
151 
152  return this->surfaceDeformation()->positionCorrection(pos2D, dir, theLength, theWidth);
153 }
154 
157  return this->surfaceDeformation()->positionCorrection(trk.point(), trk.angles(), theLength, theWidth);
158 }
virtual void setSurfaceDeformation(const SurfaceDeformation *deformation)
const LocalTrackAngles & angles() const
Definition: Topology.h:65
LocalPoint localPosition(const MeasurementPoint &) const override
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
virtual std::pair< float, float > pixel(const LocalPoint &p) const =0
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
LocalError localError(const MeasurementPoint &, const MeasurementError &) const override
T z() const
Definition: PV3DBase.h:61
SurfaceDeformation::Local2DVector positionCorrection(const LocalPoint &pos, const Topology::LocalTrackAngles &dir) const
int channel(const LocalPoint &) const override
ProxyPixelTopology(PixelGeomDetType const *type, Plane *bp)
const Local2DPoint & point() const
Definition: Topology.h:64
MeasurementError measurementError(const LocalPoint &lp, const LocalError &le) const override
virtual float localX(float mpX) const =0
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0
dictionary corr
float localY(const float mpY) const override
virtual int channel(const LocalPoint &p) const =0
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
virtual LocalError localError(const MeasurementPoint &, const MeasurementError &) const =0
virtual float localY(float mpY) const =0
virtual Local2DVector positionCorrection(const Local2DPoint &localPos, const LocalTrackAngles &localAngles, double length, double width) const =0
virtual const PixelTopology & specificTopology() const
std::pair< float, float > pixel(const LocalPoint &p) const override
float localX(const float mpX) const override
std::unique_ptr< const SurfaceDeformation > theSurfaceDeformation
const SurfaceDeformation * surfaceDeformation() const
MeasurementPoint measurementPosition(const LocalPoint &) const override