CMS 3D CMS Logo

List of all members | Public Member Functions
PixelBarrelLinkMaker::Order Struct Reference

Public Member Functions

bool operator() (const Item &, const Item &) const
 

Detailed Description

define order of items in a link. Highest priority to layer id. Second priority for ladder id (phi). Third priority by abs(module) (ie. along |z|) If all equal id of ROC matters

Definition at line 57 of file PixelBarrelLinkMaker.h.

Member Function Documentation

bool PixelBarrelLinkMaker::Order::operator() ( const Item u1,
const Item u2 
) const

Definition at line 12 of file PixelBarrelLinkMaker.cc.

References funct::abs(), PixelBarrelName::ladderName(), PixelBarrelName::layerName(), TRange< T >::min(), PixelBarrelName::moduleName(), PixelBarrelLinkMaker::Item::name, and PixelBarrelLinkMaker::Item::rocIds.

12  {
13  const PixelBarrelName& n1 = *u1.name;
14  const PixelBarrelName& n2 = *u2.name;
15 
16  bool res = false;
17 
18  if (n1.layerName() < n2.layerName())
19  res = true;
20  else if (n1.layerName() > n2.layerName())
21  res = false;
22  else if (n1.ladderName() < n2.ladderName())
23  res = true;
24  else if (n1.ladderName() > n2.ladderName())
25  res = false;
26  else if (abs(n1.moduleName()) < abs(n2.moduleName()))
27  res = true;
28  else if (abs(n1.moduleName()) > abs(n2.moduleName()))
29  res = false;
30  else if (u1.rocIds.min() < u2.rocIds.min())
31  res = true;
32  else if (u1.rocIds.min() > u2.rocIds.min())
33  res = false;
34 
35  return res;
36 }
int moduleName() const
module id (index in z)
Definition: Electron.h:6
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int ladderName() const
ladder id (index in phi)
int layerName() const
layer id