250{
251
252
253 bool doenergysplit = false;
254
255
256 bool validcell = true;
257
258
259 int towereta = -99;
260 int towerphi = -99;
261 int iETower = -99;
262 int iCell = -1;
263 int towerID_Modifier = -999999999;
264
265
266
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 switch (sample) {
351
352 case CaloSampling::PreSamplerB: {
353
354
355
356
358
361
362 if(eta_index == 14){
363 if(pos_neg < 0){ towerID_Modifier = 300000; }
364 else if(pos_neg > 0){ towerID_Modifier = 400000; }
365 iCell = 0;
366 }
367 else{
368 if(pos_neg < 0){ towerID_Modifier = 100000; }
369 else if(pos_neg > 0){ towerID_Modifier = 200000; }
370 iCell = 0;
371 }
372
373 break;
374 }
375 case CaloSampling::EMB1:
376 case CaloSampling::EMB2: {
377
378
379
380
381
382
383
384
385 if (region == 0) {
388 if(pos_neg < 0){ towerID_Modifier = 100000; }
389 else if(pos_neg > 0){ towerID_Modifier = 200000; }
390 }
391 else if (region == 1){
392 towereta = 14;
394 if(pos_neg < 0){ towerID_Modifier = 300000; }
395 else if(pos_neg > 0){ towerID_Modifier = 400000; }
396 }
397 else {
398 ATH_MSG_DEBUG(
"[CaloSampling::EMB1 or CaloSampling::EMB2] -> invalid 'region' value: " << region <<
" (Under investigation) ");
399 }
400
401 switch(sample){
402 case CaloSampling::EMB1: {
405 break;
406 }
407 case CaloSampling::EMB2: {
408 if (region == 0) { iCell = (
eta_index % 4) + 5; }
409 else if (region == 1){ iCell = 5; }
411 break;
412 }
413 default: {
414 ATH_MSG_DEBUG(
"CaloSampling::EMBX -> invalid sample for assigning iCell value! " << sample <<
" (Under investigation) ");
415 break;
416 }
417 }
418
419 break;
420 }
421 case CaloSampling::EMB3: {
422
423
424
425
429
430 iCell = 9;
431
432 if(pos_neg < 0){ towerID_Modifier = 100000; }
433 else if(pos_neg > 0){ towerID_Modifier = 200000; }
434
435 break;
436 }
437
438 case CaloSampling::PreSamplerE: {
439
440
441
443
446
447 iCell = 0;
448
449 if(pos_neg < 0){ towerID_Modifier = 500000; }
450 else if(pos_neg > 0){ towerID_Modifier = 600000; }
451
452 break;
453 }
454 case CaloSampling::EME1: {
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
474
475 switch (region) {
476 case 0: {
477
480
481 iCell = 4;
482 break;
483 }
484 case 2: {
485
488
490 break;
491 }
492 case 3: {
493
494
497
499
500 if(iCell == 1){ iCell = 1; doenergysplit = false; }
501 else if( iCell == 2 ){ iCell = 1; doenergysplit = true; }
502 else if( iCell == 3 ){ iCell = 2; doenergysplit = false; }
503 else if( iCell == 4 ){ iCell = 3; doenergysplit = false; }
504 else if( iCell == 5 ){ iCell = 3; doenergysplit = true; }
505 else if( iCell == 6 ){ iCell = 4; doenergysplit = false; }
506
507 break;
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526 }
527 case 4: {
528
531
533 break;
534 }
535 case 5: {
536
539
540 iCell = 1;
541 break;
542 }
543 default: {
544
545 ATH_MSG_DEBUG(
"CaloSampling::EME1 -> invalid 'region' value: " << region <<
" (Under investigation) ");
546 break;
547 }
548 break;
549 }
550
551 if(region != 0){
552 if(pos_neg < 0){ towerID_Modifier = 500000; }
553 else if(pos_neg > 0){ towerID_Modifier = 600000; }
554 }
555 else if(region == 0){
556
557 if(pos_neg < 0){ towerID_Modifier = 300000; }
558 else if(pos_neg > 0){ towerID_Modifier = 400000; }
559 }
560
561 break;
562 }
563 case CaloSampling::EME2: {
564
565
566
567
568
569
570
571
572
573
574
576
577 switch (region) {
578 case 0: {
579
581
584
585 iCell = 9;
586
587 break;
588 }
589 case 1: {
590
593
595
596 break;
597 }
598 default: {
599 ATH_MSG_DEBUG(
"CaloSampling::EME2 -> invalid 'region' value: " << region <<
" (Under investigation) ");
600 break;
601 }
602 break;
603 }
604
605 if(region == 0){
606
607 if(pos_neg < 0){ towerID_Modifier = 300000; }
608 else if(pos_neg > 0){ towerID_Modifier = 400000; }
609 }
610 else {
611 if( (eta_index / 4) < 15 ){
612 if(pos_neg < 0){ towerID_Modifier = 300000; }
613 else if(pos_neg > 0){ towerID_Modifier = 400000; }
614 }
615 else{
616 if(pos_neg < 0){ towerID_Modifier = 500000; }
617 else if(pos_neg > 0){ towerID_Modifier = 600000; }
618 }
619 }
620
621 break;
622 }
623 case CaloSampling::EME3: {
624
625
626
627
628
629
630
631
632
634
635 switch (region) {
636 case 0: {
637
640
641 iCell = 9;
642
643 break;
644 }
645 default: {
646 ATH_MSG_DEBUG(
"CaloSampling::EME3 -> invalid 'region' value: " << region <<
" (Under investigation) ");
647 break;
648 }
649 break;
650 }
651
652 if(pos_neg < 0){ towerID_Modifier = 500000; }
653 else if(pos_neg > 0){ towerID_Modifier = 600000; }
654
655 break;
656 }
657
658 case CaloSampling::HEC0:
659 case CaloSampling::HEC1:
660 case CaloSampling::HEC2:
661 case CaloSampling::HEC3: {
662
663
664
665
666
667 switch(region){
668 case 0: {
669
672
674
675 switch (sample){
676 case CaloSampling::HEC0: { iCell = 10; break; }
677 case CaloSampling::HEC1: { iCell = 11; break; }
678 case CaloSampling::HEC2: { iCell = 12; break; }
679 case CaloSampling::HEC3: { iCell = 13; break; }
680
681 default: {
682 ATH_MSG_DEBUG(
"CaloSampling::HECX -> invalid sample for assigning iCell value! " << sample <<
" (Under investigation) ");
683 break;
684 }
685 }
686 break;
687
688 }
689 case 1: {
690 validcell = false;
691
692 break;
693 }
694 default: { break; }
695 }
696
697
698 if(pos_neg < 0){ towerID_Modifier = 500000; }
699 else if(pos_neg > 0){ towerID_Modifier = 600000; }
700
701 break;
702 }
703 case CaloSampling::TileBar0:
704 case CaloSampling::TileBar1:
705 case CaloSampling::TileBar2: {
707 validcell = false;
708
709 break;
710 }
711 case CaloSampling::TileGap1:
712 case CaloSampling::TileGap2:
713 case CaloSampling::TileGap3: {
714
715 validcell = false;
716 break;
717 }
718 case CaloSampling::TileExt0:
719 case CaloSampling::TileExt1:
720 case CaloSampling::TileExt2: {
721
722 validcell = false;
723 break;
724 }
725 case CaloSampling::FCAL0:
726 case CaloSampling::FCAL1:
727 case CaloSampling::FCAL2: {
728
729 validcell = false;
730 break;
731 }
732 case CaloSampling::MINIFCAL0:
733 case CaloSampling::MINIFCAL1:
734 case CaloSampling::MINIFCAL2:
735 case CaloSampling::MINIFCAL3: {
736
737 validcell = false;
738 break;
739 }
740 case CaloSampling::Unknown: {
741
742 validcell = false;
743 break;
744 }
745 default: {
746 ATH_MSG_DEBUG(
"\n==== eSuperCellTowerMapper ============ Supercell has invalid CaloSampling value: " << sample <<
" (Needs investigation). Please report this!");
747 validcell = false;
748 break;
749 }
750 }
751
752 if(validcell){
754
755
756
757 if (iETower < 200000 || (iETower > 300000 && iETower < 400000) || (iETower > 500000 && iETower < 600000)) {
758 if (layer == 1) {
759 iCell = 5 - iCell;
760 if (doenergysplit) iCell -= 1;
761 } else if (layer == 2) {
762 iCell = 13 - iCell;
763 }
764 }
765
766
767 int etaIndex = (iETower%100000)/64;
768 if (iETower > 500000 && etaIndex == 24 && iCell < 5) iCell = 0;
769
770 if(doPrint){
771 PrintCellSpec(sample, layer, region, eta_index, phi_index, pos_neg, iETower, iCell, prov, ID, doenergysplit);
772 }
774 }
775
776
777
778 return 1;
779
780 }
#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