CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
HitComparatorByRadius Class Reference

Public Member Functions

bool operator() (const TrackingRecHit *a, const TrackingRecHit *b) const
 

Detailed Description

Definition at line 17 of file TrackCleaner.cc.

Member Function Documentation

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

Definition at line 20 of file TrackCleaner.cc.

References PXFDetId::disk(), TrackingRecHit::geographicalId(), PXBDetId::ladder(), PXBDetId::layer(), p1, p2, PXFDetId::panel(), PixelSubdetector::PixelBarrel, diffTwoXMLs::r1, diffTwoXMLs::r2, and DetId::subdetId().

21  {
22  DetId i1 = a->geographicalId();
23  DetId i2 = b->geographicalId();
24 
25  bool isBarrel = (i1.subdetId() == int(PixelSubdetector::PixelBarrel));
26 
27  if(i1.subdetId() != i2.subdetId())
28  {
29  return isBarrel;
30  }
31  else
32  {
33  if(isBarrel)
34  {
35  PXBDetId p1(i1);
36  PXBDetId p2(i2);
37 
38  int r1 = (p1.layer() - 1)*2 + (p1.ladder() - 1)%2;
39  int r2 = (p2.layer() - 1)*2 + (p2.ladder() - 1)%2;
40 
41  return (r1 < r2);
42  }
43  else
44  {
45  PXFDetId p1(i1);
46  PXFDetId p2(i2);
47 
48  int r1 = (p1.disk() - 1)*2 + (p1.panel() - 1)%2;
49  int r2 = (p2.disk() - 1)*2 + (p2.panel() - 1)%2;
50 
51  return (r1 < r2);
52  }
53  }
54  }
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
double p2[4]
Definition: TauolaWrapper.h:90
Definition: DetId.h:20
double p1[4]
Definition: TauolaWrapper.h:89
DetId geographicalId() const