ATLAS Offline Software
RegionSelectorLUT.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 RegionSelectorLUT::RegionSelectorLUT( unsigned int maxHash ){
8  m_etaMin.resize( maxHash );
9  m_etaMax.resize( maxHash );
10  m_phiMin.resize( maxHash );
11  m_phiMax.resize( maxHash );
12  m_position.resize( maxHash );
13  m_number.resize( maxHash );
14  m_robId.resize( maxHash );
15  m_hashId.resize( maxHash );
16  m_maxHash = 0;
17 }
18 
20  unsigned int maxHash = 50000;
21  m_etaMin.resize( maxHash );
22  m_etaMax.resize( maxHash );
23  m_phiMin.resize( maxHash );
24  m_phiMax.resize( maxHash );
25  m_position.resize( maxHash );
26  m_number.resize( maxHash );
27  m_robId.resize( maxHash );
28  m_hashId.resize( maxHash );
29  m_maxHash = 0;
30 }
31 
32 int RegionSelectorLUT::layerDiskPosition( int hashId ) const{
33  return m_position[ hashId ];
34 }
35 
36 int RegionSelectorLUT::layerDiskNumber( int hashId ) const{
37  return m_number[ hashId ];
38 }
39 
40 double RegionSelectorLUT::etaMin( int hashId ) const{
41  return m_etaMin[ hashId ];
42 }
43 
44 double RegionSelectorLUT::etaMax( int hashId ) const{
45  return m_etaMax[ hashId ];
46 }
47 
48 double RegionSelectorLUT::phiMin( int hashId ) const{
49  return m_phiMin[ hashId ];
50 }
51 
52 double RegionSelectorLUT::phiMax( int hashId ) const{
53  return m_phiMax[ hashId ];
54 }
55 
56 int RegionSelectorLUT::sampling( int hashId ) const{
57  return m_position[ hashId ];
58 }
59 
60 int RegionSelectorLUT::robId( int hashId ) const{
61  return m_robId[ hashId ];
62 }
63 
65  return m_hashId[ value ];
66 }
67 
68 unsigned int RegionSelectorLUT::maxHash( void ) const{
69  return m_maxHash;
70 }
71 
73  double etaminElem = 1000.0;
74  unsigned int i;
75 
76  if( m_maxHash > 0 ){
77  for( i = 0; i < m_maxHash; i++ ){
78  if( m_etaMin[i] < etaminElem )
79  etaminElem = m_etaMin[i];
80  }
81  }
82  return etaminElem;
83 }
84 
86  double etamaxElem = -1000.0;
87  unsigned int i;
88 
89  if( m_maxHash > 0 ){
90  for( i = 0; i < m_maxHash; i++ ){
91  if( m_etaMax[i] > etamaxElem )
92  etamaxElem = m_etaMax[i];
93  }
94  }
95  return etamaxElem;
96 }
97 
99  double phiminElem = 1000.0;
100  unsigned int i;
101 
102  if( m_maxHash > 0 ){
103  for( i = 0; i < m_maxHash; i++ ){
104  if( m_phiMin[i] < phiminElem )
105  phiminElem = m_phiMin[i];
106  }
107  }
108  return phiminElem;
109 }
110 
112  double phimaxElem = -1000.0;
113  unsigned int i;
114 
115  if( m_maxHash > 0 ){
116  for( i = 0; i < m_maxHash; i++ ){
117  if( m_phiMax[i] > phimaxElem )
118  phimaxElem = m_phiMax[i];
119  }
120  }
121 
122  return phimaxElem;
123 }
124 
125 void RegionSelectorLUT::additem(const int hashId,
126  const double etaMin, const double etaMax,
127  const double phiMin, const double phiMax,
128  const int layerDiskNumber, const int layerDiskPosition ){
136  m_maxHash++;
137 
138 }
139 
140 void RegionSelectorLUT::additem(const double etaMin, const double etaMax,
141  const double phiMin, const double phiMax,
142  const int layerDiskNumber, const int layerDiskPosition,
143  const int hashId, const int robId ){
152 
153  m_maxHash++;
154 
155 }
156 
157 void RegionSelectorLUT::additem(const int sampling,
158  const double etaMin, const double etaMax,
159  const double phiMin, const double phiMax,
160  const int layerDiskNumber,
161  const int hashId, const int robId ){
170  m_maxHash++;
171 }
RegionSelectorLUT::m_maxHash
unsigned int m_maxHash
Definition: RegionSelectorLUT.h:56
RegionSelectorLUT::RegionSelectorLUT
RegionSelectorLUT(void)
Definition: RegionSelectorLUT.cxx:19
RegionSelectorLUT::etaminElem
double etaminElem()
Definition: RegionSelectorLUT.cxx:72
RegionSelectorLUT::layerDiskPosition
int layerDiskPosition(int hashId) const
Definition: RegionSelectorLUT.cxx:32
RegionSelectorLUT.h
RegionSelectorLUT::sampling
int sampling(int hashId) const
Definition: RegionSelectorLUT.cxx:56
xAOD::etaMax
etaMax
Definition: HIEventShape_v2.cxx:46
athena.value
value
Definition: athena.py:122
RegionSelectorLUT::m_phiMin
std::vector< double > m_phiMin
Definition: RegionSelectorLUT.h:58
RegionSelectorLUT::maxHash
unsigned int maxHash(void) const
Definition: RegionSelectorLUT.cxx:68
RegionSelectorLUT::etaMin
double etaMin(int hashId) const
Definition: RegionSelectorLUT.cxx:40
RegionSelectorLUT::m_phiMax
std::vector< double > m_phiMax
Definition: RegionSelectorLUT.h:58
RegionSelectorLUT::m_etaMin
std::vector< double > m_etaMin
Definition: RegionSelectorLUT.h:58
RegionSelectorLUT::phiMax
double phiMax(int hashId) const
Definition: RegionSelectorLUT.cxx:52
lumiFormat.i
int i
Definition: lumiFormat.py:92
RegionSelectorLUT::m_robId
std::vector< int > m_robId
Definition: RegionSelectorLUT.h:59
RegionSelectorLUT::m_number
std::vector< int > m_number
Definition: RegionSelectorLUT.h:57
RegionSelectorLUT::phimaxElem
double phimaxElem()
Definition: RegionSelectorLUT.cxx:111
RegionSelectorLUT::etamaxElem
double etamaxElem()
Definition: RegionSelectorLUT.cxx:85
RegionSelectorLUT::m_hashId
std::vector< int > m_hashId
Definition: RegionSelectorLUT.h:59
RegionSelectorLUT::robId
int robId(int hashId) const
Definition: RegionSelectorLUT.cxx:60
RegionSelectorLUT::layerDiskNumber
int layerDiskNumber(int hashId) const
Definition: RegionSelectorLUT.cxx:36
RegionSelectorLUT::etaMax
double etaMax(int hashId) const
Definition: RegionSelectorLUT.cxx:44
RegionSelectorLUT::phiminElem
double phiminElem()
Definition: RegionSelectorLUT.cxx:98
LArCellBinning.etaMin
etaMin
Definition: LArCellBinning.py:84
RegionSelectorLUT::m_position
std::vector< int > m_position
Definition: RegionSelectorLUT.h:57
RegionSelectorLUT::m_etaMax
std::vector< double > m_etaMax
Definition: RegionSelectorLUT.h:58
RegionSelectorLUT::additem
void additem(const int hashId, const double etaMin, const double etaMax, const double phiMin, const double phiMax, const int layerDiskNumber, const int layerDiskPosition)
Definition: RegionSelectorLUT.cxx:125
RegionSelectorLUT::hashId
int hashId(int value) const
Definition: RegionSelectorLUT.cxx:64
RegionSelectorLUT::phiMin
double phiMin(int hashId) const
Definition: RegionSelectorLUT.cxx:48