80 {
81
82
84
85
86
87
88
89
90
91 cout << "======================================" <<endl;
92 cout << " BARREL ELEMENTS - access via index" << endl;
93 cout << "======================================" <<endl;
94 cout << endl;
95
96 const TRT_Numerology * numerology=
m_manager->getNumerology();
97
100
101 for (int iSide = 0; iSide < 2; iSide++) {
102 for (unsigned int iLayer = 0; iLayer != nBarrelRings; iLayer++) {
104 for (unsigned int iPhiModule = 0; iPhiModule != nBarrelPhi; iPhiModule++) {
105 for (unsigned int iStrawLayer = 0; iStrawLayer !=nBarrelLayers; iStrawLayer++) {
106 cout << "Barrel element " << iSide << ", " << iLayer << ", " << iPhiModule << ", "<< iStrawLayer << endl;
107 const TRT_BarrelElement *element =
m_manager->getBarrelElement(iSide, iLayer, iPhiModule, iStrawLayer);
108
109 Identifier newId = idHelper->
layer_id((iSide ? 1:-1), iPhiModule, iLayer, iStrawLayer);
110 idHelper->
show(newId);
112 cout << "idHash = " << idHash << endl;
113 if (element) {
115 cout << " center = " << center << endl;
116
117 cout <<
" number of straws = " << element->
nStraws() << endl;
118
119 if ((iPhiModule == 0) || (iPhiModule == 1) || (iPhiModule == 7) || (iPhiModule == 31)) {
120 for (unsigned int istraw = 0; istraw < 15; istraw++) {
122
123 }
124 }
125
126 for (
unsigned int istraw = 0; istraw < element->
nStraws(); istraw++) {
128 }
129 } else {
130 cout << "No Element found " << endl;
131 }
132 }
133 }
134 }
135 }
136
137
138
139 cout << "======================================" <<endl;
140 cout << " ENDCAP ELEMENTS - access via index" << endl;
141 cout << "======================================" <<endl;
142 cout << endl;
145 for (int iSide = 0; iSide < 2; iSide++) {
146 for (unsigned int iWheel = 0; iWheel !=nWheels ; iWheel++) {
148 for (unsigned int iStrawLayer = 0; iStrawLayer != nEndcapLayers; iStrawLayer++){
149 for(
unsigned int iPhi = 0;
iPhi != nEndcapPhi;
iPhi++){
150 cout <<
"Endcap element " << iSide <<
", "<< iWheel <<
", "<< iStrawLayer <<
", "<<
iPhi << endl;
151 const TRT_EndcapElement * element =
m_manager->getEndcapElement(iSide, iWheel, iStrawLayer, iPhi);
152
153
154 Identifier newId = idHelper->
layer_id((iSide ? 2:-2), iPhi, iWheel, iStrawLayer);
155 idHelper->
show(newId);
157 cout << "idHash = " << idHash << endl;
158
159 if (element) {
161 cout << " center = " << center << endl;
162 cout <<
" number of straws = " << element->
nStraws() << endl;
163
164 int iPhiModule =
iPhi;
165 if ((iPhiModule == 0) || (iPhiModule == 1) || (iPhiModule == 7) || (iPhiModule == 31)) {
166 for (unsigned int istraw = 0; istraw < 15; istraw++) {
168
169 }
170 }
171
172 for (
unsigned int istraw = 0; istraw < element->
nStraws(); istraw++) {
174 }
175 } else {
176 cout << "No Element found " << endl;
177 }
178 }
179 }
180 }
181 }
182
183
184
186
187
188
189
190
191
192 cout << "======================================" <<endl;
193 cout << " ALL ELEMENTS - access via hash" << endl;
194 cout << "======================================" <<endl;
195 cout << endl;
196
197 cout << " maxHash = " << maxHash << endl;
198
199 for (
unsigned int index = 0;
index < maxHash;
index++) {
200
201 IdentifierHash idHash =
index;
202
203 Identifier
id = idHelper->
layer_id(idHash);
205
206 const TRT_BaseElement * element;
207
209
210 if (element) {
212 cout << " center = " << center << endl;
213 } else {
214 cout << "No Element with id hash = " << idHash << endl;
215 }
216 }
217
218
219 cout << "======================================" <<endl;
220 cout << " ALL ELEMENTS - access via index from hash" << endl;
221 cout << " (no printout) " << endl;
222 cout << "======================================" <<endl;
223 cout << endl;
for (
unsigned int index = 0;
index < maxHash;
index++) {
224
225 IdentifierHash idHash =
index;
226
227 Identifier
id = idHelper->
layer_id(idHash);
228
229
230
231 int idBarrelEndcap = idHelper->
barrel_ec(
id);
232 int idSide = (idBarrelEndcap > 0);
236
237
238
239
240
241
242 const TRT_BaseElement * element;
243
244
246 element =
m_manager->getBarrelElement(idSide, idLayerWheel, idPhiModule, idStrawLayer);
247 } else {
248 element =
m_manager->getEndcapElement(idSide, idLayerWheel, idStrawLayer, idPhiModule);
249 }
250
251 if (element) {
252
253
254
255 } else {
256 cout << "No Element with id hash = " << idHash << endl;
257 }
258 }
259
260 cout << endl;
261
262 cout <<
"Max diff = " <<
m_maxdiff << endl;
263
264}
void show(Identifier id, const IdContext *context=0, char sep='.') const
Short print out of any identifier (optionally provide separation character - default is '.
unsigned int getNEndcapWheels() const
unsigned int getNEndcapPhi() const
unsigned int getNBarrelPhi() const
unsigned int getNBarrelRings() const
unsigned int getNBarrelLayers(unsigned int iMod) const
unsigned int getNEndcapLayers(unsigned int iWheel) const
void compareEndcapStraw(const InDetDD::TRT_EndcapElement *element, const unsigned int strawNum)
void compareBarrelStraw(const InDetDD::TRT_BarrelElement *element, const unsigned int strawNum)
int phi_module(const Identifier &id) const
Identifier layer_id(int barrel_ec, int phi_module, int layer_or_wheel, int straw_layer) const
For an individual straw layer.
size_type straw_layer_hash_max() const
bool is_barrel(const Identifier &id) const
Test for barrel.
int barrel_ec(const Identifier &id) const
Values of different levels (failure returns 0)
IdentifierHash straw_layer_hash(Identifier straw_layer_id) const
straw_layer hash from id - optimized
int layer_or_wheel(const Identifier &id) const
int straw_layer(const Identifier &id) const