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

Hash table for Tile fragments (==drawers ==collections in StoreGate) More...

#include <TileFragHash.h>

Collaboration diagram for TileFragHash:

Public Types

enum  TYPE {
  Beam =255 , Default =0 , Digitizer =0 , OptFilterDsp =1 ,
  OptFilterOffline =2 , OptFilterDspCompressed =3 , ManyAmps =4 , MF =5 ,
  FitFilter =6 , FitFilterCool =7 , FlatFilter =8 , WienerFilterOffline =9
}
 initialize More...
typedef int ID

Public Member Functions

 TileFragHash ()
virtual ~TileFragHash ()
void initialize (const TileHWID *tileHWID, TYPE type=Default)
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)
ID identifier (int i) const
 reverse conversion
int max () const
 return maximum number of IDs
int offset () const
 return offset
TYPE type () const
 return hash type

Static Public Member Functions

static std::string typeToString (TYPE type)
 Printable representation of a type.

Private Attributes

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

Static Private Attributes

static const int m_table_size = 0x500
 lookup table

Detailed Description

Hash table for Tile fragments (==drawers ==collections in StoreGate)

Author
Alexander Solodkov

Hash table Identifier builds a table of drawer identifiers 4 * 64 in total for ATLAS only 32 in the testbeam

Definition at line 24 of file TileFragHash.h.

Member Typedef Documentation

◆ ID

typedef int TileFragHash::ID

Definition at line 28 of file TileFragHash.h.

Member Enumeration Documentation

◆ TYPE

initialize

Enumerator
Beam 
Default 
Digitizer 
OptFilterDsp 
OptFilterOffline 
OptFilterDspCompressed 
ManyAmps 
MF 
FitFilter 
FitFilterCool 
FlatFilter 
WienerFilterOffline 

Definition at line 33 of file TileFragHash.h.

Constructor & Destructor Documentation

◆ TileFragHash()

TileFragHash::TileFragHash ( )

Definition at line 15 of file TileFragHash.cxx.

16 : m_size(0)
17 , m_offset(0)
19{
20 memset(m_lookup,0,sizeof(m_lookup));
21}
int m_size
total number of IDs
int m_lookup[m_table_size]

◆ ~TileFragHash()

virtual TileFragHash::~TileFragHash ( )
inlinevirtual

Definition at line 30 of file TileFragHash.h.

30{ };

Member Function Documentation

◆ hash()

int TileFragHash::hash ( const ID & id) const

Convert ID to int (same as the converter, but easier to call from python)

Definition at line 74 of file TileFragHash.cxx.

75{
76 assert(id>=0 && id < m_table_size);
77
78 return m_lookup[id];
79}
static const int m_table_size
lookup table

◆ identifier()

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

reverse conversion

Definition at line 67 of file TileFragHash.cxx.

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

◆ initialize()

void TileFragHash::initialize ( const TileHWID * tileHWID,
TYPE type = Default )

iterator over all drawer Identifiers

Definition at line 23 of file TileFragHash.cxx.

24{
25 // std::cout << " TileFragHash Constructor "<< std::endl;
26
27 m_type = type;
28 m_size = 0;
29 if (!tileHWID) return;
30 m_int2id.clear();
31 m_int2id.reserve(tileHWID->drawer_hash_max());
32
33 for(int i = 0; i< m_table_size; ++i) { m_lookup[i]=-1; }
34
36 std::vector<HWIdentifier>::const_iterator first = tileHWID->drawer_begin();
37 std::vector<HWIdentifier>::const_iterator last = tileHWID->drawer_end();
38
39 switch (type) {
40 case Beam:
41 m_offset = 0;
42 for ( ; first!=last; ++first) {
43 ID id = tileHWID->frag(*first);
44 if (id >= 0x100) continue; // skip all real drawers
45 assert(id>=0 && id < m_table_size);
46
47 m_int2id.push_back(id);
48 m_lookup[id] = (m_size++);
49 }
50 // std::cout << " Number of valid Beam frag IDs "<< m_size << std::endl;
51 break;
52 default:
53 m_offset = (int)type * 0x1000;
54 for ( ; first!=last; ++first) {
55 ID id = tileHWID->frag(*first);
56 if (id < 0x100) continue; // skip Beam ROD frags
57 assert(id>=0 && id < m_table_size);
58
59 m_int2id.push_back(id);
60 m_lookup[id] = (m_size++);
61 }
62 // std::cout << " Number of valid drawer IDs "<< m_size << std::endl;
63 break;
64 }
65}
TYPE type() const
return hash type
int frag(const HWIdentifier &id) const
extract frag field from HW identifier
Definition TileHWID.h:181
std::vector< HWIdentifier >::const_iterator drawer_end() const
end iterator for drawer Identifiers
Definition TileHWID.h:294
std::vector< HWIdentifier >::const_iterator drawer_begin() const
begin iterator for drawer Identifiers
Definition TileHWID.h:290
size_type drawer_hash_max() const
drawer hash table max size
Definition TileHWID.h:268
bool first
Definition DeMoScan.py:534

◆ max()

int TileFragHash::max ( ) const
inline

return maximum number of IDs

Definition at line 50 of file TileFragHash.h.

50{return m_size;}

◆ offset()

int TileFragHash::offset ( ) const
inline

return offset

Definition at line 53 of file TileFragHash.h.

53{return m_offset;}

◆ operator()()

int TileFragHash::operator() ( const ID & id) const
inline

Convert ID to int.

Definition at line 41 of file TileFragHash.h.

41{ return hash(id); }
int hash(const ID &id) const
Convert ID to int (same as the converter, but easier to call from python)

◆ type()

TYPE TileFragHash::type ( ) const
inline

return hash type

Definition at line 56 of file TileFragHash.h.

56{return m_type;}

◆ typeToString()

std::string TileFragHash::typeToString ( TYPE type)
static

Printable representation of a type.

Definition at line 85 of file TileFragHash.cxx.

86{
87 switch (type) {
88#define CASE(X) case TileFragHash::X: return #X
94 CASE(MF);
98 CASE(Beam);
99#undef CASE
100 default: break;
101 };
102 return "UNKNOWN";
103}
#define CASE(X)

Member Data Documentation

◆ m_int2id

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

Definition at line 73 of file TileFragHash.h.

◆ m_lookup

int TileFragHash::m_lookup[m_table_size]
private

Definition at line 71 of file TileFragHash.h.

◆ m_offset

int TileFragHash::m_offset
private

Definition at line 66 of file TileFragHash.h.

◆ m_size

int TileFragHash::m_size
private

total number of IDs

Definition at line 65 of file TileFragHash.h.

◆ m_table_size

const int TileFragHash::m_table_size = 0x500
staticprivate

lookup table

Definition at line 70 of file TileFragHash.h.

◆ m_type

TYPE TileFragHash::m_type
private

Definition at line 67 of file TileFragHash.h.


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