44 static constexpr float delta_phi =
M_PI/32;
45 static constexpr float delta_eta = 0.1;
48 if(!triggerTowerCollection.
isValid()){
50 return StatusCode::FAILURE;
54 for(
auto eachTower : *triggerTowerCollection) {
56 if(std::abs(eachTower->eta())<1.5 && eachTower->sampling()==1) {
57 int tile_iphi = int(eachTower->phi()/delta_phi);
58 int tower_iphi = tile_iphi/2;
59 int tile_ieta = int(std::abs(eachTower->eta())/delta_eta);
60 int tower_ieta = tile_ieta/2;
63 int towerID_Modifier{100000};
66 if (eachTower->eta() > 0) {
68 towerID_Modifier = 200000;
71 if(tower_ieta * etaSign == -7) {
72 towerID_Modifier = 300000;
75 else if (tower_ieta * etaSign == 7) {
76 towerID_Modifier = 400000;
81 if((targetTower = my_gTowerContainerRaw->findTower(towerid)))
84 targetTower->
addET(
static_cast<int>(eachTower->jepET()) * 1000., 1);
87 ATH_MSG_WARNING(
"\n==== gSuperCellTowerMapper ============ Tower id is officially unknown - it will be ignored. (Needs investigation). Please report this!");
91 return StatusCode::SUCCESS;
165 bool validcell =
true;
172 int towerID_Modifier = -999999999;
183 case CaloSampling::PreSamplerB: {
185 towereta = eta_index / 2;
186 towerphi = phi_index / 2;
191 if(pos_neg < 0){ towerID_Modifier = 300000; }
192 else if(pos_neg > 0){ towerID_Modifier = 400000; }
195 if(pos_neg < 0){ towerID_Modifier = 100000; }
196 else if(pos_neg > 0){ towerID_Modifier = 200000; }
201 case CaloSampling::EMB1:
202 case CaloSampling::EMB2: {
207 towereta = eta_index / 8;
208 towerphi = phi_index / 2;
209 if(pos_neg < 0){ towerID_Modifier = 100000; }
210 else if(pos_neg > 0){ towerID_Modifier = 200000; }
212 else if (region == 1){
214 towerphi = phi_index/2;
215 if(pos_neg < 0){ towerID_Modifier = 300000; }
216 else if(pos_neg > 0){ towerID_Modifier = 400000; }
219 ATH_MSG_DEBUG(
"[CaloSampling::EMB1 or CaloSampling::EMB2] -> invalid 'region' value: " << region <<
" (Under investigation) ");
223 case CaloSampling::EMB1: {
226 case CaloSampling::EMB2: {
230 ATH_MSG_DEBUG(
"CaloSampling::EMBX -> invalid sample for assigning iCell value! " << sample <<
" (Under investigation) ");
237 case CaloSampling::EMB3: {
240 towereta = eta_index/2;
241 towerphi = phi_index/2;
244 if(pos_neg < 0){ towerID_Modifier = 100000; }
245 else if(pos_neg > 0){ towerID_Modifier = 200000; }
250 case CaloSampling::PreSamplerE: {
254 if (eta_index < 1) {towereta = 7;}
256 towerphi = phi_index / 2;
260 if(pos_neg < 0){ towerID_Modifier = 300000; }
261 else if(pos_neg > 0){ towerID_Modifier = 400000; }
263 else if (towereta != 7){
264 if(pos_neg < 0){ towerID_Modifier = 500000; }
265 else if(pos_neg > 0){ towerID_Modifier = 600000; }
270 case CaloSampling::EME1: {
278 towerphi = phi_index/2;
284 if (eta_index < 4) {towereta = 7;}
286 towerphi = phi_index/2;
292 if (eta_index < 11) {towereta = 8;}
294 towerphi = phi_index/2;
300 if (eta_index < 8) {towereta = 10;}
301 else {towereta = 11;}
302 towerphi = phi_index/2;
309 towerphi = phi_index/2;
314 ATH_MSG_DEBUG(
"CaloSampling::EME1 -> invalid 'region' value: " << region <<
" (Under investigation) ");
321 if(pos_neg < 0){ towerID_Modifier = 300000; }
322 else if(pos_neg > 0){ towerID_Modifier = 400000; }
324 else if (towereta != 7){
325 if(pos_neg < 0){ towerID_Modifier = 500000; }
326 else if(pos_neg > 0){ towerID_Modifier = 600000; }
331 case CaloSampling::EME2: {
338 if(abs(pos_neg) == 2){
340 towerphi = phi_index/2;
342 else if(abs(pos_neg) == 3){
345 towerphi = phi_index;
347 else if (eta_index == 1){
349 towerphi = phi_index;
351 else if (eta_index == 2){
353 towerphi = phi_index;
359 if(abs(pos_neg) == 2){
360 towerphi = phi_index/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;}
367 else if(abs(pos_neg) == 3){
368 towerphi = phi_index;
375 ATH_MSG_DEBUG(
"CaloSampling::EME2 -> invalid 'region' value: " << region <<
" (Under investigation) ");
382 if(pos_neg < 0){ towerID_Modifier = 300000; }
383 else if(pos_neg > 0){ towerID_Modifier = 400000; }
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; }
390 if(pos_neg < 0){ towerID_Modifier = 500000; }
391 else if(pos_neg > 0){ towerID_Modifier = 600000; }
396 case CaloSampling::EME3: {
401 if(abs(pos_neg) == 2){
402 towerphi = phi_index/2;
406 else if(eta_index < 3){
409 else if(eta_index < 5){
412 else if(eta_index < 7){
415 else if(eta_index < 10){
420 else if(abs(pos_neg) == 3){
423 towerphi = phi_index;
425 else if (eta_index == 1){
427 towerphi = phi_index;
429 else if (eta_index == 2){
431 towerphi = phi_index;
437 towerphi = phi_index;
442 ATH_MSG_DEBUG(
"CaloSampling::EME3 -> invalid 'region' value: " << region <<
" (Under investigation) ");
449 if(pos_neg < 0){ towerID_Modifier = 300000; }
450 else if(pos_neg > 0){ towerID_Modifier = 400000; }
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; }
457 if(pos_neg < 0){ towerID_Modifier = 500000; }
458 else if(pos_neg > 0){ towerID_Modifier = 600000; }
463 case CaloSampling::HEC0:{
467 if(abs(pos_neg) == 2){
468 towerphi = phi_index/2;
472 else if(eta_index < 3){
475 else if(eta_index < 5){
478 else if(eta_index < 7){
481 else if(eta_index < 10){
490 if(abs(pos_neg) == 2){
493 towerphi = phi_index;
495 else if(eta_index == 1){
497 towerphi = phi_index;
499 else if(eta_index == 2){
501 towerphi = phi_index;
503 else if(eta_index == 3){
505 towerphi = phi_index;
513 ATH_MSG_DEBUG(
"CaloSampling::HEC0 -> invalid 'region' value: " << region <<
" (Under investigation) ");
522 if(pos_neg < 0){ towerID_Modifier = 300000; }
523 else if(pos_neg > 0){ towerID_Modifier = 400000; }
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; }
531 if(pos_neg < 0){ towerID_Modifier = 500000; }
532 else if(pos_neg > 0){ towerID_Modifier = 600000; }
537 case CaloSampling::TileBar0:
538 case CaloSampling::TileBar1:
539 case CaloSampling::TileBar2: {
542 ATH_MSG_DEBUG(
"\n==== gSuperCellTowerMapper ============ Supercell is from Tile Barrel - it will be ignored.");
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.");
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.");
559 case CaloSampling::FCAL0:{
561 towerphi = phi_index;
565 else if(eta_index < 8){
568 else if(eta_index < 10){
571 else if(eta_index < 12){
575 if(pos_neg < 0){ towerID_Modifier = 900000; }
576 else if(pos_neg > 0){ towerID_Modifier = 1000000; }
580 case CaloSampling::FCAL1:{
582 towerphi = phi_index;
586 else if(eta_index < 6){
589 else if(eta_index < 7){
592 else if(eta_index < 8){
596 if(pos_neg < 0){ towerID_Modifier = 900000; }
597 else if(pos_neg > 0){ towerID_Modifier = 1000000; }
601 case CaloSampling::FCAL2:{
603 towerphi = phi_index;
607 else if(eta_index < 3){
610 else if(eta_index < 4){
614 if(pos_neg < 0){ towerID_Modifier = 900000; }
615 else if(pos_neg > 0){ towerID_Modifier = 1000000; }
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.");
628 case CaloSampling::Unknown: {
629 ATH_MSG_WARNING(
"\n==== gSuperCellTowerMapper ============ Supercell sampling is officially unknown - it will be ignored. (Needs investigation). Please report this!");
634 ATH_MSG_DEBUG(
"\n==== gSuperCellTowerMapper ============ Supercell has invalid CaloSampling value: " << sample <<
" (Needs investigation). Please report this!");
643 PrintCellSpec(sample, region, eta_index, phi_index, pos_neg, towereta, towerphi, nphi, towerID_Modifier, iGTower, prov,
ID);
662 const int eta_index,
const int phi_index,
const int pos_neg,
663 int towereta,
int towerphi,
int nphi,
int towerID_Modifier,
667 std::string sampleName =
"";
670 case CaloSampling::PreSamplerB: { sampleName =
"PreSamplerB";
break; }
671 case CaloSampling::EMB1: { sampleName =
"EMB1";
break; }
672 case CaloSampling::EMB2: { sampleName =
"EMB2";
break; }
673 case CaloSampling::EMB3: { sampleName =
"EMB3";
break; }
674 case CaloSampling::PreSamplerE: { sampleName =
"PreSamplerE";
break; }
675 case CaloSampling::EME1: { sampleName =
"EME1";
break; }
676 case CaloSampling::EME2: { sampleName =
"EME2";
break; }
677 case CaloSampling::EME3: { sampleName =
"EME3";
break; }
678 case CaloSampling::HEC0: { sampleName =
"HEC0";
break; }
679 case CaloSampling::HEC1: { sampleName =
"HEC1";
break; }
680 case CaloSampling::HEC2: { sampleName =
"HEC2";
break; }
681 case CaloSampling::HEC3: { sampleName =
"HEC3";
break; }
682 case CaloSampling::TileBar0: { sampleName =
"TileBar0";
break; }
683 case CaloSampling::TileBar1: { sampleName =
"TileBar1";
break; }
684 case CaloSampling::TileBar2: { sampleName =
"TileBar2";
break; }
685 case CaloSampling::TileGap1: { sampleName =
"TileGap1";
break; }
686 case CaloSampling::TileGap2: { sampleName =
"TileGap2";
break; }
687 case CaloSampling::TileGap3: { sampleName =
"TileGap3";
break; }
688 case CaloSampling::TileExt0: { sampleName =
"TileExt0";
break; }
689 case CaloSampling::TileExt1: { sampleName =
"TileExt1";
break; }
690 case CaloSampling::TileExt2: { sampleName =
"TileExt2";
break; }
691 case CaloSampling::FCAL0: { sampleName =
"FCAL0";
break; }
692 case CaloSampling::FCAL1: { sampleName =
"FCAL1";
break; }
693 case CaloSampling::FCAL2: { sampleName =
"FCAL2";
break; }
696 ATH_MSG_DEBUG(
"\n==== gSuperCellTowerMapper ============ Supercell has invalid CaloSampling value: " << sample <<
" (Needs investigation). Please report this!");
702 <<
"\tSample: " << sample
703 <<
"\tRegion: " << region
704 <<
"\tEta_Index: " << eta_index
705 <<
"\tPhi_Index: " << phi_index
706 <<
"\tPosNeg: " << pos_neg
707 <<
"\tgTower Eta: " << towereta
708 <<
"\tgTower Phi: " << towerphi
709 <<
"\tgTower nphi: " << nphi
710 <<
"\tgTower modifier: " << towerID_Modifier
711 <<
"\tiGTower: " << iGTower
712 <<
"\tProvenance: " << prov