26 declareInterface<IjSuperCellTowerMapper>(
this);
41 return StatusCode::SUCCESS;
47 static constexpr
float pi_over_32 =
M_PI/32;
50 if(!triggerTowerCollection.
isValid()) {
52 return StatusCode::FAILURE;
54 for(
auto eachTower : *triggerTowerCollection) {
55 if(std::fabs(eachTower->eta())<1.5 && eachTower->sampling()==1) {
56 int i_phi =
int(eachTower->phi()/pi_over_32);
58 int towerID_Modifier{100000};
59 if (eachTower->eta() > 0) {
61 towerID_Modifier = 200000;
63 int i_eta =
int(eachTower->eta() * 10) * etaSign;
64 if(i_eta * etaSign == -14) {
65 towerID_Modifier = 300000;
66 }
else if (i_eta * etaSign == 14) {
67 towerID_Modifier = 400000;
72 if((targetTower = my_jTowerContainerRaw->findTower(towerid))) {
74 ATH_MSG_WARNING(
"\n==== jSuperCellTowerMapper ============ Hadronic layer energy filled more than once - it will be ignored. (Needs investigation). Please report this!");
79 ATH_MSG_WARNING(
"\n==== jSuperCellTowerMapper ============ Tower ID is officially unknown - it will be ignored. (Needs investigation). Please report this!");
83 return StatusCode::SUCCESS;
97 if(!scellsCollection.
isValid()) {
99 return StatusCode::FAILURE;
114 const int phi_index = idHelper->
phi(
ID);
116 int prov = (
cell)->provenance();
121 float eta0 = idHelper->
eta0(
ID);
199 else if (region == 1) { }
200 else if (region == 2) {
203 else if (region == 3) {
206 else if (region == 4) {
209 else if (region == 5) {
223 else if (region == 1) {
243 else if (region == 1) {
261 else if (region == 1){
272 FindAndConnectTower(my_jTowerContainerRaw,
sample,region,
layer,pos_neg,
eta_index,phi_index,
ID,
et,prov,doPrint, eta_min, eta_max, eta0, phi_min, phi_max,
phi0);
277 for(
auto tmpTower : *my_jTowerContainerRaw){
278 tmpTower->Do_LAr_encoding();
281 return StatusCode::SUCCESS;
288 LVL1::jTower * tmpTower = my_jTowerContainerRaw->findTower(iJTower);
295 int jSuperCellTowerMapper::FindAndConnectTower(std::unique_ptr<jTowerContainer> & my_jTowerContainerRaw,
CaloSampling::CaloSample sample,
const int region,
int layer,
const int pos_neg,
const int eta_index,
const int phi_index,
Identifier ID,
float et,
int prov,
bool doPrint,
float eta_min,
float eta_max,
float eta0,
float phi_min,
float phi_max,
float phi0)
const
299 bool doenergysplit =
false;
302 bool validcell =
true;
309 int towerID_Modifier = -999999999;
405 towerphi = phi_index;
409 towerID_Modifier = 300000;
411 else if(pos_neg > 0) {
412 towerID_Modifier = 400000;
418 towerID_Modifier = 100000;
420 else if(pos_neg > 0) {
421 towerID_Modifier = 200000;
440 towerphi = phi_index;
442 towerID_Modifier = 100000;
444 else if(pos_neg > 0) {
445 towerID_Modifier = 200000;
448 else if (region == 1) {
450 towerphi = phi_index;
452 towerID_Modifier = 300000;
454 else if(pos_neg > 0) {
455 towerID_Modifier = 400000;
459 ATH_MSG_DEBUG(
"[CaloSampling::EMB1 or CaloSampling::EMB2] -> invalid 'region' value: " << region <<
" (Under investigation) ");
476 ATH_MSG_DEBUG(
"CaloSampling::EMBX -> invalid sample for assigning iCell value! " <<
sample <<
" (Under investigation) ");
490 towerphi = phi_index;
495 towerID_Modifier = 100000;
497 else if(pos_neg > 0) {
498 towerID_Modifier = 200000;
511 towerphi = phi_index;
516 towerID_Modifier = 500000;
518 else if(pos_neg > 0) {
519 towerID_Modifier = 600000;
549 towerphi = phi_index;
557 towerphi = phi_index;
567 towerphi = phi_index;
604 towerphi = phi_index;
613 towerphi = phi_index;
620 ATH_MSG_DEBUG(
"CaloSampling::EME1 -> invalid 'region' value: " << region <<
" (Under investigation) ");
628 towerID_Modifier = 500000;
630 else if(pos_neg > 0) {
631 towerID_Modifier = 600000;
634 else if(region == 0) {
637 towerID_Modifier = 300000;
639 else if(pos_neg > 0) {
640 towerID_Modifier = 400000;
680 switch (std::abs(pos_neg)) {
683 towerphi = phi_index;
688 towerphi = phi_index;
692 ATH_MSG_DEBUG(
"CaloSampling::EME2 -> invalid 'pos_neg' value: " << pos_neg <<
" (Under investigation) ");
703 switch (std::abs(pos_neg)) {
706 towerphi = phi_index;
711 towerphi = phi_index;
715 ATH_MSG_DEBUG(
"CaloSampling::EME2 -> invalid 'pos_neg' value: " << pos_neg <<
" (Under investigation) ");
726 ATH_MSG_DEBUG(
"CaloSampling::EME2 -> invalid 'region' value: " << region <<
" (Under investigation) ");
778 towerID_Modifier = 300000;
780 else if(pos_neg > 0) {
781 towerID_Modifier = 400000;
786 towerID_Modifier = 500000;
788 else if(pos_neg > 0) {
789 towerID_Modifier = 600000;
796 if(pos_neg < 0 && pos_neg > -3) {
797 towerID_Modifier = 300000;
799 else if(pos_neg > 0 && pos_neg < 3) {
800 towerID_Modifier = 400000;
804 if(pos_neg < 0 && pos_neg >= -3) {
805 towerID_Modifier = 500000;
807 else if(pos_neg > 0 && pos_neg <= 3) {
808 towerID_Modifier = 600000;
814 towerID_Modifier = 500000;
816 else if(pos_neg > 0) {
817 towerID_Modifier = 600000;
853 towerphi = phi_index;
861 towerphi = phi_index;
866 ATH_MSG_DEBUG(
"CaloSampling::EME3 -> invalid 'region' value: " << region <<
" (Under investigation) ");
873 towerID_Modifier = 500000;
875 else if(pos_neg > 0) {
876 towerID_Modifier = 600000;
893 towerphi = phi_index;
901 towerphi = phi_index;
912 towerphi = phi_index;
926 towerID_Modifier = 500000;
928 else if(pos_neg > 0) {
929 towerID_Modifier = 600000;
940 ATH_MSG_DEBUG(
"\n==== jSuperCellTowerMapper ============ Supercell is from Tile Barrel - it will be ignored.");
946 ATH_MSG_DEBUG(
"\n==== jSuperCellTowerMapper ============ Supercell is from Tile Gap (ITC and scintillator) - it will be ignored.");
954 ATH_MSG_DEBUG(
"\n==== jSuperCellTowerMapper ============ Supercell is from Tile Extended Barrel - it will be ignored.");
969 towerID_Modifier = 700000;
971 else if(pos_neg > 0) {
972 towerID_Modifier = 800000;
980 towerID_Modifier = 900000;
982 else if(pos_neg > 0) {
983 towerID_Modifier = 1000000;
991 towerID_Modifier = 1100000;
993 else if(pos_neg > 0) {
994 towerID_Modifier = 1200000;
1006 towerphi = phi_index;
1011 case CaloSampling::MINIFCAL0:
1012 case CaloSampling::MINIFCAL1:
1013 case CaloSampling::MINIFCAL2:
1014 case CaloSampling::MINIFCAL3: {
1015 ATH_MSG_DEBUG(
"\n==== jSuperCellTowerMapper ============ Supercells is from MiniFCAL - it will be ignored.");
1020 ATH_MSG_WARNING(
"\n==== jSuperCellTowerMapper ============ Supercell sampling is officially unknown - it will be ignored. (Needs investigation). Please report this!");
1025 ATH_MSG_DEBUG(
"\n==== jSuperCellTowerMapper ============ Supercell has invalid CaloSampling value: " <<
sample <<
" (Needs investigation). Please report this!");
1041 PrintCellSpec(
sample,
layer, region,
eta_index, phi_index, pos_neg, iJTower, iCell, prov,
ID, doenergysplit, eta_min, eta_max, eta0, phi_min, phi_max,
phi0);
1048 PrintCellSpec(
sample,
layer, region,
eta_index, phi_index, pos_neg, iJTower, iCell, prov,
ID, doenergysplit, eta_min, eta_max, eta0, phi_min, phi_max,
phi0,
false);
1060 return (towerphi + (64 * towereta));
1063 void jSuperCellTowerMapper::PrintCellSpec(
const CaloSampling::CaloSample sample,
int layer,
const int region,
const int eta_index,
const int phi_index,
const int pos_neg,
int iJTower,
int iCell,
int prov,
Identifier ID ,
bool doenergysplit,
float eta_min,
float eta_max,
float eta0,
float phi_min,
float phi_max,
float phi0,
bool cellValid)
const
1066 std::string sampleName =
"";
1085 ATH_MSG_DEBUG(
"\n==== jSuperCellTowerMapper ============ Supercell has invalid CaloSampling value: " <<
sample <<
" (Needs investigation). Please report this!");
1092 <<
"\tSample: " <<
sample
1093 <<
"\tLayer: " <<
layer
1094 <<
"\tRegion: " << region
1095 <<
"\tEta0: " << eta0
1096 <<
"\tEta_min: " << eta_min
1097 <<
"\tEta_max: " << eta_max
1099 <<
"\tPhi0: " <<
phi0
1100 <<
"\tPhi_min: " << phi_min
1101 <<
"\tPhi_max: " << phi_max
1102 <<
"\tPhi_Index: " << phi_index
1103 <<
"\tPosNeg: " << pos_neg
1104 <<
"\tiJTower: " << iJTower
1105 <<
"\tiCell: " << iCell
1106 <<
"\tDoEnergySplit: " << doenergysplit
1107 <<
"\tProvenance: " << prov
1112 ATH_MSG_DEBUG(
"INVALID CELL IDENTIFIED::: CASE: " << sampleName
1113 <<
"\tSample: " <<
sample
1114 <<
"\tLayer: " <<
layer
1115 <<
"\tRegion: " << region
1116 <<
"\tEta0: " << eta0
1117 <<
"\tEta_min: " << eta_min
1118 <<
"\tEta_max: " << eta_max
1120 <<
"\tPhi0: " <<
phi0
1121 <<
"\tPhi_min: " << phi_min
1122 <<
"\tPhi_max: " << phi_max
1123 <<
"\tPhi_Index: " << phi_index
1124 <<
"\tPosNeg: " << pos_neg
1125 <<
"\tiJTower: " << iJTower
1126 <<
"\tiCell: " << iCell
1127 <<
"\tDoEnergySplit: " << doenergysplit
1128 <<
"\tProvenance: " << prov
1138 std::string sampleName =
"";
1156 ATH_MSG_DEBUG(
"\n==== jSuperCellTowerMapper ============ Supercell has invalid CaloSampling value: " <<
sample <<
" (Needs investigation). Please report this!");
1157 sampleName =
"----";