CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ProxyStripTopology.cc
Go to the documentation of this file.
3 
6 
8 ProxyStripTopology::ProxyStripTopology(StripGeomDetType* type, BoundPlane * bp)
9  :theType(type), theLength(bp->bounds().length()), theWidth(bp->bounds().width())
10 {
11 }
12 
14 /* inlined
15 LocalPoint ProxyStripTopology::localPosition( const MeasurementPoint& mp ) const
16 {
17  return specificTopology().localPosition(mp);
18 
19 // FIXME: Better this way? Well, but posOrig will not contain useful y!
20 // if (!this->surfaceDeformation()) return specificTopology().localPosition(mp);
21 //
22 // // correct with position information from input and zero track angles
23 // const LocalPoint posOrig(specificTopology().localPosition(mp));
24 // return this->localPosition(mp, Topology::LocalTrackPred(posOrig.x(), posOrig.y(), 0., 0.));
25 }
26 */
27 
29 LocalPoint ProxyStripTopology::localPosition( const MeasurementPoint& mp,
30  const Topology::LocalTrackPred &trkPred ) const
31 {
32  if (!this->surfaceDeformation()) return specificTopology().localPosition(mp);
33 
34  // add correction from SurfaceDeformation
35  const LocalPoint posOld(specificTopology().localPosition(mp)); // 'original position'
36  const SurfaceDeformation::Local2DVector corr(this->positionCorrection(trkPred));
37 
38  return LocalPoint(posOld.x()+corr.x(), posOld.y()+corr.y(), posOld.z());
39 }
40 
42 /* inlined
43 LocalPoint ProxyStripTopology::localPosition( float strip ) const
44 {
45  return specificTopology().localPosition(strip);
46 
47 // FIXME: Better this way? Well, but posOrig will not contain useful y!
48 // if (!this->surfaceDeformation()) return specificTopology().localPosition(strip);
49 
50 // // correct with position information from input and zero track angles
51 // const LocalPoint posOrig(specificTopology().localPosition(strip));
52 // return this->localPosition(mp, Topology::LocalTrackPred(posOrig.x(), posOrig.y(), 0., 0.));
53 }
54 */
55 
57 LocalPoint ProxyStripTopology::localPosition(float strip, const Topology::LocalTrackPred &trkPred) const
58 {
59  if (!this->surfaceDeformation()) return specificTopology().localPosition(strip);
60 
61  // add correction from SurfaceDeformation
62  const LocalPoint posOld(specificTopology().localPosition(strip));
63 
64  const SurfaceDeformation::Local2DVector corr(this->positionCorrection(trkPred));
65  return LocalPoint(posOld.x()+corr.x(), posOld.y()+corr.y(), posOld.z());
66 }
67 
68 
69 
71 LocalError ProxyStripTopology::localError(float strip, float stripErr2,
72  const Topology::LocalTrackPred &trkPred) const
73 {
74  // 'strip' is from measurement frame and the topology knows to
75  // calculate the cartesian error.
76  // But assuming no uncertainty on the SurfaceDeformation variables,
77  // the errors do not change from a simple shift to compensate
78  // that the track 'sees' the surface at another place than it thinks...
79 
80  // In case of TwoBowedSurfacesDeformation one could add corrections here due to
81  // relative rotations of the sensors...
82  return specificTopology().localError(strip, stripErr2);
83 }
84 
85 
87 LocalError ProxyStripTopology::localError( const MeasurementPoint& mp,
88  const MeasurementError& me,
89  const Topology::LocalTrackPred &trkPred) const
90 {
91  // See comment in localError(float strip, float stripErr2,
92  // const Topology::LocalTrackPred &trkPred)!
93  return specificTopology().localError(mp, me);
94 }
95 
96 
98 MeasurementPoint ProxyStripTopology::measurementPosition( const LocalPoint& lp,
99  const Topology::LocalTrackAngles &dir) const
100 {
101  if (!this->surfaceDeformation()) return specificTopology().measurementPosition(lp);
102 
103  // subtract correction from SurfaceDeformation
104  const SurfaceDeformation::Local2DVector corr(this->positionCorrection(lp, dir));
105  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
106 
107  return specificTopology().measurementPosition(posOrig);
108 }
109 
110 
112 MeasurementError ProxyStripTopology::measurementError( const LocalPoint &lp, const LocalError &le,
113  const Topology::LocalTrackAngles &dir) const
114 {
115  if (!this->surfaceDeformation()) return specificTopology().measurementError(lp, le);
116 
117  // assuming 'lp' comes from a track prediction
118  // (i.e. where the track thinks it hits the surface)
119  // we need to subtract correction from SurfaceDeformation
120  const SurfaceDeformation::Local2DVector corr(this->positionCorrection(lp, dir));
121  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
122 
123  return specificTopology().measurementError(posOrig, le);
124 }
125 
126 
128 int ProxyStripTopology::channel( const LocalPoint &lp, const Topology::LocalTrackAngles &dir) const
129 {
130  if (!this->surfaceDeformation()) return specificTopology().channel(lp);
131 
132  // subtract correction from SurfaceDeformation
133  const SurfaceDeformation::Local2DVector corr(this->positionCorrection(lp, dir));
134  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
135 
136  return specificTopology().channel(posOrig);
137 }
138 
139 
141 float ProxyStripTopology::strip( const LocalPoint& lp, const Topology::LocalTrackAngles &dir ) const
142 {
143  if (!this->surfaceDeformation()) return specificTopology().strip(lp);
144 
145  // subtract correction from SurfaceDeformation
146  const SurfaceDeformation::Local2DVector corr(this->positionCorrection(lp, dir));
147  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
148 
149  return specificTopology().strip(posOrig);
150 }
151 
152 
154 float ProxyStripTopology::localPitch( const LocalPoint& lp, const Topology::LocalTrackAngles &dir ) const
155 {
156  if (!this->surfaceDeformation()) return specificTopology().localPitch(lp);
157 
158  // subtract correction from SurfaceDeformation
159  const SurfaceDeformation::Local2DVector corr(this->positionCorrection(lp, dir));
160  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
161 
162  return specificTopology().localPitch(posOrig);
163 }
164 
165 
167 float ProxyStripTopology::localStripLength( const LocalPoint& lp, const Topology::LocalTrackAngles &dir ) const
168 {
169  if (!this->surfaceDeformation()) return specificTopology().localStripLength(lp);
170 
171  // subtract correction from SurfaceDeformation
172  const SurfaceDeformation::Local2DVector corr(this->positionCorrection(lp, dir));
173  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
174 
175  return specificTopology().localStripLength(posOrig);
176 }
177 
178 
180 void ProxyStripTopology::setSurfaceDeformation(const SurfaceDeformation * deformation)
181 {
182  theSurfaceDeformation = deformation;
183 }
184 
187 ProxyStripTopology::positionCorrection(const LocalPoint &pos,
188  const Topology::LocalTrackAngles &dir) const
189 {
190  const SurfaceDeformation::Local2DPoint pos2D(pos.x(), pos.y());// change precision and dimension
191 
192  return this->surfaceDeformation()->positionCorrection(pos2D, dir,
193  theLength, theWidth);
194 }
195 
198 ProxyStripTopology::positionCorrection(const Topology::LocalTrackPred &trk) const
199 {
200  return this->surfaceDeformation()->positionCorrection(trk.point(), trk.angles(),
201  theLength, theWidth);
202 }
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
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