CMS 3D CMS Logo

ProxyMTDTopology.cc
Go to the documentation of this file.
3 
6 
9  :theType(type), theLength(bp->bounds().length()), theWidth(bp->bounds().width())
10 {
11 
12 }
13 
16 {
17  return specificTopology().localPosition(mp);
18 }
19 
22  const Topology::LocalTrackPred &trkPred ) const
23 {
24  if (!this->surfaceDeformation()) return specificTopology().localPosition(mp);
25 
26  // add correction from SurfaceDeformation
27  const LocalPoint posOld(specificTopology().localPosition(mp)); // 'original position'
29 
30  return LocalPoint(posOld.x()+corr.x(), posOld.y()+corr.y(), posOld.z());
31 }
32 
35  const MeasurementError& me ) const
36 {
37  return specificTopology().localError(mp, me);
38 }
39 
42  const MeasurementError& me,
43  const Topology::LocalTrackPred &trkPred ) const
44 {
45  // The topology knows to calculate the cartesian error from measurement frame.
46  // But assuming no uncertainty on the SurfaceDeformation variables,
47  // the errors do not change from a simple shift to compensate
48  // that the track 'sees' the surface at another place than it thinks...
49  return specificTopology().localError(mp, me);
50 }
51 
54 {
56 }
57 
60  const Topology::LocalTrackAngles &dir ) const
61 {
62  if (!this->surfaceDeformation()) return specificTopology().measurementPosition(lp);
63 
64  // subtract correction from SurfaceDeformation
66  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
67 
68  return specificTopology().measurementPosition(posOrig);
69 }
70 
73 {
74  return specificTopology().measurementError(lp, le);
75 }
76 
79  const Topology::LocalTrackAngles &dir ) const
80 {
81  if (!this->surfaceDeformation()) return specificTopology().measurementError(lp, le);
82 
83  // subtract correction from SurfaceDeformation
85  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
86 
87  return specificTopology().measurementError(posOrig, le);
88 }
89 
92 {
93  return specificTopology().channel(lp);
94 }
95 
98 {
99  if (!this->surfaceDeformation()) return specificTopology().channel(lp);
100 
101  // subtract correction from SurfaceDeformation
103  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
104 
105  return specificTopology().channel(posOrig);
106 }
107 
109 std::pair<float,float> ProxyMTDTopology::pixel( const LocalPoint& lp ) const
110 {
111  return specificTopology().pixel(lp);
112 }
113 
115 std::pair<float,float> ProxyMTDTopology::pixel( const LocalPoint& lp,
116  const Topology::LocalTrackAngles &dir ) const
117 {
118  if (!this->surfaceDeformation()) return specificTopology().pixel(lp);
119 
120  // subtract correction from SurfaceDeformation
122  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
123 
124  return specificTopology().pixel(posOrig);
125 }
126 
128 float ProxyMTDTopology::localX(const float mpX) const
129 {
130  return specificTopology().localX(mpX);
131 }
132 
134 float ProxyMTDTopology::localX(const float mpX,
135  const Topology::LocalTrackPred &trkPred) const
136 {
137  if (!this->surfaceDeformation()) return specificTopology().localX(mpX);
138 
139  // add correction from SurfaceDeformation
140  float xOld = specificTopology().localX(mpX); // 'original position'
142 
143  return xOld + corr.x();
144 }
145 
147 float ProxyMTDTopology::localY(const float mpY) const
148 {
149  return specificTopology().localY(mpY);
150 }
151 
153 float ProxyMTDTopology::localY(const float mpY,
154  const Topology::LocalTrackPred &trkPred) const
155 {
156  if (!this->surfaceDeformation()) return specificTopology().localY(mpY);
157 
158  // add correction from SurfaceDeformation
159  float yOld = specificTopology().localY(mpY); // 'original position'
161 
162  return yOld + corr.y();
163 }
164 
165 
166 
169 {
170  theSurfaceDeformation.reset(deformation);
171 }
172 
176  const Topology::LocalTrackAngles &dir) const
177 {
178  const SurfaceDeformation::Local2DPoint pos2D(pos.x(), pos.y());// change precision and dimension
179 
180  return this->surfaceDeformation()->positionCorrection(pos2D, dir,
182 }
183 
187 {
188  return this->surfaceDeformation()->positionCorrection(trk.point(), trk.angles(),
190 }
type
Definition: HCALResponse.h:21
virtual std::pair< float, float > pixel(const LocalPoint &p) const =0
MeasurementPoint measurementPosition(const LocalPoint &) const override
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:32
T y() const
Definition: PV2DBase.h:46
LocalPoint localPosition(const MeasurementPoint &) const override
virtual Local2DVector positionCorrection(const Local2DPoint &localPos, const LocalTrackAngles &localAngles, double length, double width) const =0
LocalError localError(const MeasurementPoint &, const MeasurementError &) const override
T y() const
Definition: PV3DBase.h:63
virtual void setSurfaceDeformation(const SurfaceDeformation *deformation)
const SurfaceDeformation * surfaceDeformation() const
T z() const
Definition: PV3DBase.h:64
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
virtual const PixelTopology & specificTopology() const
virtual float localX(float mpX) const =0
const LocalTrackAngles & angles() const
Definition: Topology.h:68
int channel(const LocalPoint &) const override
virtual int channel(const LocalPoint &p) const =0
ProxyMTDTopology(MTDGeomDetType const *type, Plane *bp)
JetCorrectorParameters corr
Definition: classes.h:5
float localX(const float mpX) const override
const Local2DPoint & point() const
Definition: Topology.h:67
virtual LocalPoint localPosition(const MeasurementPoint &) const =0
std::unique_ptr< const SurfaceDeformation > theSurfaceDeformation
float localY(const float mpY) const override
virtual LocalError localError(const MeasurementPoint &, const MeasurementError &) const =0
MeasurementError measurementError(const LocalPoint &lp, const LocalError &le) const override
virtual float localY(float mpY) const =0
std::pair< float, float > pixel(const LocalPoint &p) const override
dbl *** dir
Definition: mlp_gen.cc:35
SurfaceDeformation::Local2DVector positionCorrection(const LocalPoint &pos, const Topology::LocalTrackAngles &dir) const
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0
T x() const
Definition: PV2DBase.h:45
T x() const
Definition: PV3DBase.h:62