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;
162 bool validcell =
true;
169 int towerID_Modifier = -999999999;
180 case CaloSampling::PreSamplerB: {
182 towereta = eta_index / 2;
183 towerphi = phi_index / 2;
188 if(pos_neg < 0){ towerID_Modifier = 300000; }
189 else if(pos_neg > 0){ towerID_Modifier = 400000; }
192 if(pos_neg < 0){ towerID_Modifier = 100000; }
193 else if(pos_neg > 0){ towerID_Modifier = 200000; }
198 case CaloSampling::EMB1:
199 case CaloSampling::EMB2: {
204 towereta = eta_index / 8;
205 towerphi = phi_index / 2;
206 if(pos_neg < 0){ towerID_Modifier = 100000; }
207 else if(pos_neg > 0){ towerID_Modifier = 200000; }
209 else if (region == 1){
211 towerphi = phi_index/2;
212 if(pos_neg < 0){ towerID_Modifier = 300000; }
213 else if(pos_neg > 0){ towerID_Modifier = 400000; }
216 ATH_MSG_DEBUG(
"[CaloSampling::EMB1 or CaloSampling::EMB2] -> invalid 'region' value: " << region <<
" (Under investigation) ");
220 case CaloSampling::EMB1: {
223 case CaloSampling::EMB2: {
228 ATH_MSG_DEBUG(
"CaloSampling::EMBX -> invalid sample for assigning iCell value! " << sample <<
" (Under investigation) ");
235 case CaloSampling::EMB3: {
238 towereta = eta_index/2;
239 towerphi = phi_index/2;
242 if(pos_neg < 0){ towerID_Modifier = 100000; }
243 else if(pos_neg > 0){ towerID_Modifier = 200000; }
248 case CaloSampling::PreSamplerE: {
252 if (eta_index < 1) {towereta = 7;}
254 towerphi = phi_index / 2;
258 if(pos_neg < 0){ towerID_Modifier = 300000; }
259 else if(pos_neg > 0){ towerID_Modifier = 400000; }
261 else if (towereta != 7){
262 if(pos_neg < 0){ towerID_Modifier = 500000; }
263 else if(pos_neg > 0){ towerID_Modifier = 600000; }
268 case CaloSampling::EME1: {
276 towerphi = phi_index/2;
282 if (eta_index < 4) {towereta = 7;}
284 towerphi = phi_index/2;
290 if (eta_index < 11) {towereta = 8;}
292 towerphi = phi_index/2;
298 if (eta_index < 8) {towereta = 10;}
299 else {towereta = 11;}
300 towerphi = phi_index/2;
307 towerphi = phi_index/2;
312 ATH_MSG_DEBUG(
"CaloSampling::EME1 -> invalid 'region' value: " << region <<
" (Under investigation) ");
319 if(pos_neg < 0){ towerID_Modifier = 300000; }
320 else if(pos_neg > 0){ towerID_Modifier = 400000; }
322 else if (towereta != 7){
323 if(pos_neg < 0){ towerID_Modifier = 500000; }
324 else if(pos_neg > 0){ towerID_Modifier = 600000; }
329 case CaloSampling::EME2: {
336 if(abs(pos_neg) == 2){
338 towerphi = phi_index/2;
340 else if(abs(pos_neg) == 3){
343 towerphi = phi_index;
345 else if (eta_index == 1){
347 towerphi = phi_index;
349 else if (eta_index == 2){
351 towerphi = phi_index;
357 if(abs(pos_neg) == 2){
358 towerphi = phi_index/2;
359 if (eta_index < 7) {towereta = 7;}
360 else if (eta_index < 15) {towereta = 8;}
361 else if (eta_index < 23) {towereta = 9;}
362 else if (eta_index < 31) {towereta = 10;}
363 else if (eta_index < 43) {towereta = 11;}
365 else if(abs(pos_neg) == 3){
366 towerphi = phi_index;
373 ATH_MSG_DEBUG(
"CaloSampling::EME2 -> invalid 'region' value: " << region <<
" (Under investigation) ");
380 if(pos_neg < 0){ towerID_Modifier = 300000; }
381 else if(pos_neg > 0){ towerID_Modifier = 400000; }
383 else if (towereta == 12 || towereta == 13 || towereta == 14 || towereta == 15){
384 if(pos_neg < 0){ towerID_Modifier = 700000; }
385 else if(pos_neg > 0){ towerID_Modifier = 800000; }
388 if(pos_neg < 0){ towerID_Modifier = 500000; }
389 else if(pos_neg > 0){ towerID_Modifier = 600000; }
394 case CaloSampling::EME3: {
399 if(abs(pos_neg) == 2){
400 towerphi = phi_index/2;
404 else if(eta_index < 3){
407 else if(eta_index < 5){
410 else if(eta_index < 7){
413 else if(eta_index < 10){
418 else if(abs(pos_neg) == 3){
421 towerphi = phi_index;
423 else if (eta_index == 1){
425 towerphi = phi_index;
427 else if (eta_index == 2){
429 towerphi = phi_index;
435 towerphi = phi_index;
440 ATH_MSG_DEBUG(
"CaloSampling::EME3 -> invalid 'region' value: " << region <<
" (Under investigation) ");
447 if(pos_neg < 0){ towerID_Modifier = 300000; }
448 else if(pos_neg > 0){ towerID_Modifier = 400000; }
450 else if (towereta == 12 || towereta == 13 || towereta == 14 || towereta == 15){
451 if(pos_neg < 0){ towerID_Modifier = 700000; }
452 else if(pos_neg > 0){ towerID_Modifier = 800000; }
455 if(pos_neg < 0){ towerID_Modifier = 500000; }
456 else if(pos_neg > 0){ towerID_Modifier = 600000; }
461 case CaloSampling::HEC0:{
465 if(abs(pos_neg) == 2){
466 towerphi = phi_index/2;
470 else if(eta_index < 3){
473 else if(eta_index < 5){
476 else if(eta_index < 7){
479 else if(eta_index < 10){
488 if(abs(pos_neg) == 2){
491 towerphi = phi_index;
493 else if(eta_index == 1){
495 towerphi = phi_index;
497 else if(eta_index == 2){
499 towerphi = phi_index;
501 else if(eta_index == 3){
503 towerphi = phi_index;
511 ATH_MSG_DEBUG(
"CaloSampling::HEC0 -> invalid 'region' value: " << region <<
" (Under investigation) ");
520 if(pos_neg < 0){ towerID_Modifier = 300000; }
521 else if(pos_neg > 0){ towerID_Modifier = 400000; }
523 else if (towereta == 12 || towereta == 13 || towereta == 14 || towereta == 15){
524 if(pos_neg < 0){ towerID_Modifier = 700000; }
525 else if(pos_neg > 0){ towerID_Modifier = 800000; }
529 if(pos_neg < 0){ towerID_Modifier = 500000; }
530 else if(pos_neg > 0){ towerID_Modifier = 600000; }
535 case CaloSampling::TileBar0:
536 case CaloSampling::TileBar1:
537 case CaloSampling::TileBar2: {
540 ATH_MSG_DEBUG(
"\n==== gSuperCellTowerMapper ============ Supercell is from Tile Barrel - it will be ignored.");
543 case CaloSampling::TileGap1:
544 case CaloSampling::TileGap2:
545 case CaloSampling::TileGap3: {
546 ATH_MSG_DEBUG(
"\n==== gSuperCellTowerMapper ============ Supercell is from Tile Gap (ITC and scintillator) - it will be ignored.");
550 case CaloSampling::TileExt0:
551 case CaloSampling::TileExt1:
552 case CaloSampling::TileExt2: {
553 ATH_MSG_DEBUG(
"\n==== gSuperCellTowerMapper ============ Supercell is from Tile Extended Barrel - it will be ignored.");
557 case CaloSampling::FCAL0:{
559 towerphi = phi_index;
563 else if(eta_index < 8){
566 else if(eta_index < 10){
569 else if(eta_index < 12){
573 if(pos_neg < 0){ towerID_Modifier = 900000; }
574 else if(pos_neg > 0){ towerID_Modifier = 1000000; }
578 case CaloSampling::FCAL1:{
580 towerphi = phi_index;
584 else if(eta_index < 6){
587 else if(eta_index < 7){
590 else if(eta_index < 8){
594 if(pos_neg < 0){ towerID_Modifier = 900000; }
595 else if(pos_neg > 0){ towerID_Modifier = 1000000; }
599 case CaloSampling::FCAL2:{
601 towerphi = phi_index;
605 else if(eta_index < 3){
608 else if(eta_index < 4){
612 if(pos_neg < 0){ towerID_Modifier = 900000; }
613 else if(pos_neg > 0){ towerID_Modifier = 1000000; }
618 case CaloSampling::MINIFCAL0:
619 case CaloSampling::MINIFCAL1:
620 case CaloSampling::MINIFCAL2:
621 case CaloSampling::MINIFCAL3: {
622 ATH_MSG_DEBUG(
"\n==== gSuperCellTowerMapper ============ Supercells is from MiniFCAL - it will be ignored.");
626 case CaloSampling::Unknown: {
627 ATH_MSG_WARNING(
"\n==== gSuperCellTowerMapper ============ Supercell sampling is officially unknown - it will be ignored. (Needs investigation). Please report this!");
632 ATH_MSG_DEBUG(
"\n==== gSuperCellTowerMapper ============ Supercell has invalid CaloSampling value: " << sample <<
" (Needs investigation). Please report this!");
641 PrintCellSpec(sample, region, eta_index, phi_index, pos_neg, towereta, towerphi, nphi, towerID_Modifier, iGTower, prov, ID);
660 const int eta_index,
const int phi_index,
const int pos_neg,
661 int towereta,
int towerphi,
int nphi,
int towerID_Modifier,
665 std::string sampleName =
"";
668 case CaloSampling::PreSamplerB: { sampleName =
"PreSamplerB";
break; }
669 case CaloSampling::EMB1: { sampleName =
"EMB1";
break; }
670 case CaloSampling::EMB2: { sampleName =
"EMB2";
break; }
671 case CaloSampling::EMB3: { sampleName =
"EMB3";
break; }
672 case CaloSampling::PreSamplerE: { sampleName =
"PreSamplerE";
break; }
673 case CaloSampling::EME1: { sampleName =
"EME1";
break; }
674 case CaloSampling::EME2: { sampleName =
"EME2";
break; }
675 case CaloSampling::EME3: { sampleName =
"EME3";
break; }
676 case CaloSampling::HEC0: { sampleName =
"HEC0";
break; }
677 case CaloSampling::HEC1: { sampleName =
"HEC1";
break; }
678 case CaloSampling::HEC2: { sampleName =
"HEC2";
break; }
679 case CaloSampling::HEC3: { sampleName =
"HEC3";
break; }
680 case CaloSampling::TileBar0: { sampleName =
"TileBar0";
break; }
681 case CaloSampling::TileBar1: { sampleName =
"TileBar1";
break; }
682 case CaloSampling::TileBar2: { sampleName =
"TileBar2";
break; }
683 case CaloSampling::TileGap1: { sampleName =
"TileGap1";
break; }
684 case CaloSampling::TileGap2: { sampleName =
"TileGap2";
break; }
685 case CaloSampling::TileGap3: { sampleName =
"TileGap3";
break; }
686 case CaloSampling::TileExt0: { sampleName =
"TileExt0";
break; }
687 case CaloSampling::TileExt1: { sampleName =
"TileExt1";
break; }
688 case CaloSampling::TileExt2: { sampleName =
"TileExt2";
break; }
689 case CaloSampling::FCAL0: { sampleName =
"FCAL0";
break; }
690 case CaloSampling::FCAL1: { sampleName =
"FCAL1";
break; }
691 case CaloSampling::FCAL2: { sampleName =
"FCAL2";
break; }
694 ATH_MSG_DEBUG(
"\n==== gSuperCellTowerMapper ============ Supercell has invalid CaloSampling value: " << sample <<
" (Needs investigation). Please report this!");
700 <<
"\tSample: " << sample
701 <<
"\tRegion: " << region
702 <<
"\tEta_Index: " << eta_index
703 <<
"\tPhi_Index: " << phi_index
704 <<
"\tPosNeg: " << pos_neg
705 <<
"\tgTower Eta: " << towereta
706 <<
"\tgTower Phi: " << towerphi
707 <<
"\tgTower nphi: " << nphi
708 <<
"\tgTower modifier: " << towerID_Modifier
709 <<
"\tiGTower: " << iGTower
710 <<
"\tProvenance: " << prov