class that provides LArReadoutModuleID to integer hash ID mapping.
More...
#include <LArRodIdHash.h>
|
| using | ID = unsigned int |
| | definition of ID type
|
class that provides LArReadoutModuleID to integer hash ID mapping.
Definition at line 25 of file LArRodIdHash.h.
◆ ID
◆ identifier()
| ID LArRodIdHash::identifier |
( |
size_t | i | ) |
const |
|
inline |
reverse conversion
Definition at line 43 of file LArRodIdHash.h.
std::vector< ID > m_int2id
reverse lookup
◆ initialize()
| void LArRodIdHash::initialize |
( |
int | offset, |
|
|
const std::vector< HWIdentifier > & | roms ) |
Initialize.
Here real map is built
Definition at line 15 of file LArRodIdHash.cxx.
15 {
16
18
19 LArReadoutModuleService larROMService;
20 std::vector<ID> rmod;
21 rmod.reserve(roms.size());
22
23 for(const HWIdentifier& mId : roms) {
24 SourceIdentifier sid{
static_cast<eformat::SubDetector
>(larROMService.
subDet(mId)),
27 rmod.push_back(rod_id);
28 }
29
35 }
36}
static int subDet(const HWIdentifier &id)
return sub-detector identifier
static int rodFragId(const HWIdentifier &id)
return ROD fragment identifier ( == ROL == ROB identifier )
unsigned int ID
definition of ID type
std::unordered_map< ID, size_t > m_lookup
lookup map
int offset() const
return offset
◆ max()
| size_t LArRodIdHash::max |
( |
| ) |
const |
|
inline |
◆ offset()
| int LArRodIdHash::offset |
( |
| ) |
const |
|
inline |
◆ operator()()
| size_t LArRodIdHash::operator() |
( |
ID | id | ) |
const |
convert ID to index throws std::out_of_range if not found
Definition at line 39 of file LArRodIdHash.cxx.
39 {
40
43
44 throw std::out_of_range("LArRodIdHash: invalid Rod number" + std::to_string(id));
45
46}
◆ m_int2id
| std::vector<ID> LArRodIdHash::m_int2id |
|
private |
◆ m_lookup
| std::unordered_map<ID, size_t> LArRodIdHash::m_lookup |
|
private |
◆ m_offset
| int LArRodIdHash::m_offset {0} |
|
private |
The documentation for this class was generated from the following files: