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

#include <RegSelectorMapElement.h>

Collaboration diagram for RegSelectorMapElement:

Public Member Functions

 RegSelectorMapElement ()
 
int layerDiskPosition () const
 
int layerDiskNumber () const
 
double etaMin (const IdentifierHash hashId) const
 
double etaMax (IdentifierHash hashId) const
 
double phiMin (IdentifierHash hashId) const
 
double phiMax (IdentifierHash hashId) const
 
const std::vector< IdentifierHash > & hashId () const
 
double etaminElem () const
 
double etamaxElem () const
 
double phiminElem () const
 
double phimaxElem () const
 
double phiminElem ()
 these phi*Elem() functions are some of the worst functions I have ever come accross: if the value it has is larger(smaller) than some threshold, it sets the value to some new value, which is also larger (and smaller) than the same threshold, so that every subsequent time it is called, it will be setting the value to this too-large (or too-small) value what it sthe point of it ? Why does it need to change this value at all ? If we want to find the value we should check all the elements in one place, and then set the value once and for all, and not mess about setting it to already out-of-range values in the accessor. More...
 
double phimaxElem ()
 
void findMaxMinElem (void)
 
void additem (const IdentifierHash hashId, const double etaMin, const double etaMax, const double phiMin, const double phiMax, const int layerDiskNumber, const int layerDiskPosition, const uint32_t robId)
 
void selection (double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::set< IdentifierHash > &outset) const
 
void selectionRobIdUint (double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::set< uint32_t > &outset) const
 

Private Member Functions

void insertElementInVector (double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, IdentifierHash hashIdIn, uint32_t robIdIn)
 
void insertNumberElement (int numberIn)
 
void insertPositionElement (int position)
 
void findHash (double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::set< IdentifierHash > &outset) const
 
void findRobId (double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::set< uint32_t > &outset) const
 

Private Attributes

int m_position
 
int m_number
 
std::vector< double > m_etamin
 
std::vector< double > m_etamax
 
std::vector< double > m_phimin
 
std::vector< double > m_phimax
 
std::vector< IdentifierHashm_hashId
 
std::vector< uint32_t > m_robId
 
double m_etaminValue
 
double m_etamaxValue
 
double m_phiminValue
 
double m_phimaxValue
 

Detailed Description

Definition at line 17 of file RegSelectorMapElement.h.

Constructor & Destructor Documentation

◆ RegSelectorMapElement()

RegSelectorMapElement::RegSelectorMapElement ( )

Definition at line 11 of file RegSelectorMapElement.cxx.

11  {
12  m_position = 0;
13  m_number = 0;
14  m_etaminValue = 1000;
15  m_etamaxValue = -1000;
16  m_phiminValue = 1000;
17  m_phimaxValue = -1000;
18 }

Member Function Documentation

◆ additem()

void RegSelectorMapElement::additem ( const IdentifierHash  hashId,
const double  etaMin,
const double  etaMax,
const double  phiMin,
const double  phiMax,
const int  layerDiskNumber,
const int  layerDiskPosition,
const uint32_t  robId 
)

Definition at line 193 of file RegSelectorMapElement.cxx.

◆ etaMax()

double RegSelectorMapElement::etaMax ( IdentifierHash  hashId) const

Definition at line 106 of file RegSelectorMapElement.cxx.

106  {
107  return m_etamax[ hashId ];
108 }

◆ etamaxElem()

double RegSelectorMapElement::etamaxElem ( ) const

Definition at line 122 of file RegSelectorMapElement.cxx.

122  {
123  return m_etamaxValue;
124 }

◆ etaMin()

double RegSelectorMapElement::etaMin ( const IdentifierHash  hashId) const

Definition at line 102 of file RegSelectorMapElement.cxx.

102  {
103  return m_etamin[ hashId ];
104 }

◆ etaminElem()

double RegSelectorMapElement::etaminElem ( ) const

Definition at line 118 of file RegSelectorMapElement.cxx.

118  {
119  return m_etaminValue;
120 }

◆ findHash()

void RegSelectorMapElement::findHash ( double  etaminIn,
double  etamaxIn,
double  phiminIn,
double  phimaxIn,
std::set< IdentifierHash > &  outset 
) const
private

Definition at line 58 of file RegSelectorMapElement.cxx.

60  {
61  int vecsize = m_etamin.size();
62  double phiTmpMin = phiminElem();
63  double phiTmpMax = phimaxElem();
64 
65  for(int i= 0; i < vecsize; i++){
66  if( (etaminIn <= m_etamax[i]) && (etamaxIn >= m_etamin[i]) ){
67  if( m_phimin[i] < m_phimax[i]){
68  if( (phiminIn <= m_phimax[i]) && (phimaxIn >= m_phimin[i]) )
69  outset.insert(m_hashId[i]);
70  }
71  else{
72  if( ((phiminIn <= m_phimax[i]) && (phimaxIn >= phiTmpMin )) ||
73  ((phiminIn <= phiTmpMax ) && (phimaxIn >= m_phimin[i])) )
74  outset.insert(m_hashId[i]);
75  }
76  }
77  }
78 }

◆ findMaxMinElem()

void RegSelectorMapElement::findMaxMinElem ( void  )

Definition at line 177 of file RegSelectorMapElement.cxx.

177  {
178  m_etaminValue = 1000; m_etamaxValue = -1000;
179  m_phiminValue = 1000; m_phimaxValue = -1000;
180  int vecsize = m_etamin.size();
181  for(int i = 0; i < vecsize; i++){
182  if( m_etamin[i] < m_etaminValue )
184  if( m_etamax[i] > m_etamaxValue )
186  if( m_phimin[i] < m_phiminValue )
188  if( m_phimax[i] > m_phimaxValue )
190  }
191 }

◆ findRobId()

void RegSelectorMapElement::findRobId ( double  etaminIn,
double  etamaxIn,
double  phiminIn,
double  phimaxIn,
std::set< uint32_t > &  outset 
) const
private

Definition at line 80 of file RegSelectorMapElement.cxx.

82  {
83  int vecsize = m_etamin.size();
84  double phiTmpMin = phiminElem();
85  double phiTmpMax = phimaxElem();
86 
87  for(int i= 0; i < vecsize; i++){
88  if( (etaminIn <= m_etamax[i]) && (etamaxIn >= m_etamin[i]) ){
89  if( m_phimin[i] < m_phimax[i]){
90  if( (phiminIn <= m_phimax[i]) && (phimaxIn >= m_phimin[i]) )
91  outset.insert( m_robId[i]);
92  }
93  else{
94  if( ((phiminIn <= m_phimax[i]) && (phimaxIn >= phiTmpMin )) ||
95  ((phiminIn <= phiTmpMax ) && (phimaxIn >= m_phimin[i])) )
96  outset.insert( m_robId[i]);
97  }
98  }
99  }
100 }

◆ hashId()

const std::vector< IdentifierHash > & RegSelectorMapElement::hashId ( ) const

Definition at line 28 of file RegSelectorMapElement.cxx.

28  {
29  return m_hashId;
30 }

◆ insertElementInVector()

void RegSelectorMapElement::insertElementInVector ( double  etaminIn,
double  etamaxIn,
double  phiminIn,
double  phimaxIn,
IdentifierHash  hashIdIn,
uint32_t  robIdIn 
)
private

Definition at line 32 of file RegSelectorMapElement.cxx.

34  {
35  if(etaminIn > etamaxIn){
36  m_etamin.push_back(etamaxIn);
37  m_etamax.push_back(etaminIn);
38  }
39  else{
40  m_etamin.push_back(etaminIn);
41  m_etamax.push_back(etamaxIn);
42  }
43 
44  m_phimin.push_back(phiminIn);
45  m_phimax.push_back(phimaxIn);
46  m_hashId.push_back(hashIdIn);
47  m_robId.push_back(robIdIn);
48 }

◆ insertNumberElement()

void RegSelectorMapElement::insertNumberElement ( int  numberIn)
private

Definition at line 50 of file RegSelectorMapElement.cxx.

50  {
51  m_number = numberIn;
52 }

◆ insertPositionElement()

void RegSelectorMapElement::insertPositionElement ( int  position)
private

Definition at line 54 of file RegSelectorMapElement.cxx.

54  {
55  m_position = positionIn;
56 }

◆ layerDiskNumber()

int RegSelectorMapElement::layerDiskNumber ( ) const

Definition at line 24 of file RegSelectorMapElement.cxx.

24  {
25  return m_number;
26 }

◆ layerDiskPosition()

int RegSelectorMapElement::layerDiskPosition ( ) const

Definition at line 20 of file RegSelectorMapElement.cxx.

20  {
21  return m_position;
22 }

◆ phiMax()

double RegSelectorMapElement::phiMax ( IdentifierHash  hashId) const

Definition at line 114 of file RegSelectorMapElement.cxx.

114  {
115  return m_phimax[ hashId ];
116 }

◆ phimaxElem() [1/2]

double RegSelectorMapElement::phimaxElem ( )

Definition at line 152 of file RegSelectorMapElement.cxx.

152  {
153  if(m_phimaxValue > (3*M_PI)/2)
154  m_phimaxValue = 2*M_PI;
155  else
157  return m_phimaxValue;
158 }

◆ phimaxElem() [2/2]

double RegSelectorMapElement::phimaxElem ( ) const

Definition at line 168 of file RegSelectorMapElement.cxx.

168  {
169  if(m_phimaxValue > (3*M_PI)/2)
170  return 2*M_PI;
171  else
172  return M_PI;
173  return m_phimaxValue;
174 }

◆ phiMin()

double RegSelectorMapElement::phiMin ( IdentifierHash  hashId) const

Definition at line 110 of file RegSelectorMapElement.cxx.

110  {
111  return m_phimin[ hashId ];
112 }

◆ phiminElem() [1/2]

double RegSelectorMapElement::phiminElem ( )

these phi*Elem() functions are some of the worst functions I have ever come accross: if the value it has is larger(smaller) than some threshold, it sets the value to some new value, which is also larger (and smaller) than the same threshold, so that every subsequent time it is called, it will be setting the value to this too-large (or too-small) value what it sthe point of it ? Why does it need to change this value at all ? If we want to find the value we should check all the elements in one place, and then set the value once and for all, and not mess about setting it to already out-of-range values in the accessor.

So what this means is that when calling this function to to get the limit for the map, it might actually change that said limit, and give you some hardcoded limit instead. Why is the limit set to be the value that it is ? working out how to replace this function will be a complete pain, The sooner we get rid of this awful class the better

Definition at line 144 of file RegSelectorMapElement.cxx.

144  {
145  if(m_phiminValue < -M_PI/2)
146  m_phiminValue = -M_PI;
147  else
148  m_phiminValue = 0;
149  return m_phiminValue;
150 }

◆ phiminElem() [2/2]

double RegSelectorMapElement::phiminElem ( ) const

Definition at line 160 of file RegSelectorMapElement.cxx.

160  {
161  if(m_phiminValue < -M_PI/2)
162  return -M_PI;
163  else
164  return 0;
165  return m_phiminValue;
166 }

◆ selection()

void RegSelectorMapElement::selection ( double  etaminIn,
double  etamaxIn,
double  phiminIn,
double  phimaxIn,
std::set< IdentifierHash > &  outset 
) const

Definition at line 203 of file RegSelectorMapElement.cxx.

205  {
206  if(phiminIn > phimaxIn){
207  double tmp = phimaxElem();
208  findHash(etaminIn, etamaxIn, phiminIn, tmp, outset);
209  tmp = phiminElem();
210  findHash(etaminIn, etamaxIn, tmp, phimaxIn, outset);
211  }
212  else{
213  findHash(etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
214  }
215 }

◆ selectionRobIdUint()

void RegSelectorMapElement::selectionRobIdUint ( double  etaminIn,
double  etamaxIn,
double  phiminIn,
double  phimaxIn,
std::set< uint32_t > &  outset 
) const

Definition at line 217 of file RegSelectorMapElement.cxx.

219  {
220  if(phiminIn > phimaxIn){
221  double tmp = phimaxElem();
222  findRobId(etaminIn, etamaxIn, phiminIn, tmp, outset);
223  tmp = phiminElem();
224  findRobId(etaminIn, etamaxIn, tmp, phimaxIn, outset);
225  }
226  else{
227  findRobId(etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
228  }
229 }

Member Data Documentation

◆ m_etamax

std::vector<double> RegSelectorMapElement::m_etamax
private

Definition at line 61 of file RegSelectorMapElement.h.

◆ m_etamaxValue

double RegSelectorMapElement::m_etamaxValue
private

Definition at line 65 of file RegSelectorMapElement.h.

◆ m_etamin

std::vector<double> RegSelectorMapElement::m_etamin
private

Definition at line 61 of file RegSelectorMapElement.h.

◆ m_etaminValue

double RegSelectorMapElement::m_etaminValue
private

Definition at line 65 of file RegSelectorMapElement.h.

◆ m_hashId

std::vector<IdentifierHash> RegSelectorMapElement::m_hashId
private

Definition at line 63 of file RegSelectorMapElement.h.

◆ m_number

int RegSelectorMapElement::m_number
private

Definition at line 60 of file RegSelectorMapElement.h.

◆ m_phimax

std::vector<double> RegSelectorMapElement::m_phimax
private

Definition at line 62 of file RegSelectorMapElement.h.

◆ m_phimaxValue

double RegSelectorMapElement::m_phimaxValue
private

Definition at line 66 of file RegSelectorMapElement.h.

◆ m_phimin

std::vector<double> RegSelectorMapElement::m_phimin
private

Definition at line 62 of file RegSelectorMapElement.h.

◆ m_phiminValue

double RegSelectorMapElement::m_phiminValue
private

Definition at line 66 of file RegSelectorMapElement.h.

◆ m_position

int RegSelectorMapElement::m_position
private

Definition at line 59 of file RegSelectorMapElement.h.

◆ m_robId

std::vector<uint32_t> RegSelectorMapElement::m_robId
private

Definition at line 64 of file RegSelectorMapElement.h.


The documentation for this class was generated from the following files:
RegSelectorMapElement::hashId
const std::vector< IdentifierHash > & hashId() const
Definition: RegSelectorMapElement.cxx:28
RegSelectorMapElement::insertNumberElement
void insertNumberElement(int numberIn)
Definition: RegSelectorMapElement.cxx:50
RegSelectorMapElement::findRobId
void findRobId(double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::set< uint32_t > &outset) const
Definition: RegSelectorMapElement.cxx:80
RegSelectorMapElement::findHash
void findHash(double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::set< IdentifierHash > &outset) const
Definition: RegSelectorMapElement.cxx:58
M_PI
#define M_PI
Definition: ActiveFraction.h:11
RegSelectorMapElement::etaMax
double etaMax(IdentifierHash hashId) const
Definition: RegSelectorMapElement.cxx:106
RegSelectorMapElement::m_phimaxValue
double m_phimaxValue
Definition: RegSelectorMapElement.h:66
RegSelectorMapElement::m_number
int m_number
Definition: RegSelectorMapElement.h:60
RegSelectorMapElement::layerDiskNumber
int layerDiskNumber() const
Definition: RegSelectorMapElement.cxx:24
RegSelectorMapElement::insertPositionElement
void insertPositionElement(int position)
Definition: RegSelectorMapElement.cxx:54
lumiFormat.i
int i
Definition: lumiFormat.py:85
RegSelectorMapElement::layerDiskPosition
int layerDiskPosition() const
Definition: RegSelectorMapElement.cxx:20
RegSelectorMapElement::insertElementInVector
void insertElementInVector(double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, IdentifierHash hashIdIn, uint32_t robIdIn)
Definition: RegSelectorMapElement.cxx:32
RegSelectorMapElement::m_etamaxValue
double m_etamaxValue
Definition: RegSelectorMapElement.h:65
RegSelectorMapElement::m_etaminValue
double m_etaminValue
Definition: RegSelectorMapElement.h:65
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
RegSelectorMapElement::m_position
int m_position
Definition: RegSelectorMapElement.h:59
RegSelectorMapElement::m_etamin
std::vector< double > m_etamin
Definition: RegSelectorMapElement.h:61
RegSelectorMapElement::m_phimin
std::vector< double > m_phimin
Definition: RegSelectorMapElement.h:62
RegSelectorMapElement::phiminElem
double phiminElem() const
Definition: RegSelectorMapElement.cxx:160
RegSelectorMapElement::m_phimax
std::vector< double > m_phimax
Definition: RegSelectorMapElement.h:62
RegSelectorMapElement::m_robId
std::vector< uint32_t > m_robId
Definition: RegSelectorMapElement.h:64
RegSelectorMapElement::m_hashId
std::vector< IdentifierHash > m_hashId
Definition: RegSelectorMapElement.h:63
RegSelectorMapElement::m_phiminValue
double m_phiminValue
Definition: RegSelectorMapElement.h:66
RegSelectorMapElement::etaMin
double etaMin(const IdentifierHash hashId) const
Definition: RegSelectorMapElement.cxx:102
RegSelectorMapElement::phiMin
double phiMin(IdentifierHash hashId) const
Definition: RegSelectorMapElement.cxx:110
RegSelectorMapElement::m_etamax
std::vector< double > m_etamax
Definition: RegSelectorMapElement.h:61
RegSelectorMapElement::phiMax
double phiMax(IdentifierHash hashId) const
Definition: RegSelectorMapElement.cxx:114
RegSelectorMapElement::phimaxElem
double phimaxElem() const
Definition: RegSelectorMapElement.cxx:168