ATLAS Offline Software
Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | List of all members
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. More...
 
int hash (const ID &id) const
 Convert ID to int (same as the converter, but easier to call from python) More...
 
ID identifier (int i) const
 reverse conversion More...
 
int max () const
 return maximum number of IDs More...
 
int offset () const
 return offset More...
 
TYPE type () const
 return hash type More...
 

Static Public Member Functions

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

Private Attributes

int m_size
 total number of IDs More...
 
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 More...
 

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)
18  , m_type(Default)
19 {
20  memset(m_lookup,0,sizeof(m_lookup));
21 }

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

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

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

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

◆ 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
89  CASE(Digitizer);
93  CASE(ManyAmps);
94  CASE(MF);
95  CASE(FitFilter);
98  CASE(Beam);
99 #undef CASE
100  default: break;
101  };
102  return "UNKNOWN";
103 }

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:
TileFragHash::m_lookup
int m_lookup[m_table_size]
Definition: TileFragHash.h:71
TileFragHash::m_offset
int m_offset
Definition: TileFragHash.h:66
ID
std::vector< Identifier > ID
Definition: CalibHitIDCheck.h:24
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
index
Definition: index.py:1
TileFragHash::m_table_size
static const int m_table_size
lookup table
Definition: TileFragHash.h:70
TileFragHash::FitFilter
@ FitFilter
Definition: TileFragHash.h:35
TileHWID::frag
int frag(const HWIdentifier &id) const
extract frag field from HW identifier
Definition: TileHWID.h:181
TileHWID::drawer_hash_max
size_type drawer_hash_max(void) const
drawer hash table max size
Definition: TileHWID.h:268
TileFragHash::Digitizer
@ Digitizer
Definition: TileFragHash.h:33
TileFragHash::m_int2id
std::vector< ID > m_int2id
Definition: TileFragHash.h:73
TileFragHash::OptFilterDsp
@ OptFilterDsp
Definition: TileFragHash.h:34
TileFragHash::OptFilterDspCompressed
@ OptFilterDspCompressed
Definition: TileFragHash.h:34
TileFragHash::hash
int hash(const ID &id) const
Convert ID to int (same as the converter, but easier to call from python)
Definition: TileFragHash.cxx:74
TileFragHash::OptFilterOffline
@ OptFilterOffline
Definition: TileFragHash.h:34
lumiFormat.i
int i
Definition: lumiFormat.py:85
TileHWID::drawer_begin
std::vector< HWIdentifier >::const_iterator drawer_begin(void) const
begin iterator for drawer Identifiers
Definition: TileHWID.h:290
TileFragHash::m_size
int m_size
total number of IDs
Definition: TileFragHash.h:65
TileFragHash::Beam
@ Beam
Definition: TileFragHash.h:33
TileFragHash::m_type
TYPE m_type
Definition: TileFragHash.h:67
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
TileFragHash::MF
@ MF
Definition: TileFragHash.h:35
TileFragHash::WienerFilterOffline
@ WienerFilterOffline
Definition: TileFragHash.h:36
CASE
#define CASE(X)
TileFragHash::type
TYPE type() const
return hash type
Definition: TileFragHash.h:56
DeMoScan.index
string index
Definition: DeMoScan.py:364
TileFragHash::FlatFilter
@ FlatFilter
Definition: TileFragHash.h:35
DeMoScan.first
bool first
Definition: DeMoScan.py:536
TileFragHash::ManyAmps
@ ManyAmps
Definition: TileFragHash.h:35
TileFragHash::FitFilterCool
@ FitFilterCool
Definition: TileFragHash.h:35
TileHWID::drawer_end
std::vector< HWIdentifier >::const_iterator drawer_end(void) const
end iterator for drawer Identifiers
Definition: TileHWID.h:294
Default