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 LocalPoint ProxyStripTopology::localPosition( const MeasurementPoint& mp ) const
15 {
16  return specificTopology().localPosition(mp);
17 
18 // FIXME: Better this way? Well, but posOrig will not contain useful y!
19 // if (!this->surfaceDeformation()) return specificTopology().localPosition(mp);
20 //
21 // // correct with position information from input and zero track angles
22 // const LocalPoint posOrig(specificTopology().localPosition(mp));
23 // return this->localPosition(mp, Topology::LocalTrackPred(posOrig.x(), posOrig.y(), 0., 0.));
24 }
25 
27 LocalPoint ProxyStripTopology::localPosition( const MeasurementPoint& mp,
28  const Topology::LocalTrackPred &trkPred ) const
29 {
30  if (!this->surfaceDeformation()) return specificTopology().localPosition(mp);
31 
32  // add correction from SurfaceDeformation
33  const LocalPoint posOld(specificTopology().localPosition(mp)); // 'original position'
34  const SurfaceDeformation::Local2DVector corr(this->positionCorrection(trkPred));
35 
36  return LocalPoint(posOld.x()+corr.x(), posOld.y()+corr.y(), posOld.z());
37 }
38 
40 LocalPoint ProxyStripTopology::localPosition( float strip ) const
41 {
42  return specificTopology().localPosition(strip);
43 
44 // FIXME: Better this way? Well, but posOrig will not contain useful y!
45 // if (!this->surfaceDeformation()) return specificTopology().localPosition(strip);
46 
47 // // correct with position information from input and zero track angles
48 // const LocalPoint posOrig(specificTopology().localPosition(strip));
49 // return this->localPosition(mp, Topology::LocalTrackPred(posOrig.x(), posOrig.y(), 0., 0.));
50 }
51 
53 LocalPoint ProxyStripTopology::localPosition(float strip, const Topology::LocalTrackPred &trkPred) const
54 {
55  if (!this->surfaceDeformation()) return specificTopology().localPosition(strip);
56 
57  // add correction from SurfaceDeformation
58  const LocalPoint posOld(specificTopology().localPosition(strip));
59 
60  const SurfaceDeformation::Local2DVector corr(this->positionCorrection(trkPred));
61  return LocalPoint(posOld.x()+corr.x(), posOld.y()+corr.y(), posOld.z());
62 }
63 
65 LocalError ProxyStripTopology::localError( float strip, float stripErr2 ) const
66 {
67  return specificTopology().localError(strip, stripErr2);
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 
86 LocalError ProxyStripTopology::localError( const MeasurementPoint& mp,
87  const MeasurementError& me) const
88 {
89  return specificTopology().localError(mp, me);
90 }
91 
93 LocalError ProxyStripTopology::localError( const MeasurementPoint& mp,
94  const MeasurementError& me,
95  const Topology::LocalTrackPred &trkPred) const
96 {
97  // See comment in localError(float strip, float stripErr2,
98  // const Topology::LocalTrackPred &trkPred)!
99  return specificTopology().localError(mp, me);
100 }
101 
103 MeasurementPoint ProxyStripTopology::measurementPosition( const LocalPoint& lp) const
104 {
105  return specificTopology().measurementPosition(lp);
106 }
107 
109 MeasurementPoint ProxyStripTopology::measurementPosition( const LocalPoint& lp,
110  const Topology::LocalTrackAngles &dir) const
111 {
112  if (!this->surfaceDeformation()) return specificTopology().measurementPosition(lp);
113 
114  // subtract correction from SurfaceDeformation
115  const SurfaceDeformation::Local2DVector corr(this->positionCorrection(lp, dir));
116  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
117 
118  return specificTopology().measurementPosition(posOrig);
119 }
120 
122 MeasurementError ProxyStripTopology::measurementError( const LocalPoint& lp, const LocalError& le ) const
123 {
124  return specificTopology().measurementError(lp, le);
125 }
126 
128 MeasurementError ProxyStripTopology::measurementError( const LocalPoint &lp, const LocalError &le,
129  const Topology::LocalTrackAngles &dir) const
130 {
131  if (!this->surfaceDeformation()) return specificTopology().measurementError(lp, le);
132 
133  // assuming 'lp' comes from a track prediction
134  // (i.e. where the track thinks it hits the surface)
135  // we need to subtract correction from SurfaceDeformation
136  const SurfaceDeformation::Local2DVector corr(this->positionCorrection(lp, dir));
137  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
138 
139  return specificTopology().measurementError(posOrig, le);
140 }
141 
143 int ProxyStripTopology::channel( const LocalPoint& lp) const
144 {
145  return specificTopology().channel(lp);
146 }
147 
149 int ProxyStripTopology::channel( const LocalPoint &lp, const Topology::LocalTrackAngles &dir) const
150 {
151  if (!this->surfaceDeformation()) return specificTopology().channel(lp);
152 
153  // subtract correction from SurfaceDeformation
154  const SurfaceDeformation::Local2DVector corr(this->positionCorrection(lp, dir));
155  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
156 
157  return specificTopology().channel(posOrig);
158 }
159 
161 float ProxyStripTopology::strip(const LocalPoint& lp) const
162 {
163  return specificTopology().strip(lp);
164 }
165 
167 float ProxyStripTopology::strip( const LocalPoint& lp, const Topology::LocalTrackAngles &dir ) const
168 {
169  if (!this->surfaceDeformation()) return specificTopology().strip(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().strip(posOrig);
176 }
177 
178 float ProxyStripTopology::pitch() const
179 {
180  return specificTopology().pitch();
181 }
182 
184 float ProxyStripTopology::localPitch( const LocalPoint& lp) const
185 {
186  return specificTopology().localPitch(lp);
187 }
188 
190 float ProxyStripTopology::localPitch( const LocalPoint& lp, const Topology::LocalTrackAngles &dir ) const
191 {
192  if (!this->surfaceDeformation()) return specificTopology().localPitch(lp);
193 
194  // subtract correction from SurfaceDeformation
195  const SurfaceDeformation::Local2DVector corr(this->positionCorrection(lp, dir));
196  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
197 
198  return specificTopology().localPitch(posOrig);
199 }
200 
202 float ProxyStripTopology::stripAngle( float strip ) const
203 {
204  return specificTopology().stripAngle(strip);
205 }
206 
208 int ProxyStripTopology::nstrips() const
209 {
210  return specificTopology().nstrips();
211 }
212 
214 float ProxyStripTopology::stripLength() const
215 {
216  return specificTopology().stripLength();
217 }
218 
220 float ProxyStripTopology::localStripLength(const LocalPoint& lp) const
221 {
222  return specificTopology().localStripLength(lp);
223 }
224 
226 float ProxyStripTopology::localStripLength( const LocalPoint& lp, const Topology::LocalTrackAngles &dir ) const
227 {
228  if (!this->surfaceDeformation()) return specificTopology().localStripLength(lp);
229 
230  // subtract correction from SurfaceDeformation
231  const SurfaceDeformation::Local2DVector corr(this->positionCorrection(lp, dir));
232  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
233 
234  return specificTopology().localStripLength(posOrig);
235 }
236 
238 const GeomDetType& ProxyStripTopology::type() const { return *theType;}
239 
241 StripGeomDetType& ProxyStripTopology::specificType() const { return *theType;}
242 
244 const StripTopology& ProxyStripTopology::specificTopology() const
245 {
246  return specificType().specificTopology();
247 }
248 
250 void ProxyStripTopology::setSurfaceDeformation(const SurfaceDeformation * deformation)
251 {
252  theSurfaceDeformation = deformation;
253 }
254 
257 ProxyStripTopology::positionCorrection(const LocalPoint &pos,
258  const Topology::LocalTrackAngles &dir) const
259 {
260  const SurfaceDeformation::Local2DPoint pos2D(pos.x(), pos.y());// change precision and dimension
261 
262  return this->surfaceDeformation()->positionCorrection(pos2D, dir,
263  theLength, theWidth);
264 }
265 
268 ProxyStripTopology::positionCorrection(const Topology::LocalTrackPred &trk) const
269 {
270  return this->surfaceDeformation()->positionCorrection(trk.point(), trk.angles(),
271  theLength, theWidth);
272 }
type
Definition: HCALResponse.h:22
void strip(std::string &input, const std::string &blanks=" \n\t")
Definition: stringTools.cc:16
T y() const
Definition: PV3DBase.h:62
T z() const
Definition: PV3DBase.h:63
const LocalTrackAngles & angles() const
Definition: Topology.h:66
JetCorrectorParameters corr
Definition: classes.h:9
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:61