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;
94 if(!scellsCollection.
isValid()) {
96 return StatusCode::FAILURE;
103 for (
const CaloCell* cell : * scellsCollection) {
107 int region = idHelper->
region(ID);
109 int pos_neg = idHelper->
pos_neg(ID);
110 int eta_index = idHelper->
eta(ID);
111 const int phi_index = idHelper->
phi(ID);
112 float et = (cell)->energy()/cosh((cell)->
eta());
113 int prov = (cell)->provenance();
117 float eta_max = idHelper->
eta_max(ID);
118 float eta0 = idHelper->
eta0(ID);
120 float phi_max = idHelper->
phi_max(ID);
121 float phi0 = idHelper->
phi0(ID);
170 case CaloSampling::PreSamplerB: {
173 case CaloSampling::EMB1: {
179 case CaloSampling::EMB2: {
185 case CaloSampling::EMB3: {
188 case CaloSampling::PreSamplerE: {
192 case CaloSampling::EME1: {
196 else if (region == 1) { }
197 else if (region == 2) {
200 else if (region == 3) {
203 else if (region == 4) {
206 else if (region == 5) {
211 case CaloSampling::EME2: {
220 else if (region == 1) {
230 case CaloSampling::EME3: {
240 else if (region == 1) {
251 case CaloSampling::HEC0:
252 case CaloSampling::HEC1:
253 case CaloSampling::HEC2:
254 case CaloSampling::HEC3: {
258 else if (region == 1){
269 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);
274 for(
auto tmpTower : *my_jTowerContainerRaw){
275 tmpTower->Do_LAr_encoding();
278 return StatusCode::SUCCESS;
292int 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
296 bool doenergysplit =
false;
299 bool validcell =
true;
306 int towerID_Modifier = -999999999;
394 case CaloSampling::PreSamplerB: {
401 towereta = eta_index;
402 towerphi = phi_index;
404 if(eta_index == 14) {
406 towerID_Modifier = 300000;
408 else if(pos_neg > 0) {
409 towerID_Modifier = 400000;
415 towerID_Modifier = 100000;
417 else if(pos_neg > 0) {
418 towerID_Modifier = 200000;
425 case CaloSampling::EMB1:
426 case CaloSampling::EMB2: {
436 towereta = eta_index / 4;
437 towerphi = phi_index;
439 towerID_Modifier = 100000;
441 else if(pos_neg > 0) {
442 towerID_Modifier = 200000;
445 else if (region == 1) {
447 towerphi = phi_index;
449 towerID_Modifier = 300000;
451 else if(pos_neg > 0) {
452 towerID_Modifier = 400000;
456 ATH_MSG_DEBUG(
"[CaloSampling::EMB1 or CaloSampling::EMB2] -> invalid 'region' value: " << region <<
" (Under investigation) ");
460 case CaloSampling::EMB1: {
465 case CaloSampling::EMB2: {
473 ATH_MSG_DEBUG(
"CaloSampling::EMBX -> invalid sample for assigning iCell value! " << sample <<
" (Under investigation) ");
480 case CaloSampling::EMB3: {
486 towereta = eta_index;
487 towerphi = phi_index;
492 towerID_Modifier = 100000;
494 else if(pos_neg > 0) {
495 towerID_Modifier = 200000;
501 case CaloSampling::PreSamplerE: {
507 towereta = eta_index;
508 towerphi = phi_index;
513 towerID_Modifier = 500000;
515 else if(pos_neg > 0) {
516 towerID_Modifier = 600000;
521 case CaloSampling::EME1: {
545 towereta = eta_index;
546 towerphi = phi_index;
553 towereta = (eta_index / 4);
554 towerphi = phi_index;
563 towereta = (eta_index / 6);
564 towerphi = phi_index;
600 towereta = (eta_index / 4);
601 towerphi = phi_index;
609 towereta = eta_index ;
610 towerphi = phi_index;
617 ATH_MSG_DEBUG(
"CaloSampling::EME1 -> invalid 'region' value: " << region <<
" (Under investigation) ");
625 towerID_Modifier = 500000;
627 else if(pos_neg > 0) {
628 towerID_Modifier = 600000;
631 else if(region == 0) {
634 towerID_Modifier = 300000;
636 else if(pos_neg > 0) {
637 towerID_Modifier = 400000;
643 case CaloSampling::EME2: {
677 switch (std::abs(pos_neg)) {
679 towereta = eta_index;
680 towerphi = phi_index;
684 towereta = eta_index;
685 towerphi = phi_index;
689 ATH_MSG_DEBUG(
"CaloSampling::EME2 -> invalid 'pos_neg' value: " << pos_neg <<
" (Under investigation) ");
700 switch (std::abs(pos_neg)) {
702 towereta = (eta_index / 4);
703 towerphi = phi_index;
707 towereta = eta_index;
708 towerphi = phi_index;
712 ATH_MSG_DEBUG(
"CaloSampling::EME2 -> invalid 'pos_neg' value: " << pos_neg <<
" (Under investigation) ");
723 ATH_MSG_DEBUG(
"CaloSampling::EME2 -> invalid 'region' value: " << region <<
" (Under investigation) ");
775 towerID_Modifier = 300000;
777 else if(pos_neg > 0) {
778 towerID_Modifier = 400000;
783 towerID_Modifier = 500000;
785 else if(pos_neg > 0) {
786 towerID_Modifier = 600000;
793 if(pos_neg < 0 && pos_neg > -3) {
794 towerID_Modifier = 300000;
796 else if(pos_neg > 0 && pos_neg < 3) {
797 towerID_Modifier = 400000;
801 if(pos_neg < 0 && pos_neg >= -3) {
802 towerID_Modifier = 500000;
804 else if(pos_neg > 0 && pos_neg <= 3) {
805 towerID_Modifier = 600000;
811 towerID_Modifier = 500000;
813 else if(pos_neg > 0) {
814 towerID_Modifier = 600000;
822 case CaloSampling::EME3: {
849 towereta = eta_index;
850 towerphi = phi_index;
857 towereta = eta_index;
858 towerphi = phi_index;
863 ATH_MSG_DEBUG(
"CaloSampling::EME3 -> invalid 'region' value: " << region <<
" (Under investigation) ");
870 towerID_Modifier = 500000;
872 else if(pos_neg > 0) {
873 towerID_Modifier = 600000;
879 case CaloSampling::HEC0:
880 case CaloSampling::HEC1:
881 case CaloSampling::HEC2:
882 case CaloSampling::HEC3: {
889 towereta = eta_index;
890 towerphi = phi_index;
897 towereta = eta_index;
898 towerphi = phi_index;
908 towereta = eta_index;
909 towerphi = phi_index;
923 towerID_Modifier = 500000;
925 else if(pos_neg > 0) {
926 towerID_Modifier = 600000;
931 case CaloSampling::TileBar0:
932 case CaloSampling::TileBar1:
933 case CaloSampling::TileBar2: {
937 ATH_MSG_DEBUG(
"\n==== jSuperCellTowerMapper ============ Supercell is from Tile Barrel - it will be ignored.");
940 case CaloSampling::TileGap1:
941 case CaloSampling::TileGap2:
942 case CaloSampling::TileGap3: {
943 ATH_MSG_DEBUG(
"\n==== jSuperCellTowerMapper ============ Supercell is from Tile Gap (ITC and scintillator) - it will be ignored.");
948 case CaloSampling::TileExt0:
949 case CaloSampling::TileExt1:
950 case CaloSampling::TileExt2: {
951 ATH_MSG_DEBUG(
"\n==== jSuperCellTowerMapper ============ Supercell is from Tile Extended Barrel - it will be ignored.");
956 case CaloSampling::FCAL0:
957 case CaloSampling::FCAL1:
958 case CaloSampling::FCAL2: {
964 case CaloSampling::FCAL0: {
966 towerID_Modifier = 700000;
968 else if(pos_neg > 0) {
969 towerID_Modifier = 800000;
975 case CaloSampling::FCAL1: {
977 towerID_Modifier = 900000;
979 else if(pos_neg > 0) {
980 towerID_Modifier = 1000000;
986 case CaloSampling::FCAL2: {
988 towerID_Modifier = 1100000;
990 else if(pos_neg > 0) {
991 towerID_Modifier = 1200000;
1003 towereta = eta_index;
1004 towerphi = phi_index;
1009 case CaloSampling::MINIFCAL0:
1010 case CaloSampling::MINIFCAL1:
1011 case CaloSampling::MINIFCAL2:
1012 case CaloSampling::MINIFCAL3: {
1013 ATH_MSG_DEBUG(
"\n==== jSuperCellTowerMapper ============ Supercells is from MiniFCAL - it will be ignored.");
1017 case CaloSampling::Unknown: {
1018 ATH_MSG_WARNING(
"\n==== jSuperCellTowerMapper ============ Supercell sampling is officially unknown - it will be ignored. (Needs investigation). Please report this!");
1023 ATH_MSG_DEBUG(
"\n==== jSuperCellTowerMapper ============ Supercell has invalid CaloSampling value: " << sample <<
" (Needs investigation). Please report this!");
1039 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);
1046 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);
1061 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
1064 std::string sampleName =
"";
1067 case CaloSampling::PreSamplerB: { sampleName =
"PreSamplerB";
break; }
1068 case CaloSampling::EMB1: { sampleName =
"EMB1";
break; }
1069 case CaloSampling::EMB2: { sampleName =
"EMB2";
break; }
1070 case CaloSampling::EMB3: { sampleName =
"EMB3";
break; }
1071 case CaloSampling::PreSamplerE: { sampleName =
"PreSamplerE";
break; }
1072 case CaloSampling::EME1: { sampleName =
"EME1";
break; }
1073 case CaloSampling::EME2: { sampleName =
"EME2";
break; }
1074 case CaloSampling::EME3: { sampleName =
"EME3";
break; }
1075 case CaloSampling::HEC0: { sampleName =
"HEC0";
break; }
1076 case CaloSampling::HEC1: { sampleName =
"HEC1";
break; }
1077 case CaloSampling::HEC2: { sampleName =
"HEC2";
break; }
1078 case CaloSampling::HEC3: { sampleName =
"HEC3";
break; }
1079 case CaloSampling::FCAL0: { sampleName =
"FCAL0";
break; }
1080 case CaloSampling::FCAL1: { sampleName =
"FCAL1";
break; }
1081 case CaloSampling::FCAL2: { sampleName =
"FCAL2";
break; }
1083 ATH_MSG_DEBUG(
"\n==== jSuperCellTowerMapper ============ Supercell has invalid CaloSampling value: " << sample <<
" (Needs investigation). Please report this!");
1090 <<
"\tSample: " << sample
1091 <<
"\tLayer: " << layer
1092 <<
"\tRegion: " << region
1093 <<
"\tEta0: " << eta0
1094 <<
"\tEta_min: " << eta_min
1095 <<
"\tEta_max: " << eta_max
1096 <<
"\tEta_Index: " << eta_index
1097 <<
"\tPhi0: " << phi0
1098 <<
"\tPhi_min: " << phi_min
1099 <<
"\tPhi_max: " << phi_max
1100 <<
"\tPhi_Index: " << phi_index
1101 <<
"\tPosNeg: " << pos_neg
1102 <<
"\tiJTower: " << iJTower
1103 <<
"\tiCell: " << iCell
1104 <<
"\tDoEnergySplit: " << doenergysplit
1105 <<
"\tProvenance: " << prov
1110 ATH_MSG_DEBUG(
"INVALID CELL IDENTIFIED::: CASE: " << sampleName
1111 <<
"\tSample: " << sample
1112 <<
"\tLayer: " << layer
1113 <<
"\tRegion: " << region
1114 <<
"\tEta0: " << eta0
1115 <<
"\tEta_min: " << eta_min
1116 <<
"\tEta_max: " << eta_max
1117 <<
"\tEta_Index: " << eta_index
1118 <<
"\tPhi0: " << phi0
1119 <<
"\tPhi_min: " << phi_min
1120 <<
"\tPhi_max: " << phi_max
1121 <<
"\tPhi_Index: " << phi_index
1122 <<
"\tPosNeg: " << pos_neg
1123 <<
"\tiJTower: " << iJTower
1124 <<
"\tiCell: " << iCell
1125 <<
"\tDoEnergySplit: " << doenergysplit
1126 <<
"\tProvenance: " << prov
1136 std::string sampleName =
"";
1138 case CaloSampling::PreSamplerB: { sampleName =
"PreSamplerB";
break; }
1139 case CaloSampling::EMB1: { sampleName =
"EMB1";
break; }
1140 case CaloSampling::EMB2: { sampleName =
"EMB2";
break; }
1141 case CaloSampling::EMB3: { sampleName =
"EMB3";
break; }
1142 case CaloSampling::PreSamplerE: { sampleName =
"PreSamplerE";
break; }
1143 case CaloSampling::EME1: { sampleName =
"EME1";
break; }
1144 case CaloSampling::EME2: { sampleName =
"EME2";
break; }
1145 case CaloSampling::EME3: { sampleName =
"EME3";
break; }
1146 case CaloSampling::HEC0: { sampleName =
"HEC0";
break; }
1147 case CaloSampling::HEC1: { sampleName =
"HEC1";
break; }
1148 case CaloSampling::HEC2: { sampleName =
"HEC2";
break; }
1149 case CaloSampling::HEC3: { sampleName =
"HEC3";
break; }
1150 case CaloSampling::FCAL0: { sampleName =
"FCAL0";
break; }
1151 case CaloSampling::FCAL1: { sampleName =
"FCAL1";
break; }
1152 case CaloSampling::FCAL2: { sampleName =
"FCAL2";
break; }
1154 ATH_MSG_DEBUG(
"\n==== jSuperCellTowerMapper ============ Supercell has invalid CaloSampling value: " << sample <<
" (Needs investigation). Please report this!");
1155 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