13 return std::copysign(
calculatePhiWindow(maxDistance, tsos, startPlane), maxDistance.x());
30 if (yc < maxDistance.
y() && xc < maxDistance.
x())
33 auto hori = yc > maxDistance.
y();
34 auto y0 = hori ? yc + std::copysign(maxDistance.
y(), xc - maxDistance.
x()) : xc - maxDistance.
x();
35 auto x0 = hori ? xc - maxDistance.
x() : -yc - maxDistance.
y();
36 auto y1 = hori ? yc - maxDistance.
y() : xc - maxDistance.
x();
37 auto x1 = hori ? xc + maxDistance.
x() : -yc + maxDistance.
y();
39 auto sp = (x0 * x1 + y0 * y1) /
std::sqrt((x0 * x0 + y0 * y0) * (x1 * x1 + y1 * y1));
54 for (
int i = 1;
i < 4;
i++) {
55 float cPhi = corners[
i];
63 float phiWindow = phimax -
phimin;
76 return maxDistance.
y();
80 const std::vector<GlobalPoint>& ringCrossing,
82 std::array<int, 3> theBins = {{-1, -1, -1}};
84 float initialR = ringParams[0].theRingR;
85 float rDiff0 =
std::abs(ringCrossing[0].
perp() - initialR);
88 for (
int i = 1;
i < ringSize;
i++) {
89 float ringR = ringParams[
i].theRingR;
91 if (testDiff < rDiff0) {
95 theBins[2] = theBins[1];
96 theBins[1] = theBins[0];
98 }
else if (rDiff1 < 0 || testDiff < rDiff1) {
101 theBins[2] = theBins[1];
103 }
else if (rDiff2 < 0 || testDiff < rDiff2) {
121 return !(thetamin > ringParams[
index].thetaRingMax || ringParams[
index].thetaRingMin > thetamax);
125 float ringMinZ =
std::abs(ringDisk.position().z()) - ringDisk.bounds().thickness() / 2.;
126 float ringMaxZ =
std::abs(ringDisk.position().z()) + ringDisk.bounds().thickness() / 2.;
128 tempPar.
thetaRingMin = ringDisk.innerRadius() / ringMaxZ;
129 tempPar.
thetaRingMax = ringDisk.outerRadius() / ringMinZ;
130 tempPar.
theRingR = (ringDisk.innerRadius() + ringDisk.outerRadius()) / 2.;
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
bool overlapInR(const TrajectoryStateOnSurface &tsos, int index, double ymax, const std::vector< RingPar > &ringParams)
Point3DBase< Scalar, LocalTag > LocalPoint
LocalPoint localPosition() const
GlobalVector normalVector() const
virtual Local2DVector maximalLocalDisplacement(const TrajectoryStateOnSurface &ts, const Plane &plane) const =0
Global3DPoint GlobalPoint
GlobalPoint globalPosition() const
const Plane & surface() const
The nominal surface of the GeomDet.
std::array< int, 3 > findThreeClosest(const std::vector< RingPar > &ringParams, const std::vector< GlobalPoint > &ringCrossing, const int ringSize)
float computeWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
float computeYdirWindowSize(const GeomDet *det, const TrajectoryStateOnSurface &tsos, const MeasurementEstimator &est)
LocalPoint toLocal(const GlobalPoint &gp) const
Abs< T >::type abs(const T &t)
RingPar fillRingParametersFromDisk(const BoundDisk &ringDisk)
bool phiLess(float phi1, float phi2)
T perp() const
Magnitude of transverse component.
float calculatePhiWindow(const MeasurementEstimator::Local2DVector &imaxDistance, const TrajectoryStateOnSurface &ts, const Plane &plane)