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]; }
129 if(sd.compare(
"HB")==0) SD=1;
130 if(sd.compare(
"HE")==0) SD=2;
131 if(sd.compare(
"HO")==0) SD=3;
132 if(sd.compare(
"HF")==0) SD=4;
134 if(eta>0)
ETA=1;
else ETA=-1;
135 if(phi==71 ||phi==72 || phi==1 || phi==2)
PHI=71;
else PHI=((phi-3)/4)*4+3;
139 if(phi==71 ||phi==72 || phi==1 || phi==2 || phi==3 || phi==4)
PHI=71;
else PHI=((phi-5)/6)*6+5;
144 if(phi==71 ||phi==72 || (phi>=1 && phi<=10))
PHI=71;
else PHI=((phi-11)/12)*12+11;
147 if(eta>0)
ETA=1;
else ETA=-1;
148 if(phi>=1 && phi<=18)
PHI=1;
149 if(phi>=19 && phi<=36)
PHI=19;
150 if(phi>=37 && phi<=54)
PHI=37;
151 if(phi>=55 && phi<=72)
PHI=55;
223 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,
224 13.5,15.,17.,19.,21.,23.,25.,27.,29.5,32.5,35.5,38.5,42.,46.,50.,54.5,59.5,
225 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,
226 124.5,129.5,137.,147.,157.,167.,177.,187.,197.,209.5,224.5,239.5,254.5,272.,
227 292.,312.,334.5,359.5,384.5,359.5,384.5,409.5,434.5,459.5,484.5,509.5,534.5,
228 559.5,584.5,609.5,634.5,659.5,684.5,709.5,747.,797.,847.,897.,947.,997.,
229 1047.,1109.5,1184.5,1259.5,1334.5,1422.,1522.,1622.,1734.5,1859.5,1984.5,
230 1859.5,1984.5,2109.5,2234.5,2359.5,2484.5,2609.5,2734.5,2859.5,2984.5,
231 3109.5,3234.5,3359.5,3484.5,3609.5,3797.,4047.,4297.,4547.,4797.,5047.,
232 5297.,5609.5,5984.5,6359.5,6734.5,7172.,7672.,8172.,8734.5,9359.5,9984.5};
239 hcalTBTriggerDataTag_(ps.getParameter<edm::InputTag>(
"hcalTBTriggerDataTag"))
251 if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!=
"/")
252 prefixME_.append(
"/");
289 if (
debug_>1)
std::cout <<
"HcalDetDiagLEDMonitor::beginRun"<<std::endl;
301 for (std::vector<DetId>::const_iterator
i = mydetids.begin();
i!=mydetids.end();++
i){
328 name=
"HBHEHO LED Energy Distribution";
Energy =
dbe_->
book1D(name,name,200,0,3000);
329 name=
"HBHEHO LED Timing Distribution";
Time =
dbe_->
book1D(name,name,200,0,10);
330 name=
"HBHEHO LED Energy RMS_div_Energy Distribution";
EnergyRMS =
dbe_->
book1D(name,name,200,0,0.2);
331 name=
"HBHEHO LED Timing RMS Distribution";
TimeRMS =
dbe_->
book1D(name,name,200,0,0.4);
333 name=
"HF LED Timing Distribution";
TimeHF =
dbe_->
book1D(name,name,200,0,10);
342 name=
"HBP Average over HPD LED Ref";
HBPphi =
dbe_->
book2D(name,name,180,1,73,400,0,2);
343 name=
"HBM Average over HPD LED Ref";
HBMphi =
dbe_->
book2D(name,name,180,1,73,400,0,2);
344 name=
"HEP Average over HPD LED Ref";
HEPphi =
dbe_->
book2D(name,name,180,1,73,400,0,2);
345 name=
"HEM Average over HPD LED Ref";
HEMphi =
dbe_->
book2D(name,name,180,1,73,400,0,2);
346 name=
"HFP Average over RM LED Ref";
HFPphi =
dbe_->
book2D(name,name,180,1,37,400,0,2);
347 name=
"HFM Average over RM LED Ref";
HFMphi =
dbe_->
book2D(name,name,180,1,37,400,0,2);
348 name=
"HO0 Average over HPD LED Ref";
HO0phi =
dbe_->
book2D(name,name,180,1,49,400,0,2);
349 name=
"HO1P Average over HPD LED Ref";
HO1Pphi=
dbe_->
book2D(name,name,180,1,49,400,0,2);
350 name=
"HO2P Average over HPD LED Ref";
HO2Pphi=
dbe_->
book2D(name,name,180,1,49,400,0,2);
351 name=
"HO1M Average over HPD LED Ref";
HO1Mphi=
dbe_->
book2D(name,name,180,1,49,400,0,2);
352 name=
"HO2M Average over HPD LED Ref";
HO2Mphi=
dbe_->
book2D(name,name,180,1,49,400,0,2);
393 if(trigger_data->triggerWord()==6){ LEDEvent=
true;LocalRun=
true;}
395 if(!LocalRun)
return;
396 if(!LEDEvent)
return;
408 eta=digi->id().ieta(); phi=digi->id().iphi(); depth=digi->id().depth(); nTS=digi->size();
410 for(
int i=0;
i<nTS;
i++) data[
i]=
adc2fC[digi->sample(
i).adc()&0xff]-2.5;
414 for(
int i=0;
i<nTS;
i++) data[
i]=
adc2fC[digi->sample(
i).adc()&0xff]-2.5;
422 eta=digi->id().ieta(); phi=digi->id().iphi(); depth=digi->id().depth(); nTS=digi->size();
423 for(
int i=0;
i<nTS;
i++) data[
i]=
adc2fC[digi->sample(
i).adc()&0xff]-2.5;
430 eta=digi->id().ieta(); phi=digi->id().iphi(); depth=digi->id().depth(); nTS=digi->size();
431 for(
int i=0;
i<nTS;
i++) data[
i]=
adc2fC[digi->sample(
i).adc()&0xff]-2.5;
438 if(digi->id().cboxChannel()!=0 || digi->id().hcalSubdet()==0)
continue;
441 for(
int i=0;
i<nTS;
i++){ data[
i]=
adc2fC[digi->sample(
i).adc()&0xff]; e+=data[
i];}
445 if(((
ievt_)%500)==0){
482 double T=0,nT=0,E=0,nE=0;
483 for(
int depth=1;depth<=2;depth++){
495 T+=
time; nT++; E+=ave; nE++;
509 double T=0,nT=0,E=0,nE=0;
510 for(
int depth=1;depth<=3;depth++){
521 T+=
time; nT++; E+=ave; nE++;
537 double T=0,nT=0,E=0,nE=0;
538 for(
int depth=1;depth<=2;depth++){
549 T+=
time; nT++; E+=ave; nE++;
565 double T=0,nT=0,E=0,nE=0;
567 for(
int depth=4;depth<=4;depth++){
578 T+=
time; nT++; E+=ave; nE++;
592 double ave=0.,
rms=0.,ave_calib=0.,rms_calib=0.;
594 for(
int eta=-16;
eta<=16;
eta++)
for(
int phi=1;
phi<=72;
phi++)
for(
int depth=1;depth<=2;depth++){
600 for(
int eta=-29;
eta<=29;
eta++)
for(
int phi=1;
phi<=72;
phi++)
for(
int depth=1;depth<=3;depth++){
606 for(
int eta=-10;
eta<=15;
eta++)
for(
int phi=1;
phi<=72;
phi++)
for(
int depth=4;depth<=4;depth++){
613 for(
int eta=-42;
eta<=42;
eta++)
for(
int phi=1;
phi<=72;
phi++)
for(
int depth=1;depth<=2;depth++){
620 double hbp[18][4],nhbp[18][4],hbm[18][4],nhbm[18][4];
621 double hep[18][4],nhep[18][4],hem[18][4],nhem[18][4];
622 double hfp[18][4],nhfp[18][4],hfm[18][4],nhfm[18][4];
623 double ho0[18][4],nho0[18][4];
624 double ho1p[18][4],nho1p[18][4];
625 double ho2p[18][4],nho2p[18][4];
626 double ho1m[18][4],nho1m[18][4];
627 double ho2m[18][4],nho2m[18][4];
628 for(
int i=0;
i<18;
i++)
for(
int j=0;
j<4;
j++)
629 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;
630 for(
int i=0;
i<18;
i++)
for(
int j=0;
j<4;
j++)
631 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;
634 for(std::vector <HcalElectronicsId>::iterator eid = AllElIds.begin(); eid != AllElIds.end(); eid++){
638 if(!(!(gid.null()) &&
660 if(sd==0 || sd==1 || sd==3){
661 sscanf(&(lmap_entry.
rbx().c_str())[3],
"%d",&rbx);
663 if(
abs(
eta)<5) sscanf(&(lmap_entry.
rbx().c_str())[3],
"%d",&rbx);
664 if(
abs(
eta)>=5) sscanf(&(lmap_entry.
rbx().c_str())[4],
"%d",&rbx);
667 if(sd==0 &&
eta>0){ hbp[rbx-1][lmap_entry.
rm()-1]+=ave/ref; nhbp[rbx-1][lmap_entry.
rm()-1]++; }
668 if(sd==0 &&
eta<0){ hbm[rbx-1][lmap_entry.
rm()-1]+=ave/ref; nhbm[rbx-1][lmap_entry.
rm()-1]++; }
669 if(sd==1 &&
eta>0){ hep[rbx-1][lmap_entry.
rm()-1]+=ave/ref; nhep[rbx-1][lmap_entry.
rm()-1]++; }
670 if(sd==1 &&
eta<0){ hem[rbx-1][lmap_entry.
rm()-1]+=ave/ref; nhem[rbx-1][lmap_entry.
rm()-1]++; }
671 if(sd==3 &&
eta>0){ hfp[rbx-1][lmap_entry.
rm()-1]+=ave/ref; nhfp[rbx-1][lmap_entry.
rm()-1]++; }
672 if(sd==3 &&
eta<0){ hfm[rbx-1][lmap_entry.
rm()-1]+=ave/ref; nhfm[rbx-1][lmap_entry.
rm()-1]++; }
673 if(sd==2 &&
abs(
eta)<5){ ho0[rbx-1][lmap_entry.
rm()-1]+=ave/ref; nho0[rbx-1][lmap_entry.
rm()-1]++; }
674 if(sd==2 &&
eta>=5 &&
eta<=10){ ho1p[rbx-1][lmap_entry.
rm()-1]+=ave/ref; nho1p[rbx-1][lmap_entry.
rm()-1]++; }
675 if(sd==2 &&
eta>=11 &&
eta<=15){ ho2p[rbx-1][lmap_entry.
rm()-1]+=ave/ref; nho2p[rbx-1][lmap_entry.
rm()-1]++; }
676 if(sd==2 &&
eta>=-10 &&
eta<=-5){ ho1m[rbx-1][lmap_entry.
rm()-1]+=ave/ref; nho1m[rbx-1][lmap_entry.
rm()-1]++; }
677 if(sd==2 &&
eta>=-15 &&
eta<=-11){ ho2m[rbx-1][lmap_entry.
rm()-1]+=ave/ref; nho2m[rbx-1][lmap_entry.
rm()-1]++; }
680 for(
int i=0;
i<18;
i++)
for(
int j=0;
j<4;
j++){
687 for(
int i=0;
i<12;
i++)
for(
int j=0;
j<3;
j++){
692 for(
int i=0;
i<12;
i++)
for(
int j=0;
j<4;
j++){
705 char Subdet[10],str[500];
707 TFile *
theFile =
new TFile(str,
"RECREATE");
708 if(!theFile->IsOpen())
return;
710 sprintf(str,
"%d",
run_number); TObjString
run(str); run.Write(
"run number");
711 sprintf(str,
"%d",
ievt_); TObjString
events(str); events.Write(
"Total events processed");
713 TTree *
tree =
new TTree(
"HCAL LED data",
"HCAL LED data");
715 tree->Branch(
"Subdet", &Subdet,
"Subdet/C");
716 tree->Branch(
"eta", &Eta,
"Eta/I");
717 tree->Branch(
"phi", &Phi,
"Phi/I");
718 tree->Branch(
"depth", &Depth,
"Depth/I");
719 tree->Branch(
"statistic",&Statistic,
"Statistic/I");
720 tree->Branch(
"status", &Status,
"Status/I");
721 tree->Branch(
"led", &led,
"led/D");
722 tree->Branch(
"rms", &rms,
"rms/D");
723 tree->Branch(
"time", &Time,
"time/D");
724 tree->Branch(
"time_rms", &time_rms,
"time_rms/D");
725 sprintf(Subdet,
"HB");
726 for(
int eta=-16;
eta<=16;
eta++)
for(
int phi=1;
phi<=72;
phi++)
for(
int depth=1;depth<=2;depth++){
727 if((Statistic=
hb_data[
eta+42][
phi-1][depth-1].get_statistics())>100){
728 Eta=
eta; Phi=
phi; Depth=depth;
735 sprintf(Subdet,
"HE");
736 for(
int eta=-29;
eta<=29;
eta++)
for(
int phi=1;
phi<=72;
phi++)
for(
int depth=1;depth<=3;depth++){
737 if((Statistic=
he_data[
eta+42][
phi-1][depth-1].get_statistics())>100){
738 Eta=
eta; Phi=
phi; Depth=depth;
745 sprintf(Subdet,
"HO");
746 for(
int eta=-15;
eta<=15;
eta++)
for(
int phi=1;
phi<=72;
phi++)
for(
int depth=4;depth<=4;depth++){
747 if((Statistic=
ho_data[
eta+42][
phi-1][depth-1].get_statistics())>100){
748 Eta=
eta; Phi=
phi; Depth=depth;
755 sprintf(Subdet,
"HF");
756 for(
int eta=-42;
eta<=42;
eta++)
for(
int phi=1;
phi<=72;
phi++)
for(
int depth=1;depth<=2;depth++){
757 if((Statistic=
hf_data[
eta+42][
phi-1][depth-1].get_statistics())>100){
758 Eta=
eta; Phi=
phi; Depth=depth;
765 sprintf(Subdet,
"CALIB_HB");
768 Eta=
eta; Phi=
phi; Depth=0;
775 sprintf(Subdet,
"CALIB_HE");
778 Eta=
eta; Phi=
phi; Depth=0;
785 sprintf(Subdet,
"CALIB_HO");
788 Eta=
eta; Phi=
phi; Depth=0;
795 sprintf(Subdet,
"CALIB_HF");
798 Eta=
eta; Phi=
phi; Depth=0;
812 Long_t
t; t=
time(0); strftime(TIME,30,
"%F %T",localtime(&t));
817 xmlFile.open(xmlName.c_str());
819 xmlFile<<
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n";
821 xmlFile<<
" <HEADER>\n";
822 xmlFile<<
" <HINTS mode='only-det-root'/>\n";
823 xmlFile<<
" <TYPE>\n";
824 xmlFile<<
" <EXTENSION_TABLE_NAME>HCAL_DETMON_LED_LASER_V1</EXTENSION_TABLE_NAME>\n";
825 xmlFile<<
" <NAME>HCAL LED [local]</NAME>\n";
826 xmlFile<<
" </TYPE>\n";
827 xmlFile<<
" <!-- run details -->\n";
829 xmlFile<<
" <RUN_TYPE>LOCAL-RUN</RUN_TYPE>\n";
830 xmlFile<<
" <RUN_NUMBER>"<<
run_number<<
"</RUN_NUMBER>\n";
831 xmlFile<<
" <RUN_BEGIN_TIMESTAMP>2009-01-01 00:00:00</RUN_BEGIN_TIMESTAMP>\n";
832 xmlFile<<
" <COMMENT_DESCRIPTION>hcal LED data</COMMENT_DESCRIPTION>\n";
833 xmlFile<<
" <LOCATION>P5</LOCATION>\n";
834 xmlFile<<
" <INITIATED_BY_USER>dma</INITIATED_BY_USER>\n";
835 xmlFile<<
" </RUN>\n";
836 xmlFile<<
" </HEADER>\n";
837 xmlFile<<
" <DATA_SET>\n";
838 xmlFile<<
" <!-- optional dataset metadata -->\n\n";
840 xmlFile<<
" <SET_BEGIN_TIMESTAMP>2009-01-01 00:00:00</SET_BEGIN_TIMESTAMP>\n";
841 xmlFile<<
" <SET_END_TIMESTAMP>2009-01-01 00:00:00</SET_END_TIMESTAMP>\n";
842 xmlFile<<
" <NUMBER_OF_EVENTS_IN_SET>"<<
ievt_<<
"</NUMBER_OF_EVENTS_IN_SET>\n";
843 xmlFile<<
" <COMMENT_DESCRIPTION>Automatic DQM output</COMMENT_DESCRIPTION>\n";
844 xmlFile<<
" <DATA_FILE_NAME>"<< xmlName <<
"</DATA_FILE_NAME>\n";
845 xmlFile<<
" <IMAGE_FILE_NAME>data plot url or file path</IMAGE_FILE_NAME>\n";
846 xmlFile<<
" <!-- who and when created this dataset-->\n\n";
847 xmlFile<<
" <CREATE_TIMESTAMP>"<<TIME<<
"</CREATE_TIMESTAMP>\n";
848 xmlFile<<
" <CREATED_BY_USER>dma</CREATED_BY_USER>\n";
849 xmlFile<<
" <!-- version (string) and subversion (number) -->\n";
850 xmlFile<<
" <!-- fields are used to read data back from the database -->\n\n";
851 xmlFile<<
" <VERSION>"<<run_number<<dataset_seq_number<<
"</VERSION>\n";
852 xmlFile<<
" <SUBVERSION>1</SUBVERSION>\n";
853 xmlFile<<
" <!-- Assign predefined dataset attributes -->\n\n";
854 xmlFile<<
" <PREDEFINED_ATTRIBUTES>\n";
855 xmlFile<<
" <ATTRIBUTE>\n";
856 xmlFile<<
" <NAME>HCAL Dataset Status</NAME>\n";
857 xmlFile<<
" <VALUE>VALID</VALUE>\n";
858 xmlFile<<
" </ATTRIBUTE>\n";
859 xmlFile<<
" </PREDEFINED_ATTRIBUTES>\n";
860 xmlFile<<
" <!-- multiple data block records -->\n\n";
863 for(std::vector <HcalElectronicsId>::iterator eid = AllElIds.begin(); eid != AllElIds.end(); eid++){
867 if(!(!(gid.null()) &&
879 double e=0,e_rms=0,t=0,t_rms=0;
905 xmlFile<<
" <DATA>\n";
906 xmlFile<<
" <NUMBER_OF_EVENTS_USED>"<<Statistic<<
"</NUMBER_OF_EVENTS_USED>\n";
907 xmlFile<<
" <SIGNAL_MEAN>"<<e<<
"</SIGNAL_MEAN>\n";
908 xmlFile<<
" <SIGNAL_RMS>"<<e_rms<<
"</SIGNAL_RMS>\n";
909 xmlFile<<
" <TIME_MEAN>"<<t<<
"</TIME_MEAN>\n";
910 xmlFile<<
" <TIME_RMS>"<<t_rms<<
"</TIME_RMS>\n";
911 xmlFile<<
" <CHANNEL_STATUS_WORD>"<<Status<<
"</CHANNEL_STATUS_WORD>\n";
912 xmlFile<<
" <CHANNEL_OBJECTNAME>HcalDetId</CHANNEL_OBJECTNAME>\n";
913 xmlFile<<
" <SUBDET>"<<subdet<<
"</SUBDET>\n";
914 xmlFile<<
" <IETA>"<<eta<<
"</IETA>\n";
915 xmlFile<<
" <IPHI>"<<phi<<
"</IPHI>\n";
916 xmlFile<<
" <DEPTH>"<<depth<<
"</DEPTH>\n";
917 xmlFile<<
" <TYPE>0</TYPE>\n";
918 xmlFile<<
" </DATA>\n";
921 xmlFile<<
" </DATA_SET>\n";
922 xmlFile<<
"</ROOT>\n";
926 sprintf(str,
"HcalDetDiagLEDCalib_%i_%i.xml",run_number,dataset_seq_number);
928 ofstream xmlFileCalib;
929 xmlFileCalib.open(xmlNameCalib.c_str());
931 xmlFileCalib<<
"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n";
932 xmlFileCalib<<
"<ROOT>\n";
933 xmlFileCalib<<
" <HEADER>\n";
934 xmlFileCalib<<
" <HINTS mode='only-det-root'/>\n";
935 xmlFileCalib<<
" <TYPE>\n";
936 xmlFileCalib<<
" <EXTENSION_TABLE_NAME>HCAL_DETMON_LED_LASER_V1</EXTENSION_TABLE_NAME>\n";
937 xmlFileCalib<<
" <NAME>HCAL LED CALIB [local]</NAME>\n";
938 xmlFileCalib<<
" </TYPE>\n";
939 xmlFileCalib<<
" <!-- run details -->\n";
940 xmlFileCalib<<
" <RUN>\n";
941 xmlFileCalib<<
" <RUN_TYPE>LOCAL-RUN</RUN_TYPE>\n";
942 xmlFileCalib<<
" <RUN_NUMBER>"<<run_number<<
"</RUN_NUMBER>\n";
943 xmlFileCalib<<
" <RUN_BEGIN_TIMESTAMP>2009-01-01 00:00:00</RUN_BEGIN_TIMESTAMP>\n";
944 xmlFileCalib<<
" <COMMENT_DESCRIPTION>hcal LED CALIB data</COMMENT_DESCRIPTION>\n";
945 xmlFileCalib<<
" <LOCATION>P5</LOCATION>\n";
946 xmlFileCalib<<
" <INITIATED_BY_USER>dma</INITIATED_BY_USER>\n";
947 xmlFileCalib<<
" </RUN>\n";
948 xmlFileCalib<<
" </HEADER>\n";
949 xmlFileCalib<<
" <DATA_SET>\n";
950 xmlFileCalib<<
" <!-- optional dataset metadata -->\n\n";
951 xmlFileCalib<<
" <SET_NUMBER>"<<dataset_seq_number<<
"</SET_NUMBER>\n";
952 xmlFileCalib<<
" <SET_BEGIN_TIMESTAMP>2009-01-01 00:00:00</SET_BEGIN_TIMESTAMP>\n";
953 xmlFileCalib<<
" <SET_END_TIMESTAMP>2009-01-01 00:00:00</SET_END_TIMESTAMP>\n";
954 xmlFileCalib<<
" <NUMBER_OF_EVENTS_IN_SET>"<<ievt_<<
"</NUMBER_OF_EVENTS_IN_SET>\n";
955 xmlFileCalib<<
" <COMMENT_DESCRIPTION>Automatic DQM output</COMMENT_DESCRIPTION>\n";
956 xmlFileCalib<<
" <DATA_FILE_NAME>"<< xmlNameCalib <<
"</DATA_FILE_NAME>\n";
957 xmlFileCalib<<
" <IMAGE_FILE_NAME>data plot url or file path</IMAGE_FILE_NAME>\n";
958 xmlFileCalib<<
" <!-- who and when created this dataset-->\n\n";
959 xmlFileCalib<<
" <CREATE_TIMESTAMP>"<<TIME<<
"</CREATE_TIMESTAMP>\n";
960 xmlFileCalib<<
" <CREATED_BY_USER>dma</CREATED_BY_USER>\n";
961 xmlFileCalib<<
" <!-- version (string) and subversion (number) -->\n";
962 xmlFileCalib<<
" <!-- fields are used to read data back from the database -->\n\n";
963 xmlFileCalib<<
" <VERSION>"<<run_number<<dataset_seq_number<<
"</VERSION>\n";
964 xmlFileCalib<<
" <SUBVERSION>1</SUBVERSION>\n";
965 xmlFileCalib<<
" <!-- Assign predefined dataset attributes -->\n\n";
966 xmlFileCalib<<
" <PREDEFINED_ATTRIBUTES>\n";
967 xmlFileCalib<<
" <ATTRIBUTE>\n";
968 xmlFileCalib<<
" <NAME>HCAL Dataset Status</NAME>\n";
969 xmlFileCalib<<
" <VALUE>VALID</VALUE>\n";
970 xmlFileCalib<<
" </ATTRIBUTE>\n";
971 xmlFileCalib<<
" </PREDEFINED_ATTRIBUTES>\n";
972 xmlFileCalib<<
" <!-- multiple data block records -->\n\n";
976 if(
sd==1) subdet=
"HB";
977 if(
sd==2) subdet=
"HE";
978 if(
sd==3) subdet=
"HO";
979 if(
sd==4) subdet=
"HF";
981 double e=0,e_rms=0,t=0,t_rms=0;
986 xmlFileCalib<<
" <DATA>\n";
987 xmlFileCalib<<
" <NUMBER_OF_EVENTS_USED>"<<Statistic<<
"</NUMBER_OF_EVENTS_USED>\n";
988 xmlFileCalib<<
" <SIGNAL_MEAN>"<<e<<
"</SIGNAL_MEAN>\n";
989 xmlFileCalib<<
" <SIGNAL_RMS>"<<e_rms<<
"</SIGNAL_RMS>\n";
990 xmlFileCalib<<
" <TIME_MEAN>"<<t<<
"</TIME_MEAN>\n";
991 xmlFileCalib<<
" <TIME_RMS>"<<t_rms<<
"</TIME_RMS>\n";
992 xmlFileCalib<<
" <CHANNEL_STATUS_WORD>"<<Status<<
"</CHANNEL_STATUS_WORD>\n";
993 xmlFileCalib<<
" <CHANNEL_OBJECTNAME>HcalDetId</CHANNEL_OBJECTNAME>\n";
994 xmlFileCalib<<
" <SUBDET>"<<subdet<<
"</SUBDET>\n";
995 xmlFileCalib<<
" <IETA>"<<
eta<<
"</IETA>\n";
996 xmlFileCalib<<
" <IPHI>"<<
phi<<
"</IPHI>\n";
997 xmlFileCalib<<
" <DEPTH>"<<0<<
"</DEPTH>\n";
998 xmlFileCalib<<
" <TYPE>0</TYPE>\n";
999 xmlFileCalib<<
" </DATA>\n";
1003 xmlFileCalib<<
" </DATA_SET>\n";
1004 xmlFileCalib<<
"</ROOT>\n";
1005 xmlFileCalib.close();
1007 sprintf(str,
"zip %s.zip %s %s",xmlName.c_str(),xmlName.c_str(),xmlNameCalib.c_str());
1009 sprintf(str,
"rm -f %s %s",xmlName.c_str(),xmlNameCalib.c_str());
1011 sprintf(str,
"mv -f %s.zip %s",xmlName.c_str(),
XmlFilePath.c_str());
1026 if(!f->IsOpen())
return ;
1027 TObjString *STR=(TObjString *)f->Get(
"run number");
1029 TTree*
t=(TTree*)f->Get(
"HCAL LED data");
1031 t->SetBranchAddress(
"Subdet", subdet);
1032 t->SetBranchAddress(
"eta", &Eta);
1033 t->SetBranchAddress(
"phi", &Phi);
1034 t->SetBranchAddress(
"depth", &Depth);
1035 t->SetBranchAddress(
"led", &led);
1036 t->SetBranchAddress(
"rms", &rms);
1037 for(
int ievt=0;ievt<t->GetEntries();ievt++){
1053 for(
int i=0;
i<4;
i++){
1064 for (std::vector <HcalElectronicsId>::iterator eid = AllElIds.begin(); eid != AllElIds.end(); eid++) {
1068 if(!(!(gid.null()) &&
1089 if(stat>0 && stat!=(
ievt_)){
1093 if(
hb_data[eta+42][
phi-1][depth-1].get_statistics()>100){
1097 if((AVE_TIME-ave)>0.75 || (AVE_TIME-ave)<-0.75){
1115 if(stat>0 && stat!=(
ievt_)){
1119 if(
he_data[eta+42][
phi-1][depth-1].get_statistics()>100){
1123 if((AVE_TIME-ave)>0.75 || (AVE_TIME-ave)<-0.75){
1141 if(stat>0 && stat!=(
ievt_)){
1145 if(
ho_data[eta+42][
phi-1][depth-1].get_statistics()>100){
1149 if((AVE_TIME-ave)>0.75 || (AVE_TIME-ave)<-0.75){
1168 if(stat>0 && stat!=(
ievt_)){
1172 if(
hf_data[eta+42][
phi-1][depth-1].get_statistics()>100){
1176 if((AVE_TIME-ave)>0.75 || (AVE_TIME-ave)<-0.75){
1191 if (subdet.compare(
"HB")==0) subdetval=(
int)
HcalBarrel;
1192 else if (subdet.compare(
"HE")==0) subdetval=(
int)
HcalEndcap;
1193 else if (subdet.compare(
"HO")==0) subdetval=(
int)
HcalOuter;
1194 else if (subdet.compare(
"HF")==0) subdetval=(
int)
HcalForward;
1197 int ietabin=
CalcEtaBin(subdetval, eta, depth)+1;
1204 if (subdet.compare(
"HB")==0) subdetval=(
int)
HcalBarrel;
1205 else if (subdet.compare(
"HE")==0) subdetval=(
int)
HcalEndcap;
1206 else if (subdet.compare(
"HO")==0) subdetval=(
int)
HcalOuter;
1207 else if (subdet.compare(
"HF")==0) subdetval=(
int)
HcalForward;
1210 int ietabin=
CalcEtaBin(subdetval, eta, depth)+1;
1218 if (subdet.compare(
"HB")==0) subdetval=(
int)
HcalBarrel;
1219 else if (subdet.compare(
"HE")==0) subdetval=(
int)
HcalEndcap;
1220 else if (subdet.compare(
"HO")==0) subdetval=(
int)
HcalOuter;
1221 else if (subdet.compare(
"HF")==0) subdetval=(
int)
HcalForward;
1223 int ietabin=
CalcEtaBin(subdetval, eta, depth)+1;
EtaPhiHists * ChannelStatusMissingChannels
T getUntrackedParameter(std::string const &, T const &) const
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
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
void endRun(const edm::Run &run, const edm::EventSetup &c)
EtaPhiHists * ChannelStatusTimeMean
#define DEFINE_FWK_MODULE(type)
bool get_average_led(double *ave, double *rms)
std::vector< int > AllowedCalibTypes_
std::vector< T >::const_iterator const_iterator
void setup(DQMStore *&m_dbe, std::string Name, std::string Units="")
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]
edm::InputTag hcalTBTriggerDataTag_
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
virtual void beginRun(const edm::Run &run, const edm::EventSetup &c)
void removeContents(void)
erase all monitoring elements in current directory (not including subfolders);
edm::InputTag calibDigiLabel_
MonitorElement * EnergyCorr
MonitorElement * bookString(const char *name, const char *value)
Book string.
HcalDetDiagLEDData ho_data[85][72][4]
std::vector< DetId > getAllChannels() const
HcalLogicalMap * logicalMap_
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup)
int ieta() const
get the cell ieta
HcalElectronicsMap * emap
EtaPhiHists * ChannelStatusUnstableLEDsignal
MonitorElement * EnergyRMS
HcalDetDiagLEDMonitor(const edm::ParameterSet &ps)
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) ...
void beginRun(const edm::Run &run, const edm::EventSetup &c)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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
T const * product() const
MonitorElement * Time2Dho
bool xmlFile(const std::string fParam)
int CalcEtaBin(int subdet, int ieta, int depth)
HcalDetDiagLEDData calib_data[5][5][72]
void fill_energy(std::string subdet, int eta, int phi, int depth, double e, int type)
HcalDetDiagLEDData he_data[85][72][4]
char data[epos_bytes_allocation]
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)
MonitorElement * bookInt(const char *name)
Book int.
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Detector det() const
get the detector field from this detid
EtaPhiHists * ChannelsLEDEnergy
MonitorElement * Energy2Dhbhehf
void Reset(void)
reset ME (ie. contents, errors, etc)
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
void setCurrentFolder(const std::string &fullpath)
void set_reference(float val, float rms)