CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ProxyPixelTopology.cc
Go to the documentation of this file.
3 
6 
8 ProxyPixelTopology::ProxyPixelTopology(PixelGeomDetType const * type, BoundPlane * bp)
9  :theType(type), theLength(bp->bounds().length()), theWidth(bp->bounds().width())
10 {
11 
12 }
13 
15 LocalPoint ProxyPixelTopology::localPosition( const MeasurementPoint& mp ) const
16 {
17  return specificTopology().localPosition(mp);
18 }
19 
21 LocalPoint ProxyPixelTopology::localPosition( const MeasurementPoint& mp,
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'
28  const SurfaceDeformation::Local2DVector corr(this->positionCorrection(trkPred));
29 
30  return LocalPoint(posOld.x()+corr.x(), posOld.y()+corr.y(), posOld.z());
31 }
32 
34 LocalError ProxyPixelTopology::localError( const MeasurementPoint& mp,
35  const MeasurementError& me ) const
36 {
37  return specificTopology().localError(mp, me);
38 }
39 
41 LocalError ProxyPixelTopology::localError( const MeasurementPoint& mp,
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 
53 MeasurementPoint ProxyPixelTopology::measurementPosition( const LocalPoint& lp ) const
54 {
55  return specificTopology().measurementPosition(lp);
56 }
57 
59 MeasurementPoint ProxyPixelTopology::measurementPosition( const LocalPoint& lp,
60  const Topology::LocalTrackAngles &dir ) const
61 {
62  if (!this->surfaceDeformation()) return specificTopology().measurementPosition(lp);
63 
64  // subtract correction from SurfaceDeformation
65  const SurfaceDeformation::Local2DVector corr(this->positionCorrection(lp, dir));
66  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
67 
68  return specificTopology().measurementPosition(posOrig);
69 }
70 
72 MeasurementError ProxyPixelTopology::measurementError( const LocalPoint &lp, const LocalError &le ) const
73 {
74  return specificTopology().measurementError(lp, le);
75 }
76 
78 MeasurementError ProxyPixelTopology::measurementError( const LocalPoint &lp, const LocalError &le,
79  const Topology::LocalTrackAngles &dir ) const
80 {
81  if (!this->surfaceDeformation()) return specificTopology().measurementError(lp, le);
82 
83  // subtract correction from SurfaceDeformation
84  const SurfaceDeformation::Local2DVector corr(this->positionCorrection(lp, dir));
85  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
86 
87  return specificTopology().measurementError(posOrig, le);
88 }
89 
91 int ProxyPixelTopology::channel( const LocalPoint& lp) const
92 {
93  return specificTopology().channel(lp);
94 }
95 
97 int ProxyPixelTopology::channel( const LocalPoint &lp, const Topology::LocalTrackAngles &dir) const
98 {
99  if (!this->surfaceDeformation()) return specificTopology().channel(lp);
100 
101  // subtract correction from SurfaceDeformation
102  const SurfaceDeformation::Local2DVector corr(this->positionCorrection(lp, dir));
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> ProxyPixelTopology::pixel( const LocalPoint& lp ) const
110 {
111  return specificTopology().pixel(lp);
112 }
113 
115 std::pair<float,float> ProxyPixelTopology::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
121  const SurfaceDeformation::Local2DVector corr(this->positionCorrection(lp, dir));
122  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
123 
124  return specificTopology().pixel(posOrig);
125 }
126 
128 float ProxyPixelTopology::localX(const float mpX) const
129 {
130  return specificTopology().localX(mpX);
131 }
132 
134 float ProxyPixelTopology::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'
141  const SurfaceDeformation::Local2DVector corr(this->positionCorrection(trkPred));
142 
143  return xOld + corr.x();
144 }
145 
147 float ProxyPixelTopology::localY(const float mpY) const
148 {
149  return specificTopology().localY(mpY);
150 }
151 
153 float ProxyPixelTopology::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'
160  const SurfaceDeformation::Local2DVector corr(this->positionCorrection(trkPred));
161 
162  return yOld + corr.y();
163 }
164 
165 
166 
168 void ProxyPixelTopology::setSurfaceDeformation(const SurfaceDeformation * deformation)
169 {
170  theSurfaceDeformation = deformation;
171 }
172 
175 ProxyPixelTopology::positionCorrection(const LocalPoint &pos,
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,
181  theLength, theWidth);
182 }
183 
186 ProxyPixelTopology::positionCorrection(const Topology::LocalTrackPred &trk) const
187 {
188  return this->surfaceDeformation()->positionCorrection(trk.point(), trk.angles(),
189  theLength, theWidth);
190 }
type
Definition: HCALResponse.h:21
T y() const
Definition: PV3DBase.h:63
T z() const
Definition: PV3DBase.h:64
const LocalTrackAngles & angles() const
Definition: Topology.h:66
JetCorrectorParameters corr
Definition: classes.h:5
const Local2DPoint & point() const
Definition: Topology.h:65
Local3DPoint LocalPoint
Definition: LocalPoint.h:11
dbl *** dir
Definition: mlp_gen.cc:35
T x() const
Definition: PV3DBase.h:62