CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 20 of file TrackCleaner.cc.

20 {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 24 of file TrackCleaner.cc.

References TrackingRecHit::geographicalId(), PixelSubdetector::PixelBarrel, diffTwoXMLs::r1, diffTwoXMLs::r2, and DetId::subdetId().

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  {
33  return isBarrel;
34  }
35  else
36  {
37  if(isBarrel)
38  {
39  int r1 = (tTopo_->pxbLayer(i1) - 1)*2 + (tTopo_->pxbLadder(i1) - 1)%2;
40  int r2 = (tTopo_->pxbLayer(i2) - 1)*2 + (tTopo_->pxbLadder(i2) - 1)%2;
41 
42  return (r1 < r2);
43  }
44  else
45  {
46  int r1 = (tTopo_->pxfDisk(i1) - 1)*2 + (tTopo_->pxfPanel(i1) - 1)%2;
47  int r2 = (tTopo_->pxfDisk(i2) - 1)*2 + (tTopo_->pxfPanel(i2) - 1)%2;
48 
49  return (r1 < r2);
50  }
51  }
52  }
unsigned int pxfDisk(const DetId &id) const
unsigned int pxbLadder(const DetId &id) const
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
unsigned int pxbLayer(const DetId &id) const
Definition: DetId.h:18
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.