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

◆ operator()()

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

Definition at line 12 of file PixelBarrelLinkMaker.cc.

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 }

References funct::abs(), PixelBarrelName::ladderName(), PixelBarrelName::layerName(), PixelBarrelName::moduleName(), testProducerWithPsetDescEmpty_cfi::u1, and MetAnalyzer::u2.

PixelBarrelName
Definition: PixelBarrelName.h:16
PixelBarrelName::layerName
int layerName() const
layer id
Definition: PixelBarrelName.h:43
PixelBarrelName::ladderName
int ladderName() const
ladder id (index in phi)
Definition: PixelBarrelName.h:49
testProducerWithPsetDescEmpty_cfi.u1
u1
Definition: testProducerWithPsetDescEmpty_cfi.py:49
PixelBarrelName::moduleName
int moduleName() const
module id (index in z)
Definition: PixelBarrelName.h:46
res
Definition: Electron.h:6
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
MetAnalyzer.u2
u2
Definition: MetAnalyzer.py:61