CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CompareHitY Class Reference

#include <CosmicTrajectoryBuilder.h>

Public Member Functions

 CompareHitY (const TrackerGeometry &tracker)
 
 CompareHitY (const TrackerGeometry &tracker)
 
bool operator() (const TrackingRecHit *rh1, const TrackingRecHit *rh2)
 
bool operator() (const TrackingRecHit *rh1, const TrackingRecHit *rh2)
 

Private Attributes

const TrackerGeometry_tracker
 

Detailed Description

Definition at line 44 of file CosmicTrajectoryBuilder.h.

Constructor & Destructor Documentation

◆ CompareHitY() [1/2]

CompareHitY::CompareHitY ( const TrackerGeometry tracker)
inline

Definition at line 46 of file CosmicTrajectoryBuilder.h.

◆ CompareHitY() [2/2]

CompareHitY::CompareHitY ( const TrackerGeometry tracker)
inline

Definition at line 94 of file CRackTrajectoryBuilder.h.

Member Function Documentation

◆ operator()() [1/2]

bool CompareHitY::operator() ( const TrackingRecHit rh1,
const TrackingRecHit rh2 
)
inline

Definition at line 47 of file CosmicTrajectoryBuilder.h.

References _tracker, TrackingRecHit::geographicalId(), TrackerGeometry::idToDet(), TrackingRecHit::localPosition(), GeomDet::toGlobal(), and PV3DBase< T, PVType, FrameType >::y().

47  {
48  GlobalPoint gp1 = _tracker.idToDet(rh1->geographicalId())->surface().toGlobal(rh1->localPosition());
49  GlobalPoint gp2 = _tracker.idToDet(rh2->geographicalId())->surface().toGlobal(rh2->localPosition());
50  return gp1.y() < gp2.y();
51  };
const TrackerGeometry & _tracker
T y() const
Definition: PV3DBase.h:60
const TrackerGeomDet * idToDet(DetId) const override
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
DetId geographicalId() const
virtual LocalPoint localPosition() const =0

◆ operator()() [2/2]

bool CompareHitY::operator() ( const TrackingRecHit rh1,
const TrackingRecHit rh2 
)
inline

Definition at line 95 of file CRackTrajectoryBuilder.h.

References _tracker, TrackingRecHit::geographicalId(), TrackerGeometry::idToDet(), TrackingRecHit::localPosition(), GeomDet::toGlobal(), and PV3DBase< T, PVType, FrameType >::y().

95  {
96  GlobalPoint gp1 = _tracker.idToDet(rh1->geographicalId())->surface().toGlobal(rh1->localPosition());
97  GlobalPoint gp2 = _tracker.idToDet(rh2->geographicalId())->surface().toGlobal(rh2->localPosition());
98  return gp1.y() < gp2.y();
99  };
const TrackerGeometry & _tracker
T y() const
Definition: PV3DBase.h:60
const TrackerGeomDet * idToDet(DetId) const override
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
DetId geographicalId() const
virtual LocalPoint localPosition() const =0

Member Data Documentation

◆ _tracker

const TrackerGeometry & CompareHitY::_tracker
private

Definition at line 51 of file CosmicTrajectoryBuilder.h.

Referenced by operator()().