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