ATLAS Offline Software
Public Types | Public Member Functions | Private Attributes | List of all members
TileRodIdHash Class Reference

Table to convert ROB ID to fragment hash. More...

#include <TileRodIdHash.h>

Collaboration diagram for TileRodIdHash:

Public Types

typedef int ID
 

Public Member Functions

 TileRodIdHash ()
 
virtual ~TileRodIdHash ()
 
void initialize (int offset, int runnum)
 initialize More...
 
void initialize (int offset, const std::vector< ID > &rmod)
 new initialize for the HLT More...
 
int operator() (const ID &id) const
 Convert ID to int. More...
 
int max () const
 return maximum number of IDs More...
 
ID identifier (int i) const
 reverse conversion More...
 
int offset () const
 return offset More...
 

Private Attributes

int m_size
 total number of IDs More...
 
std::map< unsigned int, int > m_lookup
 test beam flag More...
 
std::vector< IDm_int2id
 reverse look up More...
 
int m_offset
 

Detailed Description

Table to convert ROB ID to fragment hash.

Author
Alexander Solodkov

Definition at line 19 of file TileRodIdHash.h.

Member Typedef Documentation

◆ ID

typedef int TileRodIdHash::ID

Definition at line 23 of file TileRodIdHash.h.

Constructor & Destructor Documentation

◆ TileRodIdHash()

TileRodIdHash::TileRodIdHash ( )

Definition at line 15 of file TileRodIdHash.cxx.

16  : m_size(0),
17  m_offset(0)
18 {
19 
20 }

◆ ~TileRodIdHash()

virtual TileRodIdHash::~TileRodIdHash ( )
inlinevirtual

Definition at line 25 of file TileRodIdHash.h.

25 { };

Member Function Documentation

◆ identifier()

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

reverse conversion

Definition at line 112 of file TileRodIdHash.cxx.

112  {
113 
114  return m_int2id[index] ;
115 
116 }

◆ initialize() [1/2]

void TileRodIdHash::initialize ( int  offset,
const std::vector< ID > &  rmod 
)

new initialize for the HLT

Definition at line 87 of file TileRodIdHash.cxx.

87  {
88 
89 //
90 
91  m_offset = offset;
92 
93  std::vector<ID>::const_iterator
94  it = rmod.begin();
95  std::vector<ID>::const_iterator
96  it_end = rmod.end() ;
97 
98  int n = 0;
99  for (; it!=it_end;++it) {
100  ID id = *it;
101  unsigned int i = id;
102  m_lookup[i] = n ;
103  m_int2id.push_back(id);
104  ++n;
105  }
106 
107  m_size = n;
108 }

◆ initialize() [2/2]

void TileRodIdHash::initialize ( int  offset,
int  runnum 
)

initialize

Definition at line 23 of file TileRodIdHash.cxx.

23  {
24 
25 //
26 
27  std::vector<ID> rmod;
28  rmod.reserve(256);
29  if (runnum>318000) {
30  // new frag->ROB mapping since March 2017
31  // put 4 drawers in two subsequent RODs
32  // odd drawers in odd ROD, even drawers in even ROD
33  for(unsigned int i=0x510000;i<=0x51001f;i+=2){
34  rmod.push_back(i);
35  rmod.push_back(i+1);
36  rmod.push_back(i);
37  rmod.push_back(i+1);
38  }
39  for(unsigned int i=0x520000;i<=0x52001f;i+=2){
40  rmod.push_back(i);
41  rmod.push_back(i+1);
42  rmod.push_back(i);
43  rmod.push_back(i+1);
44  }
45  for(unsigned int i=0x530000;i<=0x53001f;i+=2){
46  rmod.push_back(i);
47  rmod.push_back(i+1);
48  rmod.push_back(i);
49  rmod.push_back(i+1);
50  }
51  for(unsigned int i=0x540000;i<=0x54001f;i+=2){
52  rmod.push_back(i);
53  rmod.push_back(i+1);
54  rmod.push_back(i);
55  rmod.push_back(i+1);
56  }
57  } else {
58  for(unsigned int i=0x510000;i<=0x51000f;i++){
59  rmod.push_back(i);
60  rmod.push_back(i);
61  rmod.push_back(i);
62  rmod.push_back(i);
63  }
64  for(unsigned int i=0x520000;i<=0x52000f;i++){
65  rmod.push_back(i);
66  rmod.push_back(i);
67  rmod.push_back(i);
68  rmod.push_back(i);
69  }
70  for(unsigned int i=0x530000;i<=0x53000f;i++){
71  rmod.push_back(i);
72  rmod.push_back(i);
73  rmod.push_back(i);
74  rmod.push_back(i);
75  }
76  for(unsigned int i=0x540000;i<=0x54000f;i++){
77  rmod.push_back(i);
78  rmod.push_back(i);
79  rmod.push_back(i);
80  rmod.push_back(i);
81  }
82  }
83 
84  initialize(offset,rmod);
85 }

◆ max()

int TileRodIdHash::max ( ) const

return maximum number of IDs

Definition at line 129 of file TileRodIdHash.cxx.

129  {
130 
131 return m_size;
132 
133 }

◆ offset()

int TileRodIdHash::offset ( ) const

return offset

Definition at line 135 of file TileRodIdHash.cxx.

135  {
136 
137 return m_offset;
138 
139 }

◆ operator()()

int TileRodIdHash::operator() ( const ID id) const

Convert ID to int.

Definition at line 118 of file TileRodIdHash.cxx.

118  {
119 
120  unsigned int i = id ;
121  std::map<unsigned int, int> ::const_iterator it= m_lookup.find(i);
122  if(it!=m_lookup.end()) return (*it).second;
123  std::cout <<" ERROR in TileRodIdHash : invalid Rod number"
124  <<std::endl;
125  return -1;
126 
127 }

Member Data Documentation

◆ m_int2id

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

reverse look up

Definition at line 54 of file TileRodIdHash.h.

◆ m_lookup

std::map<unsigned int, int> TileRodIdHash::m_lookup
private

test beam flag

Definition at line 51 of file TileRodIdHash.h.

◆ m_offset

int TileRodIdHash::m_offset
private

Definition at line 56 of file TileRodIdHash.h.

◆ m_size

int TileRodIdHash::m_size
private

total number of IDs

Definition at line 47 of file TileRodIdHash.h.


The documentation for this class was generated from the following files:
python.utils.AtlRunQueryDQUtils.runnum
runnum
Definition: AtlRunQueryDQUtils.py:214
TileRodIdHash::m_lookup
std::map< unsigned int, int > m_lookup
test beam flag
Definition: TileRodIdHash.h:51
ID
std::vector< Identifier > ID
Definition: CalibHitIDCheck.h:24
TileRodIdHash::offset
int offset() const
return offset
Definition: TileRodIdHash.cxx:135
TileRodIdHash::initialize
void initialize(int offset, int runnum)
initialize
Definition: TileRodIdHash.cxx:23
TileRodIdHash::m_offset
int m_offset
Definition: TileRodIdHash.h:56
skel.it
it
Definition: skel.GENtoEVGEN.py:396
lumiFormat.i
int i
Definition: lumiFormat.py:85
TileRodIdHash::m_int2id
std::vector< ID > m_int2id
reverse look up
Definition: TileRodIdHash.h:54
TileRodIdHash::m_size
int m_size
total number of IDs
Definition: TileRodIdHash.h:47
beamspotman.n
n
Definition: beamspotman.py:731
id
SG::auxid_t id
Definition: Control/AthContainers/Root/debug.cxx:220
DeMoScan.index
string index
Definition: DeMoScan.py:364