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 =
static_cast<int>(eachTower->phi()/pi_over_32);
58 int towerID_Modifier{100000};
59 if (eachTower->eta() > 0) {
61 towerID_Modifier = 200000;
63 int i_eta =
static_cast<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!");
77 targetTower->
set_TileCal_Et(1,
static_cast<int>(eachTower->cpET()) * 500.);
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;
106 for (
const CaloCell* cell : * scellsCollection) {
113 int eta_index = idHelper->
eta(
ID);
114 const int phi_index = idHelper->
phi(
ID);
115 float et = (cell)->energy()/cosh((cell)->
eta());
116 int prov = (cell)->provenance();
121 float eta0 = idHelper->
eta0(
ID);
124 float phi0 = idHelper->
phi0(
ID);
173 case CaloSampling::PreSamplerB: {
176 case CaloSampling::EMB1: {
182 case CaloSampling::EMB2: {
188 case CaloSampling::EMB3: {
191 case CaloSampling::PreSamplerE: {
195 case CaloSampling::EME1: {
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) {
214 case CaloSampling::EME2: {
223 else if (region == 1) {
233 case CaloSampling::EME3: {
243 else if (region == 1) {
254 case CaloSampling::HEC0:
255 case CaloSampling::HEC1:
256 case CaloSampling::HEC2:
257 case CaloSampling::HEC3: {
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;
295int 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;
397 case CaloSampling::PreSamplerB: {
404 towereta = eta_index;
405 towerphi = phi_index;
407 if(eta_index == 14) {
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;
428 case CaloSampling::EMB1:
429 case CaloSampling::EMB2: {
439 towereta = eta_index / 4;
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) ");
463 case CaloSampling::EMB1: {
468 case CaloSampling::EMB2: {
476 ATH_MSG_DEBUG(
"CaloSampling::EMBX -> invalid sample for assigning iCell value! " << sample <<
" (Under investigation) ");
483 case CaloSampling::EMB3: {
489 towereta = eta_index;
490 towerphi = phi_index;
495 towerID_Modifier = 100000;
497 else if(pos_neg > 0) {
498 towerID_Modifier = 200000;
504 case CaloSampling::PreSamplerE: {
510 towereta = eta_index;
511 towerphi = phi_index;
516 towerID_Modifier = 500000;
518 else if(pos_neg > 0) {
519 towerID_Modifier = 600000;
524 case CaloSampling::EME1: {
548 towereta = eta_index;
549 towerphi = phi_index;
556 towereta = (eta_index / 4);
557 towerphi = phi_index;
566 towereta = (eta_index / 6);
567 towerphi = phi_index;
603 towereta = (eta_index / 4);
604 towerphi = phi_index;
612 towereta = eta_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;
646 case CaloSampling::EME2: {
680 switch (std::abs(pos_neg)) {
682 towereta = eta_index;
683 towerphi = phi_index;
687 towereta = eta_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)) {
705 towereta = (eta_index / 4);
706 towerphi = phi_index;
710 towereta = eta_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;
825 case CaloSampling::EME3: {
852 towereta = eta_index;
853 towerphi = phi_index;
860 towereta = eta_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;
882 case CaloSampling::HEC0:
883 case CaloSampling::HEC1:
884 case CaloSampling::HEC2:
885 case CaloSampling::HEC3: {
892 towereta = eta_index;
893 towerphi = phi_index;
900 towereta = eta_index;
901 towerphi = phi_index;
911 towereta = eta_index;
912 towerphi = phi_index;
926 towerID_Modifier = 500000;
928 else if(pos_neg > 0) {
929 towerID_Modifier = 600000;
934 case CaloSampling::TileBar0:
935 case CaloSampling::TileBar1:
936 case CaloSampling::TileBar2: {
940 ATH_MSG_DEBUG(
"\n==== jSuperCellTowerMapper ============ Supercell is from Tile Barrel - it will be ignored.");
943 case CaloSampling::TileGap1:
944 case CaloSampling::TileGap2:
945 case CaloSampling::TileGap3: {
946 ATH_MSG_DEBUG(
"\n==== jSuperCellTowerMapper ============ Supercell is from Tile Gap (ITC and scintillator) - it will be ignored.");
951 case CaloSampling::TileExt0:
952 case CaloSampling::TileExt1:
953 case CaloSampling::TileExt2: {
954 ATH_MSG_DEBUG(
"\n==== jSuperCellTowerMapper ============ Supercell is from Tile Extended Barrel - it will be ignored.");
959 case CaloSampling::FCAL0:
960 case CaloSampling::FCAL1:
961 case CaloSampling::FCAL2: {
967 case CaloSampling::FCAL0: {
969 towerID_Modifier = 700000;
971 else if(pos_neg > 0) {
972 towerID_Modifier = 800000;
978 case CaloSampling::FCAL1: {
980 towerID_Modifier = 900000;
982 else if(pos_neg > 0) {
983 towerID_Modifier = 1000000;
989 case CaloSampling::FCAL2: {
991 towerID_Modifier = 1100000;
993 else if(pos_neg > 0) {
994 towerID_Modifier = 1200000;
1005 towereta = eta_index;
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.");
1019 case CaloSampling::Unknown: {
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);
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 =
"";
1069 case CaloSampling::PreSamplerB: { sampleName =
"PreSamplerB";
break; }
1070 case CaloSampling::EMB1: { sampleName =
"EMB1";
break; }
1071 case CaloSampling::EMB2: { sampleName =
"EMB2";
break; }
1072 case CaloSampling::EMB3: { sampleName =
"EMB3";
break; }
1073 case CaloSampling::PreSamplerE: { sampleName =
"PreSamplerE";
break; }
1074 case CaloSampling::EME1: { sampleName =
"EME1";
break; }
1075 case CaloSampling::EME2: { sampleName =
"EME2";
break; }
1076 case CaloSampling::EME3: { sampleName =
"EME3";
break; }
1077 case CaloSampling::HEC0: { sampleName =
"HEC0";
break; }
1078 case CaloSampling::HEC1: { sampleName =
"HEC1";
break; }
1079 case CaloSampling::HEC2: { sampleName =
"HEC2";
break; }
1080 case CaloSampling::HEC3: { sampleName =
"HEC3";
break; }
1081 case CaloSampling::FCAL0: { sampleName =
"FCAL0";
break; }
1082 case CaloSampling::FCAL1: { sampleName =
"FCAL1";
break; }
1083 case CaloSampling::FCAL2: { sampleName =
"FCAL2";
break; }
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
1098 <<
"\tEta_Index: " << eta_index
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
1119 <<
"\tEta_Index: " << eta_index
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 =
"";
1140 case CaloSampling::PreSamplerB: { sampleName =
"PreSamplerB";
break; }
1141 case CaloSampling::EMB1: { sampleName =
"EMB1";
break; }
1142 case CaloSampling::EMB2: { sampleName =
"EMB2";
break; }
1143 case CaloSampling::EMB3: { sampleName =
"EMB3";
break; }
1144 case CaloSampling::PreSamplerE: { sampleName =
"PreSamplerE";
break; }
1145 case CaloSampling::EME1: { sampleName =
"EME1";
break; }
1146 case CaloSampling::EME2: { sampleName =
"EME2";
break; }
1147 case CaloSampling::EME3: { sampleName =
"EME3";
break; }
1148 case CaloSampling::HEC0: { sampleName =
"HEC0";
break; }
1149 case CaloSampling::HEC1: { sampleName =
"HEC1";
break; }
1150 case CaloSampling::HEC2: { sampleName =
"HEC2";
break; }
1151 case CaloSampling::HEC3: { sampleName =
"HEC3";
break; }
1152 case CaloSampling::FCAL0: { sampleName =
"FCAL0";
break; }
1153 case CaloSampling::FCAL1: { sampleName =
"FCAL1";
break; }
1154 case CaloSampling::FCAL2: { sampleName =
"FCAL2";
break; }
1156 ATH_MSG_DEBUG(
"\n==== jSuperCellTowerMapper ============ Supercell has invalid CaloSampling value: " << sample <<
" (Needs investigation). Please report this!");
1157 sampleName =
"----";
virtual int 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 override
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, float eta_min, float eta_max, float eta0, float phi_min, float phi_max, float phi0, bool cellValid=true) const override