CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions | Public Attributes
MuonTrackResidualAnalyzer::RadiusComparatorInOut Struct Reference

Public Member Functions

bool operator() (const PSimHit *a, const PSimHit *b) const
 
 RadiusComparatorInOut (edm::ESHandle< GlobalTrackingGeometry > tg)
 

Public Attributes

edm::ESHandle< GlobalTrackingGeometrytheTG
 

Detailed Description

Definition at line 117 of file MuonTrackResidualAnalyzer.h.

Constructor & Destructor Documentation

◆ RadiusComparatorInOut()

MuonTrackResidualAnalyzer::RadiusComparatorInOut::RadiusComparatorInOut ( edm::ESHandle< GlobalTrackingGeometry tg)
inline

Definition at line 118 of file MuonTrackResidualAnalyzer.h.

118 : theTG(tg) {}

Member Function Documentation

◆ operator()()

bool MuonTrackResidualAnalyzer::RadiusComparatorInOut::operator() ( const PSimHit a,
const PSimHit b 
) const
inline

Definition at line 120 of file MuonTrackResidualAnalyzer.h.

120  {
121  const GeomDet *geomDetA = theTG->idToDet(DetId(a->detUnitId()));
122  const GeomDet *geomDetB = theTG->idToDet(DetId(b->detUnitId()));
123 
124  double distA = geomDetA->toGlobal(a->localPosition()).mag();
125  double distB = geomDetB->toGlobal(b->localPosition()).mag();
126 
127  return distA < distB;
128  }

References a, b, GlobalTrackingGeometry::idToDet(), mag(), theTG, and GeomDet::toGlobal().

Member Data Documentation

◆ theTG

edm::ESHandle<GlobalTrackingGeometry> MuonTrackResidualAnalyzer::RadiusComparatorInOut::theTG

Definition at line 130 of file MuonTrackResidualAnalyzer.h.

Referenced by operator()().

GeomDet
Definition: GeomDet.h:27
MuonTrackResidualAnalyzer::RadiusComparatorInOut::theTG
edm::ESHandle< GlobalTrackingGeometry > theTG
Definition: MuonTrackResidualAnalyzer.h:130
DetId
Definition: DetId.h:17
b
double b
Definition: hdecay.h:118
GeomDet::toGlobal
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
a
double a
Definition: hdecay.h:119
mag
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
Definition: Basic3DVectorLD.h:127
GlobalTrackingGeometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: GlobalTrackingGeometry.cc:44