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 }

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 189 of file RegSelectorMapElement.cxx.

◆ etaMax()

double RegSelectorMapElement::etaMax ( IdentifierHash  hashId) const

Definition at line 102 of file RegSelectorMapElement.cxx.

102  {
103  return m_etamax[ hashId ];
104 }

◆ etamaxElem()

double RegSelectorMapElement::etamaxElem ( ) const

Definition at line 118 of file RegSelectorMapElement.cxx.

118  {
119  return m_etamaxValue;
120 }

◆ etaMin()

double RegSelectorMapElement::etaMin ( const IdentifierHash  hashId) const

Definition at line 98 of file RegSelectorMapElement.cxx.

98  {
99  return m_etamin[ hashId ];
100 }

◆ etaminElem()

double RegSelectorMapElement::etaminElem ( ) const

Definition at line 114 of file RegSelectorMapElement.cxx.

114  {
115  return m_etaminValue;
116 }

◆ findHash()

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

Definition at line 54 of file RegSelectorMapElement.cxx.

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

◆ findMaxMinElem()

void RegSelectorMapElement::findMaxMinElem ( void  )

Definition at line 173 of file RegSelectorMapElement.cxx.

173  {
174  m_etaminValue = 1000; m_etamaxValue = -1000;
175  m_phiminValue = 1000; m_phimaxValue = -1000;
176  int vecsize = m_etamin.size();
177  for(int i = 0; i < vecsize; i++){
178  if( m_etamin[i] < m_etaminValue )
180  if( m_etamax[i] > m_etamaxValue )
182  if( m_phimin[i] < m_phiminValue )
184  if( m_phimax[i] > m_phimaxValue )
186  }
187 }

◆ findRobId()

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

Definition at line 76 of file RegSelectorMapElement.cxx.

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

◆ hashId()

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

Definition at line 24 of file RegSelectorMapElement.cxx.

24  {
25  return m_hashId;
26 }

◆ insertElementInVector()

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

Definition at line 28 of file RegSelectorMapElement.cxx.

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

◆ insertNumberElement()

void RegSelectorMapElement::insertNumberElement ( int  numberIn)
private

Definition at line 46 of file RegSelectorMapElement.cxx.

46  {
47  m_number = numberIn;
48 }

◆ insertPositionElement()

void RegSelectorMapElement::insertPositionElement ( int  position)
private

Definition at line 50 of file RegSelectorMapElement.cxx.

50  {
51  m_position = positionIn;
52 }

◆ layerDiskNumber()

int RegSelectorMapElement::layerDiskNumber ( ) const

Definition at line 20 of file RegSelectorMapElement.cxx.

20  {
21  return m_number;
22 }

◆ layerDiskPosition()

int RegSelectorMapElement::layerDiskPosition ( ) const

Definition at line 16 of file RegSelectorMapElement.cxx.

16  {
17  return m_position;
18 }

◆ phiMax()

double RegSelectorMapElement::phiMax ( IdentifierHash  hashId) const

Definition at line 110 of file RegSelectorMapElement.cxx.

110  {
111  return m_phimax[ hashId ];
112 }

◆ phimaxElem() [1/2]

double RegSelectorMapElement::phimaxElem ( )

Definition at line 148 of file RegSelectorMapElement.cxx.

148  {
149  if(m_phimaxValue > (3*M_PI)/2)
150  m_phimaxValue = 2*M_PI;
151  else
153  return m_phimaxValue;
154 }

◆ phimaxElem() [2/2]

double RegSelectorMapElement::phimaxElem ( ) const

Definition at line 164 of file RegSelectorMapElement.cxx.

164  {
165  if(m_phimaxValue > (3*M_PI)/2)
166  return 2*M_PI;
167  else
168  return M_PI;
169  return m_phimaxValue;
170 }

◆ phiMin()

double RegSelectorMapElement::phiMin ( IdentifierHash  hashId) const

Definition at line 106 of file RegSelectorMapElement.cxx.

106  {
107  return m_phimin[ hashId ];
108 }

◆ 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 140 of file RegSelectorMapElement.cxx.

140  {
141  if(m_phiminValue < -M_PI/2)
142  m_phiminValue = -M_PI;
143  else
144  m_phiminValue = 0;
145  return m_phiminValue;
146 }

◆ phiminElem() [2/2]

double RegSelectorMapElement::phiminElem ( ) const

Definition at line 156 of file RegSelectorMapElement.cxx.

156  {
157  if(m_phiminValue < -M_PI/2)
158  return -M_PI;
159  else
160  return 0;
161  return m_phiminValue;
162 }

◆ selection()

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

Definition at line 199 of file RegSelectorMapElement.cxx.

201  {
202  if(phiminIn > phimaxIn){
203  double tmp = phimaxElem();
204  findHash(etaminIn, etamaxIn, phiminIn, tmp, outset);
205  tmp = phiminElem();
206  findHash(etaminIn, etamaxIn, tmp, phimaxIn, outset);
207  }
208  else{
209  findHash(etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
210  }
211 }

◆ selectionRobIdUint()

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

Definition at line 213 of file RegSelectorMapElement.cxx.

215  {
216  if(phiminIn > phimaxIn){
217  double tmp = phimaxElem();
218  findRobId(etaminIn, etamaxIn, phiminIn, tmp, outset);
219  tmp = phiminElem();
220  findRobId(etaminIn, etamaxIn, tmp, phimaxIn, outset);
221  }
222  else{
223  findRobId(etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
224  }
225 }

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:24
RegSelectorMapElement::insertNumberElement
void insertNumberElement(int numberIn)
Definition: RegSelectorMapElement.cxx:46
RegSelectorMapElement::findRobId
void findRobId(double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::set< uint32_t > &outset) const
Definition: RegSelectorMapElement.cxx:76
RegSelectorMapElement::findHash
void findHash(double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::set< IdentifierHash > &outset) const
Definition: RegSelectorMapElement.cxx:54
M_PI
#define M_PI
Definition: ActiveFraction.h:11
RegSelectorMapElement::etaMax
double etaMax(IdentifierHash hashId) const
Definition: RegSelectorMapElement.cxx:102
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:20
RegSelectorMapElement::insertPositionElement
void insertPositionElement(int position)
Definition: RegSelectorMapElement.cxx:50
lumiFormat.i
int i
Definition: lumiFormat.py:92
RegSelectorMapElement::layerDiskPosition
int layerDiskPosition() const
Definition: RegSelectorMapElement.cxx:16
RegSelectorMapElement::insertElementInVector
void insertElementInVector(double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, IdentifierHash hashIdIn, uint32_t robIdIn)
Definition: RegSelectorMapElement.cxx:28
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:156
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:98
RegSelectorMapElement::phiMin
double phiMin(IdentifierHash hashId) const
Definition: RegSelectorMapElement.cxx:106
RegSelectorMapElement::m_etamax
std::vector< double > m_etamax
Definition: RegSelectorMapElement.h:61
RegSelectorMapElement::phiMax
double phiMax(IdentifierHash hashId) const
Definition: RegSelectorMapElement.cxx:110
RegSelectorMapElement::phimaxElem
double phimaxElem() const
Definition: RegSelectorMapElement.cxx:164