CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ProxyMTDTopology.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  if (!this->surfaceDeformation())
19  return specificTopology().localPosition(mp);
20 
21  // add correction from SurfaceDeformation
22  const LocalPoint posOld(specificTopology().localPosition(mp)); // 'original position'
24 
25  return LocalPoint(posOld.x() + corr.x(), posOld.y() + corr.y(), posOld.z());
26 }
27 
30  return specificTopology().localError(mp, me);
31 }
32 
35  const MeasurementError &me,
36  const Topology::LocalTrackPred &trkPred) const {
37  // The topology knows to calculate the cartesian error from measurement frame.
38  // But assuming no uncertainty on the SurfaceDeformation variables,
39  // the errors do not change from a simple shift to compensate
40  // that the track 'sees' the surface at another place than it thinks...
41  return specificTopology().localError(mp, me);
42 }
43 
47 }
48 
51  const Topology::LocalTrackAngles &dir) const {
52  if (!this->surfaceDeformation())
54 
55  // subtract correction from SurfaceDeformation
57  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
58 
59  return specificTopology().measurementPosition(posOrig);
60 }
61 
64  return specificTopology().measurementError(lp, le);
65 }
66 
69  const LocalError &le,
70  const Topology::LocalTrackAngles &dir) const {
71  if (!this->surfaceDeformation())
72  return specificTopology().measurementError(lp, le);
73 
74  // subtract correction from SurfaceDeformation
76  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
77 
78  return specificTopology().measurementError(posOrig, le);
79 }
80 
82 int ProxyMTDTopology::channel(const LocalPoint &lp) const { return specificTopology().channel(lp); }
83 
86  if (!this->surfaceDeformation())
87  return specificTopology().channel(lp);
88 
89  // subtract correction from SurfaceDeformation
91  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
92 
93  return specificTopology().channel(posOrig);
94 }
95 
97 std::pair<float, float> ProxyMTDTopology::pixel(const LocalPoint &lp) const { return specificTopology().pixel(lp); }
98 
100 std::pair<float, float> ProxyMTDTopology::pixel(const LocalPoint &lp, const Topology::LocalTrackAngles &dir) const {
101  if (!this->surfaceDeformation())
102  return specificTopology().pixel(lp);
103 
104  // subtract correction from SurfaceDeformation
106  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
107 
108  return specificTopology().pixel(posOrig);
109 }
110 
112 float ProxyMTDTopology::localX(const float mpX) const { return specificTopology().localX(mpX); }
113 
115 float ProxyMTDTopology::localX(const float mpX, const Topology::LocalTrackPred &trkPred) const {
116  if (!this->surfaceDeformation())
117  return specificTopology().localX(mpX);
118 
119  // add correction from SurfaceDeformation
120  float xOld = specificTopology().localX(mpX); // 'original position'
122 
123  return xOld + corr.x();
124 }
125 
127 float ProxyMTDTopology::localY(const float mpY) const { return specificTopology().localY(mpY); }
128 
130 float ProxyMTDTopology::localY(const float mpY, const Topology::LocalTrackPred &trkPred) const {
131  if (!this->surfaceDeformation())
132  return specificTopology().localY(mpY);
133 
134  // add correction from SurfaceDeformation
135  float yOld = specificTopology().localY(mpY); // 'original position'
137 
138  return yOld + corr.y();
139 }
140 
143  theSurfaceDeformation.reset(deformation);
144 }
145 
148  const Topology::LocalTrackAngles &dir) const {
149  const SurfaceDeformation::Local2DPoint pos2D(pos.x(), pos.y()); // change precision and dimension
150 
151  return this->surfaceDeformation()->positionCorrection(pos2D, dir, theLength, theWidth);
152 }
153 
156  return this->surfaceDeformation()->positionCorrection(trk.point(), trk.angles(), theLength, theWidth);
157 }
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
T y() const
Definition: PV2DBase.h:44
virtual std::pair< float, float > pixel(const LocalPoint &p) const =0
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
MeasurementPoint measurementPosition(const LocalPoint &) const override
float localY(const float mpY) const override
T y() const
Definition: PV3DBase.h:60
LocalPoint localPosition(const MeasurementPoint &) const override
virtual void setSurfaceDeformation(const SurfaceDeformation *deformation)
const SurfaceDeformation * surfaceDeformation() const
virtual float localX(float mpX) const =0
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0
T z() const
Definition: PV3DBase.h:61
virtual const PixelTopology & specificTopology() const
const LocalTrackAngles & angles() const
Definition: Topology.h:65
virtual int channel(const LocalPoint &p) const =0
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
ProxyMTDTopology(MTDGeomDetType const *type, Plane *bp)
LocalError localError(const MeasurementPoint &, const MeasurementError &) const override
virtual LocalError localError(const MeasurementPoint &, const MeasurementError &) const =0
const Local2DPoint & point() const
Definition: Topology.h:64
std::pair< float, float > pixel(const LocalPoint &p) const override
virtual float localY(float mpY) const =0
virtual Local2DVector positionCorrection(const Local2DPoint &localPos, const LocalTrackAngles &localAngles, double length, double width) const =0
std::unique_ptr< const SurfaceDeformation > theSurfaceDeformation
float localX(const float mpX) const override
SurfaceDeformation::Local2DVector positionCorrection(const LocalPoint &pos, const Topology::LocalTrackAngles &dir) const
T x() const
Definition: PV2DBase.h:43
T x() const
Definition: PV3DBase.h:59
MeasurementError measurementError(const LocalPoint &lp, const LocalError &le) const override
int channel(const LocalPoint &) const override