Main Page
Namespaces
Classes
Package Documentation
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Pages
TrackingTools
TransientTrackingRecHit
src
RecHitComparatorByPosition.cc
Go to the documentation of this file.
1
#include "
TrackingTools/TransientTrackingRecHit/interface/RecHitComparatorByPosition.h
"
2
bool
RecHitComparatorByPosition::operator()
(
const
TrackingRecHit
*
a
,
const
TrackingRecHit
*
b
)
const
{
3
float
xcut = 0.01;
4
float
ycut = 0.2;
5
if
(a->
geographicalId
()<b->
geographicalId
())
return
true
;
6
if
(b->
geographicalId
()<a->
geographicalId
())
return
false
;
7
if
(a->
localPosition
().
x
() < b->
localPosition
().
x
() - xcut)
return
true
;
8
if
(b->
localPosition
().
x
() < a->
localPosition
().
x
() - xcut)
return
false
;
9
return
(a->
localPosition
().
y
() < b->
localPosition
().
y
() - ycut );
10
}
11
bool
RecHitComparatorByPosition::equals
(
const
TrackingRecHit
*
a
,
const
TrackingRecHit
*
b
)
const
{
12
float
xcut = 0.01;
13
float
ycut = 0.2;
14
if
(a->
geographicalId
() != b->
geographicalId
())
return
false
;
15
if
(a->
isValid
() && b->
isValid
()) {
16
if
(fabs(a->
localPosition
().
x
() - b->
localPosition
().
x
()) >= xcut)
return
false
;
17
return
(fabs(a->
localPosition
().
y
() - b->
localPosition
().
y
()) < ycut);
18
}
else
if
(!a->
isValid
() && !b->
isValid
()) {
19
return
true
;
20
}
else
return
false
;
21
}
RecHitComparatorByPosition::equals
bool equals(const TrackingRecHit *a, const TrackingRecHit *b) const
Definition:
RecHitComparatorByPosition.cc:11
PV3DBase::y
T y() const
Definition:
PV3DBase.h:63
TrackingRecHit
Definition:
TrackingRecHit.h:23
RecHitComparatorByPosition::operator()
bool operator()(const TrackingRecHit *a, const TrackingRecHit *b) const
Definition:
RecHitComparatorByPosition.cc:2
TrackingRecHit::isValid
bool isValid() const
Definition:
TrackingRecHit.h:139
b
double b
Definition:
hdecay.h:120
a
double a
Definition:
hdecay.h:121
TrackingRecHit::geographicalId
DetId geographicalId() const
Definition:
TrackingRecHit.h:116
RecHitComparatorByPosition.h
PV3DBase::x
T x() const
Definition:
PV3DBase.h:62
TrackingRecHit::localPosition
virtual LocalPoint localPosition() const =0
Generated for CMSSW Reference Manual by
1.8.5