163{
164
165 bool validcell = true;
166
167
168 int nphi = -1;
169 int towereta = -99;
170 int towerphi = -99;
171 int iGTower = -99;
172 int towerID_Modifier = -999999999;
173
174
175
176
177
178
179
180
181 switch (sample) {
182
183 case CaloSampling::PreSamplerB: {
184
187
188 nphi = 32;
189
190 if(eta_index == 14){
191 if(pos_neg < 0){ towerID_Modifier = 300000; }
192 else if(pos_neg > 0){ towerID_Modifier = 400000; }
193 }
194 else{
195 if(pos_neg < 0){ towerID_Modifier = 100000; }
196 else if(pos_neg > 0){ towerID_Modifier = 200000; }
197 }
198
199 break;
200 }
201 case CaloSampling::EMB1:
202 case CaloSampling::EMB2: {
203
204 nphi = 32;
205
206 if (region == 0) {
209 if(pos_neg < 0){ towerID_Modifier = 100000; }
210 else if(pos_neg > 0){ towerID_Modifier = 200000; }
211 }
212 else if (region == 1){
213 towereta = 7;
215 if(pos_neg < 0){ towerID_Modifier = 300000; }
216 else if(pos_neg > 0){ towerID_Modifier = 400000; }
217 }
218 else {
219 ATH_MSG_DEBUG(
"[CaloSampling::EMB1 or CaloSampling::EMB2] -> invalid 'region' value: " << region <<
" (Under investigation) ");
220 }
221
222 switch(sample){
223 case CaloSampling::EMB1: {
224 break;
225 }
226 case CaloSampling::EMB2: {
227 break;
228 }
229 default: {
230 ATH_MSG_DEBUG(
"CaloSampling::EMBX -> invalid sample for assigning iCell value! " << sample <<
" (Under investigation) ");
231 break;
232 }
233 }
234
235 break;
236 }
237 case CaloSampling::EMB3: {
238
239 nphi = 32;
242
243
244 if(pos_neg < 0){ towerID_Modifier = 100000; }
245 else if(pos_neg > 0){ towerID_Modifier = 200000; }
246
247 break;
248 }
249
250 case CaloSampling::PreSamplerE: {
251
252 nphi = 32;
253
254 if (eta_index < 1) {towereta = 7;}
255 else {towereta = 8;}
257
258
259 if (towereta == 7){
260 if(pos_neg < 0){ towerID_Modifier = 300000; }
261 else if(pos_neg > 0){ towerID_Modifier = 400000; }
262 }
263 else if (towereta != 7){
264 if(pos_neg < 0){ towerID_Modifier = 500000; }
265 else if(pos_neg > 0){ towerID_Modifier = 600000; }
266 }
267
268 break;
269 }
270 case CaloSampling::EME1: {
271
272 nphi = 32;
273
274 switch (region) {
275 case 0: {
276
277 towereta = 7;
279
280 break;
281 }
282 case 2: {
283
284 if (eta_index < 4) {towereta = 7;}
285 else {towereta = 8;}
287
288 break;
289 }
290 case 3: {
291
292 if (eta_index < 11) {towereta = 8;}
293 else {towereta = 9;}
295 break;
296
297 }
298 case 4: {
299
300 if (eta_index < 8) {towereta = 10;}
301 else {towereta = 11;}
303
304 break;
305 }
306 case 5: {
307
308 towereta = 11 ;
310
311 break;
312 }
313 default: {
314 ATH_MSG_DEBUG(
"CaloSampling::EME1 -> invalid 'region' value: " << region <<
" (Under investigation) ");
315 break;
316 }
317 break;
318 }
319
320 if (towereta == 7){
321 if(pos_neg < 0){ towerID_Modifier = 300000; }
322 else if(pos_neg > 0){ towerID_Modifier = 400000; }
323 }
324 else if (towereta != 7){
325 if(pos_neg < 0){ towerID_Modifier = 500000; }
326 else if(pos_neg > 0){ towerID_Modifier = 600000; }
327 }
328
329 break;
330 }
331 case CaloSampling::EME2: {
332
333 nphi = 32;
334
335 switch (region) {
336 case 0: {
337
338 if(abs(pos_neg) == 2){
339 towereta = 7;
341 }
342 else if(abs(pos_neg) == 3){
343 if (eta_index == 0){
344 towereta = 12;
346 }
347 else if (eta_index == 1){
348 towereta = 13;
350 }
351 else if (eta_index == 2){
352 towereta = 14;
354 }
355 }
356 break;
357 }
358 case 1: {
359 if(abs(pos_neg) == 2){
361 if (eta_index < 7) {towereta = 7;}
362 else if (eta_index < 15) {towereta = 8;}
363 else if (eta_index < 23) {towereta = 9;}
364 else if (eta_index < 31) {towereta = 10;}
365 else if (eta_index < 43) {towereta = 11;}
366 }
367 else if(abs(pos_neg) == 3){
369 towereta = 15;
370 }
371 break;
372 }
373
374 default: {
375 ATH_MSG_DEBUG(
"CaloSampling::EME2 -> invalid 'region' value: " << region <<
" (Under investigation) ");
376 break;
377 }
378 break;
379 }
380
381 if (towereta == 7){
382 if(pos_neg < 0){ towerID_Modifier = 300000; }
383 else if(pos_neg > 0){ towerID_Modifier = 400000; }
384 }
385 else if (towereta == 12 || towereta == 13 || towereta == 14 || towereta == 15){
386 if(pos_neg < 0){ towerID_Modifier = 700000; }
387 else if(pos_neg > 0){ towerID_Modifier = 800000; }
388 }
389 else {
390 if(pos_neg < 0){ towerID_Modifier = 500000; }
391 else if(pos_neg > 0){ towerID_Modifier = 600000; }
392 }
393
394 break;
395 }
396 case CaloSampling::EME3: {
397
398 nphi = 32;
399 switch (region) {
400 case 0: {
401 if(abs(pos_neg) == 2){
403 if (eta_index == 0){
404 towereta = 7;
405 }
406 else if(eta_index < 3){
407 towereta = 8;
408 }
409 else if(eta_index < 5){
410 towereta = 9;
411 }
412 else if(eta_index < 7){
413 towereta = 10;
414 }
415 else if(eta_index < 10){
416 towereta = 11;
417 }
418
419 }
420 else if(abs(pos_neg) == 3){
421 if (eta_index == 0){
422 towereta = 12;
424 }
425 else if (eta_index == 1){
426 towereta = 13;
428 }
429 else if (eta_index == 2){
430 towereta = 14;
432 }
433 }
434 break;
435 }
436 case 1: {
438 towereta = 15;
439 break;
440 }
441 default: {
442 ATH_MSG_DEBUG(
"CaloSampling::EME3 -> invalid 'region' value: " << region <<
" (Under investigation) ");
443 break;
444 }
445 break;
446 }
447
448 if (towereta == 7){
449 if(pos_neg < 0){ towerID_Modifier = 300000; }
450 else if(pos_neg > 0){ towerID_Modifier = 400000; }
451 }
452 else if (towereta == 12 || towereta == 13 || towereta == 14 || towereta == 15){
453 if(pos_neg < 0){ towerID_Modifier = 700000; }
454 else if(pos_neg > 0){ towerID_Modifier = 800000; }
455 }
456 else {
457 if(pos_neg < 0){ towerID_Modifier = 500000; }
458 else if(pos_neg > 0){ towerID_Modifier = 600000; }
459 }
460 break;
461 }
462
463 case CaloSampling::HEC0:{
464 nphi = 32;
465 switch(region){
466 case 0: {
467 if(abs(pos_neg) == 2){
469 if (eta_index == 0){
470 towereta = 7;
471 }
472 else if(eta_index < 3){
473 towereta = 8;
474 }
475 else if(eta_index < 5){
476 towereta = 9;
477 }
478 else if(eta_index < 7){
479 towereta = 10;
480 }
481 else if(eta_index < 10){
482 towereta = 11;
483 }
484 }
485 break;
486
487 }
488
489 case 1: {
490 if(abs(pos_neg) == 2){
491 if (eta_index == 0){
492 towereta = 12;
494 }
495 else if(eta_index == 1){
496 towereta = 13;
498 }
499 else if(eta_index == 2){
500 towereta = 14;
502 }
503 else if(eta_index == 3){
504 towereta = 15;
506 }
507 }
508 break;
509
510 }
511
512 default: {
513 ATH_MSG_DEBUG(
"CaloSampling::HEC0 -> invalid 'region' value: " << region <<
" (Under investigation) ");
514 break;
515 }
516
517 }
518
519
520 if (towereta == 7){
521 nphi = 32;
522 if(pos_neg < 0){ towerID_Modifier = 300000; }
523 else if(pos_neg > 0){ towerID_Modifier = 400000; }
524 }
525 else if (towereta == 12 || towereta == 13 || towereta == 14 || towereta == 15){
526 if(pos_neg < 0){ towerID_Modifier = 700000; }
527 else if(pos_neg > 0){ towerID_Modifier = 800000; }
528 }
529 else {
530 nphi = 32;
531 if(pos_neg < 0){ towerID_Modifier = 500000; }
532 else if(pos_neg > 0){ towerID_Modifier = 600000; }
533 }
534
535 break;
536 }
537 case CaloSampling::TileBar0:
538 case CaloSampling::TileBar1:
539 case CaloSampling::TileBar2: {
541 validcell = false;
542 ATH_MSG_DEBUG(
"\n==== gSuperCellTowerMapper ============ Supercell is from Tile Barrel - it will be ignored.");
543 break;
544 }
545 case CaloSampling::TileGap1:
546 case CaloSampling::TileGap2:
547 case CaloSampling::TileGap3: {
548 ATH_MSG_DEBUG(
"\n==== gSuperCellTowerMapper ============ Supercell is from Tile Gap (ITC and scintillator) - it will be ignored.");
549 validcell = false;
550 break;
551 }
552 case CaloSampling::TileExt0:
553 case CaloSampling::TileExt1:
554 case CaloSampling::TileExt2: {
555 ATH_MSG_DEBUG(
"\n==== gSuperCellTowerMapper ============ Supercell is from Tile Extended Barrel - it will be ignored.");
556 validcell = false;
557 break;
558 }
559 case CaloSampling::FCAL0:{
560 nphi = 16;
562 if(eta_index < 5){
563 towereta = 16;
564 }
565 else if(eta_index < 8){
566 towereta = 17;
567 }
568 else if(eta_index < 10){
569 towereta = 18;
570 }
571 else if(eta_index < 12){
572 towereta = 19;
573 }
574
575 if(pos_neg < 0){ towerID_Modifier = 900000; }
576 else if(pos_neg > 0){ towerID_Modifier = 1000000; }
577
578 break;
579 }
580 case CaloSampling::FCAL1:{
581 nphi = 16;
583 if (eta_index < 4){
584 towereta = 16;
585 }
586 else if(eta_index < 6){
587 towereta = 17;
588 }
589 else if(eta_index < 7){
590 towereta = 18;
591 }
592 else if(eta_index < 8){
593 towereta = 19;
594 }
595
596 if(pos_neg < 0){ towerID_Modifier = 900000; }
597 else if(pos_neg > 0){ towerID_Modifier = 1000000; }
598
599 break;
600 }
601 case CaloSampling::FCAL2:{
602 nphi = 16;
604 if (eta_index < 1){
605 towereta = 16;
606 }
607 else if(eta_index < 3){
608 towereta = 17;
609 }
610 else if(eta_index < 4){
611 towereta = 18;
612 }
613
614 if(pos_neg < 0){ towerID_Modifier = 900000; }
615 else if(pos_neg > 0){ towerID_Modifier = 1000000; }
616 break;
617 }
618
619
620 case CaloSampling::MINIFCAL0:
621 case CaloSampling::MINIFCAL1:
622 case CaloSampling::MINIFCAL2:
623 case CaloSampling::MINIFCAL3: {
624 ATH_MSG_DEBUG(
"\n==== gSuperCellTowerMapper ============ Supercells is from MiniFCAL - it will be ignored.");
625 validcell = false;
626 break;
627 }
628 case CaloSampling::Unknown: {
629 ATH_MSG_WARNING(
"\n==== gSuperCellTowerMapper ============ Supercell sampling is officially unknown - it will be ignored. (Needs investigation). Please report this!");
630 validcell = false;
631 break;
632 }
633 default: {
634 ATH_MSG_DEBUG(
"\n==== gSuperCellTowerMapper ============ Supercell has invalid CaloSampling value: " << sample <<
" (Needs investigation). Please report this!");
635 validcell = false;
636 break;
637 }
638 }
639
640 if(validcell){
642 if(doPrint){
643 PrintCellSpec(sample, region, eta_index, phi_index, pos_neg, towereta, towerphi, nphi, towerID_Modifier, iGTower, prov,
ID);
644 }
646 }
647
648
649
650 return 1;
651
652}
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
virtual void PrintCellSpec(const CaloSampling::CaloSample sample, const int region, const int eta_index, const int phi_index, const int pos_neg, int towereta, int towerphi, int nphi, int towerID_Modifier, int iGTower, int prov, Identifier ID) const override
virtual void ConnectSuperCellToTower(std::unique_ptr< gTowerContainer > &my_gTowerContainerRaw, int iGTower, Identifier ID, float et) const override