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