ATLAS Offline Software
Loading...
Searching...
No Matches
TgcL1RdoIdHash.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef MUONRDO_TGCL1RDOIDHASH_H
6#define MUONRDO_TGCL1RDOIDHASH_H
7
8#include <map>
9#include <vector>
10#include <inttypes.h>
11
12/*
13 Hash function for TGC RDO Identifier
14 @author Tadashi Maeno
15 based on RpcPadIdHash by Ketevi A. Assamagan
16*/
18{
19public:
20
21 typedef uint16_t ID;
22
24 virtual ~TgcL1RdoIdHash() {}
25
27 int operator() (const ID& id) const ;
28
30 int max() const {return m_size;}
31
33 ID identifier(int i) const;
34
36 uint16_t subDetectorId(int i) const;
37 uint16_t rodId(int i) const;
38
39 // return value definition
40 enum {INVALID_ID = 0xFFFF};
41
42private:
44 int m_size;
45
48 std::map<ID,int> m_lookup;
49
52 std::vector<ID> m_int2id;
53
56 std::vector<uint16_t> m_int2subDetectorId;
57 std::vector<uint16_t> m_int2rodId;
58};
59
60#endif
61
std::vector< Identifier > ID
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
virtual ~TgcL1RdoIdHash()
uint16_t subDetectorId(int i) const
reverse conversion for SubDetectorID and ROD ID
std::vector< uint16_t > m_int2rodId
int max() const
return maximum number of IDs
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