ATLAS Offline Software
Loading...
Searching...
No Matches
InDetDD::SiReadoutCellId Class Reference

Identifier for the strip or pixel readout cell. More...

#include <SiReadoutCellId.h>

Inheritance diagram for InDetDD::SiReadoutCellId:
Collaboration diagram for InDetDD::SiReadoutCellId:

Public Member Functions

 SiReadoutCellId ()
 SiReadoutCellId (int strip)
 SiReadoutCellId (int phiIndex, int etaIndex)
int etaIndex () const
 Get eta index.
int phiIndex () const
 Get phi index. Equivalent to strip().
int strip () const
 Get strip number. Equivalent to phiIndex().
bool isValid () const
 Test if its in a valid state.
bool operator== (const SiCellId &other) const
 Test equality.
bool operator!= (const SiCellId &other) const
 Test inequality.
bool operator< (const SiCellId &other) const
 Operator for sorting.
unsigned int word () const

Private Types

enum  MaskAndShiftConstants {
  PHI_MASK = 0x0000ffff , PHI_NEG = 0x00008000 , ETA_MASK = 0x00007fff , ETA_SHIFT = 16 ,
  ETA_NEG = 0x40000000 , VALID = 0x80000000
}

Private Attributes

unsigned int m_word

Detailed Description

Identifier for the strip or pixel readout cell.

SiReadoutCellId behaves identically to its base class. Its only introduced to provide some type safety and distiguish between diodes (base class) and readout cells (this class). This is since more than one diode can be connected to a readout cell.

The following conversion is legal

 SiReadoutCellId -> SiCellId   OK   

However the oppoisite is not allowed

 SiCellId -> SiReadoutCellId   NOT ALLOWED

since a SiCellId might not have direct readout out (eg for an edge strip or ganged pixel).

Author
Grant Gorfine

Definition at line 42 of file SiReadoutCellId.h.

Member Enumeration Documentation

◆ MaskAndShiftConstants

Enumerator
PHI_MASK 
PHI_NEG 
ETA_MASK 
ETA_SHIFT 
ETA_NEG 
VALID 

Definition at line 76 of file SiCellId.h.

76 {
77 PHI_MASK = 0x0000ffff,
78 PHI_NEG = 0x00008000, // (PHI_MASK >> 1 + 1)
79 ETA_MASK = 0x00007fff,
80 ETA_SHIFT = 16,
81 ETA_NEG = 0x40000000, // ((ETA_MASK >> 1 + 1) << ETA_SHIFT)
82 VALID = 0x80000000
83 };

Constructor & Destructor Documentation

◆ SiReadoutCellId() [1/3]

InDetDD::SiReadoutCellId::SiReadoutCellId ( )
inline

Definition at line 62 of file SiReadoutCellId.h.

63 : SiCellId()
64{}
SiCellId()
Constructor. Set in invalid state.
Definition SiCellId.h:92

◆ SiReadoutCellId() [2/3]

InDetDD::SiReadoutCellId::SiReadoutCellId ( int strip)
inline

Definition at line 70 of file SiReadoutCellId.h.

72{}
int strip() const
Get strip number. Equivalent to phiIndex().
Definition SiCellId.h:131

◆ SiReadoutCellId() [3/3]

InDetDD::SiReadoutCellId::SiReadoutCellId ( int phiIndex,
int etaIndex )
inline

Definition at line 66 of file SiReadoutCellId.h.

68{}
int phiIndex() const
Get phi index. Equivalent to strip().
Definition SiCellId.h:122
int etaIndex() const
Get eta index.
Definition SiCellId.h:114

Member Function Documentation

◆ etaIndex()

int InDetDD::SiCellId::etaIndex ( ) const
inlineinherited

Get eta index.

Definition at line 114 of file SiCellId.h.

115{
116 if (m_word & ETA_NEG) { // Negative index
117 return ((m_word >> ETA_SHIFT) & ETA_MASK) - ETA_MASK - 1;
118 }
119 return (m_word >> ETA_SHIFT) & ETA_MASK;
120}
unsigned int m_word
Definition SiCellId.h:70

◆ isValid()

bool InDetDD::SiCellId::isValid ( ) const
inlineinherited

Test if its in a valid state.

Definition at line 136 of file SiCellId.h.

137{
138 return !(m_word & VALID);
139}

◆ operator!=()

bool InDetDD::SiCellId::operator!= ( const SiCellId & other) const
inlineinherited

Test inequality.

Definition at line 146 of file SiCellId.h.

147{
148 return (m_word != other.m_word);
149}

◆ operator<()

bool InDetDD::SiCellId::operator< ( const SiCellId & other) const
inlineinherited

Operator for sorting.

Definition at line 151 of file SiCellId.h.

152{
153 return (m_word < other.m_word);
154}

◆ operator==()

bool InDetDD::SiCellId::operator== ( const SiCellId & other) const
inlineinherited

Test equality.

Definition at line 141 of file SiCellId.h.

142{
143 return (m_word == other.m_word);
144}

◆ phiIndex()

int InDetDD::SiCellId::phiIndex ( ) const
inlineinherited

Get phi index. Equivalent to strip().

Definition at line 122 of file SiCellId.h.

123{
124 if (m_word & PHI_NEG) { // Negative index
125 return (m_word & PHI_MASK) - PHI_MASK - 1;
126 }
127 return (m_word & PHI_MASK);
128
129}

◆ strip()

int InDetDD::SiCellId::strip ( ) const
inlineinherited

Get strip number. Equivalent to phiIndex().

Definition at line 131 of file SiCellId.h.

132{
133 return phiIndex();
134}

◆ word()

unsigned int InDetDD::SiCellId::word ( ) const
inlineinherited

Definition at line 67 of file SiCellId.h.

67{ return m_word; }

Member Data Documentation

◆ m_word

unsigned int InDetDD::SiCellId::m_word
privateinherited

Definition at line 70 of file SiCellId.h.


The documentation for this class was generated from the following file: