CMS 3D CMS Logo

List of all members | Public Member Functions
RecHitComparatorByPosition Class Reference

#include <RecHitComparatorByPosition.h>

Public Member Functions

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

Detailed Description

Definition at line 4 of file RecHitComparatorByPosition.h.

Constructor & Destructor Documentation

◆ RecHitComparatorByPosition()

RecHitComparatorByPosition::RecHitComparatorByPosition ( )
inline

Definition at line 6 of file RecHitComparatorByPosition.h.

6 {}

Member Function Documentation

◆ equals()

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

Definition at line 15 of file RecHitComparatorByPosition.cc.

References a, and b.

15  {
16  float xcut = 0.01;
17  float ycut = 0.2;
18  if (a->geographicalId() != b->geographicalId())
19  return false;
20  if (a->isValid() && b->isValid()) {
21  if (fabs(a->localPosition().x() - b->localPosition().x()) >= xcut)
22  return false;
23  return (fabs(a->localPosition().y() - b->localPosition().y()) < ycut);
24  } else if (!a->isValid() && !b->isValid()) {
25  return true;
26  } else
27  return false;
28 }
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121

◆ operator()()

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

Definition at line 2 of file RecHitComparatorByPosition.cc.

References a, and b.

2  {
3  float xcut = 0.01;
4  float ycut = 0.2;
5  if (a->geographicalId() < b->geographicalId())
6  return true;
7  if (b->geographicalId() < a->geographicalId())
8  return false;
9  if (a->localPosition().x() < b->localPosition().x() - xcut)
10  return true;
11  if (b->localPosition().x() < a->localPosition().x() - xcut)
12  return false;
13  return (a->localPosition().y() < b->localPosition().y() - ycut);
14 }
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121