# MuonReadoutGeometry - Rotate the stereo layer surfaces

Hi everybody,

this MR is another approach to improving the phi constraint from the stereo layers by rotating the underlying surfaces of the micro mega stereo layers. During the fit, the clusters can be moved along the local X coordinate which is always completely orthogonal to the wires without bothering that this would also introduce a shift in Y w.r.t. to the pure eta layers. However, it's not that simple to just rotate the surface, because we have to keep in mind that each strip is individually rotated by the stereo angle alpha around the strip center in the eta layer.

In the coordinate system of the ordinary eta layer, a given strip `N`

can be parametrized via

`S (N, lambda) = S_{N} + lambda * (sin alpha, cos alpha)`

where S_{N} is the nominal strip center parallel to the x-axis. In general, S_{N} can be outside of the trapezoid bounds. Therefore, it's better to take the actual geometrical center of the stereo strip as the reference point of the MM hit. The center is calculated by first intersecting the stereo strips with the left and right edges of the trapezoid

```
bool leftInterSect(const int channelNumbers, Amg::Vector2D& pos) const;
bool rightInterSect(const int channelNumbers, Amg::Vector2D& pos) const;
```

and then taking the middle of them. The intersection happens in the unrotated frame and cannot be called outside the `MuonChannelDesign`

.

```
bool leftEdge(const int channelNumber, Amg::Vector2D& pos) const;
bool center(const int channelNumber, Amg::Vector2D& pos) const;
bool rightEdge(const int channelNumber, Amg::Vector2D& pos) const;
```

are public members and express the different points in their native coordinate frame. The plot below shows the strip edges and the corresponding centers, for the unrotated (black) and stereo layers rotated by 15 degrees (blue/red). All points are expressed in the unrotated coordinate frame

If we rotate the Trk::Surfaces, we also need to rotate the associated boundaries by the same amount to keep the overall shape of the micro mega wedges undistorted. The `Trk::RotatedTrapezoidBounds`

are now equipped with another constructor rotating the trapezoids by a given angle alpha

```
/** Constructor for symmetric Trapezoid rotated around the X axis by alpha */
RotatedTrapezoidBounds(double halex, double minhalex, double maxhalex, double alpha);
```

The plots below show the validation of the rotated bounds in combination with the rotated surfaces. The former is now outsourced to a separate MR (!56743 (merged))

Wheel A - layer 1 (Non rotated)

Wheel A - layer 3 (Stereo angle +)

Wheel A - layer 4 (Stereo angle -)

And last but not least what happens if you just exaggerate the stereo angle

Micromega residuals on track U-layer in ML1 (Legacy geometry)

Tagging: @pscholer, @lucam, @rosati, @sangelid, @chchau, @stavrop, @iodice Addresses ATLASSIM-6001