ATLAS Offline Software
Loading...
Searching...
No Matches
RegSelectorMapElement.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <stdio.h>
8#include <iostream>
9
10
19
23
25 return m_number;
26}
27
28const std::vector<IdentifierHash>& RegSelectorMapElement::hashId() const {
29 return m_hashId;
30}
31
32void RegSelectorMapElement::insertElementInVector(double etaminIn, double etamaxIn, double phiminIn,
33 double phimaxIn, IdentifierHash hashIdIn,
34 uint32_t robIdIn){
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}
49
51 m_number = numberIn;
52}
53
55 m_position = positionIn;
56}
57
58void RegSelectorMapElement::findHash( double etaminIn, double etamaxIn,
59 double phiminIn, double phimaxIn,
60 std::set<IdentifierHash> &outset ) const {
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}
79
80void RegSelectorMapElement::findRobId( double etaminIn, double etamaxIn,
81 double phiminIn, double phimaxIn,
82 std::set<uint32_t>& outset ) const {
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}
101
103 return m_etamin[ hashId ];
104}
105
109
113
117
119 return m_etaminValue;
120}
121
123 return m_etamaxValue;
124}
125
143
145 if(m_phiminValue < -M_PI/2)
147 else
148 m_phiminValue = 0;
149 return m_phiminValue;
150}
151
153 if(m_phimaxValue > (3*M_PI)/2)
155 else
157 return m_phimaxValue;
158}
159
161 if(m_phiminValue < -M_PI/2)
162 return -M_PI;
163 else
164 return 0;
165}
166
168 if(m_phimaxValue > (3*M_PI)/2)
169 return 2*M_PI;
170 else
171 return M_PI;
172}
173
174
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}
190
192 const double etaMax, const double phiMin, const double phiMax,
193 const int layerDiskNumber, const int layerDiskPosition,
194 const uint32_t robId){
195
199}
200
201void RegSelectorMapElement::selection( double etaminIn, double etamaxIn,
202 double phiminIn, double phimaxIn,
203 std::set<IdentifierHash> &outset) const {
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}
214
215void RegSelectorMapElement::selectionRobIdUint( double etaminIn, double etamaxIn,
216 double phiminIn, double phimaxIn,
217 std::set<uint32_t> &outset ) const {
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}
#define M_PI
This is a "hash" representation of an Identifier.
std::vector< double > m_phimax
std::vector< IdentifierHash > m_hashId
double etaMin(const IdentifierHash hashId) const
double etaMax(IdentifierHash hashId) const
std::vector< double > m_phimin
const std::vector< IdentifierHash > & hashId() const
void selection(double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::set< IdentifierHash > &outset) const
double phiMin(IdentifierHash hashId) const
void selectionRobIdUint(double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, std::set< uint32_t > &outset) const
double phiMax(IdentifierHash hashId) const
std::vector< uint32_t > m_robId
std::vector< double > m_etamax
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
void insertElementInVector(double etaminIn, double etamaxIn, double phiminIn, double phimaxIn, IdentifierHash hashIdIn, uint32_t robIdIn)
std::vector< double > m_etamin
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)