diff --git a/TrackingTools/TrackAssociator/src/TrackDetectorAssociator.cc b/TrackingTools/TrackAssociator/src/TrackDetectorAssociator.cc index d7f9c41519024..d164292554f15 100644 --- a/TrackingTools/TrackAssociator/src/TrackDetectorAssociator.cc +++ b/TrackingTools/TrackAssociator/src/TrackDetectorAssociator.cc @@ -48,6 +48,7 @@ #include "Geometry/CSCGeometry/interface/CSCGeometry.h" #include "Geometry/GEMGeometry/interface/GEMGeometry.h" #include "Geometry/GEMGeometry/interface/ME0Geometry.h" +#include "Geometry/GEMGeometry/interface/GEMEtaPartitionSpecs.h" #include "TrackPropagation/SteppingHelixPropagator/interface/SteppingHelixPropagator.h" #include @@ -665,6 +666,17 @@ void TrackDetectorAssociator::getTAMuonChamberMatches(std::vector(geomDet) || dynamic_cast(geomDet)) { + const TrapezoidalPlaneBounds* bounds = dynamic_cast(&geomDet->surface().bounds()); + + float wideWidth = bounds->width(); + float narrowWidth = 2.f * bounds->widthAtHalfLength() - wideWidth; + float length = bounds->length(); + float tangent = (wideWidth - narrowWidth) / (2.f * length); + float halfWidthAtY = tangent * localPoint.y() + 0.5f * narrowWidth; + + distanceX = std::abs(localPoint.x()) - halfWidthAtY; + distanceY = std::abs(localPoint.y()) - 0.5f * length; } else { distanceX = std::abs(localPoint.x()) - 0.5f * geomDet->surface().bounds().width(); distanceY = std::abs(localPoint.y()) - 0.5f * geomDet->surface().bounds().length();