ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAlgorithms
TrigT2CaloCommon
TrigT2CaloCommon
LArRodIdHash.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
/********************************************************************
6
7
NAME: LArRodIdHash.h
8
PACKAGE: Trigger/TrigAlgorithms/TrigT2CaloCommon
9
10
AUTHOR: Denis Oliveira Damazio
11
12
PURPOSE: LArReadoutModuleID to integer (hash ID) mapping.
13
*******************************************************************/
14
15
#ifndef TRIGT2CALOCOMMON_LARRODIDHASH_H
16
#define TRIGT2CALOCOMMON_LARRODIDHASH_H
17
18
#include <vector>
19
#include <unordered_map>
20
21
class
HWIdentifier
;
22
25
class
LArRodIdHash
{
26
27
public
:
28
30
using
ID
=
unsigned
int;
31
33
void
initialize
(
int
offset
,
const
std::vector<HWIdentifier>& roms );
34
37
size_t
operator()
(
ID
id
)
const
;
38
40
size_t
max
()
const
{
return
m_int2id
.size(); }
41
43
ID
identifier
(
size_t
i)
const
{
return
m_int2id
[i]; }
44
46
int
offset
()
const
{
return
m_offset
; }
47
48
private
:
49
51
std::unordered_map<ID, size_t>
m_lookup
;
52
54
std::vector<ID>
m_int2id
;
55
56
int
m_offset
{0};
57
58
};
59
60
#endif
61
HWIdentifier
Definition
HWIdentifier.h:13
LArRodIdHash
class that provides LArReadoutModuleID to integer hash ID mapping.
Definition
LArRodIdHash.h:25
LArRodIdHash::m_offset
int m_offset
Definition
LArRodIdHash.h:56
LArRodIdHash::ID
unsigned int ID
definition of ID type
Definition
LArRodIdHash.h:30
LArRodIdHash::m_lookup
std::unordered_map< ID, size_t > m_lookup
lookup map
Definition
LArRodIdHash.h:51
LArRodIdHash::m_int2id
std::vector< ID > m_int2id
reverse lookup
Definition
LArRodIdHash.h:54
LArRodIdHash::identifier
ID identifier(size_t i) const
reverse conversion
Definition
LArRodIdHash.h:43
LArRodIdHash::operator()
size_t operator()(ID id) const
convert ID to index throws std::out_of_range if not found
Definition
LArRodIdHash.cxx:39
LArRodIdHash::max
size_t max() const
return maximum number of IDs
Definition
LArRodIdHash.h:40
LArRodIdHash::offset
int offset() const
return offset
Definition
LArRodIdHash.h:46
initialize
void initialize()
Definition
run_EoverP.cxx:894
Generated on
for ATLAS Offline Software by
1.17.0