12 m_caloHelper(caloId), m_hvlineHelper(hvId), m_electrodeHelper(elId)
27 std::map<HWIdentifier,HWIdentifier>::const_iterator elecIt = m_electrode_hvline_map.find(electrodeId);
28 if(elecIt != m_electrode_hvline_map.end()) {
74 HWIdentifier invalidId = m_hvlineHelper->HVLineId(0,0,0,0);
88 std::map<HWIdentifier,std::vector<HWIdentifier> >::const_iterator elecIt=m_hvline_electrode_map.find(hvlineId);
89 if( elecIt != m_hvline_electrode_map.end()){
90 return (elecIt)->second;
133 if( m_caloHelper->is_em( offId ) ){
134 bec = m_emHelper->barrel_ec(offId);
135 sampling = m_emHelper->sampling(offId);
136 region = m_emHelper->region(offId);
137 phi = m_emHelper->phi(offId);
140 else if( m_caloHelper->is_hec( offId ) ){
141 bec = m_hecHelper->pos_neg(offId)*10;
142 sampling = m_hecHelper->sampling(offId);
143 region = m_hecHelper->region(offId);
144 phi = m_hecHelper->phi(offId);
147 else if( m_caloHelper->is_fcal( offId )){
148 bec = m_fcalHelper->pos_neg(offId)*20;
149 sampling = m_fcalHelper->module(offId);
151 phi = m_fcalHelper->phi(offId);
180 int phi_module=
int(
phi/2);
181 ModuleID = phi_module;
183 else if( sampling == 1 && region == 0 ){
187 int phi_module =
int((
phi+2)/4);
188 if( phi_module == 16 ){
192 ModuleID = phi_module;
195 else if( sampling == 2 || sampling == 3 || (sampling == 1 && region == 1 ) ){
199 int phi_module =
int((
phi+8)/16);
200 if( phi_module == 16 ){
209 else if(
bec == -1 ){
216 int phi_module=
int(
phi/2);
217 if( phi_module <= 15 ){
218 phi_module = 15 - phi_module;
221 phi_module = 47 - phi_module;
223 ModuleID = phi_module;
225 else if( sampling == 1 && region == 0 ){
229 int phi_module =
int((
phi+2)/4);
230 if( phi_module <= 8){
231 phi_module = 8 - phi_module;
234 phi_module = 24 - phi_module;
236 ModuleID = phi_module;
238 else if( sampling == 2 || sampling == 3 || (sampling == 1 && region == 1 ) ){
242 int phi_module =
int((
phi+8)/16);
243 if( phi_module <= 8){
244 phi_module = 8 - phi_module;
247 phi_module = 24 - phi_module;
249 ModuleID = phi_module;
254 else if( abs(
bec) == 2 || abs(
bec) == 3){
274 if( sampling == 0 || sampling == 1 ||
275 (sampling == 2 && abs(
bec) == 3 ) ){
281 int phi_local =
int(
phi/8);
282 ModuleID = phi_local;
284 else if( (sampling == 2 && abs(
bec) == 2) || (sampling == 3 && abs(
bec) == 2)){
290 int phi_local =
int(
phi/32);
291 ModuleID = phi_local;
296 if( sampling == 0 || sampling == 1 ||
297 (sampling == 2 && abs(
bec) == 3 ) ){
304 int phi_local =
int(
phi/8);
305 if( phi_local == 0 ){rev_phi = 3;}
306 if( phi_local == 1 ){rev_phi = 2;}
307 if( phi_local == 2 ){rev_phi = 1;}
308 if( phi_local == 3 ){rev_phi = 0;}
309 if( phi_local == 4 ){rev_phi = 7;}
310 if( phi_local == 5 ){rev_phi = 6;}
311 if( phi_local == 6 ){rev_phi = 5;}
312 if( phi_local == 7 ){rev_phi = 4;}
315 else if( (sampling == 2 && abs(
bec) == 2) || (sampling == 3 && abs(
bec) == 2)){
322 int phi_local =
int(
phi/32);
323 if( phi_local == 0 ){rev_phi = 3;}
324 if( phi_local == 1 ){rev_phi = 2;}
325 if( phi_local == 2 ){rev_phi = 1;}
326 if( phi_local == 3 ){rev_phi = 0;}
327 if( phi_local == 4 ){rev_phi = 7;}
328 if( phi_local == 5 ){rev_phi = 6;}
329 if( phi_local == 6 ){rev_phi = 5;}
330 if( phi_local == 7 ){rev_phi = 4;}
337 else if( abs(
bec) == 20 ){
347 int phi_module=
int(
phi/2);
348 ModuleID = phi_module;
350 else if( region == 1){
356 ModuleID = phi_module;
364 int phi_module=
int(
phi/2);
365 if( phi_module <= 15 ){
366 phi_module = 15 - phi_module;
369 phi_module = 47 - phi_module;
371 ModuleID = phi_module;
373 else if( region == 1){
377 if( phi_module <= 15 ){
378 phi_module = 15 - phi_module;
381 phi_module = 47 - phi_module;
383 ModuleID = phi_module;
403 else if( abs(
bec) == 40 ){
413 else if( sampling == 2 ){
416 else if( sampling == 3){
445 std::string l_version = m_emHelper->dictionaryVersion();
454 if( m_caloHelper->is_em( offId ) ){
455 l_bec = m_emHelper->barrel_ec(offId);
456 sampling = m_emHelper->sampling(offId);
457 region = m_emHelper->region(offId);
458 ieta = m_emHelper->eta(offId);
460 else if( m_caloHelper->is_hec( offId ) ){
461 l_bec = m_hecHelper->pos_neg(offId)*10;
462 sampling = m_hecHelper->sampling(offId);
463 region = m_hecHelper->region(offId);
464 ieta = m_hecHelper->eta(offId);
466 else if( m_caloHelper->is_fcal( offId ) ){
467 l_bec = m_fcalHelper->pos_neg(offId)*20;
468 sampling = m_fcalHelper->module(offId);
477 if( abs(l_bec) == 1 ){
482 if( ieta >= 0 && ieta < 64 ){
485 else if( ieta >=64 && ieta < 128 ){
488 else if( ieta >=128 && ieta < 192 ){
491 else if( ieta >=192 && ieta < 256 ){
494 else if( ieta >=256 && ieta < 320 ){
497 else if( ieta >=320 && ieta < 384 ){
500 else if( ieta >=384 && ieta < 448 ){
504 else if( region == 1){
511 else if( sampling == 2 ){
516 if( ieta >= 0 && ieta < 8 ){
519 else if( ieta >=8 && ieta < 16 ){
522 else if( ieta >=16 && ieta < 24 ){
525 else if( ieta >=24 && ieta < 32 ){
528 else if( ieta >=32 && ieta < 40 ){
531 else if( ieta >=40 && ieta < 48 ){
534 else if( ieta >=48 && ieta < 57 ){
538 else if( region == 1)
547 else if( sampling == 3 ){
552 if( ieta >= 0 && ieta < 4 ){
555 else if( ieta >=4 && ieta < 8 ){
558 else if( ieta >=8 && ieta < 12 ){
561 else if( ieta >=12 && ieta < 16 ){
564 else if( ieta >=16 && ieta < 20 ){
567 else if( ieta >=20 && ieta < 24 ){
570 else if( ieta >=24 && ieta < 28 ){
574 else if( region == 1){
582 else if( sampling == 0 ){
588 if( ieta >= 0 && ieta < 15 ){
591 else if( ieta >=15 && ieta <30 ){
594 else if( ieta >=30 && ieta < 45 ){
597 else if( ieta >=45 && ieta < 61 ){
610 else if( abs(l_bec) == 2 || abs(l_bec) == 3){
619 if( ieta >= 0 && ieta <= 1){
622 else if(ieta >=2 && ieta <= 5){
625 else if(ieta >=6 && ieta <= 9){
628 else if(ieta >=10 && ieta <= 11){
631 else if(ieta >=12 && ieta <= 15){
634 else if(ieta >=16 && ieta <= 19){
638 else if( sampling == 2 && abs(l_bec) == 2 ){
647 else if( region == 1 ){
649 if( ieta >=0 && ieta <= 2){
652 else if( ieta >=3 && ieta <= 6){
655 else if( ieta >=7 && ieta <= 15){
658 else if( ieta >=16 && ieta <= 23){
661 else if( ieta >=24 && ieta <= 27){
664 else if( ieta >=28 && ieta <= 35){
667 else if( ieta >=36 && ieta <= 42){
673 else if( sampling == 2 && abs(l_bec) == 3 ){
679 if( ieta >=0 && ieta <= 2){
682 else if( ieta >=3 && ieta <= 6){
687 else if( sampling == 1 && abs(l_bec) == 3 ){
693 if( ieta >=0 && ieta <= 2){
696 else if( ieta >=3 && ieta <= 6){
701 else if( sampling == 1 && abs(l_bec) == 2 ){
705 if( region == 0 || region == 1)
709 else if( region == 2 ){
710 if( ieta >= 0 && ieta <= 31)
715 else if( ieta <= 95) {
720 else if(region == 3){
724 else if(region == 4){
726 if( ieta >=0 && ieta <= 15 ){
730 else if( ieta >= 16 && ieta <= 47 ){
734 else if( ieta >= 48 && ieta <= 63 ){
739 else if( region == 5 ){
747 else if( abs(l_bec)== 20 ){
753 else if( sampling == 1){
756 else if( sampling == 2){
759 else if( sampling == 3){
769 else if( abs(l_bec)== 40 ){
775 else if( sampling == 2 ){
778 else if( sampling == 3 ){
824 if( m_caloHelper->is_em( offId ) ){
825 bec = m_emHelper->barrel_ec(offId);
826 sampling = m_emHelper->sampling(offId);
827 region = m_emHelper->region(offId);
828 phi = m_emHelper->phi(offId);
830 else if( m_caloHelper->is_hec( offId ) ){
831 bec = m_hecHelper->pos_neg(offId)*10;
833 else if( m_caloHelper->is_fcal( offId ) ){
834 bec = m_fcalHelper->pos_neg(offId)*20;
858 if( sampling == 1 && region == 0 ){
864 for(
int ift=0; ift<= 15; ift++){
865 if( phi_local == ift*4 || phi_local == 1+ift*4 ){
868 if( phi_local == 2+ift*4 || phi_local == 3+ift*4 ){
873 else if( sampling == 2 || sampling == 3 || (sampling == 1 && region == 1 ) ){
878 for(
int ift=0; ift<= 15; ift++){
879 for(
int i=0;
i<=7;
i++){
880 if( phi_local ==
i+ift*16 ){
884 for(
int i=8;
i<=15;
i++){
885 if( phi_local ==
i+ift*16 ){
902 if( sampling == 1 && region == 0 ){
907 for(
int ift=0; ift<= 15; ift++){
908 if( phi_local == ift*4 || phi_local == 1+ift*4 ){
911 if( phi_local == 2+ift*4 || phi_local == 3+ift*4 ){
916 else if( sampling == 2 || sampling == 3 || (sampling == 1 && region == 1 ) ){
919 for(
int ift=0; ift<= 15; ift++){
920 for(
int i=0;
i<=7;
i++){
921 if( phi_local ==
i+ift*16 ){
925 for(
int i=8;
i<=15;
i++){
926 if( phi_local ==
i+ift*16 ){
935 else if( abs(
bec) == 2 || abs(
bec) == 3 ){
939 if( sampling == 1 && abs(
bec) == 2 ){
950 int phi_local =
phi - imod*8;
951 if( phi_local == 0 || phi_local == 1){
954 else if( phi_local == 2 || phi_local == 3){
957 else if( phi_local == 4 || phi_local == 5){
960 else if( phi_local == 6 || phi_local == 7){
964 if( sampling == 1 && abs(
bec) == 3 ){
969 int phi_local =
phi-imod*8;
972 else if( sampling == 2 && abs(
bec) == 3 ){
978 int phi_local =
phi - imod*8;
981 else if( sampling == 2 && abs(
bec) == 2 ){
987 int phi_local=
phi-imod*32;
988 if( phi_local >= 0 && phi_local <= 7 ){
991 else if( phi_local >= 8 && phi_local <= 15 ){
994 else if( phi_local >= 16 && phi_local <= 23 ){
997 else if( phi_local >= 24 && phi_local <= 31 ){
1001 else if( sampling == 3 ){
1006 int imod = (
phi/32);
1007 int phi_local=
phi-imod*32;
1008 if( phi_local >= 0 && phi_local <= 7 ){
1011 else if( phi_local >= 8 && phi_local <= 15 ){
1014 else if( phi_local >= 16 && phi_local <= 23 ){
1017 else if( phi_local >= 24 && phi_local <= 31 ){
1024 if( sampling == 1 && abs(
bec) == 2 ){
1028 int phi_local =
phi-imod*8;
1029 if( phi_local == 0 || phi_local == 1){
1032 else if( phi_local == 2 || phi_local == 3){
1035 else if( phi_local == 4 || phi_local == 5){
1038 else if( phi_local == 6 || phi_local == 7){
1042 if( sampling == 1 && abs(
bec) == 3 ){
1047 int phi_local =
phi - imod*8;
1048 hvPhi = 8-(phi_local);
1050 else if( sampling == 2 && abs(
bec) == 3 ){
1054 int phi_local =
phi-imod*8;
1055 hvPhi = 8-(phi_local);
1057 else if( sampling == 2 && abs(
bec) == 2 ){
1060 int imod = (
phi/32);
1061 int phi_local=
phi-imod*32;
1062 if( phi_local >= 0 && phi_local <= 7 ){
1065 else if( phi_local >= 8 && phi_local <= 15 ){
1068 else if( phi_local >= 16 && phi_local <= 23 ){
1071 else if( phi_local >= 24 && phi_local <= 31 ){
1075 else if( sampling == 3 ){
1078 int imod = (
phi/32);
1079 int phi_local=
phi-imod*32;
1080 if( phi_local >= 0 && phi_local <= 7 ){
1083 else if( phi_local >= 8 && phi_local <= 15 ){
1086 else if( phi_local >= 16 && phi_local <= 23 ){
1089 else if( phi_local >= 24 && phi_local <= 31 ){
1096 else if( abs(
bec)==20){
1102 else if( abs(
bec)==40){
1108 std::cout<<
"Closing getCellPhiSector ...." << hvPhi <<std::endl;
1139 if( m_caloHelper->is_em( offId ) ){
1140 l_bec = m_emHelper->barrel_ec(offId);
1141 l_sampling = m_emHelper->sampling(offId);
1142 l_region = m_emHelper->region(offId);
1144 l_phi = m_emHelper->phi(offId);
1146 else if( m_caloHelper->is_hec( offId ) ){
1147 l_bec = m_hecHelper->pos_neg(offId)*10;
1148 l_sampling = m_hecHelper->sampling(offId);
1149 l_region = m_hecHelper->region(offId);
1151 l_phi = m_hecHelper->phi(offId);
1153 else if( m_caloHelper->is_fcal( offId ) ){
1154 l_bec = m_fcalHelper->pos_neg(offId)*20;
1160 if( abs(l_bec) == 1 )
1164 if( l_sampling == 0 || ( l_sampling == 1 && l_region == 0) ){
1176 int phi_module =
int((l_phi+2)/4);
1177 int phi_local = l_phi+2 - 4*phi_module;
1178 ElecMin = phi_local*16;
1179 ElecMax = ElecMin + 16-1;
1190 if( l_sampling == 0 ){
1196 else if( (l_sampling == 1 && l_region == 1) || l_sampling == 2 || l_sampling == 3 ){
1220 int phi_module =
int((l_phi+8)/16);
1222 int phi_local = l_phi+8 - 16*phi_module;
1223 ElecMin = phi_local * 4;
1224 ElecMax = ElecMin + 4 - 1;
1238 else if( l_bec == -1){
1246 if( l_sampling == 0 || ( l_sampling == 1 && l_region == 0) ){
1259 int phi_module =
int((l_phi+2)/4);
1260 int phi_local = (l_phi+2 - 4*phi_module) ;
1261 ElecMin = 48-phi_local*16;
1262 ElecMax = ElecMin + 16 - 1;
1273 if( l_sampling == 0 ){
1278 else if( (l_sampling == 1 && l_region == 1) || l_sampling == 2 || l_sampling == 3 ){
1303 int phi_module =
int((l_phi+8)/16);
1304 int phi_local = (l_phi+8 - 16*phi_module);
1307 if( phi_module <= 8){
1308 phi_module = 8 - phi_module;
1311 phi_module = 24 - phi_module;
1313 ElecMin = 60-phi_local * 4;
1314 ElecMax = ElecMin + 4 - 1;
1333 else if(abs(l_bec) == 2 || abs(l_bec) == 3){
1339 if( l_sampling == 0 ||
1340 (l_sampling == 1 && l_region >= 0 && l_region <= 5) ){
1358 int phi_module =
int(l_phi/8);
1359 int phi_local = l_phi - 8*phi_module;
1360 ElecMin = phi_local * 12;
1361 ElecMax = ElecMin + 12 - 1;
1374 else if( l_sampling == 2 || l_sampling == 3){
1389 int phi_module =
int(l_phi/32);
1390 int phi_local = l_phi - 32*phi_module;
1391 ElecMin = phi_local*3;
1392 ElecMax = ElecMin+3-1;
1406 else if( l_bec == 3 ){
1410 if( l_sampling == 1 || l_sampling == 2 || l_sampling == 0 ){
1425 int phi_module =
int(l_phi/8);
1426 int phi_local = l_phi - 8*phi_module;
1427 ElecMin = phi_local *4;
1428 ElecMax = ElecMin + 4 - 1;
1441 else if( l_bec == -2 ){
1445 if( l_sampling == 0 || (l_sampling == 1 && l_region >= 0 && l_region <= 5) ){
1463 int phi_module =
int(l_phi/8);
1464 int phi_local = 7 - (l_phi - 8*phi_module);
1465 ElecMin = phi_local * 12;
1466 ElecMax = ElecMin + 12 - 1;
1479 else if( l_sampling == 2 || l_sampling == 3){
1494 int phi_module =
int(l_phi/32);
1495 int phi_local = 31 - (l_phi - 32*phi_module);
1496 ElecMin = phi_local*3;
1497 ElecMax = ElecMin + 3 - 1;
1510 else if( l_bec == -3 ){
1512 if( l_sampling == 1 || l_sampling == 2 || l_sampling == 0 ){
1517 int phi_module =
int(l_phi/8);
1518 int phi_local = l_phi - 8*phi_module;
1519 ElecMin = 28 - phi_local *4;
1520 ElecMax = ElecMin + 4 -1;
1534 else if( abs(l_bec)==20 ){
1543 if( l_sampling == 0){
1561 else if( l_sampling == 1){
1577 else if( l_sampling == 2){
1592 else if( l_sampling == 3){
1604 else if( abs(l_bec)==40 ){
1614 std::pair<int, int> electrodeMinMax( ElecMin, ElecMax);
1615 return electrodeMinMax;