49 #include "TProfile2D.h" 61 std::cout <<
"EcalChannelStatus Source handler constructor\n" << std::endl;
74 std::cout <<
m_sid <<
"/" << m_user <<
"/" << m_pass <<
"/" << m_location <<
"/" << m_gentag << std::endl;
138 for (
int theSm=0; theSm<36; theSm++){
139 for (
int theLM=0; theLM<2; theLM++){
148 for (
int theSector=0; theSector<18; theSector++){
149 for (
int theLM=0; theLM<2; theLM++){
156 typedef std::map<EcalLogicID, MonLaserBlueDat>::const_iterator CImon;
160 for (CImon
p = dataset_mon.begin();
p != dataset_mon.end();
p++) {
163 int sm_num = ecid_xt.
getID1();
164 int xt_num = ecid_xt.
getID2();
165 int yt_num = ecid_xt.
getID3();
171 if(ecid_xt.
getName()==
"EB_crystal_number") {
174 theFed = 600+elecId.
dccId();
177 if(ecid_xt.
getName()==
"EE_crystal_number") {
179 EEDetId eedetid(xt_num,yt_num,sm_num);
181 theFed = 600+elecId.
dccId();
182 theIx = eedetid.
ix();
191 if (ecid_xt.
getName()==
"EE_crystal_number") {
192 if (theFed>600 && theFed<610) thisFed = theFed -601;
193 if (theFed>645 && theFed<655) thisFed = theFed -646 + 9;
195 if (ecid_xt.
getName()==
"EB_crystal_number") { thisFed = theFed - 610; }
202 if(ecid_xt.
getName()==
"EB_crystal_number") {
203 theTTieta = (theTT-1)/4 +1;
204 theTTiphi = (theTT-1)%4 +1;
205 if (theTTieta==1 || theTTiphi==3 || theTTiphi==4) theLM=0;
206 if (theTTieta>1 && (theTTiphi==1 || theTTiphi==2)) theLM=1;
208 if( (ecid_xt.
getName()==
"EE_crystal_number") && (thisFed==7 || thisFed==16) ) {
209 if (theIx<=50) theLM=0;
210 if (theIx>50) theLM=1;
219 if (ecid_xt.
getName()==
"EB_crystal_number") {
226 if (ecid_xt.
getName()==
"EE_crystal_number") {
227 EEDetId eedetid(xt_num,yt_num,sm_num);
230 if (thisFed!=7 && thisFed!=16) {
236 if (thisFed==7 || thisFed==16) {
244 for (
int theSm=0; theSm<36; theSm++){
245 for (
int theLM=0; theLM<2; theLM++){
250 for (
int theSector=0; theSector<18; theSector++){
251 for (
int theLM=0; theLM<2; theLM++){
269 std::map<EcalLogicID, RunCrystalErrorsDat> theMask;
272 if ( theMask.size()!=0 ) {
274 std::map<EcalLogicID, RunCrystalErrorsDat>::const_iterator
m;
275 for (m=theMask.begin(); m!=theMask.end(); m++) {
278 int sm_num = ecid_xt.
getID1();
279 int xt_num = ecid_xt.
getID2();
280 int yt_num = ecid_xt.
getID3();
282 if ( (m->second).getErrorBits() & bits03 ) {
284 if(ecid_xt.
getName()==
"EB_crystal_number") {
289 EEDetId eedetid(xt_num,yt_num,sm_num);
313 std::map<EcalLogicID, RunCrystalErrorsDat> theMask;
316 if ( theMask.size()!=0 ) {
318 std::map<EcalLogicID, RunCrystalErrorsDat>::const_iterator
m;
319 for (m=theMask.begin(); m!=theMask.end(); m++) {
322 int sm_num = ecid_xt.
getID1();
323 int xt_num = ecid_xt.
getID2();
324 int yt_num = ecid_xt.
getID3();
326 if ( (m->second).getErrorBits() & bits03 ) {
328 if(ecid_xt.
getName()==
"EB_crystal_number") {
330 maskedPedEB.insert(std::pair<DetId, float>(ebdetid, 9999.));
333 EEDetId eedetid(xt_num,yt_num,sm_num);
334 maskedPedEE.insert(std::pair<DetId, float>(eedetid, 9999.));
351 std::map<EcalLogicID, RunCrystalErrorsDat> theMask;
354 if ( theMask.size()!=0 ) {
356 std::map<EcalLogicID, RunCrystalErrorsDat>::const_iterator
m;
357 for (m=theMask.begin(); m!=theMask.end(); m++) {
360 int sm_num = ecid_xt.
getID1();
361 int xt_num = ecid_xt.
getID2();
362 int yt_num = ecid_xt.
getID3();
364 if ( (m->second).getErrorBits() & bits03 ) {
366 if(ecid_xt.
getName()==
"EB_crystal_number") {
368 maskedLaserEB.insert(std::pair<DetId, float>(ebdetid, 9999.));
371 EEDetId eedetid(xt_num,yt_num,sm_num);
372 maskedLaserEE.insert(std::pair<DetId, float>(eedetid, 9999.));
385 std::map<EcalLogicID, RunCrystalErrorsDat> theMask;
388 if ( theMask.size()!=0 ) {
390 std::map<EcalLogicID, RunCrystalErrorsDat>::const_iterator
m;
391 for (m=theMask.begin(); m!=theMask.end(); m++) {
394 int sm_num = ecid_xt.
getID1();
395 int xt_num = ecid_xt.
getID2();
396 int yt_num = ecid_xt.
getID3();
398 if ( (m->second).getErrorBits() & bits03 ) {
400 if(ecid_xt.
getName()==
"EB_crystal_number") {
405 EEDetId eedetid(xt_num,yt_num,sm_num);
417 std::map<EcalLogicID, RunFEConfigDat> feconfig;
420 typedef std::map<EcalLogicID, RunFEConfigDat>::const_iterator feConfIter;
425 for (feConfIter
p=feconfig.begin();
p!=feconfig.end();
p++) {
433 myconfig.
setId(fe_conf_id);
442 std::vector< ODBadTTDat > badTT_dat;
445 for(
size_t iTT=0; iTT<badTT_dat.size(); iTT++){
446 int fed_id = badTT_dat[iTT].getFedId();
447 int tt_id = badTT_dat[iTT].getTTId();
448 if (tt_id<69) *
daqFile << fed_id <<
" " << tt_id << std::endl;
451 if((fed_id<=609 || fed_id>=646) && tt_id<69) {
461 std::vector<EcalLogicID> badCrystals;
464 for(
size_t mycrys=0; mycrys<badCrystals.size(); mycrys++){
468 int yt2 = log_id%1000;
469 int xt2 = (log_id%1000000)/1000;
470 int zt2 = (log_id/1000000)%10;
471 if (zt2==0) zSide = -1;
472 if (zt2==2) zSide = 1;
473 *
daqFile2 << xt2 <<
" " << yt2 <<
" " << zSide << std::endl;
477 if(fed_id>=610 && fed_id<=645 && tt_id<69) {
481 if (fed_id>=610 && fed_id<=627) db_fedId = fed_id - 609 + 18;
482 if (fed_id>=628 && fed_id<=645) db_fedId = fed_id - 627;
484 std::vector<EcalLogicID> badCrystals;
487 for(
size_t mycrys=0; mycrys<badCrystals.size(); mycrys++){
489 int sm_num = ecid_xt.
getID1();
491 int xt2_num = log_id%10000;
516 std::map<DetId,float>::const_iterator theIter;
522 typedef std::map<EcalLogicID, MonPedestalsDat>::const_iterator CImon;
525 for (CImon
p = dataset_mon.begin();
p != dataset_mon.end();
p++) {
527 uint16_t status_now = 0;
530 int sm_num = ecid_xt.
getID1();
531 int xt_num = ecid_xt.
getID2();
532 int yt_num = ecid_xt.
getID3();
543 float lowerCut = 999.;
544 if(ecid_xt.
getName()==
"EB_crystal_number") { lowerCut = 2.0; }
545 if(ecid_xt.
getName()==
"EE_crystal_number") { lowerCut = 2.5; }
570 if(ecid_xt.
getName()==
"EB_crystal_number") {
573 int thisFed = 600+elecId.
dccId();
578 << ped_item.
mean_x1 <<
"\t\t" << ped_item.
rms_x1 << std::endl;
584 if ((*theIter).first==ebdetid) isOld=
true;
590 << ped_item.
mean_x1 <<
"\t\t" << ped_item.
rms_x1 << std::endl;
595 EEDetId eedetid(xt_num,yt_num,sm_num);
597 int thisFed = 600+elecId.
dccId();
599 << eedetid.
ix() <<
"\t\t" << eedetid.
iy() <<
"\t\t" 603 << ped_item.
mean_x1 <<
"\t\t" << ped_item.
rms_x1 << std::endl;
607 if ((*theIter).first==eedetid) isOld=
true;
611 << eedetid.
ix() <<
"\t\t" << eedetid.
iy() <<
"\t\t" 615 << ped_item.
mean_x1 <<
"\t\t" << ped_item.
rms_x1 << std::endl;
625 typedef std::map<EcalLogicID, MonCrystalConsistencyDat>::const_iterator WGmonIter;
628 for (WGmonIter
p = wrongGain_mon.begin();
p != wrongGain_mon.end();
p++) {
630 rd_wgain =
p->second;
631 int sm_num = ecid_xt.
getID1();
632 int xt_num = ecid_xt.
getID2();
633 int yt_num = ecid_xt.
getID3();
637 if(ecid_xt.
getName()==
"EB_crystal_number") {
640 int thisFed = 600+elecId.
dccId();
641 *
ResFileEB << thisFed <<
"\t\t" << ebdetid.
ic() <<
"\t\t" << ebdetid.
hashedIndex() <<
"\t\t" <<
"at gain zero" << std::endl;
646 if ((*theIter).first==ebdetid) isOld=
true;
649 *
ResFileNewEB << thisFed <<
"\t\t" << ebdetid.
ic() <<
"\t\t" << ebdetid.
hashedIndex() <<
"\t\t" <<
"at gain zero" << std::endl;
654 EEDetId eedetid(xt_num,yt_num,sm_num);
656 int thisFed = 600+elecId.
dccId();
657 *
ResFileEE << thisFed <<
"\t\t" << eedetid.
ix() <<
"\t\t" 658 << eedetid.
iy() <<
"\t\t" << eedetid.
zside() <<
"\t\t" 660 <<
"at gain zero" << std::endl;
664 if ((*theIter).first==eedetid) isOld=
true;
668 << eedetid.
iy() <<
"\t\t" << eedetid.
zside() <<
"\t\t" 670 <<
"at gain zero" << std::endl;
690 std::map<DetId,float>::const_iterator theIter;
692 typedef std::map<EcalLogicID, MonLaserBlueDat>::const_iterator CImon;
696 for (CImon
p = dataset_mon.begin();
p != dataset_mon.end();
p++) {
698 int sm_num = ecid_xt.
getID1();
699 int xt_num = ecid_xt.
getID2();
700 int yt_num = ecid_xt.
getID3();
706 if(ecid_xt.
getName()==
"EB_crystal_number") {
709 theFed = 600+elecId.
dccId();
712 if(ecid_xt.
getName()==
"EE_crystal_number") {
714 EEDetId eedetid(xt_num,yt_num,sm_num);
716 theFed = 600+elecId.
dccId();
717 theIx = eedetid.
ix();
723 if (ecid_xt.
getName()==
"EE_crystal_number") {
724 if (theFed>600 && theFed<610) thisFed = theFed -601;
725 if (theFed>645 && theFed<655) thisFed = theFed -646 + 9;
727 if (ecid_xt.
getName()==
"EB_crystal_number") { thisFed = theFed - 610; }
733 if(ecid_xt.
getName()==
"EB_crystal_number") {
734 theTTieta = (theTT-1)/4 +1;
735 theTTiphi = (theTT-1)%4 +1;
736 if (theTTieta==1 || theTTiphi==3 || theTTiphi==4) theLM=0;
737 if (theTTieta>1 && (theTTiphi==1 || theTTiphi==2)) theLM=1;
739 if( (ecid_xt.
getName()==
"EE_crystal_number") && (thisFed==7 || thisFed==16) ) {
740 if (theIx<=50) theLM=0;
741 if (theIx>50) theLM=1;
745 uint16_t status_now = 0;
749 if(ecid_xt.
getName()==
"EB_crystal_number") {
750 if ( (myApdMean < 400) &&
isGoodLaserEBSm[thisFed][theLM] ) status_now = 2;
753 if(ecid_xt.
getName()==
"EE_crystal_number") {
754 if ( myApdMean<100 ) {
755 if ( thisFed!=7 && thisFed!=16 &&
isGoodLaserEESm[thisFed][0] ) status_now = 2;
756 if ( (thisFed==7 || thisFed==16) &&
isGoodLaserEESm[thisFed][theLM] ) status_now = 2;
762 if(ecid_xt.
getName()==
"EB_crystal_number") {
764 *
ResFileEB << theFed <<
"\t\t" << ebdetid.
ic() <<
"\t\t" << ebdetid.
hashedIndex() <<
"\t\t" << myApdMean << std::endl;
769 if ((*theIter).first==ebdetid) isOld=
true;
771 if (!isOld) { *
ResFileNewEB << thisFed <<
"\t\t" << ebdetid.
ic() <<
"\t\t" << ebdetid.
hashedIndex() <<
"\t\t" << myApdMean << std::endl; }
775 EEDetId eedetid(xt_num,yt_num,sm_num);
776 *
ResFileEE << theFed <<
"\t\t" << eedetid.
ix() <<
"\t\t" 777 << eedetid.
iy() <<
"\t\t" << eedetid.
zside() <<
"\t\t" 778 << eedetid.
hashedIndex() <<
"\t\t" << myApdMean << std::endl;
783 if ((*theIter).first==eedetid) isOld=
true;
786 *
ResFileEE << theFed <<
"\t\t" << eedetid.
ix() <<
"\t\t" 787 << eedetid.
iy() <<
"\t\t" << eedetid.
zside() <<
"\t\t" 788 << eedetid.
hashedIndex() <<
"\t\t" << myApdMean << std::endl;
803 std::map<EcalLogicID, MonCrystalConsistencyDat> wrongGain_mon,
804 std::map<EcalLogicID, MonLaserBlueDat> laser_mon,
805 std::map<EcalLogicID, MonOccupancyDat> occupancy_mon ) {
812 std::map<DetId,float>::const_iterator theIter;
813 std::map<DetId, float> badPedOnEB, badPedOnEE;
814 std::map<DetId, float> badPedOnRmsEB, badPedOnRmsEE;
815 std::map<DetId, float> badGainEB, badGainEE;
816 std::map<DetId, float> badLaserEB, badLaserEE;
817 std::map<DetId, float> badOccHighEB, badOccHighEE;
819 typedef std::map<EcalLogicID, MonPedestalsOnlineDat>::const_iterator CImonPedO;
820 typedef std::map<EcalLogicID, MonCrystalConsistencyDat>::const_iterator CImonCons;
821 typedef std::map<EcalLogicID, MonOccupancyDat>::const_iterator CImonOcc;
822 typedef std::map<EcalLogicID, MonLaserBlueDat>::const_iterator CImonLaser;
832 float totEntriesAboveHighThrEB=0.;
833 float totEntriesAboveHighThrEE=0.;
834 for (CImonOcc
p=occupancy_mon.begin();
p!=occupancy_mon.end();
p++) {
838 if (ecid_xt.
getName()==
"EB_crystal_number" && highOcc>-1) totEntriesAboveHighThrEB = totEntriesAboveHighThrEB + highOcc;
839 if (ecid_xt.
getName()==
"EE_crystal_number" && highOcc>-1) totEntriesAboveHighThrEE = totEntriesAboveHighThrEE + highOcc;
844 for (CImonPedO
p = pedestalO_mon.begin();
p != pedestalO_mon.end();
p++) {
846 bool isWrong =
false;
849 int sm_num=ecid_xt.
getID1();
850 int xt_num=ecid_xt.
getID2();
851 int yt_num=ecid_xt.
getID3();
858 if(ecid_xt.
getName()==
"EB_crystal_number") { lowerCut = 2.0; }
859 if(ecid_xt.
getName()==
"EE_crystal_number") { lowerCut = 2.5; }
867 if(ecid_xt.
getName()==
"EB_crystal_number") {
869 theIter = badPedOnEB.find(ebdetid);
870 if (theIter==badPedOnEB.end()) {
871 badPedOnEB.insert (std::pair<DetId, float>(ebdetid, rd_ped0.
getADCMeanG12()));
872 badPedOnRmsEB.insert(std::pair<DetId, float>(ebdetid, rd_ped0.
getADCRMSG12()));
876 EEDetId eedetid(xt_num,yt_num,sm_num);
877 theIter = badPedOnEE.find(eedetid);
878 if (theIter==badPedOnEE.end()) {
879 badPedOnEE.insert (std::pair<DetId, float>(eedetid, rd_ped0.
getADCMeanG12()));
880 badPedOnRmsEE.insert(std::pair<DetId, float>(eedetid, rd_ped0.
getADCRMSG12()));
889 for (CImonCons
p = wrongGain_mon.begin();
p != wrongGain_mon.end();
p++) {
891 bool isWrong =
false;
893 rd_wgain =
p->second;
894 int sm_num = ecid_xt.
getID1();
895 int xt_num = ecid_xt.
getID2();
896 int yt_num = ecid_xt.
getID3();
901 if(ecid_xt.
getName()==
"EB_crystal_number") {
903 theIter = badGainEB.find(ebdetid);
904 if (theIter==badGainEB.end()) badGainEB.insert(std::pair<DetId, float>(ebdetid, 999.));
907 EEDetId eedetid(xt_num,yt_num,sm_num);
908 theIter = badGainEE.find(eedetid);
909 if (theIter==badGainEE.end()) badGainEE.insert(std::pair<DetId, float>(eedetid, 999.));
917 for (CImonOcc
p=occupancy_mon.begin();
p!=occupancy_mon.end();
p++) {
921 int sm_num = ecid_xt.
getID1();
922 int xt_num = ecid_xt.
getID2();
923 int yt_num = ecid_xt.
getID3();
928 bool isWrong =
false;
929 float occAvg = -999.;
930 if ( ecid_xt.
getName()==
"EB_crystal_number" ) {
932 if (occAvg>0.001) isWrong=
true;
934 if ( ecid_xt.
getName()==
"EE_crystal_number" ) {
936 if (occAvg>0.001) isWrong=
true;
940 if(ecid_xt.
getName()==
"EB_crystal_number") {
942 theIter = badOccHighEB.find(ebdetid);
943 if (theIter==badOccHighEB.end()) badOccHighEB.insert(std::pair<DetId, float>(ebdetid, occAvg));
946 EEDetId eedetid(xt_num,yt_num,sm_num);
947 theIter = badOccHighEE.find(eedetid);
948 if (theIter==badOccHighEE.end()) badOccHighEE.insert(std::pair<DetId, float>(eedetid, occAvg));
956 for (CImonLaser
p=laser_mon.begin();
p!=laser_mon.end();
p++) {
960 int sm_num = ecid_xt.
getID1();
961 int xt_num = ecid_xt.
getID2();
962 int yt_num = ecid_xt.
getID3();
968 if(ecid_xt.
getName()==
"EB_crystal_number") {
971 theFed = 600+elecId.
dccId();
974 if(ecid_xt.
getName()==
"EE_crystal_number") {
976 EEDetId eedetid(xt_num,yt_num,sm_num);
978 theFed = 600+elecId.
dccId();
979 theIx = eedetid.
ix();
985 if (ecid_xt.
getName()==
"EE_crystal_number") {
986 if (theFed>600 && theFed<610) thisFed = theFed -601;
987 if (theFed>645 && theFed<655) thisFed = theFed -646 + 9;
989 if (ecid_xt.
getName()==
"EB_crystal_number") { thisFed = theFed - 610; }
995 if(ecid_xt.
getName()==
"EB_crystal_number") {
996 theTTieta = (theTT-1)/4 +1;
997 theTTiphi = (theTT-1)%4 +1;
998 if (theTTieta==1 || theTTiphi==3 || theTTiphi==4) theLM=0;
999 if (theTTieta>1 && (theTTiphi==1 || theTTiphi==2)) theLM=1;
1001 if( (ecid_xt.
getName()==
"EE_crystal_number") && (thisFed==7 || thisFed==16) ) {
1002 if (theIx<=50) theLM=0;
1003 if (theIx>50) theLM=1;
1007 rd_blue =
p->second;
1010 bool isWrong =
false;
1011 if(ecid_xt.
getName()==
"EB_crystal_number") {
1012 if ( (myApdMean < 400) &&
isGoodLaserEBSm[thisFed][theLM] ) isWrong=
true;
1014 if(ecid_xt.
getName()==
"EE_crystal_number") {
1015 if ( myApdMean<100 ) {
1016 if ( thisFed!=7 && thisFed!=16 &&
isGoodLaserEESm[thisFed][0] ) isWrong=
true;
1017 if ( (thisFed==7 || thisFed==16) &&
isGoodLaserEESm[thisFed][theLM] ) isWrong=
true;
1022 if(ecid_xt.
getName()==
"EB_crystal_number") {
1024 theIter = badLaserEB.find(ebdetid);
1025 if (theIter==badLaserEB.end()) badLaserEB.insert(std::pair<DetId, float>(ebdetid, myApdMean));
1028 EEDetId eedetid(xt_num,yt_num,sm_num);
1029 theIter = badLaserEE.find(eedetid);
1030 if (theIter==badLaserEE.end()) badLaserEE.insert(std::pair<DetId, float>(eedetid, myApdMean));
1038 std::map<DetId, float>::const_iterator theIterPedOn;
1039 std::map<DetId, float>::const_iterator theIterPedOnRms;
1040 std::map<DetId, float>::const_iterator theIterGain;
1041 std::map<DetId, float>::const_iterator theIterLaser;
1042 std::map<DetId, float>::const_iterator theIterOccHigh;
1046 for(theIterPedOn=badPedOnEB.begin(); theIterPedOn!=badPedOnEB.end(); ++theIterPedOn) {
1047 float thePedOn = (*theIterPedOn).second;
1048 float thePedOnRms = 9999.;
1049 float theGain = 9999.;
1050 float theLaser = 9999.;
1051 float theOccHigh = 9999.;
1053 theIterPedOnRms = badPedOnRmsEB.find((*theIterPedOn).first);
1054 theIterGain = badGainEB.find ((*theIterPedOn).first);
1055 theIterLaser = badLaserEB.find ((*theIterPedOn).first);
1056 theIterOccHigh = badOccHighEB.find ((*theIterPedOn).first);
1058 if (theIterPedOnRms!=badPedOnRmsEB.end()) thePedOnRms = (*theIterPedOnRms).second;
1059 if (theIterLaser!=badLaserEB.end()) theLaser = (*theIterLaser).second;
1060 if (theIterOccHigh!=badOccHighEB.end()) theOccHigh = (*theIterOccHigh).second;
1063 EBDetId ebdetid((*theIterPedOn).first);
1065 thisFed = 600+elecId.
dccId();
1070 bool isNewLaser=
true;
1071 bool isNewPhysics=
true;
1074 for(theIter=
maskedLaserEB.begin(); theIter!=
maskedLaserEB.end(); ++theIter) {
if ((*theIter).first==ebdetid) isNewLaser=
false; }
1078 if ( isNewPed || (theLaser!=9999 && isNewLaser) || (theOccHigh!=9999 && isNewPhysics) ) isNew=
true;
1080 if (theIterGain!=badGainEB.end()) {
1081 *
ResFileEB << thisFed <<
"\t\t" << ebdetid.ic() <<
"\t\t" << ebdetid.hashedIndex() <<
"\t\t" 1082 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1083 <<
"gainZero" <<
"\t\t" << theLaser <<
"\t\t" 1084 << theOccHigh << std::endl;
1087 *
ResFileNewEB << thisFed <<
"\t\t" << ebdetid.ic() <<
"\t\t" << ebdetid.hashedIndex() <<
"\t\t" 1088 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1089 <<
"gainZero" <<
"\t\t" << theLaser <<
"\t\t" 1090 << theOccHigh << std::endl;
1092 float thisEtaFill=
float(0);
1093 if (ebdetid.ieta()>0) thisEtaFill = ebdetid.ieta() - 0.5;
1094 if (ebdetid.ieta()<0) thisEtaFill = ebdetid.ieta();
1098 *
ResFileEB << thisFed <<
"\t\t" << ebdetid.ic() <<
"\t\t" << ebdetid.hashedIndex() <<
"\t\t" 1099 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1100 << theGain <<
"\t\t" << theLaser <<
"\t\t" 1101 << theOccHigh << std::endl;
1104 *
ResFileNewEB << thisFed <<
"\t\t" << ebdetid.ic() <<
"\t\t" << ebdetid.hashedIndex() <<
"\t\t" 1105 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1106 << theGain <<
"\t\t" << theLaser <<
"\t\t" 1107 << theOccHigh << std::endl;
1109 float thisEtaFill=
float(0);
1110 if (ebdetid.ieta()>0) thisEtaFill = ebdetid.ieta() - 0.5;
1111 if (ebdetid.ieta()<0) thisEtaFill = ebdetid.ieta();
1120 for(theIterLaser=badLaserEB.begin(); theIterLaser!=badLaserEB.end(); ++theIterLaser) {
1123 theIterPedOnRms = badPedOnRmsEB.find((*theIterLaser).first);
1124 if (theIterPedOnRms!=badPedOnRmsEB.end())
continue;
1126 float thePedOn = 9999.;
1127 float thePedOnRms = 9999.;
1128 float theGain = 9999.;
1129 float theLaser = (*theIterLaser).second;
1130 float theOccHigh = 9999.;
1132 theIterGain = badGainEB.find ((*theIterLaser).first);
1133 theIterOccHigh = badOccHighEB.find ((*theIterLaser).first);
1134 if (theIterOccHigh!=badOccHighEB.end()) theOccHigh = (*theIterOccHigh).second;
1137 EBDetId ebdetid((*theIterLaser).first);
1139 thisFed = 600+elecId.
dccId();
1144 bool isNewLaser=
true;
1145 bool isNewPhysics=
true;
1148 for(theIter=
maskedLaserEB.begin(); theIter!=
maskedLaserEB.end(); ++theIter) {
if ((*theIter).first==ebdetid) isNewLaser=
false; }
1152 if ( (isNewPed && theIterGain!=badGainEB.end() ) || (isNewLaser) || (theOccHigh!=9999 && isNewPhysics) ) isNew=
true;
1154 if (theIterGain!=badGainEB.end()) {
1155 *
ResFileEB << thisFed <<
"\t\t" << ebdetid.ic() <<
"\t\t" << ebdetid.hashedIndex() <<
"\t\t" 1156 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1157 <<
"gainZero" <<
"\t\t" << theLaser <<
"\t\t" 1158 << theOccHigh << std::endl;
1161 *
ResFileNewEB << thisFed <<
"\t\t" << ebdetid.ic() <<
"\t\t" << ebdetid.hashedIndex() <<
"\t\t" 1162 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1163 <<
"gainZero" <<
"\t\t" << theLaser <<
"\t\t" 1164 << theOccHigh << std::endl;
1166 float thisEtaFill=
float(0);
1167 if (ebdetid.ieta()>0) thisEtaFill = ebdetid.ieta() - 0.5;
1168 if (ebdetid.ieta()<0) thisEtaFill = ebdetid.ieta();
1172 *
ResFileEB << thisFed <<
"\t\t" << ebdetid.ic() <<
"\t\t" << ebdetid.hashedIndex() <<
"\t\t" 1173 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1174 << theGain <<
"\t\t" << theLaser <<
"\t\t" 1175 << theOccHigh << std::endl;
1178 *
ResFileNewEB << thisFed <<
"\t\t" << ebdetid.ic() <<
"\t\t" << ebdetid.hashedIndex() <<
"\t\t" 1179 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1180 << theGain <<
"\t\t" << theLaser <<
"\t\t" 1181 << theOccHigh << std::endl;
1183 float thisEtaFill=
float(0);
1184 if (ebdetid.ieta()>0) thisEtaFill = ebdetid.ieta() - 0.5;
1185 if (ebdetid.ieta()<0) thisEtaFill = ebdetid.ieta();
1193 for(theIterOccHigh = badOccHighEB.begin(); theIterOccHigh != badOccHighEB.end(); ++theIterOccHigh) {
1196 theIterPedOnRms = badPedOnRmsEB.find((*theIterOccHigh).first);
1197 theIterLaser = badLaserEB.find ((*theIterOccHigh).first);
1198 if (theIterPedOnRms!=badPedOnRmsEB.end())
continue;
1199 if (theIterLaser!=badLaserEB.end())
continue;
1201 float thePedOn = 9999.;
1202 float thePedOnRms = 9999.;
1203 float theGain = 9999.;
1204 float theLaser = 9999.;
1205 float theOccHigh = (*theIterOccHigh).second;
1206 theIterGain = badGainEB.find ((*theIterOccHigh).first);
1209 EBDetId ebdetid((*theIterOccHigh).first);
1211 thisFed = 600+elecId.
dccId();
1216 bool isNewPhysics=
true;
1221 if ( (isNewPed && theIterGain!=badGainEB.end() ) || (isNewPhysics) ) isNew=
true;
1223 if (theIterGain!=badGainEB.end()) {
1225 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1226 <<
"gainZero" <<
"\t\t" << theLaser <<
"\t\t" 1227 << theOccHigh << std::endl;
1231 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1232 <<
"gainZero" <<
"\t\t" << theLaser <<
"\t\t" 1233 << theOccHigh << std::endl;
1235 float thisEtaFill=
float(0);
1236 if (ebdetid.
ieta()>0) thisEtaFill = ebdetid.
ieta() - 0.5;
1237 if (ebdetid.
ieta()<0) thisEtaFill = ebdetid.
ieta();
1242 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1243 << theGain <<
"\t\t" << theLaser <<
"\t\t" 1244 << theOccHigh << std::endl;
1248 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1249 << theGain <<
"\t\t" << theLaser <<
"\t\t" 1250 << theOccHigh << std::endl;
1252 float thisEtaFill=
float(0);
1253 if (ebdetid.
ieta()>0) thisEtaFill = ebdetid.
ieta() - 0.5;
1254 if (ebdetid.
ieta()<0) thisEtaFill = ebdetid.
ieta();
1261 for(theIterGain = badGainEB.begin(); theIterGain != badGainEB.end(); ++theIterGain) {
1264 theIterPedOnRms = badPedOnRmsEB.find((*theIterGain).first);
1265 theIterLaser = badLaserEB.find ((*theIterGain).first);
1266 theIterOccHigh = badOccHighEB.find ((*theIterGain).first);
1267 if (theIterPedOnRms!=badPedOnRmsEB.end())
continue;
1268 if (theIterLaser!=badLaserEB.end())
continue;
1269 if (theIterOccHigh!=badOccHighEB.end())
continue;
1271 float thePedOn = 9999.;
1272 float thePedOnRms = 9999.;
1273 float theLaser = 9999.;
1274 float theOccHigh = 9999.;
1277 EBDetId ebdetid((*theIterGain).first);
1279 thisFed = 600+elecId.
dccId();
1286 if ( isNewPed && theIterGain!=badGainEB.end() ) isNew=
true;
1289 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1290 <<
"gainZero" <<
"\t\t" << theLaser <<
"\t\t" 1291 << theOccHigh << std::endl;
1295 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1296 <<
"gainZero" <<
"\t\t" << theLaser <<
"\t\t" 1297 << theOccHigh << std::endl;
1299 float thisEtaFill=
float(0);
1300 if (ebdetid.
ieta()>0) thisEtaFill = ebdetid.
ieta() - 0.5;
1301 if (ebdetid.
ieta()<0) thisEtaFill = ebdetid.
ieta();
1308 for(theIterPedOn = badPedOnEE.begin(); theIterPedOn != badPedOnEE.end(); ++theIterPedOn) {
1310 float thePedOn = (*theIterPedOn).second;
1311 float thePedOnRms = 9999.;
1312 float theGain = 9999.;
1313 float theLaser = 9999.;
1314 float theOccHigh = 9999.;
1316 theIterPedOnRms = badPedOnRmsEE.find((*theIterPedOn).first);
1317 theIterGain = badGainEE.find ((*theIterPedOn).first);
1318 theIterLaser = badLaserEE.find ((*theIterPedOn).first);
1319 theIterOccHigh = badOccHighEE.find ((*theIterPedOn).first);
1321 if (theIterPedOnRms!=badPedOnRmsEE.end()) thePedOnRms = (*theIterPedOnRms).second;
1322 if (theIterLaser !=badLaserEE.end()) theLaser = (*theIterLaser).second;
1323 if (theIterOccHigh !=badOccHighEE.end()) theOccHigh = (*theIterOccHigh).second;
1326 EEDetId eedetid((*theIterPedOn).first);
1328 thisFed = 600+elecId.
dccId();
1333 bool isNewLaser=
true;
1334 bool isNewPhysics=
true;
1337 for(theIter=
maskedLaserEE.begin(); theIter!=
maskedLaserEE.end(); ++theIter) {
if ((*theIter).first==eedetid) isNewLaser=
false; }
1341 if ( isNewPed || (theLaser!=9999 && isNewLaser) || (theOccHigh!=9999 && isNewPhysics) ) isNew=
true;
1343 if (theIterGain!=badGainEE.end()) {
1344 *
ResFileEE << thisFed <<
"\t\t" << eedetid.ix() <<
"\t\t" 1345 << eedetid.iy() <<
"\t\t" << eedetid.zside() <<
"\t\t" 1346 << eedetid.hashedIndex() <<
"\t\t" 1347 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1348 <<
"gainZero" <<
"\t\t" << theLaser <<
"\t\t" 1349 << theOccHigh << std::endl;
1352 *
ResFileNewEE << thisFed <<
"\t\t" << eedetid.ix() <<
"\t\t" 1353 << eedetid.iy() <<
"\t\t" << eedetid.zside() <<
"\t\t" 1354 << eedetid.hashedIndex() <<
"\t\t" 1355 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1356 <<
"gainZero" <<
"\t\t" << theLaser <<
"\t\t" 1357 << theOccHigh << std::endl;
1359 if (eedetid.zside()>0)
newBadEEP_ ->
Fill( (eedetid.ix()-0.5), (eedetid.iy()-0.5), 4);
1360 if (eedetid.zside()<0)
newBadEEM_ ->
Fill( (eedetid.ix()-0.5), (eedetid.iy()-0.5), 4);
1363 *
ResFileEE << thisFed <<
"\t\t" << eedetid.ix() <<
"\t\t" 1364 << eedetid.iy() <<
"\t\t" << eedetid.zside() <<
"\t\t" 1365 << eedetid.hashedIndex() <<
"\t\t" 1366 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1367 << theGain <<
"\t\t" << theLaser <<
"\t\t" 1368 << theOccHigh << std::endl;
1371 *
ResFileNewEE << thisFed <<
"\t\t" << eedetid.ix() <<
"\t\t" 1372 << eedetid.iy() <<
"\t\t" << eedetid.zside() <<
"\t\t" 1373 << eedetid.hashedIndex() <<
"\t\t" 1374 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1375 << theGain <<
"\t\t" << theLaser <<
"\t\t" 1376 << theOccHigh << std::endl;
1378 if (eedetid.zside()>0)
newBadEEP_ ->
Fill( (eedetid.ix()-0.5), (eedetid.iy()-0.5), 4);
1379 if (eedetid.zside()<0)
newBadEEM_ ->
Fill( (eedetid.ix()-0.5), (eedetid.iy()-0.5), 4);
1386 for(theIterLaser = badLaserEE.begin(); theIterLaser != badLaserEE.end(); ++theIterLaser) {
1389 theIterPedOnRms = badPedOnRmsEE.find((*theIterLaser).first);
1390 if (theIterPedOnRms!=badPedOnRmsEE.end())
continue;
1392 float thePedOn = 9999.;
1393 float thePedOnRms = 9999.;
1394 float theGain = 9999.;
1395 float theLaser = (*theIterLaser).second;
1396 float theOccHigh = 9999.;
1398 theIterGain = badGainEE.find ((*theIterLaser).first);
1399 theIterOccHigh = badOccHighEE.find ((*theIterLaser).first);
1400 if (theIterOccHigh!=badOccHighEE.end()) theOccHigh = (*theIterOccHigh).second;
1403 EEDetId eedetid((*theIterLaser).first);
1405 thisFed = 600+elecId.
dccId();
1410 bool isNewLaser=
true;
1411 bool isNewPhysics=
true;
1414 for(theIter=
maskedLaserEE.begin(); theIter!=
maskedLaserEE.end(); ++theIter) {
if ((*theIter).first==eedetid) isNewLaser=
false; }
1418 if ( (isNewPed && theIterGain!=badGainEE.end() ) || (isNewLaser) || (theOccHigh!=9999 && isNewPhysics) ) isNew=
true;
1420 if (theIterGain!=badGainEE.end()) {
1421 *
ResFileEE << thisFed <<
"\t\t" << eedetid.ix() <<
"\t\t" 1422 << eedetid.iy() <<
"\t\t" << eedetid.zside() <<
"\t\t" 1423 << eedetid.hashedIndex() <<
"\t\t" 1424 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1425 <<
"gainZero" <<
"\t\t" << theLaser <<
"\t\t" 1426 << theOccHigh << std::endl;
1429 *
ResFileNewEE << thisFed <<
"\t\t" << eedetid.ix() <<
"\t\t" 1430 << eedetid.iy() <<
"\t\t" << eedetid.zside() <<
"\t\t" 1431 << eedetid.hashedIndex() <<
"\t\t" 1432 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1433 <<
"gainZero" <<
"\t\t" << theLaser <<
"\t\t" 1434 << theOccHigh << std::endl;
1436 if (eedetid.zside()>0)
newBadEEP_ ->
Fill( (eedetid.ix()-0.5), (eedetid.iy()-0.5), 4);
1437 if (eedetid.zside()<0)
newBadEEM_ ->
Fill( (eedetid.ix()-0.5), (eedetid.iy()-0.5), 4);
1440 *
ResFileEE << thisFed <<
"\t\t" << eedetid.ix() <<
"\t\t" 1441 << eedetid.iy() <<
"\t\t" << eedetid.zside() <<
"\t\t" 1442 << eedetid.hashedIndex() <<
"\t\t" 1443 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1444 << theGain <<
"\t\t" << theLaser <<
"\t\t" 1445 << theOccHigh << std::endl;
1448 *
ResFileNewEE << thisFed <<
"\t\t" << eedetid.ix() <<
"\t\t" 1449 << eedetid.iy() <<
"\t\t" << eedetid.zside() <<
"\t\t" 1450 << eedetid.hashedIndex() <<
"\t\t" 1451 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1452 << theGain <<
"\t\t" << theLaser <<
"\t\t" 1453 << theOccHigh << std::endl;
1455 if (eedetid.zside()>0)
newBadEEP_ ->
Fill( (eedetid.ix()-0.5), (eedetid.iy()-0.5), 4);
1456 if (eedetid.zside()<0)
newBadEEM_ ->
Fill( (eedetid.ix()-0.5), (eedetid.iy()-0.5), 4);
1463 for(theIterOccHigh = badOccHighEE.begin(); theIterOccHigh != badOccHighEE.end(); ++theIterOccHigh) {
1466 theIterPedOnRms = badPedOnRmsEE.find((*theIterOccHigh).first);
1467 theIterLaser = badLaserEE.find ((*theIterOccHigh).first);
1468 if (theIterPedOnRms!=badPedOnRmsEE.end())
continue;
1469 if (theIterLaser!=badLaserEE.end())
continue;
1471 float thePedOn = 9999.;
1472 float thePedOnRms = 9999.;
1473 float theGain = 9999.;
1474 float theLaser = 9999.;
1475 float theOccHigh = (*theIterOccHigh).second;
1476 theIterGain = badGainEE.find ((*theIterOccHigh).first);
1479 EEDetId eedetid((*theIterOccHigh).first);
1481 thisFed = 600+elecId.
dccId();
1486 bool isNewPhysics=
true;
1491 if ( (isNewPed && theIterGain!=badGainEE.end() ) || (isNewPhysics) ) isNew=
true;
1493 if (theIterGain!=badGainEE.end()) {
1494 *
ResFileEE << thisFed <<
"\t\t" << eedetid.
ix() <<
"\t\t" 1495 << eedetid.
iy() <<
"\t\t" << eedetid.
zside() <<
"\t\t" 1497 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1498 <<
"gainZero" <<
"\t\t" << theLaser <<
"\t\t" 1499 << theOccHigh << std::endl;
1503 << eedetid.
iy() <<
"\t\t" << eedetid.
zside() <<
"\t\t" 1505 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1506 <<
"gainZero" <<
"\t\t" << theLaser <<
"\t\t" 1507 << theOccHigh << std::endl;
1513 *
ResFileEE << thisFed <<
"\t\t" << eedetid.
ix() <<
"\t\t" 1514 << eedetid.
iy() <<
"\t\t" << eedetid.
zside() <<
"\t\t" 1516 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1517 << theGain <<
"\t\t" << theLaser <<
"\t\t" 1518 << theOccHigh << std::endl;
1522 << eedetid.
iy() <<
"\t\t" << eedetid.
zside() <<
"\t\t" 1524 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1525 << theGain <<
"\t\t" << theLaser <<
"\t\t" 1526 << theOccHigh << std::endl;
1535 for(theIterGain = badGainEE.begin(); theIterGain != badGainEE.end(); ++theIterGain) {
1538 theIterPedOnRms = badPedOnRmsEE.find((*theIterGain).first);
1539 theIterLaser = badLaserEE.find ((*theIterGain).first);
1540 theIterOccHigh = badOccHighEE.find ((*theIterGain).first);
1541 if (theIterPedOnRms!=badPedOnRmsEE.end())
continue;
1542 if (theIterLaser!=badLaserEE.end())
continue;
1543 if (theIterOccHigh!=badOccHighEE.end())
continue;
1544 float thePedOn = 9999.;
1545 float thePedOnRms = 9999.;
1546 float theLaser = 9999.;
1547 float theOccHigh = 9999.;
1550 EEDetId eedetid((*theIterGain).first);
1552 thisFed = 600+elecId.
dccId();
1559 if ( isNewPed && theIterGain!=badGainEE.end() ) isNew=
true;
1561 *
ResFileEE << thisFed <<
"\t\t" << eedetid.
ix() <<
"\t\t" 1562 << eedetid.
iy() <<
"\t\t" << eedetid.
zside() <<
"\t\t" 1564 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1565 <<
"gainZero" <<
"\t\t" << theLaser <<
"\t\t" 1566 << theOccHigh << std::endl;
1570 << eedetid.
iy() <<
"\t\t" << eedetid.
zside() <<
"\t\t" 1572 << thePedOn <<
"\t\t" << thePedOnRms <<
"\t\t" 1573 <<
"gainZero" <<
"\t\t" << theLaser <<
"\t\t" 1574 << theOccHigh << std::endl;
1588 std::ostringstream ss;
1592 unsigned int max_since=0;
1594 std::cout <<
"max_since : " << max_since << std::endl;
1596 std::cout <<
"Retrieving run list from ONLINE DB ... " << std::endl;
1598 std::cout <<
"Connection done" << std::endl;
1606 newBadEB_ =
new TProfile2D(
"newBadEB_",
"new bad channels, EB", 360, 0., 360., 170, -85., 85.);
1607 newBadEEP_ =
new TProfile2D(
"newBad_EEP_",
"new bad channels, EE+", 100, 0., 100., 100, 0., 100.);
1608 newBadEEM_ =
new TProfile2D(
"newBad_EEM_",
"new bad channels, EE-", 100, 0., 100., 100, 0., 100.);
1623 unsigned int min_run=0;
1625 min_run=max_since+1;
1651 sprintf(outfile,
"BadChannelsEB_run%d.txt",min_run);
1653 sprintf(outfile,
"BadChannelsEE_run%d.txt",min_run);
1655 sprintf(outfile,
"BadNewChannelsEB_run%d.txt",min_run);
1657 sprintf(outfile,
"BadNewChannelsEE_run%d.txt",min_run);
1659 sprintf(outfile,
"DaqConfig_run%d.txt",min_run);
1661 sprintf(outfile,
"DaqConfig_channels_run%d.txt",min_run);
1664 *
daqFile <<
"fed" <<
"\t\t" <<
"tower" << std::endl;
1667 *
ResFileEB <<
"Fed" <<
"\t\t" <<
"Ic" <<
"\t\t" <<
"hIndex" <<
"\t\t" 1668 <<
"MeanG12" <<
"\t\t" <<
"RmsG12" <<
"\t\t" 1669 <<
"MeanG6" <<
"\t\t" <<
"RmsG6" <<
"\t\t" 1670 <<
"MeanG1" <<
"\t\t" <<
"RmsG1" << std::endl;
1672 *
ResFileEE <<
"Fed" <<
"\t\t" <<
"Ix" <<
"\t\t" 1673 <<
"Iy" <<
"\t\t" <<
"Iz" <<
"\t\t" <<
"hIndex" <<
"\t\t" 1674 <<
"MeanG12" <<
"\t\t" <<
"RmsG12" <<
"\t\t" 1675 <<
"MeanG6" <<
"\t\t" <<
"RmsG6" <<
"\t\t" 1676 <<
"MeanG1" <<
"\t\t" <<
"RmsG1" << std::endl;
1678 *
ResFileNewEB <<
"Fed" <<
"\t\t" <<
"Ic" <<
"\t\t" <<
"hIndex" <<
"\t\t" 1679 <<
"MeanG12" <<
"\t\t" <<
"RmsG12" <<
"\t\t" 1680 <<
"MeanG6" <<
"\t\t" <<
"RmsG6" <<
"\t\t" 1681 <<
"MeanG1" <<
"\t\t" <<
"RmsG1" << std::endl;
1684 <<
"Iy" <<
"\t\t" <<
"Iz" <<
"\t\t" <<
"hIndex" <<
"\t\t" 1685 <<
"MeanG12" <<
"\t\t" <<
"RmsG12" <<
"\t\t" 1686 <<
"MeanG6" <<
"\t\t" <<
"RmsG6" <<
"\t\t" 1687 <<
"MeanG1" <<
"\t\t" <<
"RmsG1" << std::endl;
1692 *
ResFileEB <<
"Fed" <<
"\t\t" <<
"Ic" <<
"\t\t" <<
"hIndex" <<
"\t\t" <<
"apd" << std::endl;
1693 *
ResFileEE <<
"Fed" <<
"\t\t" <<
"Ix" <<
"\t\t" <<
"Iy" <<
"\t\t" <<
"Iz" <<
"\t\t" <<
"hIndex" <<
"\t\t" <<
"apd" << std::endl;
1694 *
ResFileNewEB <<
"Fed" <<
"\t\t" <<
"Ic" <<
"\t\t" <<
"hIndex" <<
"\t\t" <<
"apd" << std::endl;
1695 *
ResFileNewEE <<
"Fed" <<
"\t\t" <<
"Ix" <<
"\t\t" <<
"Iy" <<
"\t\t" <<
"Iz" <<
"\t\t" <<
"hIndex" <<
"\t\t" <<
"apd" << std::endl;
1701 *
ResFileEB <<
"Fed" <<
"\t\t" <<
"Ic" <<
"\t\t" <<
"hIndex" <<
"\t\t" 1702 <<
"pedOnline" <<
"\t\t" <<
"pedOnlineRMS " <<
"\t\t" 1703 <<
"gain0" <<
"\t\t" <<
"apd" <<
"\t\t" 1704 <<
"highThrOcc" <<
"\t\t" << std::endl;
1707 <<
"Iy" <<
"\t\t" <<
"Iz" <<
"\t\t" <<
"hIndex" <<
"\t\t" 1708 <<
"pedOnline" <<
"\t\t" <<
"pedOnlineRMS " <<
"\t\t" 1709 <<
"gain0" <<
"\t\t" <<
"apd" <<
"\t\t" 1710 <<
"highThrOcc" <<
"\t\t" << std::endl;
1712 *
ResFileNewEB <<
"Fed" <<
"\t\t" <<
"Ic" <<
"\t\t" <<
"hIndex" <<
"\t\t" 1713 <<
"pedOnline" <<
"\t\t" <<
"pedOnlineRMS " <<
"\t\t" 1714 <<
"gain0" <<
"\t\t" <<
"apd" <<
"\t\t" 1715 <<
"highThrOcc" <<
"\t\t" << std::endl;
1718 <<
"Iy" <<
"\t\t" <<
"Iz" <<
"\t\t" <<
"hIndex" <<
"\t\t" 1719 <<
"pedOnline" <<
"\t\t" <<
"pedOnlineRMS " <<
"\t\t" 1720 <<
"gain0" <<
"\t\t" <<
"apd" <<
"\t\t" 1721 <<
"highThrOcc" <<
"\t\t" << std::endl;
1730 std::vector<MonRunIOV> mon_run_vec = mon_list.
getRuns();
1731 int mon_runs = mon_run_vec.size();
1732 std::cout <<
"number of Mon runs is " << mon_runs << std::endl;
1733 if(mon_runs==0)
std::cout <<
"PROBLEM! 0 runs analyzed by DQM" << std::endl;
1734 if(mon_runs==0) ss <<
"PROBLEM! 0 runs analyzed by DQM" << std::endl;
1747 std::map<DetId,float>::const_iterator theIter;
1752 for(
int dqmRun=0; dqmRun<mon_runs; dqmRun++){
1754 unsigned long iDqmRun=(
unsigned long) mon_run_vec[dqmRun].getRunIOV().getRunNumber();
1756 std::cout <<
"retrieve the DQM data for run number: " << iDqmRun <<
", subrun number: " << mon_run_vec[dqmRun].getSubRunNumber() << std::endl;
1759 if (mon_run_vec[dqmRun].getSubRunNumber()==mon_runs){
1763 myRun=mon_run_vec[dqmRun].getRunIOV();
1768 RunIOV runiov_prime = mon_run_vec[dqmRun].getRunIOV();
1772 std::cout <<
"Fetching masked channels from DB" << std::endl;
1786 std::map<EcalLogicID, MonPedestalsDat> dataset_mon;
1788 std::cout <<
"running pedestal analysis" << std::endl;
1789 std::cout <<
"OMDS record for pedestals, run " << iDqmRun <<
" is made of " << dataset_mon.size() <<
" entries" << std::endl;
1792 std::map<EcalLogicID, MonCrystalConsistencyDat> wrongGain_mon;
1794 std::cout <<
"OMDS record for consistency, run " << iDqmRun <<
" is made of " << wrongGain_mon.size() <<
" entries" << std::endl;
1797 if (dataset_mon.size()>0) {
1800 std::cout <<
"Not enought data for pedestal analysis" << std::endl;
1801 ss <<
"Not enought data for pedestal analysis" << std::endl;
1811 std::map<EcalLogicID, MonLaserBlueDat > dataset_mon;
1813 std::cout <<
"running the laser analysis based on DQM data" << std::endl;
1814 std::cout <<
"OMDS record for run " << iDqmRun <<
" is made of " << dataset_mon.size() <<
" records" << std::endl;
1817 if (dataset_mon.size()>0) {
1821 std::cout <<
"Not enought data for dqm-based laser analysis" << std::endl;
1822 ss <<
"Not enought data for dqm-based laser analysis" << std::endl;
1832 std::map<EcalLogicID, MonPedestalsOnlineDat> pedonline_mon;
1834 std::cout <<
"running pedestal online analysis" << std::endl;
1835 std::cout <<
"OMDS record for pedestals, run " << iDqmRun <<
" is made of " << pedonline_mon.size() << std::endl;
1838 std::map<EcalLogicID, MonCrystalConsistencyDat> wrongGain_mon;
1840 std::cout <<
"OMDS record for consistency, run " << iDqmRun <<
" is made of " << wrongGain_mon.size() <<
" entries" << std::endl;
1843 std::map<EcalLogicID, MonOccupancyDat> occupancy_mon;
1845 std::cout <<
"OMDS record for occupancy, run " << iDqmRun <<
" is made of " << occupancy_mon.size() << std::endl;
1848 std::map<EcalLogicID, MonLaserBlueDat > laser_mon;
1850 std::cout <<
"running laser analysis" << std::endl;
1851 std::cout <<
"OMDS record for laser, run " << iDqmRun <<
" is made of " << laser_mon.size() <<
" records" << std::endl;
1855 if (pedonline_mon.size()<=0) {
1856 std::cout <<
"Not enought data for pedestal online analysis" << std::endl;
1857 ss <<
"Not enought data for pedestal online analysis" << std::endl;
1859 if (occupancy_mon.size()<=0) {
1860 std::cout <<
"Not enought data for occupancy analysis" << std::endl;
1861 ss <<
"Not enought data for occupancy analysis" << std::endl;
1863 if (laser_mon.size()<=0) {
1864 std::cout <<
"Not enought data for laser analysis" << std::endl;
1865 ss <<
"Not enought data for laser analysis" << std::endl;
1867 if ( pedonline_mon.size()>0 || occupancy_mon.size()>0 || wrongGain_mon.size()>0 || laser_mon.size()>0 ) {
1869 cosmicsAnalysis( pedonline_mon, wrongGain_mon, laser_mon, occupancy_mon );
1876 gStyle->SetPalette(1);
1877 gStyle->SetOptStat(0);
1878 TCanvas
c(
"c",
"c",1);
1882 lEB.DrawLine(0,0,360,0);
1883 while (iLineEB<18) { lEB.DrawLine (iLineEB*20, -85, iLineEB*20, 85); iLineEB++; }
1884 c.SaveAs(
"newBadEB_.png");
1887 lEE.SetLineWidth(1);
1888 int ixSectorsEE[202] = {61, 61, 60, 60, 59, 59, 58, 58, 57, 57, 55, 55, 45, 45, 43, 43, 42, 42, 41, 41, 40, 40, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 45, 45, 55, 55, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 0,100,100, 97, 97, 95, 95, 92, 92, 87, 87, 85, 85, 80, 80, 75, 75, 65, 65, 60, 60, 40, 40, 35, 35, 25, 25, 20, 20, 15, 15, 13, 13, 8, 8, 5, 5, 3, 3, 0, 0, 3, 3, 5, 5, 8, 8, 13, 13, 15, 15, 20, 20, 25, 25, 35, 35, 40, 40, 60, 60, 65, 65, 75, 75, 80, 80, 85, 85, 87, 87, 92, 92, 95, 95, 97, 97,100,100, 0, 61, 65, 65, 70, 70, 80, 80, 90, 90, 92, 0, 61, 65, 65, 90, 90, 97, 0, 57, 60, 60, 65, 65, 70, 70, 75, 75, 80, 80, 0, 50, 50, 0, 43, 40, 40, 35, 35, 30, 30, 25, 25, 20, 20, 0, 39, 35, 35, 10, 10, 3, 0, 39, 35, 35, 30, 30, 20, 20, 10, 10, 8, 0, 45, 45, 40, 40, 35, 35, 0, 55, 55, 60, 60, 65, 65};
1889 int iySectorsEE[202] = {50, 55, 55, 57, 57, 58, 58, 59, 59, 60, 60, 61, 61, 60, 60, 59, 59, 58, 58, 57, 57, 55, 55, 45, 45, 43, 43, 42, 42, 41, 41, 40, 40, 39, 39, 40, 40, 41, 41, 42, 42, 43, 43, 45, 45, 50, 0, 50, 60, 60, 65, 65, 75, 75, 80, 80, 85, 85, 87, 87, 92, 92, 95, 95, 97, 97,100,100, 97, 97, 95, 95, 92, 92, 87, 87, 85, 85, 80, 80, 75, 75, 65, 65, 60, 60, 40, 40, 35, 35, 25, 25, 20, 20, 15, 15, 13, 13, 8, 8, 5, 5, 3, 3, 0, 0, 3, 3, 5, 5, 8, 8, 13, 13, 15, 15, 20, 20, 25, 25, 35, 35, 40, 40, 50, 0, 45, 45, 40, 40, 35, 35, 30, 30, 25, 25, 0, 50, 50, 55, 55, 60, 60, 0, 60, 60, 65, 65, 70, 70, 75, 75, 85, 85, 87, 0, 61,100, 0, 60, 60, 65, 65, 70, 70, 75, 75, 85, 85, 87, 0, 50, 50, 55, 55, 60, 60, 0, 45, 45, 40, 40, 35, 35, 30, 30, 25, 25, 0, 39, 30, 30, 15, 15, 5, 0, 39, 30, 30, 15, 15, 5};
1893 for (
int iLineEEP=0; iLineEEP<201; iLineEEP=iLineEEP+1 ) {
1894 if ( (ixSectorsEE[iLineEEP]!=0 || iySectorsEE[iLineEEP]!=0) && (ixSectorsEE[iLineEEP+1]!=0 || iySectorsEE[iLineEEP+1]!=0) ) {
1895 lEE.DrawLine(ixSectorsEE[iLineEEP], iySectorsEE[iLineEEP], ixSectorsEE[iLineEEP+1], iySectorsEE[iLineEEP+1]);
1897 c.SaveAs(
"newBadEEP_.png");
1901 for (
int iLineEEP=0; iLineEEP<201; iLineEEP=iLineEEP+1 ) {
1902 if ( (ixSectorsEE[iLineEEP]!=0 || iySectorsEE[iLineEEP]!=0) && (ixSectorsEE[iLineEEP+1]!=0 || iySectorsEE[iLineEEP+1]!=0) ) {
1903 lEE.DrawLine(ixSectorsEE[iLineEEP], iySectorsEE[iLineEEP], ixSectorsEE[iLineEEP+1], iySectorsEE[iLineEEP+1]);
1905 c.SaveAs(
"newBadEEM_.png");
1914 std::cout <<
"Ecal - > end of getNewObjects -----------\n";
static void readDB(EcalCondDBInterface *eConn, RunIOV *runIOV) noexcept(false)
std::map< DetId, float > maskedLaserEB
T getParameter(std::string const &) const
void setRunTypeDef(const RunTypeDef &runTypeDef)
std::map< DetId, float > maskedPedEE
T getUntrackedParameter(std::string const &, T const &) const
int hashedIndex() const
get a compact index for arrays
std::map< DetId, float > maskedPhysicsEB
std::ofstream * ResFileEE
int getProblemsGainZero() const
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
float getPedRMSG1() const
int towerId() const
get the tower id
static void fetchDataSet(std::map< EcalLogicID, RunCrystalErrorsDat > *fillMap)
float checkPedestalValueGain12(EcalPedestals::Item *item)
int getEventsOverHighThreshold() const
MonRunList fetchMonRunList(const RunTag &tag, const MonRunTag &monruntag) noexcept(false)
void fetchConfigSet(ICONF *iconf) noexcept(false)
std::map< DetId, float > maskedPedEB
void setGeneralTag(std::string tag)
void fetchDataSet(std::map< EcalLogicID, DATT > *fillMap, IOVT *iov) noexcept(false)
std::map< DetId, float > maskedOnlinePedEE
void setRunTag(const RunTag &tag)
std::map< DetId, float > maskedPhysicsEE
void cosmicsAnalysis(std::map< EcalLogicID, MonPedestalsOnlineDat > pedestalO_mon, std::map< EcalLogicID, MonCrystalConsistencyDat > wrongGain_mon, std::map< EcalLogicID, MonLaserBlueDat > laser_mon, std::map< EcalLogicID, MonOccupancyDat > occupancy_mon)
float checkPedestalValueGain6(EcalPedestals::Item *item)
int iphi() const
get the crystal iphi
std::vector< EcalLogicID > getEcalLogicIDSet(std::string name, int fromId1=EcalLogicID::NULLID, int toId1=EcalLogicID::NULLID, int fromId2=EcalLogicID::NULLID, int toId2=EcalLogicID::NULLID, int fromId3=EcalLogicID::NULLID, int toId3=EcalLogicID::NULLID, std::string mapsTo="") noexcept(false)
EcalChannelStatusHandler(edm::ParameterSet const &)
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
cond::ValidityInterval lastInterval
std::map< DetId, float > maskedLaserEE
std::string getName() const
float getPedMeanG12() const
static uint64_t getMask(std::string shortDesc)
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
float checkPedestalRMSGain12(EcalPedestals::Item *item)
float getPedRMSG12() const
EcalElectronicsMapping ecalElectronicsMap_
void nBadLaserModules(std::map< EcalLogicID, MonLaserBlueDat > dataset_mon)
float checkPedestalRMSGain6(EcalPedestals::Item *item)
int ieta() const
get the crystal ieta
void setMonVersionDef(const MonVersionDef &ver)
bool isGoodLaserEBSm[36][2]
std::string m_locationsource
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
void setLocationDef(const LocationDef &locDef)
int ic() const
get ECAL/crystal number inside SM
std::vector< MonRunIOV > getRuns()
std::ofstream * ResFileNewEB
float getADCMeanG12() const
unsigned long long uint64_t
void setRunType(std::string runtype)
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
float checkPedestalValueGain1(EcalPedestals::Item *item)
void setMonRunTag(const MonRunTag &tag)
float getPedMeanG1() const
bool isGoodLaserEESm[18][2]
void setMonitoringVersion(std::string ver)
~EcalChannelStatusHandler()
EcalCondDBInterface * econn
std::map< DetId, float > maskedOnlinePedEB
void laserAnalysis(std::map< EcalLogicID, MonLaserBlueDat > dataset_mon)
float checkPedestalRMSGain1(EcalPedestals::Item *item)
float getPedMeanG6() const
void setLocation(std::string loc)
std::ofstream * ResFileEB
void fetchConfigDataSet(std::vector< DATT > *fillMap, ICONF *iconf) noexcept(false)
void setGeneralTag(std::string tag)
std::ofstream * ResFileNewEE
float getADCRMSG12() const
static const int SMCRYSTALMODE
void setElectronicsMap(const EcalElectronicsMapping *)
void pedAnalysis(std::map< EcalLogicID, MonPedestalsDat > dataset_mon, std::map< EcalLogicID, MonCrystalConsistencyDat > wrongGain_mon)
float getPedRMSG6() const
void daqOut(const RunIOV &myRun)
cond::TagInfo_t const & tagInfo() const