CMS 3D CMS Logo

Public Member Functions

RecHitComparatorByPosition Class Reference

#include <RecHitComparatorByPosition.h>

List of all members.

Public Member Functions

bool equals (const TrackingRecHit *a, const TrackingRecHit *b) const
bool operator() (const TrackingRecHit *a, const TrackingRecHit *b) const

Detailed Description

Definition at line 4 of file RecHitComparatorByPosition.h.


Member Function Documentation

bool RecHitComparatorByPosition::equals ( const TrackingRecHit a,
const TrackingRecHit b 
) const

Definition at line 11 of file RecHitComparatorByPosition.cc.

References TrackingRecHit::geographicalId(), TrackingRecHit::isValid(), TrackingRecHit::localPosition(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

Referenced by CachingSeedCleanerByHitPosition::good(), and SeedCleanerByHitPosition::good().

                                                                                                {
    float xcut = 0.01;
    float ycut = 0.2;
    if (a->geographicalId() != b->geographicalId()) return false; 
    if (a->isValid() && b->isValid()) {
        if (fabs(a->localPosition().x() - b->localPosition().x()) >=  xcut)  return false;
        return (fabs(a->localPosition().y() - b->localPosition().y()) <  ycut);
    } else if (!a->isValid() && !b->isValid()) {
        return true;
    } else return false;
}
bool RecHitComparatorByPosition::operator() ( const TrackingRecHit a,
const TrackingRecHit b 
) const

Definition at line 2 of file RecHitComparatorByPosition.cc.

References TrackingRecHit::geographicalId(), TrackingRecHit::localPosition(), PV3DBase< T, PVType, FrameType >::x(), and PV3DBase< T, PVType, FrameType >::y().

                                                                                                     {
    float xcut = 0.01;
    float ycut = 0.2;
    if (a->geographicalId()<b->geographicalId()) return true;  
    if (b->geographicalId()<a->geographicalId()) return false;  
    if (a->localPosition().x() < b->localPosition().x() - xcut)  return true;
    if (b->localPosition().x() < a->localPosition().x() - xcut) return false;
    return (a->localPosition().y() < b->localPosition().y() - ycut );
  }