File indexing completed on 2024-04-06 12:15:27
0001 #include "DataFormats/GeometrySurface/interface/BoundPlane.h"
0002 #include "DataFormats/GeometrySurface/interface/Bounds.h"
0003
0004 #include "Geometry/TrackerGeometryBuilder/interface/ProxyStripTopology.h"
0005 #include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetType.h"
0006
0007
0008 ProxyStripTopology::ProxyStripTopology(StripGeomDetType const *type, BoundPlane *bp)
0009 : theType(type), theLength(bp->bounds().length()), theWidth(bp->bounds().width()) {}
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 LocalPoint ProxyStripTopology::localPosition(const MeasurementPoint &mp,
0028 const Topology::LocalTrackPred &trkPred) const {
0029 if (!this->surfaceDeformation())
0030 return specificTopology().localPosition(mp);
0031
0032
0033 const LocalPoint posOld(specificTopology().localPosition(mp));
0034 const SurfaceDeformation::Local2DVector corr(this->positionCorrection(trkPred));
0035
0036 return LocalPoint(posOld.x() + corr.x(), posOld.y() + corr.y(), posOld.z());
0037 }
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055 LocalPoint ProxyStripTopology::localPosition(float strip, const Topology::LocalTrackPred &trkPred) const {
0056 if (!this->surfaceDeformation())
0057 return specificTopology().localPosition(strip);
0058
0059
0060 const LocalPoint posOld(specificTopology().localPosition(strip));
0061
0062 const SurfaceDeformation::Local2DVector corr(this->positionCorrection(trkPred));
0063 return LocalPoint(posOld.x() + corr.x(), posOld.y() + corr.y(), posOld.z());
0064 }
0065
0066
0067 LocalError ProxyStripTopology::localError(float strip, float stripErr2, const Topology::LocalTrackPred &trkPred) const {
0068
0069
0070
0071
0072
0073
0074
0075
0076 return specificTopology().localError(strip, stripErr2);
0077 }
0078
0079
0080 LocalError ProxyStripTopology::localError(const MeasurementPoint &mp,
0081 const MeasurementError &me,
0082 const Topology::LocalTrackPred &trkPred) const {
0083
0084
0085 return specificTopology().localError(mp, me);
0086 }
0087
0088
0089 MeasurementPoint ProxyStripTopology::measurementPosition(const LocalPoint &lp,
0090 const Topology::LocalTrackAngles &dir) const {
0091 if (!this->surfaceDeformation())
0092 return specificTopology().measurementPosition(lp);
0093
0094
0095 const SurfaceDeformation::Local2DVector corr(this->positionCorrection(lp, dir));
0096 const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
0097
0098 return specificTopology().measurementPosition(posOrig);
0099 }
0100
0101
0102 MeasurementError ProxyStripTopology::measurementError(const LocalPoint &lp,
0103 const LocalError &le,
0104 const Topology::LocalTrackAngles &dir) const {
0105 if (!this->surfaceDeformation())
0106 return specificTopology().measurementError(lp, le);
0107
0108
0109
0110
0111 const SurfaceDeformation::Local2DVector corr(this->positionCorrection(lp, dir));
0112 const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
0113
0114 return specificTopology().measurementError(posOrig, le);
0115 }
0116
0117
0118 int ProxyStripTopology::channel(const LocalPoint &lp, const Topology::LocalTrackAngles &dir) const {
0119 if (!this->surfaceDeformation())
0120 return specificTopology().channel(lp);
0121
0122
0123 const SurfaceDeformation::Local2DVector corr(this->positionCorrection(lp, dir));
0124 const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
0125
0126 return specificTopology().channel(posOrig);
0127 }
0128
0129
0130 float ProxyStripTopology::strip(const LocalPoint &lp, const Topology::LocalTrackAngles &dir) const {
0131 if (!this->surfaceDeformation())
0132 return specificTopology().strip(lp);
0133
0134
0135 const SurfaceDeformation::Local2DVector corr(this->positionCorrection(lp, dir));
0136 const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
0137
0138 return specificTopology().strip(posOrig);
0139 }
0140
0141
0142 float ProxyStripTopology::localPitch(const LocalPoint &lp, const Topology::LocalTrackAngles &dir) const {
0143 if (!this->surfaceDeformation())
0144 return specificTopology().localPitch(lp);
0145
0146
0147 const SurfaceDeformation::Local2DVector corr(this->positionCorrection(lp, dir));
0148 const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
0149
0150 return specificTopology().localPitch(posOrig);
0151 }
0152
0153
0154 float ProxyStripTopology::localStripLength(const LocalPoint &lp, const Topology::LocalTrackAngles &dir) const {
0155 if (!this->surfaceDeformation())
0156 return specificTopology().localStripLength(lp);
0157
0158
0159 const SurfaceDeformation::Local2DVector corr(this->positionCorrection(lp, dir));
0160 const LocalPoint posOrig(lp.x() - corr.x(), lp.y() - corr.y(), lp.z());
0161
0162 return specificTopology().localStripLength(posOrig);
0163 }
0164
0165
0166 void ProxyStripTopology::setSurfaceDeformation(const SurfaceDeformation *deformation) {
0167 theSurfaceDeformation.reset(deformation);
0168 }
0169
0170
0171 SurfaceDeformation::Local2DVector ProxyStripTopology::positionCorrection(const LocalPoint &pos,
0172 const Topology::LocalTrackAngles &dir) const {
0173 const SurfaceDeformation::Local2DPoint pos2D(pos.x(), pos.y());
0174
0175 return this->surfaceDeformation()->positionCorrection(pos2D, dir, theLength, theWidth);
0176 }
0177
0178
0179 SurfaceDeformation::Local2DVector ProxyStripTopology::positionCorrection(const Topology::LocalTrackPred &trk) const {
0180 return this->surfaceDeformation()->positionCorrection(trk.point(), trk.angles(), theLength, theWidth);
0181 }