253{
254
255
256 bool doenergysplit = false;
257
258
259 bool validcell = true;
260
261
262 int towereta = -99;
263 int towerphi = -99;
264 int iETower = -99;
265 int iCell = -1;
266 int towerID_Modifier = -999999999;
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353 switch (sample) {
354
355 case CaloSampling::PreSamplerB: {
356
357
358
359
361
364
365 if(eta_index == 14){
366 if(pos_neg < 0){ towerID_Modifier = 300000; }
367 else if(pos_neg > 0){ towerID_Modifier = 400000; }
368 iCell = 0;
369 }
370 else{
371 if(pos_neg < 0){ towerID_Modifier = 100000; }
372 else if(pos_neg > 0){ towerID_Modifier = 200000; }
373 iCell = 0;
374 }
375
376 break;
377 }
378 case CaloSampling::EMB1:
379 case CaloSampling::EMB2: {
380
381
382
383
384
385
386
387
388 if (region == 0) {
391 if(pos_neg < 0){ towerID_Modifier = 100000; }
392 else if(pos_neg > 0){ towerID_Modifier = 200000; }
393 }
394 else if (region == 1){
395 towereta = 14;
397 if(pos_neg < 0){ towerID_Modifier = 300000; }
398 else if(pos_neg > 0){ towerID_Modifier = 400000; }
399 }
400 else {
401 ATH_MSG_DEBUG(
"[CaloSampling::EMB1 or CaloSampling::EMB2] -> invalid 'region' value: " << region <<
" (Under investigation) ");
402 }
403
404 switch(sample){
405 case CaloSampling::EMB1: {
408 break;
409 }
410 case CaloSampling::EMB2: {
411 if (region == 0) { iCell = (
eta_index % 4) + 5; }
412 else if (region == 1){ iCell = 5; }
414 break;
415 }
416 default: {
417 ATH_MSG_DEBUG(
"CaloSampling::EMBX -> invalid sample for assigning iCell value! " << sample <<
" (Under investigation) ");
418 break;
419 }
420 }
421
422 break;
423 }
424 case CaloSampling::EMB3: {
425
426
427
428
432
433 iCell = 9;
434
435 if(pos_neg < 0){ towerID_Modifier = 100000; }
436 else if(pos_neg > 0){ towerID_Modifier = 200000; }
437
438 break;
439 }
440
441 case CaloSampling::PreSamplerE: {
442
443
444
446
449
450 iCell = 0;
451
452 if(pos_neg < 0){ towerID_Modifier = 500000; }
453 else if(pos_neg > 0){ towerID_Modifier = 600000; }
454
455 break;
456 }
457 case CaloSampling::EME1: {
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
477
478 switch (region) {
479 case 0: {
480
483
484 iCell = 4;
485 break;
486 }
487 case 2: {
488
491
493 break;
494 }
495 case 3: {
496
497
500
502
503 if(iCell == 1){ iCell = 1; doenergysplit = false; }
504 else if( iCell == 2 ){ iCell = 1; doenergysplit = true; }
505 else if( iCell == 3 ){ iCell = 2; doenergysplit = false; }
506 else if( iCell == 4 ){ iCell = 3; doenergysplit = false; }
507 else if( iCell == 5 ){ iCell = 3; doenergysplit = true; }
508 else if( iCell == 6 ){ iCell = 4; doenergysplit = false; }
509
510 break;
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529 }
530 case 4: {
531
534
536 break;
537 }
538 case 5: {
539
542
543 iCell = 1;
544 break;
545 }
546 default: {
547
548 ATH_MSG_DEBUG(
"CaloSampling::EME1 -> invalid 'region' value: " << region <<
" (Under investigation) ");
549 break;
550 }
551 break;
552 }
553
554 if(region != 0){
555 if(pos_neg < 0){ towerID_Modifier = 500000; }
556 else if(pos_neg > 0){ towerID_Modifier = 600000; }
557 }
558 else if(region == 0){
559
560 if(pos_neg < 0){ towerID_Modifier = 300000; }
561 else if(pos_neg > 0){ towerID_Modifier = 400000; }
562 }
563
564 break;
565 }
566 case CaloSampling::EME2: {
567
568
569
570
571
572
573
574
575
576
577
579
580 switch (region) {
581 case 0: {
582
584
587
588 iCell = 9;
589
590 break;
591 }
592 case 1: {
593
596
598
599 break;
600 }
601 default: {
602 ATH_MSG_DEBUG(
"CaloSampling::EME2 -> invalid 'region' value: " << region <<
" (Under investigation) ");
603 break;
604 }
605 break;
606 }
607
608 if(region == 0){
609
610 if(pos_neg < 0){ towerID_Modifier = 300000; }
611 else if(pos_neg > 0){ towerID_Modifier = 400000; }
612 }
613 else {
614 if( (eta_index / 4) < 15 ){
615 if(pos_neg < 0){ towerID_Modifier = 300000; }
616 else if(pos_neg > 0){ towerID_Modifier = 400000; }
617 }
618 else{
619 if(pos_neg < 0){ towerID_Modifier = 500000; }
620 else if(pos_neg > 0){ towerID_Modifier = 600000; }
621 }
622 }
623
624 break;
625 }
626 case CaloSampling::EME3: {
627
628
629
630
631
632
633
634
635
637
638 switch (region) {
639 case 0: {
640
643
644 iCell = 9;
645
646 break;
647 }
648 default: {
649 ATH_MSG_DEBUG(
"CaloSampling::EME3 -> invalid 'region' value: " << region <<
" (Under investigation) ");
650 break;
651 }
652 break;
653 }
654
655 if(pos_neg < 0){ towerID_Modifier = 500000; }
656 else if(pos_neg > 0){ towerID_Modifier = 600000; }
657
658 break;
659 }
660
661 case CaloSampling::HEC0:
662 case CaloSampling::HEC1:
663 case CaloSampling::HEC2:
664 case CaloSampling::HEC3: {
665
666
667
668
669
670 switch(region){
671 case 0: {
672
675
677
678 switch (sample){
679 case CaloSampling::HEC0: { iCell = 10; break; }
680 case CaloSampling::HEC1: { iCell = 11; break; }
681 case CaloSampling::HEC2: { iCell = 12; break; }
682 case CaloSampling::HEC3: { iCell = 13; break; }
683
684 default: {
685 ATH_MSG_DEBUG(
"CaloSampling::HECX -> invalid sample for assigning iCell value! " << sample <<
" (Under investigation) ");
686 break;
687 }
688 }
689 break;
690
691 }
692 case 1: {
693 validcell = false;
694
695 break;
696 }
697 default: { break; }
698 }
699
700
701 if(pos_neg < 0){ towerID_Modifier = 500000; }
702 else if(pos_neg > 0){ towerID_Modifier = 600000; }
703
704 break;
705 }
706 case CaloSampling::TileBar0:
707 case CaloSampling::TileBar1:
708 case CaloSampling::TileBar2: {
710 validcell = false;
711
712 break;
713 }
714 case CaloSampling::TileGap1:
715 case CaloSampling::TileGap2:
716 case CaloSampling::TileGap3: {
717
718 validcell = false;
719 break;
720 }
721 case CaloSampling::TileExt0:
722 case CaloSampling::TileExt1:
723 case CaloSampling::TileExt2: {
724
725 validcell = false;
726 break;
727 }
728 case CaloSampling::FCAL0:
729 case CaloSampling::FCAL1:
730 case CaloSampling::FCAL2: {
731
732 validcell = false;
733 break;
734 }
735 case CaloSampling::MINIFCAL0:
736 case CaloSampling::MINIFCAL1:
737 case CaloSampling::MINIFCAL2:
738 case CaloSampling::MINIFCAL3: {
739
740 validcell = false;
741 break;
742 }
743 case CaloSampling::Unknown: {
744
745 validcell = false;
746 break;
747 }
748 default: {
749 ATH_MSG_DEBUG(
"\n==== eSuperCellTowerMapper ============ Supercell has invalid CaloSampling value: " << sample <<
" (Needs investigation). Please report this!");
750 validcell = false;
751 break;
752 }
753 }
754
755 if(validcell){
757
758
759
760 if (iETower < 200000 || (iETower > 300000 && iETower < 400000) || (iETower > 500000 && iETower < 600000)) {
761 if (layer == 1) {
762 iCell = 5 - iCell;
763 if (doenergysplit) iCell -= 1;
764 } else if (layer == 2) {
765 iCell = 13 - iCell;
766 }
767 }
768
769
770 int etaIndex = (iETower%100000)/64;
771 if (iETower > 500000 && etaIndex == 24 && iCell < 5) iCell = 0;
772
773 if(doPrint){
774 PrintCellSpec(sample, layer, region, eta_index, phi_index, pos_neg, iETower, iCell, prov, ID, doenergysplit);
775 }
777 }
778
779
780
781 return 1;
782
783 }
#define REPORT_MESSAGE_WITH_CONTEXT(LVL, CONTEXT_NAME)
Report a message, with an explicitly specified context name.
virtual void PrintCellSpec(const CaloSampling::CaloSample sample, int layer, const int region, const int eta_index, const int phi_index, const int pos_neg, int iETower, int iCell, int prov, Identifier ID, bool doenergysplit) const override