ATLAS Offline Software
Loading...
Searching...
No Matches
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
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
15 m_lookup[id]=m_size;
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)
46
47 // if invalid index
48 return INVALID_ID;
49}
50
51
53uint16_t TgcL1RdoIdHash::rodId(int index) const
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
64int 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}
std::vector< uint16_t > m_int2subDetectorId
reverse lookup for SubDetectorID and ROD ID
int m_size
total number of IDs
ID identifier(int i) const
reverse conversion
uint16_t subDetectorId(int i) const
reverse conversion for SubDetectorID and ROD ID
std::vector< uint16_t > m_int2rodId
std::vector< ID > m_int2id
reverse lookup
int operator()(const ID &id) const
Convert ID to int.
std::map< ID, int > m_lookup
lookup table
uint16_t rodId(int i) const
reverse conversion : ROD ID
Definition index.py:1