ATLAS Offline Software
Loading...
Searching...
No Matches
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
22class HWIdentifier;
23
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
class that provides LArReadoutModuleID to integer hash ID mapping.
std::vector< ID > m_int2id
reverse look up
unsigned int ID
definition of ID type
ID identifier(int i) const
reverse conversion
std::map< unsigned int, int > m_lookup
test beam flag
int m_size
total number of IDs
int max() const
return maximum number of IDs
int operator()(const ID &id) const
Convert ID to int.
int offset() const
return offset
void initialize()