CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
HitComparatorByRadius Class Reference

Public Member Functions

 HitComparatorByRadius (const TrackerTopology *tTopo)
 
bool operator() (const TrackingRecHit *a, const TrackingRecHit *b) const
 

Private Attributes

const TrackerTopologytTopo_
 

Detailed Description

Definition at line 17 of file TrackCleaner.cc.

Constructor & Destructor Documentation

◆ HitComparatorByRadius()

HitComparatorByRadius::HitComparatorByRadius ( const TrackerTopology tTopo)
inline

Definition at line 19 of file TrackCleaner.cc.

19 { tTopo_ = tTopo; }

Member Function Documentation

◆ operator()()

bool HitComparatorByRadius::operator() ( const TrackingRecHit a,
const TrackingRecHit b 
) const
inline

Definition at line 25 of file TrackCleaner.cc.

25  {
26  DetId i1 = a->geographicalId();
27  DetId i2 = b->geographicalId();
28 
29  bool isBarrel = (i1.subdetId() == int(PixelSubdetector::PixelBarrel));
30 
31  if (i1.subdetId() != i2.subdetId()) {
32  return isBarrel;
33  } else {
34  if (isBarrel) {
35  int r1 = (tTopo_->pxbLayer(i1) - 1) * 2 + (tTopo_->pxbLadder(i1) - 1) % 2;
36  int r2 = (tTopo_->pxbLayer(i2) - 1) * 2 + (tTopo_->pxbLadder(i2) - 1) % 2;
37 
38  return (r1 < r2);
39  } else {
40  int r1 = (tTopo_->pxfDisk(i1) - 1) * 2 + (tTopo_->pxfPanel(i1) - 1) % 2;
41  int r2 = (tTopo_->pxfDisk(i2) - 1) * 2 + (tTopo_->pxfPanel(i2) - 1) % 2;
42 
43  return (r1 < r2);
44  }
45  }
46  }

References a, b, testProducerWithPsetDescEmpty_cfi::i1, testProducerWithPsetDescEmpty_cfi::i2, createfilelist::int, PixelPluginsPhase0_cfi::isBarrel, PixelSubdetector::PixelBarrel, TrackerTopology::pxbLadder(), TrackerTopology::pxbLayer(), TrackerTopology::pxfDisk(), TrackerTopology::pxfPanel(), diffTwoXMLs::r1, and diffTwoXMLs::r2.

Member Data Documentation

◆ tTopo_

const TrackerTopology* HitComparatorByRadius::tTopo_
private

Definition at line 22 of file TrackCleaner.cc.

testProducerWithPsetDescEmpty_cfi.i2
i2
Definition: testProducerWithPsetDescEmpty_cfi.py:46
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
TrackerTopology::pxbLadder
unsigned int pxbLadder(const DetId &id) const
Definition: TrackerTopology.h:155
testProducerWithPsetDescEmpty_cfi.i1
i1
Definition: testProducerWithPsetDescEmpty_cfi.py:45
TrackerTopology::pxbLayer
unsigned int pxbLayer(const DetId &id) const
Definition: TrackerTopology.h:144
TrackerTopology::pxfPanel
unsigned int pxfPanel(const DetId &id) const
Definition: TrackerTopology.h:450
DetId
Definition: DetId.h:17
b
double b
Definition: hdecay.h:118
PixelPluginsPhase0_cfi.isBarrel
isBarrel
Definition: PixelPluginsPhase0_cfi.py:17
a
double a
Definition: hdecay.h:119
diffTwoXMLs.r2
r2
Definition: diffTwoXMLs.py:73
createfilelist.int
int
Definition: createfilelist.py:10
TrackerTopology::pxfDisk
unsigned int pxfDisk(const DetId &id) const
Definition: TrackerTopology.h:446
diffTwoXMLs.r1
r1
Definition: diffTwoXMLs.py:53
HitComparatorByRadius::tTopo_
const TrackerTopology * tTopo_
Definition: TrackCleaner.cc:22