296{
297
298
299 bool doenergysplit = false;
300
301
302 bool validcell = true;
303
304
305 int towereta = -99;
306 int towerphi = -99;
307 int iJTower = -99;
308 int iCell = -1;
309 int towerID_Modifier = -999999999;
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
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395 switch (sample) {
396
397 case CaloSampling::PreSamplerB: {
398
399
400
401
403
406
407 if(eta_index == 14) {
408 if(pos_neg < 0) {
409 towerID_Modifier = 300000;
410 }
411 else if(pos_neg > 0) {
412 towerID_Modifier = 400000;
413 }
414 iCell = 0;
415 }
416 else {
417 if(pos_neg < 0) {
418 towerID_Modifier = 100000;
419 }
420 else if(pos_neg > 0) {
421 towerID_Modifier = 200000;
422 }
423 iCell = 0;
424 }
425
426 break;
427 }
428 case CaloSampling::EMB1:
429 case CaloSampling::EMB2: {
430
431
432
433
434
435
436
437
438 if (region == 0) {
441 if(pos_neg < 0) {
442 towerID_Modifier = 100000;
443 }
444 else if(pos_neg > 0) {
445 towerID_Modifier = 200000;
446 }
447 }
448 else if (region == 1) {
449 towereta = 14;
451 if(pos_neg < 0) {
452 towerID_Modifier = 300000;
453 }
454 else if(pos_neg > 0) {
455 towerID_Modifier = 400000;
456 }
457 }
458 else {
459 ATH_MSG_DEBUG(
"[CaloSampling::EMB1 or CaloSampling::EMB2] -> invalid 'region' value: " << region <<
" (Under investigation) ");
460 }
461
462 switch(sample) {
463 case CaloSampling::EMB1: {
464 iCell = 0;
466 break;
467 }
468 case CaloSampling::EMB2: {
469
470
471 iCell = 0;
473 break;
474 }
475 default: {
476 ATH_MSG_DEBUG(
"CaloSampling::EMBX -> invalid sample for assigning iCell value! " << sample <<
" (Under investigation) ");
477 break;
478 }
479 }
480
481 break;
482 }
483 case CaloSampling::EMB3: {
484
485
486
487
491
492 iCell = 0;
493
494 if(pos_neg < 0) {
495 towerID_Modifier = 100000;
496 }
497 else if(pos_neg > 0) {
498 towerID_Modifier = 200000;
499 }
500
501 break;
502 }
503
504 case CaloSampling::PreSamplerE: {
505
506
507
509
512
513 iCell = 0;
514
515 if(pos_neg < 0) {
516 towerID_Modifier = 500000;
517 }
518 else if(pos_neg > 0) {
519 towerID_Modifier = 600000;
520 }
521
522 break;
523 }
524 case CaloSampling::EME1: {
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
544
545 switch (region) {
546 case 0: {
547
550
551 iCell = 0;
552 break;
553 }
554 case 2: {
555
558
559
560 iCell = 0;
561 break;
562 }
563 case 3: {
564
565
568
569
570 iCell = 0;
571
572
573
574
575
576
577
578
579
580
581 break;
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600 }
601 case 4: {
602
605
606
607 iCell = 0;
608 break;
609 }
610 case 5: {
611
614
615
616 iCell = 0;
617 break;
618 }
619 default: {
620 ATH_MSG_DEBUG(
"CaloSampling::EME1 -> invalid 'region' value: " << region <<
" (Under investigation) ");
621 break;
622 }
623 break;
624 }
625
626 if(region != 0) {
627 if(pos_neg < 0) {
628 towerID_Modifier = 500000;
629 }
630 else if(pos_neg > 0) {
631 towerID_Modifier = 600000;
632 }
633 }
634 else if(region == 0) {
635
636 if(pos_neg < 0) {
637 towerID_Modifier = 300000;
638 }
639 else if(pos_neg > 0) {
640 towerID_Modifier = 400000;
641 }
642 }
643
644 break;
645 }
646 case CaloSampling::EME2: {
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
673
674 switch (region) {
675 case 0: {
676
677
679
680 switch (std::abs(pos_neg)) {
681 case 2: {
684 break;
685 }
686 case 3: {
689 break;
690 }
691 default: {
692 ATH_MSG_DEBUG(
"CaloSampling::EME2 -> invalid 'pos_neg' value: " << pos_neg <<
" (Under investigation) ");
693 break;
694 }
695 }
696
697 iCell = 0;
698
699 break;
700 }
701 case 1: {
702
703 switch (std::abs(pos_neg)) {
704 case 2: {
707 break;
708 }
709 case 3: {
712 break;
713 }
714 default: {
715 ATH_MSG_DEBUG(
"CaloSampling::EME2 -> invalid 'pos_neg' value: " << pos_neg <<
" (Under investigation) ");
716 break;
717 }
718 }
719
720
721 iCell = 0;
722
723 break;
724 }
725 default: {
726 ATH_MSG_DEBUG(
"CaloSampling::EME2 -> invalid 'region' value: " << region <<
" (Under investigation) ");
727 break;
728 }
729 break;
730 }
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775 if(region == 0) {
776 if(eta0 < 2.5) {
777 if(pos_neg < 0) {
778 towerID_Modifier = 300000;
779 }
780 else if(pos_neg > 0) {
781 towerID_Modifier = 400000;
782 }
783 }
784 else {
785 if(pos_neg < 0) {
786 towerID_Modifier = 500000;
787 }
788 else if(pos_neg > 0) {
789 towerID_Modifier = 600000;
790 }
791 }
792 }
793 else {
794 if(eta0 <= 1.5) {
795 if(towereta < 15) {
796 if(pos_neg < 0 && pos_neg > -3) {
797 towerID_Modifier = 300000;
798 }
799 else if(pos_neg > 0 && pos_neg < 3) {
800 towerID_Modifier = 400000;
801 }
802 }
803 else {
804 if(pos_neg < 0 && pos_neg >= -3) {
805 towerID_Modifier = 500000;
806 }
807 else if(pos_neg > 0 && pos_neg <= 3) {
808 towerID_Modifier = 600000;
809 }
810 }
811 }
812 else {
813 if(pos_neg < 0) {
814 towerID_Modifier = 500000;
815 }
816 else if(pos_neg > 0) {
817 towerID_Modifier = 600000;
818 }
819 }
820 }
821
822
823 break;
824 }
825 case CaloSampling::EME3: {
826
827
828
829
830
831
832
834
835
836
837
838
839
840
841
842
843
844
845
846
848
849 switch (region) {
850 case 0: {
851
854
855 iCell = 0;
856
857 break;
858 }
859 case 1: {
862 iCell = 0;
863 break;
864 }
865 default: {
866 ATH_MSG_DEBUG(
"CaloSampling::EME3 -> invalid 'region' value: " << region <<
" (Under investigation) ");
867 break;
868 }
869 break;
870 }
871
872 if(pos_neg < 0) {
873 towerID_Modifier = 500000;
874 }
875 else if(pos_neg > 0) {
876 towerID_Modifier = 600000;
877 }
878
879 break;
880 }
881
882 case CaloSampling::HEC0:
883 case CaloSampling::HEC1:
884 case CaloSampling::HEC2:
885 case CaloSampling::HEC3: {
886
887
888
889
890
891
894
896 iCell = 1;
897 switch(region) {
898 case 0: {
899
902
904 iCell = 1;
905
906 break;
907
908 }
909 case 1: {
910
913
915 iCell = 1;
916
917 break;
918
919 }
920 default: {
921 break;
922 }
923 }
924
925 if(pos_neg < 0) {
926 towerID_Modifier = 500000;
927 }
928 else if(pos_neg > 0) {
929 towerID_Modifier = 600000;
930 }
931
932 break;
933 }
934 case CaloSampling::TileBar0:
935 case CaloSampling::TileBar1:
936 case CaloSampling::TileBar2: {
937
938 validcell = false;
939
940 ATH_MSG_DEBUG(
"\n==== jSuperCellTowerMapper ============ Supercell is from Tile Barrel - it will be ignored.");
941 break;
942 }
943 case CaloSampling::TileGap1:
944 case CaloSampling::TileGap2:
945 case CaloSampling::TileGap3: {
946 ATH_MSG_DEBUG(
"\n==== jSuperCellTowerMapper ============ Supercell is from Tile Gap (ITC and scintillator) - it will be ignored.");
947
948 validcell = false;
949 break;
950 }
951 case CaloSampling::TileExt0:
952 case CaloSampling::TileExt1:
953 case CaloSampling::TileExt2: {
954 ATH_MSG_DEBUG(
"\n==== jSuperCellTowerMapper ============ Supercell is from Tile Extended Barrel - it will be ignored.");
955
956 validcell = false;
957 break;
958 }
959 case CaloSampling::FCAL0:
960 case CaloSampling::FCAL1:
961 case CaloSampling::FCAL2: {
962
963
964
965
966 switch (sample) {
967 case CaloSampling::FCAL0: {
968 if(pos_neg < 0) {
969 towerID_Modifier = 700000;
970 }
971 else if(pos_neg > 0) {
972 towerID_Modifier = 800000;
973 }
974 iCell = 0;
976 break;
977 }
978 case CaloSampling::FCAL1: {
979 if(pos_neg < 0) {
980 towerID_Modifier = 900000;
981 }
982 else if(pos_neg > 0) {
983 towerID_Modifier = 1000000;
984 }
985 iCell = 1;
987 break;
988 }
989 case CaloSampling::FCAL2: {
990 if(pos_neg < 0) {
991 towerID_Modifier = 1100000;
992 }
993 else if(pos_neg > 0) {
994 towerID_Modifier = 1200000;
995 }
996 iCell = 1;
998 break;
999 }
1000 default: {
1001 break;
1002 }
1003 }
1004
1007
1008 break;
1009
1010 }
1011 case CaloSampling::MINIFCAL0:
1012 case CaloSampling::MINIFCAL1:
1013 case CaloSampling::MINIFCAL2:
1014 case CaloSampling::MINIFCAL3: {
1015 ATH_MSG_DEBUG(
"\n==== jSuperCellTowerMapper ============ Supercells is from MiniFCAL - it will be ignored.");
1016 validcell = false;
1017 break;
1018 }
1019 case CaloSampling::Unknown: {
1020 ATH_MSG_WARNING(
"\n==== jSuperCellTowerMapper ============ Supercell sampling is officially unknown - it will be ignored. (Needs investigation). Please report this!");
1021 validcell = false;
1022 break;
1023 }
1024 default: {
1025 ATH_MSG_DEBUG(
"\n==== jSuperCellTowerMapper ============ Supercell has invalid CaloSampling value: " << sample <<
" (Needs investigation). Please report this!");
1026 validcell = false;
1027 break;
1028 }
1029 }
1030
1031
1032 if(validcell) {
1034
1035
1037
1039 }
1040 if(doPrint) {
1041 PrintCellSpec(sample, layer, region, eta_index, phi_index, pos_neg, iJTower, iCell, prov,
ID, doenergysplit, eta_min, eta_max, eta0, phi_min, phi_max, phi0);
1042 }
1044
1045
1046 }
1047 else {
1048 PrintCellSpec(sample, layer, region, eta_index, phi_index, pos_neg, iJTower, iCell, prov,
ID, doenergysplit, eta_min, eta_max, eta0, phi_min, phi_max, phi0,
false);
1049 }
1050
1051
1052
1053 return 1;
1054}
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, float eta_min, float eta_max, float eta0, float phi_min, float phi_max, float phi0, bool cellValid=true) const override
virtual void ConnectSuperCellToTower(std::unique_ptr< jTowerContainer > &my_jTowerContainerRaw, int iETower, Identifier ID, int iCell, float et, int layer) const override
Gaudi::Property< bool > m_apply_masking