ATLAS Offline Software
TgcL1RdoIdHash.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "MuonRDO/TgcL1RdoIdHash.h"
6 #include "MuonRDO/TgcL1Rdo.h"
7 
8 // default contructor
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 }
29 
32 {
33  if (index>=0 && index < m_size)
34  return m_int2id[index];
35 
36  // if invalid index
37  return INVALID_ID;
38 }
39 
40 
43 {
44  if (index>=0 && index < m_size)
45  return m_int2subDetectorId[index];
46 
47  // if invalid index
48  return INVALID_ID;
49 }
50 
51 
54 {
55  if (index>=0 && index < m_size)
56  return m_int2rodId[index];
57 
58  // if invalid index
59  return INVALID_ID;
60 }
61 
62 
64 int TgcL1RdoIdHash::operator() (const ID& id) const
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 }
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
TgcL1RdoIdHash::identifier
ID identifier(int i) const
reverse conversion
Definition: TgcL1RdoIdHash.cxx:31
TgcL1RdoIdHash::INVALID_ID
@ INVALID_ID
Definition: TgcL1RdoIdHash.h:40
index
Definition: index.py:1
skel.it
it
Definition: skel.GENtoEVGEN.py:423
TgcL1RdoIdHash::m_int2rodId
std::vector< uint16_t > m_int2rodId
Definition: TgcL1RdoIdHash.h:57
TgcL1RdoIdHash::ID
uint16_t ID
Definition: TgcL1RdoIdHash.h:21
TgcL1RdoIdHash::operator()
int operator()(const ID &id) const
Convert ID to int.
Definition: TgcL1RdoIdHash.cxx:64
TgcL1Rdo.h
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
TgcL1RdoIdHash::TgcL1RdoIdHash
TgcL1RdoIdHash()
Definition: TgcL1RdoIdHash.cxx:9
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:191
TgcL1RdoIdHash::rodId
uint16_t rodId(int i) const
reverse conversion : ROD ID
Definition: TgcL1RdoIdHash.cxx:53
DeMoScan.index
string index
Definition: DeMoScan.py:362
TgcL1RdoIdHash::m_int2subDetectorId
std::vector< uint16_t > m_int2subDetectorId
reverse lookup for SubDetectorID and ROD ID
Definition: TgcL1RdoIdHash.h:56
TgcL1RdoIdHash::subDetectorId
uint16_t subDetectorId(int i) const
reverse conversion for SubDetectorID and ROD ID
Definition: TgcL1RdoIdHash.cxx:42
TgcL1RdoIdHash::m_int2id
std::vector< ID > m_int2id
reverse lookup
Definition: TgcL1RdoIdHash.h:52
TgcL1RdoIdHash.h