test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalDetDiagLEDMonitor.cc
Go to the documentation of this file.
2 // this is to retrieve HCAL digi's
4 // to retrive trigger information (local runs only)
6 // to retrive GMT information, for cosmic runs muon triggers can be used as pedestal (global runs only)
8 // to retrive trigger desition words, to select pedestal (from hcal point of view) triggers (global runs only)
10 
19 
20 #include "TFile.h"
21 #include "TTree.h"
22 #include "TSystem.h"
23 #include <math.h>
24 #include <iostream>
25 #include <fstream>
26 
27 
29 public:
31  IsRefetence=false;
32  status=0;
33  reset();
34  }
35  void reset(){
36  Xe=XXe=Xt=XXt=n=0;
37  overflow=0;
38  undeflow=0;
39  }
40  void add_statistics(double *data,int nTS){
41  double e=GetEnergy(data,nTS);
42  double t=GetTime(data,nTS);
43  if(e<20) undeflow++; else if(e>10000) overflow++; else{
44  n++; Xe+=e; XXe+=e*e; Xt+=t; XXt+=t*t;
45  }
46  }
47  void set_reference(float val,float rms){
48  ref_led=val; ref_rms=rms;
49  IsRefetence=true;
50  }
51  void change_status(int val){
52  status|=val;
53  }
54  int get_status(){
55  return status;
56  }
57  bool get_reference(double *val,double *rms){
58  *val=ref_led; *rms=ref_rms;
59  return IsRefetence;
60  }
61  bool get_average_led(double *ave,double *rms){
62  if(n>0){ *ave=Xe/n; *rms=sqrt(XXe/n-(Xe*Xe)/(n*n));} else return false;
63  return true;
64  }
65  bool get_average_time(double *ave,double *rms){
66  if(n>0){ *ave=Xt/n; *rms=sqrt(XXt/n-(Xt*Xt)/(n*n));} else return false;
67  return true;
68  }
70  return (int)n;
71  }
72  int get_overflow(){
73  return overflow;
74  }
75  int get_undeflow(){
76  return undeflow;
77  }
78 private:
79  double GetEnergy(double *data,int n){
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; }
82  Energy=data[MaxI];
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];
87  return Energy;
88  }
89  double GetTime(double *data,int n=10){
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; }
92  Time=MaxI*data[MaxI];
93  SumT=data[MaxI];
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]; }
96  Time=Time/SumT;
97  return Time;
98  }
99  int overflow;
100  int undeflow;
101  double Xe,XXe,Xt,XXt,n;
103  float ref_led;
104  float ref_rms;
105  int status;
106 };
107 
109 public:
112 
113  void bookHistograms(DQMStore::IBooker &ib, const edm::Run& run, const edm::EventSetup& c) override;
114  void setup(DQMStore::IBooker &ib) override;
115  void analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) override;// const HcalDbService& cond)
116  void endRun(const edm::Run& run, const edm::EventSetup& c) override;
117  void reset() override;
118  void fillHistos();
119  int GetStatistics(){ return ievt_; }
120 private:
122  void SaveReference();
123  void LoadReference();
124  void CheckStatus();
125 
127  int SD=0,ETA=0,PHI=0;
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;
132  if(SD==1 || SD==2){
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;
135  }else if(SD==3){
136  if(abs(eta)<=4){
137  ETA=0;
138  if(phi==71 ||phi==72 || phi==1 || phi==2 || phi==3 || phi==4) PHI=71; else PHI=((phi-5)/6)*6+5;
139  }else{
140  if(abs(eta)>4 && abs(eta)<=10) ETA=1;
141  if(abs(eta)>10 && abs(eta)<=15) ETA=2;
142  if(eta<0) ETA=-ETA;
143  if(phi==71 ||phi==72 || (phi>=1 && phi<=10)) PHI=71; else PHI=((phi-11)/12)*12+11;
144  }
145  }else if(SD==4){
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;
151  }
152  return &calib_data[SD][ETA+2][PHI-1];
153  };
154  int ievt_;
158 
161 
166 
193 
199 
209 
211 
217 
218  std::map<unsigned int, int> KnownBadCells_;
219 
220  void fill_channel_status(std::string subdet,int eta,int phi,int depth,int type,double status);
221  void fill_energy(std::string subdet,int eta,int phi,int depth,double e,int type);
222  double get_energy(std::string subdet,int eta,int phi,int depth,int type);
223 };
224 
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};
237 
238 
239 
240 
243  {
244 
245 
246  ievt_=0;
248  run_number=-1;
249  IsReference=false;
250 
251  Online_ = ps.getUntrackedParameter<bool>("online",false);
252  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns",false);
253  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup",false);
254  debug_ = ps.getUntrackedParameter<int>("debug",0);
255  prefixME_ = ps.getUntrackedParameter<std::string>("subSystemFolder","Hcal/");
256  if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!="/")
257  prefixME_.append("/");
258  subdir_ = ps.getUntrackedParameter<std::string>("TaskFolder","DetDiagLEDMonitor_Hcal");
259  if (subdir_.size()>0 && subdir_.substr(subdir_.size()-1,subdir_.size())!="/")
260  subdir_.append("/");
261  subdir_=prefixME_+subdir_;
262  AllowedCalibTypes_ = ps.getUntrackedParameter<std::vector<int> > ("AllowedCalibTypes");
263  skipOutOfOrderLS_ = ps.getUntrackedParameter<bool>("skipOutOfOrderLS",false);
264  NLumiBlocks_ = ps.getUntrackedParameter<int>("NLumiBlocks",4000);
265  makeDiagnostics_ = ps.getUntrackedParameter<bool>("makeDiagnostics",false);
266 
267  LEDMeanTreshold = ps.getUntrackedParameter<double>("LEDMeanTreshold" , 0.1);
268  LEDRmsTreshold = ps.getUntrackedParameter<double>("LEDRmsTreshold" , 0.1);
269 
270  ReferenceData = ps.getUntrackedParameter<std::string>("LEDReferenceData" ,"");
271  OutputFilePath = ps.getUntrackedParameter<std::string>("OutputFilePath", "");
272  XmlFilePath = ps.getUntrackedParameter<std::string>("XmlFilePath", "");
273 
274  digiLabel_ = ps.getUntrackedParameter<edm::InputTag>("digiLabel", edm::InputTag("hcalDigis"));
275 
276  emap=0;
277  needLogicalMap_ = true;
278 
279  // register for data access
280  tok_tb_ = consumes<HcalTBTriggerData>(ps.getParameter<edm::InputTag>("hcalTBTriggerDataTag"));
281  tok_hbhe_ = consumes<HBHEDigiCollection>(digiLabel_);
282  tok_ho_ = consumes<HODigiCollection>(digiLabel_);
283  tok_hf_ = consumes<HFDigiCollection>(digiLabel_);
284  tok_calib_ = consumes<HcalCalibDigiCollection>(ps.getUntrackedParameter<edm::InputTag>("calibDigiLabel",edm::InputTag("hcalDigis")));
285 
295 
296 }
297 
299 {
300 
301  if ( ChannelsLEDEnergy ) delete ChannelsLEDEnergy;
310 
311  if ( emap ) delete emap;
312 
313 }
314 
316 
318 {
319  if (debug_>1) std::cout <<"HcalDetDiagLEDMonitor::bookHistograms"<<std::endl;
321 
322  if (tevt_==0) this->setup(ib); // set up histograms if they have not been created before
323  if (mergeRuns_==false) this->reset();
324 
326  c.get<HcalChannelQualityRcd>().get("withTopo",p);
327  const HcalChannelQuality* chanquality= p.product();
328  std::vector<DetId> mydetids = chanquality->getAllChannels();
329  KnownBadCells_.clear();
330 
331  for (std::vector<DetId>::const_iterator i = mydetids.begin();i!=mydetids.end();++i){
332  if (i->det()!=DetId::Hcal) continue; // not an hcal cell
333  HcalDetId id=HcalDetId(*i);
334  int status=(chanquality->getValues(id))->getValue();
336  KnownBadCells_[id.rawId()]=status;
337  }
338  }
339 
340  return;
341 } // void HcalNDetDiagLEDMonitor::bookHistograms(...)
342 
344  // Call base class setup
346 
349  meEVT_ = ib.bookInt("HcalDetDiagLEDMonitor Event Number");
350  meRUN_ = ib.bookInt("HcalDetDiagLEDMonitor Run Number");
351  ReferenceRun="UNKNOWN";
352  LoadReference();
354  RefRun_= ib.bookString("HcalDetDiagLEDMonitor Reference Run",ReferenceRun);
355  ib.setCurrentFolder(subdir_+"Summary Plots");
356 
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);
366  name="LED Timing HBHEHF"; Time2Dhbhehf = ib.book2D(name,name,87,-43,43,74,0,73);
367  name="LED Timing HO"; Time2Dho = ib.book2D(name,name,33,-16,16,74,0,73);
368  name="LED Energy HBHEHF"; Energy2Dhbhehf = ib.book2D(name,name,87,-43,43,74,0,73);
369  name="LED Energy HO"; Energy2Dho = ib.book2D(name,name,33,-16,16,74,0,73);
370 
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);
382 
384  ChannelsLEDEnergy->setup(ib," Channel LED Energy");
386  ChannelsLEDEnergyRef->setup(ib," Channel LED Energy Reference");
387 
388  ib.setCurrentFolder(subdir_+"channel status");
390  ChannelStatusMissingChannels->setup(ib," Missing Channels");
392  ChannelStatusUnstableChannels->setup(ib," Unstable Channels");
394  ChannelStatusUnstableLEDsignal->setup(ib," Unstable LED");
396  ChannelStatusLEDMean->setup(ib," LED Mean");
398  ChannelStatusLEDRMS->setup(ib," LED RMS");
400  ChannelStatusTimeMean->setup(ib," Time Mean");
402  ChannelStatusTimeRMS->setup(ib," Time RMS");
403 
404 
405 }
406 
408 int eta,phi,depth,nTS;
410  if (emap==0) {
412  }
413 
414  bool LEDEvent=false;
415  bool LocalRun=false;
416  // for local runs
417 
418  edm::Handle<HcalTBTriggerData> trigger_data;
419  iEvent.getByToken(tok_tb_, trigger_data);
420  if(trigger_data.isValid()){
421  if(trigger_data->triggerWord()==6){ LEDEvent=true;LocalRun=true;}
422  }
423  if(!LocalRun) return;
424  if(!LEDEvent) return;
425 
426  HcalBaseDQMonitor::analyze(iEvent, iSetup);
427  meEVT_->Fill(++ievt_);
428  run_number=iEvent.id().run();
429  meRUN_->Fill(iEvent.id().run());
430 
431  double data[20];
432 
434  iEvent.getByToken(tok_hbhe_, hbhe);
435  if(hbhe.isValid()) for(HBHEDigiCollection::const_iterator digi=hbhe->begin();digi!=hbhe->end();digi++){
436  eta=digi->id().ieta(); phi=digi->id().iphi(); depth=digi->id().depth(); nTS=digi->size();
437  if(digi->id().subdet()==HcalBarrel){
438  for(int i=0;i<nTS;i++) data[i]=adc2fC[digi->sample(i).adc()&0xff]-2.5;
439  hb_data[eta+42][phi-1][depth-1].add_statistics(data,nTS);
440  }
441  if(digi->id().subdet()==HcalEndcap){
442  for(int i=0;i<nTS;i++) data[i]=adc2fC[digi->sample(i).adc()&0xff]-2.5;
443  he_data[eta+42][phi-1][depth-1].add_statistics(data,nTS);
444  }
445  }
446 
448  iEvent.getByToken(tok_ho_,ho);
449  if(ho.isValid()) for(HODigiCollection::const_iterator digi=ho->begin();digi!=ho->end();digi++){
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;
452  ho_data[eta+42][phi-1][depth-1].add_statistics(data,nTS);
453  }
454 
456  iEvent.getByToken(tok_hf_,hf);
457  if(hf.isValid()) for(HFDigiCollection::const_iterator digi=hf->begin();digi!=hf->end();digi++){
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;
460  hf_data[eta+42][phi-1][depth-1].add_statistics(data,nTS);
461  }
462 
464  iEvent.getByToken(tok_calib_, calib);
465  if(calib.isValid())for(HcalCalibDigiCollection::const_iterator digi=calib->begin();digi!=calib->end();digi++){
466  if(digi->id().cboxChannel()!=0 || digi->id().hcalSubdet()==0) continue;
467  nTS=digi->size();
468  double e=0;
469  for(int i=0;i<nTS;i++){ data[i]=adc2fC[digi->sample(i).adc()&0xff]; e+=data[i];}
470  if(e<15000) calib_data[digi->id().hcalSubdet()][digi->id().ieta()+2][digi->id().iphi()-1].add_statistics(data,nTS);
471  }
472 
473  if(((ievt_)%500)==0){
474  fillHistos();
475  CheckStatus();
476  }
477  return;
478 }
479 
480 
482  std::string subdet[4]={"HB","HE","HO","HF"};
483  Energy->Reset();
484  Time->Reset();
485  EnergyRMS->Reset();
486  TimeRMS->Reset();
487  EnergyHF->Reset();
488  TimeHF->Reset();
489  EnergyRMSHF->Reset();
490  TimeRMSHF->Reset();
491  EnergyCorr->Reset();
492  Time2Dhbhehf->Reset();
493  Time2Dho->Reset();
495  Energy2Dho->Reset();
496  HBPphi->Reset();
497  HBMphi->Reset();
498  HEPphi->Reset();
499  HEMphi->Reset();
500  HFPphi->Reset();
501  HFMphi->Reset();
502  HO0phi->Reset();
503  HO1Pphi->Reset();
504  HO2Pphi->Reset();
505  HO1Mphi->Reset();
506  HO2Mphi->Reset();
507 
508  // HB histograms
509  for(int eta=-16;eta<=16;eta++) for(int phi=1;phi<=72;phi++){
510  double T=0,nT=0,E=0,nE=0;
511  for(int depth=1;depth<=2;depth++){
512  if(hb_data[eta+42][phi-1][depth-1].get_statistics()>100){
513  double ave=0;
514  double rms=0;
515  double time=0;
516  double time_rms=0;
517  hb_data[eta+42][phi-1][depth-1].get_average_led(&ave,&rms);
518  hb_data[eta+42][phi-1][depth-1].get_average_time(&time,&time_rms);
519  Energy->Fill(ave);
520  if(ave>0)EnergyRMS->Fill(rms/ave);
521  Time->Fill(time);
522  TimeRMS->Fill(time_rms);
523  T+=time; nT++; E+=ave; nE++;
524  if(GetCalib("HB",eta,phi)->get_statistics()>100){
525  double ave_calib=0;
526  double rms_calib=0;
527  GetCalib("HB",eta,phi)->get_average_led(&ave_calib,&rms_calib);
528  fill_energy("HB",eta,phi,depth,ave/ave_calib,1);
529  EnergyCorr->Fill(ave_calib/ave);
530  }
531  }
532  }
533  if(nT>0){Time2Dhbhehf->Fill(eta,phi,T/nT);Energy2Dhbhehf->Fill(eta,phi,E/nE); }
534  }
535  // HE histograms
536  for(int eta=-29;eta<=29;eta++) for(int phi=1;phi<=72;phi++){
537  double T=0,nT=0,E=0,nE=0;
538  for(int depth=1;depth<=3;depth++){
539  if(he_data[eta+42][phi-1][depth-1].get_statistics()>100){
540  double ave=0;
541  double rms=0;
542  double time=0;
543  double time_rms=0;
544  he_data[eta+42][phi-1][depth-1].get_average_led(&ave,&rms);
545  he_data[eta+42][phi-1][depth-1].get_average_time(&time,&time_rms);
546  Energy->Fill(ave);
547  if(ave>0)EnergyRMS->Fill(rms/ave);
548  Time->Fill(time);
549  T+=time; nT++; E+=ave; nE++;
550  TimeRMS->Fill(time_rms);
551  if(GetCalib("HE",eta,phi)->get_statistics()>100){
552  double ave_calib=0;
553  double rms_calib=0;
554  GetCalib("HE",eta,phi)->get_average_led(&ave_calib,&rms_calib);
555  fill_energy("HE",eta,phi,depth,ave/ave_calib,1);
556  EnergyCorr->Fill(ave_calib/ave);
557  }
558  }
559  }
560  if(nT>0 && abs(eta)>16 ){Time2Dhbhehf->Fill(eta,phi,T/nT); Energy2Dhbhehf->Fill(eta,phi,E/nE); }
561  if(nT>0 && abs(eta)>20 ){Time2Dhbhehf->Fill(eta,phi+1,T/nT); Energy2Dhbhehf->Fill(eta,phi+1,E/nE);}
562  }
563  // HF histograms
564  for(int eta=-42;eta<=42;eta++) for(int phi=1;phi<=72;phi++){
565  double T=0,nT=0,E=0,nE=0;
566  for(int depth=1;depth<=2;depth++){
567  if(hf_data[eta+42][phi-1][depth-1].get_statistics()>100){
568  double ave=0;
569  double rms=0;
570  double time=0;
571  double time_rms=0;
572  hf_data[eta+42][phi-1][depth-1].get_average_led(&ave,&rms);
573  hf_data[eta+42][phi-1][depth-1].get_average_time(&time,&time_rms);
574  EnergyHF->Fill(ave);
575  if(ave>0)EnergyRMSHF->Fill(rms/ave);
576  TimeHF->Fill(time);
577  T+=time; nT++; E+=ave; nE++;
578  TimeRMSHF->Fill(time_rms);
579  if(GetCalib("HF",eta,phi)->get_statistics()>100){
580  double ave_calib=0;
581  double rms_calib=0;
582  GetCalib("HF",eta,phi)->get_average_led(&ave_calib,&rms_calib);
583  fill_energy("HF",eta,phi,depth,ave/ave_calib,1);
584  EnergyCorr->Fill(ave_calib/ave);
585  }
586  }
587  }
588  if(nT>0 && abs(eta)>29 ){ Time2Dhbhehf->Fill(eta,phi,T/nT); Time2Dhbhehf->Fill(eta,phi+1,T/nT);}
589  if(nT>0 && abs(eta)>29 ){ Energy2Dhbhehf->Fill(eta,phi,E/nE); Energy2Dhbhehf->Fill(eta,phi+1,E/nE);}
590  }
591  // HO histograms
592  for(int eta=-10;eta<=15;eta++) for(int phi=1;phi<=72;phi++){
593  double T=0,nT=0,E=0,nE=0;
594  if(eta>10 && !isSiPM(eta,phi,4)) continue;
595  for(int depth=4;depth<=4;depth++){
596  if(ho_data[eta+42][phi-1][depth-1].get_statistics()>100){
597  double ave=0;
598  double rms=0;
599  double time=0;
600  double time_rms=0;
601  ho_data[eta+42][phi-1][depth-1].get_average_led(&ave,&rms);
602  ho_data[eta+42][phi-1][depth-1].get_average_time(&time,&time_rms);
603  Energy->Fill(ave);
604  if(ave>0)EnergyRMS->Fill(rms/ave);
605  Time->Fill(time);
606  T+=time; nT++; E+=ave; nE++;
607  TimeRMS->Fill(time_rms);
608  if(GetCalib("HO",eta,phi)->get_statistics()>100){
609  double ave_calib=0;
610  double rms_calib=0;
611  GetCalib("HO",eta,phi)->get_average_led(&ave_calib,&rms_calib);
612  fill_energy("HO",eta,phi,depth,ave/ave_calib,1);
613  EnergyCorr->Fill(ave_calib/ave);
614  }
615  }
616  }
617  if(nT>0){ Time2Dho->Fill(eta,phi,T/nT); Energy2Dho->Fill(eta,phi+1,E/nE) ;}
618  }
619 
620  double ave=0.,rms=0.,ave_calib=0.,rms_calib=0.;
621  // HB Ref histograms
622  for(int eta=-16;eta<=16;eta++) for(int phi=1;phi<=72;phi++) for(int depth=1;depth<=2;depth++){
623  if(hb_data[eta+42][phi-1][depth-1].get_reference(&ave,&rms) && GetCalib("HB",eta,phi)->get_reference(&ave_calib,&rms_calib)){
624  fill_energy("HB",eta,phi,depth,ave/ave_calib,2);
625  }
626  }
627  // HE Ref histograms
628  for(int eta=-29;eta<=29;eta++) for(int phi=1;phi<=72;phi++) for(int depth=1;depth<=3;depth++){
629  if(he_data[eta+42][phi-1][depth-1].get_reference(&ave,&rms) && GetCalib("HE",eta,phi)->get_reference(&ave_calib,&rms_calib)){
630  fill_energy("HE",eta,phi,depth,ave/ave_calib,2);
631  }
632  }
633  // HO Ref histograms
634  for(int eta=-10;eta<=15;eta++) for(int phi=1;phi<=72;phi++) for(int depth=4;depth<=4;depth++){
635  if(eta>10 && !isSiPM(eta,phi,4)) continue;
636  if(ho_data[eta+42][phi-1][depth-1].get_reference(&ave,&rms) && GetCalib("HO",eta,phi)->get_reference(&ave_calib,&rms_calib)){
637  fill_energy("HO",eta,phi,depth,ave/ave_calib,2);
638  }
639  }
640  // HF Ref histograms
641  for(int eta=-42;eta<=42;eta++) for(int phi=1;phi<=72;phi++) for(int depth=1;depth<=2;depth++){
642  if(hf_data[eta+42][phi-1][depth-1].get_reference(&ave,&rms) && GetCalib("HF",eta,phi)->get_reference(&ave_calib,&rms_calib)){
643  fill_energy("HF",eta,phi,depth,ave/ave_calib,2);
644  }
645  }
646 
647  //fill RM histograms: this part is incomplete, will be modefied later
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;
660 
661  std::vector <HcalElectronicsId> AllElIds = emap->allElectronicsIdPrecision();
662  for(std::vector <HcalElectronicsId>::iterator eid = AllElIds.begin(); eid != AllElIds.end(); eid++){
663  DetId detid=emap->lookup(*eid);
664  if(detid.det()!=DetId::Hcal) continue;
665  HcalGenericDetId gid(emap->lookup(*eid));
666  if(!(!(gid.null()) &&
667  (gid.genericSubdet()==HcalGenericDetId::HcalGenBarrel ||
668  gid.genericSubdet()==HcalGenericDetId::HcalGenEndcap ||
669  gid.genericSubdet()==HcalGenericDetId::HcalGenForward ||
670  gid.genericSubdet()==HcalGenericDetId::HcalGenOuter))) continue;
671  int sd=0,eta=0,phi=0,depth=0;
672  if(gid.genericSubdet()==HcalGenericDetId::HcalGenBarrel) sd=0;
673  else if(gid.genericSubdet()==HcalGenericDetId::HcalGenEndcap) sd=1;
674  else if(gid.genericSubdet()==HcalGenericDetId::HcalGenOuter) sd=2;
675  else if(gid.genericSubdet()==HcalGenericDetId::HcalGenForward)sd=3;
676  HcalDetId hid(detid);
677  if(KnownBadCells_.find(hid.rawId())==KnownBadCells_.end()) continue;
678 
679  eta=hid.ieta();
680  phi=hid.iphi();
681  depth=hid.depth();
682 
683  double ave =get_energy(subdet[sd],eta,phi,depth,1);
684  double ref =get_energy(subdet[sd],eta,phi,depth,2);
685 
687  int rbx;
688  if(sd==0 || sd==1 || sd==3){
689  sscanf(&(lmap_entry.rbx().c_str())[3],"%d",&rbx);
690  }else{
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);
693  }
694  if(ave>0 && ref>0){
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]++; }
706  }
707  }
708  for(int i=0;i<18;i++)for(int j=0;j<4;j++){
709  int phi=i*4+j+1;
710  if(nhbp[i][j]>1) HBPphi->Fill(phi+0.5,hbp[i][j]/nhbp[i][j]);
711  if(nhbm[i][j]>1) HBMphi->Fill(phi+0.5,hbm[i][j]/nhbm[i][j]);
712  if(nhep[i][j]>1) HEPphi->Fill(phi+0.5,hep[i][j]/nhep[i][j]);
713  if(nhem[i][j]>1) HEMphi->Fill(phi+0.5,hem[i][j]/nhem[i][j]);
714  }
715  for(int i=0;i<12;i++)for(int j=0;j<3;j++){
716  int phi=i*3+j+1;
717  if(nhfp[i][j]>1) HFPphi->Fill(phi+0.5,hfp[i][j]/nhfp[i][j]);
718  if(nhfm[i][j]>1) HFMphi->Fill(phi+0.5,hfm[i][j]/nhfm[i][j]);
719  }
720  for(int i=0;i<12;i++)for(int j=0;j<4;j++){
721  int phi=i*4+j+1;
722  if(nho0[i][j]>1) HO0phi->Fill(phi+0.5,ho0[i][j]/nho0[i][j]);
723  if(nho1p[i][j]>1) HO1Pphi->Fill(phi+0.5,ho1p[i][j]/nho1p[i][j]);
724  if(nho2p[i][j]>1) HO2Pphi->Fill(phi+0.5,ho2p[i][j]/nho2p[i][j]);
725  if(nho1m[i][j]>1) HO1Mphi->Fill(phi+0.5,ho1m[i][j]/nho1m[i][j]);
726  if(nho2m[i][j]>1) HO2Mphi->Fill(phi+0.5,ho2m[i][j]/nho2m[i][j]);
727  }
728 }
729 
731 double led,rms,Time,time_rms;
732 int Eta,Phi,Depth,Statistic,Status=0;
733 char Subdet[10],str[500];
734  sprintf(str,"%sHcalDetDiagLEDData_run%06i_%i.root",OutputFilePath.c_str(),run_number,dataset_seq_number);
735  TFile *theFile = new TFile(str, "RECREATE");
736  if(!theFile->IsOpen()) return;
737  theFile->cd();
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");
740 
741  TTree *tree =new TTree("HCAL LED data","HCAL LED data");
742  if(tree==0) return;
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");
754  for(int eta=-16;eta<=16;eta++) for(int phi=1;phi<=72;phi++) for(int depth=1;depth<=2;depth++){
755  if((Statistic=hb_data[eta+42][phi-1][depth-1].get_statistics())>100){
756  Eta=eta; Phi=phi; Depth=depth;
757  Status=hb_data[eta+42][phi-1][depth-1].get_status();
758  hb_data[eta+42][phi-1][depth-1].get_average_led(&led,&rms);
759  hb_data[eta+42][phi-1][depth-1].get_average_time(&Time,&time_rms);
760  tree->Fill();
761  }
762  }
763  sprintf(Subdet,"HE");
764  for(int eta=-29;eta<=29;eta++) for(int phi=1;phi<=72;phi++) for(int depth=1;depth<=3;depth++){
765  if((Statistic=he_data[eta+42][phi-1][depth-1].get_statistics())>100){
766  Eta=eta; Phi=phi; Depth=depth;
767  Status=he_data[eta+42][phi-1][depth-1].get_status();
768  he_data[eta+42][phi-1][depth-1].get_average_led(&led,&rms);
769  he_data[eta+42][phi-1][depth-1].get_average_time(&Time,&time_rms);
770  tree->Fill();
771  }
772  }
773  sprintf(Subdet,"HO");
774  for(int eta=-15;eta<=15;eta++) for(int phi=1;phi<=72;phi++) for(int depth=4;depth<=4;depth++){
775  if((Statistic=ho_data[eta+42][phi-1][depth-1].get_statistics())>100){
776  Eta=eta; Phi=phi; Depth=depth;
777  Status=ho_data[eta+42][phi-1][depth-1].get_status();
778  ho_data[eta+42][phi-1][depth-1].get_average_led(&led,&rms);
779  ho_data[eta+42][phi-1][depth-1].get_average_time(&Time,&time_rms);
780  tree->Fill();
781  }
782  }
783  sprintf(Subdet,"HF");
784  for(int eta=-42;eta<=42;eta++) for(int phi=1;phi<=72;phi++) for(int depth=1;depth<=2;depth++){
785  if((Statistic=hf_data[eta+42][phi-1][depth-1].get_statistics())>100){
786  Eta=eta; Phi=phi; Depth=depth;
787  Status=hf_data[eta+42][phi-1][depth-1].get_status();
788  hf_data[eta+42][phi-1][depth-1].get_average_led(&led,&rms);
789  hf_data[eta+42][phi-1][depth-1].get_average_time(&Time,&time_rms);
790  tree->Fill();
791  }
792  }
793  sprintf(Subdet,"CALIB_HB");
794  for(int eta=-1;eta<=1;eta++) for(int phi=1;phi<=72;phi++){
795  if((calib_data[1][eta+2][phi-1].get_statistics())>100){
796  Eta=eta; Phi=phi; Depth=0;
797  Status=calib_data[1][eta+2][phi-1].get_status();
798  calib_data[1][eta+2][phi-1].get_average_led(&led,&rms);
799  calib_data[1][eta+2][phi-1].get_average_time(&Time,&time_rms);
800  tree->Fill();
801  }
802  }
803  sprintf(Subdet,"CALIB_HE");
804  for(int eta=-1;eta<=1;eta++) for(int phi=1;phi<=72;phi++){
805  if((calib_data[2][eta+2][phi-1].get_statistics())>100){
806  Eta=eta; Phi=phi; Depth=0;
807  Status=calib_data[2][eta+2][phi-1].get_status();
808  calib_data[2][eta+2][phi-1].get_average_led(&led,&rms);
809  calib_data[2][eta+2][phi-1].get_average_time(&Time,&time_rms);
810  tree->Fill();
811  }
812  }
813  sprintf(Subdet,"CALIB_HO");
814  for(int eta=-2;eta<=2;eta++) for(int phi=1;phi<=72;phi++){
815  if((calib_data[3][eta+2][phi-1].get_statistics())>100){
816  Eta=eta; Phi=phi; Depth=0;
817  Status=calib_data[3][eta+2][phi-1].get_status();
818  calib_data[3][eta+2][phi-1].get_average_led(&led,&rms);
819  calib_data[3][eta+2][phi-1].get_average_time(&Time,&time_rms);
820  tree->Fill();
821  }
822  }
823  sprintf(Subdet,"CALIB_HF");
824  for(int eta=-2;eta<=2;eta++) for(int phi=1;phi<=72;phi++){
825  if((calib_data[4][eta+2][phi-1].get_statistics())>100){
826  Eta=eta; Phi=phi; Depth=0;
827  Status=calib_data[4][eta+2][phi-1].get_status();
828  calib_data[4][eta+2][phi-1].get_average_led(&led,&rms);
829  calib_data[4][eta+2][phi-1].get_average_time(&Time,&time_rms);
830  tree->Fill();
831  }
832  }
833  theFile->Write();
834  theFile->Close();
835  theFile->Delete();
836 
837  if(XmlFilePath.size()>0){
838  //create XML file
839  char TIME[40];
840  Long_t t; t=time(0); strftime(TIME,30,"%F %T",localtime(&t));
841 
842  sprintf(str,"HcalDetDiagLED_%i_%i.xml",run_number,dataset_seq_number);
843  std::string xmlName=str;
844  std::ofstream xmlFile;
845  xmlFile.open(xmlName.c_str());
846 
847  xmlFile<<"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n";
848  xmlFile<<"<ROOT>\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";
856  xmlFile<<" <RUN>\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";
867  xmlFile<<" <SET_NUMBER>"<<dataset_seq_number<<"</SET_NUMBER>\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";
889 
890  std::vector <HcalElectronicsId> AllElIds = emap->allElectronicsIdPrecision();
891  for(std::vector <HcalElectronicsId>::iterator eid = AllElIds.begin(); eid != AllElIds.end(); eid++){
892  DetId detid=emap->lookup(*eid);
893  if (detid.det()!=DetId::Hcal) continue;
894  HcalGenericDetId gid(emap->lookup(*eid));
895  if(!(!(gid.null()) &&
896  (gid.genericSubdet()==HcalGenericDetId::HcalGenBarrel ||
897  gid.genericSubdet()==HcalGenericDetId::HcalGenEndcap ||
898  gid.genericSubdet()==HcalGenericDetId::HcalGenForward ||
899  gid.genericSubdet()==HcalGenericDetId::HcalGenOuter))) continue;
900  int eta,phi,depth;
901  std::string subdet="";
902  HcalDetId hid(detid);
903  eta=hid.ieta();
904  phi=hid.iphi();
905  depth=hid.depth();
906 
907  double e=0,e_rms=0,t=0,t_rms=0;
908  if(detid.subdetId()==HcalBarrel){
909  subdet="HB";
910  Statistic=hb_data[eta+42][phi-1][depth-1].get_statistics();
911  Status =hb_data[eta+42][phi-1][depth-1].get_status();
912  hb_data[eta+42][phi-1][depth-1].get_average_led(&e,&e_rms);
913  hb_data[eta+42][phi-1][depth-1].get_average_time(&t,&t_rms);
914  }else if(detid.subdetId()==HcalEndcap){
915  subdet="HE";
916  Statistic=he_data[eta+42][phi-1][depth-1].get_statistics();
917  Status =he_data[eta+42][phi-1][depth-1].get_status();
918  he_data[eta+42][phi-1][depth-1].get_average_led(&e,&e_rms);
919  he_data[eta+42][phi-1][depth-1].get_average_time(&t,&t_rms);
920  }else if(detid.subdetId()==HcalForward){
921  subdet="HF";
922  Statistic=hf_data[eta+42][phi-1][depth-1].get_statistics();
923  Status =hf_data[eta+42][phi-1][depth-1].get_status();
924  hf_data[eta+42][phi-1][depth-1].get_average_led(&e,&e_rms);
925  hf_data[eta+42][phi-1][depth-1].get_average_time(&t,&t_rms);
926  }else if(detid.subdetId()==HcalOuter){
927  subdet="HO";
928  Statistic=ho_data[eta+42][phi-1][depth-1].get_statistics();
929  Status =ho_data[eta+42][phi-1][depth-1].get_status();
930  ho_data[eta+42][phi-1][depth-1].get_average_led(&e,&e_rms);
931  ho_data[eta+42][phi-1][depth-1].get_average_time(&t,&t_rms);
932  }else continue;
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";
947  }
949  xmlFile<<" </DATA_SET>\n";
950  xmlFile<<"</ROOT>\n";
951  xmlFile.close();
952 
953  //create CALIB XML file
954  sprintf(str,"HcalDetDiagLEDCalib_%i_%i.xml",run_number,dataset_seq_number);
955  std::string xmlNameCalib=str;
956  std::ofstream xmlFileCalib;
957  xmlFileCalib.open(xmlNameCalib.c_str());
958 
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";
1001 
1002  for(int sd=1;sd<=4;sd++) for(int eta=-2;eta<=2;eta++) for(int phi=1;phi<=72;phi++){
1003  std::string subdet="";
1004  if(sd==1) subdet="HB";
1005  if(sd==2) subdet="HE";
1006  if(sd==3) subdet="HO";
1007  if(sd==4) subdet="HF";
1008  if((calib_data[sd][eta+2][phi-1].get_statistics())>100){
1009  double e=0,e_rms=0,t=0,t_rms=0;
1010  Status=calib_data[sd][eta+2][phi-1].get_status();
1011  Statistic=calib_data[sd][eta+2][phi-1].get_statistics();
1012  calib_data[sd][eta+2][phi-1].get_average_led(&e,&e_rms);
1013  calib_data[sd][eta+2][phi-1].get_average_time(&t,&t_rms);
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";
1028  }
1029  }
1031  xmlFileCalib<<" </DATA_SET>\n";
1032  xmlFileCalib<<"</ROOT>\n";
1033  xmlFileCalib.close();
1034 
1035  sprintf(str,"zip %s.zip %s %s",xmlName.c_str(),xmlName.c_str(),xmlNameCalib.c_str());
1036  system(str);
1037  sprintf(str,"rm -f %s %s",xmlName.c_str(),xmlNameCalib.c_str());
1038  system(str);
1039  sprintf(str,"mv -f %s.zip %s",xmlName.c_str(),XmlFilePath.c_str());
1040  system(str);
1041  }
1042 
1043 
1045 }
1046 
1048 double led,rms;
1049 int Eta,Phi,Depth;
1050 char subdet[10];
1051 TFile *f;
1052  if(gSystem->AccessPathName(ReferenceData.c_str())) return;
1053  f = new TFile(ReferenceData.c_str(),"READ");
1054  if(!f->IsOpen()) return ;
1055  TObjString *STR=(TObjString *)f->Get("run number");
1056  if(STR){ std::string Ref(STR->String()); ReferenceRun=Ref;}
1057  TTree* t=(TTree*)f->Get("HCAL LED data");
1058  if(!t) return;
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++){
1066 
1067  t->GetEntry(ievt);
1068  if(strcmp(subdet,"HB")==0) hb_data[Eta+42][Phi-1][Depth-1].set_reference(led,rms);
1069  if(strcmp(subdet,"HE")==0) he_data[Eta+42][Phi-1][Depth-1].set_reference(led,rms);
1070  if(strcmp(subdet,"HO")==0) ho_data[Eta+42][Phi-1][Depth-1].set_reference(led,rms);
1071  if(strcmp(subdet,"HF")==0) hf_data[Eta+42][Phi-1][Depth-1].set_reference(led,rms);
1072  if(strcmp(subdet,"CALIB_HB")==0) calib_data[1][Eta+2][Phi-1].set_reference(led,rms);
1073  if(strcmp(subdet,"CALIB_HE")==0) calib_data[2][Eta+2][Phi-1].set_reference(led,rms);
1074  if(strcmp(subdet,"CALIB_HO")==0) calib_data[3][Eta+2][Phi-1].set_reference(led,rms);
1075  if(strcmp(subdet,"CALIB_HF")==0) calib_data[4][Eta+2][Phi-1].set_reference(led,rms);
1076  }
1077  f->Close();
1078  f->Delete();
1079  IsReference=true;
1080 }
1082  for(int i=0;i<4;i++){
1086  ChannelStatusLEDMean->depth[i]->Reset();
1087  ChannelStatusLEDRMS->depth[i]->Reset();
1088  ChannelStatusTimeMean->depth[i]->Reset();
1089  ChannelStatusTimeRMS->depth[i]->Reset();
1090  }
1091 
1092  std::vector <HcalElectronicsId> AllElIds = emap->allElectronicsIdPrecision();
1093  for (std::vector <HcalElectronicsId>::iterator eid = AllElIds.begin(); eid != AllElIds.end(); eid++) {
1094  DetId detid=emap->lookup(*eid);
1095  if (detid.det()!=DetId::Hcal) continue;
1096  HcalGenericDetId gid(emap->lookup(*eid));
1097  if(!(!(gid.null()) &&
1098  (gid.genericSubdet()==HcalGenericDetId::HcalGenBarrel ||
1099  gid.genericSubdet()==HcalGenericDetId::HcalGenEndcap ||
1100  gid.genericSubdet()==HcalGenericDetId::HcalGenForward ||
1101  gid.genericSubdet()==HcalGenericDetId::HcalGenOuter))) continue;
1102  int eta=0,phi=0,depth=0;
1103  if(KnownBadCells_.find(gid.rawId())==KnownBadCells_.end()) continue;
1104 
1105  HcalDetId hid(detid);
1106  eta=hid.ieta();
1107  phi=hid.iphi();
1108  depth=hid.depth();
1109 
1110  double AVE_TIME=Time->getMean();
1111  if(detid.subdetId()==HcalBarrel){
1112  int stat=hb_data[eta+42][phi-1][depth-1].get_statistics()+
1113  hb_data[eta+42][phi-1][depth-1].get_overflow()+hb_data[eta+42][phi-1][depth-1].get_undeflow();
1114  if(stat==0){
1115  fill_channel_status("HB",eta,phi,depth,1,1);
1116  hb_data[eta+42][phi-1][depth-1].change_status(1);
1117  }
1118  if(stat>0 && stat!=(ievt_)){
1119  fill_channel_status("HB",eta,phi,depth,2,(double)stat/(double)(ievt_));
1120  hb_data[eta+42][phi-1][depth-1].change_status(2);
1121  }
1122  if(hb_data[eta+42][phi-1][depth-1].get_statistics()>100){
1123  double ave=0;
1124  double rms=0;
1125  hb_data[eta+42][phi-1][depth-1].get_average_time(&ave,&rms);
1126  if((AVE_TIME-ave)>0.75 || (AVE_TIME-ave)<-0.75){
1127  fill_channel_status("HB",eta,phi,depth,6,AVE_TIME-ave);
1128  hb_data[eta+42][phi-1][depth-1].change_status(8);
1129  }
1130  }
1131  stat=hb_data[eta+42][phi-1][depth-1].get_undeflow();
1132  if(stat>0){
1133  fill_channel_status("HB",eta,phi,depth,3,(double)stat/(double)(ievt_));
1134  hb_data[eta+42][phi-1][depth-1].change_status(4);
1135  }
1136  }
1137  if(detid.subdetId()==HcalEndcap){
1138  int stat=he_data[eta+42][phi-1][depth-1].get_statistics()+
1139  he_data[eta+42][phi-1][depth-1].get_overflow()+he_data[eta+42][phi-1][depth-1].get_undeflow();
1140  if(stat==0){
1141  fill_channel_status("HE",eta,phi,depth,1,1);
1142  he_data[eta+42][phi-1][depth-1].change_status(1);
1143  }
1144  if(stat>0 && stat!=(ievt_)){
1145  fill_channel_status("HE",eta,phi,depth,2,(double)stat/(double)(ievt_));
1146  he_data[eta+42][phi-1][depth-1].change_status(2);
1147  }
1148  if(he_data[eta+42][phi-1][depth-1].get_statistics()>100){
1149  double ave=0;
1150  double rms=0;
1151  he_data[eta+42][phi-1][depth-1].get_average_time(&ave,&rms);
1152  if((AVE_TIME-ave)>0.75 || (AVE_TIME-ave)<-0.75){
1153  fill_channel_status("HE",eta,phi,depth,6,AVE_TIME-ave);
1154  he_data[eta+42][phi-1][depth-1].change_status(8);
1155  }
1156  }
1157  stat=he_data[eta+42][phi-1][depth-1].get_undeflow();
1158  if(stat>0){
1159  fill_channel_status("HE",eta,phi,depth,3,(double)stat/(double)(ievt_));
1160  he_data[eta+42][phi-1][depth-1].change_status(4);
1161  }
1162  }
1163  if(detid.subdetId()==HcalOuter){
1164  int stat=ho_data[eta+42][phi-1][depth-1].get_statistics()+
1165  ho_data[eta+42][phi-1][depth-1].get_overflow()+ho_data[eta+42][phi-1][depth-1].get_undeflow();
1166  if(stat==0){
1167  fill_channel_status("HO",eta,phi,depth,1,1);
1168  ho_data[eta+42][phi-1][depth-1].change_status(1);
1169  }
1170  if(stat>0 && stat!=(ievt_)){
1171  fill_channel_status("HO",eta,phi,depth,2,(double)stat/(double)(ievt_));
1172  ho_data[eta+42][phi-1][depth-1].change_status(2);
1173  }
1174  if(ho_data[eta+42][phi-1][depth-1].get_statistics()>100){
1175  double ave=0;
1176  double rms=0;
1177  ho_data[eta+42][phi-1][depth-1].get_average_time(&ave,&rms);
1178  if((AVE_TIME-ave)>0.75 || (AVE_TIME-ave)<-0.75){
1179  fill_channel_status("HO",eta,phi,depth,6,AVE_TIME-ave);
1180  ho_data[eta+42][phi-1][depth-1].change_status(8);
1181  }
1182  }
1183  stat=ho_data[eta+42][phi-1][depth-1].get_undeflow();
1184  if(stat>0){
1185  fill_channel_status("HO",eta,phi,depth,3,(double)stat/(double)(ievt_));
1186  ho_data[eta+42][phi-1][depth-1].change_status(4);
1187  }
1188  }
1189  if(detid.subdetId()==HcalForward){
1190  AVE_TIME=TimeHF->getMean();
1191  int stat=hf_data[eta+42][phi-1][depth-1].get_statistics()+
1192  hf_data[eta+42][phi-1][depth-1].get_overflow()+hf_data[eta+42][phi-1][depth-1].get_undeflow();
1193  if(stat==0){
1194  fill_channel_status("HF",eta,phi,depth,1,1);
1195  hf_data[eta+42][phi-1][depth-1].change_status(1);
1196  }
1197  if(stat>0 && stat!=(ievt_)){
1198  fill_channel_status("HF",eta,phi,depth,2,(double)stat/(double)(ievt_));
1199  hf_data[eta+42][phi-1][depth-1].change_status(2);
1200  }
1201  if(hf_data[eta+42][phi-1][depth-1].get_statistics()>100){
1202  double ave=0;
1203  double rms=0;
1204  hf_data[eta+42][phi-1][depth-1].get_average_time(&ave,&rms);
1205  if((AVE_TIME-ave)>0.75 || (AVE_TIME-ave)<-0.75){
1206  fill_channel_status("HF",eta,phi,depth,6,AVE_TIME-ave);
1207  hf_data[eta+42][phi-1][depth-1].change_status(8);
1208  }
1209  }
1210  stat=hf_data[eta+42][phi-1][depth-1].get_undeflow();
1211  if(stat>0){
1212  fill_channel_status("HF",eta,phi,depth,3,(double)stat/(double)(ievt_));
1213  hf_data[eta+42][phi-1][depth-1].change_status(4);
1214  }
1215  }
1216  }
1217 }
1218 void HcalDetDiagLEDMonitor::fill_energy(std::string subdet,int eta,int phi,int depth,double e,int type){
1219  int subdetval=-1;
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;
1224  else return;
1225 
1226  int ietabin=CalcEtaBin(subdetval, eta, depth)+1;
1227  if(type==1) ChannelsLEDEnergy->depth[depth-1] ->setBinContent(ietabin,phi,e);
1228  else if(type==2) ChannelsLEDEnergyRef->depth[depth-1]->setBinContent(ietabin,phi,e);
1229 }
1230 
1232  int subdetval=-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;
1237  else return -1.0;
1238 
1239  int ietabin=CalcEtaBin(subdetval, eta, depth)+1;
1240  if(type==1) return ChannelsLEDEnergy->depth[depth-1] ->getBinContent(ietabin, phi);
1241  else if(type==2) return ChannelsLEDEnergyRef->depth[depth-1] ->getBinContent(ietabin,phi);
1242  return -1.0;
1243 }
1244 
1246  int subdetval=-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;
1251  else return;
1252  int ietabin=CalcEtaBin(subdetval, eta, depth)+1;
1253 
1254  if(type==1) ChannelStatusMissingChannels->depth[depth-1] ->setBinContent(ietabin,phi,status);
1255  if(type==2) ChannelStatusUnstableChannels->depth[depth-1] ->setBinContent(ietabin,phi,status);
1256  if(type==3) ChannelStatusUnstableLEDsignal->depth[depth-1]->setBinContent(ietabin,phi,status);
1257  if(type==4) ChannelStatusLEDMean->depth[depth-1] ->setBinContent(ietabin,phi,status);
1258  if(type==5) ChannelStatusLEDRMS->depth[depth-1] ->setBinContent(ietabin,phi,status);
1259  if(type==6) ChannelStatusTimeMean->depth[depth-1] ->setBinContent(ietabin,phi,status);
1260  if(type==7) ChannelStatusTimeRMS->depth[depth-1] ->setBinContent(ietabin,phi,status);
1261 }
1263  if(ievt_>=100){
1264  fillHistos();
1265  CheckStatus();
1266  SaveReference();
1267  }
1268 }
1270 
RunNumber_t run() const
Definition: EventID.h:39
EtaPhiHists * ChannelStatusMissingChannels
type
Definition: HCALResponse.h:21
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
edm::EDGetTokenT< HcalTBTriggerData > tok_tb_
int ib
Definition: cuy.py:660
std::vector< HcalElectronicsId > allElectronicsIdPrecision() const
HcalDetDiagLEDData hb_data[85][72][4]
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
void setup(DQMStore::IBooker &ib) override
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
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)
Definition: DQMStore.h:103
std::vector< HBHEDataFrame >::const_iterator const_iterator
MonitorElement * bookString(Args &&...args)
Definition: DQMStore.h:97
edm::EDGetTokenT< HcalCalibDigiCollection > tok_calib_
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)
double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
double GetTime(double *data, int n=10)
HcalDetDiagLEDData hf_data[85][72][4]
HcalDetDiagLEDData * GetCalib(std::string sd, int eta, int phi)
std::string rbx() const
bool get_reference(double *val, double *rms)
EtaPhiHists * ChannelStatusUnstableChannels
void Fill(long long x)
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
static const float SD[]
Definition: sicif.h:67
bool isSiPM(int ieta, int iphi, int depth)
int depth() const
get the tower depth
Definition: HcalDetId.cc:106
#define ETA
MVATrainerComputer * calib
Definition: MVATrainer.cc:64
int iEvent
Definition: GenABIO.cc:230
HcalElectronicsMap generateHcalElectronicsMap()
std::vector< MonitorElement * > depth
edm::EDGetTokenT< HFDigiCollection > tok_hf_
HcalDetDiagLEDData ho_data[85][72][4]
std::vector< DetId > getAllChannels() const
T sqrt(T t)
Definition: SSEVec.h:18
HcalLogicalMap * logicalMap_
int rm() const
int ieta() const
get the cell ieta
Definition: HcalDetId.h:56
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
HcalElectronicsMap * emap
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int j
Definition: DBlmapReader.cc:9
EtaPhiHists * ChannelStatusUnstableLEDsignal
HcalDetDiagLEDMonitor(const edm::ParameterSet &ps)
double f[11][100]
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)
bool isValid() const
Definition: HandleBase.h:75
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
bool get_average_time(double *ave, double *rms)
const HcalFrontEndId getHcalFrontEndId(const DetId &)
double const adc2fC[256]
Definition: Constants.h:221
int iphi() const
get the cell iphi
Definition: HcalDetId.cc:101
Definition: DetId.h:18
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:276
MonitorElement * book2D(Args &&...args)
Definition: DQMStore.h:133
double sd
const T & get() const
Definition: EventSetup.h:56
#define PHI
Statistic
T const * product() const
Definition: ESHandle.h:86
void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override
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]
edm::EventID id() const
Definition: EventBase.h:59
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
tuple events
Definition: patZpeak.py:19
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
tuple cout
Definition: gather_cfg.py:145
double get_energy(std::string subdet, int eta, int phi, int depth, int type)
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
long double T
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
Definition: Run.h:43
void set_reference(float val, float rms)
edm::EDGetTokenT< HODigiCollection > tok_ho_
tuple status
Definition: mps_update.py:57