CMS 3D CMS Logo

HitComparator Class Reference

List of all members.

Public Member Functions

bool operator() (const TransientTrackingRecHit *ta, const TransientTrackingRecHit *tb) const
bool operator() (const TrackingRecHit *a, const TrackingRecHit *b) const

Private Member Functions

int getId (const TrackingRecHit *a) const
bool less (const SiStripMatchedRecHit2D *a, const SiStripMatchedRecHit2D *b) const
bool less (const SiStripRecHit2D *a, const SiStripRecHit2D *b) const
bool less (const SiPixelRecHit *a, const SiPixelRecHit *b) const


Detailed Description

Definition at line 17 of file TrackCleaner.cc.


Member Function Documentation

int HitComparator::getId ( const TrackingRecHit a  )  const [inline, private]

Definition at line 95 of file TrajectoryCleanerMerger.cc.

Referenced by operator()().

00096     {
00097       if(dynamic_cast<const SiPixelRecHit*>(a)            != 0) return 0;
00098       if(dynamic_cast<const SiStripRecHit2D*>(a)          != 0) return 1;
00099       if(dynamic_cast<const SiStripMatchedRecHit2D*>(a)   != 0) return 2;
00100       if(dynamic_cast<const ProjectedSiStripRecHit2D*>(a) != 0) return 3;
00101       return -1;
00102     }

bool HitComparator::less ( const SiStripMatchedRecHit2D a,
const SiStripMatchedRecHit2D b 
) const [inline, private]

Definition at line 118 of file TrajectoryCleanerMerger.cc.

References less(), SiStripMatchedRecHit2D::monoHit(), and SiStripMatchedRecHit2D::stereoHit().

00120     {
00121 //cerr << " comp matched strip" << endl;
00122       if(less(a->monoHit(), b->monoHit())) return true;
00123       if(less(b->monoHit(), a->monoHit())) return false;
00124 
00125       if(less(a->stereoHit(), b->stereoHit())) return true;
00126       return false;
00127     }

bool HitComparator::less ( const SiStripRecHit2D a,
const SiStripRecHit2D b 
) const [inline, private]

Definition at line 111 of file TrajectoryCleanerMerger.cc.

References SiStripRecHit2D::cluster().

00113     {
00114 //cerr << " comp strip" << endl;
00115       return a->cluster() < b->cluster();
00116     }

bool HitComparator::less ( const SiPixelRecHit a,
const SiPixelRecHit b 
) const [inline, private]

Definition at line 104 of file TrajectoryCleanerMerger.cc.

References SiPixelRecHit::cluster().

Referenced by less(), and operator()().

00106     {
00107 //cerr << " comp pixel" << endl;
00108       return a->cluster() < b->cluster();
00109     }

bool HitComparator::operator() ( const TransientTrackingRecHit ta,
const TransientTrackingRecHit tb 
) const [inline]

Definition at line 33 of file TrajectoryCleanerMerger.cc.

References a, a_, b, TrackingRecHit::geographicalId(), getId(), TransientTrackingRecHit::hit(), less(), and ProjectedSiStripRecHit2D::originalHit().

00035     {
00036       const TrackingRecHit* a = ta->hit();
00037       const TrackingRecHit* b = tb->hit();
00038 
00039       if(getId(a) < getId(b)) return true;
00040       if(getId(b) < getId(a)) return false;
00041 
00042       if(a->geographicalId() < b->geographicalId()) return true;
00043       if(b->geographicalId() < a->geographicalId()) return false;
00044 
00045       const SiPixelRecHit* a_ = dynamic_cast<const SiPixelRecHit*>(a);
00046       if(a_ != 0)
00047       {
00048         const SiPixelRecHit* b_ = dynamic_cast<const SiPixelRecHit*>(b);
00049         return less(a_, b_);
00050       }
00051       else
00052       {
00053         const SiStripMatchedRecHit2D* a_ =
00054           dynamic_cast<const SiStripMatchedRecHit2D*>(a);
00055 
00056         if(a_ != 0)
00057         {
00058           const SiStripMatchedRecHit2D* b_ =
00059             dynamic_cast<const SiStripMatchedRecHit2D*>(b);
00060           return less(a_, b_);
00061         }
00062         else
00063         {
00064           const SiStripRecHit2D* a_ =
00065             dynamic_cast<const SiStripRecHit2D*>(a);
00066 
00067           if(a_ != 0)
00068           {
00069             const SiStripRecHit2D* b_ =
00070               dynamic_cast<const SiStripRecHit2D*>(b);
00071             return less(a_, b_);
00072           }
00073           else 
00074           {
00075             const ProjectedSiStripRecHit2D* a_ =
00076               dynamic_cast<const ProjectedSiStripRecHit2D*>(a); 
00077 
00078 //cerr << " comp proj" << endl;
00079 
00080             if(a_ != 0)
00081             {
00082               const ProjectedSiStripRecHit2D* b_ =
00083                 dynamic_cast<const ProjectedSiStripRecHit2D*>(b);
00084 
00085               return less(&(a_->originalHit()), &(b_->originalHit()));
00086             }
00087             else
00088               return false;
00089           }
00090         }
00091       }
00092     }

bool HitComparator::operator() ( const TrackingRecHit a,
const TrackingRecHit b 
) const [inline]

Definition at line 20 of file TrackCleaner.cc.

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

00021   {
00022     if(a->geographicalId() < b->geographicalId()) return true;
00023     if(b->geographicalId() < a->geographicalId()) return false;
00024 
00025     if(a->localPosition().x() < b->localPosition().x() - 1e-5) return true;
00026     if(b->localPosition().x() < a->localPosition().x() - 1e-5) return false;
00027 
00028     if(a->localPosition().y() < b->localPosition().y() - 1e-5) return true;
00029     if(b->localPosition().y() < a->localPosition().y() - 1e-5) return false;
00030 
00031     return false;
00032   }


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