CMS 3D CMS Logo

ProxyStripTopology.cc
Go to the documentation of this file.
3 
6 
9  : theType(type), theLength(bp->bounds().length()), theWidth(bp->bounds().width()) {}
10 
12 /* inlined
13 LocalPoint ProxyStripTopology::localPosition( const MeasurementPoint& mp ) const
14 {
15  return specificTopology().localPosition(mp);
16 
17 // FIXME: Better this way? Well, but posOrig will not contain useful y!
18 // if (!this->surfaceDeformation()) return specificTopology().localPosition(mp);
19 //
20 // // correct with position information from input and zero track angles
21 // const LocalPoint posOrig(specificTopology().localPosition(mp));
22 // return this->localPosition(mp, Topology::LocalTrackPred(posOrig.x(), posOrig.y(), 0., 0.));
23 }
24 */
25 
28  const Topology::LocalTrackPred &trkPred) const {
29  if (!this->surfaceDeformation())
30  return specificTopology().localPosition(mp);
31 
32  // add correction from SurfaceDeformation
33  const LocalPoint posOld(specificTopology().localPosition(mp)); // 'original position'
35 
36  return LocalPoint(posOld.x() + corr.x(), posOld.y() + corr.y(), posOld.z());
37 }
38 
40 /* inlined
41 LocalPoint ProxyStripTopology::localPosition( float strip ) const
42 {
43  return specificTopology().localPosition(strip);
44 
45 // FIXME: Better this way? Well, but posOrig will not contain useful y!
46 // if (!this->surfaceDeformation()) return specificTopology().localPosition(strip);
47 
48 // // correct with position information from input and zero track angles
49 // const LocalPoint posOrig(specificTopology().localPosition(strip));
50 // return this->localPosition(mp, Topology::LocalTrackPred(posOrig.x(), posOrig.y(), 0., 0.));
51 }
52 */
53 
56  if (!this->surfaceDeformation())
57  return specificTopology().localPosition(strip);
58 
59  // add correction from SurfaceDeformation
60  const LocalPoint posOld(specificTopology().localPosition(strip));
61 
63  return LocalPoint(posOld.x() + corr.x(), posOld.y() + corr.y(), posOld.z());
64 }
65 
67 LocalError ProxyStripTopology::localError(float strip, float stripErr2, const Topology::LocalTrackPred &trkPred) const {
68  // 'strip' is from measurement frame and the topology knows to
69  // calculate the cartesian error.
70  // But assuming no uncertainty on the SurfaceDeformation variables,
71  // the errors do not change from a simple shift to compensate
72  // that the track 'sees' the surface at another place than it thinks...
73 
74  // In case of TwoBowedSurfacesDeformation one could add corrections here due to
75  // relative rotations of the sensors...
76  return specificTopology().localError(strip, stripErr2);
77 }
78 
81  const MeasurementError &me,
82  const Topology::LocalTrackPred &trkPred) const {
83  // See comment in localError(float strip, float stripErr2,
84  // const Topology::LocalTrackPred &trkPred)!
85  return specificTopology().localError(mp, me);
86 }
87 
90  const Topology::LocalTrackAngles &dir) const {
91  if (!this->surfaceDeformation())
93 
94  // subtract correction from SurfaceDeformation
96  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
97 
98  return specificTopology().measurementPosition(posOrig);
99 }
100 
103  const LocalError &le,
104  const Topology::LocalTrackAngles &dir) const {
105  if (!this->surfaceDeformation())
106  return specificTopology().measurementError(lp, le);
107 
108  // assuming 'lp' comes from a track prediction
109  // (i.e. where the track thinks it hits the surface)
110  // we need to subtract correction from SurfaceDeformation
112  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
113 
114  return specificTopology().measurementError(posOrig, le);
115 }
116 
119  if (!this->surfaceDeformation())
120  return specificTopology().channel(lp);
121 
122  // subtract correction from SurfaceDeformation
124  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
125 
126  return specificTopology().channel(posOrig);
127 }
128 
131  if (!this->surfaceDeformation())
132  return specificTopology().strip(lp);
133 
134  // subtract correction from SurfaceDeformation
136  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
137 
138  return specificTopology().strip(posOrig);
139 }
140 
143  if (!this->surfaceDeformation())
144  return specificTopology().localPitch(lp);
145 
146  // subtract correction from SurfaceDeformation
148  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
149 
150  return specificTopology().localPitch(posOrig);
151 }
152 
155  if (!this->surfaceDeformation())
156  return specificTopology().localStripLength(lp);
157 
158  // subtract correction from SurfaceDeformation
160  const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
161 
162  return specificTopology().localStripLength(posOrig);
163 }
164 
167  theSurfaceDeformation.reset(deformation);
168 }
169 
172  const Topology::LocalTrackAngles &dir) const {
173  const SurfaceDeformation::Local2DPoint pos2D(pos.x(), pos.y()); // change precision and dimension
174 
175  return this->surfaceDeformation()->positionCorrection(pos2D, dir, theLength, theWidth);
176 }
177 
180  return this->surfaceDeformation()->positionCorrection(trk.point(), trk.angles(), theLength, theWidth);
181 }
type
Definition: HCALResponse.h:21
virtual const StripTopology & specificTopology() const
Point3DBase< Scalar, LocalTag > LocalPoint
Definition: Definitions.h:30
T y() const
Definition: PV2DBase.h:44
LocalError localError(float strip, float stripErr2) const override
std::unique_ptr< const SurfaceDeformation > theSurfaceDeformation
virtual Local2DVector positionCorrection(const Local2DPoint &localPos, const LocalTrackAngles &localAngles, double length, double width) const =0
float strip(const LocalPoint &lp) const override
int channel(const LocalPoint &lp) const override
MeasurementPoint measurementPosition(const LocalPoint &lp) const override
virtual float localStripLength(const LocalPoint &aLP) const =0
virtual LocalError localError(float strip, float stripErr2) const =0
T y() const
Definition: PV3DBase.h:60
virtual float strip(const LocalPoint &) const =0
ProxyStripTopology(StripGeomDetType const *type, Plane *bp)
float localStripLength(const LocalPoint &lp) const override
float localPitch(const LocalPoint &lp) const override
virtual LocalPoint localPosition(float strip) const =0
T z() const
Definition: PV3DBase.h:61
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
const LocalTrackAngles & angles() const
Definition: Topology.h:67
MeasurementError measurementError(const LocalPoint &lp, const LocalError &le) const override
virtual int channel(const LocalPoint &p) const =0
JetCorrectorParameters corr
Definition: classes.h:5
LocalPoint localPosition(const MeasurementPoint &mp) const override
const SurfaceDeformation * surfaceDeformation() const
const Local2DPoint & point() const
Definition: Topology.h:66
SurfaceDeformation::Local2DVector positionCorrection(const LocalPoint &pos, const Topology::LocalTrackAngles &dir) const
virtual float localPitch(const LocalPoint &) const =0
virtual void setSurfaceDeformation(const SurfaceDeformation *deformation)
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0
T x() const
Definition: PV2DBase.h:43
T x() const
Definition: PV3DBase.h:59