CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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
< GlobalTrackingGeometry
theTG
 

Detailed Description

Definition at line 121 of file MuonTrackResidualAnalyzer.h.

Constructor & Destructor Documentation

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

Definition at line 123 of file MuonTrackResidualAnalyzer.h.

123 :theTG(tg){}

Member Function Documentation

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

Definition at line 125 of file MuonTrackResidualAnalyzer.h.

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

126  {
127 
128  const GeomDet *geomDetA = theTG->idToDet(DetId(a->detUnitId()));
129  const GeomDet *geomDetB = theTG->idToDet(DetId(b->detUnitId()));
130 
131  double distA = geomDetA->toGlobal(a->localPosition()).mag();
132  double distB = geomDetB->toGlobal(b->localPosition()).mag();
133 
134  return distA < distB;
135  }
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:47
Local3DPoint localPosition() const
Definition: PSimHit.h:44
Definition: DetId.h:20
unsigned int detUnitId() const
Definition: PSimHit.h:93

Member Data Documentation

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

Definition at line 137 of file MuonTrackResidualAnalyzer.h.

Referenced by operator()().