ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | Static Private Attributes | List of all members
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. More...
 
ID identifier (int i) const
 reverse conversion More...
 
int max () const
 return maximum number of IDs More...
 

Private Attributes

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

Static Private Attributes

static const int m_table_size = 7000
 lookup table More...
 

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 }

◆ ~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 }

◆ 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 }

◆ 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:
ID
std::vector< Identifier > ID
Definition: CalibHitIDCheck.h:24
TileTTL1Hash::m_lookup
int m_lookup[m_table_size]
Definition: TileTTL1Hash.h:64
index
Definition: index.py:1
TileTTL1Hash::m_size
int m_size
total number of IDs
Definition: TileTTL1Hash.h:60
CaloLVL1_ID::tower_end
id_iterator tower_end() const
end iterator over towers
Definition: CaloLVL1_ID.h:603
lumiFormat.i
int i
Definition: lumiFormat.py:92
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:194
DeMoScan.index
string index
Definition: DeMoScan.py:362
TileTTL1Hash::m_int2id
std::vector< ID > m_int2id
Definition: TileTTL1Hash.h:66
DeMoScan.first
bool first
Definition: DeMoScan.py:534
CaloLVL1_ID::tower_begin
id_iterator tower_begin() const
begin iterator over towers
Definition: CaloLVL1_ID.h:597
CaloLVL1_ID::tower_hash
IdentifierHash tower_hash(Identifier towerId) const
create hash id from tower id
Definition: CaloLVL1_ID.h:728
TileTTL1Hash::m_table_size
static const int m_table_size
lookup table
Definition: TileTTL1Hash.h:63
CaloLVL1_ID::is_tile
bool is_tile(const Identifier id) const
Test wether given tower or layer is part of the Tile Calorimeter.
Definition: CaloLVL1_ID.h:672