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: {
231 ATH_MSG_DEBUG(
"CaloSampling::EMBX -> invalid sample for assigning iCell value! " << sample <<
" (Under investigation) ");
238 case CaloSampling::EMB3: {
241 towereta = eta_index/2;
242 towerphi = phi_index/2;
245 if(pos_neg < 0){ towerID_Modifier = 100000; }
246 else if(pos_neg > 0){ towerID_Modifier = 200000; }
251 case CaloSampling::PreSamplerE: {
255 if (eta_index < 1) {towereta = 7;}
257 towerphi = phi_index / 2;
261 if(pos_neg < 0){ towerID_Modifier = 300000; }
262 else if(pos_neg > 0){ towerID_Modifier = 400000; }
264 else if (towereta != 7){
265 if(pos_neg < 0){ towerID_Modifier = 500000; }
266 else if(pos_neg > 0){ towerID_Modifier = 600000; }
271 case CaloSampling::EME1: {
279 towerphi = phi_index/2;
285 if (eta_index < 4) {towereta = 7;}
287 towerphi = phi_index/2;
293 if (eta_index < 11) {towereta = 8;}
295 towerphi = phi_index/2;
301 if (eta_index < 8) {towereta = 10;}
302 else {towereta = 11;}
303 towerphi = phi_index/2;
310 towerphi = phi_index/2;
315 ATH_MSG_DEBUG(
"CaloSampling::EME1 -> invalid 'region' value: " << region <<
" (Under investigation) ");
322 if(pos_neg < 0){ towerID_Modifier = 300000; }
323 else if(pos_neg > 0){ towerID_Modifier = 400000; }
325 else if (towereta != 7){
326 if(pos_neg < 0){ towerID_Modifier = 500000; }
327 else if(pos_neg > 0){ towerID_Modifier = 600000; }
332 case CaloSampling::EME2: {
339 if(abs(pos_neg) == 2){
341 towerphi = phi_index/2;
343 else if(abs(pos_neg) == 3){
346 towerphi = phi_index;
348 else if (eta_index == 1){
350 towerphi = phi_index;
352 else if (eta_index == 2){
354 towerphi = phi_index;
360 if(abs(pos_neg) == 2){
361 towerphi = phi_index/2;
362 if (eta_index < 7) {towereta = 7;}
363 else if (eta_index < 15) {towereta = 8;}
364 else if (eta_index < 23) {towereta = 9;}
365 else if (eta_index < 31) {towereta = 10;}
366 else if (eta_index < 43) {towereta = 11;}
368 else if(abs(pos_neg) == 3){
369 towerphi = phi_index;
376 ATH_MSG_DEBUG(
"CaloSampling::EME2 -> invalid 'region' value: " << region <<
" (Under investigation) ");
383 if(pos_neg < 0){ towerID_Modifier = 300000; }
384 else if(pos_neg > 0){ towerID_Modifier = 400000; }
386 else if (towereta == 12 || towereta == 13 || towereta == 14 || towereta == 15){
387 if(pos_neg < 0){ towerID_Modifier = 700000; }
388 else if(pos_neg > 0){ towerID_Modifier = 800000; }
391 if(pos_neg < 0){ towerID_Modifier = 500000; }
392 else if(pos_neg > 0){ towerID_Modifier = 600000; }
397 case CaloSampling::EME3: {
402 if(abs(pos_neg) == 2){
403 towerphi = phi_index/2;
407 else if(eta_index < 3){
410 else if(eta_index < 5){
413 else if(eta_index < 7){
416 else if(eta_index < 10){
421 else if(abs(pos_neg) == 3){
424 towerphi = phi_index;
426 else if (eta_index == 1){
428 towerphi = phi_index;
430 else if (eta_index == 2){
432 towerphi = phi_index;
438 towerphi = phi_index;
443 ATH_MSG_DEBUG(
"CaloSampling::EME3 -> invalid 'region' value: " << region <<
" (Under investigation) ");
450 if(pos_neg < 0){ towerID_Modifier = 300000; }
451 else if(pos_neg > 0){ towerID_Modifier = 400000; }
453 else if (towereta == 12 || towereta == 13 || towereta == 14 || towereta == 15){
454 if(pos_neg < 0){ towerID_Modifier = 700000; }
455 else if(pos_neg > 0){ towerID_Modifier = 800000; }
458 if(pos_neg < 0){ towerID_Modifier = 500000; }
459 else if(pos_neg > 0){ towerID_Modifier = 600000; }
464 case CaloSampling::HEC0:{
468 if(abs(pos_neg) == 2){
469 towerphi = phi_index/2;
473 else if(eta_index < 3){
476 else if(eta_index < 5){
479 else if(eta_index < 7){
482 else if(eta_index < 10){
491 if(abs(pos_neg) == 2){
494 towerphi = phi_index;
496 else if(eta_index == 1){
498 towerphi = phi_index;
500 else if(eta_index == 2){
502 towerphi = phi_index;
504 else if(eta_index == 3){
506 towerphi = phi_index;
514 ATH_MSG_DEBUG(
"CaloSampling::HEC0 -> invalid 'region' value: " << region <<
" (Under investigation) ");
523 if(pos_neg < 0){ towerID_Modifier = 300000; }
524 else if(pos_neg > 0){ towerID_Modifier = 400000; }
526 else if (towereta == 12 || towereta == 13 || towereta == 14 || towereta == 15){
527 if(pos_neg < 0){ towerID_Modifier = 700000; }
528 else if(pos_neg > 0){ towerID_Modifier = 800000; }
532 if(pos_neg < 0){ towerID_Modifier = 500000; }
533 else if(pos_neg > 0){ towerID_Modifier = 600000; }
538 case CaloSampling::TileBar0:
539 case CaloSampling::TileBar1:
540 case CaloSampling::TileBar2: {
543 ATH_MSG_DEBUG(
"\n==== gSuperCellTowerMapper ============ Supercell is from Tile Barrel - it will be ignored.");
546 case CaloSampling::TileGap1:
547 case CaloSampling::TileGap2:
548 case CaloSampling::TileGap3: {
549 ATH_MSG_DEBUG(
"\n==== gSuperCellTowerMapper ============ Supercell is from Tile Gap (ITC and scintillator) - it will be ignored.");
553 case CaloSampling::TileExt0:
554 case CaloSampling::TileExt1:
555 case CaloSampling::TileExt2: {
556 ATH_MSG_DEBUG(
"\n==== gSuperCellTowerMapper ============ Supercell is from Tile Extended Barrel - it will be ignored.");
560 case CaloSampling::FCAL0:{
562 towerphi = phi_index;
566 else if(eta_index < 8){
569 else if(eta_index < 10){
572 else if(eta_index < 12){
576 if(pos_neg < 0){ towerID_Modifier = 900000; }
577 else if(pos_neg > 0){ towerID_Modifier = 1000000; }
581 case CaloSampling::FCAL1:{
583 towerphi = phi_index;
587 else if(eta_index < 6){
590 else if(eta_index < 7){
593 else if(eta_index < 8){
597 if(pos_neg < 0){ towerID_Modifier = 900000; }
598 else if(pos_neg > 0){ towerID_Modifier = 1000000; }
602 case CaloSampling::FCAL2:{
604 towerphi = phi_index;
608 else if(eta_index < 3){
611 else if(eta_index < 4){
615 if(pos_neg < 0){ towerID_Modifier = 900000; }
616 else if(pos_neg > 0){ towerID_Modifier = 1000000; }
621 case CaloSampling::MINIFCAL0:
622 case CaloSampling::MINIFCAL1:
623 case CaloSampling::MINIFCAL2:
624 case CaloSampling::MINIFCAL3: {
625 ATH_MSG_DEBUG(
"\n==== gSuperCellTowerMapper ============ Supercells is from MiniFCAL - it will be ignored.");
629 case CaloSampling::Unknown: {
630 ATH_MSG_WARNING(
"\n==== gSuperCellTowerMapper ============ Supercell sampling is officially unknown - it will be ignored. (Needs investigation). Please report this!");
635 ATH_MSG_DEBUG(
"\n==== gSuperCellTowerMapper ============ Supercell has invalid CaloSampling value: " << sample <<
" (Needs investigation). Please report this!");
644 PrintCellSpec(sample, region, eta_index, phi_index, pos_neg, towereta, towerphi, nphi, towerID_Modifier, iGTower, prov, ID);
663 const int eta_index,
const int phi_index,
const int pos_neg,
664 int towereta,
int towerphi,
int nphi,
int towerID_Modifier,
668 std::string sampleName =
"";
671 case CaloSampling::PreSamplerB: { sampleName =
"PreSamplerB";
break; }
672 case CaloSampling::EMB1: { sampleName =
"EMB1";
break; }
673 case CaloSampling::EMB2: { sampleName =
"EMB2";
break; }
674 case CaloSampling::EMB3: { sampleName =
"EMB3";
break; }
675 case CaloSampling::PreSamplerE: { sampleName =
"PreSamplerE";
break; }
676 case CaloSampling::EME1: { sampleName =
"EME1";
break; }
677 case CaloSampling::EME2: { sampleName =
"EME2";
break; }
678 case CaloSampling::EME3: { sampleName =
"EME3";
break; }
679 case CaloSampling::HEC0: { sampleName =
"HEC0";
break; }
680 case CaloSampling::HEC1: { sampleName =
"HEC1";
break; }
681 case CaloSampling::HEC2: { sampleName =
"HEC2";
break; }
682 case CaloSampling::HEC3: { sampleName =
"HEC3";
break; }
683 case CaloSampling::TileBar0: { sampleName =
"TileBar0";
break; }
684 case CaloSampling::TileBar1: { sampleName =
"TileBar1";
break; }
685 case CaloSampling::TileBar2: { sampleName =
"TileBar2";
break; }
686 case CaloSampling::TileGap1: { sampleName =
"TileGap1";
break; }
687 case CaloSampling::TileGap2: { sampleName =
"TileGap2";
break; }
688 case CaloSampling::TileGap3: { sampleName =
"TileGap3";
break; }
689 case CaloSampling::TileExt0: { sampleName =
"TileExt0";
break; }
690 case CaloSampling::TileExt1: { sampleName =
"TileExt1";
break; }
691 case CaloSampling::TileExt2: { sampleName =
"TileExt2";
break; }
692 case CaloSampling::FCAL0: { sampleName =
"FCAL0";
break; }
693 case CaloSampling::FCAL1: { sampleName =
"FCAL1";
break; }
694 case CaloSampling::FCAL2: { sampleName =
"FCAL2";
break; }
697 ATH_MSG_DEBUG(
"\n==== gSuperCellTowerMapper ============ Supercell has invalid CaloSampling value: " << sample <<
" (Needs investigation). Please report this!");
703 <<
"\tSample: " << sample
704 <<
"\tRegion: " << region
705 <<
"\tEta_Index: " << eta_index
706 <<
"\tPhi_Index: " << phi_index
707 <<
"\tPosNeg: " << pos_neg
708 <<
"\tgTower Eta: " << towereta
709 <<
"\tgTower Phi: " << towerphi
710 <<
"\tgTower nphi: " << nphi
711 <<
"\tgTower modifier: " << towerID_Modifier
712 <<
"\tiGTower: " << iGTower
713 <<
"\tProvenance: " << prov