ATLAS Offline Software
Loading...
Searching...
No Matches
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 ?
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 ( )

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

194 {
195
199}
double etaMin(const IdentifierHash hashId) const
double etaMax(IdentifierHash hashId) const
const std::vector< IdentifierHash > & hashId() const
double phiMin(IdentifierHash hashId) const
double phiMax(IdentifierHash hashId) const
void insertNumberElement(int numberIn)
void insertPositionElement(int position)
void insertElementInVector(double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, IdentifierHash hashIdIn, uint32_t robIdIn)

◆ etaMax()

double RegSelectorMapElement::etaMax ( IdentifierHash hashId) const

Definition at line 106 of file RegSelectorMapElement.cxx.

106 {
107 return m_etamax[ hashId ];
108}
std::vector< double > m_etamax

◆ 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}
std::vector< double > m_etamin

◆ 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}
std::vector< double > m_phimax
std::vector< IdentifierHash > m_hashId
std::vector< double > m_phimin

◆ findMaxMinElem()

void RegSelectorMapElement::findMaxMinElem ( void )

Definition at line 175 of file RegSelectorMapElement.cxx.

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

◆ 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}
std::vector< uint32_t > m_robId

◆ 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 ( void ) const

Definition at line 24 of file RegSelectorMapElement.cxx.

24 {
25 return m_number;
26}

◆ layerDiskPosition()

int RegSelectorMapElement::layerDiskPosition ( void ) 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)
155 else
157 return m_phimaxValue;
158}
#define M_PI

◆ phimaxElem() [2/2]

double RegSelectorMapElement::phimaxElem ( ) const

Definition at line 167 of file RegSelectorMapElement.cxx.

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

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

◆ selection()

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

Definition at line 201 of file RegSelectorMapElement.cxx.

203 {
204 if(phiminIn > phimaxIn){
205 double tmp = phimaxElem();
206 findHash(etaminIn, etamaxIn, phiminIn, tmp, outset);
207 tmp = phiminElem();
208 findHash(etaminIn, etamaxIn, tmp, phimaxIn, outset);
209 }
210 else{
211 findHash(etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
212 }
213}
void findHash(double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::set< IdentifierHash > &outset) const

◆ selectionRobIdUint()

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

Definition at line 215 of file RegSelectorMapElement.cxx.

217 {
218 if(phiminIn > phimaxIn){
219 double tmp = phimaxElem();
220 findRobId(etaminIn, etamaxIn, phiminIn, tmp, outset);
221 tmp = phiminElem();
222 findRobId(etaminIn, etamaxIn, tmp, phimaxIn, outset);
223 }
224 else{
225 findRobId(etaminIn, etamaxIn, phiminIn, phimaxIn, outset);
226 }
227}
void findRobId(double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::set< uint32_t > &outset) const

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: