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 ( 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

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

Definition at line 25 of file TrackCleaner.cc.

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

25  {
26  DetId i1 = a->geographicalId();
27  DetId i2 = b->geographicalId();
28 
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 pxfDisk(const DetId &id) const
unsigned int pxbLadder(const DetId &id) const
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
unsigned int pxbLayer(const DetId &id) const
Definition: DetId.h:17
DetId geographicalId() const
unsigned int pxfPanel(const DetId &id) const
const TrackerTopology * tTopo_
Definition: TrackCleaner.cc:22

Member Data Documentation

const TrackerTopology* HitComparatorByRadius::tTopo_
private

Definition at line 22 of file TrackCleaner.cc.