CMS 3D CMS Logo

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

Member Function Documentation

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

Definition at line 13 of file PixelBarrelLinkMaker.cc.

References abs, PixelBarrelName::ladderName(), PixelBarrelName::layerName(), PixelBarrelName::moduleName(), and PixelBarrelName::name().

14 {
15  const PixelBarrelName & n1 = *u1.name;
16  const PixelBarrelName & n2 = *u2.name;
17 
18  bool res = false;
19 
20  if ( n1.layerName() < n2.layerName() ) res = true;
21  else if ( n1.layerName() > n2.layerName() ) res = false;
22  else if ( n1.ladderName() < n2.ladderName() ) res = true;
23  else if ( n1.ladderName() > n2.ladderName() ) res = false;
24  else if ( abs(n1.moduleName()) < abs(n2.moduleName()) ) res = true;
25  else if ( abs(n1.moduleName()) > abs(n2.moduleName()) ) res = false;
26  else if ( u1.rocIds.min() < u2.rocIds.min() ) res = true;
27  else if ( u1.rocIds.min() > u2.rocIds.min() ) res = false;
28 
29  return res;
30 }
int moduleName() const
module id (index in z)
#define abs(x)
Definition: mlp_lapack.h:159
int ladderName() const
ladder id (index in phi)
virtual std::string name() const
from base class
int layerName() const
layer id