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

#include <TgcL1RdoIdHash.h>

Collaboration diagram for TgcL1RdoIdHash:

Public Types

enum  { INVALID_ID = 0xFFFF }
 
typedef uint16_t ID
 

Public Member Functions

 TgcL1RdoIdHash ()
 
virtual ~TgcL1RdoIdHash ()
 
int operator() (const ID &id) const
 Convert ID to int. More...
 
int max () const
 return maximum number of IDs More...
 
ID identifier (int i) const
 reverse conversion More...
 
uint16_t subDetectorId (int i) const
 reverse conversion for SubDetectorID and ROD ID More...
 
uint16_t rodId (int i) const
 reverse conversion : ROD ID More...
 

Private Attributes

int m_size
 total number of IDs More...
 
std::map< ID, int > m_lookup
 lookup table More...
 
std::vector< IDm_int2id
 reverse lookup More...
 
std::vector< uint16_t > m_int2subDetectorId
 reverse lookup for SubDetectorID and ROD ID More...
 
std::vector< uint16_t > m_int2rodId
 

Detailed Description

Definition at line 17 of file TgcL1RdoIdHash.h.

Member Typedef Documentation

◆ ID

typedef uint16_t TgcL1RdoIdHash::ID

Definition at line 21 of file TgcL1RdoIdHash.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
INVALID_ID 

Definition at line 40 of file TgcL1RdoIdHash.h.

40 {INVALID_ID = 0xFFFF};

Constructor & Destructor Documentation

◆ TgcL1RdoIdHash()

TgcL1RdoIdHash::TgcL1RdoIdHash ( )

Definition at line 9 of file TgcL1RdoIdHash.cxx.

9  {
10  m_size=0;
11 
12  // loop over all RODs
13  for (uint16_t id=0; id<24; ++id) {
14  // map
16  m_int2id.push_back(id);
17  ++m_size;
18 
19  // SubDetectorID
20  if (id < 12) // A-side
21  m_int2subDetectorId.push_back(0x67);
22  else
23  m_int2subDetectorId.push_back(0x68);
24 
25  // ROD ID
26  m_int2rodId.push_back( (id % 12) + 1);
27  }
28 }

◆ ~TgcL1RdoIdHash()

virtual TgcL1RdoIdHash::~TgcL1RdoIdHash ( )
inlinevirtual

Definition at line 24 of file TgcL1RdoIdHash.h.

24 {}

Member Function Documentation

◆ identifier()

TgcL1RdoIdHash::ID TgcL1RdoIdHash::identifier ( int  i) const

reverse conversion

Definition at line 31 of file TgcL1RdoIdHash.cxx.

32 {
33  if (index>=0 && index < m_size)
34  return m_int2id[index];
35 
36  // if invalid index
37  return INVALID_ID;
38 }

◆ max()

int TgcL1RdoIdHash::max ( ) const
inline

return maximum number of IDs

Definition at line 30 of file TgcL1RdoIdHash.h.

30 {return m_size;}

◆ operator()()

int TgcL1RdoIdHash::operator() ( const ID id) const

Convert ID to int.

return INVALID_ID if invalid ID

return -1 if invalid ID

Definition at line 64 of file TgcL1RdoIdHash.cxx.

65 {
66  std::map<ID,int>::const_iterator it = m_lookup.find(id);
67  if(it!=m_lookup.end())
68  return (*it).second;
69 
70  // if invalid ID
71  return INVALID_ID;
72 }

◆ rodId()

uint16_t TgcL1RdoIdHash::rodId ( int  i) const

reverse conversion : ROD ID

Definition at line 53 of file TgcL1RdoIdHash.cxx.

54 {
55  if (index>=0 && index < m_size)
56  return m_int2rodId[index];
57 
58  // if invalid index
59  return INVALID_ID;
60 }

◆ subDetectorId()

uint16_t TgcL1RdoIdHash::subDetectorId ( int  i) const

reverse conversion for SubDetectorID and ROD ID

reverse conversion : SubDetectorID

Definition at line 42 of file TgcL1RdoIdHash.cxx.

43 {
44  if (index>=0 && index < m_size)
45  return m_int2subDetectorId[index];
46 
47  // if invalid index
48  return INVALID_ID;
49 }

Member Data Documentation

◆ m_int2id

std::vector<ID> TgcL1RdoIdHash::m_int2id
private

reverse lookup

Definition at line 52 of file TgcL1RdoIdHash.h.

◆ m_int2rodId

std::vector<uint16_t> TgcL1RdoIdHash::m_int2rodId
private

Definition at line 57 of file TgcL1RdoIdHash.h.

◆ m_int2subDetectorId

std::vector<uint16_t> TgcL1RdoIdHash::m_int2subDetectorId
private

reverse lookup for SubDetectorID and ROD ID

Definition at line 56 of file TgcL1RdoIdHash.h.

◆ m_lookup

std::map<ID,int> TgcL1RdoIdHash::m_lookup
private

lookup table

Definition at line 48 of file TgcL1RdoIdHash.h.

◆ m_size

int TgcL1RdoIdHash::m_size
private

total number of IDs

Definition at line 44 of file TgcL1RdoIdHash.h.


The documentation for this class was generated from the following files:
TgcL1RdoIdHash::m_lookup
std::map< ID, int > m_lookup
lookup table
Definition: TgcL1RdoIdHash.h:48
TgcL1RdoIdHash::m_size
int m_size
total number of IDs
Definition: TgcL1RdoIdHash.h:44
index
Definition: index.py:1
skel.it
it
Definition: skel.GENtoEVGEN.py:396
TgcL1RdoIdHash::m_int2rodId
std::vector< uint16_t > m_int2rodId
Definition: TgcL1RdoIdHash.h:57
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
TgcL1RdoIdHash::INVALID_ID
@ INVALID_ID
Definition: TgcL1RdoIdHash.h:40
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:227
DeMoScan.index
string index
Definition: DeMoScan.py:364
TgcL1RdoIdHash::m_int2subDetectorId
std::vector< uint16_t > m_int2subDetectorId
reverse lookup for SubDetectorID and ROD ID
Definition: TgcL1RdoIdHash.h:56
TgcL1RdoIdHash::m_int2id
std::vector< ID > m_int2id
reverse lookup
Definition: TgcL1RdoIdHash.h:52