CMS 3D CMS Logo

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

#include <RecHitLessByDet.h>

Public Member Functions

bool operator() (const RecHitPointer &aHit, const RecHitPointer &bHit) const
 
 RecHitLessByDet (const PropagationDirection &dir)
 
 ~RecHitLessByDet ()
 

Private Types

typedef TransientTrackingRecHit::ConstRecHitPointer RecHitPointer
 

Private Attributes

PropagationDirection theDirection
 

Detailed Description

A comparison operator for RecHits. Returns true if the hits are in the order in which they would be seen by an outgoing (or an incoming) track. Only meaningful for RecHits from the same trajectory. Ported from ORCA

Author
todorov, cerati

Definition at line 16 of file RecHitLessByDet.h.

Member Typedef Documentation

◆ RecHitPointer

Definition at line 17 of file RecHitLessByDet.h.

Constructor & Destructor Documentation

◆ RecHitLessByDet()

RecHitLessByDet::RecHitLessByDet ( const PropagationDirection dir)
inline

Definition at line 20 of file RecHitLessByDet.h.

20 : theDirection(dir) {}
PropagationDirection theDirection

◆ ~RecHitLessByDet()

RecHitLessByDet::~RecHitLessByDet ( )
inline

Definition at line 22 of file RecHitLessByDet.h.

22 {}

Member Function Documentation

◆ operator()()

bool RecHitLessByDet::operator() ( const RecHitPointer aHit,
const RecHitPointer bHit 
) const
inline

Definition at line 24 of file RecHitLessByDet.h.

References alongMomentum, mag(), and theDirection.

24  {
25  return (theDirection == alongMomentum ? (aHit->surface()->toGlobal(aHit->localPosition()).mag() <
26  bHit->surface()->toGlobal(bHit->localPosition()).mag())
27  : (aHit->surface()->toGlobal(aHit->localPosition()).mag() >
28  bHit->surface()->toGlobal(bHit->localPosition()).mag()));
29  }
PropagationDirection theDirection
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())

Member Data Documentation

◆ theDirection

PropagationDirection RecHitLessByDet::theDirection
private

Definition at line 32 of file RecHitLessByDet.h.

Referenced by operator()().