CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalDetDiagPedestalMonitor.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: HcalDetDiagPedestalMonitor
4 // Class: HcalDetDiagPedestalMonitor
5 //
13 //
14 // Original Author: Dmitry Vishnevskiy,591 R-013,+41227674265,
15 // Created: Tue Mar 9 12:59:18 CET 2010
16 // $Id: HcalDetDiagPedestalMonitor.cc,v 1.21 2012/08/30 21:48:48 wdd Exp $
17 //
18 //
19 // user include files
25 
30 
33 
34 #include <math.h>
35 // this is to retrieve HCAL digi's
37 // to retrive trigger information (local runs only)
39 
42 
46 
47 #include "TFile.h"
48 #include "TTree.h"
49 #include "TSystem.h"
50 
56 
57 #include <iostream>
58 #include <fstream>
59 
61 public:
63  reset();
64  IsReference=false;
65  status=n=0;
66  ds_ped=ds_rms=-100;
68  }
69  void reset(){
70  for(int i=0;i<128;i++) adc[i]=0;
71  overflow=0;
72  }
73  void add_statistics(unsigned int val){
74  if(val<128){ adc[val&0x7F]++; n++;}else overflow++;
75  }
76  void set_reference(float val,float rms){
77  ref_ped=val; ref_rms=rms;
78  IsReference=true;
79  }
80  void set_data(float val,float rms){
81  ds_ped=val; ds_rms=rms;
82  }
83  void change_status(int val){
84  status|=val;
85  }
86  int get_status(){
87  return status;
88  }
89  bool get_reference(double *val,double *rms){
90  *val=ref_ped; *rms=ref_rms;
91  return IsReference;
92  }
93  bool get_average(double *ave,double *rms){
94  if(ds_ped>-100){ *ave=ds_ped; *rms=ds_rms; return true;}
95  double Sum=0,nSum=0;
96  int from,to,max=adc[0],maxi=0;
97  for(int i=1;i<128;i++) if(adc[i]>max){ max=adc[i]; maxi=i;}
98  from=0; to=maxi+6; if(to>127) to=127;
99  for(int i=from;i<=to;i++){
100  Sum+=i*adc[i];
101  nSum+=adc[i];
102  }
103  if(nSum>0) *ave=Sum/nSum; else return false;
104  Sum=0;
105  for(int i=from;i<=to;i++) Sum+=adc[i]*(i-*ave)*(i-*ave);
106  *rms=sqrt(Sum/nSum);
107  return true;
108  }
110  return n;
111  }
112  void set_statistics(int stat){
113  n=stat;
114  }
116  return overflow;
117  }
118  float nChecks;
119  float nMissing;
120  float nUnstable;
121  float nBadPed;
122  float nBadRms;
123 private:
124  int adc[128];
125  int overflow;
127  float ref_ped;
128  float ref_rms;
129  float ds_ped;
130  float ds_rms;
131  int n;
132  int status;
133 };
134 
135 
137  public:
140 
141 
142  private:
143  void SaveReference();
144  void LoadReference();
145  void LoadDataset();
146 
147  void CheckStatus();
148  void fillHistos();
149 
153 
154  void beginRun(const edm::Run& run, const edm::EventSetup& c);
155  void endRun(const edm::Run& run, const edm::EventSetup& c);
156  void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg,const edm::EventSetup& c) ;
157  void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg,const edm::EventSetup& c);
158  void analyze(const edm::Event&, const edm::EventSetup&);
159 
160  int ievt_;
164  bool LocalRun;
165  int nHB,nHE,nHO,nHF;
166 
175 
180 
181  // to create html from processed dataset
185 
187  bool Online_;
188  bool Overwrite;
189 
198 
208 
213 
220 
225 
230  std::vector<std::string> problemnames_;
231 
236 
237  std::map<unsigned int, int> KnownBadCells_;
238 
240 };
241 
243  hcalTBTriggerDataTag_(iConfig.getParameter<edm::InputTag>("hcalTBTriggerDataTag"))
244 {
245  ievt_=-1;
246  emap=0;
248  run_number=-1;
249  IsReference=false;
250  LocalRun=false;
251  nHB=nHE=nHO=nHF=0;
252  createHTMLonly=false;
254  inputLabelDigi_ = iConfig.getUntrackedParameter<edm::InputTag>("digiLabel");
255  inputLabelRawData_ = iConfig.getUntrackedParameter<edm::InputTag>("rawDataLabel");
256  ReferenceData = iConfig.getUntrackedParameter<std::string>("PedestalReferenceData" ,"");
257  OutputFilePath = iConfig.getUntrackedParameter<std::string>("OutputFilePath", "");
258  DatasetName = iConfig.getUntrackedParameter<std::string>("PedestalDatasetName", "");
259  htmlOutputPath = iConfig.getUntrackedParameter<std::string>("htmlOutputPath", "");
260  XmlFilePath = iConfig.getUntrackedParameter<std::string>("XmlFilePath", "");
261  Online_ = iConfig.getUntrackedParameter<bool> ("online",false);
262  Overwrite = iConfig.getUntrackedParameter<bool> ("Overwrite",true);
263 
264  prefixME_ = iConfig.getUntrackedParameter<std::string>("subSystemFolder","Hcal/");
265  if (prefixME_.size()>0 && prefixME_.substr(prefixME_.size()-1,prefixME_.size())!="/")
266  prefixME_.append("/");
267  subdir_ = iConfig.getUntrackedParameter<std::string>("TaskFolder","DetDiagPedestalMonitor_Hcal/");
268  if (subdir_.size()>0 && subdir_.substr(subdir_.size()-1,subdir_.size())!="/")
269  subdir_.append("/");
270  subdir_=prefixME_+subdir_;
271 
272  HBMeanTreshold = iConfig.getUntrackedParameter<double>("HBMeanPedestalTreshold" , 0.2);
273  HBRmsTreshold = iConfig.getUntrackedParameter<double>("HBRmsPedestalTreshold" , 0.3);
274  HEMeanTreshold = iConfig.getUntrackedParameter<double>("HEMeanPedestalTreshold" , 0.2);
275  HERmsTreshold = iConfig.getUntrackedParameter<double>("HERmsPedestalTreshold" , 0.3);
276  HOMeanTreshold = iConfig.getUntrackedParameter<double>("HOMeanPedestalTreshold" , 0.2);
277  HORmsTreshold = iConfig.getUntrackedParameter<double>("HORmsPedestalTreshold" , 0.3);
278  HFMeanTreshold = iConfig.getUntrackedParameter<double>("HFMeanPedestalTreshold" , 0.2);
279  HFRmsTreshold = iConfig.getUntrackedParameter<double>("HFRmsPedestalTreshold" , 0.3);
280 }
282 
284  edm::ESHandle<HcalDbService> conditions_;
285  c.get<HcalDbRecord>().get(conditions_);
286  emap=conditions_->getHcalMapping();
287 
289  c.get<HcalChannelQualityRcd>().get(p);
290  HcalChannelQuality* chanquality= new HcalChannelQuality(*p.product());
291  std::vector<DetId> mydetids = chanquality->getAllChannels();
292  KnownBadCells_.clear();
293 
294  for (std::vector<DetId>::const_iterator i = mydetids.begin();i!=mydetids.end();++i){
295  if (i->det()!=DetId::Hcal) continue; // not an hcal cell
296  HcalDetId id=HcalDetId(*i);
297  int status=(chanquality->getValues(id))->getValue();
299  KnownBadCells_[id.rawId()]=status;
300  }
301  }
302 
303 
305  if (!dbe_) return;
307 
309  meEVT_ = dbe_->bookInt("HcalDetDiagPedestalMonitor Event Number");
310  meRUN_ = dbe_->bookInt("HcalDetDiagPedestalMonitor Run Number");
311 
312  ReferenceRun="UNKNOWN";
313  LoadReference();
314  LoadDataset();
316  RefRun_= dbe_->bookString("HcalDetDiagPedestalMonitor Reference Run",ReferenceRun);
317  if(DatasetName.size()>0 && createHTMLonly){
318  char str[200]; sprintf(str,"%sHcalDetDiagPedestalData_run%i_%i/",htmlOutputPath.c_str(),run_number,dataset_seq_number);
319  htmlFolder=dbe_->bookString("HcalDetDiagPedestalMonitor HTML folder",str);
320  MonitorElement *me;
321  dbe_->setCurrentFolder(prefixME_+"HcalInfo");
322  me=dbe_->bookInt("HBpresent");
323  if(nHB>0) me->Fill(1);
324  me=dbe_->bookInt("HEpresent");
325  if(nHE>0) me->Fill(1);
326  me=dbe_->bookInt("HOpresent");
327  if(nHO>0) me->Fill(1);
328  me=dbe_->bookInt("HFpresent");
329  if(nHF>0) me->Fill(1);
330  }
331 
333  ProblemCellsByDepth_missing->setup(dbe_," Problem Missing Channels");
334  for(unsigned int i=0;i<ProblemCellsByDepth_missing->depth.size();i++)
335  problemnames_.push_back(ProblemCellsByDepth_missing->depth[i]->getName());
337  ProblemCellsByDepth_unstable->setup(dbe_," Problem Unstable Channels");
338  for(unsigned int i=0;i<ProblemCellsByDepth_unstable->depth.size();i++)
339  problemnames_.push_back(ProblemCellsByDepth_unstable->depth[i]->getName());
341  ProblemCellsByDepth_badped->setup(dbe_," Problem Bad Pedestal Value");
342  for(unsigned int i=0;i<ProblemCellsByDepth_badped->depth.size();i++)
343  problemnames_.push_back(ProblemCellsByDepth_badped->depth[i]->getName());
345  ProblemCellsByDepth_badrms->setup(dbe_," Problem Bad Rms Value");
346  for(unsigned int i=0;i<ProblemCellsByDepth_badrms->depth.size();i++)
347  problemnames_.push_back(ProblemCellsByDepth_badrms->depth[i]->getName());
348 
349  dbe_->setCurrentFolder(subdir_+"Summary Plots");
350  name="HB Pedestal Distribution (average over 4 caps)"; PedestalsAve4HB = dbe_->book1D(name,name,200,0,6);
351  name="HE Pedestal Distribution (average over 4 caps)"; PedestalsAve4HE = dbe_->book1D(name,name,200,0,6);
352  name="HO Pedestal Distribution (average over 4 caps)"; PedestalsAve4HO = dbe_->book1D(name,name,200,0,6);
353  name="HF Pedestal Distribution (average over 4 caps)"; PedestalsAve4HF = dbe_->book1D(name,name,200,0,6);
354  name="SIPM Pedestal Distribution (average over 4 caps)"; PedestalsAve4Simp = dbe_->book1D(name,name,200,5,15);
355 
356  name="HB Pedestal-Reference Distribution (average over 4 caps)"; PedestalsAve4HBref= dbe_->book1D(name,name,1500,-3,3);
357  name="HE Pedestal-Reference Distribution (average over 4 caps)"; PedestalsAve4HEref= dbe_->book1D(name,name,1500,-3,3);
358  name="HO Pedestal-Reference Distribution (average over 4 caps)"; PedestalsAve4HOref= dbe_->book1D(name,name,1500,-3,3);
359  name="HF Pedestal-Reference Distribution (average over 4 caps)"; PedestalsAve4HFref= dbe_->book1D(name,name,1500,-3,3);
360 
361  name="HB Pedestal RMS Distribution (individual cap)"; PedestalsRmsHB = dbe_->book1D(name,name,200,0,2);
362  name="HE Pedestal RMS Distribution (individual cap)"; PedestalsRmsHE = dbe_->book1D(name,name,200,0,2);
363  name="HO Pedestal RMS Distribution (individual cap)"; PedestalsRmsHO = dbe_->book1D(name,name,200,0,2);
364  name="HF Pedestal RMS Distribution (individual cap)"; PedestalsRmsHF = dbe_->book1D(name,name,200,0,2);
365  name="SIPM Pedestal RMS Distribution (individual cap)"; PedestalsRmsSimp = dbe_->book1D(name,name,200,0,4);
366 
367  name="HB Pedestal_rms-Reference_rms Distribution"; PedestalsRmsHBref = dbe_->book1D(name,name,1500,-3,3);
368  name="HE Pedestal_rms-Reference_rms Distribution"; PedestalsRmsHEref = dbe_->book1D(name,name,1500,-3,3);
369  name="HO Pedestal_rms-Reference_rms Distribution"; PedestalsRmsHOref = dbe_->book1D(name,name,1500,-3,3);
370  name="HF Pedestal_rms-Reference_rms Distribution"; PedestalsRmsHFref = dbe_->book1D(name,name,1500,-3,3);
371 
372  name="HBHEHF pedestal mean map"; Pedestals2DHBHEHF = dbe_->book2D(name,name,87,-43,43,74,0,73);
373  name="HO pedestal mean map"; Pedestals2DHO = dbe_->book2D(name,name,33,-16,16,74,0,73);
374  name="HBHEHF pedestal rms map"; Pedestals2DRmsHBHEHF = dbe_->book2D(name,name,87,-43,43,74,0,73);
375  name="HO pedestal rms map"; Pedestals2DRmsHO = dbe_->book2D(name,name,33,-16,16,74,0,73);
376  name="HBHEHF pedestal problems map"; Pedestals2DErrorHBHEHF = dbe_->book2D(name,name,87,-43,43,74,0,73);
377  name="HO pedestal problems map"; Pedestals2DErrorHO = dbe_->book2D(name,name,33,-16,16,74,0,73);
378 
380  Pedestals2DHO->setAxisRange(1,5,3);
383 
384  Pedestals2DHBHEHF->setAxisTitle("i#eta",1);
385  Pedestals2DHBHEHF->setAxisTitle("i#phi",2);
386  Pedestals2DHO->setAxisTitle("i#eta",1);
387  Pedestals2DHO->setAxisTitle("i#phi",2);
390  Pedestals2DRmsHO->setAxisTitle("i#eta",1);
391  Pedestals2DRmsHO->setAxisTitle("i#phi",2);
394  Pedestals2DErrorHO->setAxisTitle("i#eta",1);
395  Pedestals2DErrorHO->setAxisTitle("i#phi",2);
396  PedestalsAve4HB->setAxisTitle("ADC counts",1);
397  PedestalsAve4HE->setAxisTitle("ADC counts",1);
398  PedestalsAve4HO->setAxisTitle("ADC counts",1);
399  PedestalsAve4HF->setAxisTitle("ADC counts",1);
400  PedestalsAve4Simp->setAxisTitle("ADC counts",1);
401  PedestalsAve4HBref->setAxisTitle("ADC counts",1);
402  PedestalsAve4HEref->setAxisTitle("ADC counts",1);
403  PedestalsAve4HOref->setAxisTitle("ADC counts",1);
404  PedestalsAve4HFref->setAxisTitle("ADC counts",1);
405  PedestalsRmsHB->setAxisTitle("ADC counts",1);
406  PedestalsRmsHE->setAxisTitle("ADC counts",1);
407  PedestalsRmsHO->setAxisTitle("ADC counts",1);
408  PedestalsRmsHF->setAxisTitle("ADC counts",1);
409  PedestalsRmsSimp->setAxisTitle("ADC counts",1);
410  PedestalsRmsHBref->setAxisTitle("ADC counts",1);
411  PedestalsRmsHEref->setAxisTitle("ADC counts",1);
412  PedestalsRmsHOref->setAxisTitle("ADC counts",1);
413  PedestalsRmsHFref->setAxisTitle("ADC counts",1);
414 
415  dbe_->setCurrentFolder(subdir_+"Plots for client");
417  ProblemCellsByDepth_missing_val->setup(dbe_," Missing channels");
419  ProblemCellsByDepth_unstable_val->setup(dbe_," Channel instability value");
421  ProblemCellsByDepth_badped_val->setup(dbe_," Bad Pedestal-Ref Value");
423  ProblemCellsByDepth_badrms_val->setup(dbe_," Bad Rms-ref Value");
424 }
425 
426 
427 
429  if(createHTMLonly) return;
430  HcalBaseDQMonitor::analyze(iEvent, iSetup); // increments counters
431 int eta,phi,depth,nTS;
432 static bool PEDseq;
433 static int lastPEDorbit,nChecksPED;
434  if(ievt_==-1){ ievt_=0; PEDseq=false; lastPEDorbit=-1;nChecksPED=0; }
435  int orbit=iEvent.orbitNumber();
436  meRUN_->Fill(iEvent.id().run());
437 
438  bool PedestalEvent=false;
439 
440  // for local runs
441  edm::Handle<HcalTBTriggerData> trigger_data;
442  iEvent.getByLabel(hcalTBTriggerDataTag_, trigger_data);
443  if(trigger_data.isValid()){
444  if((trigger_data->triggerWord())==5) PedestalEvent=true;
445  LocalRun=true;
446  }
447 
448  if(LocalRun && !PedestalEvent) return;
449 
450  if(!LocalRun && Online_){
451  if(PEDseq && (orbit-lastPEDorbit)>(11223*10) && ievt_>500){
452  PEDseq=false;
453  fillHistos();
454  CheckStatus();
455  nChecksPED++;
456  if(nChecksPED==1 || (nChecksPED>1 && ((nChecksPED-1)%12)==0)){
457  SaveReference();
458  }
459  for(int i=0;i<85;i++)for(int j=0;j<72;j++)for(int k=0;k<4;k++)for(int l=0;l<4;l++) hb_data[i][j][k][l].reset();
460  for(int i=0;i<85;i++)for(int j=0;j<72;j++)for(int k=0;k<4;k++)for(int l=0;l<4;l++) he_data[i][j][k][l].reset();
461  for(int i=0;i<85;i++)for(int j=0;j<72;j++)for(int k=0;k<4;k++)for(int l=0;l<4;l++) ho_data[i][j][k][l].reset();
462  for(int i=0;i<85;i++)for(int j=0;j<72;j++)for(int k=0;k<4;k++)for(int l=0;l<4;l++) hf_data[i][j][k][l].reset();
463  ievt_=0;
464  }
465  }
466 
467 
468  // Abort Gap pedestals
469  int calibType = -1 ;
470  if(LocalRun==false){
472  iEvent.getByLabel(inputLabelRawData_,rawdata);
473  //checking FEDs for calibration information
475  const FEDRawData& fedData = rawdata->FEDData(i) ;
476  if ( fedData.size() < 24 ) continue ;
477  int value = ((const HcalDCCHeader*)(fedData.data()))->getCalibType() ;
478  if ( calibType < 0 ) calibType = value ;
479  if(value==hc_Pedestal){ PEDseq=true; lastPEDorbit=orbit; break;}
480  }
481  }
482  if(!LocalRun && calibType!=hc_Pedestal) return;
483 
484  ievt_++;
485  meEVT_->Fill(ievt_);
486  run_number=iEvent.id().run();
487 
489  iEvent.getByLabel(inputLabelDigi_,hbhe);
490  if(hbhe.isValid()){
491  if(hbhe->size()<30 && calibType==hc_Pedestal){
492  ievt_--;
493  meEVT_->Fill(ievt_);
494  return;
495  }
496  for(HBHEDigiCollection::const_iterator digi=hbhe->begin();digi!=hbhe->end();digi++){
497  eta=digi->id().ieta(); phi=digi->id().iphi(); depth=digi->id().depth(); nTS=digi->size();
498  if(nTS>8) nTS=8;
499  if(nTS<8 && nTS>=4) nTS=4;
500  nTS_HBHE=nTS;
501  if(digi->id().subdet()==HcalBarrel){
502  for(int i=0;i<nTS;i++) hb_data[eta+42][phi-1][depth-1][digi->sample(i).capid()].add_statistics(digi->sample(i).adc());
503  }
504  if(digi->id().subdet()==HcalEndcap){
505  for(int i=0;i<nTS;i++) he_data[eta+42][phi-1][depth-1][digi->sample(i).capid()].add_statistics(digi->sample(i).adc());
506  }
507  }
508  }
510  iEvent.getByLabel(inputLabelDigi_,ho);
511  if(ho.isValid()){
512  for(HODigiCollection::const_iterator digi=ho->begin();digi!=ho->end();digi++){
513  eta=digi->id().ieta(); phi=digi->id().iphi(); depth=digi->id().depth(); nTS=digi->size();
514  if(nTS>8) nTS=8;
515  if(nTS<8 && nTS>=4) nTS=4;
516  nTS_HO=nTS;
517  for(int i=0;i<nTS;i++) ho_data[eta+42][phi-1][depth-1][digi->sample(i).capid()].add_statistics(digi->sample(i).adc());
518  }
519  }
521  iEvent.getByLabel(inputLabelDigi_,hf);
522  if(hf.isValid()){
523  for(HFDigiCollection::const_iterator digi=hf->begin();digi!=hf->end();digi++){
524  eta=digi->id().ieta(); phi=digi->id().iphi(); depth=digi->id().depth(); nTS=digi->size();
525  if(nTS>8) nTS=8;
526  if(nTS<8 && nTS>=4) nTS=4;
527  nTS_HF=nTS;
528  for(int i=0;i<nTS;i++) hf_data[eta+42][phi-1][depth-1][digi->sample(i).capid()].add_statistics(digi->sample(i).adc());
529  }
530  }
531 }
532 
547  Pedestals2DHO->Reset();
548  // HBHEHF summary map
549  for(int eta=-42;eta<=42;eta++) for(int phi=1;phi<=72;phi++){
550  double PED=0,RMS=0,nped=0,nrms=0,ave=0,rms=0;
551  for(int depth=1;depth<=3;depth++){
552  if(hb_data[eta+42][phi-1][depth-1][0].get_statistics()>100){
553  hb_data[eta+42][phi-1][depth-1][0].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
554  hb_data[eta+42][phi-1][depth-1][1].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
555  hb_data[eta+42][phi-1][depth-1][2].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
556  hb_data[eta+42][phi-1][depth-1][3].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
557  }
558  if(he_data[eta+42][phi-1][depth-1][0].get_statistics()>100){
559  he_data[eta+42][phi-1][depth-1][0].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
560  he_data[eta+42][phi-1][depth-1][1].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
561  he_data[eta+42][phi-1][depth-1][2].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
562  he_data[eta+42][phi-1][depth-1][3].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
563  }
564  if(hf_data[eta+42][phi-1][depth-1][0].get_statistics()>100){
565  hf_data[eta+42][phi-1][depth-1][0].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
566  hf_data[eta+42][phi-1][depth-1][1].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
567  hf_data[eta+42][phi-1][depth-1][2].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
568  hf_data[eta+42][phi-1][depth-1][3].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
569  }
570  }
571  if(nped>0) Pedestals2DHBHEHF->Fill(eta,phi,PED/nped);
572  if(nrms>0) Pedestals2DRmsHBHEHF->Fill(eta,phi,RMS/nrms);
573  if(nped>0 && abs(eta)>20) Pedestals2DHBHEHF->Fill(eta,phi+1,PED/nped);
574  if(nrms>0 && abs(eta)>20) Pedestals2DRmsHBHEHF->Fill(eta,phi+1,RMS/nrms);
575  }
576  // HO summary map
577  for(int eta=-10;eta<=15;eta++) for(int phi=1;phi<=72;phi++){
578  if(eta>10 && !isSiPM(eta,phi,4)) continue;
579  double PED=0,RMS=0,nped=0,nrms=0,ave=0,rms=0;
580  if(ho_data[eta+42][phi-1][4-1][0].get_statistics()>100){
581  ho_data[eta+42][phi-1][4-1][0].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
582  ho_data[eta+42][phi-1][4-1][1].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
583  ho_data[eta+42][phi-1][4-1][2].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
584  ho_data[eta+42][phi-1][4-1][3].get_average(&ave,&rms); PED+=ave; nped++; RMS+=rms; nrms++;
585  }
586  if(nped>0) Pedestals2DHO->Fill(eta,phi,PED/nped);
587  if(nrms>0) Pedestals2DRmsHO->Fill(eta,phi,RMS/nrms);
588  }
589  // HB histograms
590  for(int eta=-16;eta<=16;eta++) for(int phi=1;phi<=72;phi++) for(int depth=1;depth<=2;depth++){
591  if(hb_data[eta+42][phi-1][depth-1][0].get_statistics()>100){
592  double ave=0,rms=0,sum=0;
593  hb_data[eta+42][phi-1][depth-1][0].get_average(&ave,&rms); sum+=ave; PedestalsRmsHB->Fill(rms);
594  hb_data[eta+42][phi-1][depth-1][1].get_average(&ave,&rms); sum+=ave; PedestalsRmsHB->Fill(rms);
595  hb_data[eta+42][phi-1][depth-1][2].get_average(&ave,&rms); sum+=ave; PedestalsRmsHB->Fill(rms);
596  hb_data[eta+42][phi-1][depth-1][3].get_average(&ave,&rms); sum+=ave; PedestalsRmsHB->Fill(rms);
597  PedestalsAve4HB->Fill(sum/4.0);
598  }
599  }
600  // HE histograms
601  for(int eta=-29;eta<=29;eta++) for(int phi=1;phi<=72;phi++) for(int depth=1;depth<=3;depth++){
602  if(he_data[eta+42][phi-1][depth-1][0].get_statistics()>100){
603  double ave=0,rms=0,sum=0;
604  he_data[eta+42][phi-1][depth-1][0].get_average(&ave,&rms); sum+=ave; PedestalsRmsHE->Fill(rms);
605  he_data[eta+42][phi-1][depth-1][1].get_average(&ave,&rms); sum+=ave; PedestalsRmsHE->Fill(rms);
606  he_data[eta+42][phi-1][depth-1][2].get_average(&ave,&rms); sum+=ave; PedestalsRmsHE->Fill(rms);
607  he_data[eta+42][phi-1][depth-1][3].get_average(&ave,&rms); sum+=ave; PedestalsRmsHE->Fill(rms);
608  PedestalsAve4HE->Fill(sum/4.0);
609  }
610  }
611  // HO histograms
612  for(int eta=-10;eta<=15;eta++) for(int phi=1;phi<=72;phi++) for(int depth=4;depth<=4;depth++){
613  if(eta>10 && !isSiPM(eta,phi,4)) continue;
614  if(ho_data[eta+42][phi-1][depth-1][0].get_statistics()>100){
615  double ave=0,rms=0,sum=0;
616  if((eta>=11 && eta<=15 && phi>=59 && phi<=70) || (eta>=5 && eta<=10 && phi>=47 && phi<=58)){
617  ho_data[eta+42][phi-1][depth-1][0].get_average(&ave,&rms); sum+=ave; PedestalsRmsSimp->Fill(rms);
618  ho_data[eta+42][phi-1][depth-1][1].get_average(&ave,&rms); sum+=ave; PedestalsRmsSimp->Fill(rms);
619  ho_data[eta+42][phi-1][depth-1][2].get_average(&ave,&rms); sum+=ave; PedestalsRmsSimp->Fill(rms);
620  ho_data[eta+42][phi-1][depth-1][3].get_average(&ave,&rms); sum+=ave; PedestalsRmsSimp->Fill(rms);
621  PedestalsAve4Simp->Fill(sum/4.0);
622  }else{
623  ho_data[eta+42][phi-1][depth-1][0].get_average(&ave,&rms); sum+=ave; PedestalsRmsHO->Fill(rms);
624  ho_data[eta+42][phi-1][depth-1][1].get_average(&ave,&rms); sum+=ave; PedestalsRmsHO->Fill(rms);
625  ho_data[eta+42][phi-1][depth-1][2].get_average(&ave,&rms); sum+=ave; PedestalsRmsHO->Fill(rms);
626  ho_data[eta+42][phi-1][depth-1][3].get_average(&ave,&rms); sum+=ave; PedestalsRmsHO->Fill(rms);
627  PedestalsAve4HO->Fill(sum/4.0);
628  }
629  }
630  }
631  // HF histograms
632  for(int eta=-42;eta<=42;eta++) for(int phi=1;phi<=72;phi++) for(int depth=1;depth<=2;depth++){
633  if(hf_data[eta+42][phi-1][depth-1][0].get_statistics()>100){
634  double ave=0,rms=0,sum=0;
635  hf_data[eta+42][phi-1][depth-1][0].get_average(&ave,&rms); sum+=ave; PedestalsRmsHF->Fill(rms);
636  hf_data[eta+42][phi-1][depth-1][1].get_average(&ave,&rms); sum+=ave; PedestalsRmsHF->Fill(rms);
637  hf_data[eta+42][phi-1][depth-1][2].get_average(&ave,&rms); sum+=ave; PedestalsRmsHF->Fill(rms);
638  hf_data[eta+42][phi-1][depth-1][3].get_average(&ave,&rms); sum+=ave; PedestalsRmsHF->Fill(rms);
639  PedestalsAve4HF->Fill(sum/4.0);
640  }
641  }
642 }
644  for(int i=0;i<4;i++){
649  }
658 
661 
662  if(emap==0) return;
663 
664  std::vector <HcalElectronicsId> AllElIds = emap->allElectronicsIdPrecision();
665  for (std::vector <HcalElectronicsId>::iterator eid = AllElIds.begin(); eid != AllElIds.end(); eid++) {
666  DetId detid=emap->lookup(*eid);
667  if (detid.det()!=DetId::Hcal) continue;
668  HcalGenericDetId gid(emap->lookup(*eid));
669  if(!(!(gid.null()) &&
670  (gid.genericSubdet()==HcalGenericDetId::HcalGenBarrel ||
671  gid.genericSubdet()==HcalGenericDetId::HcalGenEndcap ||
672  gid.genericSubdet()==HcalGenericDetId::HcalGenForward ||
673  gid.genericSubdet()==HcalGenericDetId::HcalGenOuter))) continue;
674  int eta=0,phi=0,depth=0;
675 
676  HcalDetId hid(detid);
677  if(KnownBadCells_.find(hid.rawId())==KnownBadCells_.end()) continue;
678 
679  eta=hid.ieta();
680  phi=hid.iphi();
681  depth=hid.depth();
682  int sd=detid.subdetId();
683 
684  if(sd==HcalBarrel){
685  int ovf=hb_data[eta+42][phi-1][depth-1][0].get_overflow();
686  int stat=hb_data[eta+42][phi-1][depth-1][0].get_statistics()+ovf;
687  double status=0;
688  double ped[4],rms[4],ped_ref[4],rms_ref[4];
689  hb_data[eta+42][phi-1][depth-1][0].nChecks++;
690  if(stat==0){
691  status=1;
692  int e=CalcEtaBin(sd,eta,depth)+1;
693  hb_data[eta+42][phi-1][depth-1][0].nMissing++;
694  double val=hb_data[eta+42][phi-1][depth-1][0].nMissing/hb_data[eta+42][phi-1][depth-1][0].nChecks;
695  ProblemCellsByDepth_missing->depth[depth-1]->setBinContent(e,phi,val);
696  ProblemCellsByDepth_missing_val->depth[depth-1]->setBinContent(e,phi,1);
697  }
698  if(status) hb_data[eta+42][phi-1][depth-1][0].change_status(1);
699  if(stat>0 && stat!=(ievt_*2)){ if(nTS_HBHE==8) status=(double)stat/(double)(ievt_*2); else status=(double)stat/(double)(ievt_);
700  if(status<0.995){
701  int e=CalcEtaBin(sd,eta,depth)+1;
702  hb_data[eta+42][phi-1][depth-1][0].nUnstable++;
703  double val=hb_data[eta+42][phi-1][depth-1][0].nUnstable/hb_data[eta+42][phi-1][depth-1][0].nChecks;
704  ProblemCellsByDepth_unstable->depth[depth-1]->setBinContent(e,phi,val);
705  ProblemCellsByDepth_unstable_val->depth[depth-1]->setBinContent(e,phi,status);
706  hb_data[eta+42][phi-1][depth-1][0].change_status(2);
707  }
708  }
709  if(hb_data[eta+42][phi-1][depth-1][0].get_reference(&ped_ref[0],&rms_ref[0])
710  && hb_data[eta+42][phi-1][depth-1][0].get_average(&ped[0],&rms[0])){
711  hb_data[eta+42][phi-1][depth-1][1].get_reference(&ped_ref[1],&rms_ref[1]);
712  hb_data[eta+42][phi-1][depth-1][2].get_reference(&ped_ref[2],&rms_ref[2]);
713  hb_data[eta+42][phi-1][depth-1][3].get_reference(&ped_ref[3],&rms_ref[3]);
714  hb_data[eta+42][phi-1][depth-1][1].get_average(&ped[1],&rms[1]);
715  hb_data[eta+42][phi-1][depth-1][2].get_average(&ped[2],&rms[2]);
716  hb_data[eta+42][phi-1][depth-1][3].get_average(&ped[3],&rms[3]);
717  double ave=(ped[0]+ped[1]+ped[2]+ped[3])/4.0;
718  double ave_ref=(ped_ref[0]+ped_ref[1]+ped_ref[2]+ped_ref[3])/4.0;
719  double deltaPed=ave-ave_ref; PedestalsAve4HBref->Fill(deltaPed); if(deltaPed<0) deltaPed=-deltaPed;
720  double deltaRms=rms[0]-rms_ref[0]; PedestalsRmsHBref->Fill(deltaRms); if(deltaRms<0) deltaRms=-deltaRms;
721  for(int i=1;i<4;i++){
722  double tmp=rms[i]-rms_ref[i]; PedestalsRmsHBref->Fill(tmp);
723  if(fabs(tmp)>fabs(deltaRms)) deltaRms=tmp;
724  }
725  if(deltaPed>HBMeanTreshold){
726  int e=CalcEtaBin(sd,eta,depth)+1;
727  hb_data[eta+42][phi-1][depth-1][0].nBadPed++;
728  double val=hb_data[eta+42][phi-1][depth-1][0].nBadPed/hb_data[eta+42][phi-1][depth-1][0].nChecks;
729  ProblemCellsByDepth_badped_val->depth[depth-1]->setBinContent(e,phi,ave-ave_ref);
730  ProblemCellsByDepth_badped->depth[depth-1]->setBinContent(e,phi,val);
732  }
733  if(deltaRms>HBRmsTreshold){
734  int e=CalcEtaBin(sd,eta,depth)+1;
735  hb_data[eta+42][phi-1][depth-1][0].nBadRms++;
736  double val=hb_data[eta+42][phi-1][depth-1][0].nBadRms/hb_data[eta+42][phi-1][depth-1][0].nChecks;
737  ProblemCellsByDepth_badrms->depth[depth-1]->setBinContent(e,phi,val);
738  ProblemCellsByDepth_badrms_val->depth[depth-1]->setBinContent(e,phi,deltaRms);
740  }
741  }
742  }
743  if(sd==HcalEndcap){
744  int ovf=he_data[eta+42][phi-1][depth-1][0].get_overflow();
745  int stat=he_data[eta+42][phi-1][depth-1][0].get_statistics()+ovf;
746  double status=0;
747  double ped[4],rms[4],ped_ref[4],rms_ref[4];
748  he_data[eta+42][phi-1][depth-1][0].nChecks++;
749  if(stat==0){
750  status=1;
751  int e=CalcEtaBin(sd,eta,depth)+1;
752  he_data[eta+42][phi-1][depth-1][0].nMissing++;
753  double val=he_data[eta+42][phi-1][depth-1][0].nMissing/he_data[eta+42][phi-1][depth-1][0].nChecks;
754  ProblemCellsByDepth_missing->depth[depth-1]->setBinContent(e,phi,val);
755  ProblemCellsByDepth_missing_val->depth[depth-1]->setBinContent(e,phi,1);
756  }
757  if(status) he_data[eta+42][phi-1][depth-1][0].change_status(1);
758  if(stat>0 && stat!=(ievt_*2)){ if(nTS_HBHE==8) status=(double)stat/(double)(ievt_*2); else status=(double)stat/(double)(ievt_);
759  if(status<0.995){
760  int e=CalcEtaBin(sd,eta,depth)+1;
761  he_data[eta+42][phi-1][depth-1][0].nUnstable++;
762  double val=he_data[eta+42][phi-1][depth-1][0].nUnstable/he_data[eta+42][phi-1][depth-1][0].nChecks;
763  ProblemCellsByDepth_unstable->depth[depth-1]->setBinContent(e,phi,val);
764  ProblemCellsByDepth_unstable_val->depth[depth-1]->setBinContent(e,phi,status);
765  he_data[eta+42][phi-1][depth-1][0].change_status(2);
766  }
767  }
768  if(he_data[eta+42][phi-1][depth-1][0].get_reference(&ped_ref[0],&rms_ref[0])
769  && he_data[eta+42][phi-1][depth-1][0].get_average(&ped[0],&rms[0])){
770  he_data[eta+42][phi-1][depth-1][1].get_reference(&ped_ref[1],&rms_ref[1]);
771  he_data[eta+42][phi-1][depth-1][2].get_reference(&ped_ref[2],&rms_ref[2]);
772  he_data[eta+42][phi-1][depth-1][3].get_reference(&ped_ref[3],&rms_ref[3]);
773  he_data[eta+42][phi-1][depth-1][1].get_average(&ped[1],&rms[1]);
774  he_data[eta+42][phi-1][depth-1][2].get_average(&ped[2],&rms[2]);
775  he_data[eta+42][phi-1][depth-1][3].get_average(&ped[3],&rms[3]);
776  double ave=(ped[0]+ped[1]+ped[2]+ped[3])/4.0;
777  double ave_ref=(ped_ref[0]+ped_ref[1]+ped_ref[2]+ped_ref[3])/4.0;
778  double deltaPed=ave-ave_ref; PedestalsAve4HEref->Fill(deltaPed); if(deltaPed<0) deltaPed=-deltaPed;
779  double deltaRms=rms[0]-rms_ref[0]; PedestalsRmsHEref->Fill(deltaRms); if(deltaRms<0) deltaRms=-deltaRms;
780  for(int i=1;i<4;i++){
781  double tmp=rms[i]-rms_ref[i]; PedestalsRmsHEref->Fill(tmp);
782  if(fabs(tmp)>fabs(deltaRms)) deltaRms=tmp;
783  }
784  if(deltaPed>HEMeanTreshold){
785  int e=CalcEtaBin(sd,eta,depth)+1;
786  he_data[eta+42][phi-1][depth-1][0].nBadPed++;
787  double val=he_data[eta+42][phi-1][depth-1][0].nBadPed/he_data[eta+42][phi-1][depth-1][0].nChecks;
788  ProblemCellsByDepth_badped->depth[depth-1]->setBinContent(e,phi,val);
789  ProblemCellsByDepth_badped_val->depth[depth-1]->setBinContent(e,phi,ave-ave_ref);
791  }
792  if(deltaRms>HERmsTreshold){
793  int e=CalcEtaBin(sd,eta,depth)+1;
794  he_data[eta+42][phi-1][depth-1][0].nBadRms++;
795  double val=he_data[eta+42][phi-1][depth-1][0].nBadRms/he_data[eta+42][phi-1][depth-1][0].nChecks;
796  ProblemCellsByDepth_badrms->depth[depth-1]->setBinContent(e,phi,val);
797  ProblemCellsByDepth_badrms_val->depth[depth-1]->setBinContent(e,phi,deltaRms);
799  }
800  }
801  }
802  if(sd==HcalOuter){
803  int ovf=ho_data[eta+42][phi-1][depth-1][0].get_overflow();
804  int stat=ho_data[eta+42][phi-1][depth-1][0].get_statistics()+ovf;
805  double status=0;
806  double ped[4],rms[4],ped_ref[4],rms_ref[4];
807  ho_data[eta+42][phi-1][depth-1][0].nChecks++;
808  if(stat==0){
809  status=1;
810  int e=CalcEtaBin(sd,eta,depth)+1;
811  ho_data[eta+42][phi-1][depth-1][0].nMissing++;
812  double val=ho_data[eta+42][phi-1][depth-1][0].nMissing/ho_data[eta+42][phi-1][depth-1][0].nChecks;
813  ProblemCellsByDepth_missing->depth[depth-1]->setBinContent(e,phi,val);
814  ProblemCellsByDepth_missing_val->depth[depth-1]->setBinContent(e,phi,1);
815  }
816  if(status) ho_data[eta+42][phi-1][depth-1][0].change_status(1);
817  if(stat>0 && stat!=(ievt_*2)){ if(nTS_HO==8) status=(double)stat/(double)(ievt_*2); else status=(double)stat/(double)(ievt_);
818  if(status<0.995){
819  int e=CalcEtaBin(sd,eta,depth)+1;
820  ho_data[eta+42][phi-1][depth-1][0].nUnstable++;
821  double val=ho_data[eta+42][phi-1][depth-1][0].nUnstable/ho_data[eta+42][phi-1][depth-1][0].nChecks;
822  ProblemCellsByDepth_unstable->depth[depth-1]->setBinContent(e,phi,val);
823  ProblemCellsByDepth_unstable_val->depth[depth-1]->setBinContent(e,phi,status);
824  ho_data[eta+42][phi-1][depth-1][0].change_status(2);
825  }
826  }
827  if(ho_data[eta+42][phi-1][depth-1][0].get_reference(&ped_ref[0],&rms_ref[0])
828  && ho_data[eta+42][phi-1][depth-1][0].get_average(&ped[0],&rms[0])){
829  ho_data[eta+42][phi-1][depth-1][1].get_reference(&ped_ref[1],&rms_ref[1]);
830  ho_data[eta+42][phi-1][depth-1][2].get_reference(&ped_ref[2],&rms_ref[2]);
831  ho_data[eta+42][phi-1][depth-1][3].get_reference(&ped_ref[3],&rms_ref[3]);
832  ho_data[eta+42][phi-1][depth-1][1].get_average(&ped[1],&rms[1]);
833  ho_data[eta+42][phi-1][depth-1][2].get_average(&ped[2],&rms[2]);
834  ho_data[eta+42][phi-1][depth-1][3].get_average(&ped[3],&rms[3]);
835 
836  double THRESTHOLD=HORmsTreshold;
837  if((eta>=11 && eta<=15 && phi>=59 && phi<=70) || (eta>=5 && eta<=10 && phi>=47 && phi<=58))THRESTHOLD*=2;
838  double ave=(ped[0]+ped[1]+ped[2]+ped[3])/4.0;
839  double ave_ref=(ped_ref[0]+ped_ref[1]+ped_ref[2]+ped_ref[3])/4.0;
840  double deltaPed=ave-ave_ref; PedestalsAve4HOref->Fill(deltaPed);if(deltaPed<0) deltaPed=-deltaPed;
841  double deltaRms=rms[0]-rms_ref[0]; PedestalsRmsHOref->Fill(deltaRms); if(deltaRms<0) deltaRms=-deltaRms;
842  for(int i=1;i<4;i++){
843  double tmp=rms[i]-rms_ref[i]; PedestalsRmsHOref->Fill(tmp);
844  if(fabs(tmp)>fabs(deltaRms)) deltaRms=tmp;
845  }
846  if(deltaPed>HOMeanTreshold){
847  int e=CalcEtaBin(sd,eta,depth)+1;
848  ho_data[eta+42][phi-1][depth-1][0].nBadPed++;
849  double val=ho_data[eta+42][phi-1][depth-1][0].nBadPed/ho_data[eta+42][phi-1][depth-1][0].nChecks;
850  ProblemCellsByDepth_badped->depth[depth-1]->setBinContent(e,phi,val);
851  ProblemCellsByDepth_badped_val->depth[depth-1]->setBinContent(e,phi,ave-ave_ref);
852  Pedestals2DErrorHO->Fill(eta,phi,1);
853  }
854  if(deltaRms>THRESTHOLD){
855  int e=CalcEtaBin(sd,eta,depth)+1;
856  ho_data[eta+42][phi-1][depth-1][0].nBadRms++;
857  double val=ho_data[eta+42][phi-1][depth-1][0].nBadRms/ho_data[eta+42][phi-1][depth-1][0].nChecks;
858  ProblemCellsByDepth_badrms->depth[depth-1]->setBinContent(e,phi,val);
859  ProblemCellsByDepth_badrms_val->depth[depth-1]->setBinContent(e,phi,deltaRms);
860  Pedestals2DErrorHO->Fill(eta,phi,1);
861  }
862  }
863  }
864  if(sd==HcalForward){
865  int ovf=hf_data[eta+42][phi-1][depth-1][0].get_overflow();
866  int stat=hf_data[eta+42][phi-1][depth-1][0].get_statistics()+ovf;
867  double status=0;
868  double ped[4],rms[4],ped_ref[4],rms_ref[4];
869  hf_data[eta+42][phi-1][depth-1][0].nChecks++;
870  if(stat==0){
871  status=1;
872  int e=CalcEtaBin(sd,eta,depth)+1;
873  hf_data[eta+42][phi-1][depth-1][0].nMissing++;
874  double val=hf_data[eta+42][phi-1][depth-1][0].nMissing/hf_data[eta+42][phi-1][depth-1][0].nChecks;
875  ProblemCellsByDepth_missing->depth[depth-1]->setBinContent(e,phi,val);
876  ProblemCellsByDepth_missing_val->depth[depth-1]->setBinContent(e,phi,1);
877  }
878  if(status) hf_data[eta+42][phi-1][depth-1][0].change_status(1);
879  if(stat>0 && stat!=(ievt_*2)){ if(nTS_HF==8) status=(double)stat/(double)(ievt_*2); else status=(double)stat/(double)(ievt_);
880  if(status<0.995){
881  int e=CalcEtaBin(sd,eta,depth)+1;
882  hf_data[eta+42][phi-1][depth-1][0].nUnstable++;
883  double val=hf_data[eta+42][phi-1][depth-1][0].nUnstable/hf_data[eta+42][phi-1][depth-1][0].nChecks;
884  ProblemCellsByDepth_unstable->depth[depth-1]->setBinContent(e,phi,val);
885  ProblemCellsByDepth_unstable_val->depth[depth-1]->setBinContent(e,phi,status);
886  hf_data[eta+42][phi-1][depth-1][0].change_status(2);
887  }
888  }
889  if(hf_data[eta+42][phi-1][depth-1][0].get_reference(&ped_ref[0],&rms_ref[0])
890  && hf_data[eta+42][phi-1][depth-1][0].get_average(&ped[0],&rms[0])){
891  hf_data[eta+42][phi-1][depth-1][1].get_reference(&ped_ref[1],&rms_ref[1]);
892  hf_data[eta+42][phi-1][depth-1][2].get_reference(&ped_ref[2],&rms_ref[2]);
893  hf_data[eta+42][phi-1][depth-1][3].get_reference(&ped_ref[3],&rms_ref[3]);
894  hf_data[eta+42][phi-1][depth-1][1].get_average(&ped[1],&rms[1]);
895  hf_data[eta+42][phi-1][depth-1][2].get_average(&ped[2],&rms[2]);
896  hf_data[eta+42][phi-1][depth-1][3].get_average(&ped[3],&rms[3]);
897  double ave=(ped[0]+ped[1]+ped[2]+ped[3])/4.0;
898  double ave_ref=(ped_ref[0]+ped_ref[1]+ped_ref[2]+ped_ref[3])/4.0;
899  double deltaPed=ave-ave_ref; PedestalsAve4HFref->Fill(deltaPed); if(deltaPed<0) deltaPed=-deltaPed;
900  double deltaRms=rms[0]-rms_ref[0]; PedestalsRmsHFref->Fill(deltaRms); if(deltaRms<0) deltaRms=-deltaRms;
901  for(int i=1;i<4;i++){
902  double tmp=rms[i]-rms_ref[i]; PedestalsRmsHFref->Fill(tmp);
903  if(fabs(tmp)>fabs(deltaRms)) deltaRms=tmp;
904  }
905  if(deltaPed>HFMeanTreshold){
906  int e=CalcEtaBin(sd,eta,depth)+1;
907  hf_data[eta+42][phi-1][depth-1][0].nBadPed++;
908  double val=hf_data[eta+42][phi-1][depth-1][0].nBadPed/hf_data[eta+42][phi-1][depth-1][0].nChecks;
909  ProblemCellsByDepth_badped->depth[depth-1]->setBinContent(e,phi,val);
910  ProblemCellsByDepth_badped_val->depth[depth-1]->setBinContent(e,phi,ave-ave_ref);
912  }
913  if(deltaRms>HFRmsTreshold){
914  int e=CalcEtaBin(sd,eta,depth)+1;
915  hf_data[eta+42][phi-1][depth-1][0].nBadRms++;
916  double val=hf_data[eta+42][phi-1][depth-1][0].nBadRms/hf_data[eta+42][phi-1][depth-1][0].nChecks;
917  ProblemCellsByDepth_badrms->depth[depth-1]->setBinContent(e,phi,val);
918  ProblemCellsByDepth_badrms_val->depth[depth-1]->setBinContent(e,phi,deltaRms);
920  }
921  }
922  }
923  }
924 }
925 
927 
928  if((LocalRun || !Online_ || createHTMLonly) && ievt_>=100){
929  fillHistos();
930  CheckStatus();
931  SaveReference();
932  }
933 }
934 
936 double ped[4],rms[4];
937 int Eta,Phi,Depth,Statistic,Status=0;
938 char Subdet[10],str[500];
939  if(OutputFilePath.size()>0){
940  if(!Overwrite){
941  sprintf(str,"%sHcalDetDiagPedestalData_run%06i_%i.root",OutputFilePath.c_str(),run_number,dataset_seq_number);
942  }else{
943  sprintf(str,"%sHcalDetDiagPedestalData.root",OutputFilePath.c_str());
944  }
945  TFile *theFile = new TFile(str, "RECREATE");
946  if(!theFile->IsOpen()) return;
947  theFile->cd();
948  sprintf(str,"%d",run_number); TObjString run(str); run.Write("run number");
949  sprintf(str,"%d",ievt_); TObjString events(str); events.Write("Total events processed");
950  sprintf(str,"%d",dataset_seq_number); TObjString dsnum(str); dsnum.Write("Dataset number");
951  Long_t t; t=time(0); strftime(str,30,"%F %T",localtime(&t)); TObjString tm(str); tm.Write("Dataset creation time");
952 
953  TTree *tree =new TTree("HCAL Pedestal data","HCAL Pedestal data");
954  if(tree==0) return;
955  tree->Branch("Subdet", &Subdet, "Subdet/C");
956  tree->Branch("eta", &Eta, "Eta/I");
957  tree->Branch("phi", &Phi, "Phi/I");
958  tree->Branch("depth", &Depth, "Depth/I");
959  tree->Branch("statistic",&Statistic, "Statistic/I");
960  tree->Branch("status", &Status, "Status/I");
961  tree->Branch("cap0_ped", &ped[0], "cap0_ped/D");
962  tree->Branch("cap0_rms", &rms[0], "cap0_rms/D");
963  tree->Branch("cap1_ped", &ped[1], "cap1_ped/D");
964  tree->Branch("cap1_rms", &rms[1], "cap1_rms/D");
965  tree->Branch("cap2_ped", &ped[2], "cap2_ped/D");
966  tree->Branch("cap2_rms", &rms[2], "cap2_rms/D");
967  tree->Branch("cap3_ped", &ped[3], "cap3_ped/D");
968  tree->Branch("cap3_rms", &rms[3], "cap3_rms/D");
969  sprintf(Subdet,"HB");
970  for(int eta=-16;eta<=16;eta++) for(int phi=1;phi<=72;phi++) for(int depth=1;depth<=2;depth++){
971  if((Statistic=hb_data[eta+42][phi-1][depth-1][0].get_statistics())>100){
972  Eta=eta; Phi=phi; Depth=depth;
973  Status=hb_data[eta+42][phi-1][depth-1][0].get_status();
974  hb_data[eta+42][phi-1][depth-1][0].get_average(&ped[0],&rms[0]);
975  hb_data[eta+42][phi-1][depth-1][1].get_average(&ped[1],&rms[1]);
976  hb_data[eta+42][phi-1][depth-1][2].get_average(&ped[2],&rms[2]);
977  hb_data[eta+42][phi-1][depth-1][3].get_average(&ped[3],&rms[3]);
978  tree->Fill();
979  }
980  }
981  sprintf(Subdet,"HE");
982  for(int eta=-29;eta<=29;eta++) for(int phi=1;phi<=72;phi++) for(int depth=1;depth<=3;depth++){
983  if((Statistic=he_data[eta+42][phi-1][depth-1][0].get_statistics())>100){
984  Eta=eta; Phi=phi; Depth=depth;
985  Status=he_data[eta+42][phi-1][depth-1][0].get_status();
986  he_data[eta+42][phi-1][depth-1][0].get_average(&ped[0],&rms[0]);
987  he_data[eta+42][phi-1][depth-1][1].get_average(&ped[1],&rms[1]);
988  he_data[eta+42][phi-1][depth-1][2].get_average(&ped[2],&rms[2]);
989  he_data[eta+42][phi-1][depth-1][3].get_average(&ped[3],&rms[3]);
990  tree->Fill();
991  }
992  }
993  sprintf(Subdet,"HO");
994  for(int eta=-15;eta<=15;eta++) for(int phi=1;phi<=72;phi++) for(int depth=4;depth<=4;depth++){
995  if((Statistic=ho_data[eta+42][phi-1][depth-1][0].get_statistics())>100){
996  Eta=eta; Phi=phi; Depth=depth;
997  Status=ho_data[eta+42][phi-1][depth-1][0].get_status();
998  ho_data[eta+42][phi-1][depth-1][0].get_average(&ped[0],&rms[0]);
999  ho_data[eta+42][phi-1][depth-1][1].get_average(&ped[1],&rms[1]);
1000  ho_data[eta+42][phi-1][depth-1][2].get_average(&ped[2],&rms[2]);
1001  ho_data[eta+42][phi-1][depth-1][3].get_average(&ped[3],&rms[3]);
1002  tree->Fill();
1003  }
1004  }
1005  sprintf(Subdet,"HF");
1006  for(int eta=-42;eta<=42;eta++) for(int phi=1;phi<=72;phi++) for(int depth=1;depth<=2;depth++){
1007  if((Statistic=hf_data[eta+42][phi-1][depth-1][0].get_statistics())>100){
1008  Eta=eta; Phi=phi; Depth=depth;
1009  Status=hf_data[eta+42][phi-1][depth-1][0].get_status();
1010  hf_data[eta+42][phi-1][depth-1][0].get_average(&ped[0],&rms[0]);
1011  hf_data[eta+42][phi-1][depth-1][1].get_average(&ped[1],&rms[1]);
1012  hf_data[eta+42][phi-1][depth-1][2].get_average(&ped[2],&rms[2]);
1013  hf_data[eta+42][phi-1][depth-1][3].get_average(&ped[3],&rms[3]);
1014  tree->Fill();
1015  }
1016  }
1017  theFile->Write();
1018  theFile->Close();
1019  }
1020 
1021  if(XmlFilePath.size()>0){
1022  //create XML file
1023  if(!Overwrite){
1024  sprintf(str,"HcalDetDiagPedestals_%i_%i.xml",run_number,dataset_seq_number);
1025  }else{
1026  sprintf(str,"HcalDetDiagPedestals.xml");
1027  }
1028  printf("%s\n",str);
1029  std::string xmlName=str;
1030  ofstream xmlFile;
1031  xmlFile.open(xmlName.c_str());
1032 
1033  xmlFile<<"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n";
1034  xmlFile<<"<ROOT>\n";
1035  xmlFile<<" <HEADER>\n";
1036  xmlFile<<" <HINTS mode='only-det-root'/>\n";
1037  xmlFile<<" <TYPE>\n";
1038  xmlFile<<" <EXTENSION_TABLE_NAME>HCAL_DETMON_PEDESTALS_V1</EXTENSION_TABLE_NAME>\n";
1039  xmlFile<<" <NAME>HCAL Pedestals [abort gap global]</NAME>\n";
1040  xmlFile<<" </TYPE>\n";
1041  xmlFile<<" <!-- run details -->\n";
1042  xmlFile<<" <RUN>\n";
1043  xmlFile<<" <RUN_TYPE>GLOBAL-RUN</RUN_TYPE>\n";
1044  xmlFile<<" <RUN_NUMBER>"<<run_number<<"</RUN_NUMBER>\n";
1045  xmlFile<<" <RUN_BEGIN_TIMESTAMP>2009-01-01 00:00:00</RUN_BEGIN_TIMESTAMP>\n";
1046  xmlFile<<" <COMMENT_DESCRIPTION>hcal ped data</COMMENT_DESCRIPTION>\n";
1047  xmlFile<<" <LOCATION>P5</LOCATION>\n";
1048  xmlFile<<" <INITIATED_BY_USER>dma</INITIATED_BY_USER>\n";
1049  xmlFile<<" </RUN>\n";
1050  xmlFile<<" </HEADER>\n";
1051  xmlFile<<" <DATA_SET>\n";
1052  xmlFile<<" <!-- optional dataset metadata -->\n\n";
1053  xmlFile<<" <SET_NUMBER>"<<dataset_seq_number<<"</SET_NUMBER>\n";
1054  xmlFile<<" <SET_BEGIN_TIMESTAMP>2009-01-01 00:00:00</SET_BEGIN_TIMESTAMP>\n";
1055  xmlFile<<" <SET_END_TIMESTAMP>2009-01-01 00:00:00</SET_END_TIMESTAMP>\n";
1056  xmlFile<<" <NUMBER_OF_EVENTS_IN_SET>"<<ievt_<<"</NUMBER_OF_EVENTS_IN_SET>\n";
1057  xmlFile<<" <COMMENT_DESCRIPTION>Automatic DQM output</COMMENT_DESCRIPTION>\n";
1058  xmlFile<<" <DATA_FILE_NAME>"<< xmlName <<"</DATA_FILE_NAME>\n";
1059  xmlFile<<" <IMAGE_FILE_NAME>data plot url or file path</IMAGE_FILE_NAME>\n";
1060  xmlFile<<" <!-- who and when created this dataset-->\n\n";
1061  Long_t t; t=time(0); strftime(str,30,"%F %T",localtime(&t));
1062  xmlFile<<" <CREATE_TIMESTAMP>"<<str<<"</CREATE_TIMESTAMP>\n";
1063  xmlFile<<" <CREATED_BY_USER>dma</CREATED_BY_USER>\n";
1064  xmlFile<<" <!-- version (string) and subversion (number) -->\n";
1065  xmlFile<<" <!-- fields are used to read data back from the database -->\n\n";
1066  xmlFile<<" <VERSION>"<<run_number<<dataset_seq_number<<"</VERSION>\n";
1067  xmlFile<<" <SUBVERSION>1</SUBVERSION>\n";
1068  xmlFile<<" <!-- Assign predefined dataset attributes -->\n\n";
1069  xmlFile<<" <PREDEFINED_ATTRIBUTES>\n";
1070  xmlFile<<" <ATTRIBUTE>\n";
1071  xmlFile<<" <NAME>HCAL Dataset Status</NAME>\n";
1072  xmlFile<<" <VALUE>VALID</VALUE>\n";
1073  xmlFile<<" </ATTRIBUTE>\n";
1074  xmlFile<<" </PREDEFINED_ATTRIBUTES>\n";
1075  xmlFile<<" <!-- multiple data block records -->\n\n";
1076 
1077  std::vector <HcalElectronicsId> AllElIds = emap->allElectronicsIdPrecision();
1078  for(std::vector <HcalElectronicsId>::iterator eid = AllElIds.begin(); eid != AllElIds.end(); eid++){
1079  DetId detid=emap->lookup(*eid);
1080  if (detid.det()!=DetId::Hcal) continue;
1081  HcalGenericDetId gid(emap->lookup(*eid));
1082  if(!(!(gid.null()) &&
1083  (gid.genericSubdet()==HcalGenericDetId::HcalGenBarrel ||
1084  gid.genericSubdet()==HcalGenericDetId::HcalGenEndcap ||
1085  gid.genericSubdet()==HcalGenericDetId::HcalGenForward ||
1086  gid.genericSubdet()==HcalGenericDetId::HcalGenOuter))) continue;
1087  int eta,phi,depth;
1088  std::string subdet="";
1089  HcalDetId hid(detid);
1090  eta=hid.ieta();
1091  phi=hid.iphi();
1092  depth=hid.depth();
1093 
1094  double ped[4]={0,0,0,0},rms[4]={0,0,0,0};
1095  if(detid.subdetId()==HcalBarrel){
1096  subdet="HB";
1097  Statistic=hb_data[eta+42][phi-1][depth-1][0].get_statistics();
1098  Status =hb_data[eta+42][phi-1][depth-1][0].get_status();
1099  hb_data[eta+42][phi-1][depth-1][0].get_average(&ped[0],&rms[0]);
1100  hb_data[eta+42][phi-1][depth-1][1].get_average(&ped[1],&rms[1]);
1101  hb_data[eta+42][phi-1][depth-1][2].get_average(&ped[2],&rms[2]);
1102  hb_data[eta+42][phi-1][depth-1][3].get_average(&ped[3],&rms[3]);
1103  }else if(detid.subdetId()==HcalEndcap){
1104  subdet="HE";
1105  he_data[eta+42][phi-1][depth-1][0].get_average(&ped[0],&rms[0]);
1106  he_data[eta+42][phi-1][depth-1][1].get_average(&ped[1],&rms[1]);
1107  he_data[eta+42][phi-1][depth-1][2].get_average(&ped[2],&rms[2]);
1108  he_data[eta+42][phi-1][depth-1][3].get_average(&ped[3],&rms[3]);
1109  Statistic=he_data[eta+42][phi-1][depth-1][0].get_statistics();
1110  Status =he_data[eta+42][phi-1][depth-1][0].get_status();
1111  }else if(detid.subdetId()==HcalForward){
1112  subdet="HF";
1113  hf_data[eta+42][phi-1][depth-1][0].get_average(&ped[0],&rms[0]);
1114  hf_data[eta+42][phi-1][depth-1][1].get_average(&ped[1],&rms[1]);
1115  hf_data[eta+42][phi-1][depth-1][2].get_average(&ped[2],&rms[2]);
1116  hf_data[eta+42][phi-1][depth-1][3].get_average(&ped[3],&rms[3]);
1117  Statistic=hf_data[eta+42][phi-1][depth-1][0].get_statistics();
1118  Status =hf_data[eta+42][phi-1][depth-1][0].get_status();
1119  }else if(detid.subdetId()==HcalOuter){
1120  subdet="HO";
1121  ho_data[eta+42][phi-1][depth-1][0].get_average(&ped[0],&rms[0]);
1122  ho_data[eta+42][phi-1][depth-1][1].get_average(&ped[1],&rms[1]);
1123  ho_data[eta+42][phi-1][depth-1][2].get_average(&ped[2],&rms[2]);
1124  ho_data[eta+42][phi-1][depth-1][3].get_average(&ped[3],&rms[3]);
1125  Statistic=ho_data[eta+42][phi-1][depth-1][0].get_statistics();
1126  Status =ho_data[eta+42][phi-1][depth-1][0].get_status();
1127  }else continue;
1128  xmlFile<<" <DATA>\n";
1129  xmlFile<<" <NUMBER_OF_EVENTS_USED>"<<Statistic<<"</NUMBER_OF_EVENTS_USED>\n";
1130  xmlFile<<" <MEAN0>"<<ped[0]<<"</MEAN0>\n";
1131  xmlFile<<" <MEAN1>"<<ped[1]<<"</MEAN1>\n";
1132  xmlFile<<" <MEAN2>"<<ped[2]<<"</MEAN2>\n";
1133  xmlFile<<" <MEAN3>"<<ped[3]<<"</MEAN3>\n";
1134  xmlFile<<" <RMS0>"<<rms[0]<<"</RMS0>\n";
1135  xmlFile<<" <RMS1>"<<rms[1]<<"</RMS1>\n";
1136  xmlFile<<" <RMS2>"<<rms[2]<<"</RMS2>\n";
1137  xmlFile<<" <RMS3>"<<rms[3]<<"</RMS3>\n";
1138  xmlFile<<" <CHANNEL_STATUS_WORD>"<<Status<<"</CHANNEL_STATUS_WORD>\n";
1139  xmlFile<<" <CHANNEL_OBJECTNAME>HcalDetId</CHANNEL_OBJECTNAME>\n";
1140  xmlFile<<" <SUBDET>"<<subdet<<"</SUBDET>\n";
1141  xmlFile<<" <IETA>"<<eta<<"</IETA>\n";
1142  xmlFile<<" <IPHI>"<<phi<<"</IPHI>\n";
1143  xmlFile<<" <DEPTH>"<<depth<<"</DEPTH>\n";
1144  xmlFile<<" <TYPE>0</TYPE>\n";
1145  xmlFile<<" </DATA>\n";
1146  }
1148  xmlFile<<" </DATA_SET>\n";
1149  xmlFile<<"</ROOT>\n";
1150  xmlFile.close();
1151  sprintf(str,"zip %s.zip %s",xmlName.c_str(),xmlName.c_str());
1152  system(str);
1153  sprintf(str,"rm -f %s",xmlName.c_str());
1154  system(str);
1155  sprintf(str,"mv -f %s.zip %s",xmlName.c_str(),XmlFilePath.c_str());
1156  system(str);
1157  }
1159 }
1160 
1162  double ped[4],rms[4];
1163  int Eta,Phi,Depth;
1164  char subdet[10];
1165  TFile *f;
1166  if(gSystem->AccessPathName(ReferenceData.c_str())) return;
1167  f = new TFile(ReferenceData.c_str(),"READ");
1168  if(!f->IsOpen()) return ;
1169  TObjString *STR=(TObjString *)f->Get("run number");
1170 
1171  if(STR){ std::string Ref(STR->String()); ReferenceRun=Ref;}
1172 
1173  TTree* t=(TTree*)f->Get("HCAL Pedestal data");
1174  if(!t) return;
1175  t->SetBranchAddress("Subdet", subdet);
1176  t->SetBranchAddress("eta", &Eta);
1177  t->SetBranchAddress("phi", &Phi);
1178  t->SetBranchAddress("depth", &Depth);
1179  t->SetBranchAddress("cap0_ped", &ped[0]);
1180  t->SetBranchAddress("cap0_rms", &rms[0]);
1181  t->SetBranchAddress("cap1_ped", &ped[1]);
1182  t->SetBranchAddress("cap1_rms", &rms[1]);
1183  t->SetBranchAddress("cap2_ped", &ped[2]);
1184  t->SetBranchAddress("cap2_rms", &rms[2]);
1185  t->SetBranchAddress("cap3_ped", &ped[3]);
1186  t->SetBranchAddress("cap3_rms", &rms[3]);
1187  for(int ievt=0;ievt<t->GetEntries();ievt++){
1188  t->GetEntry(ievt);
1189  if(strcmp(subdet,"HB")==0){
1190  hb_data[Eta+42][Phi-1][Depth-1][0].set_reference(ped[0],rms[0]);
1191  hb_data[Eta+42][Phi-1][Depth-1][1].set_reference(ped[1],rms[1]);
1192  hb_data[Eta+42][Phi-1][Depth-1][2].set_reference(ped[2],rms[2]);
1193  hb_data[Eta+42][Phi-1][Depth-1][3].set_reference(ped[3],rms[3]);
1194  }
1195  if(strcmp(subdet,"HE")==0){
1196  he_data[Eta+42][Phi-1][Depth-1][0].set_reference(ped[0],rms[0]);
1197  he_data[Eta+42][Phi-1][Depth-1][1].set_reference(ped[1],rms[1]);
1198  he_data[Eta+42][Phi-1][Depth-1][2].set_reference(ped[2],rms[2]);
1199  he_data[Eta+42][Phi-1][Depth-1][3].set_reference(ped[3],rms[3]);
1200  }
1201  if(strcmp(subdet,"HO")==0){
1202  ho_data[Eta+42][Phi-1][Depth-1][0].set_reference(ped[0],rms[0]);
1203  ho_data[Eta+42][Phi-1][Depth-1][1].set_reference(ped[1],rms[1]);
1204  ho_data[Eta+42][Phi-1][Depth-1][2].set_reference(ped[2],rms[2]);
1205  ho_data[Eta+42][Phi-1][Depth-1][3].set_reference(ped[3],rms[3]);
1206  }
1207  if(strcmp(subdet,"HF")==0){
1208  hf_data[Eta+42][Phi-1][Depth-1][0].set_reference(ped[0],rms[0]);
1209  hf_data[Eta+42][Phi-1][Depth-1][1].set_reference(ped[1],rms[1]);
1210  hf_data[Eta+42][Phi-1][Depth-1][2].set_reference(ped[2],rms[2]);
1211  hf_data[Eta+42][Phi-1][Depth-1][3].set_reference(ped[3],rms[3]);
1212  }
1213  }
1214  f->Close();
1215  IsReference=true;
1216 }
1217 
1219  double ped[4],rms[4];
1220  int Eta,Phi,Depth,Statistic;
1221  char subdet[10];
1222  TFile *f;
1223  if(DatasetName.size()==0) return;
1224  createHTMLonly=true;
1225  if(gSystem->AccessPathName(DatasetName.c_str())) return;
1226  f = new TFile(DatasetName.c_str(),"READ");
1227  if(!f->IsOpen()) return ;
1228 
1229  TTree* t=0;
1230  t=(TTree*)f->Get("HCAL Pedestal data");
1231  if(!t) return;
1232  t->SetBranchAddress("Subdet", subdet);
1233  t->SetBranchAddress("eta", &Eta);
1234  t->SetBranchAddress("phi", &Phi);
1235  t->SetBranchAddress("depth", &Depth);
1236  t->SetBranchAddress("cap0_ped", &ped[0]);
1237  t->SetBranchAddress("cap0_rms", &rms[0]);
1238  t->SetBranchAddress("cap1_ped", &ped[1]);
1239  t->SetBranchAddress("cap1_rms", &rms[1]);
1240  t->SetBranchAddress("cap2_ped", &ped[2]);
1241  t->SetBranchAddress("cap2_rms", &rms[2]);
1242  t->SetBranchAddress("cap3_ped", &ped[3]);
1243  t->SetBranchAddress("cap3_rms", &rms[3]);
1244  t->SetBranchAddress("statistic",&Statistic);
1245 
1246  for(int ievt=0;ievt<t->GetEntries();ievt++){
1247  t->GetEntry(ievt);
1248  if(strcmp(subdet,"HB")==0){ nHB++;
1249  hb_data[Eta+42][Phi-1][Depth-1][0].set_data(ped[0],rms[0]);
1250  hb_data[Eta+42][Phi-1][Depth-1][1].set_data(ped[1],rms[1]);
1251  hb_data[Eta+42][Phi-1][Depth-1][2].set_data(ped[2],rms[2]);
1252  hb_data[Eta+42][Phi-1][Depth-1][3].set_data(ped[3],rms[3]);
1253  hb_data[Eta+42][Phi-1][Depth-1][0].set_statistics(Statistic);
1254  hb_data[Eta+42][Phi-1][Depth-1][1].set_statistics(Statistic);
1255  hb_data[Eta+42][Phi-1][Depth-1][2].set_statistics(Statistic);
1256  hb_data[Eta+42][Phi-1][Depth-1][3].set_statistics(Statistic);
1257  }
1258  if(strcmp(subdet,"HE")==0){ nHE++;
1259  he_data[Eta+42][Phi-1][Depth-1][0].set_data(ped[0],rms[0]);
1260  he_data[Eta+42][Phi-1][Depth-1][1].set_data(ped[1],rms[1]);
1261  he_data[Eta+42][Phi-1][Depth-1][2].set_data(ped[2],rms[2]);
1262  he_data[Eta+42][Phi-1][Depth-1][3].set_data(ped[3],rms[3]);
1263  he_data[Eta+42][Phi-1][Depth-1][0].set_statistics(Statistic);
1264  he_data[Eta+42][Phi-1][Depth-1][1].set_statistics(Statistic);
1265  he_data[Eta+42][Phi-1][Depth-1][2].set_statistics(Statistic);
1266  he_data[Eta+42][Phi-1][Depth-1][3].set_statistics(Statistic);
1267  }
1268  if(strcmp(subdet,"HO")==0){ nHO++;
1269  ho_data[Eta+42][Phi-1][Depth-1][0].set_data(ped[0],rms[0]);
1270  ho_data[Eta+42][Phi-1][Depth-1][1].set_data(ped[1],rms[1]);
1271  ho_data[Eta+42][Phi-1][Depth-1][2].set_data(ped[2],rms[2]);
1272  ho_data[Eta+42][Phi-1][Depth-1][3].set_data(ped[3],rms[3]);
1273  ho_data[Eta+42][Phi-1][Depth-1][0].set_statistics(Statistic);
1274  ho_data[Eta+42][Phi-1][Depth-1][1].set_statistics(Statistic);
1275  ho_data[Eta+42][Phi-1][Depth-1][2].set_statistics(Statistic);
1276  ho_data[Eta+42][Phi-1][Depth-1][3].set_statistics(Statistic);
1277  }
1278  if(strcmp(subdet,"HF")==0){ nHF++;
1279  hf_data[Eta+42][Phi-1][Depth-1][0].set_data(ped[0],rms[0]);
1280  hf_data[Eta+42][Phi-1][Depth-1][1].set_data(ped[1],rms[1]);
1281  hf_data[Eta+42][Phi-1][Depth-1][2].set_data(ped[2],rms[2]);
1282  hf_data[Eta+42][Phi-1][Depth-1][3].set_data(ped[3],rms[3]);
1283  hf_data[Eta+42][Phi-1][Depth-1][0].set_statistics(Statistic);
1284  hf_data[Eta+42][Phi-1][Depth-1][1].set_statistics(Statistic);
1285  hf_data[Eta+42][Phi-1][Depth-1][2].set_statistics(Statistic);
1286  hf_data[Eta+42][Phi-1][Depth-1][3].set_statistics(Statistic);
1287  }
1288  }
1289  TObjString *STR1=(TObjString *)f->Get("run number");
1290  if(STR1){ int run; sscanf(STR1->String(),"%i",&run); meRUN_->Fill(run); run_number=run;}
1291 
1292  TObjString *STR2=(TObjString *)f->Get("Total events processed");
1293  if(STR2){ int events; sscanf(STR2->String(),"%i",&events); meEVT_->Fill(events); ievt_=events;}
1294 
1295  TObjString *STR3=(TObjString *)f->Get("Dataset number");
1296  if(STR3){ int ds; sscanf(STR3->String(),"%i",&ds); dataset_seq_number=ds;}
1297 
1298  f->Close();
1299 }
1302 
1303 //define this as a plug-in
RunNumber_t run() const
Definition: EventID.h:42
T getUntrackedParameter(std::string const &, T const &) const
int i
Definition: DBlmapReader.cc:9
std::vector< HcalElectronicsId > allElectronicsIdPrecision() const
void beginRun(const edm::Run &run, const edm::EventSetup &c)
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:722
void setAxisRange(double xmin, double xmax, int axis=1)
set x-, y- or z-axis range (axis=1, 2, 3 respectively)
std::vector< std::string > problemnames_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
HcalDetDiagPedestalData ho_data[85][72][4][4]
tuple calibType
Definition: diJetCalib.py:20
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
HcalDetDiagPedestalData he_data[85][72][4][4]
bool get_average(double *ave, double *rms)
const Item * getValues(DetId fId, bool throwOnFail=true) const
std::map< unsigned int, int > KnownBadCells_
T eta() const
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:49
void Fill(long long x)
void analyze(const edm::Event &, const edm::EventSetup &)
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
bool get_reference(double *val, double *rms)
bool isSiPM(int ieta, int iphi, int depth)
int depth() const
get the tower depth
Definition: HcalDetId.h:42
int iEvent
Definition: GenABIO.cc:243
std::vector< MonitorElement * > depth
const T & max(const T &a, const T &b)
MonitorElement * bookString(const char *name, const char *value)
Book string.
Definition: DQMStore.cc:688
std::vector< DetId > getAllChannels() const
T sqrt(T t)
Definition: SSEVec.h:48
HcalDetDiagPedestalData hb_data[85][72][4][4]
HcalDetDiagPedestalMonitor(const edm::ParameterSet &)
int ieta() const
get the cell ieta
Definition: HcalDetId.h:38
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
int j
Definition: DBlmapReader.cc:9
double f[11][100]
int orbitNumber() const
Definition: EventBase.h:63
void add_statistics(unsigned int val)
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
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
int k[5][pyjets_maxn]
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
T const * product() const
Definition: ESHandle.h:62
virtual void reset(void)
bool xmlFile(const std::string fParam)
int CalcEtaBin(int subdet, int ieta, int depth)
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
edm::EventID id() const
Definition: EventBase.h:56
void set_reference(float val, float rms)
tuple events
Definition: patZpeak.py:19
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:29
const JetExtendedData & getValue(const Container &, const reco::JetBaseRef &)
get value for the association. Throw exception if no association found
void endRun(const edm::Run &run, const edm::EventSetup &c)
dictionary rawdata
Definition: lumiPlot.py:393
tuple status
Definition: ntuplemaker.py:245
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:629
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:850
virtual void setup(void)
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
void set_data(float val, float rms)
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
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:434
Definition: Run.h:36
HcalDetDiagPedestalData hf_data[85][72][4][4]
Definition: DDAxes.h:10