ATLAS Offline Software
Loading...
Searching...
No Matches
TileFragHash.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6#ifndef TileFragHash_H
7#define TileFragHash_H
8
9class TileHWID;
10
11#include <vector>
12#include <string>
13
25
26 public:
27
28 typedef int ID;
29 TileFragHash ();
30 virtual ~TileFragHash() { };
31
33 enum TYPE {Beam=255, Default=0, Digitizer=0,
37
38 void initialize(const TileHWID * tileHWID, TYPE type=Default );
39
41 int operator() (const ID& id) const { return hash(id); }
42
44 int hash (const ID& id) const;
45
47 ID identifier(int i) const;
48
50 int max() const {return m_size;}
51
53 int offset() const {return m_offset;}
54
56 TYPE type() const {return m_type;}
57
58
60 static std::string typeToString (TYPE type);
61
62
63private:
65 int m_size; // total number of IDs
66 int m_offset; // different offset for different types of collections
68
70 static const int m_table_size = 0x500;
72
73 std::vector<ID> m_int2id;
74
75};
76
77#endif
std::vector< Identifier > ID
#define TYPE(CODE, TYP, IOTYP)
TYPE
initialize
int max() const
return maximum number of IDs
int operator()(const ID &id) const
Convert ID to int.
int hash(const ID &id) const
Convert ID to int (same as the converter, but easier to call from python)
int offset() const
return offset
static std::string typeToString(TYPE type)
Printable representation of a type.
int m_size
total number of IDs
int m_lookup[m_table_size]
ID identifier(int i) const
reverse conversion
std::vector< ID > m_int2id
TYPE type() const
return hash type
virtual ~TileFragHash()
static const int m_table_size
lookup table
Helper class for TileCal online (hardware) identifiers.
Definition TileHWID.h:49
void initialize()