CMS 3D CMS Logo

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 130 of file MuonTrackResidualAnalyzer.h.

Constructor & Destructor Documentation

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

Definition at line 132 of file MuonTrackResidualAnalyzer.h.

132 :theTG(tg){}

Member Function Documentation

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

Definition at line 134 of file MuonTrackResidualAnalyzer.h.

References PSimHit::detUnitId(), PSimHit::localPosition(), mag(), and GeomDet::toGlobal().

135  {
136 
137  const GeomDet *geomDetA = theTG->idToDet(DetId(a->detUnitId()));
138  const GeomDet *geomDetB = theTG->idToDet(DetId(b->detUnitId()));
139 
140  double distA = geomDetA->toGlobal(a->localPosition()).mag();
141  double distB = geomDetB->toGlobal(b->localPosition()).mag();
142 
143  return distA < distB;
144  }
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:54
Local3DPoint localPosition() const
Definition: PSimHit.h:44
Definition: DetId.h:18
const GeomDet * idToDet(DetId) const override
unsigned int detUnitId() const
Definition: PSimHit.h:93

Member Data Documentation

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

Definition at line 146 of file MuonTrackResidualAnalyzer.h.