ATLAS Offline Software
LArRodIdHash.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 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 
19 #include <vector>
20 #include <map>
21 
22 class HWIdentifier;
23 
26 class LArRodIdHash {
27 
28  public:
29 
31  typedef unsigned int ID;
32 
34  void initialize(int offset, const std::vector<HWIdentifier>& roms );
35 
37  int operator() (const ID& id) const ;
38 
40  int max() const;
41 
43  ID identifier(int i) const;
44 
46  int offset() const ;
47 
48  private:
50  int m_size{0}; // total number of IDs
51 
53  std::map<unsigned int, int> m_lookup ;
54 
56  std::vector<ID> m_int2id;
57 
58  int m_offset{0};
59 
60 };
61 
62 #endif
63 
LArRodIdHash::initialize
void initialize(int offset, const std::vector< HWIdentifier > &roms)
Initialize.
Definition: LArRodIdHash.cxx:20
LArRodIdHash::identifier
ID identifier(int i) const
reverse conversion
Definition: LArRodIdHash.cxx:65
LArRodIdHash::offset
int offset() const
return offset
Definition: LArRodIdHash.cxx:88
HWIdentifier
Definition: HWIdentifier.h:13
LArRodIdHash::ID
unsigned int ID
definition of ID type
Definition: LArRodIdHash.h:31
LArRodIdHash::m_size
int m_size
total number of IDs
Definition: LArRodIdHash.h:50
LArRodIdHash::m_lookup
std::map< unsigned int, int > m_lookup
test beam flag
Definition: LArRodIdHash.h:53
lumiFormat.i
int i
Definition: lumiFormat.py:92
LArRodIdHash::operator()
int operator()(const ID &id) const
Convert ID to int.
Definition: LArRodIdHash.cxx:71
LArRodIdHash::max
int max() const
return maximum number of IDs
Definition: LArRodIdHash.cxx:82
LArRodIdHash
class that provides LArReadoutModuleID to integer hash ID mapping.
Definition: LArRodIdHash.h:26
LArRodIdHash::m_int2id
std::vector< ID > m_int2id
reverse look up
Definition: LArRodIdHash.h:56
LArRodIdHash::m_offset
int m_offset
Definition: LArRodIdHash.h:58