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; }
const TrackerTopology * tTopo_
Definition: TrackCleaner.cc:22

Member Function Documentation

◆ operator()()

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

Definition at line 25 of file TrackCleaner.cc.

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

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  }
unsigned int pxbLayer(const DetId &id) const
unsigned int pxbLadder(const DetId &id) const
unsigned int pxfDisk(const DetId &id) const
unsigned int pxfPanel(const DetId &id) const
Definition: DetId.h:17
double b
Definition: hdecay.h:120
double a
Definition: hdecay.h:121
const TrackerTopology * tTopo_
Definition: TrackCleaner.cc:22

Member Data Documentation

◆ tTopo_

const TrackerTopology* HitComparatorByRadius::tTopo_
private

Definition at line 22 of file TrackCleaner.cc.