ATLAS Offline Software
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
Muon::TgcSlbData Class Reference

#include <TgcSlbData.h>

Collaboration diagram for Muon::TgcSlbData:

Public Types

enum  {
  BC_UNDEFINED =0, BC_PREVIOUS, BC_CENTRAL, BC_NEXT,
  N_BC, BITMAP_SIZE = 200
}
 
enum  SlbType {
  SLB_HIT =0, SLB_LPT_D_W, SLB_LPT_D_S, SLB_LPT_T_W,
  SLB_LPT_T_S, SLB_LPT_I_W, SLB_LPT_I_S, SLB_SL_F,
  SLB_SL_E, SLB_NONE
}
 

Public Member Functions

 TgcSlbData (uint16_t bcId, uint32_t l1Id, uint16_t sswId, uint16_t slbId)
 Costructor. More...
 
virtual ~TgcSlbData (void)
 Destructor. More...
 
bool equal (uint16_t bcId, uint32_t l1Id, uint16_t sswId, uint16_t slbId) const
 Check input IDs and held IDs are equal or not. More...
 
const bool * getBitArray (const uint16_t bcTag) const
 Get bitArray for a BC tag. More...
 
void setBitmap (const uint16_t bcTag, const uint32_t cellAddr, const uint32_t cellData)
 Store bitmap. More...
 
void setBit (const uint16_t bcTag, uint32_t iBit)
 Set a bit. More...
 
int getType () const
 Get SLB type. More...
 
void setType (int vType)
 Set SLB type. More...
 
bool isCoincidence (void) const
 Check if the SLB type is coincidence. More...
 
bool isLowPt (void) const
 Check if the SLB type is LowPt. More...
 
bool isHighPt (void) const
 Check if the SLB type is HighPt. More...
 
bool isSL (void) const
 Check if the SLB type is SL. More...
 
bool isInner (void) const
 Check if the SLB type is inner LowPt. More...
 
void setBcId (uint16_t bcId)
 Set bcId. More...
 
void setL1Id (uint32_t l1Id)
 Set l1Id. More...
 
void setSswId (uint16_t sswId)
 Set sswId. More...
 
void setSlbId (uint16_t slbId)
 Set slbId. More...
 
void setSbLoc (uint16_t sbLoc)
 Set sbLoc. More...
 
void setError (uint16_t error)
 Set Error. More...
 
uint16_t getBcId () const
 Get bcId. More...
 
uint32_t getL1Id () const
 Get l1Id. More...
 
uint16_t getSswId () const
 Get sswId. More...
 
uint16_t getSlbId () const
 Get slbId. More...
 
uint16_t getSbLoc () const
 Get sbLoc. More...
 
uint16_t getError () const
 Get error. More...
 

Private Types

enum  { CELL_SIZE = 8, PADDING_WORD = 0x1F }
 

Private Member Functions

 TgcSlbData (void)
 Costructor. More...
 
bool * getBitArray (const uint16_t bcTag)
 Get bitArray for a BC tag. More...
 

Private Attributes

uint16_t m_bcId
 
uint32_t m_l1Id
 
uint16_t m_sswId
 
uint16_t m_slbId
 
uint16_t m_sbLoc
 
uint16_t m_error
 
bool m_bitArray_C [BITMAP_SIZE]
 Bit array at central bunch. More...
 
bool m_bitArray_P [BITMAP_SIZE]
 Bit array at previous bunch. More...
 
bool m_bitArray_N [BITMAP_SIZE]
 Bit array at next bunch. More...
 
int m_type
 SLB type. More...
 

Detailed Description

This is the SLB data class which represents an SLB block.

Author
Hisaya Kurashige
Susumu Oda

This class was developed by Tadashi Maeno.

Definition at line 21 of file TgcSlbData.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
BC_UNDEFINED 
BC_PREVIOUS 
BC_CENTRAL 
BC_NEXT 
N_BC 
BITMAP_SIZE 

Definition at line 24 of file TgcSlbData.h.

25  {
26  BC_UNDEFINED=0,
28  BC_CENTRAL,
29  BC_NEXT,
30  N_BC,
31  BITMAP_SIZE = 200
32  };

◆ anonymous enum

anonymous enum
private
Enumerator
CELL_SIZE 
PADDING_WORD 

Definition at line 119 of file TgcSlbData.h.

119  {
120  CELL_SIZE = 8,
121  PADDING_WORD = 0x1F
122  };

◆ SlbType

Enumerator
SLB_HIT 
SLB_LPT_D_W 
SLB_LPT_D_S 
SLB_LPT_T_W 
SLB_LPT_T_S 
SLB_LPT_I_W 
SLB_LPT_I_S 
SLB_SL_F 
SLB_SL_E 
SLB_NONE 

Definition at line 34 of file TgcSlbData.h.

34  {
35  SLB_HIT =0,
42  SLB_SL_F,
43  SLB_SL_E,
44  SLB_NONE
45  };

Constructor & Destructor Documentation

◆ TgcSlbData() [1/2]

Muon::TgcSlbData::TgcSlbData ( uint16_t  bcId,
uint32_t  l1Id,
uint16_t  sswId,
uint16_t  slbId 
)

Costructor.

Definition at line 23 of file TgcSlbData.cxx.

25  : m_bcId(bcId), m_l1Id(l1Id),
26  m_sswId(sswId), m_slbId(slbId),
27  m_sbLoc(999),
28  m_error(0),
30 {
31  // init bit array
32  for(int i=0; i<BITMAP_SIZE; ++i) {
33  m_bitArray_C[i]=false;
34  m_bitArray_P[i]=false;
35  m_bitArray_N[i]=false;
36  }
37 }

◆ ~TgcSlbData()

Muon::TgcSlbData::~TgcSlbData ( void  )
virtualdefault

Destructor.

◆ TgcSlbData() [2/2]

Muon::TgcSlbData::TgcSlbData ( void  )
private

Costructor.

Definition at line 7 of file TgcSlbData.cxx.

8  : m_bcId(0), m_l1Id(0),
9  m_sswId(999), m_slbId(999),
10  m_sbLoc(999),
11  m_error(0),
13 {
14  // init bit array
15  for(int i=0; i<BITMAP_SIZE; ++i) {
16  m_bitArray_C[i]=false;
17  m_bitArray_P[i]=false;
18  m_bitArray_N[i]=false;
19  }
20 }

Member Function Documentation

◆ equal()

bool Muon::TgcSlbData::equal ( uint16_t  bcId,
uint32_t  l1Id,
uint16_t  sswId,
uint16_t  slbId 
) const

Check input IDs and held IDs are equal or not.

Definition at line 42 of file TgcSlbData.cxx.

46 {
47  return ((m_l1Id == l1Id) && (m_sswId == sswId) && (m_slbId == slbId));
48 }

◆ getBcId()

uint16_t Muon::TgcSlbData::getBcId ( ) const

Get bcId.

Definition at line 194 of file TgcSlbData.cxx.

194  {
195  return m_bcId;
196 }

◆ getBitArray() [1/2]

bool * Muon::TgcSlbData::getBitArray ( const uint16_t  bcTag)
private

Get bitArray for a BC tag.

Definition at line 75 of file TgcSlbData.cxx.

76 {
77  bool* bitArray = nullptr;
78  switch (bcTag)
79  {
80  case BC_CENTRAL:
81  bitArray = m_bitArray_C;
82  break;
83  case BC_PREVIOUS:
84  bitArray = m_bitArray_P;
85  break;
86  case BC_NEXT:
87  bitArray = m_bitArray_N;
88  break;
89  case BC_UNDEFINED:
90  bitArray = m_bitArray_C; // for backward compatibility
91  break;
92  default:
93  bitArray = nullptr;
94  break;
95  }
96  return bitArray;
97 }

◆ getBitArray() [2/2]

const bool * Muon::TgcSlbData::getBitArray ( const uint16_t  bcTag) const

Get bitArray for a BC tag.

Definition at line 50 of file TgcSlbData.cxx.

51 {
52  const bool* bitArray = nullptr;
53  switch (bcTag)
54  {
55  case BC_CENTRAL:
56  bitArray = m_bitArray_C;
57  break;
58  case BC_PREVIOUS:
59  bitArray = m_bitArray_P;
60  break;
61  case BC_NEXT:
62  bitArray = m_bitArray_N;
63  break;
64  case BC_UNDEFINED:
65  bitArray = m_bitArray_C; // for backward compatibility
66  break;
67  default:
68  bitArray = nullptr;
69  break;
70  }
71  return bitArray;
72 }

◆ getError()

uint16_t Muon::TgcSlbData::getError ( ) const

Get error.

Definition at line 214 of file TgcSlbData.cxx.

214  {
215  return m_error;
216 }

◆ getL1Id()

uint32_t Muon::TgcSlbData::getL1Id ( ) const

Get l1Id.

Definition at line 198 of file TgcSlbData.cxx.

198  {
199  return m_l1Id;
200 }

◆ getSbLoc()

uint16_t Muon::TgcSlbData::getSbLoc ( ) const

Get sbLoc.

Definition at line 210 of file TgcSlbData.cxx.

210  {
211  return m_sbLoc;
212 }

◆ getSlbId()

uint16_t Muon::TgcSlbData::getSlbId ( ) const

Get slbId.

Definition at line 206 of file TgcSlbData.cxx.

206  {
207  return m_slbId;
208 }

◆ getSswId()

uint16_t Muon::TgcSlbData::getSswId ( ) const

Get sswId.

Definition at line 202 of file TgcSlbData.cxx.

202  {
203  return m_sswId;
204 }

◆ getType()

int Muon::TgcSlbData::getType ( ) const

Get SLB type.

Definition at line 135 of file TgcSlbData.cxx.

136 {
137  return m_type;
138 }

◆ isCoincidence()

bool Muon::TgcSlbData::isCoincidence ( void  ) const

Check if the SLB type is coincidence.

Definition at line 145 of file TgcSlbData.cxx.

146 {
147  return (m_type != SLB_HIT);
148 }

◆ isHighPt()

bool Muon::TgcSlbData::isHighPt ( void  ) const

Check if the SLB type is HighPt.

No SLB for HighPt and SLB for SL is used.

Definition at line 155 of file TgcSlbData.cxx.

156 {
157  return ((m_type == SLB_SL_E)||(m_type==SLB_SL_F));
158 }

◆ isInner()

bool Muon::TgcSlbData::isInner ( void  ) const

Check if the SLB type is inner LowPt.

Definition at line 165 of file TgcSlbData.cxx.

166 {
167  return ((m_type == SLB_LPT_I_W)||(m_type==SLB_LPT_I_S));
168 }

◆ isLowPt()

bool Muon::TgcSlbData::isLowPt ( void  ) const

Check if the SLB type is LowPt.

Definition at line 150 of file TgcSlbData.cxx.

151 {
152  return ((m_type >= SLB_LPT_D_W)&&(m_type<=SLB_LPT_I_S));
153 }

◆ isSL()

bool Muon::TgcSlbData::isSL ( void  ) const

Check if the SLB type is SL.

Definition at line 160 of file TgcSlbData.cxx.

161 {
162  return ((m_type == SLB_SL_E)||(m_type==SLB_SL_F));
163 }

◆ setBcId()

void Muon::TgcSlbData::setBcId ( uint16_t  bcId)

Set bcId.

Definition at line 170 of file TgcSlbData.cxx.

170  {
171  m_bcId = bcId;
172 }

◆ setBit()

void Muon::TgcSlbData::setBit ( const uint16_t  bcTag,
uint32_t  iBit 
)

Set a bit.

Definition at line 124 of file TgcSlbData.cxx.

127 {
128  if(iBit >= BITMAP_SIZE) return;
129 
130  // get bit array
131  bool *bitArray = getBitArray(bcTag);
132  *(bitArray+iBit)=true;
133 }

◆ setBitmap()

void Muon::TgcSlbData::setBitmap ( const uint16_t  bcTag,
const uint32_t  cellAddr,
const uint32_t  cellData 
)

Store bitmap.

Definition at line 100 of file TgcSlbData.cxx.

102 {
103  // Padding Word for 32-bit alignment
104  if(cellAddr == PADDING_WORD) return;
105 
106  // get bit array
107  bool *bitArray = getBitArray(bcTag);
108 
109  // assign
110  int indexMap = BITMAP_SIZE - CELL_SIZE*(cellAddr+1);
111  if(indexMap<0) return;
112 
113  for(int iBit=0; iBit<CELL_SIZE; ++iBit) {
114  // index check
115  if(indexMap+iBit >= BITMAP_SIZE) break;
116 
117  if(cellData & (1<<iBit)) {
118  *(bitArray+indexMap+iBit)=true;
119  }
120  }
121  }

◆ setError()

void Muon::TgcSlbData::setError ( uint16_t  error)

Set Error.

Definition at line 190 of file TgcSlbData.cxx.

190  {
191  m_error = error;
192 }

◆ setL1Id()

void Muon::TgcSlbData::setL1Id ( uint32_t  l1Id)

Set l1Id.

Definition at line 174 of file TgcSlbData.cxx.

174  {
175  m_l1Id = l1Id;
176 }

◆ setSbLoc()

void Muon::TgcSlbData::setSbLoc ( uint16_t  sbLoc)

Set sbLoc.

Definition at line 186 of file TgcSlbData.cxx.

186  {
187  m_sbLoc = sbLoc;
188 }

◆ setSlbId()

void Muon::TgcSlbData::setSlbId ( uint16_t  slbId)

Set slbId.

Definition at line 182 of file TgcSlbData.cxx.

182  {
183  m_slbId = slbId;
184 }

◆ setSswId()

void Muon::TgcSlbData::setSswId ( uint16_t  sswId)

Set sswId.

Definition at line 178 of file TgcSlbData.cxx.

178  {
179  m_sswId = sswId;
180 }

◆ setType()

void Muon::TgcSlbData::setType ( int  vType)

Set SLB type.

Definition at line 140 of file TgcSlbData.cxx.

141 {
142  m_type = vType;
143 }

Member Data Documentation

◆ m_bcId

uint16_t Muon::TgcSlbData::m_bcId
private

Definition at line 131 of file TgcSlbData.h.

◆ m_bitArray_C

bool Muon::TgcSlbData::m_bitArray_C[BITMAP_SIZE]
private

Bit array at central bunch.

Definition at line 139 of file TgcSlbData.h.

◆ m_bitArray_N

bool Muon::TgcSlbData::m_bitArray_N[BITMAP_SIZE]
private

Bit array at next bunch.

Definition at line 143 of file TgcSlbData.h.

◆ m_bitArray_P

bool Muon::TgcSlbData::m_bitArray_P[BITMAP_SIZE]
private

Bit array at previous bunch.

Definition at line 141 of file TgcSlbData.h.

◆ m_error

uint16_t Muon::TgcSlbData::m_error
private

Definition at line 136 of file TgcSlbData.h.

◆ m_l1Id

uint32_t Muon::TgcSlbData::m_l1Id
private

Definition at line 132 of file TgcSlbData.h.

◆ m_sbLoc

uint16_t Muon::TgcSlbData::m_sbLoc
private

Definition at line 135 of file TgcSlbData.h.

◆ m_slbId

uint16_t Muon::TgcSlbData::m_slbId
private

Definition at line 134 of file TgcSlbData.h.

◆ m_sswId

uint16_t Muon::TgcSlbData::m_sswId
private

Definition at line 133 of file TgcSlbData.h.

◆ m_type

int Muon::TgcSlbData::m_type
private

SLB type.

Definition at line 146 of file TgcSlbData.h.


The documentation for this class was generated from the following files:
Muon::TgcSlbData::BC_PREVIOUS
@ BC_PREVIOUS
Definition: TgcSlbData.h:27
Muon::TgcSlbData::m_slbId
uint16_t m_slbId
Definition: TgcSlbData.h:134
Muon::TgcSlbData::m_error
uint16_t m_error
Definition: TgcSlbData.h:136
Muon::TgcSlbData::BITMAP_SIZE
@ BITMAP_SIZE
Definition: TgcSlbData.h:31
Muon::TgcSlbData::SLB_SL_F
@ SLB_SL_F
Definition: TgcSlbData.h:42
Muon::TgcSlbData::SLB_NONE
@ SLB_NONE
Definition: TgcSlbData.h:44
WriteCellNoiseToCool.cellData
cellData
Definition: WriteCellNoiseToCool.py:336
Muon::TgcSlbData::m_bitArray_P
bool m_bitArray_P[BITMAP_SIZE]
Bit array at previous bunch.
Definition: TgcSlbData.h:141
Muon::TgcSlbData::SLB_LPT_D_W
@ SLB_LPT_D_W
Definition: TgcSlbData.h:36
Muon::TgcSlbData::SLB_LPT_I_S
@ SLB_LPT_I_S
Definition: TgcSlbData.h:41
Muon::TgcSlbData::m_l1Id
uint32_t m_l1Id
Definition: TgcSlbData.h:132
Muon::TgcSlbData::m_type
int m_type
SLB type.
Definition: TgcSlbData.h:146
Muon::TgcSlbData::SLB_LPT_T_S
@ SLB_LPT_T_S
Definition: TgcSlbData.h:39
lumiFormat.i
int i
Definition: lumiFormat.py:92
Muon::TgcSlbData::SLB_LPT_T_W
@ SLB_LPT_T_W
Definition: TgcSlbData.h:38
Muon::TgcSlbData::SLB_SL_E
@ SLB_SL_E
Definition: TgcSlbData.h:43
Muon::TgcSlbData::m_bcId
uint16_t m_bcId
Definition: TgcSlbData.h:131
Muon::TgcSlbData::CELL_SIZE
@ CELL_SIZE
Definition: TgcSlbData.h:120
Muon::TgcSlbData::PADDING_WORD
@ PADDING_WORD
Definition: TgcSlbData.h:121
Muon::TgcSlbData::m_sswId
uint16_t m_sswId
Definition: TgcSlbData.h:133
Muon::TgcSlbData::SLB_LPT_I_W
@ SLB_LPT_I_W
Definition: TgcSlbData.h:40
Muon::TgcSlbData::m_sbLoc
uint16_t m_sbLoc
Definition: TgcSlbData.h:135
bcId
uint16_t bcId(uint32_t data)
Definition: TgcByteStreamData.h:329
Muon::TgcSlbData::BC_UNDEFINED
@ BC_UNDEFINED
Definition: TgcSlbData.h:26
Muon::TgcSlbData::N_BC
@ N_BC
Definition: TgcSlbData.h:30
Muon::TgcSlbData::BC_NEXT
@ BC_NEXT
Definition: TgcSlbData.h:29
Muon::TgcSlbData::SLB_LPT_D_S
@ SLB_LPT_D_S
Definition: TgcSlbData.h:37
Muon::TgcSlbData::BC_CENTRAL
@ BC_CENTRAL
Definition: TgcSlbData.h:28
bcTag
unsigned bcTag(unsigned bcBitMap)
Definition: TgcByteStreamData.h:367
get_generator_info.error
error
Definition: get_generator_info.py:40
Muon::TgcSlbData::m_bitArray_N
bool m_bitArray_N[BITMAP_SIZE]
Bit array at next bunch.
Definition: TgcSlbData.h:143
Muon::TgcSlbData::SLB_HIT
@ SLB_HIT
Definition: TgcSlbData.h:35
Muon::TgcSlbData::m_bitArray_C
bool m_bitArray_C[BITMAP_SIZE]
Bit array at central bunch.
Definition: TgcSlbData.h:139
Muon::TgcSlbData::getBitArray
const bool * getBitArray(const uint16_t bcTag) const
Get bitArray for a BC tag.
Definition: TgcSlbData.cxx:50