ATLAS Offline Software
Loading...
Searching...
No Matches
TileTTL1Hash Class Reference

Hash table for TileTTL1 identifiers. More...

#include <TileTTL1Hash.h>

Collaboration diagram for TileTTL1Hash:

Public Types

typedef int ID

Public Member Functions

 TileTTL1Hash ()
virtual ~TileTTL1Hash ()
void initialize (const CaloLVL1_ID *caloLVL1_ID)
int operator() (const ID &id) const
 Convert ID to int.
ID identifier (int i) const
 reverse conversion
int max () const
 return maximum number of IDs

Private Attributes

int m_size
 total number of IDs
int m_lookup [m_table_size]
std::vector< IDm_int2id

Static Private Attributes

static const int m_table_size = 7000
 lookup table

Detailed Description

Hash table for TileTTL1 identifiers.

Author
Jose Maneira

Hash table Identifier builds a table of tower identifiers 1920 in total for ATLAS

Definition at line 38 of file TileTTL1Hash.h.

Member Typedef Documentation

◆ ID

typedef int TileTTL1Hash::ID

Definition at line 42 of file TileTTL1Hash.h.

Constructor & Destructor Documentation

◆ TileTTL1Hash()

TileTTL1Hash::TileTTL1Hash ( )

Definition at line 31 of file TileTTL1Hash.cxx.

32 : m_size(0),
33 m_lookup()
34{
35}
int m_lookup[m_table_size]
int m_size
total number of IDs

◆ ~TileTTL1Hash()

virtual TileTTL1Hash::~TileTTL1Hash ( )
inlinevirtual

Definition at line 44 of file TileTTL1Hash.h.

44{ };

Member Function Documentation

◆ identifier()

TileTTL1Hash::ID TileTTL1Hash::identifier ( int i) const

reverse conversion

Definition at line 64 of file TileTTL1Hash.cxx.

65{
66 assert(index>=0 && index < m_size);
67
68 return m_int2id[index];
69}
std::vector< ID > m_int2id
str index
Definition DeMoScan.py:362

◆ initialize()

void TileTTL1Hash::initialize ( const CaloLVL1_ID * caloLVL1_ID)

iterator over all drawer Identifiers

Definition at line 37 of file TileTTL1Hash.cxx.

38{
39 std::cout << "Initialization started" << std::endl;
40
41 m_size = 0;
42 for(int i = 0; i< m_table_size; ++i) { m_lookup[i]=-1; }
43
45 std::vector<Identifier>::const_iterator first = caloLVL1_ID->tower_begin();
46 std::vector<Identifier>::const_iterator last = caloLVL1_ID->tower_end();
47
48 int maxid = 0;
49 for ( ; first!=last; ++first) {
50 if(caloLVL1_ID->is_tile(*first)){
51 ID id = caloLVL1_ID->tower_hash(*first);
52 if (id > maxid) maxid = id;
53 assert(id>=0 && id < m_table_size);
54 m_int2id.push_back(id);
55 m_lookup[id] = (m_size++);
56 }
57 }
58 std::cout << " Number of valid tower IDs "<< m_size << std::endl;
59 std::cout << " Highest tower ID "<< maxid << std::endl;
60
61
62}
IdentifierHash tower_hash(Identifier towerId) const
create hash id from tower id
id_iterator tower_begin() const
begin iterator over towers
bool is_tile(const Identifier id) const
Test wether given tower or layer is part of the Tile Calorimeter.
id_iterator tower_end() const
end iterator over towers
static const int m_table_size
lookup table
bool first
Definition DeMoScan.py:534

◆ max()

int TileTTL1Hash::max ( ) const
inline

return maximum number of IDs

Definition at line 55 of file TileTTL1Hash.h.

55{return m_size;}

◆ operator()()

int TileTTL1Hash::operator() ( const ID & id) const

Convert ID to int.

Definition at line 71 of file TileTTL1Hash.cxx.

72{
73 assert(id>=0 && id < m_table_size);
74
75 return m_lookup[id];
76}

Member Data Documentation

◆ m_int2id

std::vector<ID> TileTTL1Hash::m_int2id
private

Definition at line 66 of file TileTTL1Hash.h.

◆ m_lookup

int TileTTL1Hash::m_lookup[m_table_size]
private

Definition at line 64 of file TileTTL1Hash.h.

◆ m_size

int TileTTL1Hash::m_size
private

total number of IDs

Definition at line 60 of file TileTTL1Hash.h.

◆ m_table_size

const int TileTTL1Hash::m_table_size = 7000
staticprivate

lookup table

Definition at line 63 of file TileTTL1Hash.h.


The documentation for this class was generated from the following files: