CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions
HGCalWaferIndex Class Reference

#include <HGCalWaferIndex.h>

Public Member Functions

 HGCalWaferIndex ()
 
 ~HGCalWaferIndex ()
 

Static Public Member Functions

static int32_t waferCopy (const int32_t index)
 
static bool waferFormat (const int32_t index)
 
static int32_t waferIndex (int32_t layer, int32_t waferU, int32_t waferV, bool old=false)
 
static int32_t waferLayer (const int32_t index)
 
static int32_t waferU (const int32_t index)
 
static int32_t waferV (const int32_t index)
 

Detailed Description

Definition at line 7 of file HGCalWaferIndex.h.

Constructor & Destructor Documentation

HGCalWaferIndex::HGCalWaferIndex ( )
inline

Definition at line 9 of file HGCalWaferIndex.h.

9 {}
HGCalWaferIndex::~HGCalWaferIndex ( )
inline

Definition at line 10 of file HGCalWaferIndex.h.

References waferCopy(), waferFormat(), waferIndex(), waferLayer(), waferU(), and waferV().

10 {}

Member Function Documentation

int HGCalWaferIndex::waferCopy ( const int32_t  index)
static

Definition at line 51 of file HGCalWaferIndex.cc.

References kHGCalWaferCopyMask, and kHGCalWaferCopyOffset.

Referenced by ~HGCalWaferIndex().

51  {
53 }
const int kHGCalWaferCopyOffset
const int kHGCalWaferCopyMask
bool HGCalWaferIndex::waferFormat ( const int32_t  index)
static

Definition at line 55 of file HGCalWaferIndex.cc.

References kHGCalLayerOldMask.

Referenced by ~HGCalWaferIndex().

55  {
56  return ((id & kHGCalLayerOldMask) == 0);
57 }
const int kHGCalLayerOldMask
int32_t HGCalWaferIndex::waferIndex ( int32_t  layer,
int32_t  waferU,
int32_t  waferV,
bool  old = false 
)
static

Definition at line 17 of file HGCalWaferIndex.cc.

References funct::abs(), triggerObjects_cff::id, kHGCalLayerMask, kHGCalLayerOffset, kHGCalLayerOldMask, kHGCalWaferCopyMask, kHGCalWaferCopyOffset, kHGCalWaferUMask, kHGCalWaferUOffset, kHGCalWaferUSignMask, kHGCalWaferUSignOffset, kHGCalWaferVMask, kHGCalWaferVOffset, kHGCalWaferVSignMask, and kHGCalWaferVSignOffset.

Referenced by HGCalDDDConstants::cellThickness(), HGCalDDDConstants::getTypeHex(), HGCalDDDConstants::HGCalDDDConstants(), HGCalDDDConstants::isValidHex8(), HGCalGeomParameters::loadWaferHexagon(), HGCalGeomParameters::loadWaferHexagon8(), HGCalDDDConstants::locateCell(), HGCalDDDConstants::maskCell(), HGCalDDDConstants::maxCells(), HGCalDDDConstants::numberCellsHexagon(), HGCalDDDConstants::waferFromPosition(), HGCalDDDConstants::waferPosition(), HGCalDDDConstants::waferVirtual(), and ~HGCalWaferIndex().

18  {
19  int32_t id(0);
20  if (old) {
21  id |=
24  } else {
25  int waferUabs(std::abs(waferU)), waferVabs(std::abs(waferV));
26  int waferUsign = (waferU >= 0) ? 0 : 1;
27  int waferVsign = (waferV >= 0) ? 0 : 1;
28  id |= (((waferUabs & kHGCalWaferUMask) << kHGCalWaferUOffset) |
29  ((waferUsign & kHGCalWaferUSignMask) << kHGCalWaferUSignOffset) |
30  ((waferVabs & kHGCalWaferVMask) << kHGCalWaferVOffset) |
31  ((waferVsign & kHGCalWaferVSignMask) << kHGCalWaferVSignOffset) |
32  ((layer & kHGCalLayerMask) << kHGCalLayerOffset));
33  }
34  return id;
35 }
const int kHGCalWaferVMask
const int kHGCalWaferUSignMask
const int kHGCalWaferVSignOffset
static int32_t waferV(const int32_t index)
const int kHGCalWaferUMask
const int kHGCalLayerMask
const int kHGCalLayerOldMask
const int kHGCalWaferCopyOffset
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static int32_t waferU(const int32_t index)
const int kHGCalWaferVSignMask
const int kHGCalWaferCopyMask
const int kHGCalLayerOffset
const int kHGCalWaferUOffset
const int kHGCalWaferUSignOffset
const int kHGCalWaferVOffset
int HGCalWaferIndex::waferLayer ( const int32_t  index)
static

Definition at line 37 of file HGCalWaferIndex.cc.

References kHGCalLayerMask, and kHGCalLayerOffset.

Referenced by HGCalGeomParameters::loadWaferHexagon8(), and ~HGCalWaferIndex().

37  {
38  return (id >> kHGCalLayerOffset) & kHGCalLayerMask;
39 }
const int kHGCalLayerMask
const int kHGCalLayerOffset
int HGCalWaferIndex::waferU ( const int32_t  index)
static
int HGCalWaferIndex::waferV ( const int32_t  index)
static