CMS 3D CMS Logo

RecHitComparatorByPosition Class Reference

#include <TrackingTools/TransientTrackingRecHit/interface/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().

00011                                                                                                 {
00012     float xcut = 0.01;
00013     float ycut = 0.2;
00014     if (a->geographicalId() != b->geographicalId()) return false; 
00015     if (a->isValid() && b->isValid()) {
00016         if (fabs(a->localPosition().x() - b->localPosition().x()) >=  xcut)  return false;
00017         return (fabs(a->localPosition().y() - b->localPosition().y()) <  ycut);
00018     } else if (!a->isValid() && !b->isValid()) {
00019         return true;
00020     } else return false;
00021 }

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().

00002                                                                                                      {
00003     float xcut = 0.01;
00004     float ycut = 0.2;
00005     if (a->geographicalId()<b->geographicalId()) return true;  
00006     if (b->geographicalId()<a->geographicalId()) return false;  
00007     if (a->localPosition().x() < b->localPosition().x() - xcut)  return true;
00008     if (b->localPosition().x() < a->localPosition().x() - xcut) return false;
00009     return (a->localPosition().y() < b->localPosition().y() - ycut );
00010   }


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:30:40 2009 for CMSSW by  doxygen 1.5.4