CMS 3D CMS Logo

Public Member Functions

PixelBarrelLinkMaker::Order Struct Reference

List of all members.

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

{
  const PixelBarrelName & n1 = *u1.name;
  const PixelBarrelName & n2 = *u2.name;

  bool res = false;

       if ( n1.layerName() < n2.layerName() ) res = true;
  else if ( n1.layerName() > n2.layerName() ) res = false;
  else if ( n1.ladderName() < n2.ladderName() ) res = true;
  else if ( n1.ladderName() > n2.ladderName() ) res = false;
  else if ( abs(n1.moduleName()) < abs(n2.moduleName()) ) res =  true;
  else if ( abs(n1.moduleName()) > abs(n2.moduleName()) ) res =  false;
  else if ( u1.rocIds.min() < u2.rocIds.min() ) res = true;
  else if ( u1.rocIds.min() > u2.rocIds.min() ) res = false;

  return res;
}