36 #include "CoralBase/Blob.h"
41 #define HV_NON_NOMINAL_TOLERANCE 10 // tolerance : 1V for HV
42 #define DEAD_HV_THRESHOLD 10 // HV <10 V="dead"
43 #define MAX_LAR_CELLS 182468
60 ATH_MSG_INFO(
"Will use currents to correct voltage-drop at HV-resistors");
63 ATH_MSG_INFO(
"Will NOT correct voltage-drop at HV-resistors");
85 return StatusCode::SUCCESS;
92 const EventContext& ctx = Gaudi::Hive::currentContext();
102 return StatusCode::SUCCESS;
109 if (writeHandle.isValid()) {
111 return StatusCode::SUCCESS;
116 writeHandle.addDependency (fullRange);
120 ATH_MSG_DEBUG(
"Range of cabling" << larCablingHdl.
getRange() <<
", intersection: " << writeHandle.getRange());
121 writeHandle.addDependency(larCablingHdl);
125 writeHandle.addDependency(caloMgrHandle);
130 onlHVCorr = *onlHVCorrHdl;
131 writeHandle.addDependency(onlHVCorrHdl);
132 ATH_MSG_DEBUG(
"Range of online HV correction " << onlHVCorrHdl.
getRange() <<
", intersection: " << writeHandle.getRange());
137 writeHandle.addDependency(mappingHdl);
146 bool doPathology=
true;
149 if(!pathologyContainer) {
155 writeHandle.addDependency(pHdl);
156 ATH_MSG_DEBUG(
"Range of HV-Pathology " << pHdl.
getRange() <<
", intersection: " << writeHandle.getRange());
157 const std::vector<LArHVPathologiesDb::LArHVElectPathologyDb> &pathCont = pathologyContainer->
getPathology();
158 const size_t nPathologies=pathCont.size();
160 ATH_MSG_INFO(
"Number of HV pathologies found " << nPathologies);
163 for(
unsigned i=0;
i<nPathologies; ++
i) {
168 unsigned int index = (
unsigned int)(idHash);
169 if (
index<hasPathologyEM.size()) {
175 std::vector<unsigned short> svec;
178 hasPathologyEM[
index]=svec;
184 unsigned int index = (
unsigned int)(idHash);
185 if (
index<hasPathologyHEC.size()) {
191 std::vector<unsigned short> svec;
194 hasPathologyHEC[
index]=svec;
200 unsigned int index = (
unsigned int)(idHash);
201 if (
index<hasPathologyFCAL.size()) {
203 if(hasPathologyFCAL[
index].
size()<
static_cast<size_t>(abs(electPath.
electInd+1)))
207 std::vector<unsigned short> svec;
210 hasPathologyFCAL[
index]=svec;
218 const float* rValues{
nullptr};
222 writeHandle.addDependency(readAttrHandle);
227 return StatusCode::FAILURE;
229 rValues =
static_cast<const float*
>(rBlob.startingAddress());
233 writeHandle.addDependency (
h);
234 return writeHandle.getRange();
240 pathologyContainer, hasPathologyEM, hasPathologyHEC, hasPathologyFCAL, rValues));
242 std::vector<float> vScale;
250 const float hvonline = onlHVCorr->HVScaleCorr(hwid);
251 if (hvonline>0. && hvonline<100.) vScale[
i]=vScale[
i]/hvonline;
254 if (vScale[
i]<0.01) {
259 if (vScale[
i] < 0.9) {
260 if (vScale[
i] < 0.4) {
262 <<
" = " << vScale[
i]);
265 <<
" = " << vScale[
i]);
272 if (writeHandle.record(std::move(hvCorr)).isFailure()) {
273 ATH_MSG_ERROR(
"Could not record LArHVCorr object with " << writeHandle.key()
274 <<
" with EventRange " << writeHandle.getRange() <<
" into Conditions Store");
275 return StatusCode::FAILURE;
277 ATH_MSG_INFO(
"recorded new " << writeHandle.key() <<
" with range " << writeHandle.getRange() <<
" into Conditions Store");
279 return StatusCode::SUCCESS;
287 if (writeAffectedHandle.isValid()) {
288 ATH_MSG_DEBUG(
"Found valid write LArAffectedRegions handle");
289 return StatusCode::SUCCESS;
294 ATH_MSG_DEBUG(
"Range of cabling" << larCablingHdl.
getRange() <<
", intersection: " << writeAffectedHandle.getRange());
295 writeAffectedHandle.addDependency(larCablingHdl);
299 writeAffectedHandle.addDependency(readBFHandle);
300 ATH_MSG_DEBUG(
"Range of BadFeb " << readBFHandle.getRange() <<
", intersection: " << writeAffectedHandle.getRange());
302 auto vAffected = std::make_unique<CaloAffectedRegionInfoVec>();
305 writeAffectedHandle.addDependency (
h);
306 return writeAffectedHandle.getRange();
312 writeAffectedHandle.addDependency(mappingHdl);
322 ATH_CHECK(writeAffectedHandle.record(std::move(vAffected)));
323 ATH_MSG_INFO(
"recorded new " << writeAffectedHandle.key() <<
" with range "
324 << writeAffectedHandle.getRange()<<
" into Conditions Store");
326 return StatusCode::SUCCESS;
335 std::vector<const CondAttrListCollection*> attrvec;
342 attrvec.push_back(cattr);
343 const EventIDRange&
range = addDep (dcsHdl);
352 if (voltagePerLine.empty()) {
356 return StatusCode::SUCCESS;
368 ,
const float* rValues)
const
371 std::vector<unsigned int> listElec;
373 const float uAkOhm = 1.e-3;
382 bool hasPathology=
false;
383 if (
index<hasPathologyEM.size()) {
390 if (!embElement) std::abort();
392 unsigned int nelec =
cell->getNumElectrodes();
393 unsigned int ngap = 2*nelec;
395 for (
unsigned int i=0;
i<nelec;
i++) {
399 for (
unsigned int igap=0;igap<2;igap++) {
403 auto hvIt=voltage.find(
hvline);
404 if(hvIt != voltage.end()) {
407 curr=hvIt->second.curr;
416 if(curr > 0.) curr *= uAkOhm * rValues[ridx];
else curr = 0.;
417 ATH_MSG_VERBOSE(
"channel. "<<std::hex<<
id.get_identifier32()<<std::dec <<
" hvline: "<<
hvline<<
" curr. " << curr <<
" R: "<<rValues[ridx]);
422 for (
unsigned int ii=0;ii<listElec.size();ii++) {
423 if (listElec[ii]==(2*
i+igap) && listElec[ii]<hasPathologyEM[
index].
size() && hasPathologyEM[
index][listElec[ii]]) {
448 if (!embElement) std::abort();
453 for (
unsigned int igap=0;igap<2;igap++) {
457 auto hvIt=voltage.find(
hvline);
458 if(hvIt != voltage.end()) {
461 curr=hvIt->second.curr;
470 if(curr > 0.) curr *= uAkOhm * rValues[ridx];
else curr = 0;
471 ATH_MSG_VERBOSE(
"channel. "<<std::hex<<
id.get_identifier32()<<std::dec <<
" hvline: "<<
hvline<<
" curr. " << curr <<
" R: "<<rValues[ridx]);
481 bool hasPathology=
false;
482 if (
index<hasPathologyEM.size()) {
490 if (!emecElement) std::abort();
492 unsigned int nelec =
cell->getNumElectrodes();
493 unsigned int ngap = 2*nelec;
495 for (
unsigned int i=0;
i<nelec;
i++) {
497 for (
unsigned int igap=0;igap<2;igap++) {
501 auto hvIt=voltage.find(
hvline);
502 if(hvIt != voltage.end()) {
505 curr=hvIt->second.curr;
514 if(curr > 0.) curr *= uAkOhm * rValues[ridx];
else curr = 0.;
515 ATH_MSG_VERBOSE(
"channel. "<<std::hex<<
id.get_identifier32()<<std::dec <<
" hvline: "<<
hvline<<
" curr. " << curr <<
" R: "<<rValues[ridx]);
519 for (
unsigned int ii=0;ii<listElec.size();ii++) {
520 if (listElec[ii]==(2*
i+igap) && listElec[ii]<hasPathologyEM[
index].
size() && hasPathologyEM[
index][listElec[ii]]) {
527 hv=((hasPathologyEM[
index][listElec[ii]]&0xFFF0)>>4);
544 if (!emecElement) std::abort();
549 for (
unsigned int igap=0;igap<2;igap++) {
553 auto hvIt=voltage.find(
hvline);
554 if(hvIt != voltage.end()) {
557 curr=hvIt->second.curr;
566 if(curr >0.) curr *= uAkOhm * rValues[ridx];
else curr=0.;
567 ATH_MSG_VERBOSE(
"channel. "<<std::hex<<
id.get_identifier32()<<std::dec <<
" hvline: "<<
hvline<<
" curr. " << curr <<
" R: "<<rValues[ridx]);
577 ATH_MSG_ERROR(
"This could not be, what happened with EM identifiers ?");
578 return StatusCode::FAILURE;
587 bool hasPathology=
false;
588 if (
index<hasPathologyHEC.size()) {
595 if (!hecElement) std::abort();
597 unsigned int nsubgaps =
cell->getNumSubgaps();
598 float wt = 1./nsubgaps;
600 for (
unsigned int i=0;
i<nsubgaps;
i++) {
605 auto hvIt=voltage.find(
hvline);
606 if(hvIt != voltage.end()) {
609 curr=hvIt->second.curr;
619 if(curr > 0.) curr *= uAkOhm * rValues[ridx];
else curr = 0.;
620 ATH_MSG_VERBOSE(
"channel. "<<std::hex<<
id.get_identifier32()<<std::dec <<
" hvline: "<<
hvline<<
" cur. " << curr <<
" R: "<<rValues[ridx]);
624 for (
unsigned int ii=0;ii<listElec.size();ii++) {
625 if (listElec[ii]==
i && listElec[ii]<hasPathologyHEC[
index].
size() && hasPathologyHEC[
index][listElec[ii]]) {
650 bool hasPathology=
false;
651 if (
index<hasPathologyFCAL.size()) {
659 if (!fcalElement) std::abort();
661 unsigned int nlines =
tile->getNumHVLines();
662 unsigned int nlines_found=0;
663 for (
unsigned int i=0;
i<nlines;
i++) {
665 if (
line) nlines_found++;
667 if (nlines_found>0) {
668 float wt = 1./nlines_found;
670 for (
unsigned int i=0;
i<nlines;
i++) {
673 unsigned int hvline =
line->hvLineNo(hvCabling);
676 auto hvIt=voltage.find(
hvline);
677 if(hvIt != voltage.end()) {
680 if(rValues && useCurrent) {
681 curr=hvIt->second.curr;
691 if(curr > 0.) curr *= uAkOhm * rValues[ridx];
else curr = 0.;
692 ATH_MSG_VERBOSE(
"channel. "<<std::hex<<
id.get_identifier32()<<std::dec <<
" hvline: "<<
hvline<<
" curr." << curr <<
" R: "<<rValues[ridx]);
696 for (
unsigned int ii=0;ii<listElec.size();ii++) {
697 if (listElec[ii]==
i && listElec[ii]<hasPathologyFCAL[
index].
size() && hasPathologyFCAL[
index][listElec[ii]]) {
704 hv=((hasPathologyFCAL[
index][listElec[ii]]&0xFFF0)>>4);
720 return StatusCode::SUCCESS;
725 for (
unsigned int i=0;
i<
v.size();
i++) {
726 if (std::fabs(hv-
v[
i].hv) <0.1) {
733 v.emplace_back(hv,wt);
740 std::vector<unsigned int> myList;
744 if (electPath.
cellID == (
unsigned int)(
id.get_identifier32().get_compact())) {
745 myList.push_back(electPath.
electInd);
760 for(
const auto *attrlist : fldvec) {
764 for(;citr!=citr_e;++citr) {
765 const unsigned chan=citr->first;
767 const coral::Attribute& attr=((citr)->
second)[
"R_VMEAS"];
769 if (!attr.isNull()) voltage=attr.data<
float>();
770 const coral::Attribute& attrc=((citr)->
second)[
"R_IMEAS"];
772 if (!attrc.isNull())
current=attrc.data<
float>();
780 return StatusCode::SUCCESS;
807 float phi_min=+30.,phi_max=-30.;
809 bool are_previous_HV_affected=
false;
810 bool are_previous_HV_dead=
false;
811 for (
unsigned int ielec=0;ielec<32;ielec++) {
814 double hv[2]={0.,0.};
815 for (
unsigned int iGap=0;iGap<2;iGap++) {
817 auto hvIt=voltage.find(
hvline);
818 if(hvIt == voltage.end()) {
822 hv[iGap]=hvIt->second.hv;
825 ATH_MSG_VERBOSE(
" electrode HV " << ielec <<
" " << electrode.
getPhi() <<
" "<< hv[0] <<
" " << hv[1] );
830 bool isAffected=
false;
835 if (are_previous_HV_dead && !isDead) {
836 are_previous_HV_dead=
false;
837 ATH_MSG_VERBOSE(
" -- end dead region " << eta_min <<
" " << eta_max <<
" " <<phi_min <<
" " << phi_max);
839 vAffected->push_back(current_CaloAffectedRegionInfo);
843 if (are_previous_HV_affected && !isAffected) {
844 are_previous_HV_affected=
false;
845 ATH_MSG_VERBOSE(
" -- end affected region " << eta_min <<
" " << eta_max <<
" " <<phi_min <<
" " << phi_max);
847 vAffected->push_back(current_CaloAffectedRegionInfo);
851 if (!are_previous_HV_dead) {
854 ATH_MSG_VERBOSE(
" -- start dead region " << eta_min <<
" " << eta_max <<
" " << phi_min <<
" " <<phi_max);
855 are_previous_HV_dead =
true;
864 if (!are_previous_HV_affected) {
867 ATH_MSG_VERBOSE(
" -- start affected region " << eta_min <<
" " << eta_max <<
" " << phi_min <<
" " <<phi_max);
868 are_previous_HV_affected =
true;
872 ATH_MSG_VERBOSE(
" extend affected region " << phi_min <<
" " << phi_max);
878 if (are_previous_HV_affected) {
879 ATH_MSG_VERBOSE(
" -- finish affected region after electrode loop " << eta_min <<
" " << eta_max <<
" " << phi_min <<
" " <<phi_max);
881 vAffected->push_back(current_CaloAffectedRegionInfo);
883 if (are_previous_HV_dead) {
884 ATH_MSG_VERBOSE(
" -- finish dead region after electrode loop " << eta_min <<
" " << eta_max <<
" " << phi_min <<
" " <<phi_max);
886 vAffected->push_back(current_CaloAffectedRegionInfo);
902 for (
int iGap=0;iGap<2;iGap++) {
904 auto hvIt=voltage.find(
hvline);
905 if(hvIt == voltage.end()) {
909 hv[iGap]=hvIt->second.hv;
915 ATH_MSG_VERBOSE(
" HV " << hv[0] <<
" " << hv[1] <<
" " <<
" etamin,etamax,phimin,phimax " << eta_min <<
" " << eta_max <<
" " << phi_min <<
" " << phi_max);
920 bool isAffected=
false;
926 vAffected->push_back(current_CaloAffectedRegionInfo);
930 vAffected->push_back(current_CaloAffectedRegionInfo);
937 return StatusCode::FAILURE;
939 return StatusCode::SUCCESS;
966 ATH_MSG_VERBOSE(
"iSide,iPhi,iSector,iEta " << iSide <<
" " <<
iPhi <<
" " << iSector <<
" "
967 <<
iEta <<
" eta_min , eta_max " << eta_min <<
" " << eta_max );
970 float phi_min=+30.,phi_max=-30.;
972 bool are_previous_HV_affected=
false;
973 bool are_previous_HV_dead=
false;
978 for (
unsigned int iGap=0;iGap<2;iGap++) {
980 auto hvIt=voltage.find(
hvline);
981 if(hvIt == voltage.end()) {
985 hv[iGap]=hvIt->second.hv;
992 bool isAffected=
false;
995 <<
" " << hv[1] <<
" " <<
" isDead/isAffected " << isDead <<
" " << isAffected );
998 if (are_previous_HV_dead && !isDead) {
999 are_previous_HV_dead=
false;
1000 ATH_MSG_VERBOSE(
" -- end dead region " << eta_min <<
" " << eta_max <<
" " <<phi_min <<
" " << phi_max);
1002 vAffected->push_back(current_CaloAffectedRegionInfo);
1006 if (are_previous_HV_affected && !isAffected) {
1007 are_previous_HV_affected=
false;
1008 ATH_MSG_VERBOSE(
" -- end affected region " << eta_min <<
" " << eta_max <<
" " <<phi_min <<
" " << phi_max);
1010 vAffected->push_back(current_CaloAffectedRegionInfo);
1014 if (!are_previous_HV_dead) {
1017 are_previous_HV_dead =
true;
1018 ATH_MSG_VERBOSE(
" -- start dead region " << eta_min <<
" " << eta_max <<
" " << phi_min <<
" " <<phi_max);
1022 ATH_MSG_VERBOSE(
" extend affected region " << phi_min <<
" " << phi_max);
1027 if (!are_previous_HV_affected) {
1030 are_previous_HV_affected =
true;
1031 ATH_MSG_VERBOSE(
" -- start affected region " << eta_min <<
" " << eta_max <<
" " << phi_min <<
" " <<phi_max);
1035 ATH_MSG_VERBOSE(
" extend affected region " << phi_min <<
" " << phi_max);
1041 if (are_previous_HV_affected) {
1045 ATH_MSG_VERBOSE(
" - finih affected region after electrode loop " << eta_min <<
" " << eta_max
1046 <<
" " << phi_max <<
" " <<phi_max);
1048 vAffected->push_back(current_CaloAffectedRegionInfo);
1050 if (are_previous_HV_dead) {
1051 ATH_MSG_VERBOSE(
" -- finish dead region after electrode loop " << eta_min <<
" " << eta_max <<
" " << phi_max <<
" " <<phi_max);
1053 vAffected->push_back(current_CaloAffectedRegionInfo);
1067 for (
int iGap=0;iGap<2;iGap++) {
1069 auto hvIt=voltage.find(
hvline);
1070 if(hvIt == voltage.end()) {
1074 hv[iGap]=hvIt->second.hv;
1080 ATH_MSG_VERBOSE(
"iSide,iPhi" << iSide <<
" " <<
iPhi <<
" HV " << hv[0] <<
" " << hv[1] <<
" "
1081 <<
" etamin,etamax,phimin,phimax " << eta_min <<
" " << eta_max <<
" "
1082 << phi_min <<
" " << phi_max);
1087 bool isAffected=
false;
1093 vAffected->push_back(current_CaloAffectedRegionInfo);
1097 vAffected->push_back(current_CaloAffectedRegionInfo);
1103 return StatusCode::FAILURE;
1105 return StatusCode::SUCCESS;
1130 ATH_MSG_VERBOSE(
"iSide,iPhi,iSector,iEta " << iSide <<
" " <<
iPhi <<
" " << iSector <<
" "
1131 <<
iEta <<
" eta_min , eta_max " << eta_min <<
" " << eta_max);
1133 float phi_min=+30.,phi_max=-30.;
1135 bool are_previous_HV_affected=0;
1136 bool are_previous_HV_dead=0;
1141 for (
unsigned int iGap=0;iGap<2;iGap++) {
1143 auto hvIt=voltage.find(
hvline);
1144 if(hvIt == voltage.end()) {
1148 hv[iGap]=hvIt->second.hv;
1155 bool isAffected=
false;
1158 << hv[0] <<
" " << hv[1] <<
" " <<
" isDead, isAffected "
1159 << isDead <<
" " << isAffected);
1162 if (are_previous_HV_dead && !isDead) {
1163 are_previous_HV_dead=
false;
1164 ATH_MSG_VERBOSE(
" -- end dead region " << eta_min <<
" " << eta_max <<
" " <<phi_min <<
" " << phi_max);
1166 vAffected->push_back(current_CaloAffectedRegionInfo);
1170 if (are_previous_HV_affected && !isAffected) {
1171 are_previous_HV_affected=
false;
1172 ATH_MSG_VERBOSE(
" -- end affected region " << eta_min <<
" " << eta_max <<
" " <<phi_min <<
" " << phi_max);
1174 vAffected->push_back(current_CaloAffectedRegionInfo);
1178 if (!are_previous_HV_dead) {
1181 ATH_MSG_VERBOSE(
" -- start dead region " << phi_min <<
" " << phi_max);
1182 are_previous_HV_dead =
true;
1191 if (!are_previous_HV_affected) {
1194 are_previous_HV_affected =
true;
1195 ATH_MSG_VERBOSE(
" -- start affected region " << phi_min <<
" " << phi_max);
1199 ATH_MSG_VERBOSE(
" extend affected region " << phi_min <<
" " << phi_max);
1205 if (are_previous_HV_affected) {
1209 ATH_MSG_VERBOSE(
" - finish affected region after electrode loop " << eta_min <<
" "
1210 << eta_max <<
" " << phi_max <<
" " <<phi_max);
1212 vAffected->push_back(current_CaloAffectedRegionInfo);
1214 if (are_previous_HV_dead) {
1215 ATH_MSG_VERBOSE(
" - end dead region after electrode loop " << eta_min <<
" " << eta_max <<
" " << phi_max <<
" " <<phi_max);
1217 vAffected->push_back(current_CaloAffectedRegionInfo);
1225 return StatusCode::FAILURE;
1227 return StatusCode::SUCCESS;
1236 float etamax_layer[4]={3.3,3.1,3.1,3.3};
1237 float etamin_layer[4]={1.5,1.5,1.6,1.7};
1249 float eta_min,eta_max;
1251 eta_min = etamin_layer[iSampling];
1252 eta_max = etamax_layer[iSampling];
1254 eta_min = -1.*etamax_layer[iSampling];
1255 eta_max = -1.*etamin_layer[iSampling];
1262 for (
unsigned int iGap=0;iGap<hvMod.
getNumSubgaps();iGap++) {
1265 auto hvIt=voltage.find(
hvline);
1266 if(hvIt == voltage.end()) {
1270 if(iGap<4) hv[iGap]=hvIt->second.hv;
1277 bool isAffected=
false;
1280 ATH_MSG_VERBOSE(
" HV values " << hv[0] <<
" " << hv[1] <<
" " << hv[2] <<
" " << hv[3] <<
" "
1281 <<
" isDead/isAffected " << isDead <<
" " << isAffected);
1288 ATH_MSG_VERBOSE(
" new dead region " << eta_min <<
" " << eta_max <<
" " << phiMin <<
" " << phiMax <<
" layer " << 8+iSampling);
1290 vAffected->push_back(current_CaloAffectedRegionInfo);
1293 ATH_MSG_VERBOSE(
" new affected region " << eta_min <<
" " << eta_max <<
" " << phiMin <<
" " << phiMax <<
" layer " << 8+iSampling);
1295 vAffected->push_back(current_CaloAffectedRegionInfo);
1303 return StatusCode::FAILURE;
1305 return StatusCode::SUCCESS;
1319 float eta_min=3.1,eta_max=4.9;
1325 float HVnominal =
HV_nominal(
"FCAL",(
float)(iSampling));
1329 ATH_MSG_VERBOSE(
" FCAL HVModule side,sampling,sector " << iSide <<
" " << iSampling <<
" "
1330 << iSector <<
" HV nominal " << HVnominal);
1335 float phi_min = ((
float)(iSector))*dphi;
1339 ATH_MSG_VERBOSE(
" eta_min,eta_max,phi_min,phi_max " << eta_min <<
" " << eta_max <<
" " << phi_min
1340 <<
" " << phi_max <<
" number of lines " << hvMod.
getNumHVLines());
1342 for (
unsigned int iLine=0;iLine<hvMod.
getNumHVLines();iLine++) {
1344 unsigned int ihvline =
hvline.hvLineNo(hvCabling);
1345 auto hvIt=voltage.find(ihvline);
1346 if(hvIt == voltage.end()) {
1347 ATH_MSG_WARNING(
"Do not have hvline: "<<ihvline<<
" in LArHVData ! Assuming missing DCS data");
1350 if (iLine<4) hv[iLine]=hvIt->second.hv;
1356 bool isAffected=
false;
1359 ATH_MSG_VERBOSE(
" HV values " << hv[0] <<
" " << hv[1] <<
" " << hv[2] <<
" " << hv[3] <<
" "
1360 <<
" isDead/isAffected " << isDead <<
" " << isAffected);
1366 vAffected->push_back(current_CaloAffectedRegionInfo);
1371 vAffected->push_back(current_CaloAffectedRegionInfo);
1378 return StatusCode::FAILURE;
1380 return StatusCode::SUCCESS;
1392 bool IsMissingFeb=(bfCont->
status(febId).deadAll() || bfCont->
status(febId).deadReadout());
1396 bool is_additive1=0;
1398 int layer_min=+30,layer_max=-30;
1399 float eta_min=+30,eta_max=-30;
1400 float phi_min=+30,phi_max=-30;
1402 int layer_min_additive1=+30,layer_max_additive1=-30;
1403 float eta_min_additive1=+30,eta_max_additive1=-30;
1404 float phi_min_additive1=+30,phi_max_additive1=-30;
1408 for (
int icha=0;icha<chans_per_feb;icha++) {
1416 float current_eta=caloddElement->
eta();
1417 float current_eta_low=caloddElement->
eta()-0.5*caloddElement->
deta();
1418 float current_eta_high=caloddElement->
eta()+0.5*caloddElement->
deta();
1419 float current_phi_low=caloddElement->
phi()-0.5*caloddElement->
dphi();
1420 float current_phi_high=caloddElement->
phi()+0.5*caloddElement->
dphi();
1422 if (caloddElement->
is_lar_em_barrel() && caloddElement->
getLayer()==3 && fabs(current_eta)>0.79 && fabs(current_eta)<1.33) {
1425 if (current_layer<layer_min_additive1)
1426 layer_min_additive1=current_layer;
1427 if (current_layer>layer_max_additive1)
1428 layer_max_additive1=current_layer;
1430 if (current_eta_low<eta_min_additive1)
1431 eta_min_additive1=current_eta_low;
1432 if (current_eta_high>eta_max_additive1)
1433 eta_max_additive1=current_eta_high;
1436 extendPhiRegion(current_phi_high,phi_min_additive1,phi_max_additive1);
1442 if (current_layer<layer_min)
1443 layer_min=current_layer;
1444 if (current_layer>layer_max)
1445 layer_max=current_layer;
1447 if (current_eta_low<eta_min)
1448 eta_min=current_eta_low;
1449 if (current_eta_high>eta_max)
1450 eta_max=current_eta_high;
1461 vAffected->push_back(current_CaloAffectedRegionInfo);
1466 vAffected->push_back(current_additive1_CaloAffectedRegionInfo);
1470 return StatusCode::SUCCESS;
1475 if (strcmp(identification,
"EMBPS")==0)
1477 else if (strcmp(identification,
"EMECPS")==0)
1479 else if (strcmp(identification,
"EMB")==0)
1481 else if (strcmp(identification,
"EMEC")==0) {
1482 if ( fabs(myparameter)<1.5 )
1484 else if (fabs(myparameter)<1.6)
1486 else if (fabs(myparameter)<1.8 )
1488 else if ( fabs(myparameter) < 2.0 )
1490 else if ( fabs(myparameter) < 2.1 )
1492 else if ( fabs(myparameter) < 2.3 )
1494 else if ( fabs(myparameter) < 2.5 )
1496 else if ( fabs(myparameter) < 2.8 )
1500 else if (strcmp(identification,
"HEC")==0) {
1503 else if (strcmp(identification,
"FCAL")==0) {
1504 if (myparameter<0.5)
1506 else if (myparameter<1.5)
1508 else if (myparameter<2.5)
1518 static const float epsilon=1
e-4;
1522 if (phi_min>10. || phi_max<-10.) {
1528 bool isInRegion=
false;
1529 if (phi_min<phi_max) {
1530 if (
phi>phi_min &&
phi<phi_max) isInRegion=
true;
1533 if (
phi>phi_min ||
phi<phi_max) isInRegion=
true;
1535 if (isInRegion)
return;
1539 if (fabs(dphi1)<fabs(dphi2) )