80 int MaxI=0;
double Energy,MaxE=0;
81 for(
int j=0;
j<
n;++
j)
if(MaxE<data[
j]){ MaxE=data[
j]; MaxI=
j; }
83 if(MaxI>0) Energy+=data[MaxI-1];
84 if(MaxI>1) Energy+=data[MaxI-2];
85 if(MaxI<(n-1)) Energy+=data[MaxI+1];
86 if(MaxI<(n-2)) Energy+=data[MaxI+2];
90 int MaxI=0;
double Time=-9999,SumT=0,MaxT=-10;
91 for(
int j=0;
j<
n;++
j)
if(MaxT<data[
j]){ MaxT=data[
j]; MaxI=
j; }
94 if(MaxI>0){ Time+=(MaxI-1)*data[MaxI-1]; SumT+=data[MaxI-1]; }
95 if(MaxI<(n-1)){ Time+=(MaxI+1)*data[MaxI+1]; SumT+=data[MaxI+1]; }
117 void reset()
override;
128 if(sd.compare(
"HB")==0) SD=1;
129 if(sd.compare(
"HE")==0) SD=2;
130 if(sd.compare(
"HO")==0) SD=3;
131 if(sd.compare(
"HF")==0) SD=4;
133 if(eta>0)
ETA=1;
else ETA=-1;
134 if(phi==71 ||phi==72 || phi==1 || phi==2)
PHI=71;
else PHI=((phi-3)/4)*4+3;
138 if(phi==71 ||phi==72 || phi==1 || phi==2 || phi==3 || phi==4)
PHI=71;
else PHI=((phi-5)/6)*6+5;
143 if(phi==71 ||phi==72 || (phi>=1 && phi<=10))
PHI=71;
else PHI=((phi-11)/12)*12+11;
146 if(eta>0)
ETA=1;
else ETA=-1;
147 if(phi>=1 && phi<=18)
PHI=1;
148 if(phi>=19 && phi<=36)
PHI=19;
149 if(phi>=37 && phi<=54)
PHI=37;
150 if(phi>=55 && phi<=72)
PHI=55;
226 static const float adc2fC[128]={-0.5,0.5,1.5,2.5,3.5,4.5,5.5,6.5,7.5,8.5,9.5, 10.5,11.5,12.5,
227 13.5,15.,17.,19.,21.,23.,25.,27.,29.5,32.5,35.5,38.5,42.,46.,50.,54.5,59.5,
228 64.5,59.5,64.5,69.5,74.5,79.5,84.5,89.5,94.5,99.5,104.5,109.5,114.5,119.5,
229 124.5,129.5,137.,147.,157.,167.,177.,187.,197.,209.5,224.5,239.5,254.5,272.,
230 292.,312.,334.5,359.5,384.5,359.5,384.5,409.5,434.5,459.5,484.5,509.5,534.5,
231 559.5,584.5,609.5,634.5,659.5,684.5,709.5,747.,797.,847.,897.,947.,997.,
232 1047.,1109.5,1184.5,1259.5,1334.5,1422.,1522.,1622.,1734.5,1859.5,1984.5,
233 1859.5,1984.5,2109.5,2234.5,2359.5,2484.5,2609.5,2734.5,2859.5,2984.5,
234 3109.5,3234.5,3359.5,3484.5,3609.5,3797.,4047.,4297.,4547.,4797.,5047.,
235 5297.,5609.5,5984.5,6359.5,6734.5,7172.,7672.,8172.,8734.5,9359.5,9984.5};
256 if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!=
"/")
257 prefixME_.append(
"/");
319 if (
debug_>1)
std::cout <<
"HcalDetDiagLEDMonitor::bookHistograms"<<std::endl;
331 for (std::vector<DetId>::const_iterator
i = mydetids.begin();
i!=mydetids.end();++
i){
357 name=
"HBHEHO LED Energy Distribution";
Energy = ib.
book1D(name,name,200,0,3000);
358 name=
"HBHEHO LED Timing Distribution";
Time = ib.
book1D(name,name,200,0,10);
359 name=
"HBHEHO LED Energy RMS_div_Energy Distribution";
EnergyRMS = ib.
book1D(name,name,200,0,0.2);
360 name=
"HBHEHO LED Timing RMS Distribution";
TimeRMS = ib.
book1D(name,name,200,0,0.4);
361 name=
"HF LED Energy Distribution";
EnergyHF = ib.
book1D(name,name,200,0,3000);
362 name=
"HF LED Timing Distribution";
TimeHF = ib.
book1D(name,name,200,0,10);
363 name=
"HF LED Energy RMS_div_Energy Distribution";
EnergyRMSHF = ib.
book1D(name,name,200,0,0.5);
364 name=
"HF LED Timing RMS Distribution";
TimeRMSHF = ib.
book1D(name,name,200,0,0.4);
365 name=
"LED Energy Corr(PinDiod) Distribution";
EnergyCorr = ib.
book1D(name,name,200,0,10);
367 name=
"LED Timing HO";
Time2Dho = ib.
book2D(name,name,33,-16,16,74,0,73);
371 name=
"HBP Average over HPD LED Ref";
HBPphi = ib.
book2D(name,name,180,1,73,400,0,2);
372 name=
"HBM Average over HPD LED Ref";
HBMphi = ib.
book2D(name,name,180,1,73,400,0,2);
373 name=
"HEP Average over HPD LED Ref";
HEPphi = ib.
book2D(name,name,180,1,73,400,0,2);
374 name=
"HEM Average over HPD LED Ref";
HEMphi = ib.
book2D(name,name,180,1,73,400,0,2);
375 name=
"HFP Average over RM LED Ref";
HFPphi = ib.
book2D(name,name,180,1,37,400,0,2);
376 name=
"HFM Average over RM LED Ref";
HFMphi = ib.
book2D(name,name,180,1,37,400,0,2);
377 name=
"HO0 Average over HPD LED Ref";
HO0phi = ib.
book2D(name,name,180,1,49,400,0,2);
378 name=
"HO1P Average over HPD LED Ref";
HO1Pphi= ib.
book2D(name,name,180,1,49,400,0,2);
379 name=
"HO2P Average over HPD LED Ref";
HO2Pphi= ib.
book2D(name,name,180,1,49,400,0,2);
380 name=
"HO1M Average over HPD LED Ref";
HO1Mphi= ib.
book2D(name,name,180,1,49,400,0,2);
381 name=
"HO2M Average over HPD LED Ref";
HO2Mphi= ib.
book2D(name,name,180,1,49,400,0,2);
421 if(trigger_data->triggerWord()==6){ LEDEvent=
true;LocalRun=
true;}
423 if(!LocalRun)
return;
424 if(!LEDEvent)
return;
436 eta=digi->id().ieta(); phi=digi->id().iphi(); depth=digi->id().depth(); nTS=digi->size();
438 for(
int i=0;
i<nTS;
i++) data[
i]=
adc2fC[digi->sample(
i).adc()&0xff]-2.5;
442 for(
int i=0;
i<nTS;
i++) data[
i]=
adc2fC[digi->sample(
i).adc()&0xff]-2.5;
450 eta=digi->id().ieta(); phi=digi->id().iphi(); depth=digi->id().depth(); nTS=digi->size();
451 for(
int i=0;
i<nTS;
i++) data[
i]=
adc2fC[digi->sample(
i).adc()&0xff]-2.5;
458 eta=digi->id().ieta(); phi=digi->id().iphi(); depth=digi->id().depth(); nTS=digi->size();
459 for(
int i=0;
i<nTS;
i++) data[
i]=
adc2fC[digi->sample(
i).adc()&0xff]-2.5;
466 if(digi->id().cboxChannel()!=0 || digi->id().hcalSubdet()==0)
continue;
469 for(
int i=0;
i<nTS;
i++){ data[
i]=
adc2fC[digi->sample(
i).adc()&0xff]; e+=data[
i];}
473 if(((
ievt_)%500)==0){
510 double T=0,nT=0,E=0,nE=0;
523 T+=time; nT++; E+=ave; nE++;
537 double T=0,nT=0,E=0,nE=0;
549 T+=time; nT++; E+=ave; nE++;
565 double T=0,nT=0,E=0,nE=0;
577 T+=time; nT++; E+=ave; nE++;
593 double T=0,nT=0,E=0,nE=0;
606 T+=time; nT++; E+=ave; nE++;
620 double ave=0.,
rms=0.,ave_calib=0.,rms_calib=0.;
648 double hbp[18][4],nhbp[18][4],hbm[18][4],nhbm[18][4];
649 double hep[18][4],nhep[18][4],hem[18][4],nhem[18][4];
650 double hfp[18][4],nhfp[18][4],hfm[18][4],nhfm[18][4];
651 double ho0[18][4],nho0[18][4];
652 double ho1p[18][4],nho1p[18][4];
653 double ho2p[18][4],nho2p[18][4];
654 double ho1m[18][4],nho1m[18][4];
655 double ho2m[18][4],nho2m[18][4];
656 for(
int i=0;
i<18;
i++)
for(
int j=0;
j<4;
j++)
657 hbp[
i][
j]=nhbp[
i][
j]=hbm[
i][
j]=nhbm[
i][
j]=hep[
i][
j]=nhep[
i][
j]=hem[
i][
j]=nhem[
i][
j]=hfp[
i][
j]=nhfp[
i][
j]=hfm[
i][
j]=nhfm[
i][
j]=0;
658 for(
int i=0;
i<18;
i++)
for(
int j=0;
j<4;
j++)
659 ho0[
i][
j]=nho0[
i][
j]=ho1p[
i][
j]=nho1p[
i][
j]=ho2p[
i][
j]=nho2p[
i][
j]=ho1m[
i][
j]=nho1m[
i][
j]=ho2m[
i][
j]=nho2m[
i][
j]=0;
662 for(std::vector <HcalElectronicsId>::iterator eid = AllElIds.begin(); eid != AllElIds.end(); eid++){
666 if(!(!(gid.null()) &&
688 if(sd==0 || sd==1 || sd==3){
689 sscanf(&(lmap_entry.
rbx().c_str())[3],
"%d",&rbx);
691 if(
abs(
eta)<5) sscanf(&(lmap_entry.
rbx().c_str())[3],
"%d",&rbx);
692 if(
abs(
eta)>=5) sscanf(&(lmap_entry.
rbx().c_str())[4],
"%d",&rbx);
695 if(sd==0 &&
eta>0){ hbp[rbx-1][lmap_entry.
rm()-1]+=ave/ref; nhbp[rbx-1][lmap_entry.
rm()-1]++; }
696 if(sd==0 &&
eta<0){ hbm[rbx-1][lmap_entry.
rm()-1]+=ave/ref; nhbm[rbx-1][lmap_entry.
rm()-1]++; }
697 if(sd==1 &&
eta>0){ hep[rbx-1][lmap_entry.
rm()-1]+=ave/ref; nhep[rbx-1][lmap_entry.
rm()-1]++; }
698 if(sd==1 &&
eta<0){ hem[rbx-1][lmap_entry.
rm()-1]+=ave/ref; nhem[rbx-1][lmap_entry.
rm()-1]++; }
699 if(sd==3 &&
eta>0){ hfp[rbx-1][lmap_entry.
rm()-1]+=ave/ref; nhfp[rbx-1][lmap_entry.
rm()-1]++; }
700 if(sd==3 &&
eta<0){ hfm[rbx-1][lmap_entry.
rm()-1]+=ave/ref; nhfm[rbx-1][lmap_entry.
rm()-1]++; }
701 if(sd==2 &&
abs(
eta)<5){ ho0[rbx-1][lmap_entry.
rm()-1]+=ave/ref; nho0[rbx-1][lmap_entry.
rm()-1]++; }
702 if(sd==2 &&
eta>=5 &&
eta<=10){ ho1p[rbx-1][lmap_entry.
rm()-1]+=ave/ref; nho1p[rbx-1][lmap_entry.
rm()-1]++; }
703 if(sd==2 &&
eta>=11 &&
eta<=15){ ho2p[rbx-1][lmap_entry.
rm()-1]+=ave/ref; nho2p[rbx-1][lmap_entry.
rm()-1]++; }
704 if(sd==2 &&
eta>=-10 &&
eta<=-5){ ho1m[rbx-1][lmap_entry.
rm()-1]+=ave/ref; nho1m[rbx-1][lmap_entry.
rm()-1]++; }
705 if(sd==2 &&
eta>=-15 &&
eta<=-11){ ho2m[rbx-1][lmap_entry.
rm()-1]+=ave/ref; nho2m[rbx-1][lmap_entry.
rm()-1]++; }
708 for(
int i=0;
i<18;
i++)
for(
int j=0;
j<4;
j++){
715 for(
int i=0;
i<12;
i++)
for(
int j=0;
j<3;
j++){
720 for(
int i=0;
i<12;
i++)
for(
int j=0;
j<4;
j++){
733 char Subdet[10],str[500];
735 TFile *
theFile =
new TFile(str,
"RECREATE");
736 if(!theFile->IsOpen())
return;
738 sprintf(str,
"%d",
run_number); TObjString
run(str); run.Write(
"run number");
739 sprintf(str,
"%d",
ievt_); TObjString
events(str); events.Write(
"Total events processed");
741 TTree *
tree =
new TTree(
"HCAL LED data",
"HCAL LED data");
743 tree->Branch(
"Subdet", &Subdet,
"Subdet/C");
744 tree->Branch(
"eta", &Eta,
"Eta/I");
745 tree->Branch(
"phi", &Phi,
"Phi/I");
746 tree->Branch(
"depth", &Depth,
"Depth/I");
747 tree->Branch(
"statistic",&Statistic,
"Statistic/I");
748 tree->Branch(
"status", &Status,
"Status/I");
749 tree->Branch(
"led", &led,
"led/D");
750 tree->Branch(
"rms", &rms,
"rms/D");
751 tree->Branch(
"time", &Time,
"time/D");
752 tree->Branch(
"time_rms", &time_rms,
"time_rms/D");
753 sprintf(Subdet,
"HB");
763 sprintf(Subdet,
"HE");
773 sprintf(Subdet,
"HO");
783 sprintf(Subdet,
"HF");
793 sprintf(Subdet,
"CALIB_HB");
796 Eta=
eta; Phi=
phi; Depth=0;
803 sprintf(Subdet,
"CALIB_HE");
806 Eta=
eta; Phi=
phi; Depth=0;
813 sprintf(Subdet,
"CALIB_HO");
816 Eta=
eta; Phi=
phi; Depth=0;
823 sprintf(Subdet,
"CALIB_HF");
826 Eta=
eta; Phi=
phi; Depth=0;
840 Long_t
t; t=time(0); strftime(TIME,30,
"%F %T",localtime(&t));
845 xmlFile.open(xmlName.c_str());
847 xmlFile<<
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n";
849 xmlFile<<
" <HEADER>\n";
850 xmlFile<<
" <HINTS mode='only-det-root'/>\n";
851 xmlFile<<
" <TYPE>\n";
852 xmlFile<<
" <EXTENSION_TABLE_NAME>HCAL_DETMON_LED_LASER_V1</EXTENSION_TABLE_NAME>\n";
853 xmlFile<<
" <NAME>HCAL LED [local]</NAME>\n";
854 xmlFile<<
" </TYPE>\n";
855 xmlFile<<
" <!-- run details -->\n";
857 xmlFile<<
" <RUN_TYPE>LOCAL-RUN</RUN_TYPE>\n";
858 xmlFile<<
" <RUN_NUMBER>"<<
run_number<<
"</RUN_NUMBER>\n";
859 xmlFile<<
" <RUN_BEGIN_TIMESTAMP>2009-01-01 00:00:00</RUN_BEGIN_TIMESTAMP>\n";
860 xmlFile<<
" <COMMENT_DESCRIPTION>hcal LED data</COMMENT_DESCRIPTION>\n";
861 xmlFile<<
" <LOCATION>P5</LOCATION>\n";
862 xmlFile<<
" <INITIATED_BY_USER>dma</INITIATED_BY_USER>\n";
863 xmlFile<<
" </RUN>\n";
864 xmlFile<<
" </HEADER>\n";
865 xmlFile<<
" <DATA_SET>\n";
866 xmlFile<<
" <!-- optional dataset metadata -->\n\n";
868 xmlFile<<
" <SET_BEGIN_TIMESTAMP>2009-01-01 00:00:00</SET_BEGIN_TIMESTAMP>\n";
869 xmlFile<<
" <SET_END_TIMESTAMP>2009-01-01 00:00:00</SET_END_TIMESTAMP>\n";
870 xmlFile<<
" <NUMBER_OF_EVENTS_IN_SET>"<<
ievt_<<
"</NUMBER_OF_EVENTS_IN_SET>\n";
871 xmlFile<<
" <COMMENT_DESCRIPTION>Automatic DQM output</COMMENT_DESCRIPTION>\n";
872 xmlFile<<
" <DATA_FILE_NAME>"<< xmlName <<
"</DATA_FILE_NAME>\n";
873 xmlFile<<
" <IMAGE_FILE_NAME>data plot url or file path</IMAGE_FILE_NAME>\n";
874 xmlFile<<
" <!-- who and when created this dataset-->\n\n";
875 xmlFile<<
" <CREATE_TIMESTAMP>"<<TIME<<
"</CREATE_TIMESTAMP>\n";
876 xmlFile<<
" <CREATED_BY_USER>dma</CREATED_BY_USER>\n";
877 xmlFile<<
" <!-- version (string) and subversion (number) -->\n";
878 xmlFile<<
" <!-- fields are used to read data back from the database -->\n\n";
879 xmlFile<<
" <VERSION>"<<run_number<<dataset_seq_number<<
"</VERSION>\n";
880 xmlFile<<
" <SUBVERSION>1</SUBVERSION>\n";
881 xmlFile<<
" <!-- Assign predefined dataset attributes -->\n\n";
882 xmlFile<<
" <PREDEFINED_ATTRIBUTES>\n";
883 xmlFile<<
" <ATTRIBUTE>\n";
884 xmlFile<<
" <NAME>HCAL Dataset Status</NAME>\n";
885 xmlFile<<
" <VALUE>VALID</VALUE>\n";
886 xmlFile<<
" </ATTRIBUTE>\n";
887 xmlFile<<
" </PREDEFINED_ATTRIBUTES>\n";
888 xmlFile<<
" <!-- multiple data block records -->\n\n";
891 for(std::vector <HcalElectronicsId>::iterator eid = AllElIds.begin(); eid != AllElIds.end(); eid++){
895 if(!(!(gid.null()) &&
907 double e=0,e_rms=0,t=0,t_rms=0;
933 xmlFile<<
" <DATA>\n";
934 xmlFile<<
" <NUMBER_OF_EVENTS_USED>"<<Statistic<<
"</NUMBER_OF_EVENTS_USED>\n";
935 xmlFile<<
" <SIGNAL_MEAN>"<<e<<
"</SIGNAL_MEAN>\n";
936 xmlFile<<
" <SIGNAL_RMS>"<<e_rms<<
"</SIGNAL_RMS>\n";
937 xmlFile<<
" <TIME_MEAN>"<<t<<
"</TIME_MEAN>\n";
938 xmlFile<<
" <TIME_RMS>"<<t_rms<<
"</TIME_RMS>\n";
939 xmlFile<<
" <CHANNEL_STATUS_WORD>"<<Status<<
"</CHANNEL_STATUS_WORD>\n";
940 xmlFile<<
" <CHANNEL_OBJECTNAME>HcalDetId</CHANNEL_OBJECTNAME>\n";
941 xmlFile<<
" <SUBDET>"<<subdet<<
"</SUBDET>\n";
942 xmlFile<<
" <IETA>"<<eta<<
"</IETA>\n";
943 xmlFile<<
" <IPHI>"<<phi<<
"</IPHI>\n";
944 xmlFile<<
" <DEPTH>"<<depth<<
"</DEPTH>\n";
945 xmlFile<<
" <TYPE>0</TYPE>\n";
946 xmlFile<<
" </DATA>\n";
949 xmlFile<<
" </DATA_SET>\n";
950 xmlFile<<
"</ROOT>\n";
954 sprintf(str,
"HcalDetDiagLEDCalib_%i_%i.xml",run_number,dataset_seq_number);
956 std::ofstream xmlFileCalib;
957 xmlFileCalib.open(xmlNameCalib.c_str());
959 xmlFileCalib<<
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n";
960 xmlFileCalib<<
"<ROOT>\n";
961 xmlFileCalib<<
" <HEADER>\n";
962 xmlFileCalib<<
" <HINTS mode='only-det-root'/>\n";
963 xmlFileCalib<<
" <TYPE>\n";
964 xmlFileCalib<<
" <EXTENSION_TABLE_NAME>HCAL_DETMON_LED_LASER_V1</EXTENSION_TABLE_NAME>\n";
965 xmlFileCalib<<
" <NAME>HCAL LED CALIB [local]</NAME>\n";
966 xmlFileCalib<<
" </TYPE>\n";
967 xmlFileCalib<<
" <!-- run details -->\n";
968 xmlFileCalib<<
" <RUN>\n";
969 xmlFileCalib<<
" <RUN_TYPE>LOCAL-RUN</RUN_TYPE>\n";
970 xmlFileCalib<<
" <RUN_NUMBER>"<<run_number<<
"</RUN_NUMBER>\n";
971 xmlFileCalib<<
" <RUN_BEGIN_TIMESTAMP>2009-01-01 00:00:00</RUN_BEGIN_TIMESTAMP>\n";
972 xmlFileCalib<<
" <COMMENT_DESCRIPTION>hcal LED CALIB data</COMMENT_DESCRIPTION>\n";
973 xmlFileCalib<<
" <LOCATION>P5</LOCATION>\n";
974 xmlFileCalib<<
" <INITIATED_BY_USER>dma</INITIATED_BY_USER>\n";
975 xmlFileCalib<<
" </RUN>\n";
976 xmlFileCalib<<
" </HEADER>\n";
977 xmlFileCalib<<
" <DATA_SET>\n";
978 xmlFileCalib<<
" <!-- optional dataset metadata -->\n\n";
979 xmlFileCalib<<
" <SET_NUMBER>"<<dataset_seq_number<<
"</SET_NUMBER>\n";
980 xmlFileCalib<<
" <SET_BEGIN_TIMESTAMP>2009-01-01 00:00:00</SET_BEGIN_TIMESTAMP>\n";
981 xmlFileCalib<<
" <SET_END_TIMESTAMP>2009-01-01 00:00:00</SET_END_TIMESTAMP>\n";
982 xmlFileCalib<<
" <NUMBER_OF_EVENTS_IN_SET>"<<ievt_<<
"</NUMBER_OF_EVENTS_IN_SET>\n";
983 xmlFileCalib<<
" <COMMENT_DESCRIPTION>Automatic DQM output</COMMENT_DESCRIPTION>\n";
984 xmlFileCalib<<
" <DATA_FILE_NAME>"<< xmlNameCalib <<
"</DATA_FILE_NAME>\n";
985 xmlFileCalib<<
" <IMAGE_FILE_NAME>data plot url or file path</IMAGE_FILE_NAME>\n";
986 xmlFileCalib<<
" <!-- who and when created this dataset-->\n\n";
987 xmlFileCalib<<
" <CREATE_TIMESTAMP>"<<TIME<<
"</CREATE_TIMESTAMP>\n";
988 xmlFileCalib<<
" <CREATED_BY_USER>dma</CREATED_BY_USER>\n";
989 xmlFileCalib<<
" <!-- version (string) and subversion (number) -->\n";
990 xmlFileCalib<<
" <!-- fields are used to read data back from the database -->\n\n";
991 xmlFileCalib<<
" <VERSION>"<<run_number<<dataset_seq_number<<
"</VERSION>\n";
992 xmlFileCalib<<
" <SUBVERSION>1</SUBVERSION>\n";
993 xmlFileCalib<<
" <!-- Assign predefined dataset attributes -->\n\n";
994 xmlFileCalib<<
" <PREDEFINED_ATTRIBUTES>\n";
995 xmlFileCalib<<
" <ATTRIBUTE>\n";
996 xmlFileCalib<<
" <NAME>HCAL Dataset Status</NAME>\n";
997 xmlFileCalib<<
" <VALUE>VALID</VALUE>\n";
998 xmlFileCalib<<
" </ATTRIBUTE>\n";
999 xmlFileCalib<<
" </PREDEFINED_ATTRIBUTES>\n";
1000 xmlFileCalib<<
" <!-- multiple data block records -->\n\n";
1004 if(
sd==1) subdet=
"HB";
1005 if(
sd==2) subdet=
"HE";
1006 if(
sd==3) subdet=
"HO";
1007 if(
sd==4) subdet=
"HF";
1009 double e=0,e_rms=0,t=0,t_rms=0;
1014 xmlFileCalib<<
" <DATA>\n";
1015 xmlFileCalib<<
" <NUMBER_OF_EVENTS_USED>"<<Statistic<<
"</NUMBER_OF_EVENTS_USED>\n";
1016 xmlFileCalib<<
" <SIGNAL_MEAN>"<<e<<
"</SIGNAL_MEAN>\n";
1017 xmlFileCalib<<
" <SIGNAL_RMS>"<<e_rms<<
"</SIGNAL_RMS>\n";
1018 xmlFileCalib<<
" <TIME_MEAN>"<<t<<
"</TIME_MEAN>\n";
1019 xmlFileCalib<<
" <TIME_RMS>"<<t_rms<<
"</TIME_RMS>\n";
1020 xmlFileCalib<<
" <CHANNEL_STATUS_WORD>"<<Status<<
"</CHANNEL_STATUS_WORD>\n";
1021 xmlFileCalib<<
" <CHANNEL_OBJECTNAME>HcalDetId</CHANNEL_OBJECTNAME>\n";
1022 xmlFileCalib<<
" <SUBDET>"<<subdet<<
"</SUBDET>\n";
1023 xmlFileCalib<<
" <IETA>"<<
eta<<
"</IETA>\n";
1024 xmlFileCalib<<
" <IPHI>"<<
phi<<
"</IPHI>\n";
1025 xmlFileCalib<<
" <DEPTH>"<<0<<
"</DEPTH>\n";
1026 xmlFileCalib<<
" <TYPE>0</TYPE>\n";
1027 xmlFileCalib<<
" </DATA>\n";
1031 xmlFileCalib<<
" </DATA_SET>\n";
1032 xmlFileCalib<<
"</ROOT>\n";
1033 xmlFileCalib.close();
1035 sprintf(str,
"zip %s.zip %s %s",xmlName.c_str(),xmlName.c_str(),xmlNameCalib.c_str());
1037 sprintf(str,
"rm -f %s %s",xmlName.c_str(),xmlNameCalib.c_str());
1039 sprintf(str,
"mv -f %s.zip %s",xmlName.c_str(),
XmlFilePath.c_str());
1054 if(!f->IsOpen())
return ;
1055 TObjString *STR=(TObjString *)f->Get(
"run number");
1057 TTree*
t=(TTree*)f->Get(
"HCAL LED data");
1059 t->SetBranchAddress(
"Subdet", subdet);
1060 t->SetBranchAddress(
"eta", &Eta);
1061 t->SetBranchAddress(
"phi", &Phi);
1062 t->SetBranchAddress(
"depth", &Depth);
1063 t->SetBranchAddress(
"led", &led);
1064 t->SetBranchAddress(
"rms", &rms);
1065 for(
int ievt=0;ievt<t->GetEntries();ievt++){
1082 for(
int i=0;
i<4;
i++){
1093 for (std::vector <HcalElectronicsId>::iterator eid = AllElIds.begin(); eid != AllElIds.end(); eid++) {
1097 if(!(!(gid.null()) &&
1118 if(stat>0 && stat!=(
ievt_)){
1126 if((AVE_TIME-ave)>0.75 || (AVE_TIME-ave)<-0.75){
1144 if(stat>0 && stat!=(
ievt_)){
1152 if((AVE_TIME-ave)>0.75 || (AVE_TIME-ave)<-0.75){
1170 if(stat>0 && stat!=(
ievt_)){
1178 if((AVE_TIME-ave)>0.75 || (AVE_TIME-ave)<-0.75){
1197 if(stat>0 && stat!=(
ievt_)){
1205 if((AVE_TIME-ave)>0.75 || (AVE_TIME-ave)<-0.75){
1220 if (subdet.compare(
"HB")==0) subdetval=(
int)
HcalBarrel;
1221 else if (subdet.compare(
"HE")==0) subdetval=(
int)
HcalEndcap;
1222 else if (subdet.compare(
"HO")==0) subdetval=(
int)
HcalOuter;
1223 else if (subdet.compare(
"HF")==0) subdetval=(
int)
HcalForward;
1226 int ietabin=
CalcEtaBin(subdetval, eta, depth)+1;
1233 if (subdet.compare(
"HB")==0) subdetval=(
int)
HcalBarrel;
1234 else if (subdet.compare(
"HE")==0) subdetval=(
int)
HcalEndcap;
1235 else if (subdet.compare(
"HO")==0) subdetval=(
int)
HcalOuter;
1236 else if (subdet.compare(
"HF")==0) subdetval=(
int)
HcalForward;
1239 int ietabin=
CalcEtaBin(subdetval, eta, depth)+1;
1247 if (subdet.compare(
"HB")==0) subdetval=(
int)
HcalBarrel;
1248 else if (subdet.compare(
"HE")==0) subdetval=(
int)
HcalEndcap;
1249 else if (subdet.compare(
"HO")==0) subdetval=(
int)
HcalOuter;
1250 else if (subdet.compare(
"HF")==0) subdetval=(
int)
HcalForward;
1252 int ietabin=
CalcEtaBin(subdetval, eta, depth)+1;
EtaPhiHists * ChannelStatusMissingChannels
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< HcalTBTriggerData > tok_tb_
edm::Ref< Container > Ref
std::string OutputFilePath
std::vector< HcalElectronicsId > allElectronicsIdPrecision() const
HcalDetDiagLEDData hb_data[85][72][4]
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
std::string ReferenceData
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void setup(DQMStore::IBooker &ib) override
EtaPhiHists * ChannelStatusTimeMean
#define DEFINE_FWK_MODULE(type)
bool get_average_led(double *ave, double *rms)
std::vector< int > AllowedCalibTypes_
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &)
MonitorElement * bookInt(Args &&...args)
std::vector< HBHEDataFrame >::const_iterator const_iterator
MonitorElement * bookString(Args &&...args)
edm::EDGetTokenT< HcalCalibDigiCollection > tok_calib_
EtaPhiHists * ChannelStatusLEDMean
const Item * getValues(DetId fId, bool throwOnFail=true) const
double GetEnergy(double *data, int n)
void fill_channel_status(std::string subdet, int eta, int phi, int depth, int type, double status)
void getLogicalMap(const edm::EventSetup &c)
EtaPhiHists * ChannelStatusTimeRMS
double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
static const float adc2fC[128]
double GetTime(double *data, int n=10)
HcalDetDiagLEDData hf_data[85][72][4]
HcalDetDiagLEDData * GetCalib(std::string sd, int eta, int phi)
MonitorElement * EnergyRMSHF
bool get_reference(double *val, double *rms)
EtaPhiHists * ChannelStatusUnstableChannels
uint32_t rawId() const
get the raw id
EtaPhiHists * ChannelsLEDEnergyRef
bool isSiPM(int ieta, int iphi, int depth)
int depth() const
get the tower depth
MVATrainerComputer * calib
HcalElectronicsMap generateHcalElectronicsMap()
std::vector< MonitorElement * > depth
edm::EDGetTokenT< HFDigiCollection > tok_hf_
MonitorElement * EnergyCorr
HcalDetDiagLEDData ho_data[85][72][4]
std::vector< DetId > getAllChannels() const
HcalLogicalMap * logicalMap_
int ieta() const
get the cell ieta
MonitorElement * book1D(Args &&...args)
HcalElectronicsMap * emap
Abs< T >::type abs(const T &t)
EtaPhiHists * ChannelStatusUnstableLEDsignal
MonitorElement * EnergyRMS
HcalDetDiagLEDMonitor(const edm::ParameterSet &ps)
void setup(DQMStore::IBooker &m_dbe, std::string Name, std::string Units="")
void endRun(const edm::Run &run, const edm::EventSetup &c) override
void add_statistics(double *data, int nTS)
MonitorElement * EnergyHF
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
MonitorElement * Energy2Dho
bool get_average_time(double *ave, double *rms)
MonitorElement * TimeRMSHF
const HcalFrontEndId getHcalFrontEndId(const DetId &)
MonitorElement * Time2Dhbhehf
int iphi() const
get the cell iphi
void setCurrentFolder(const std::string &fullpath)
MonitorElement * book2D(Args &&...args)
T const * product() const
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
MonitorElement * Time2Dho
bool xmlFile(const std::string fParam)
int CalcEtaBin(int subdet, int ieta, int depth)
void bookHistograms(DQMStore::IBooker &ib, const edm::Run &run, const edm::EventSetup &c) override
Geom::Phi< T > phi() const
HcalDetDiagLEDData calib_data[5][5][72]
void fill_energy(std::string subdet, int eta, int phi, int depth, double e, int type)
edm::EDGetTokenT< HBHEDigiCollection > tok_hbhe_
HcalDetDiagLEDData he_data[85][72][4]
EtaPhiHists * ChannelStatusLEDRMS
std::map< unsigned int, int > KnownBadCells_
const JetExtendedData & getValue(const Container &, const reco::JetBaseRef &)
get value for the association. Throw exception if no association found
void change_status(int val)
double get_energy(std::string subdet, int eta, int phi, int depth, int type)
Detector det() const
get the detector field from this detid
EtaPhiHists * ChannelsLEDEnergy
MonitorElement * Energy2Dhbhehf
void Reset(void)
reset ME (ie. contents, errors, etc)
virtual void setup(DQMStore::IBooker &)
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
void set_reference(float val, float rms)
edm::EDGetTokenT< HODigiCollection > tok_ho_