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