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 beginRun(const edm::Run& run, const edm::EventSetup& c) override;
114  void setup() 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 cleanup() override;
119  void fillHistos();
120  int GetStatistics(){ return ievt_; }
121 private:
123  void SaveReference();
124  void LoadReference();
125  void CheckStatus();
126 
128  int SD=0,ETA=0,PHI=0;
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;
133  if(SD==1 || SD==2){
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;
136  }else if(SD==3){
137  if(abs(eta)<=4){
138  ETA=0;
139  if(phi==71 ||phi==72 || phi==1 || phi==2 || phi==3 || phi==4) PHI=71; else PHI=((phi-5)/6)*6+5;
140  }else{
141  if(abs(eta)>4 && abs(eta)<=10) ETA=1;
142  if(abs(eta)>10 && abs(eta)<=15) ETA=2;
143  if(eta<0) ETA=-ETA;
144  if(phi==71 ||phi==72 || (phi>=1 && phi<=10)) PHI=71; else PHI=((phi-11)/12)*12+11;
145  }
146  }else if(SD==4){
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;
152  }
153  return &calib_data[SD][ETA+2][PHI-1];
154  };
155  int ievt_;
159 
162 
167 
194 
200 
210 
212 
218 
219  std::map<unsigned int, int> KnownBadCells_;
220 
221  void fill_channel_status(std::string subdet,int eta,int phi,int depth,int type,double status);
222  void fill_energy(std::string subdet,int eta,int phi,int depth,double e,int type);
223  double get_energy(std::string subdet,int eta,int phi,int depth,int type);
224 };
225 
227 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,
228  13.5,15.,17.,19.,21.,23.,25.,27.,29.5,32.5,35.5,38.5,42.,46.,50.,54.5,59.5,
229  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,
230  124.5,129.5,137.,147.,157.,167.,177.,187.,197.,209.5,224.5,239.5,254.5,272.,
231  292.,312.,334.5,359.5,384.5,359.5,384.5,409.5,434.5,459.5,484.5,509.5,534.5,
232  559.5,584.5,609.5,634.5,659.5,684.5,709.5,747.,797.,847.,897.,947.,997.,
233  1047.,1109.5,1184.5,1259.5,1334.5,1422.,1522.,1622.,1734.5,1859.5,1984.5,
234  1859.5,1984.5,2109.5,2234.5,2359.5,2484.5,2609.5,2734.5,2859.5,2984.5,
235  3109.5,3234.5,3359.5,3484.5,3609.5,3797.,4047.,4297.,4547.,4797.,5047.,
236  5297.,5609.5,5984.5,6359.5,6734.5,7172.,7672.,8172.,8734.5,9359.5,9984.5};
238 
239 
240 
241 
243 
244 
245  ievt_=0;
247  run_number=-1;
248  IsReference=false;
249 
250  Online_ = ps.getUntrackedParameter<bool>("online",false);
251  mergeRuns_ = ps.getUntrackedParameter<bool>("mergeRuns",false);
252  enableCleanup_ = ps.getUntrackedParameter<bool>("enableCleanup",false);
253  debug_ = ps.getUntrackedParameter<int>("debug",0);
254  prefixME_ = ps.getUntrackedParameter<std::string>("subSystemFolder","Hcal/");
255  if (prefixME_.substr(prefixME_.size()-1,prefixME_.size())!="/")
256  prefixME_.append("/");
257  subdir_ = ps.getUntrackedParameter<std::string>("TaskFolder","DetDiagLEDMonitor_Hcal");
258  if (subdir_.size()>0 && subdir_.substr(subdir_.size()-1,subdir_.size())!="/")
259  subdir_.append("/");
260  subdir_=prefixME_+subdir_;
261  AllowedCalibTypes_ = ps.getUntrackedParameter<std::vector<int> > ("AllowedCalibTypes");
262  skipOutOfOrderLS_ = ps.getUntrackedParameter<bool>("skipOutOfOrderLS",false);
263  NLumiBlocks_ = ps.getUntrackedParameter<int>("NLumiBlocks",4000);
264  makeDiagnostics_ = ps.getUntrackedParameter<bool>("makeDiagnostics",false);
265 
266  LEDMeanTreshold = ps.getUntrackedParameter<double>("LEDMeanTreshold" , 0.1);
267  LEDRmsTreshold = ps.getUntrackedParameter<double>("LEDRmsTreshold" , 0.1);
268 
269  ReferenceData = ps.getUntrackedParameter<std::string>("LEDReferenceData" ,"");
270  OutputFilePath = ps.getUntrackedParameter<std::string>("OutputFilePath", "");
271  XmlFilePath = ps.getUntrackedParameter<std::string>("XmlFilePath", "");
272 
273  digiLabel_ = ps.getUntrackedParameter<edm::InputTag>("digiLabel", edm::InputTag("hcalDigis"));
274 
275  emap=0;
276  needLogicalMap_ = true;
277 
278  // register for data access
279  tok_tb_ = consumes<HcalTBTriggerData>(ps.getParameter<edm::InputTag>("hcalTBTriggerDataTag"));
280  tok_hbhe_ = consumes<HBHEDigiCollection>(digiLabel_);
281  tok_ho_ = consumes<HODigiCollection>(digiLabel_);
282  tok_hf_ = consumes<HFDigiCollection>(digiLabel_);
283  tok_calib_ = consumes<HcalCalibDigiCollection>(ps.getUntrackedParameter<edm::InputTag>("calibDigiLabel",edm::InputTag("hcalDigis")));
284 
285 
286 }
287 
289 
291  if(dbe_){
293  dbe_->removeContents();
294  dbe_ = 0;
295  }
296 }
298 
300 {
301  if (debug_>1) std::cout <<"HcalDetDiagLEDMonitor::beginRun"<<std::endl;
303 
304  if (tevt_==0) this->setup(); // set up histograms if they have not been created before
305  if (mergeRuns_==false) this->reset();
306 
308  c.get<HcalChannelQualityRcd>().get(p);
309  HcalChannelQuality* chanquality= new HcalChannelQuality(*p.product());
310  std::vector<DetId> mydetids = chanquality->getAllChannels();
311  KnownBadCells_.clear();
312 
313  for (std::vector<DetId>::const_iterator i = mydetids.begin();i!=mydetids.end();++i){
314  if (i->det()!=DetId::Hcal) continue; // not an hcal cell
315  HcalDetId id=HcalDetId(*i);
316  int status=(chanquality->getValues(id))->getValue();
318  KnownBadCells_[id.rawId()]=status;
319  }
320  }
321 
322  return;
323 } // void HcalNDetDiagLEDMonitor::beginRun(...)
324 
326  // Call base class setup
328  if (!dbe_) return;
329 
332  meEVT_ = dbe_->bookInt("HcalDetDiagLEDMonitor Event Number");
333  meRUN_ = dbe_->bookInt("HcalDetDiagLEDMonitor Run Number");
334  ReferenceRun="UNKNOWN";
335  LoadReference();
337  RefRun_= dbe_->bookString("HcalDetDiagLEDMonitor Reference Run",ReferenceRun);
338  dbe_->setCurrentFolder(subdir_+"Summary Plots");
339 
340  name="HBHEHO LED Energy Distribution"; Energy = dbe_->book1D(name,name,200,0,3000);
341  name="HBHEHO LED Timing Distribution"; Time = dbe_->book1D(name,name,200,0,10);
342  name="HBHEHO LED Energy RMS_div_Energy Distribution";EnergyRMS = dbe_->book1D(name,name,200,0,0.2);
343  name="HBHEHO LED Timing RMS Distribution"; TimeRMS = dbe_->book1D(name,name,200,0,0.4);
344  name="HF LED Energy Distribution"; EnergyHF = dbe_->book1D(name,name,200,0,3000);
345  name="HF LED Timing Distribution"; TimeHF = dbe_->book1D(name,name,200,0,10);
346  name="HF LED Energy RMS_div_Energy Distribution"; EnergyRMSHF = dbe_->book1D(name,name,200,0,0.5);
347  name="HF LED Timing RMS Distribution"; TimeRMSHF = dbe_->book1D(name,name,200,0,0.4);
348  name="LED Energy Corr(PinDiod) Distribution"; EnergyCorr = dbe_->book1D(name,name,200,0,10);
349  name="LED Timing HBHEHF"; Time2Dhbhehf = dbe_->book2D(name,name,87,-43,43,74,0,73);
350  name="LED Timing HO"; Time2Dho = dbe_->book2D(name,name,33,-16,16,74,0,73);
351  name="LED Energy HBHEHF"; Energy2Dhbhehf = dbe_->book2D(name,name,87,-43,43,74,0,73);
352  name="LED Energy HO"; Energy2Dho = dbe_->book2D(name,name,33,-16,16,74,0,73);
353 
354  name="HBP Average over HPD LED Ref"; HBPphi = dbe_->book2D(name,name,180,1,73,400,0,2);
355  name="HBM Average over HPD LED Ref"; HBMphi = dbe_->book2D(name,name,180,1,73,400,0,2);
356  name="HEP Average over HPD LED Ref"; HEPphi = dbe_->book2D(name,name,180,1,73,400,0,2);
357  name="HEM Average over HPD LED Ref"; HEMphi = dbe_->book2D(name,name,180,1,73,400,0,2);
358  name="HFP Average over RM LED Ref"; HFPphi = dbe_->book2D(name,name,180,1,37,400,0,2);
359  name="HFM Average over RM LED Ref"; HFMphi = dbe_->book2D(name,name,180,1,37,400,0,2);
360  name="HO0 Average over HPD LED Ref"; HO0phi = dbe_->book2D(name,name,180,1,49,400,0,2);
361  name="HO1P Average over HPD LED Ref"; HO1Pphi= dbe_->book2D(name,name,180,1,49,400,0,2);
362  name="HO2P Average over HPD LED Ref"; HO2Pphi= dbe_->book2D(name,name,180,1,49,400,0,2);
363  name="HO1M Average over HPD LED Ref"; HO1Mphi= dbe_->book2D(name,name,180,1,49,400,0,2);
364  name="HO2M Average over HPD LED Ref"; HO2Mphi= dbe_->book2D(name,name,180,1,49,400,0,2);
365 
367  ChannelsLEDEnergy->setup(dbe_," Channel LED Energy");
369  ChannelsLEDEnergyRef->setup(dbe_," Channel LED Energy Reference");
370 
371  dbe_->setCurrentFolder(subdir_+"channel status");
373  ChannelStatusMissingChannels->setup(dbe_," Missing Channels");
375  ChannelStatusUnstableChannels->setup(dbe_," Unstable Channels");
377  ChannelStatusUnstableLEDsignal->setup(dbe_," Unstable LED");
379  ChannelStatusLEDMean->setup(dbe_," LED Mean");
381  ChannelStatusLEDRMS->setup(dbe_," LED RMS");
383  ChannelStatusTimeMean->setup(dbe_," Time Mean");
385  ChannelStatusTimeRMS->setup(dbe_," Time RMS");
386 
387 
388 }
389 
391 int eta,phi,depth,nTS;
393  if (emap==0) {
395  }
396 
397  if(!dbe_) return;
398  bool LEDEvent=false;
399  bool LocalRun=false;
400  // for local runs
401 
402  edm::Handle<HcalTBTriggerData> trigger_data;
403  iEvent.getByToken(tok_tb_, trigger_data);
404  if(trigger_data.isValid()){
405  if(trigger_data->triggerWord()==6){ LEDEvent=true;LocalRun=true;}
406  }
407  if(!LocalRun) return;
408  if(!LEDEvent) return;
409 
410  HcalBaseDQMonitor::analyze(iEvent, iSetup);
411  meEVT_->Fill(++ievt_);
412  run_number=iEvent.id().run();
413  meRUN_->Fill(iEvent.id().run());
414 
415  double data[20];
416 
418  iEvent.getByToken(tok_hbhe_, hbhe);
419  if(hbhe.isValid()) for(HBHEDigiCollection::const_iterator digi=hbhe->begin();digi!=hbhe->end();digi++){
420  eta=digi->id().ieta(); phi=digi->id().iphi(); depth=digi->id().depth(); nTS=digi->size();
421  if(digi->id().subdet()==HcalBarrel){
422  for(int i=0;i<nTS;i++) data[i]=adc2fC[digi->sample(i).adc()&0xff]-2.5;
423  hb_data[eta+42][phi-1][depth-1].add_statistics(data,nTS);
424  }
425  if(digi->id().subdet()==HcalEndcap){
426  for(int i=0;i<nTS;i++) data[i]=adc2fC[digi->sample(i).adc()&0xff]-2.5;
427  he_data[eta+42][phi-1][depth-1].add_statistics(data,nTS);
428  }
429  }
430 
432  iEvent.getByToken(tok_ho_,ho);
433  if(ho.isValid()) for(HODigiCollection::const_iterator digi=ho->begin();digi!=ho->end();digi++){
434  eta=digi->id().ieta(); phi=digi->id().iphi(); depth=digi->id().depth(); nTS=digi->size();
435  for(int i=0;i<nTS;i++) data[i]=adc2fC[digi->sample(i).adc()&0xff]-2.5;
436  ho_data[eta+42][phi-1][depth-1].add_statistics(data,nTS);
437  }
438 
440  iEvent.getByToken(tok_hf_,hf);
441  if(hf.isValid()) for(HFDigiCollection::const_iterator digi=hf->begin();digi!=hf->end();digi++){
442  eta=digi->id().ieta(); phi=digi->id().iphi(); depth=digi->id().depth(); nTS=digi->size();
443  for(int i=0;i<nTS;i++) data[i]=adc2fC[digi->sample(i).adc()&0xff]-2.5;
444  hf_data[eta+42][phi-1][depth-1].add_statistics(data,nTS);
445  }
446 
448  iEvent.getByToken(tok_calib_, calib);
449  if(calib.isValid())for(HcalCalibDigiCollection::const_iterator digi=calib->begin();digi!=calib->end();digi++){
450  if(digi->id().cboxChannel()!=0 || digi->id().hcalSubdet()==0) continue;
451  nTS=digi->size();
452  double e=0;
453  for(int i=0;i<nTS;i++){ data[i]=adc2fC[digi->sample(i).adc()&0xff]; e+=data[i];}
454  if(e<15000) calib_data[digi->id().hcalSubdet()][digi->id().ieta()+2][digi->id().iphi()-1].add_statistics(data,nTS);
455  }
456 
457  if(((ievt_)%500)==0){
458  fillHistos();
459  CheckStatus();
460  }
461  return;
462 }
463 
464 
466  std::string subdet[4]={"HB","HE","HO","HF"};
467  Energy->Reset();
468  Time->Reset();
469  EnergyRMS->Reset();
470  TimeRMS->Reset();
471  EnergyHF->Reset();
472  TimeHF->Reset();
473  EnergyRMSHF->Reset();
474  TimeRMSHF->Reset();
475  EnergyCorr->Reset();
476  Time2Dhbhehf->Reset();
477  Time2Dho->Reset();
479  Energy2Dho->Reset();
480  HBPphi->Reset();
481  HBMphi->Reset();
482  HEPphi->Reset();
483  HEMphi->Reset();
484  HFPphi->Reset();
485  HFMphi->Reset();
486  HO0phi->Reset();
487  HO1Pphi->Reset();
488  HO2Pphi->Reset();
489  HO1Mphi->Reset();
490  HO2Mphi->Reset();
491 
492  // HB histograms
493  for(int eta=-16;eta<=16;eta++) for(int phi=1;phi<=72;phi++){
494  double T=0,nT=0,E=0,nE=0;
495  for(int depth=1;depth<=2;depth++){
496  if(hb_data[eta+42][phi-1][depth-1].get_statistics()>100){
497  double ave=0;
498  double rms=0;
499  double time=0;
500  double time_rms=0;
501  hb_data[eta+42][phi-1][depth-1].get_average_led(&ave,&rms);
502  hb_data[eta+42][phi-1][depth-1].get_average_time(&time,&time_rms);
503  Energy->Fill(ave);
504  if(ave>0)EnergyRMS->Fill(rms/ave);
505  Time->Fill(time);
506  TimeRMS->Fill(time_rms);
507  T+=time; nT++; E+=ave; nE++;
508  if(GetCalib("HB",eta,phi)->get_statistics()>100){
509  double ave_calib=0;
510  double rms_calib=0;
511  GetCalib("HB",eta,phi)->get_average_led(&ave_calib,&rms_calib);
512  fill_energy("HB",eta,phi,depth,ave/ave_calib,1);
513  EnergyCorr->Fill(ave_calib/ave);
514  }
515  }
516  }
517  if(nT>0){Time2Dhbhehf->Fill(eta,phi,T/nT);Energy2Dhbhehf->Fill(eta,phi,E/nE); }
518  }
519  // HE histograms
520  for(int eta=-29;eta<=29;eta++) for(int phi=1;phi<=72;phi++){
521  double T=0,nT=0,E=0,nE=0;
522  for(int depth=1;depth<=3;depth++){
523  if(he_data[eta+42][phi-1][depth-1].get_statistics()>100){
524  double ave=0;
525  double rms=0;
526  double time=0;
527  double time_rms=0;
528  he_data[eta+42][phi-1][depth-1].get_average_led(&ave,&rms);
529  he_data[eta+42][phi-1][depth-1].get_average_time(&time,&time_rms);
530  Energy->Fill(ave);
531  if(ave>0)EnergyRMS->Fill(rms/ave);
532  Time->Fill(time);
533  T+=time; nT++; E+=ave; nE++;
534  TimeRMS->Fill(time_rms);
535  if(GetCalib("HE",eta,phi)->get_statistics()>100){
536  double ave_calib=0;
537  double rms_calib=0;
538  GetCalib("HE",eta,phi)->get_average_led(&ave_calib,&rms_calib);
539  fill_energy("HE",eta,phi,depth,ave/ave_calib,1);
540  EnergyCorr->Fill(ave_calib/ave);
541  }
542  }
543  }
544  if(nT>0 && abs(eta)>16 ){Time2Dhbhehf->Fill(eta,phi,T/nT); Energy2Dhbhehf->Fill(eta,phi,E/nE); }
545  if(nT>0 && abs(eta)>20 ){Time2Dhbhehf->Fill(eta,phi+1,T/nT); Energy2Dhbhehf->Fill(eta,phi+1,E/nE);}
546  }
547  // HF histograms
548  for(int eta=-42;eta<=42;eta++) for(int phi=1;phi<=72;phi++){
549  double T=0,nT=0,E=0,nE=0;
550  for(int depth=1;depth<=2;depth++){
551  if(hf_data[eta+42][phi-1][depth-1].get_statistics()>100){
552  double ave=0;
553  double rms=0;
554  double time=0;
555  double time_rms=0;
556  hf_data[eta+42][phi-1][depth-1].get_average_led(&ave,&rms);
557  hf_data[eta+42][phi-1][depth-1].get_average_time(&time,&time_rms);
558  EnergyHF->Fill(ave);
559  if(ave>0)EnergyRMSHF->Fill(rms/ave);
560  TimeHF->Fill(time);
561  T+=time; nT++; E+=ave; nE++;
562  TimeRMSHF->Fill(time_rms);
563  if(GetCalib("HF",eta,phi)->get_statistics()>100){
564  double ave_calib=0;
565  double rms_calib=0;
566  GetCalib("HF",eta,phi)->get_average_led(&ave_calib,&rms_calib);
567  fill_energy("HF",eta,phi,depth,ave/ave_calib,1);
568  EnergyCorr->Fill(ave_calib/ave);
569  }
570  }
571  }
572  if(nT>0 && abs(eta)>29 ){ Time2Dhbhehf->Fill(eta,phi,T/nT); Time2Dhbhehf->Fill(eta,phi+1,T/nT);}
573  if(nT>0 && abs(eta)>29 ){ Energy2Dhbhehf->Fill(eta,phi,E/nE); Energy2Dhbhehf->Fill(eta,phi+1,E/nE);}
574  }
575  // HO histograms
576  for(int eta=-10;eta<=15;eta++) for(int phi=1;phi<=72;phi++){
577  double T=0,nT=0,E=0,nE=0;
578  if(eta>10 && !isSiPM(eta,phi,4)) continue;
579  for(int depth=4;depth<=4;depth++){
580  if(ho_data[eta+42][phi-1][depth-1].get_statistics()>100){
581  double ave=0;
582  double rms=0;
583  double time=0;
584  double time_rms=0;
585  ho_data[eta+42][phi-1][depth-1].get_average_led(&ave,&rms);
586  ho_data[eta+42][phi-1][depth-1].get_average_time(&time,&time_rms);
587  Energy->Fill(ave);
588  if(ave>0)EnergyRMS->Fill(rms/ave);
589  Time->Fill(time);
590  T+=time; nT++; E+=ave; nE++;
591  TimeRMS->Fill(time_rms);
592  if(GetCalib("HO",eta,phi)->get_statistics()>100){
593  double ave_calib=0;
594  double rms_calib=0;
595  GetCalib("HO",eta,phi)->get_average_led(&ave_calib,&rms_calib);
596  fill_energy("HO",eta,phi,depth,ave/ave_calib,1);
597  EnergyCorr->Fill(ave_calib/ave);
598  }
599  }
600  }
601  if(nT>0){ Time2Dho->Fill(eta,phi,T/nT); Energy2Dho->Fill(eta,phi+1,E/nE) ;}
602  }
603 
604  double ave=0.,rms=0.,ave_calib=0.,rms_calib=0.;
605  // HB Ref histograms
606  for(int eta=-16;eta<=16;eta++) for(int phi=1;phi<=72;phi++) for(int depth=1;depth<=2;depth++){
607  if(hb_data[eta+42][phi-1][depth-1].get_reference(&ave,&rms) && GetCalib("HB",eta,phi)->get_reference(&ave_calib,&rms_calib)){
608  fill_energy("HB",eta,phi,depth,ave/ave_calib,2);
609  }
610  }
611  // HE Ref histograms
612  for(int eta=-29;eta<=29;eta++) for(int phi=1;phi<=72;phi++) for(int depth=1;depth<=3;depth++){
613  if(he_data[eta+42][phi-1][depth-1].get_reference(&ave,&rms) && GetCalib("HE",eta,phi)->get_reference(&ave_calib,&rms_calib)){
614  fill_energy("HE",eta,phi,depth,ave/ave_calib,2);
615  }
616  }
617  // HO Ref histograms
618  for(int eta=-10;eta<=15;eta++) for(int phi=1;phi<=72;phi++) for(int depth=4;depth<=4;depth++){
619  if(eta>10 && !isSiPM(eta,phi,4)) continue;
620  if(ho_data[eta+42][phi-1][depth-1].get_reference(&ave,&rms) && GetCalib("HO",eta,phi)->get_reference(&ave_calib,&rms_calib)){
621  fill_energy("HO",eta,phi,depth,ave/ave_calib,2);
622  }
623  }
624  // HF Ref histograms
625  for(int eta=-42;eta<=42;eta++) for(int phi=1;phi<=72;phi++) for(int depth=1;depth<=2;depth++){
626  if(hf_data[eta+42][phi-1][depth-1].get_reference(&ave,&rms) && GetCalib("HF",eta,phi)->get_reference(&ave_calib,&rms_calib)){
627  fill_energy("HF",eta,phi,depth,ave/ave_calib,2);
628  }
629  }
630 
631  //fill RM histograms: this part is incomplete, will be modefied later
632  double hbp[18][4],nhbp[18][4],hbm[18][4],nhbm[18][4];
633  double hep[18][4],nhep[18][4],hem[18][4],nhem[18][4];
634  double hfp[18][4],nhfp[18][4],hfm[18][4],nhfm[18][4];
635  double ho0[18][4],nho0[18][4];
636  double ho1p[18][4],nho1p[18][4];
637  double ho2p[18][4],nho2p[18][4];
638  double ho1m[18][4],nho1m[18][4];
639  double ho2m[18][4],nho2m[18][4];
640  for(int i=0;i<18;i++) for(int j=0;j<4;j++)
641  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;
642  for(int i=0;i<18;i++) for(int j=0;j<4;j++)
643  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;
644 
645  std::vector <HcalElectronicsId> AllElIds = emap->allElectronicsIdPrecision();
646  for(std::vector <HcalElectronicsId>::iterator eid = AllElIds.begin(); eid != AllElIds.end(); eid++){
647  DetId detid=emap->lookup(*eid);
648  if(detid.det()!=DetId::Hcal) continue;
649  HcalGenericDetId gid(emap->lookup(*eid));
650  if(!(!(gid.null()) &&
651  (gid.genericSubdet()==HcalGenericDetId::HcalGenBarrel ||
652  gid.genericSubdet()==HcalGenericDetId::HcalGenEndcap ||
653  gid.genericSubdet()==HcalGenericDetId::HcalGenForward ||
654  gid.genericSubdet()==HcalGenericDetId::HcalGenOuter))) continue;
655  int sd=0,eta=0,phi=0,depth=0;
656  if(gid.genericSubdet()==HcalGenericDetId::HcalGenBarrel) sd=0;
657  else if(gid.genericSubdet()==HcalGenericDetId::HcalGenEndcap) sd=1;
658  else if(gid.genericSubdet()==HcalGenericDetId::HcalGenOuter) sd=2;
659  else if(gid.genericSubdet()==HcalGenericDetId::HcalGenForward)sd=3;
660  HcalDetId hid(detid);
661  if(KnownBadCells_.find(hid.rawId())==KnownBadCells_.end()) continue;
662 
663  eta=hid.ieta();
664  phi=hid.iphi();
665  depth=hid.depth();
666 
667  double ave =get_energy(subdet[sd],eta,phi,depth,1);
668  double ref =get_energy(subdet[sd],eta,phi,depth,2);
669 
671  int rbx;
672  if(sd==0 || sd==1 || sd==3){
673  sscanf(&(lmap_entry.rbx().c_str())[3],"%d",&rbx);
674  }else{
675  if(abs(eta)<5) sscanf(&(lmap_entry.rbx().c_str())[3],"%d",&rbx);
676  if(abs(eta)>=5) sscanf(&(lmap_entry.rbx().c_str())[4],"%d",&rbx);
677  }
678  if(ave>0 && ref>0){
679  if(sd==0 && eta>0){ hbp[rbx-1][lmap_entry.rm()-1]+=ave/ref; nhbp[rbx-1][lmap_entry.rm()-1]++; }
680  if(sd==0 && eta<0){ hbm[rbx-1][lmap_entry.rm()-1]+=ave/ref; nhbm[rbx-1][lmap_entry.rm()-1]++; }
681  if(sd==1 && eta>0){ hep[rbx-1][lmap_entry.rm()-1]+=ave/ref; nhep[rbx-1][lmap_entry.rm()-1]++; }
682  if(sd==1 && eta<0){ hem[rbx-1][lmap_entry.rm()-1]+=ave/ref; nhem[rbx-1][lmap_entry.rm()-1]++; }
683  if(sd==3 && eta>0){ hfp[rbx-1][lmap_entry.rm()-1]+=ave/ref; nhfp[rbx-1][lmap_entry.rm()-1]++; }
684  if(sd==3 && eta<0){ hfm[rbx-1][lmap_entry.rm()-1]+=ave/ref; nhfm[rbx-1][lmap_entry.rm()-1]++; }
685  if(sd==2 && abs(eta)<5){ ho0[rbx-1][lmap_entry.rm()-1]+=ave/ref; nho0[rbx-1][lmap_entry.rm()-1]++; }
686  if(sd==2 && eta>=5 && eta<=10){ ho1p[rbx-1][lmap_entry.rm()-1]+=ave/ref; nho1p[rbx-1][lmap_entry.rm()-1]++; }
687  if(sd==2 && eta>=11 && eta<=15){ ho2p[rbx-1][lmap_entry.rm()-1]+=ave/ref; nho2p[rbx-1][lmap_entry.rm()-1]++; }
688  if(sd==2 && eta>=-10 && eta<=-5){ ho1m[rbx-1][lmap_entry.rm()-1]+=ave/ref; nho1m[rbx-1][lmap_entry.rm()-1]++; }
689  if(sd==2 && eta>=-15 && eta<=-11){ ho2m[rbx-1][lmap_entry.rm()-1]+=ave/ref; nho2m[rbx-1][lmap_entry.rm()-1]++; }
690  }
691  }
692  for(int i=0;i<18;i++)for(int j=0;j<4;j++){
693  int phi=i*4+j+1;
694  if(nhbp[i][j]>1) HBPphi->Fill(phi+0.5,hbp[i][j]/nhbp[i][j]);
695  if(nhbm[i][j]>1) HBMphi->Fill(phi+0.5,hbm[i][j]/nhbm[i][j]);
696  if(nhep[i][j]>1) HEPphi->Fill(phi+0.5,hep[i][j]/nhep[i][j]);
697  if(nhem[i][j]>1) HEMphi->Fill(phi+0.5,hem[i][j]/nhem[i][j]);
698  }
699  for(int i=0;i<12;i++)for(int j=0;j<3;j++){
700  int phi=i*3+j+1;
701  if(nhfp[i][j]>1) HFPphi->Fill(phi+0.5,hfp[i][j]/nhfp[i][j]);
702  if(nhfm[i][j]>1) HFMphi->Fill(phi+0.5,hfm[i][j]/nhfm[i][j]);
703  }
704  for(int i=0;i<12;i++)for(int j=0;j<4;j++){
705  int phi=i*4+j+1;
706  if(nho0[i][j]>1) HO0phi->Fill(phi+0.5,ho0[i][j]/nho0[i][j]);
707  if(nho1p[i][j]>1) HO1Pphi->Fill(phi+0.5,ho1p[i][j]/nho1p[i][j]);
708  if(nho2p[i][j]>1) HO2Pphi->Fill(phi+0.5,ho2p[i][j]/nho2p[i][j]);
709  if(nho1m[i][j]>1) HO1Mphi->Fill(phi+0.5,ho1m[i][j]/nho1m[i][j]);
710  if(nho2m[i][j]>1) HO2Mphi->Fill(phi+0.5,ho2m[i][j]/nho2m[i][j]);
711  }
712 }
713 
715 double led,rms,Time,time_rms;
716 int Eta,Phi,Depth,Statistic,Status=0;
717 char Subdet[10],str[500];
718  sprintf(str,"%sHcalDetDiagLEDData_run%06i_%i.root",OutputFilePath.c_str(),run_number,dataset_seq_number);
719  TFile *theFile = new TFile(str, "RECREATE");
720  if(!theFile->IsOpen()) return;
721  theFile->cd();
722  sprintf(str,"%d",run_number); TObjString run(str); run.Write("run number");
723  sprintf(str,"%d",ievt_); TObjString events(str); events.Write("Total events processed");
724 
725  TTree *tree =new TTree("HCAL LED data","HCAL LED data");
726  if(tree==0) return;
727  tree->Branch("Subdet", &Subdet, "Subdet/C");
728  tree->Branch("eta", &Eta, "Eta/I");
729  tree->Branch("phi", &Phi, "Phi/I");
730  tree->Branch("depth", &Depth, "Depth/I");
731  tree->Branch("statistic",&Statistic, "Statistic/I");
732  tree->Branch("status", &Status, "Status/I");
733  tree->Branch("led", &led, "led/D");
734  tree->Branch("rms", &rms, "rms/D");
735  tree->Branch("time", &Time, "time/D");
736  tree->Branch("time_rms", &time_rms, "time_rms/D");
737  sprintf(Subdet,"HB");
738  for(int eta=-16;eta<=16;eta++) for(int phi=1;phi<=72;phi++) for(int depth=1;depth<=2;depth++){
739  if((Statistic=hb_data[eta+42][phi-1][depth-1].get_statistics())>100){
740  Eta=eta; Phi=phi; Depth=depth;
741  Status=hb_data[eta+42][phi-1][depth-1].get_status();
742  hb_data[eta+42][phi-1][depth-1].get_average_led(&led,&rms);
743  hb_data[eta+42][phi-1][depth-1].get_average_time(&Time,&time_rms);
744  tree->Fill();
745  }
746  }
747  sprintf(Subdet,"HE");
748  for(int eta=-29;eta<=29;eta++) for(int phi=1;phi<=72;phi++) for(int depth=1;depth<=3;depth++){
749  if((Statistic=he_data[eta+42][phi-1][depth-1].get_statistics())>100){
750  Eta=eta; Phi=phi; Depth=depth;
751  Status=he_data[eta+42][phi-1][depth-1].get_status();
752  he_data[eta+42][phi-1][depth-1].get_average_led(&led,&rms);
753  he_data[eta+42][phi-1][depth-1].get_average_time(&Time,&time_rms);
754  tree->Fill();
755  }
756  }
757  sprintf(Subdet,"HO");
758  for(int eta=-15;eta<=15;eta++) for(int phi=1;phi<=72;phi++) for(int depth=4;depth<=4;depth++){
759  if((Statistic=ho_data[eta+42][phi-1][depth-1].get_statistics())>100){
760  Eta=eta; Phi=phi; Depth=depth;
761  Status=ho_data[eta+42][phi-1][depth-1].get_status();
762  ho_data[eta+42][phi-1][depth-1].get_average_led(&led,&rms);
763  ho_data[eta+42][phi-1][depth-1].get_average_time(&Time,&time_rms);
764  tree->Fill();
765  }
766  }
767  sprintf(Subdet,"HF");
768  for(int eta=-42;eta<=42;eta++) for(int phi=1;phi<=72;phi++) for(int depth=1;depth<=2;depth++){
769  if((Statistic=hf_data[eta+42][phi-1][depth-1].get_statistics())>100){
770  Eta=eta; Phi=phi; Depth=depth;
771  Status=hf_data[eta+42][phi-1][depth-1].get_status();
772  hf_data[eta+42][phi-1][depth-1].get_average_led(&led,&rms);
773  hf_data[eta+42][phi-1][depth-1].get_average_time(&Time,&time_rms);
774  tree->Fill();
775  }
776  }
777  sprintf(Subdet,"CALIB_HB");
778  for(int eta=-1;eta<=1;eta++) for(int phi=1;phi<=72;phi++){
779  if((calib_data[1][eta+2][phi-1].get_statistics())>100){
780  Eta=eta; Phi=phi; Depth=0;
781  Status=calib_data[1][eta+2][phi-1].get_status();
782  calib_data[1][eta+2][phi-1].get_average_led(&led,&rms);
783  calib_data[1][eta+2][phi-1].get_average_time(&Time,&time_rms);
784  tree->Fill();
785  }
786  }
787  sprintf(Subdet,"CALIB_HE");
788  for(int eta=-1;eta<=1;eta++) for(int phi=1;phi<=72;phi++){
789  if((calib_data[2][eta+2][phi-1].get_statistics())>100){
790  Eta=eta; Phi=phi; Depth=0;
791  Status=calib_data[2][eta+2][phi-1].get_status();
792  calib_data[2][eta+2][phi-1].get_average_led(&led,&rms);
793  calib_data[2][eta+2][phi-1].get_average_time(&Time,&time_rms);
794  tree->Fill();
795  }
796  }
797  sprintf(Subdet,"CALIB_HO");
798  for(int eta=-2;eta<=2;eta++) for(int phi=1;phi<=72;phi++){
799  if((calib_data[3][eta+2][phi-1].get_statistics())>100){
800  Eta=eta; Phi=phi; Depth=0;
801  Status=calib_data[3][eta+2][phi-1].get_status();
802  calib_data[3][eta+2][phi-1].get_average_led(&led,&rms);
803  calib_data[3][eta+2][phi-1].get_average_time(&Time,&time_rms);
804  tree->Fill();
805  }
806  }
807  sprintf(Subdet,"CALIB_HF");
808  for(int eta=-2;eta<=2;eta++) for(int phi=1;phi<=72;phi++){
809  if((calib_data[4][eta+2][phi-1].get_statistics())>100){
810  Eta=eta; Phi=phi; Depth=0;
811  Status=calib_data[4][eta+2][phi-1].get_status();
812  calib_data[4][eta+2][phi-1].get_average_led(&led,&rms);
813  calib_data[4][eta+2][phi-1].get_average_time(&Time,&time_rms);
814  tree->Fill();
815  }
816  }
817  theFile->Write();
818  theFile->Close();
819 
820 
821  if(XmlFilePath.size()>0){
822  //create XML file
823  char TIME[40];
824  Long_t t; t=time(0); strftime(TIME,30,"%F %T",localtime(&t));
825 
826  sprintf(str,"HcalDetDiagLED_%i_%i.xml",run_number,dataset_seq_number);
827  std::string xmlName=str;
828  std::ofstream xmlFile;
829  xmlFile.open(xmlName.c_str());
830 
831  xmlFile<<"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n";
832  xmlFile<<"<ROOT>\n";
833  xmlFile<<" <HEADER>\n";
834  xmlFile<<" <HINTS mode='only-det-root'/>\n";
835  xmlFile<<" <TYPE>\n";
836  xmlFile<<" <EXTENSION_TABLE_NAME>HCAL_DETMON_LED_LASER_V1</EXTENSION_TABLE_NAME>\n";
837  xmlFile<<" <NAME>HCAL LED [local]</NAME>\n";
838  xmlFile<<" </TYPE>\n";
839  xmlFile<<" <!-- run details -->\n";
840  xmlFile<<" <RUN>\n";
841  xmlFile<<" <RUN_TYPE>LOCAL-RUN</RUN_TYPE>\n";
842  xmlFile<<" <RUN_NUMBER>"<<run_number<<"</RUN_NUMBER>\n";
843  xmlFile<<" <RUN_BEGIN_TIMESTAMP>2009-01-01 00:00:00</RUN_BEGIN_TIMESTAMP>\n";
844  xmlFile<<" <COMMENT_DESCRIPTION>hcal LED data</COMMENT_DESCRIPTION>\n";
845  xmlFile<<" <LOCATION>P5</LOCATION>\n";
846  xmlFile<<" <INITIATED_BY_USER>dma</INITIATED_BY_USER>\n";
847  xmlFile<<" </RUN>\n";
848  xmlFile<<" </HEADER>\n";
849  xmlFile<<" <DATA_SET>\n";
850  xmlFile<<" <!-- optional dataset metadata -->\n\n";
851  xmlFile<<" <SET_NUMBER>"<<dataset_seq_number<<"</SET_NUMBER>\n";
852  xmlFile<<" <SET_BEGIN_TIMESTAMP>2009-01-01 00:00:00</SET_BEGIN_TIMESTAMP>\n";
853  xmlFile<<" <SET_END_TIMESTAMP>2009-01-01 00:00:00</SET_END_TIMESTAMP>\n";
854  xmlFile<<" <NUMBER_OF_EVENTS_IN_SET>"<<ievt_<<"</NUMBER_OF_EVENTS_IN_SET>\n";
855  xmlFile<<" <COMMENT_DESCRIPTION>Automatic DQM output</COMMENT_DESCRIPTION>\n";
856  xmlFile<<" <DATA_FILE_NAME>"<< xmlName <<"</DATA_FILE_NAME>\n";
857  xmlFile<<" <IMAGE_FILE_NAME>data plot url or file path</IMAGE_FILE_NAME>\n";
858  xmlFile<<" <!-- who and when created this dataset-->\n\n";
859  xmlFile<<" <CREATE_TIMESTAMP>"<<TIME<<"</CREATE_TIMESTAMP>\n";
860  xmlFile<<" <CREATED_BY_USER>dma</CREATED_BY_USER>\n";
861  xmlFile<<" <!-- version (string) and subversion (number) -->\n";
862  xmlFile<<" <!-- fields are used to read data back from the database -->\n\n";
863  xmlFile<<" <VERSION>"<<run_number<<dataset_seq_number<<"</VERSION>\n";
864  xmlFile<<" <SUBVERSION>1</SUBVERSION>\n";
865  xmlFile<<" <!-- Assign predefined dataset attributes -->\n\n";
866  xmlFile<<" <PREDEFINED_ATTRIBUTES>\n";
867  xmlFile<<" <ATTRIBUTE>\n";
868  xmlFile<<" <NAME>HCAL Dataset Status</NAME>\n";
869  xmlFile<<" <VALUE>VALID</VALUE>\n";
870  xmlFile<<" </ATTRIBUTE>\n";
871  xmlFile<<" </PREDEFINED_ATTRIBUTES>\n";
872  xmlFile<<" <!-- multiple data block records -->\n\n";
873 
874  std::vector <HcalElectronicsId> AllElIds = emap->allElectronicsIdPrecision();
875  for(std::vector <HcalElectronicsId>::iterator eid = AllElIds.begin(); eid != AllElIds.end(); eid++){
876  DetId detid=emap->lookup(*eid);
877  if (detid.det()!=DetId::Hcal) continue;
878  HcalGenericDetId gid(emap->lookup(*eid));
879  if(!(!(gid.null()) &&
880  (gid.genericSubdet()==HcalGenericDetId::HcalGenBarrel ||
881  gid.genericSubdet()==HcalGenericDetId::HcalGenEndcap ||
882  gid.genericSubdet()==HcalGenericDetId::HcalGenForward ||
883  gid.genericSubdet()==HcalGenericDetId::HcalGenOuter))) continue;
884  int eta,phi,depth;
885  std::string subdet="";
886  HcalDetId hid(detid);
887  eta=hid.ieta();
888  phi=hid.iphi();
889  depth=hid.depth();
890 
891  double e=0,e_rms=0,t=0,t_rms=0;
892  if(detid.subdetId()==HcalBarrel){
893  subdet="HB";
894  Statistic=hb_data[eta+42][phi-1][depth-1].get_statistics();
895  Status =hb_data[eta+42][phi-1][depth-1].get_status();
896  hb_data[eta+42][phi-1][depth-1].get_average_led(&e,&e_rms);
897  hb_data[eta+42][phi-1][depth-1].get_average_time(&t,&t_rms);
898  }else if(detid.subdetId()==HcalEndcap){
899  subdet="HE";
900  Statistic=he_data[eta+42][phi-1][depth-1].get_statistics();
901  Status =he_data[eta+42][phi-1][depth-1].get_status();
902  he_data[eta+42][phi-1][depth-1].get_average_led(&e,&e_rms);
903  he_data[eta+42][phi-1][depth-1].get_average_time(&t,&t_rms);
904  }else if(detid.subdetId()==HcalForward){
905  subdet="HF";
906  Statistic=hf_data[eta+42][phi-1][depth-1].get_statistics();
907  Status =hf_data[eta+42][phi-1][depth-1].get_status();
908  hf_data[eta+42][phi-1][depth-1].get_average_led(&e,&e_rms);
909  hf_data[eta+42][phi-1][depth-1].get_average_time(&t,&t_rms);
910  }else if(detid.subdetId()==HcalOuter){
911  subdet="HO";
912  Statistic=ho_data[eta+42][phi-1][depth-1].get_statistics();
913  Status =ho_data[eta+42][phi-1][depth-1].get_status();
914  ho_data[eta+42][phi-1][depth-1].get_average_led(&e,&e_rms);
915  ho_data[eta+42][phi-1][depth-1].get_average_time(&t,&t_rms);
916  }else continue;
917  xmlFile<<" <DATA>\n";
918  xmlFile<<" <NUMBER_OF_EVENTS_USED>"<<Statistic<<"</NUMBER_OF_EVENTS_USED>\n";
919  xmlFile<<" <SIGNAL_MEAN>"<<e<<"</SIGNAL_MEAN>\n";
920  xmlFile<<" <SIGNAL_RMS>"<<e_rms<<"</SIGNAL_RMS>\n";
921  xmlFile<<" <TIME_MEAN>"<<t<<"</TIME_MEAN>\n";
922  xmlFile<<" <TIME_RMS>"<<t_rms<<"</TIME_RMS>\n";
923  xmlFile<<" <CHANNEL_STATUS_WORD>"<<Status<<"</CHANNEL_STATUS_WORD>\n";
924  xmlFile<<" <CHANNEL_OBJECTNAME>HcalDetId</CHANNEL_OBJECTNAME>\n";
925  xmlFile<<" <SUBDET>"<<subdet<<"</SUBDET>\n";
926  xmlFile<<" <IETA>"<<eta<<"</IETA>\n";
927  xmlFile<<" <IPHI>"<<phi<<"</IPHI>\n";
928  xmlFile<<" <DEPTH>"<<depth<<"</DEPTH>\n";
929  xmlFile<<" <TYPE>0</TYPE>\n";
930  xmlFile<<" </DATA>\n";
931  }
933  xmlFile<<" </DATA_SET>\n";
934  xmlFile<<"</ROOT>\n";
935  xmlFile.close();
936 
937  //create CALIB XML file
938  sprintf(str,"HcalDetDiagLEDCalib_%i_%i.xml",run_number,dataset_seq_number);
939  std::string xmlNameCalib=str;
940  std::ofstream xmlFileCalib;
941  xmlFileCalib.open(xmlNameCalib.c_str());
942 
943  xmlFileCalib<<"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n";
944  xmlFileCalib<<"<ROOT>\n";
945  xmlFileCalib<<" <HEADER>\n";
946  xmlFileCalib<<" <HINTS mode='only-det-root'/>\n";
947  xmlFileCalib<<" <TYPE>\n";
948  xmlFileCalib<<" <EXTENSION_TABLE_NAME>HCAL_DETMON_LED_LASER_V1</EXTENSION_TABLE_NAME>\n";
949  xmlFileCalib<<" <NAME>HCAL LED CALIB [local]</NAME>\n";
950  xmlFileCalib<<" </TYPE>\n";
951  xmlFileCalib<<" <!-- run details -->\n";
952  xmlFileCalib<<" <RUN>\n";
953  xmlFileCalib<<" <RUN_TYPE>LOCAL-RUN</RUN_TYPE>\n";
954  xmlFileCalib<<" <RUN_NUMBER>"<<run_number<<"</RUN_NUMBER>\n";
955  xmlFileCalib<<" <RUN_BEGIN_TIMESTAMP>2009-01-01 00:00:00</RUN_BEGIN_TIMESTAMP>\n";
956  xmlFileCalib<<" <COMMENT_DESCRIPTION>hcal LED CALIB data</COMMENT_DESCRIPTION>\n";
957  xmlFileCalib<<" <LOCATION>P5</LOCATION>\n";
958  xmlFileCalib<<" <INITIATED_BY_USER>dma</INITIATED_BY_USER>\n";
959  xmlFileCalib<<" </RUN>\n";
960  xmlFileCalib<<" </HEADER>\n";
961  xmlFileCalib<<" <DATA_SET>\n";
962  xmlFileCalib<<" <!-- optional dataset metadata -->\n\n";
963  xmlFileCalib<<" <SET_NUMBER>"<<dataset_seq_number<<"</SET_NUMBER>\n";
964  xmlFileCalib<<" <SET_BEGIN_TIMESTAMP>2009-01-01 00:00:00</SET_BEGIN_TIMESTAMP>\n";
965  xmlFileCalib<<" <SET_END_TIMESTAMP>2009-01-01 00:00:00</SET_END_TIMESTAMP>\n";
966  xmlFileCalib<<" <NUMBER_OF_EVENTS_IN_SET>"<<ievt_<<"</NUMBER_OF_EVENTS_IN_SET>\n";
967  xmlFileCalib<<" <COMMENT_DESCRIPTION>Automatic DQM output</COMMENT_DESCRIPTION>\n";
968  xmlFileCalib<<" <DATA_FILE_NAME>"<< xmlNameCalib <<"</DATA_FILE_NAME>\n";
969  xmlFileCalib<<" <IMAGE_FILE_NAME>data plot url or file path</IMAGE_FILE_NAME>\n";
970  xmlFileCalib<<" <!-- who and when created this dataset-->\n\n";
971  xmlFileCalib<<" <CREATE_TIMESTAMP>"<<TIME<<"</CREATE_TIMESTAMP>\n";
972  xmlFileCalib<<" <CREATED_BY_USER>dma</CREATED_BY_USER>\n";
973  xmlFileCalib<<" <!-- version (string) and subversion (number) -->\n";
974  xmlFileCalib<<" <!-- fields are used to read data back from the database -->\n\n";
975  xmlFileCalib<<" <VERSION>"<<run_number<<dataset_seq_number<<"</VERSION>\n";
976  xmlFileCalib<<" <SUBVERSION>1</SUBVERSION>\n";
977  xmlFileCalib<<" <!-- Assign predefined dataset attributes -->\n\n";
978  xmlFileCalib<<" <PREDEFINED_ATTRIBUTES>\n";
979  xmlFileCalib<<" <ATTRIBUTE>\n";
980  xmlFileCalib<<" <NAME>HCAL Dataset Status</NAME>\n";
981  xmlFileCalib<<" <VALUE>VALID</VALUE>\n";
982  xmlFileCalib<<" </ATTRIBUTE>\n";
983  xmlFileCalib<<" </PREDEFINED_ATTRIBUTES>\n";
984  xmlFileCalib<<" <!-- multiple data block records -->\n\n";
985 
986  for(int sd=1;sd<=4;sd++) for(int eta=-2;eta<=2;eta++) for(int phi=1;phi<=72;phi++){
987  std::string subdet="";
988  if(sd==1) subdet="HB";
989  if(sd==2) subdet="HE";
990  if(sd==3) subdet="HO";
991  if(sd==4) subdet="HF";
992  if((calib_data[sd][eta+2][phi-1].get_statistics())>100){
993  double e=0,e_rms=0,t=0,t_rms=0;
994  Status=calib_data[sd][eta+2][phi-1].get_status();
995  Statistic=calib_data[sd][eta+2][phi-1].get_statistics();
996  calib_data[sd][eta+2][phi-1].get_average_led(&e,&e_rms);
997  calib_data[sd][eta+2][phi-1].get_average_time(&t,&t_rms);
998  xmlFileCalib<<" <DATA>\n";
999  xmlFileCalib<<" <NUMBER_OF_EVENTS_USED>"<<Statistic<<"</NUMBER_OF_EVENTS_USED>\n";
1000  xmlFileCalib<<" <SIGNAL_MEAN>"<<e<<"</SIGNAL_MEAN>\n";
1001  xmlFileCalib<<" <SIGNAL_RMS>"<<e_rms<<"</SIGNAL_RMS>\n";
1002  xmlFileCalib<<" <TIME_MEAN>"<<t<<"</TIME_MEAN>\n";
1003  xmlFileCalib<<" <TIME_RMS>"<<t_rms<<"</TIME_RMS>\n";
1004  xmlFileCalib<<" <CHANNEL_STATUS_WORD>"<<Status<<"</CHANNEL_STATUS_WORD>\n";
1005  xmlFileCalib<<" <CHANNEL_OBJECTNAME>HcalDetId</CHANNEL_OBJECTNAME>\n";
1006  xmlFileCalib<<" <SUBDET>"<<subdet<<"</SUBDET>\n";
1007  xmlFileCalib<<" <IETA>"<<eta<<"</IETA>\n";
1008  xmlFileCalib<<" <IPHI>"<<phi<<"</IPHI>\n";
1009  xmlFileCalib<<" <DEPTH>"<<0<<"</DEPTH>\n";
1010  xmlFileCalib<<" <TYPE>0</TYPE>\n";
1011  xmlFileCalib<<" </DATA>\n";
1012  }
1013  }
1015  xmlFileCalib<<" </DATA_SET>\n";
1016  xmlFileCalib<<"</ROOT>\n";
1017  xmlFileCalib.close();
1018 
1019  sprintf(str,"zip %s.zip %s %s",xmlName.c_str(),xmlName.c_str(),xmlNameCalib.c_str());
1020  system(str);
1021  sprintf(str,"rm -f %s %s",xmlName.c_str(),xmlNameCalib.c_str());
1022  system(str);
1023  sprintf(str,"mv -f %s.zip %s",xmlName.c_str(),XmlFilePath.c_str());
1024  system(str);
1025  }
1026 
1027 
1029 }
1030 
1032 double led,rms;
1033 int Eta,Phi,Depth;
1034 char subdet[10];
1035 TFile *f;
1036  if(gSystem->AccessPathName(ReferenceData.c_str())) return;
1037  f = new TFile(ReferenceData.c_str(),"READ");
1038  if(!f->IsOpen()) return ;
1039  TObjString *STR=(TObjString *)f->Get("run number");
1040  if(STR){ std::string Ref(STR->String()); ReferenceRun=Ref;}
1041  TTree* t=(TTree*)f->Get("HCAL LED data");
1042  if(!t) return;
1043  t->SetBranchAddress("Subdet", subdet);
1044  t->SetBranchAddress("eta", &Eta);
1045  t->SetBranchAddress("phi", &Phi);
1046  t->SetBranchAddress("depth", &Depth);
1047  t->SetBranchAddress("led", &led);
1048  t->SetBranchAddress("rms", &rms);
1049  for(int ievt=0;ievt<t->GetEntries();ievt++){
1050 
1051  t->GetEntry(ievt);
1052  if(strcmp(subdet,"HB")==0) hb_data[Eta+42][Phi-1][Depth-1].set_reference(led,rms);
1053  if(strcmp(subdet,"HE")==0) he_data[Eta+42][Phi-1][Depth-1].set_reference(led,rms);
1054  if(strcmp(subdet,"HO")==0) ho_data[Eta+42][Phi-1][Depth-1].set_reference(led,rms);
1055  if(strcmp(subdet,"HF")==0) hf_data[Eta+42][Phi-1][Depth-1].set_reference(led,rms);
1056  if(strcmp(subdet,"CALIB_HB")==0) calib_data[1][Eta+2][Phi-1].set_reference(led,rms);
1057  if(strcmp(subdet,"CALIB_HE")==0) calib_data[2][Eta+2][Phi-1].set_reference(led,rms);
1058  if(strcmp(subdet,"CALIB_HO")==0) calib_data[3][Eta+2][Phi-1].set_reference(led,rms);
1059  if(strcmp(subdet,"CALIB_HF")==0) calib_data[4][Eta+2][Phi-1].set_reference(led,rms);
1060  }
1061  f->Close();
1062  IsReference=true;
1063 }
1065  for(int i=0;i<4;i++){
1069  ChannelStatusLEDMean->depth[i]->Reset();
1070  ChannelStatusLEDRMS->depth[i]->Reset();
1071  ChannelStatusTimeMean->depth[i]->Reset();
1072  ChannelStatusTimeRMS->depth[i]->Reset();
1073  }
1074 
1075  std::vector <HcalElectronicsId> AllElIds = emap->allElectronicsIdPrecision();
1076  for (std::vector <HcalElectronicsId>::iterator eid = AllElIds.begin(); eid != AllElIds.end(); eid++) {
1077  DetId detid=emap->lookup(*eid);
1078  if (detid.det()!=DetId::Hcal) continue;
1079  HcalGenericDetId gid(emap->lookup(*eid));
1080  if(!(!(gid.null()) &&
1081  (gid.genericSubdet()==HcalGenericDetId::HcalGenBarrel ||
1082  gid.genericSubdet()==HcalGenericDetId::HcalGenEndcap ||
1083  gid.genericSubdet()==HcalGenericDetId::HcalGenForward ||
1084  gid.genericSubdet()==HcalGenericDetId::HcalGenOuter))) continue;
1085  int eta=0,phi=0,depth=0;
1086  if(KnownBadCells_.find(gid.rawId())==KnownBadCells_.end()) continue;
1087 
1088  HcalDetId hid(detid);
1089  eta=hid.ieta();
1090  phi=hid.iphi();
1091  depth=hid.depth();
1092 
1093  double AVE_TIME=Time->getMean();
1094  if(detid.subdetId()==HcalBarrel){
1095  int stat=hb_data[eta+42][phi-1][depth-1].get_statistics()+
1096  hb_data[eta+42][phi-1][depth-1].get_overflow()+hb_data[eta+42][phi-1][depth-1].get_undeflow();
1097  if(stat==0){
1098  fill_channel_status("HB",eta,phi,depth,1,1);
1099  hb_data[eta+42][phi-1][depth-1].change_status(1);
1100  }
1101  if(stat>0 && stat!=(ievt_)){
1102  fill_channel_status("HB",eta,phi,depth,2,(double)stat/(double)(ievt_));
1103  hb_data[eta+42][phi-1][depth-1].change_status(2);
1104  }
1105  if(hb_data[eta+42][phi-1][depth-1].get_statistics()>100){
1106  double ave=0;
1107  double rms=0;
1108  hb_data[eta+42][phi-1][depth-1].get_average_time(&ave,&rms);
1109  if((AVE_TIME-ave)>0.75 || (AVE_TIME-ave)<-0.75){
1110  fill_channel_status("HB",eta,phi,depth,6,AVE_TIME-ave);
1111  hb_data[eta+42][phi-1][depth-1].change_status(8);
1112  }
1113  }
1114  stat=hb_data[eta+42][phi-1][depth-1].get_undeflow();
1115  if(stat>0){
1116  fill_channel_status("HB",eta,phi,depth,3,(double)stat/(double)(ievt_));
1117  hb_data[eta+42][phi-1][depth-1].change_status(4);
1118  }
1119  }
1120  if(detid.subdetId()==HcalEndcap){
1121  int stat=he_data[eta+42][phi-1][depth-1].get_statistics()+
1122  he_data[eta+42][phi-1][depth-1].get_overflow()+he_data[eta+42][phi-1][depth-1].get_undeflow();
1123  if(stat==0){
1124  fill_channel_status("HE",eta,phi,depth,1,1);
1125  he_data[eta+42][phi-1][depth-1].change_status(1);
1126  }
1127  if(stat>0 && stat!=(ievt_)){
1128  fill_channel_status("HE",eta,phi,depth,2,(double)stat/(double)(ievt_));
1129  he_data[eta+42][phi-1][depth-1].change_status(2);
1130  }
1131  if(he_data[eta+42][phi-1][depth-1].get_statistics()>100){
1132  double ave=0;
1133  double rms=0;
1134  he_data[eta+42][phi-1][depth-1].get_average_time(&ave,&rms);
1135  if((AVE_TIME-ave)>0.75 || (AVE_TIME-ave)<-0.75){
1136  fill_channel_status("HE",eta,phi,depth,6,AVE_TIME-ave);
1137  he_data[eta+42][phi-1][depth-1].change_status(8);
1138  }
1139  }
1140  stat=he_data[eta+42][phi-1][depth-1].get_undeflow();
1141  if(stat>0){
1142  fill_channel_status("HE",eta,phi,depth,3,(double)stat/(double)(ievt_));
1143  he_data[eta+42][phi-1][depth-1].change_status(4);
1144  }
1145  }
1146  if(detid.subdetId()==HcalOuter){
1147  int stat=ho_data[eta+42][phi-1][depth-1].get_statistics()+
1148  ho_data[eta+42][phi-1][depth-1].get_overflow()+ho_data[eta+42][phi-1][depth-1].get_undeflow();
1149  if(stat==0){
1150  fill_channel_status("HO",eta,phi,depth,1,1);
1151  ho_data[eta+42][phi-1][depth-1].change_status(1);
1152  }
1153  if(stat>0 && stat!=(ievt_)){
1154  fill_channel_status("HO",eta,phi,depth,2,(double)stat/(double)(ievt_));
1155  ho_data[eta+42][phi-1][depth-1].change_status(2);
1156  }
1157  if(ho_data[eta+42][phi-1][depth-1].get_statistics()>100){
1158  double ave=0;
1159  double rms=0;
1160  ho_data[eta+42][phi-1][depth-1].get_average_time(&ave,&rms);
1161  if((AVE_TIME-ave)>0.75 || (AVE_TIME-ave)<-0.75){
1162  fill_channel_status("HO",eta,phi,depth,6,AVE_TIME-ave);
1163  ho_data[eta+42][phi-1][depth-1].change_status(8);
1164  }
1165  }
1166  stat=ho_data[eta+42][phi-1][depth-1].get_undeflow();
1167  if(stat>0){
1168  fill_channel_status("HO",eta,phi,depth,3,(double)stat/(double)(ievt_));
1169  ho_data[eta+42][phi-1][depth-1].change_status(4);
1170  }
1171  }
1172  if(detid.subdetId()==HcalForward){
1173  AVE_TIME=TimeHF->getMean();
1174  int stat=hf_data[eta+42][phi-1][depth-1].get_statistics()+
1175  hf_data[eta+42][phi-1][depth-1].get_overflow()+hf_data[eta+42][phi-1][depth-1].get_undeflow();
1176  if(stat==0){
1177  fill_channel_status("HF",eta,phi,depth,1,1);
1178  hf_data[eta+42][phi-1][depth-1].change_status(1);
1179  }
1180  if(stat>0 && stat!=(ievt_)){
1181  fill_channel_status("HF",eta,phi,depth,2,(double)stat/(double)(ievt_));
1182  hf_data[eta+42][phi-1][depth-1].change_status(2);
1183  }
1184  if(hf_data[eta+42][phi-1][depth-1].get_statistics()>100){
1185  double ave=0;
1186  double rms=0;
1187  hf_data[eta+42][phi-1][depth-1].get_average_time(&ave,&rms);
1188  if((AVE_TIME-ave)>0.75 || (AVE_TIME-ave)<-0.75){
1189  fill_channel_status("HF",eta,phi,depth,6,AVE_TIME-ave);
1190  hf_data[eta+42][phi-1][depth-1].change_status(8);
1191  }
1192  }
1193  stat=hf_data[eta+42][phi-1][depth-1].get_undeflow();
1194  if(stat>0){
1195  fill_channel_status("HF",eta,phi,depth,3,(double)stat/(double)(ievt_));
1196  hf_data[eta+42][phi-1][depth-1].change_status(4);
1197  }
1198  }
1199  }
1200 }
1201 void HcalDetDiagLEDMonitor::fill_energy(std::string subdet,int eta,int phi,int depth,double e,int type){
1202  int subdetval=-1;
1203  if (subdet.compare("HB")==0) subdetval=(int)HcalBarrel;
1204  else if (subdet.compare("HE")==0) subdetval=(int)HcalEndcap;
1205  else if (subdet.compare("HO")==0) subdetval=(int)HcalOuter;
1206  else if (subdet.compare("HF")==0) subdetval=(int)HcalForward;
1207  else return;
1208 
1209  int ietabin=CalcEtaBin(subdetval, eta, depth)+1;
1210  if(type==1) ChannelsLEDEnergy->depth[depth-1] ->setBinContent(ietabin,phi,e);
1211  else if(type==2) ChannelsLEDEnergyRef->depth[depth-1]->setBinContent(ietabin,phi,e);
1212 }
1213 
1214 double HcalDetDiagLEDMonitor::get_energy(std::string subdet,int eta,int phi,int depth,int type){
1215  int subdetval=-1;
1216  if (subdet.compare("HB")==0) subdetval=(int)HcalBarrel;
1217  else if (subdet.compare("HE")==0) subdetval=(int)HcalEndcap;
1218  else if (subdet.compare("HO")==0) subdetval=(int)HcalOuter;
1219  else if (subdet.compare("HF")==0) subdetval=(int)HcalForward;
1220  else return -1.0;
1221 
1222  int ietabin=CalcEtaBin(subdetval, eta, depth)+1;
1223  if(type==1) return ChannelsLEDEnergy->depth[depth-1] ->getBinContent(ietabin, phi);
1224  else if(type==2) return ChannelsLEDEnergyRef->depth[depth-1] ->getBinContent(ietabin,phi);
1225  return -1.0;
1226 }
1227 
1228 void HcalDetDiagLEDMonitor::fill_channel_status(std::string subdet,int eta,int phi,int depth,int type,double status){
1229  int subdetval=-1;
1230  if (subdet.compare("HB")==0) subdetval=(int)HcalBarrel;
1231  else if (subdet.compare("HE")==0) subdetval=(int)HcalEndcap;
1232  else if (subdet.compare("HO")==0) subdetval=(int)HcalOuter;
1233  else if (subdet.compare("HF")==0) subdetval=(int)HcalForward;
1234  else return;
1235  int ietabin=CalcEtaBin(subdetval, eta, depth)+1;
1236 
1237  if(type==1) ChannelStatusMissingChannels->depth[depth-1] ->setBinContent(ietabin,phi,status);
1238  if(type==2) ChannelStatusUnstableChannels->depth[depth-1] ->setBinContent(ietabin,phi,status);
1239  if(type==3) ChannelStatusUnstableLEDsignal->depth[depth-1]->setBinContent(ietabin,phi,status);
1240  if(type==4) ChannelStatusLEDMean->depth[depth-1] ->setBinContent(ietabin,phi,status);
1241  if(type==5) ChannelStatusLEDRMS->depth[depth-1] ->setBinContent(ietabin,phi,status);
1242  if(type==6) ChannelStatusTimeMean->depth[depth-1] ->setBinContent(ietabin,phi,status);
1243  if(type==7) ChannelStatusTimeRMS->depth[depth-1] ->setBinContent(ietabin,phi,status);
1244 }
1246  if(ievt_>=100){
1247  fillHistos();
1248  CheckStatus();
1249  SaveReference();
1250  }
1251 }
1253 
RunNumber_t run() const
Definition: EventID.h:42
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_
std::vector< HcalElectronicsId > allElectronicsIdPrecision() const
HcalDetDiagLEDData hb_data[85][72][4]
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:942
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
bool get_average_led(double *ave, double *rms)
std::vector< int > AllowedCalibTypes_
std::vector< HBHEDataFrame >::const_iterator const_iterator
void setup(DQMStore *&m_dbe, std::string Name, std::string Units="")
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)
T eta() const
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)
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.h:40
#define ETA
MVATrainerComputer * calib
Definition: MVATrainer.cc:64
int iEvent
Definition: GenABIO.cc:230
HcalElectronicsMap generateHcalElectronicsMap()
std::vector< MonitorElement * > depth
virtual void beginRun(const edm::Run &run, const edm::EventSetup &c)
edm::EDGetTokenT< HFDigiCollection > tok_hf_
void removeContents(void)
erase all monitoring elements in current directory (not including subfolders);
Definition: DQMStore.cc:3085
MonitorElement * bookString(const char *name, const char *value)
Book string.
Definition: DQMStore.cc:908
HcalDetDiagLEDData ho_data[85][72][4]
std::vector< DetId > getAllChannels() const
T sqrt(T t)
Definition: SSEVec.h:48
HcalLogicalMap * logicalMap_
int rm() const
int ieta() const
get the cell ieta
Definition: HcalDetId.h:36
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 endRun(const edm::Run &run, const edm::EventSetup &c) override
void add_statistics(double *data, int nTS)
bool isValid() const
Definition: HandleBase.h:76
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
void beginRun(const edm::Run &run, const edm::EventSetup &c) override
bool get_average_time(double *ave, double *rms)
const HcalFrontEndId getHcalFrontEndId(const DetId &)
int iphi() const
get the cell iphi
Definition: HcalDetId.h:38
Definition: DetId.h:18
double sd
const T & get() const
Definition: EventSetup.h:55
#define PHI
Statistic
T const * product() const
Definition: ESHandle.h:62
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)
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:56
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:121
double get_energy(std::string subdet, int eta, int phi, int depth, int type)
tuple status
Definition: ntuplemaker.py:245
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:849
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:1070
virtual void setup(void)
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)
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:655
Definition: Run.h:41
void set_reference(float val, float rms)
edm::EDGetTokenT< HODigiCollection > tok_ho_
Definition: DDAxes.h:10