Skip to content

Commit

Permalink
Merge pull request #40554 from Jo100sun/GEMedge
Browse files Browse the repository at this point in the history
Correct GEM edge calculation for TrackerMuons
  • Loading branch information
cmsbuild committed Jan 20, 2023
2 parents dc7fded + dc988ac commit 75a6a9d
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions TrackingTools/TrackAssociator/src/TrackDetectorAssociator.cc
Expand Up @@ -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 <stack>
Expand Down Expand Up @@ -665,6 +666,17 @@ void TrackDetectorAssociator::getTAMuonChamberMatches(std::vector<TAMuonChamberM
float halfWidthAtYPrime = 0.5f * narrowWidth + yPrime * tangent;
distanceX = std::abs(localPoint.x()) - halfWidthAtYPrime;
distanceY = std::abs(localPoint.y() - yCOWPOffset) - 0.5f * length;
} else if (dynamic_cast<const GEMChamber*>(geomDet) || dynamic_cast<const GEMSuperChamber*>(geomDet)) {
const TrapezoidalPlaneBounds* bounds = dynamic_cast<const TrapezoidalPlaneBounds*>(&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();
Expand Down

0 comments on commit 75a6a9d

Please sign in to comment.