CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions
HitComparator Class Reference

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 SiPixelRecHit *a, const SiPixelRecHit *b) const
 
bool less (const SiStripRecHit2D *a, const SiStripRecHit2D *b) const
 
bool less (const SiStripMatchedRecHit2D *a, const SiStripMatchedRecHit2D *b) const
 

Detailed Description

Definition at line 58 of file TrackCleaner.cc.

Member Function Documentation

int HitComparator::getId ( const TrackingRecHit a) const
inlineprivate

Definition at line 95 of file TrajectoryCleanerMerger.cc.

96  {
97  if(dynamic_cast<const SiPixelRecHit*>(a) != 0) return 0;
98  if(dynamic_cast<const SiStripRecHit2D*>(a) != 0) return 1;
99  if(dynamic_cast<const SiStripMatchedRecHit2D*>(a) != 0) return 2;
100  if(dynamic_cast<const ProjectedSiStripRecHit2D*>(a) != 0) return 3;
101  return -1;
102  }
bool HitComparator::less ( const SiPixelRecHit a,
const SiPixelRecHit b 
) const
inlineprivate

Definition at line 104 of file TrajectoryCleanerMerger.cc.

106  {
107 //std::cerr << " comp pixel" << std::endl;
108  return a->cluster() < b->cluster();
109  }
bool HitComparator::less ( const SiStripRecHit2D *  a,
const SiStripRecHit2D *  b 
) const
inlineprivate

Definition at line 111 of file TrajectoryCleanerMerger.cc.

113  {
114 //std::cerr << " comp strip" << std::endl;
115  return a->cluster() < b->cluster();
116  }
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
bool HitComparator::less ( const SiStripMatchedRecHit2D *  a,
const SiStripMatchedRecHit2D *  b 
) const
inlineprivate

Definition at line 118 of file TrajectoryCleanerMerger.cc.

120  {
121 //std::cerr << " comp matched strip" << std::endl;
122  if(a->monoClusterRef() < b->monoClusterRef()) return true;
123  if(b->monoClusterRef() < a->monoClusterRef()) return false;
124  if(a->stereoClusterRef() < b->stereoClusterRef()) return true;
125  return false;
126  }
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
bool HitComparator::operator() ( const TransientTrackingRecHit ta,
const TransientTrackingRecHit tb 
) const
inline

Definition at line 33 of file TrajectoryCleanerMerger.cc.

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

35  {
36  const TrackingRecHit* a = ta->hit();
37  const TrackingRecHit* b = tb->hit();
38 
39  if(getId(a) < getId(b)) return true;
40  if(getId(b) < getId(a)) return false;
41 
42  if(a->geographicalId() < b->geographicalId()) return true;
43  if(b->geographicalId() < a->geographicalId()) return false;
44 
45  const SiPixelRecHit* a_ = dynamic_cast<const SiPixelRecHit*>(a);
46  if(a_ != 0)
47  {
48  const SiPixelRecHit* b_ = dynamic_cast<const SiPixelRecHit*>(b);
49  return less(a_, b_);
50  }
51  else
52  {
53  const SiStripMatchedRecHit2D* a_ =
54  dynamic_cast<const SiStripMatchedRecHit2D*>(a);
55 
56  if(a_ != 0)
57  {
58  const SiStripMatchedRecHit2D* b_ =
59  dynamic_cast<const SiStripMatchedRecHit2D*>(b);
60  return less(a_, b_);
61  }
62  else
63  {
64  const SiStripRecHit2D* a_ =
65  dynamic_cast<const SiStripRecHit2D*>(a);
66 
67  if(a_ != 0)
68  {
69  const SiStripRecHit2D* b_ =
70  dynamic_cast<const SiStripRecHit2D*>(b);
71  return less(a_, b_);
72  }
73  else
74  {
75  const ProjectedSiStripRecHit2D* a_ =
76  dynamic_cast<const ProjectedSiStripRecHit2D*>(a);
77 
78 //std::cerr << " comp proj" << std::endl;
79 
80  if(a_ != 0)
81  {
82  const ProjectedSiStripRecHit2D* b_ =
83  dynamic_cast<const ProjectedSiStripRecHit2D*>(b);
84 
85  return less(&(a_->originalHit()), &(b_->originalHit()));
86  }
87  else
88  return false;
89  }
90  }
91  }
92  }
virtual const TrackingRecHit * hit() const =0
int getId(const TrackingRecHit *a) const
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
DetId geographicalId() const
bool less(const SiPixelRecHit *a, const SiPixelRecHit *b) const
const SiStripRecHit2D & originalHit() const
Pixel Reconstructed Hit.
bool HitComparator::operator() ( const TrackingRecHit a,
const TrackingRecHit b 
) const
inline

Definition at line 61 of file TrackCleaner.cc.

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

62  {
63  if(a->geographicalId() < b->geographicalId()) return true;
64  if(b->geographicalId() < a->geographicalId()) return false;
65 
66  if(a->localPosition().x() < b->localPosition().x() - 1e-5) return true;
67  if(b->localPosition().x() < a->localPosition().x() - 1e-5) return false;
68 
69  if(a->localPosition().y() < b->localPosition().y() - 1e-5) return true;
70  if(b->localPosition().y() < a->localPosition().y() - 1e-5) return false;
71 
72  return false;
73  }
T y() const
Definition: PV3DBase.h:62
DetId geographicalId() const
T x() const
Definition: PV3DBase.h:61
virtual LocalPoint localPosition() const =0