CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
l1t::HGCalTowerID Class Reference

#include <HGCalTowerID.h>

Public Member Functions

 HGCalTowerID ()
 
 HGCalTowerID (short zside, unsigned short coord1, unsigned short coord2)
 
 HGCalTowerID (unsigned short rawId)
 
unsigned short iEta () const
 
unsigned short iPhi () const
 
unsigned short rawId () const
 
short zside () const
 

Private Attributes

unsigned short rawId_
 

Static Private Attributes

static const int coord1Shift = 7
 
static const int coord2Shift = 0
 
static const int coordMask = 0x007F
 
static const int zsideMask = 0x1
 
static const int zsideShift = 15
 

Detailed Description

Definition at line 8 of file HGCalTowerID.h.

Constructor & Destructor Documentation

◆ HGCalTowerID() [1/3]

l1t::HGCalTowerID::HGCalTowerID ( )
inline

Definition at line 10 of file HGCalTowerID.h.

10 : HGCalTowerID(0) {}

◆ HGCalTowerID() [2/3]

l1t::HGCalTowerID::HGCalTowerID ( unsigned short  rawId)
inline

Definition at line 12 of file HGCalTowerID.h.

12 : rawId_(rawId) {}

◆ HGCalTowerID() [3/3]

l1t::HGCalTowerID::HGCalTowerID ( short  zside,
unsigned short  coord1,
unsigned short  coord2 
)
inline

Definition at line 14 of file HGCalTowerID.h.

14  {
15  rawId_ = ((coord1 & coordMask) << coord1Shift) | ((coord2 & coordMask) << coord2Shift) |
16  (((zside > 0) & zsideMask) << zsideShift);
17  }

References coord1Shift, coord2Shift, coordMask, rawId_, zside(), zsideMask, and zsideShift.

Member Function Documentation

◆ iEta()

unsigned short l1t::HGCalTowerID::iEta ( ) const
inline

Definition at line 21 of file HGCalTowerID.h.

21 { return (rawId_ >> coord1Shift) & coordMask; }

References coord1Shift, coordMask, and rawId_.

◆ iPhi()

unsigned short l1t::HGCalTowerID::iPhi ( ) const
inline

Definition at line 23 of file HGCalTowerID.h.

23 { return (rawId_ >> coord2Shift) & coordMask; }

References coord2Shift, coordMask, and rawId_.

◆ rawId()

unsigned short l1t::HGCalTowerID::rawId ( ) const
inline

Definition at line 25 of file HGCalTowerID.h.

25 { return rawId_; }

References rawId_.

Referenced by HGCalTriggerTowerGeometryHelper::getTriggerTowerFromTriggerCell(), and l1t::HGCalTower::operator+=().

◆ zside()

short l1t::HGCalTowerID::zside ( ) const
inline

Definition at line 19 of file HGCalTowerID.h.

19 { return ((rawId_ >> zsideShift) & zsideMask) ? 1 : -1; }

References rawId_, zsideMask, and zsideShift.

Referenced by HGCalTowerID(), and l1t::HGCalTower::zside().

Member Data Documentation

◆ coord1Shift

const int l1t::HGCalTowerID::coord1Shift = 7
staticprivate

Definition at line 32 of file HGCalTowerID.h.

Referenced by HGCalTowerID(), and iEta().

◆ coord2Shift

const int l1t::HGCalTowerID::coord2Shift = 0
staticprivate

Definition at line 33 of file HGCalTowerID.h.

Referenced by HGCalTowerID(), and iPhi().

◆ coordMask

const int l1t::HGCalTowerID::coordMask = 0x007F
staticprivate

Definition at line 31 of file HGCalTowerID.h.

Referenced by HGCalTowerID(), iEta(), and iPhi().

◆ rawId_

unsigned short l1t::HGCalTowerID::rawId_
private

Definition at line 28 of file HGCalTowerID.h.

Referenced by HGCalTowerID(), iEta(), iPhi(), rawId(), and zside().

◆ zsideMask

const int l1t::HGCalTowerID::zsideMask = 0x1
staticprivate

Definition at line 29 of file HGCalTowerID.h.

Referenced by HGCalTowerID(), and zside().

◆ zsideShift

const int l1t::HGCalTowerID::zsideShift = 15
staticprivate

Definition at line 30 of file HGCalTowerID.h.

Referenced by HGCalTowerID(), and zside().

l1t::HGCalTowerID::coord2Shift
static const int coord2Shift
Definition: HGCalTowerID.h:33
l1t::HGCalTowerID::zsideShift
static const int zsideShift
Definition: HGCalTowerID.h:30
l1t::HGCalTowerID::rawId_
unsigned short rawId_
Definition: HGCalTowerID.h:28
l1t::HGCalTowerID::zsideMask
static const int zsideMask
Definition: HGCalTowerID.h:29
l1t::HGCalTowerID::zside
short zside() const
Definition: HGCalTowerID.h:19
l1t::HGCalTowerID::coord1Shift
static const int coord1Shift
Definition: HGCalTowerID.h:32
l1t::HGCalTowerID::HGCalTowerID
HGCalTowerID()
Definition: HGCalTowerID.h:10
l1t::HGCalTowerID::coordMask
static const int coordMask
Definition: HGCalTowerID.h:31
l1t::HGCalTowerID::rawId
unsigned short rawId() const
Definition: HGCalTowerID.h:25