CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
HcalDetDiagLaserMonitor.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: HcalDetDiagLaserMonitor
4 // Class: HcalDetDiagLaserMonitor
5 //
13 //
14 // Original Author: Dmitry Vishnevskiy,591 R-013,+41227674265,
15 // Created: Wed Mar 3 12:14:16 CET 2010
16 // $Id: HcalDetDiagLaserMonitor.cc,v 1.20 2011/11/14 13:29:05 apresyan Exp $
17 //
18 //
19 
25 
29 
32 
33 #include <math.h>
34 
35 // this is to retrieve HCAL digi's
37 // to retrive trigger information (local runs only)
39 
42 
49 
50 #include "TFile.h"
51 #include "TTree.h"
52 #include "TSystem.h"
53 #include "TF1.h"
54 
57 
58 #include <iostream>
59 #include <fstream>
60 
62 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,
63  13.5,15.,17.,19.,21.,23.,25.,27.,29.5,32.5,35.5,38.5,42.,46.,50.,54.5,59.5,
64  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,
65  124.5,129.5,137.,147.,157.,167.,177.,187.,197.,209.5,224.5,239.5,254.5,272.,
66  292.,312.,334.5,359.5,384.5,359.5,384.5,409.5,434.5,459.5,484.5,509.5,534.5,
67  559.5,584.5,609.5,634.5,659.5,684.5,709.5,747.,797.,847.,897.,947.,997.,
68  1047.,1109.5,1184.5,1259.5,1334.5,1422.,1522.,1622.,1734.5,1859.5,1984.5,
69  1859.5,1984.5,2109.5,2234.5,2359.5,2484.5,2609.5,2734.5,2859.5,2984.5,
70  3109.5,3234.5,3359.5,3484.5,3609.5,3797.,4047.,4297.,4547.,4797.,5047.,
71  5297.,5609.5,5984.5,6359.5,6734.5,7172.,7672.,8172.,8734.5,9359.5,9984.5};
73 typedef struct{
74 int eta;
75 int phi;
76 int depth;
77 }Raddam_ch;
78 
79 Raddam_ch RADDAM_CH[56]={{-30,35,1},{-30,71,1},{-32,15,1},{-32,51,1},{-34,35,1},{-34,71,1},{-36,15,1},
80  {-36,51,1},{-38,35,1},{-38,71,1},{-40,15,1},{-40,51,1},{-41,35,1},{-41,71,1},
81  {30,21,1}, {30,57,1}, {32,1,1}, {32,37,1}, {34,21,1}, {34,57,1}, {36,1,1 },
82  {36,37,1}, {38,21,1}, {38,57,1}, {40,35,1}, {40,71,1}, {41,19,1}, {41,55,1 },
83  {-30,15,2},{-30,51,2},{-32,35,2},{-32,71,2},{-34,15,2},{-34,51,2},{-36,35,2},
84  {-36,71,2},{-38,15,2},{-38,51,2},{-40,35,2},{-40,71,2},{-41,15,2},{-41,51,2},
85  {30,1,2}, {30,37,2}, {32,21,2}, {32,57,2}, {34,1,2}, {34,37,2}, {36,21,2 },
86  {36,57,2}, {38,1,2}, {38,37,2}, {40,19,2}, {40,55,2}, {41,35,2}, {41,71,2}};
88  public:
90  for(int i=0;i<128;i++) s1_adc[i]=s2_adc[i]=0;
94  }
96  int TOTEVNT;
97  int CUT1EVNT;
98  int CUT2EVNT;
99  float S1MEAN,S2MEAN;
100  float S1RMS,S2RMS;
104  float S1CHI2,S2CHI2;
105  float S1NDF,S2NDF;
107  int s1_adc[128];
108  int s2_adc[128];
109 };
110 
112 
114 public:
116  IsRefetence=false;
119  status=0;
120  reset();
121  reset1();
122  }
123  void reset(){
124  Xe=XXe=Xt=XXt=n=0;
125  overflow=0;
126  undeflow=0;
127  }
128  void reset1(){
129  Xe1=XXe1=Xt1=XXt1=n1=0;
130  overflow1=0;
131  undeflow1=0;
132  }
133  void add_statistics(double *data,int nTS){
134  double e=GetEnergy(data,nTS);
135  double t=GetTime(data,nTS);
136  if(e<20){ undeflow++;undeflow1++; }else if(e>10000){ overflow++;overflow1++; }else{
137  n++; Xe+=e; XXe+=e*e; Xt+=t; XXt+=t*t;
138  n1++; Xe1+=e; XXe1+=e*e; Xt1+=t; XXt1+=t*t;
139  }
140  }
141  void set_reference(float val,float rms,float time,float time_rms){
142  ref_amp=val; ref_rms=rms;
143  ref_time=time; ref_time_rms=time_rms;
144  IsRefetence=true;
145  }
146  void set_data(float val,float rms,float time,float time_rms){
147  ds_amp=val; ds_rms=rms;
148  ds_time=time; ds_time_rms=time_rms;
149  }
150  void change_status(int val){
151  status|=val;
152  }
153  int get_status(){
154  return status;
155  }
156  bool get_reference(double *val,double *rms,double *time,double *time_rms){
157  *val=ref_amp; *rms=ref_rms;
158  *time=ref_time; *time_rms=ref_time_rms;
159  return IsRefetence;
160  }
161  bool get_average_amp(double *ave,double *rms){
162  if(ds_time>-10){ *ave=ds_amp; *rms=ds_rms; return true; }
163  if(n>0){ *ave=Xe/n; *rms=sqrt(XXe/n-(Xe*Xe)/(n*n));} else return false;
164  return true;
165  }
166  bool get_average_time(double *ave,double *rms){
167  if(ds_time>-10){ *ave=ds_time; *rms=ds_time_rms; return true; }
168  if(n>0){ *ave=Xt/n; *rms=sqrt(XXt/n-(Xt*Xt)/(n*n));} else return false;
169  return true;
170  }
172  return (int)n;
173  }
174  void set_statistics(int stat){
175  n=stat;
176  }
177  void set_statistics1(int stat){
178  n1=stat;
179  }
181  return overflow;
182  }
184  return undeflow;
185  }
186  bool get_average_amp1(double *ave,double *rms){
187  if(ds_time>-10){ *ave=ds_amp; *rms=ds_rms; return true; }
188  if(n1>0){ *ave=Xe1/n1; *rms=sqrt(XXe1/n1-(Xe1*Xe1)/(n1*n1));} else return false;
189  return true;
190  }
191  bool get_average_time1(double *ave,double *rms){
192  if(ds_time>-10){ *ave=ds_time; *rms=ds_time_rms; return true; }
193  if(n1>0){ *ave=Xt1/n1; *rms=sqrt(XXt1/n1-(Xt1*Xt1)/(n1*n1));} else return false;
194  return true;
195  }
197  return (int)n1;
198  }
200  return overflow1;
201  }
203  return undeflow1;
204  }
205  double GetEnergy(double *data,int n){
206  int MaxI=0; double Energy,MaxE=0;
207  for(int j=0;j<n;++j) if(MaxE<data[j]){ MaxE=data[j]; MaxI=j; }
208  Energy=data[MaxI];
209  if(MaxI>0) Energy+=data[MaxI-1];
210  if(MaxI>1) Energy+=data[MaxI-2];
211  if(MaxI<(n-1)) Energy+=data[MaxI+1];
212  if(MaxI<(n-2)) Energy+=data[MaxI+2];
213  return Energy;
214  }
215  double GetTime(double *data,int n=10){
216  int MaxI=-100; double Time=-9999,SumT=0,MaxT=-10;
217  for(int j=0;j<n;++j) if(MaxT<data[j]){ MaxT=data[j]; MaxI=j; }
218  if (MaxI>=0) // dummy protection so that compiler doesn't think MaxI=-100
219  {
220  Time=MaxI*data[MaxI];
221  SumT=data[MaxI];
222  if(MaxI>0){ Time+=(MaxI-1)*data[MaxI-1]; SumT+=data[MaxI-1]; }
223  if(MaxI<(n-1)){ Time+=(MaxI+1)*data[MaxI+1]; SumT+=data[MaxI+1]; }
224  Time=Time/SumT;
225  }
226  return Time;
227  }
228  int overflow;
229  int undeflow;
232  double Xe,XXe,Xt,XXt,n;
233  double Xe1,XXe1,Xt1,XXt1,n1;
235  float ref_amp;
236  float ref_rms;
237  float ref_time;
239  float ds_amp;
240  float ds_rms;
241  float ds_time;
242  float ds_time_rms;
243  int status;
245 };
246 
248  public:
251 
252  private:
253  HcalDetDiagLaserData* GetCalib(std::string sd,int eta,int phi){
254  int SD=0,ETA=0,PHI=0;
255  if(sd.compare("HB")==0) SD=1;
256  if(sd.compare("HE")==0) SD=2;
257  if(sd.compare("HO")==0) SD=3;
258  if(sd.compare("HF")==0) SD=4;
259  if(SD==1 || SD==2){
260  if(eta>0) ETA=1; else ETA=-1;
261  if(phi==71 ||phi==72 || phi==1 || phi==2) PHI=71; else PHI=((phi-3)/4)*4+3;
262  }else if(SD==3){
263  if(abs(eta)<=4){
264  ETA=0;
265  if(phi==71 ||phi==72 || phi==1 || phi==2 || phi==3 || phi==4) PHI=71; else PHI=((phi-5)/6)*6+5;
266  }else{
267  if(abs(eta)>4 && abs(eta)<=10) ETA=1;
268  if(abs(eta)>10 && abs(eta)<=15) ETA=2;
269  if(eta<0) ETA=-ETA;
270  if(phi==71 ||phi==72 || (phi>=1 && phi<=10)) PHI=71; else PHI=((phi-11)/12)*12+11;
271  }
272  }else if(SD==4){
273  if(eta>0) ETA=1; else ETA=-1;
274  if(phi>=1 && phi<=18) PHI=1;
275  if(phi>=19 && phi<=36) PHI=19;
276  if(phi>=37 && phi<=54) PHI=37;
277  if(phi>=55 && phi<=72) PHI=55;
278  }
279  return &calib_data[SD][ETA+2][PHI-1];
280  };
281  void beginRun(const edm::Run& run, const edm::EventSetup& c);
282  void endRun(const edm::Run& run, const edm::EventSetup& c);
283  void beginLuminosityBlock(const edm::LuminosityBlock& lumiSeg,const edm::EventSetup& c) ;
284  void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg,const edm::EventSetup& c);
285  void analyze(const edm::Event&, const edm::EventSetup&);
286 
291 
292  void SaveReference();
293  void SaveRaddamData();
294  void LoadReference();
295  void LoadDataset();
296 
297  bool get_ave_rbx(int sd,int side,int rbx,float *ave,float *rms);
298  bool get_ave_subdet(int sd,float *ave_t,float *ave_e,float *ave_t_r,float *ave_e_r);
299  void fillHistos(int sd);
300  void fillProblems(int sd);
303 
304  int ievt_;
309  int nHB,nHE,nHO,nHF;
310  std::string ReferenceData;
311  std::string ReferenceRun;
312  std::string OutputFilePath;
313  std::string XmlFilePath;
314  std::string baseFolder_;
315  std::string prefixME_;
316  bool Online_;
317  bool Overwrite;
318 
319  // to create html from processed dataset
320  std::string DatasetName;
321  std::string htmlOutputPath;
323 
338 
347 
352 
354  TH1F *S1[56],*S2[56];
355 
358  std::vector<std::string> problemnames_;
359 
362 
368 
369  std::map<unsigned int, int> KnownBadCells_;
370 };
371 
373  ievt_=-1;
374  emap=0;
376  run_number=-1;
377  IsReference=false;
378  LocalRun=RaddamRun=false;
379  createHTMLonly=false;
380  nHB=nHE=nHO=nHF=0;
382 
383  inputLabelDigi_ = iConfig.getUntrackedParameter<edm::InputTag>("digiLabel",edm::InputTag("hcalDigis"));
384  calibDigiLabel_ = iConfig.getUntrackedParameter<edm::InputTag>("calibDigiLabel",edm::InputTag("hcalDigis"));
385  rawDataLabel_ = iConfig.getUntrackedParameter<edm::InputTag>("RawDataLabel",edm::InputTag("source"));
386 
387  ReferenceData = iConfig.getUntrackedParameter<std::string>("LaserReferenceData" ,"");
388  OutputFilePath = iConfig.getUntrackedParameter<std::string>("OutputFilePath", "");
389  DatasetName = iConfig.getUntrackedParameter<std::string>("LaserDatasetName", "");
390  htmlOutputPath = iConfig.getUntrackedParameter<std::string>("htmlOutputPath", "");
391  XmlFilePath = iConfig.getUntrackedParameter<std::string>("XmlFilePath", "");
392  Online_ = iConfig.getUntrackedParameter<bool> ("online",false);
393  Overwrite = iConfig.getUntrackedParameter<bool> ("Overwrite",true);
394  prefixME_ = iConfig.getUntrackedParameter<std::string>("subSystemFolder","Hcal/");
395  if (prefixME_.size()>0 && prefixME_.substr(prefixME_.size()-1,prefixME_.size())!="/")
396  prefixME_.append("/");
397  subdir_ = iConfig.getUntrackedParameter<std::string>("TaskFolder","DetDiagPedestalMonitor_Hcal/");
398  if (subdir_.size()>0 && subdir_.substr(subdir_.size()-1,subdir_.size())!="/")
399  subdir_.append("/");
400  subdir_=prefixME_+subdir_;
401  debug_ = iConfig.getUntrackedParameter<int>("debug",0);
402 
403  LaserTimingThreshold = iConfig.getUntrackedParameter<double>("LaserTimingThreshold",0.2);
404  LaserEnergyThreshold = iConfig.getUntrackedParameter<double>("LaserEnergyThreshold",0.1);
405  RaddamThreshold1 = iConfig.getUntrackedParameter<double>("RaddamThreshold1",10.0);
406  RaddamThreshold2 = iConfig.getUntrackedParameter<double>("RaddamThreshold2",0.95);
407 }
410  c.get<HcalChannelQualityRcd>().get(p);
411  HcalChannelQuality* chanquality= new HcalChannelQuality(*p.product());
412  std::vector<DetId> mydetids = chanquality->getAllChannels();
413  KnownBadCells_.clear();
414 
415  for (std::vector<DetId>::const_iterator i = mydetids.begin();i!=mydetids.end();++i){
416  if (i->det()!=DetId::Hcal) continue; // not an hcal cell
417  HcalDetId id=HcalDetId(*i);
418  int status=(chanquality->getValues(id))->getValue();
420  KnownBadCells_[id.rawId()]=status;
421  }
422  }
423 
424  edm::ESHandle<HcalDbService> conditions_;
425  c.get<HcalDbRecord>().get(conditions_);
426  emap=conditions_->getHcalMapping();
427 
429  if (!dbe_) return;
430  std::string name;
431 
433  meEVT_ = dbe_->bookInt("HcalDetDiagLaserMonitor Event Number");
434  meRUN_ = dbe_->bookInt("HcalDetDiagLaserMonitor Run Number");
435 
436  ReferenceRun="UNKNOWN";
437  LoadReference();
438  LoadDataset();
439  if(DatasetName.size()>0 && createHTMLonly){
440  char str[200]; sprintf(str,"%sHcalDetDiagLaserData_run%i_%i/",htmlOutputPath.c_str(),run_number,dataset_seq_number);
441  htmlFolder=dbe_->bookString("HcalDetDiagLaserMonitor HTML folder",str);
442  MonitorElement *me;
443  dbe_->setCurrentFolder(prefixME_+"HcalInfo");
444  me=dbe_->bookInt("HBpresent");
445  if(nHB>0) me->Fill(1);
446  me=dbe_->bookInt("HEpresent");
447  if(nHE>0) me->Fill(1);
448  me=dbe_->bookInt("HOpresent");
449  if(nHO>0) me->Fill(1);
450  me=dbe_->bookInt("HFpresent");
451  if(nHF>0) me->Fill(1);
452  }
454  ProblemCellsByDepth_timing->setup(dbe_," Problem Bad Laser Timing");
455  for(unsigned int i=0;i<ProblemCellsByDepth_timing->depth.size();i++)
456  problemnames_.push_back(ProblemCellsByDepth_timing->depth[i]->getName());
458  ProblemCellsByDepth_energy->setup(dbe_," Problem Bad Laser Energy");
459  for(unsigned int i=0;i<ProblemCellsByDepth_energy->depth.size();i++)
460  problemnames_.push_back(ProblemCellsByDepth_energy->depth[i]->getName());
461 
462  dbe_->setCurrentFolder(subdir_+"Summary Plots");
463 
464  name="HBHE Laser Energy Distribution"; hbheEnergy = dbe_->book1D(name,name,200,0,3000);
465  name="HBHE Laser Timing Distribution"; hbheTime = dbe_->book1D(name,name,200,0,10);
466  name="HBHE Laser Energy RMS_div_Energy Distribution"; hbheEnergyRMS = dbe_->book1D(name,name,200,0,0.5);
467  name="HBHE Laser Timing RMS Distribution"; hbheTimeRMS = dbe_->book1D(name,name,200,0,1);
468  name="HO Laser Energy Distribution"; hoEnergy = dbe_->book1D(name,name,200,0,3000);
469  name="HO Laser Timing Distribution"; hoTime = dbe_->book1D(name,name,200,0,10);
470  name="HO Laser Energy RMS_div_Energy Distribution"; hoEnergyRMS = dbe_->book1D(name,name,200,0,0.5);
471  name="HO Laser Timing RMS Distribution"; hoTimeRMS = dbe_->book1D(name,name,200,0,1);
472  name="HF Laser Energy Distribution"; hfEnergy = dbe_->book1D(name,name,200,0,3000);
473  name="HF Laser Timing Distribution"; hfTime = dbe_->book1D(name,name,200,0,10);
474  name="HF Laser Energy RMS_div_Energy Distribution"; hfEnergyRMS = dbe_->book1D(name,name,200,0,0.7);
475  name="HF Laser Timing RMS Distribution"; hfTimeRMS = dbe_->book1D(name,name,200,0,1);
476 
477  name="Laser Timing HBHEHF"; Time2Dhbhehf = dbe_->book2D(name,name,87,-43,43,74,0,73);
478  name="Laser Timing HO"; Time2Dho = dbe_->book2D(name,name,33,-16,16,74,0,73);
479  name="Laser Energy HBHEHF"; Energy2Dhbhehf = dbe_->book2D(name,name,87,-43,43,74,0,73);
480  name="Laser Energy HO"; Energy2Dho = dbe_->book2D(name,name,33,-16,16,74,0,73);
481  name="HBHEHF Laser (Timing-Ref)+1"; refTime2Dhbhehf = dbe_->book2D(name,name,87,-43,43,74,0,73);
482  name="HO Laser (Timing-Ref)+1"; refTime2Dho = dbe_->book2D(name,name,33,-16,16,74,0,73);
483  name="HBHEHF Laser Energy_div_Ref"; refEnergy2Dhbhehf = dbe_->book2D(name,name,87,-43,43,74,0,73);
484  name="HO Laser Energy_div_Ref"; refEnergy2Dho = dbe_->book2D(name,name,33,-16,16,74,0,73);
485 
486  name="HB RBX average Time-Ref"; hb_time_rbx = dbe_->book1D(name,name,36,0.5,36.5);
487  name="HE RBX average Time-Ref"; he_time_rbx = dbe_->book1D(name,name,36,0.5,36.5);
488  name="HO RBX average Time-Ref"; ho_time_rbx = dbe_->book1D(name,name,36,0.5,36.5);
489  name="HF RoBox average Time-Ref"; hf_time_rbx = dbe_->book1D(name,name,24,0.5,24.5);
490 
491  char str[200];
492  for(int i=1;i<=18;i++){ sprintf(str,"HBM%02i",i); hb_time_rbx->setBinLabel(i,str); }
493  for(int i=1;i<=18;i++){ sprintf(str,"HBP%02i",i); hb_time_rbx->setBinLabel(i+18,str); }
494  for(int i=1;i<=18;i++){ sprintf(str,"HEM%02i",i); he_time_rbx->setBinLabel(i,str); }
495  for(int i=1;i<=18;i++){ sprintf(str,"HEP%02i",i); he_time_rbx->setBinLabel(i+18,str); }
496  for(int i=1;i<=12;i++){ sprintf(str,"HFM%02i",i); hf_time_rbx->setBinLabel(i,str); }
497  for(int i=1;i<=12;i++){ sprintf(str,"HFP%02i",i); hf_time_rbx->setBinLabel(i+12,str); }
498  for(int i=1;i<=6;i++){ sprintf(str,"HO2M%02i",i*2); ho_time_rbx->setBinLabel(i,str); }
499  for(int i=1;i<=6;i++){ sprintf(str,"HO1M%02i",i*2); ho_time_rbx->setBinLabel(i+6,str); }
500  for(int i=1;i<=12;i++){ sprintf(str,"HO0%02i",i); ho_time_rbx->setBinLabel(i+12,str); }
501  for(int i=1;i<=6;i++){ sprintf(str,"HO1P%02i",i*2); ho_time_rbx->setBinLabel(i+24,str); }
502  for(int i=1;i<=6;i++){ sprintf(str,"HO2P%02i",i*2); ho_time_rbx->setBinLabel(i+30,str); }
503 
504  Time2Dhbhehf->setAxisTitle("i#eta",1);
505  Time2Dhbhehf->setAxisTitle("i#phi",2);
506  Time2Dho->setAxisTitle("i#eta",1);
507  Time2Dho->setAxisTitle("i#phi",2);
508  Energy2Dhbhehf->setAxisTitle("i#eta",1);
509  Energy2Dhbhehf->setAxisTitle("i#phi",2);
510  Energy2Dho->setAxisTitle("i#eta",1);
511  Energy2Dho->setAxisTitle("i#phi",2);
512  refTime2Dhbhehf->setAxisTitle("i#eta",1);
513  refTime2Dhbhehf->setAxisTitle("i#phi",2);
514  refTime2Dho->setAxisTitle("i#eta",1);
515  refTime2Dho->setAxisTitle("i#phi",2);
516  refEnergy2Dhbhehf->setAxisTitle("i#eta",1);
517  refEnergy2Dhbhehf->setAxisTitle("i#phi",2);
518  refEnergy2Dho->setAxisTitle("i#eta",1);
519  refEnergy2Dho->setAxisTitle("i#phi",2);
520 
522  refTime2Dho->setAxisRange(0,2,3);
523  refEnergy2Dhbhehf->setAxisRange(0.5,1.5,3);
524  refEnergy2Dho->setAxisRange(0.5,1.5,3);
525 
527  RefRun_= dbe_->bookString("HcalDetDiagLaserMonitor Reference Run",ReferenceRun);
528 
529  dbe_->setCurrentFolder(subdir_+"Raddam Plots");
530  for(int i=0;i<56;i++){
531  sprintf(str,"RADDAM (%i %i)",RADDAM_CH[i].eta,RADDAM_CH[i].phi);
532  Raddam[i] = dbe_->book1D(str,str,10,-0.5,9.5);
533  }
534 
535  dbe_->setCurrentFolder(subdir_+"Plots for client");
537  ProblemCellsByDepth_timing_val->setup(dbe_," Laser Timing difference");
539  ProblemCellsByDepth_energy_val->setup(dbe_," Laser Energy difference");
540 }
541 
542 
544 
545 }
546 
547 // ------------ method called to for each event ------------
549  if(createHTMLonly) return;
550  HcalBaseDQMonitor::analyze(iEvent,iSetup); // base class increments ievt_, etc. counters
551 
552 int eta,phi,depth,nTS;
553 static bool HBHEseq,HOseq,HFseq;
554 static int lastHBHEorbit,lastHOorbit,lastHForbit,nChecksHBHE,nChecksHO,nChecksHF,ievt_hbhe,ievt_ho,ievt_hf;
555  if(ievt_==-1){
556  ievt_=0;HBHEseq=HOseq=HFseq=false; lastHBHEorbit=lastHOorbit=lastHForbit=-1;nChecksHBHE=nChecksHO=nChecksHF=0;
557  ievt_hbhe=0,ievt_ho=0,ievt_hf=0;
558  }
559 
560  if(!dbe_) return;
561  bool LaserEvent=false;
562  bool LaserRaddam=false;
563  int orbit=iEvent.orbitNumber();
564  meRUN_->Fill(iEvent.id().run());
565  // for local runs
566  edm::Handle<HcalTBTriggerData> trigger_data;
567  iEvent.getByType(trigger_data);
568  if(trigger_data.isValid()){
569  if(trigger_data->wasLaserTrigger()) LaserEvent=true;
570  LocalRun=true;
571  }
572  if(!LocalRun && Online_){
573  if(HBHEseq && (orbit-lastHBHEorbit)>(11223*10) && ievt_hbhe>40){
574  HBHEseq=false;
578  nChecksHBHE++;
579  ievt_hbhe=0;
580  for(int i=0;i<85;i++)for(int j=0;j<72;j++)for(int k=0;k<4;k++) hb_data[i][j][k].reset();
581  for(int i=0;i<85;i++)for(int j=0;j<72;j++)for(int k=0;k<4;k++) he_data[i][j][k].reset();
582  }
583  if(HOseq && (orbit-lastHOorbit)>(11223*10) && ievt_ho>40){
584  HOseq=false;
587  nChecksHO++;
588  ievt_ho=0;
589  for(int i=0;i<85;i++)for(int j=0;j<72;j++)for(int k=0;k<4;k++) ho_data[i][j][k].reset();
590  }
591  if(HFseq && (orbit-lastHForbit)>(11223*10) && ievt_hf>40){
592  HFseq=false;
595  nChecksHF++;
596  ievt_hf=0;
597  if(nChecksHF==1 || (nChecksHF>1 && ((nChecksHF-1)%12)==0)){
598  SaveReference();
599  }
600  for(int i=0;i<85;i++)for(int j=0;j<72;j++)for(int k=0;k<4;k++) hf_data[i][j][k].reset();
601  }
602  }
603 
604  // Abort Gap laser
605  if(LocalRun==false || LaserEvent==false){
607  iEvent.getByLabel(rawDataLabel_ ,rawdata);
608  // edm::Handle<FEDRawDataCollection> rawdata;
609  // iEvent.getByType(rawdata);
610  //checking FEDs for calibration information
612  const FEDRawData& fedData = rawdata->FEDData(i) ;
613  if ( fedData.size() < 24 ) continue ;
614  int value = ((const HcalDCCHeader*)(fedData.data()))->getCalibType() ;
615  if(value==hc_HBHEHPD){ HBHEseq=true; HOseq=HFseq=false; lastHBHEorbit=orbit; ievt_hbhe++; }
616  if(value==hc_HOHPD){ HOseq=true; HBHEseq=HFseq=false; lastHOorbit=orbit; ievt_ho++; }
617  if(value==hc_HFPMT){ HFseq=true; HBHEseq=HOseq=false; lastHForbit=orbit; ievt_hf++; }
618 
619  if(value==hc_HBHEHPD || value==hc_HOHPD || value==hc_HFPMT){ LaserEvent=true; break;}
620  if(value==hc_RADDAM){ LaserEvent=true; LaserRaddam=true; break;}
621  }
622  }
623  if(!LaserEvent) return;
625  iEvent.getByLabel(inputLabelDigi_,hbhe);
627  iEvent.getByLabel(inputLabelDigi_,ho);
629  iEvent.getByLabel(inputLabelDigi_,hf);
631  iEvent.getByLabel(calibDigiLabel_, calib);
632 
633  if(LocalRun && LaserEvent){
634  int N=0;
635  if(hf.isValid()){
636  for(HFDigiCollection::const_iterator digi=hf->begin();digi!=hf->end();digi++){
637  eta=digi->id().ieta(); phi=digi->id().iphi(); depth=digi->id().depth();
638  float e=0;
639  for(int i=0;i<digi->size();i++) e+=adc2fC[digi->sample(i).adc()&0xff]-2.5;
640  if(e>40){ N++;}
641  }
642  }
643  if(N>50 && N<57){ RaddamRun=true; /*LaserRaddam=true;*/}
644  }
645  if(RaddamRun){
646  if(hf.isValid()){
647  for(HFDigiCollection::const_iterator digi=hf->begin();digi!=hf->end();digi++){
648  eta=digi->id().ieta(); phi=digi->id().iphi(); depth=digi->id().depth(); nTS=digi->size();
649  int N;
650  for(N=0;N<56;N++)if(eta==RADDAM_CH[N].eta && phi==RADDAM_CH[N].phi && depth==RADDAM_CH[N].depth) break;
651  if(N==56) continue;
652  float max1=0,max2=0;
653  int nmax1=0,nmax2=0;
654  for(int i=0;i<nTS;i++){
655  if(max1<adc2fC[digi->sample(i).adc()&0xff]){ nmax1=i; max1=adc2fC[digi->sample(i).adc()&0xff]; }
656  }
657  Raddam_data[N].TOTEVNT++;
658  for(int i=0;i<nTS;i++){
659  if(i==nmax1) continue;
660  if(max2<adc2fC[digi->sample(i).adc()&0xff]){ nmax2=i; max2=adc2fC[digi->sample(i).adc()&0xff]; }
661  }
662  if(nmax1>nmax2){
663  int tmp1=nmax2;
664  nmax2=nmax1;nmax1=tmp1;
665  }
666  if(nmax1==0 || nmax2==(nTS-1)) continue;
667  if(nmax2!=(nmax1+1)) continue;
668 
669  if(max1<RaddamThreshold1 || max2<RaddamThreshold1) continue;
670  Raddam_data[N].CUT1EVNT++;
671  max1-=2.5; max2-=2.5;
672  float S2=max1+max2;
673  float S4=S2+adc2fC[digi->sample(nmax1-1).adc()&0xff]+adc2fC[digi->sample(nmax2+1).adc()&0xff]-5.0;
674  if((S2/S4)<RaddamThreshold2) continue;
675  Raddam_data[N].CUT2EVNT++;
676  Raddam_data[N].s1_adc[digi->sample(nmax1).adc()&0xff]++;
677  Raddam_data[N].s2_adc[digi->sample(nmax2).adc()&0xff]++;
678  }
679  }
680  }
681 
682  meEVT_->Fill(++ievt_);
683  run_number=iEvent.id().run();
684  double data[20];
685  if(!LaserRaddam){
686  if(hbhe.isValid()){
687  for(HBHEDigiCollection::const_iterator digi=hbhe->begin();digi!=hbhe->end();digi++){
688  eta=digi->id().ieta(); phi=digi->id().iphi(); depth=digi->id().depth(); nTS=digi->size();
689  double ped=(adc2fC[digi->sample(0).adc()&0xff]+adc2fC[digi->sample(1).adc()&0xff])/2.0;
690  if(digi->id().subdet()==HcalBarrel){
691  for(int i=0;i<nTS;i++) data[i]=adc2fC[digi->sample(i).adc()&0xff]-ped;
692  hb_data[eta+42][phi-1][depth-1].add_statistics(data,nTS);
693  }
694  if(digi->id().subdet()==HcalEndcap){
695  for(int i=0;i<nTS;i++) data[i]=adc2fC[digi->sample(i).adc()&0xff]-ped;
696  he_data[eta+42][phi-1][depth-1].add_statistics(data,nTS);
697  }
698  }
699  }
700  if(ho.isValid()){
701  for(HODigiCollection::const_iterator digi=ho->begin();digi!=ho->end();digi++){
702  eta=digi->id().ieta(); phi=digi->id().iphi(); depth=digi->id().depth(); nTS=digi->size();
703  double ped=(adc2fC[digi->sample(0).adc()&0xff]+adc2fC[digi->sample(1).adc()&0xff])/2.0;
704  if((eta>=11 && eta<=15 && phi>=59 && phi<=70) || (eta>=5 && eta<=10 && phi>=47 && phi<=58)){
705  for(int i=0;i<nTS;i++) data[i]=adc2fC[digi->sample(i).adc()&0xff]-ped;
706  }else{
707  for(int i=0;i<nTS;i++) data[i]=adc2fC[digi->sample(i).adc()&0xff]-ped;
708  }
709  ho_data[eta+42][phi-1][depth-1].add_statistics(data,nTS);
710  }
711  }
712  if(hf.isValid()){
713  for(HFDigiCollection::const_iterator digi=hf->begin();digi!=hf->end();digi++){
714  eta=digi->id().ieta(); phi=digi->id().iphi(); depth=digi->id().depth(); nTS=digi->size();
715  double ped=adc2fC[digi->sample(0).adc()&0xff];
716  for(int i=0;i<nTS;i++) data[i]=adc2fC[digi->sample(i).adc()&0xff]-ped;
717  hf_data[eta+42][phi-1][depth-1].add_statistics(data,nTS);
718  }
719  }
720  if(calib.isValid())for(HcalCalibDigiCollection::const_iterator digi=calib->begin();digi!=calib->end();digi++){
721  if(digi->id().cboxChannel()!=0 || digi->id().hcalSubdet()==0) continue;
722  nTS=digi->size();
723  float e=0;
724  for(int i=0;i<nTS;i++){ data[i]=adc2fC[digi->sample(i).adc()&0xff]; e+=data[i];}
725  if(e<15000) calib_data[digi->id().hcalSubdet()][digi->id().ieta()+2][digi->id().iphi()-1].add_statistics(data,nTS);
726  }
727  }else{ //Raddam
728  if(hf.isValid()){
729  for(HFDigiCollection::const_iterator digi=hf->begin();digi!=hf->end();digi++){
730  eta=digi->id().ieta(); phi=digi->id().iphi(); depth=digi->id().depth(); nTS=digi->size();
731  int N;
732  for(N=0;N<56;N++)if(eta==RADDAM_CH[N].eta && phi==RADDAM_CH[N].phi && depth==RADDAM_CH[N].depth) break;
733  if(N==56) continue;
734  for(int i=0;i<nTS;i++) Raddam[N]->Fill(i,adc2fC[digi->sample(i).adc()&0xff]-2.5);
735 
736  }
737  }
738  }
739 }
740 bool HcalDetDiagLaserMonitor::get_ave_subdet(int sd,float *ave_t,float *ave_e,float *ave_t_r,float *ave_e_r){
741 double T=0,nT=0,E=0,nE=0,Tr=0,nTr=0,Er=0,nEr=0;
742  if(sd==HcalBarrel) for(int eta=-16;eta<=16;eta++) for(int phi=1;phi<=72;phi++){
743  for(int depth=1;depth<=2;depth++){
744  if(hb_data[eta+42][phi-1][depth-1].get_statistics()>10){
745  double ave=0,rms=0,time=0,time_rms=0;
746  hb_data[eta+42][phi-1][depth-1].get_average_amp(&ave,&rms);
747  hb_data[eta+42][phi-1][depth-1].get_average_time(&time,&time_rms);
748  T+=time; nT++; E+=ave; nE++;
749  if(hb_data[eta+42][phi-1][depth-1].get_reference(&ave,&rms,&time,&time_rms)){
750  Tr+=time; nTr++; Er+=ave; nEr++;}
751  }
752  }
753  }
754  // HE histograms
755  if(sd==HcalEndcap) for(int eta=-29;eta<=29;eta++) for(int phi=1;phi<=72;phi++){
756  for(int depth=1;depth<=3;depth++){
757  if(he_data[eta+42][phi-1][depth-1].get_statistics()>10){
758  double ave=0; double rms=0; double time=0; double time_rms=0;
759  he_data[eta+42][phi-1][depth-1].get_average_amp(&ave,&rms);
760  he_data[eta+42][phi-1][depth-1].get_average_time(&time,&time_rms);
761  T+=time; nT++; E+=ave; nE++;
762  if(he_data[eta+42][phi-1][depth-1].get_reference(&ave,&rms,&time,&time_rms)){
763  Tr+=time; nTr++; Er+=ave; nEr++;}
764  }
765  }
766  }
767  // HF histograms
768  if(sd==HcalForward) for(int eta=-42;eta<=42;eta++) for(int phi=1;phi<=72;phi++){
769  for(int depth=1;depth<=2;depth++){
770  if(hf_data[eta+42][phi-1][depth-1].get_statistics()>10){
771  double ave=0; double rms=0; double time=0; double time_rms=0;
772  hf_data[eta+42][phi-1][depth-1].get_average_amp(&ave,&rms);
773  hf_data[eta+42][phi-1][depth-1].get_average_time(&time,&time_rms);
774  T+=time; nT++; E+=ave; nE++;
775  if(hf_data[eta+42][phi-1][depth-1].get_reference(&ave,&rms,&time,&time_rms)){
776  Tr+=time; nTr++; Er+=ave; nEr++;}
777  }
778  }
779  }
780  // HO histograms
781  if(sd==HcalOuter) for(int eta=-15;eta<=15;eta++) for(int phi=1;phi<=72;phi++){
782  for(int depth=4;depth<=4;depth++){
783  if(ho_data[eta+42][phi-1][depth-1].get_statistics()>10){
784  double ave=0; double rms=0; double time=0; double time_rms=0;
785  ho_data[eta+42][phi-1][depth-1].get_average_amp(&ave,&rms);
786  ho_data[eta+42][phi-1][depth-1].get_average_time(&time,&time_rms);
787  T+=time; nT++; E+=ave; nE++;
788  if(ho_data[eta+42][phi-1][depth-1].get_reference(&ave,&rms,&time,&time_rms)){
789  Tr+=time; nTr++; Er+=ave; nEr++;}
790  }
791  }
792  }
793  if(nT<200 || nE<200 || nTr<200 || nEr<200) return false;
794  *ave_t=T/nT;
795  *ave_e=E/nE;
796  *ave_t_r=Tr/nTr;
797  *ave_e_r=Er/nEr;
798  return true;
799 }
800 
802 float ave_t,ave_e,ave_t_r,ave_e_r;
803  if(!get_ave_subdet(sd,&ave_t,&ave_e,&ave_t_r,&ave_e_r)) return;
804 
805  for(int i=0;i<4;i++){
808  }
809 
810  std::vector <HcalElectronicsId> AllElIds = emap->allElectronicsIdPrecision();
811  for (std::vector <HcalElectronicsId>::iterator eid = AllElIds.begin(); eid != AllElIds.end(); eid++){
812  DetId detid=emap->lookup(*eid);
813  if (detid.det()!=DetId::Hcal) continue;
814  HcalGenericDetId gid(emap->lookup(*eid));
815  if(!(!(gid.null()) &&
816  (gid.genericSubdet()==HcalGenericDetId::HcalGenBarrel ||
817  gid.genericSubdet()==HcalGenericDetId::HcalGenEndcap ||
818  gid.genericSubdet()==HcalGenericDetId::HcalGenForward ||
819  gid.genericSubdet()==HcalGenericDetId::HcalGenOuter))) continue;
820  int eta=0,phi=0,depth=0;
821  HcalDetId hid(detid);
822  if(KnownBadCells_.find(hid.rawId())==KnownBadCells_.end()) continue;
823  eta=hid.ieta();
824  phi=hid.iphi();
825  depth=hid.depth();
826 
827  int e=CalcEtaBin(sd,eta,depth)+1;
828  if(detid.subdetId()==HcalBarrel && sd==HcalBarrel){
829  double val=0,rms=0,time=0,time_rms=0,VAL=0,RMS=0,TIME=0,TIME_RMS=0;
830  if(!hb_data[eta+42][phi-1][depth-1].get_reference(&val,&rms,&time,&time_rms)) continue;
831  if(!hb_data[eta+42][phi-1][depth-1].get_average_amp(&VAL,&RMS)) continue;
832  if(!hb_data[eta+42][phi-1][depth-1].get_average_time(&TIME,&TIME_RMS)) continue;
833  hb_data[eta+42][phi-1][depth-1].nChecks++;
834  float diff_t=(TIME-ave_t)-(time-ave_t_r); if(diff_t<0) diff_t=-diff_t;
835  if(diff_t>LaserTimingThreshold){
836  hb_data[eta+42][phi-1][depth-1].nBadTime++;
837  ProblemCellsByDepth_timing_val->depth[depth-1]->setBinContent(e,phi,(TIME-ave_t)-(time-ave_t_r));
838  }else ProblemCellsByDepth_timing_val->depth[depth-1]->setBinContent(e,phi,0);
839  if(VAL!=0 && val!=0 && ave_e!=0 && ave_e_r!=0){
840  float diff_e=((VAL/ave_e))/(val/ave_e_r);
841  if(diff_e>(1+LaserEnergyThreshold) ||diff_e<(1-LaserEnergyThreshold) ){
842  hb_data[eta+42][phi-1][depth-1].nBadEnergy++;
843  ProblemCellsByDepth_energy_val->depth[depth-1]->setBinContent(e,phi,((VAL/ave_e))/(val/ave_e_r));
844  }else ProblemCellsByDepth_energy_val->depth[depth-1]->setBinContent(e,phi,0);
845  }
846  }
847  if(detid.subdetId()==HcalEndcap && sd==HcalEndcap){
848  double val=0,rms=0,time=0,time_rms=0,VAL=0,RMS=0,TIME=0,TIME_RMS=0;
849  if(!he_data[eta+42][phi-1][depth-1].get_reference(&val,&rms,&time,&time_rms)) continue;
850  if(!he_data[eta+42][phi-1][depth-1].get_average_amp(&VAL,&RMS)) continue;
851  if(!he_data[eta+42][phi-1][depth-1].get_average_time(&TIME,&TIME_RMS)) continue;
852  he_data[eta+42][phi-1][depth-1].nChecks++;
853  float diff_t=(TIME-ave_t)-(time-ave_t_r); if(diff_t<0) diff_t=-diff_t;
854  if(diff_t>LaserTimingThreshold){
855  he_data[eta+42][phi-1][depth-1].nBadTime++;
856  ProblemCellsByDepth_timing_val->depth[depth-1]->setBinContent(e,phi,(TIME-ave_t)-(time-ave_t_r));
857  }else ProblemCellsByDepth_timing_val->depth[depth-1]->setBinContent(e,phi,0);
858  if(VAL!=0 && val!=0 && ave_e!=0 && ave_e_r!=0){
859  float diff_e=((VAL/ave_e))/(val/ave_e_r);
860  if(diff_e>(1+LaserEnergyThreshold) ||diff_e<(1-LaserEnergyThreshold) ){
861  he_data[eta+42][phi-1][depth-1].nBadEnergy++;
862  ProblemCellsByDepth_energy_val->depth[depth-1]->setBinContent(e,phi,((VAL/ave_e))/(val/ave_e_r));
863  }else ProblemCellsByDepth_energy_val->depth[depth-1]->setBinContent(e,phi,0);
864  }
865  }
866  if(detid.subdetId()==HcalOuter && sd==HcalOuter){
867  double val=0,rms=0,time=0,time_rms=0,VAL=0,RMS=0,TIME=0,TIME_RMS=0;
868  if(!ho_data[eta+42][phi-1][depth-1].get_reference(&val,&rms,&time,&time_rms)) continue;
869  if(!ho_data[eta+42][phi-1][depth-1].get_average_amp(&VAL,&RMS)) continue;
870  if(!ho_data[eta+42][phi-1][depth-1].get_average_time(&TIME,&TIME_RMS)) continue;
871  ho_data[eta+42][phi-1][depth-1].nChecks++;
872  float diff_t=(TIME-ave_t)-(time-ave_t_r); if(diff_t<0) diff_t=-diff_t;
873  if(diff_t>LaserTimingThreshold){
874  ho_data[eta+42][phi-1][depth-1].nBadTime++;
875  ProblemCellsByDepth_timing_val->depth[depth-1]->setBinContent(e,phi,(TIME-ave_t)-(time-ave_t_r));
876  }else ProblemCellsByDepth_timing_val->depth[depth-1]->setBinContent(e,phi,0);
877  if(VAL!=0 && val!=0 && ave_e!=0 && ave_e_r!=0){
878  float diff_e=((VAL/ave_e))/(val/ave_e_r);
879  if(diff_e>(1+LaserEnergyThreshold) ||diff_e<(1-LaserEnergyThreshold) ){
880  ho_data[eta+42][phi-1][depth-1].nBadEnergy++;
881  ProblemCellsByDepth_energy_val->depth[depth-1]->setBinContent(e,phi,((VAL/ave_e))/(val/ave_e_r));
882  }else ProblemCellsByDepth_energy_val->depth[depth-1]->setBinContent(e,phi,0);
883  }
884  }
885  if(detid.subdetId()==HcalForward && sd==HcalForward){
886  double val=0,rms=0,time=0,time_rms=0,VAL=0,RMS=0,TIME=0,TIME_RMS=0;
887  if(!hf_data[eta+42][phi-1][depth-1].get_reference(&val,&rms,&time,&time_rms)) continue;
888  if(!hf_data[eta+42][phi-1][depth-1].get_average_amp(&VAL,&RMS)) continue;
889  if(!hf_data[eta+42][phi-1][depth-1].get_average_time(&TIME,&TIME_RMS)) continue;
890  hf_data[eta+42][phi-1][depth-1].nChecks++;
891  float diff_t=(TIME-ave_t)-(time-ave_t_r); if(diff_t<0) diff_t=-diff_t;
892  if(diff_t>LaserTimingThreshold){
893  hf_data[eta+42][phi-1][depth-1].nBadTime++;
894  ProblemCellsByDepth_timing_val->depth[depth-1]->setBinContent(e,phi,(TIME-ave_t)-(time-ave_t_r));
895  }else ProblemCellsByDepth_timing_val->depth[depth-1]->setBinContent(e,phi,0);
896  if(VAL!=0 && val!=0 && ave_e!=0 && ave_e_r!=0){
897  float diff_e=((VAL/ave_e))/(val/ave_e_r);
898  if(diff_e>(1+LaserEnergyThreshold) ||diff_e<(1-LaserEnergyThreshold) ){
899  hf_data[eta+42][phi-1][depth-1].nBadEnergy++;
900  ProblemCellsByDepth_energy_val->depth[depth-1]->setBinContent(e,phi,((VAL/ave_e))/(val/ave_e_r));
901  }else ProblemCellsByDepth_energy_val->depth[depth-1]->setBinContent(e,phi,0);
902  }
903  }
904  }
905  for (std::vector <HcalElectronicsId>::iterator eid = AllElIds.begin(); eid != AllElIds.end(); eid++){
906  DetId detid=emap->lookup(*eid);
907  if (detid.det()!=DetId::Hcal) continue;
908  HcalGenericDetId gid(emap->lookup(*eid));
909  if(!(!(gid.null()) &&
910  (gid.genericSubdet()==HcalGenericDetId::HcalGenBarrel ||
911  gid.genericSubdet()==HcalGenericDetId::HcalGenEndcap ||
912  gid.genericSubdet()==HcalGenericDetId::HcalGenForward ||
913  gid.genericSubdet()==HcalGenericDetId::HcalGenOuter))) continue;
914  int eta=0,phi=0,depth=0;
915  HcalDetId hid(detid);
916  eta=hid.ieta();
917  phi=hid.iphi();
918  depth=hid.depth();
919 
920  if(detid.subdetId()==HcalBarrel){
921  if(hb_data[eta+42][phi-1][depth-1].nBadTime>0){
922  int e=CalcEtaBin(HcalBarrel,eta,depth)+1;
923  double val=hb_data[eta+42][phi-1][depth-1].nBadTime/hb_data[eta+42][phi-1][depth-1].nChecks;
924  ProblemCellsByDepth_timing->depth[depth-1]->setBinContent(e,phi,val);
925  }
926  if(hb_data[eta+42][phi-1][depth-1].nBadEnergy>0){
927  int e=CalcEtaBin(HcalBarrel,eta,depth)+1;
928  double val=hb_data[eta+42][phi-1][depth-1].nBadEnergy/hb_data[eta+42][phi-1][depth-1].nChecks;
929  ProblemCellsByDepth_energy->depth[depth-1]->setBinContent(e,phi,val);
930  }
931  }
932  if(detid.subdetId()==HcalEndcap){
933  if(he_data[eta+42][phi-1][depth-1].nBadTime>0){
934  int e=CalcEtaBin(HcalEndcap,eta,depth)+1;
935  double val=he_data[eta+42][phi-1][depth-1].nBadTime/he_data[eta+42][phi-1][depth-1].nChecks;
936  ProblemCellsByDepth_timing->depth[depth-1]->setBinContent(e,phi,val);
937  }
938  if(he_data[eta+42][phi-1][depth-1].nBadEnergy>0){
939  int e=CalcEtaBin(HcalEndcap,eta,depth)+1;
940  double val=he_data[eta+42][phi-1][depth-1].nBadEnergy/he_data[eta+42][phi-1][depth-1].nChecks;
941  ProblemCellsByDepth_energy->depth[depth-1]->setBinContent(e,phi,val);
942  }
943  }
944  if(detid.subdetId()==HcalOuter){
945  if(ho_data[eta+42][phi-1][depth-1].nBadTime>0){
946  int e=CalcEtaBin(HcalOuter,eta,depth)+1;
947  double val=ho_data[eta+42][phi-1][depth-1].nBadTime/ho_data[eta+42][phi-1][depth-1].nChecks;
948  ProblemCellsByDepth_timing->depth[depth-1]->setBinContent(e,phi,val);
949  }
950  if(ho_data[eta+42][phi-1][depth-1].nBadEnergy>0){
951  int e=CalcEtaBin(HcalOuter,eta,depth)+1;
952  double val=ho_data[eta+42][phi-1][depth-1].nBadEnergy/ho_data[eta+42][phi-1][depth-1].nChecks;
953  ProblemCellsByDepth_energy->depth[depth-1]->setBinContent(e,phi,val);
954  }
955  }
956  if(detid.subdetId()==HcalForward){
957  if(hf_data[eta+42][phi-1][depth-1].nBadTime>0){
958  int e=CalcEtaBin(HcalForward,eta,depth)+1;
959  double val=hf_data[eta+42][phi-1][depth-1].nBadTime/hf_data[eta+42][phi-1][depth-1].nChecks;
960  ProblemCellsByDepth_timing->depth[depth-1]->setBinContent(e,phi,val);
961  }
962  if(hf_data[eta+42][phi-1][depth-1].nBadEnergy>0){
963  int e=CalcEtaBin(HcalForward,eta,depth)+1;
964  double val=hf_data[eta+42][phi-1][depth-1].nBadEnergy/hf_data[eta+42][phi-1][depth-1].nChecks;
965  ProblemCellsByDepth_energy->depth[depth-1]->setBinContent(e,phi,val);
966  }
967  }
968  }
969 }
970 
971 bool HcalDetDiagLaserMonitor::get_ave_rbx(int sd,int side,int rbx,float *ave,float *rms){
972  double xt=0,xxt=0;
973  int eta_min=0,eta_max=0,n=0;
974  if(sd==HcalBarrel){
975  if(side>0){eta_min=1; eta_max=29;}
976  if(side<0){eta_min=-29; eta_max=-1;}
977  if(rbx==1){
978  for(int i=eta_min;i<=eta_max;i++) for(int j=71;j<=72;j++)for(int k=1;k<=3;k++){
979  double val,rms,time,time_rms;
980  double TIME,TIME_RMS;
981  if(!hb_data[i+42][j-1][k-1].get_reference(&val,&rms,&time,&time_rms)) continue;
982  if(!hb_data[i+42][j-1][k-1].get_average_time(&TIME,&TIME_RMS)) continue;
983  xt+=TIME-time; xxt+=(TIME-time)*(TIME-time); n++;
984  }
985  for(int i=eta_min;i<=eta_max;i++) for(int j=1;j<=2;j++)for(int k=1;k<=3;k++){
986  double val,rms,time,time_rms;
987  double TIME,TIME_RMS;
988  if(!hb_data[i+42][j-1][k-1].get_reference(&val,&rms,&time,&time_rms)) continue;
989  if(!hb_data[i+42][j-1][k-1].get_average_time(&TIME,&TIME_RMS)) continue;
990  xt+=TIME-time; xxt+=(TIME-time)*(TIME-time); n++;
991  }
992 
993  }else{
994  for(int i=eta_min;i<=eta_max;i++) for(int j=((rbx-1)*4-1);j<=((rbx-1)*4+2);j++)for(int k=1;k<=3;k++){
995  double val,rms,time,time_rms;
996  double TIME,TIME_RMS;
997  if(!hb_data[i+42][j-1][k-1].get_reference(&val,&rms,&time,&time_rms)) continue;
998  if(!hb_data[i+42][j-1][k-1].get_average_time(&TIME,&TIME_RMS)) continue;
999  xt+=TIME-time; xxt+=(TIME-time)*(TIME-time); n++;
1000  }
1001  }
1002  }
1003  if(sd==HcalEndcap){
1004  if(side>0){eta_min=1; eta_max=29;}
1005  if(side<0){eta_min=-29; eta_max=-1;}
1006  if(rbx==1){
1007  for(int i=eta_min;i<=eta_max;i++) for(int j=71;j<=72;j++)for(int k=1;k<=3;k++){
1008  double val,rms,time,time_rms;
1009  double TIME,TIME_RMS;
1010  if(!he_data[i+42][j-1][k-1].get_reference(&val,&rms,&time,&time_rms)) continue;
1011  if(!he_data[i+42][j-1][k-1].get_average_time(&TIME,&TIME_RMS)) continue;
1012  xt+=TIME-time; xxt+=(TIME-time)*(TIME-time); n++;
1013  }
1014  for(int i=eta_min;i<=eta_max;i++) for(int j=1;j<=2;j++)for(int k=1;k<=3;k++){
1015  double val,rms,time,time_rms;
1016  double TIME,TIME_RMS;
1017  if(!he_data[i+42][j-1][k-1].get_reference(&val,&rms,&time,&time_rms)) continue;
1018  if(!he_data[i+42][j-1][k-1].get_average_time(&TIME,&TIME_RMS)) continue;
1019  xt+=TIME-time; xxt+=(TIME-time)*(TIME-time); n++;
1020  }
1021 
1022  }else{
1023  for(int i=eta_min;i<=eta_max;i++) for(int j=((rbx-1)*4-1);j<=((rbx-1)*4+2);j++)for(int k=1;k<=3;k++){
1024  double val,rms,time,time_rms;
1025  double TIME,TIME_RMS;
1026  if(!he_data[i+42][j-1][k-1].get_reference(&val,&rms,&time,&time_rms)) continue;
1027  if(!he_data[i+42][j-1][k-1].get_average_time(&TIME,&TIME_RMS)) continue;
1028  xt+=TIME-time; xxt+=(TIME-time)*(TIME-time); n++;
1029  }
1030  }
1031  }
1032  if(sd==HcalForward){
1033  if(side>0){eta_min=29; eta_max=40;}
1034  if(side<0){eta_min=-40; eta_max=-29;}
1035  for(int i=eta_min;i<=eta_max;i++) for(int j=((rbx-1)*6+1);j<=((rbx-1)*6+6);j++)for(int k=1;k<=2;k++){
1036  double val,rms,time,time_rms;
1037  double TIME,TIME_RMS;
1038  if(!hf_data[i+42][j-1][k-1].get_reference(&val,&rms,&time,&time_rms)) continue;
1039  if(!hf_data[i+42][j-1][k-1].get_average_time(&TIME,&TIME_RMS)) continue;
1040  xt+=TIME-time; xxt+=(TIME-time)*(TIME-time); n++;
1041  }
1042  }
1043  if(sd==HcalOuter){
1044  if(side==0){
1045  eta_min=-4,eta_max=4;
1046  if(rbx==1){
1047  for(int i=eta_min;i<=eta_max;i++) for(int j=71;j<=72;j++){
1048  double val,rms,time,time_rms;
1049  double TIME,TIME_RMS;
1050  if(!ho_data[i+42][j-1][4-1].get_reference(&val,&rms,&time,&time_rms)) continue;
1051  if(!ho_data[i+42][j-1][4-1].get_average_time(&TIME,&TIME_RMS)) continue;
1052  xt+=TIME-time; xxt+=(TIME-time)*(TIME-time); n++;
1053  }
1054  for(int i=eta_min;i<=eta_max;i++) for(int j=1;j<=4;j++){
1055  double val,rms,time,time_rms;
1056  double TIME,TIME_RMS;
1057  if(!ho_data[i+42][j-1][4-1].get_reference(&val,&rms,&time,&time_rms)) continue;
1058  if(!ho_data[i+42][j-1][4-1].get_average_time(&TIME,&TIME_RMS)) continue;
1059  xt+=TIME-time; xxt+=(TIME-time)*(TIME-time); n++;
1060  }
1061 
1062  }else{
1063  for(int i=eta_min;i<=eta_max;i++) for(int j=((rbx-1)*6-1);j<=((rbx-1)*6+4);j++){
1064  double val,rms,time,time_rms;
1065  double TIME,TIME_RMS;
1066  if(!ho_data[i+42][j-1][4-1].get_reference(&val,&rms,&time,&time_rms)) continue;
1067  if(!ho_data[i+42][j-1][4-1].get_average_time(&TIME,&TIME_RMS)) continue;
1068  xt+=TIME-time; xxt+=(TIME-time)*(TIME-time); n++;
1069  }
1070  }
1071  }
1072  if(side==-1){ eta_min=-10,eta_max=-5;}
1073  if(side==-2){ eta_min=-15,eta_max=-11;}
1074  if(side==1) { eta_min=5, eta_max=10;}
1075  if(side==2) { eta_min=11, eta_max=15;}
1076  if(side!=0){
1077  if(rbx==1){
1078  for(int i=eta_min;i<=eta_max;i++) for(int j=71;j<=72;j++){
1079  double val,rms,time,time_rms;
1080  double TIME,TIME_RMS;
1081  if(!ho_data[i+42][j-1][4-1].get_reference(&val,&rms,&time,&time_rms)) continue;
1082  if(!ho_data[i+42][j-1][4-1].get_average_time(&TIME,&TIME_RMS)) continue;
1083  xt+=TIME-time; xxt+=(TIME-time)*(TIME-time); n++;
1084  }
1085  for(int i=eta_min;i<=eta_max;i++) for(int j=1;j<=10;j++){
1086  double val,rms,time,time_rms;
1087  double TIME,TIME_RMS;
1088  if(!ho_data[i+42][j-1][4-1].get_reference(&val,&rms,&time,&time_rms)) continue;
1089  if(!ho_data[i+42][j-1][4-1].get_average_time(&TIME,&TIME_RMS)) continue;
1090  xt+=TIME-time; xxt+=(TIME-time)*(TIME-time); n++;
1091  }
1092 
1093  }else{
1094  for(int i=eta_min;i<=eta_max;i++) for(int j=((rbx-1)*12-1);j<=((rbx-1)*12+10);j++){
1095  double val,rms,time,time_rms;
1096  double TIME,TIME_RMS;
1097  if(!ho_data[i+42][j-1][4-1].get_reference(&val,&rms,&time,&time_rms)) continue;
1098  if(!ho_data[i+42][j-1][4-1].get_average_time(&TIME,&TIME_RMS)) continue;
1099  xt+=TIME-time; xxt+=(TIME-time)*(TIME-time); n++;
1100  }
1101  }
1102  }
1103  }
1104  if(n<10) return false;
1105  *ave=xt/n;
1106  *rms=sqrt(xxt/n-(xt*xt)/(n*n));
1107  return true;
1108 }
1109 
1110 
1112  if(sd==HcalBarrel || sd==HcalEndcap){
1113  hbheEnergy->Reset();
1114  hbheTime->Reset();
1115  hbheEnergyRMS->Reset();
1116  hbheTimeRMS->Reset();
1117  hb_time_rbx->Reset();
1118  he_time_rbx->Reset();
1119  }
1120  if(sd==HcalOuter){
1121  hoEnergy->Reset();
1122  hoTime->Reset();
1123  hoEnergyRMS->Reset();
1124  hoTimeRMS->Reset();
1125  Time2Dho->Reset();
1126  Energy2Dho->Reset();
1127  refTime2Dho->Reset();
1128  refEnergy2Dho->Reset();
1129  ho_time_rbx->Reset();
1130  }
1131  if(sd==HcalForward){
1132  hfEnergy->Reset();
1133  hfTime->Reset();
1134  hfEnergyRMS->Reset();
1135  hfTimeRMS->Reset();
1136  hf_time_rbx->Reset();
1137  }
1138  if(sd==HcalBarrel || sd==HcalEndcap){
1139  // HB histograms
1140  for(int eta=-16;eta<=16;eta++) for(int phi=1;phi<=72;phi++){
1141  double T=0,nT=0,E=0,nE=0;
1142  for(int depth=1;depth<=2;depth++){
1143  if(hb_data[eta+42][phi-1][depth-1].get_statistics()>10){
1144  double ave=0;
1145  double rms=0;
1146  double time=0;
1147  double time_rms=0;
1148  hb_data[eta+42][phi-1][depth-1].get_average_amp(&ave,&rms);
1149  hb_data[eta+42][phi-1][depth-1].get_average_time(&time,&time_rms);
1150  hbheEnergy->Fill(ave);
1151  if(ave>0)hbheEnergyRMS->Fill(rms/ave);
1152  hbheTime->Fill(time);
1153  hbheTimeRMS->Fill(time_rms);
1154  T+=time; nT++; E+=ave; nE++;
1155  }
1156  }
1157  if(nT>0){Time2Dhbhehf->setBinContent(eta+44,phi+1,T/nT);Energy2Dhbhehf->setBinContent(eta+44,phi+1,E/nE); }
1158  }
1159  // HE histograms
1160  for(int eta=-29;eta<=29;eta++) for(int phi=1;phi<=72;phi++){
1161  double T=0,nT=0,E=0,nE=0;
1162  for(int depth=1;depth<=3;depth++){
1163  if(he_data[eta+42][phi-1][depth-1].get_statistics()>10){
1164  double ave=0; double rms=0; double time=0; double time_rms=0;
1165  he_data[eta+42][phi-1][depth-1].get_average_amp(&ave,&rms);
1166  he_data[eta+42][phi-1][depth-1].get_average_time(&time,&time_rms);
1167  hbheEnergy->Fill(ave);
1168  if(ave>0)hbheEnergyRMS->Fill(rms/ave);
1169  hbheTime->Fill(time);
1170  hbheTimeRMS->Fill(time_rms);
1171  T+=time; nT++; E+=ave; nE++;
1172  }
1173  }
1174  if(nT>0 && abs(eta)>16 ){Time2Dhbhehf->setBinContent(eta+44,phi+1,T/nT); Energy2Dhbhehf->setBinContent(eta+44,phi+1,E/nE); }
1175  if(nT>0 && abs(eta)>20 ){Time2Dhbhehf->setBinContent(eta+44,phi+2,T/nT); Energy2Dhbhehf->setBinContent(eta+44,phi+2,E/nE);}
1176  }
1177  }
1178  if(sd==HcalForward){
1179  // HF histograms
1180  for(int eta=-42;eta<=42;eta++) for(int phi=1;phi<=72;phi++){
1181  double T=0,nT=0,E=0,nE=0;
1182  for(int depth=1;depth<=2;depth++){
1183  if(hf_data[eta+42][phi-1][depth-1].get_statistics()>10){
1184  double ave=0; double rms=0; double time=0; double time_rms=0;
1185  hf_data[eta+42][phi-1][depth-1].get_average_amp(&ave,&rms);
1186  hf_data[eta+42][phi-1][depth-1].get_average_time(&time,&time_rms);
1187  hfEnergy->Fill(ave);
1188  if(ave>0)hfEnergyRMS->Fill(rms/ave);
1189  hfTime->Fill(time);
1190  T+=time; nT++; E+=ave; nE++;
1191  hfTimeRMS->Fill(time_rms);
1192  }
1193  }
1194  if(nT>0 && abs(eta)>29 ){ Time2Dhbhehf->setBinContent(eta+44,phi+1,T/nT); Time2Dhbhehf->setBinContent(eta+44,phi+2,T/nT);}
1195  if(nT>0 && abs(eta)>29 ){ Energy2Dhbhehf->setBinContent(eta+44,phi+1,E/nE); Energy2Dhbhehf->setBinContent(eta+44,phi+2,E/nE);}
1196  }
1197  }
1198  if(sd==HcalOuter){
1199  // HO histograms
1200  for(int eta=-10;eta<=15;eta++) for(int phi=1;phi<=72;phi++){
1201  if(eta>10 && !isSiPM(eta,phi,4)) continue;
1202  double T=0,nT=0,E=0,nE=0;
1203  for(int depth=4;depth<=4;depth++){
1204  if(ho_data[eta+42][phi-1][depth-1].get_statistics()>10){
1205  double ave=0; double rms=0; double time=0; double time_rms=0;
1206  ho_data[eta+42][phi-1][depth-1].get_average_amp(&ave,&rms);
1207  ho_data[eta+42][phi-1][depth-1].get_average_time(&time,&time_rms);
1208  hoEnergy->Fill(ave);
1209  if(ave>0)hoEnergyRMS->Fill(rms/ave);
1210  hoTime->Fill(time);
1211  T+=time; nT++; E+=ave; nE++;
1212  hoTimeRMS->Fill(time_rms);
1213  }
1214  }
1215  if(nT>0){ Time2Dho->Fill(eta,phi,T/nT); Energy2Dho->Fill(eta,phi+1,E/nE) ;}
1216  }
1217  }
1218 
1219  // compare with reference...
1220  if(sd==HcalBarrel || sd==HcalEndcap){
1221  for(int eta=-16;eta<=16;eta++) for(int phi=1;phi<=72;phi++){
1222  double T=0,nT=0,E=0,nE=0;
1223  for(int depth=1;depth<=2;depth++){
1224  if(hb_data[eta+42][phi-1][depth-1].get_statistics()>10){
1225  double val=0,rms=0,time=0,time_rms=0;
1226  double VAL=0,RMS=0,TIME=0,TIME_RMS=0;
1227  if(!hb_data[eta+42][phi-1][depth-1].get_reference(&val,&rms,&time,&time_rms)) continue;
1228  if(!hb_data[eta+42][phi-1][depth-1].get_average_amp(&VAL,&RMS)) continue;
1229  if(!hb_data[eta+42][phi-1][depth-1].get_average_time(&TIME,&TIME_RMS)) continue;
1230  E+=VAL/val; nE++;
1231  T+=TIME-time; nT++;
1232  }
1233  }
1234  if(nE>0) refEnergy2Dhbhehf->setBinContent(eta+44,phi+1,E/nE);
1235  if(nT>0){ double TTT=T/nT+1; if(TTT<0.01) TTT=0.01; refTime2Dhbhehf->setBinContent(eta+44,phi+1,TTT); }
1236  }
1237  for(int eta=-29;eta<=29;eta++) for(int phi=1;phi<=72;phi++){
1238  double T=0,nT=0,E=0,nE=0;
1239  for(int depth=1;depth<=3;depth++){
1240  if(he_data[eta+42][phi-1][depth-1].get_statistics()>10){
1241  double val=0,rms=0,time=0,time_rms=0;
1242  double VAL=0,RMS=0,TIME=0,TIME_RMS=0;
1243  if(!he_data[eta+42][phi-1][depth-1].get_reference(&val,&rms,&time,&time_rms)) continue;
1244  if(!he_data[eta+42][phi-1][depth-1].get_average_amp(&VAL,&RMS)) continue;
1245  if(!he_data[eta+42][phi-1][depth-1].get_average_time(&TIME,&TIME_RMS)) continue;
1246  E+=VAL/val; nE++;
1247  T+=TIME-time; nT++;
1248  }
1249  }
1250  if(nE>0 && abs(eta)>16) refEnergy2Dhbhehf->setBinContent(eta+44,phi+1,E/nE);
1251  if(nT>0 && abs(eta)>16){ double TTT=T/nT+1; if(TTT<0.01) TTT=0.01; refTime2Dhbhehf->setBinContent(eta+44,phi+1,TTT); }
1252  if(nE>0 && abs(eta)>20) refEnergy2Dhbhehf->setBinContent(eta+44,phi+2,E/nE);
1253  if(nT>0 && abs(eta)>20){ double TTT=T/nT+1; if(TTT<0.01) TTT=0.01; refTime2Dhbhehf->setBinContent(eta+44,phi+2,TTT); }
1254  }
1255  }
1256  if(sd==HcalForward){
1257  for(int eta=-42;eta<=42;eta++) for(int phi=1;phi<=72;phi++){
1258  double T=0,nT=0,E=0,nE=0;
1259  for(int depth=1;depth<=2;depth++){
1260  if(hf_data[eta+42][phi-1][depth-1].get_statistics()>10){
1261  double val=0,rms=0,time=0,time_rms=0;
1262  double VAL=0,RMS=0,TIME=0,TIME_RMS=0;
1263  if(!hf_data[eta+42][phi-1][depth-1].get_reference(&val,&rms,&time,&time_rms)) continue;
1264  if(!hf_data[eta+42][phi-1][depth-1].get_average_amp(&VAL,&RMS)) continue;
1265  if(!hf_data[eta+42][phi-1][depth-1].get_average_time(&TIME,&TIME_RMS)) continue;
1266  E+=VAL/val; nE++;
1267  T+=TIME-time; nT++;
1268  }
1269  }
1270  if(nE>0 && abs(eta)>29) refEnergy2Dhbhehf->setBinContent(eta+44,phi+1,E/nE);
1271  if(nT>0 && abs(eta)>29){ double TTT=T/nT+1; if(TTT<0.01) TTT=0.01; refTime2Dhbhehf->setBinContent(eta+44,phi+1,TTT); }
1272  if(nE>0 && abs(eta)>29) refEnergy2Dhbhehf->setBinContent(eta+44,phi+2,E/nE);
1273  if(nT>0 && abs(eta)>29){ double TTT=T/nT+1; if(TTT<0.01) TTT=0.01; refTime2Dhbhehf->setBinContent(eta+44,phi+2,TTT); }
1274  }
1275  }
1276  if(sd==HcalOuter){
1277  for(int eta=-15;eta<=15;eta++) for(int phi=1;phi<=72;phi++){
1278  if(eta>10 && !isSiPM(eta,phi,4)) continue;
1279  double T=0,nT=0,E=0,nE=0;
1280  for(int depth=4;depth<=4;depth++){
1281  if(ho_data[eta+42][phi-1][depth-1].get_statistics()>10){
1282  double val=0,rms=0,time=0,time_rms=0;
1283  double VAL=0,RMS=0,TIME=0,TIME_RMS=0;
1284  if(!ho_data[eta+42][phi-1][depth-1].get_reference(&val,&rms,&time,&time_rms)) continue;
1285  if(!ho_data[eta+42][phi-1][depth-1].get_average_amp(&VAL,&RMS)) continue;
1286  if(!ho_data[eta+42][phi-1][depth-1].get_average_time(&TIME,&TIME_RMS)) continue;
1287  E+=VAL/val; nE++;
1288  T+=TIME-time; nT++;
1289  }
1290  }
1291  if(nE>0) refEnergy2Dho->Fill(eta,phi,E/nE);
1292  if(nT>0){ double TTT=T/nT+1; if(TTT<0.01) TTT=0.01; refTime2Dho->Fill(eta,phi,TTT);}
1293  }
1294  }
1296  float min,max;
1297  if(sd==HcalBarrel || sd==HcalEndcap){
1298  min=100;max=-100;
1299  for(int i=1;i<=18;i++){
1300  float ave=-10,rms=-10;
1301  if(get_ave_rbx(HcalBarrel,-1,i,&ave,&rms)){
1302  hb_time_rbx->setBinContent(i,ave);
1304  if(ave<min) min=ave;
1305  if(ave>max) max=ave;
1306  }
1307  }
1308  for(int i=1;i<=18;i++){
1309  float ave=-10,rms=-10;
1310  if(get_ave_rbx(HcalBarrel,1,i,&ave,&rms)){
1311  hb_time_rbx->setBinContent(i+18,ave);
1313  if(ave<min) min=ave;
1314  if(ave>max) max=ave;
1315  }
1316  }
1317  if(max>-100)hb_time_rbx->setAxisRange(min-1,max+1,2);
1318  min=100;max=-100;
1319  for(int i=1;i<=18;i++){
1320  float ave=-10,rms=-10;
1321  if(get_ave_rbx(HcalEndcap,-1,i,&ave,&rms)){
1322  he_time_rbx->setBinContent(i,ave);
1324  if(ave<min) min=ave;
1325  if(ave>max) max=ave;
1326  }
1327  }
1328  for(int i=1;i<=18;i++){
1329  float ave=-10,rms=-10;
1330  if(get_ave_rbx(HcalEndcap,1,i,&ave,&rms)){
1331  he_time_rbx->setBinContent(i+18,ave);
1333  if(ave<min) min=ave;
1334  if(ave>max) max=ave;
1335  }
1336  }
1337  if(max>-100)he_time_rbx->setAxisRange(min-1,max+1,2);
1338  }
1340  if(sd==HcalOuter){
1341  min=100;max=-100;
1342  for(int i=1;i<=6;i++){
1343  float ave=-10,rms=-10;
1344  if(get_ave_rbx(HcalOuter,-2,i,&ave,&rms)){
1345  ho_time_rbx->setBinContent(i,ave);
1347  if(ave<min) min=ave;
1348  if(ave>max) max=ave;
1349  }
1350  }
1351  for(int i=1;i<=6;i++){
1352  float ave=-10,rms=-10;
1353  if(get_ave_rbx(HcalOuter,-1,i,&ave,&rms)){
1354  ho_time_rbx->setBinContent(i+6,ave);
1356  if(ave<min) min=ave;
1357  if(ave>max) max=ave;
1358  }
1359  }
1360  for(int i=1;i<=12;i++){
1361  float ave=-10,rms=-10;
1362  if(get_ave_rbx(HcalOuter,0,i,&ave,&rms)){
1363  ho_time_rbx->setBinContent(i+12,ave);
1365  if(ave<min) min=ave;
1366  if(ave>max) max=ave;
1367  }
1368  }
1369  for(int i=1;i<=6;i++){
1370  float ave=-10,rms=-10;
1371  if(get_ave_rbx(HcalOuter,1,i,&ave,&rms)){
1372  ho_time_rbx->setBinContent(i+24,ave);
1374  if(ave<min) min=ave;
1375  if(ave>max) max=ave;
1376  }
1377  }
1378  for(int i=1;i<=6;i++){
1379  float ave=-10,rms=-10;
1380  if(get_ave_rbx(HcalOuter,2,i,&ave,&rms)){
1381  ho_time_rbx->setBinContent(i+30,ave);
1383  if(ave<min) min=ave;
1384  if(ave>max) max=ave;
1385  }
1386  }
1387  if(max>-100)ho_time_rbx->setAxisRange(min-1,max+1,2);
1388  }
1390  if(sd==HcalForward){
1391  min=100;max=-100;
1392  for(int i=1;i<=12;i++){
1393  float ave=-10,rms=-10;
1394  if(get_ave_rbx(HcalForward,-1,i,&ave,&rms)){
1395  hf_time_rbx->setBinContent(i,ave);
1397  if(ave<min) min=ave;
1398  if(ave>max) max=ave;
1399  }
1400  }
1401  for(int i=1;i<=12;i++){
1402  float ave=-10,rms=-10;
1403  if(get_ave_rbx(HcalForward,1,i,&ave,&rms)){
1404  hf_time_rbx->setBinContent(i+12,ave);
1406  if(ave<min) min=ave;
1407  if(ave>max) max=ave;
1408  }
1409  }
1410  if(max>-100)hf_time_rbx->setAxisRange(min-1,max+1,2);
1411  }
1412 }
1413 
1415 double amp,rms,Time,time_rms;
1416 int Eta,Phi,Depth,Statistic,Status=0;
1417 char Subdet[10],str[500];
1418  if(OutputFilePath.size()>0){
1419  if(!Overwrite){
1420  sprintf(str,"%sHcalDetDiagLaserData_run%06i_%i.root",OutputFilePath.c_str(),run_number,dataset_seq_number);
1421  }else{
1422  sprintf(str,"%sHcalDetDiagLaserData.root",OutputFilePath.c_str());
1423  }
1424  TFile *theFile = new TFile(str, "RECREATE");
1425  if(!theFile->IsOpen()) return;
1426  theFile->cd();
1427  sprintf(str,"%d",run_number); TObjString run(str); run.Write("run number");
1428  sprintf(str,"%d",ievt_); TObjString events(str); events.Write("Total events processed");
1429  sprintf(str,"%d",dataset_seq_number); TObjString dsnum(str); dsnum.Write("Dataset number");
1430  Long_t t; t=time(0); strftime(str,30,"%F %T",localtime(&t)); TObjString tm(str); tm.Write("Dataset creation time");
1431 
1432  TTree *tree =new TTree("HCAL Laser data","HCAL Laser data");
1433  if(tree==0) return;
1434  tree->Branch("Subdet", &Subdet, "Subdet/C");
1435  tree->Branch("eta", &Eta, "Eta/I");
1436  tree->Branch("phi", &Phi, "Phi/I");
1437  tree->Branch("depth", &Depth, "Depth/I");
1438  tree->Branch("statistic",&Statistic, "Statistic/I");
1439  tree->Branch("status", &Status, "Status/I");
1440  tree->Branch("amp", &amp, "amp/D");
1441  tree->Branch("rms", &rms, "rms/D");
1442  tree->Branch("time", &Time, "time/D");
1443  tree->Branch("time_rms", &time_rms, "time_rms/D");
1444  sprintf(Subdet,"HB");
1445  for(int eta=-16;eta<=16;eta++) for(int phi=1;phi<=72;phi++) for(int depth=1;depth<=2;depth++){
1446  if((Statistic=hb_data[eta+42][phi-1][depth-1].get_statistics1())>10){
1447  Eta=eta; Phi=phi; Depth=depth;
1448  Status=hb_data[eta+42][phi-1][depth-1].get_status();
1449  hb_data[eta+42][phi-1][depth-1].get_average_amp1(&amp,&rms);
1450  hb_data[eta+42][phi-1][depth-1].get_average_time1(&Time,&time_rms);
1451  tree->Fill();
1452  }
1453  }
1454  sprintf(Subdet,"HE");
1455  for(int eta=-29;eta<=29;eta++) for(int phi=1;phi<=72;phi++) for(int depth=1;depth<=3;depth++){
1456  if((Statistic=he_data[eta+42][phi-1][depth-1].get_statistics1())>10){
1457  Eta=eta; Phi=phi; Depth=depth;
1458  Status=he_data[eta+42][phi-1][depth-1].get_status();
1459  he_data[eta+42][phi-1][depth-1].get_average_amp1(&amp,&rms);
1460  he_data[eta+42][phi-1][depth-1].get_average_time1(&Time,&time_rms);
1461  tree->Fill();
1462  }
1463  }
1464  sprintf(Subdet,"HO");
1465  for(int eta=-15;eta<=15;eta++) for(int phi=1;phi<=72;phi++) for(int depth=4;depth<=4;depth++){
1466  if((Statistic=ho_data[eta+42][phi-1][depth-1].get_statistics1())>10){
1467  Eta=eta; Phi=phi; Depth=depth;
1468  Status=ho_data[eta+42][phi-1][depth-1].get_status();
1469  ho_data[eta+42][phi-1][depth-1].get_average_amp1(&amp,&rms);
1470  ho_data[eta+42][phi-1][depth-1].get_average_time1(&Time,&time_rms);
1471  tree->Fill();
1472  }
1473  }
1474  sprintf(Subdet,"HF");
1475  for(int eta=-42;eta<=42;eta++) for(int phi=1;phi<=72;phi++) for(int depth=1;depth<=2;depth++){
1476  if((Statistic=hf_data[eta+42][phi-1][depth-1].get_statistics1())>10){
1477  Eta=eta; Phi=phi; Depth=depth;
1478  Status=hf_data[eta+42][phi-1][depth-1].get_status();
1479  hf_data[eta+42][phi-1][depth-1].get_average_amp1(&amp,&rms);
1480  hf_data[eta+42][phi-1][depth-1].get_average_time1(&Time,&time_rms);
1481  tree->Fill();
1482  }
1483  }
1484  sprintf(Subdet,"CALIB_HB");
1485  for(int eta=-1;eta<=1;eta++) for(int phi=1;phi<=72;phi++){
1486  if((Statistic=calib_data[1][eta+2][phi-1].get_statistics1())>10){
1487  Eta=eta; Phi=phi; Depth=0;
1488  Status=calib_data[1][eta+2][phi-1].get_status();
1489  calib_data[1][eta+2][phi-1].get_average_amp1(&amp,&rms);
1490  calib_data[1][eta+2][phi-1].get_average_time1(&Time,&time_rms);
1491  tree->Fill();
1492  }
1493  }
1494  sprintf(Subdet,"CALIB_HE");
1495  for(int eta=-1;eta<=1;eta++) for(int phi=1;phi<=72;phi++){
1496  if((Statistic=calib_data[2][eta+2][phi-1].get_statistics1())>10){
1497  Eta=eta; Phi=phi; Depth=0;
1498  Status=calib_data[2][eta+2][phi-1].get_status();
1499  calib_data[2][eta+2][phi-1].get_average_amp1(&amp,&rms);
1500  calib_data[2][eta+2][phi-1].get_average_time1(&Time,&time_rms);
1501  tree->Fill();
1502  }
1503  }
1504  sprintf(Subdet,"CALIB_HO");
1505  for(int eta=-2;eta<=2;eta++) for(int phi=1;phi<=72;phi++){
1506  if((Statistic=calib_data[3][eta+2][phi-1].get_statistics1())>10){
1507  Eta=eta; Phi=phi; Depth=0;
1508  Status=calib_data[3][eta+2][phi-1].get_status();
1509  calib_data[3][eta+2][phi-1].get_average_amp1(&amp,&rms);
1510  calib_data[3][eta+2][phi-1].get_average_time1(&Time,&time_rms);
1511  tree->Fill();
1512  }
1513  }
1514  sprintf(Subdet,"CALIB_HF");
1515  for(int eta=-2;eta<=2;eta++) for(int phi=1;phi<=72;phi++){
1516  if((Statistic=calib_data[4][eta+2][phi-1].get_statistics1())>10){
1517  Eta=eta; Phi=phi; Depth=0;
1518  Status=calib_data[4][eta+2][phi-1].get_status();
1519  calib_data[4][eta+2][phi-1].get_average_amp1(&amp,&rms);
1520  calib_data[4][eta+2][phi-1].get_average_time1(&Time,&time_rms);
1521  tree->Fill();
1522  }
1523  }
1524  theFile->Write();
1525  theFile->Close();
1526  }
1527  if(XmlFilePath.size()>0){
1528  char TIME[40];
1529  Long_t t; t=time(0); strftime(TIME,30,"%F %T",localtime(&t));
1530  //create XML file
1531  if(!Overwrite){
1532  sprintf(str,"HcalDetDiagLaser_%i_%i.xml",run_number,dataset_seq_number);
1533  }else{
1534  sprintf(str,"HcalDetDiagLaser.xml");
1535  }
1536  std::string xmlName=str;
1537  ofstream xmlFile;
1538  xmlFile.open(xmlName.c_str());
1539 
1540  xmlFile<<"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n";
1541  xmlFile<<"<ROOT>\n";
1542  xmlFile<<" <HEADER>\n";
1543  xmlFile<<" <HINTS mode='only-det-root'/>\n";
1544  xmlFile<<" <TYPE>\n";
1545  xmlFile<<" <EXTENSION_TABLE_NAME>HCAL_DETMON_LED_LASER_V1</EXTENSION_TABLE_NAME>\n";
1546  xmlFile<<" <NAME>HCAL Laser HBHE HPD [abort gap global]</NAME>\n";
1547  xmlFile<<" </TYPE>\n";
1548  xmlFile<<" <!-- run details -->\n";
1549  xmlFile<<" <RUN>\n";
1550  xmlFile<<" <RUN_TYPE>GLOBAL-RUN</RUN_TYPE>\n";
1551  xmlFile<<" <RUN_NUMBER>"<<run_number<<"</RUN_NUMBER>\n";
1552  xmlFile<<" <RUN_BEGIN_TIMESTAMP>2009-01-01 00:00:00</RUN_BEGIN_TIMESTAMP>\n";
1553  xmlFile<<" <COMMENT_DESCRIPTION>hcal laser data</COMMENT_DESCRIPTION>\n";
1554  xmlFile<<" <LOCATION>P5</LOCATION>\n";
1555  xmlFile<<" <INITIATED_BY_USER>dma</INITIATED_BY_USER>\n";
1556  xmlFile<<" </RUN>\n";
1557  xmlFile<<" </HEADER>\n";
1558  xmlFile<<" <DATA_SET>\n";
1559  xmlFile<<" <!-- optional dataset metadata -->\n\n";
1560  xmlFile<<" <SET_NUMBER>"<<dataset_seq_number<<"</SET_NUMBER>\n";
1561  xmlFile<<" <SET_BEGIN_TIMESTAMP>2009-01-01 00:00:00</SET_BEGIN_TIMESTAMP>\n";
1562  xmlFile<<" <SET_END_TIMESTAMP>2009-01-01 00:00:00</SET_END_TIMESTAMP>\n";
1563  xmlFile<<" <NUMBER_OF_EVENTS_IN_SET>"<<ievt_<<"</NUMBER_OF_EVENTS_IN_SET>\n";
1564  xmlFile<<" <COMMENT_DESCRIPTION>Automatic DQM output</COMMENT_DESCRIPTION>\n";
1565  xmlFile<<" <DATA_FILE_NAME>"<< xmlName <<"</DATA_FILE_NAME>\n";
1566  xmlFile<<" <IMAGE_FILE_NAME>data plot url or file path</IMAGE_FILE_NAME>\n";
1567  xmlFile<<" <!-- who and when created this dataset-->\n\n";
1568  xmlFile<<" <CREATE_TIMESTAMP>"<<TIME<<"</CREATE_TIMESTAMP>\n";
1569  xmlFile<<" <CREATED_BY_USER>dma</CREATED_BY_USER>\n";
1570  xmlFile<<" <!-- version (string) and subversion (number) -->\n";
1571  xmlFile<<" <!-- fields are used to read data back from the database -->\n\n";
1572  xmlFile<<" <VERSION>"<<run_number<<dataset_seq_number<<"</VERSION>\n";
1573  xmlFile<<" <SUBVERSION>1</SUBVERSION>\n";
1574  xmlFile<<" <!-- Assign predefined dataset attributes -->\n\n";
1575  xmlFile<<" <PREDEFINED_ATTRIBUTES>\n";
1576  xmlFile<<" <ATTRIBUTE>\n";
1577  xmlFile<<" <NAME>HCAL Dataset Status</NAME>\n";
1578  xmlFile<<" <VALUE>VALID</VALUE>\n";
1579  xmlFile<<" </ATTRIBUTE>\n";
1580  xmlFile<<" </PREDEFINED_ATTRIBUTES>\n";
1581  xmlFile<<" <!-- multiple data block records -->\n\n";
1582 
1583  std::vector <HcalElectronicsId> AllElIds = emap->allElectronicsIdPrecision();
1584  for(std::vector <HcalElectronicsId>::iterator eid = AllElIds.begin(); eid != AllElIds.end(); eid++){
1585  DetId detid=emap->lookup(*eid);
1586  if (detid.det()!=DetId::Hcal) continue;
1587  HcalGenericDetId gid(emap->lookup(*eid));
1588  if(!(!(gid.null()) &&
1589  (gid.genericSubdet()==HcalGenericDetId::HcalGenBarrel ||
1590  gid.genericSubdet()==HcalGenericDetId::HcalGenEndcap ||
1591  gid.genericSubdet()==HcalGenericDetId::HcalGenForward ||
1592  gid.genericSubdet()==HcalGenericDetId::HcalGenOuter))) continue;
1593  int eta,phi,depth;
1594  std::string subdet="";
1595  HcalDetId hid(detid);
1596  eta=hid.ieta();
1597  phi=hid.iphi();
1598  depth=hid.depth();
1599 
1600  double e=0,e_rms=0,t=0,t_rms=0;
1601  if(detid.subdetId()==HcalBarrel){
1602  subdet="HB";
1603  Statistic=hb_data[eta+42][phi-1][depth-1].get_statistics1();
1604  Status =hb_data[eta+42][phi-1][depth-1].get_status();
1605  hb_data[eta+42][phi-1][depth-1].get_average_amp1(&e,&e_rms);
1606  hb_data[eta+42][phi-1][depth-1].get_average_time1(&t,&t_rms);
1607  }else if(detid.subdetId()==HcalEndcap){
1608  subdet="HE";
1609  Statistic=he_data[eta+42][phi-1][depth-1].get_statistics1();
1610  Status =he_data[eta+42][phi-1][depth-1].get_status();
1611  he_data[eta+42][phi-1][depth-1].get_average_amp1(&e,&e_rms);
1612  he_data[eta+42][phi-1][depth-1].get_average_time1(&t,&t_rms);
1613  }else if(detid.subdetId()==HcalForward){
1614  subdet="HF";
1615  Statistic=hf_data[eta+42][phi-1][depth-1].get_statistics1();
1616  Status =hf_data[eta+42][phi-1][depth-1].get_status();
1617  hf_data[eta+42][phi-1][depth-1].get_average_amp1(&e,&e_rms);
1618  hf_data[eta+42][phi-1][depth-1].get_average_time1(&t,&t_rms);
1619  }else if(detid.subdetId()==HcalOuter){
1620  subdet="HO";
1621  Statistic=ho_data[eta+42][phi-1][depth-1].get_statistics1();
1622  Status =ho_data[eta+42][phi-1][depth-1].get_status();
1623  ho_data[eta+42][phi-1][depth-1].get_average_amp1(&e,&e_rms);
1624  ho_data[eta+42][phi-1][depth-1].get_average_time1(&t,&t_rms);
1625  }else continue;
1626  xmlFile<<" <DATA>\n";
1627  xmlFile<<" <NUMBER_OF_EVENTS_USED>"<<Statistic<<"</NUMBER_OF_EVENTS_USED>\n";
1628  xmlFile<<" <SIGNAL_MEAN>"<<e<<"</SIGNAL_MEAN>\n";
1629  xmlFile<<" <SIGNAL_RMS>"<<e_rms<<"</SIGNAL_RMS>\n";
1630  xmlFile<<" <TIME_MEAN>"<<t<<"</TIME_MEAN>\n";
1631  xmlFile<<" <TIME_RMS>"<<t_rms<<"</TIME_RMS>\n";
1632  xmlFile<<" <CHANNEL_STATUS_WORD>"<<Status<<"</CHANNEL_STATUS_WORD>\n";
1633  xmlFile<<" <CHANNEL_OBJECTNAME>HcalDetId</CHANNEL_OBJECTNAME>\n";
1634  xmlFile<<" <SUBDET>"<<subdet<<"</SUBDET>\n";
1635  xmlFile<<" <IETA>"<<eta<<"</IETA>\n";
1636  xmlFile<<" <IPHI>"<<phi<<"</IPHI>\n";
1637  xmlFile<<" <DEPTH>"<<depth<<"</DEPTH>\n";
1638  xmlFile<<" <TYPE>0</TYPE>\n";
1639  xmlFile<<" </DATA>\n";
1640  }
1642  xmlFile<<" </DATA_SET>\n";
1643  xmlFile<<"</ROOT>\n";
1644  xmlFile.close();
1645 
1646 
1647  //create CALIB XML file
1648  sprintf(str,"HcalDetDiagLaserCalib_%i_%i.xml",run_number,dataset_seq_number);
1649  std::string xmlNameCalib=str;
1650  ofstream xmlFileCalib;
1651  xmlFileCalib.open(xmlNameCalib.c_str());
1652 
1653  xmlFileCalib<<"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\n";
1654  xmlFileCalib<<"<ROOT>\n";
1655  xmlFileCalib<<" <HEADER>\n";
1656  xmlFileCalib<<" <HINTS mode='only-det-root'/>\n";
1657  xmlFileCalib<<" <TYPE>\n";
1658  xmlFileCalib<<" <EXTENSION_TABLE_NAME>HCAL_DETMON_LED_LASER_V1</EXTENSION_TABLE_NAME>\n";
1659  xmlFileCalib<<" <NAME>HCAL Laser CALIB [abort gap global]</NAME>\n";
1660  xmlFileCalib<<" </TYPE>\n";
1661  xmlFileCalib<<" <!-- run details -->\n";
1662  xmlFileCalib<<" <RUN>\n";
1663  xmlFileCalib<<" <RUN_TYPE>Global-RUN</RUN_TYPE>\n";
1664  xmlFileCalib<<" <RUN_NUMBER>"<<run_number<<"</RUN_NUMBER>\n";
1665  xmlFileCalib<<" <RUN_BEGIN_TIMESTAMP>2009-01-01 00:00:00</RUN_BEGIN_TIMESTAMP>\n";
1666  xmlFileCalib<<" <COMMENT_DESCRIPTION>hcal Laser CALIB data</COMMENT_DESCRIPTION>\n";
1667  xmlFileCalib<<" <LOCATION>P5</LOCATION>\n";
1668  xmlFileCalib<<" <INITIATED_BY_USER>dma</INITIATED_BY_USER>\n";
1669  xmlFileCalib<<" </RUN>\n";
1670  xmlFileCalib<<" </HEADER>\n";
1671  xmlFileCalib<<" <DATA_SET>\n";
1672  xmlFileCalib<<" <!-- optional dataset metadata -->\n\n";
1673  xmlFileCalib<<" <SET_NUMBER>"<<dataset_seq_number<<"</SET_NUMBER>\n";
1674  xmlFileCalib<<" <SET_BEGIN_TIMESTAMP>2009-01-01 00:00:00</SET_BEGIN_TIMESTAMP>\n";
1675  xmlFileCalib<<" <SET_END_TIMESTAMP>2009-01-01 00:00:00</SET_END_TIMESTAMP>\n";
1676  xmlFileCalib<<" <NUMBER_OF_EVENTS_IN_SET>"<<ievt_<<"</NUMBER_OF_EVENTS_IN_SET>\n";
1677  xmlFileCalib<<" <COMMENT_DESCRIPTION>Automatic DQM output</COMMENT_DESCRIPTION>\n";
1678  xmlFileCalib<<" <DATA_FILE_NAME>"<< xmlNameCalib <<"</DATA_FILE_NAME>\n";
1679  xmlFileCalib<<" <IMAGE_FILE_NAME>data plot url or file path</IMAGE_FILE_NAME>\n";
1680  xmlFileCalib<<" <!-- who and when created this dataset-->\n\n";
1681  xmlFileCalib<<" <CREATE_TIMESTAMP>"<<TIME<<"</CREATE_TIMESTAMP>\n";
1682  xmlFileCalib<<" <CREATED_BY_USER>dma</CREATED_BY_USER>\n";
1683  xmlFileCalib<<" <!-- version (string) and subversion (number) -->\n";
1684  xmlFileCalib<<" <!-- fields are used to read data back from the database -->\n\n";
1685  xmlFileCalib<<" <VERSION>"<<run_number<<dataset_seq_number<<"</VERSION>\n";
1686  xmlFileCalib<<" <SUBVERSION>1</SUBVERSION>\n";
1687  xmlFileCalib<<" <!-- Assign predefined dataset attributes -->\n\n";
1688  xmlFileCalib<<" <PREDEFINED_ATTRIBUTES>\n";
1689  xmlFileCalib<<" <ATTRIBUTE>\n";
1690  xmlFileCalib<<" <NAME>HCAL Dataset Status</NAME>\n";
1691  xmlFileCalib<<" <VALUE>VALID</VALUE>\n";
1692  xmlFileCalib<<" </ATTRIBUTE>\n";
1693  xmlFileCalib<<" </PREDEFINED_ATTRIBUTES>\n";
1694  xmlFileCalib<<" <!-- multiple data block records -->\n\n";
1695 
1696  for(int sd=1;sd<=4;sd++) for(int eta=-2;eta<=2;eta++) for(int phi=1;phi<=72;phi++){
1697  std::string subdet="";
1698  if(sd==1) subdet="HB";
1699  if(sd==2) subdet="HE";
1700  if(sd==3) subdet="HO";
1701  if(sd==4) subdet="HF";
1702  if((calib_data[sd][eta+2][phi-1].get_statistics())>100){
1703  double e=0,e_rms=0,t=0,t_rms=0;
1704  Status=calib_data[sd][eta+2][phi-1].get_status();
1705  Statistic=calib_data[sd][eta+2][phi-1].get_statistics1();
1706  calib_data[sd][eta+2][phi-1].get_average_amp1(&e,&e_rms);
1707  calib_data[sd][eta+2][phi-1].get_average_time1(&t,&t_rms);
1708  xmlFileCalib<<" <DATA>\n";
1709  xmlFileCalib<<" <NUMBER_OF_EVENTS_USED>"<<Statistic<<"</NUMBER_OF_EVENTS_USED>\n";
1710  xmlFileCalib<<" <SIGNAL_MEAN>"<<e<<"</SIGNAL_MEAN>\n";
1711  xmlFileCalib<<" <SIGNAL_RMS>"<<e_rms<<"</SIGNAL_RMS>\n";
1712  xmlFileCalib<<" <TIME_MEAN>"<<t<<"</TIME_MEAN>\n";
1713  xmlFileCalib<<" <TIME_RMS>"<<t_rms<<"</TIME_RMS>\n";
1714  xmlFileCalib<<" <CHANNEL_STATUS_WORD>"<<Status<<"</CHANNEL_STATUS_WORD>\n";
1715  xmlFileCalib<<" <CHANNEL_OBJECTNAME>HcalDetId</CHANNEL_OBJECTNAME>\n";
1716  xmlFileCalib<<" <SUBDET>"<<subdet<<"</SUBDET>\n";
1717  xmlFileCalib<<" <IETA>"<<eta<<"</IETA>\n";
1718  xmlFileCalib<<" <IPHI>"<<phi<<"</IPHI>\n";
1719  xmlFileCalib<<" <DEPTH>"<<0<<"</DEPTH>\n";
1720  xmlFileCalib<<" <TYPE>0</TYPE>\n";
1721  xmlFileCalib<<" </DATA>\n";
1722  }
1723  }
1725  xmlFileCalib<<" </DATA_SET>\n";
1726  xmlFileCalib<<"</ROOT>\n";
1727  xmlFileCalib.close();
1728 
1729  sprintf(str,"zip %s.zip %s %s",xmlName.c_str(),xmlName.c_str(),xmlNameCalib.c_str());
1730  system(str);
1731  sprintf(str,"rm -f %s %s",xmlName.c_str(),xmlNameCalib.c_str());
1732  system(str);
1733  sprintf(str,"mv -f %s.zip %s",xmlName.c_str(),XmlFilePath.c_str());
1734  system(str);
1735 
1736  }
1737  for(int i=0;i<85;i++)for(int j=0;j<72;j++)for(int k=0;k<4;k++) hb_data[i][j][k].reset1();
1738  for(int i=0;i<85;i++)for(int j=0;j<72;j++)for(int k=0;k<4;k++) he_data[i][j][k].reset1();
1739  for(int i=0;i<85;i++)for(int j=0;j<72;j++)for(int k=0;k<4;k++) ho_data[i][j][k].reset1();
1740  for(int i=0;i<85;i++)for(int j=0;j<72;j++)for(int k=0;k<4;k++) hf_data[i][j][k].reset1();
1741  for(int i=1;i<=4;i++)for(int j=-2;j<=2;j++)for(int k=1;k<=72;k++)calib_data[i][j][k].reset1();
1742  ievt_=0;
1744 }
1746 double amp,rms,time,time_rms;
1747 int Eta,Phi,Depth;
1748 char subdet[10];
1749 TFile *f;
1750  if(gSystem->AccessPathName(ReferenceData.c_str())) return;
1751  f = new TFile(ReferenceData.c_str(),"READ");
1752 
1753  if(!f->IsOpen()) return ;
1754  TObjString *STR=(TObjString *)f->Get("run number");
1755 
1756  if(STR){ std::string Ref(STR->String()); ReferenceRun=Ref;}
1757 
1758  TTree* t=(TTree*)f->Get("HCAL Laser data");
1759  if(!t) return;
1760  t->SetBranchAddress("Subdet", subdet);
1761  t->SetBranchAddress("eta", &Eta);
1762  t->SetBranchAddress("phi", &Phi);
1763  t->SetBranchAddress("depth", &Depth);
1764  t->SetBranchAddress("amp", &amp);
1765  t->SetBranchAddress("rms", &rms);
1766  t->SetBranchAddress("time", &time);
1767  t->SetBranchAddress("time_rms", &time_rms);
1768  for(int ievt=0;ievt<t->GetEntries();ievt++){
1769  t->GetEntry(ievt);
1770  if(strcmp(subdet,"HB")==0) hb_data[Eta+42][Phi-1][Depth-1].set_reference(amp,rms,time,time_rms);
1771  if(strcmp(subdet,"HE")==0) he_data[Eta+42][Phi-1][Depth-1].set_reference(amp,rms,time,time_rms);
1772  if(strcmp(subdet,"HO")==0) ho_data[Eta+42][Phi-1][Depth-1].set_reference(amp,rms,time,time_rms);
1773  if(strcmp(subdet,"HF")==0) hf_data[Eta+42][Phi-1][Depth-1].set_reference(amp,rms,time,time_rms);
1774  if(strcmp(subdet,"CALIB_HB")==0) calib_data[1][Eta+2][Phi-1].set_reference(amp,rms,time,time_rms);
1775  if(strcmp(subdet,"CALIB_HE")==0) calib_data[2][Eta+2][Phi-1].set_reference(amp,rms,time,time_rms);
1776  if(strcmp(subdet,"CALIB_HO")==0) calib_data[3][Eta+2][Phi-1].set_reference(amp,rms,time,time_rms);
1777  if(strcmp(subdet,"CALIB_HF")==0) calib_data[4][Eta+2][Phi-1].set_reference(amp,rms,time,time_rms);
1778  }
1779  f->Close();
1780  IsReference=true;
1781 }
1783 double amp,rms,time,time_rms;
1784 int Eta,Phi,Depth,Statistic;
1785 char subdet[10];
1786 TFile *f;
1787  if(DatasetName.size()==0) return;
1788  createHTMLonly=true;
1789  if(gSystem->AccessPathName(DatasetName.c_str())) return;
1790  f = new TFile(DatasetName.c_str(),"READ");
1791 
1792  if(!f->IsOpen()) return ;
1793 
1794  TTree* t=0;
1795  t=(TTree*)f->Get("HCAL Laser data");
1796  if(!t) return;
1797  t->SetBranchAddress("Subdet", subdet);
1798  t->SetBranchAddress("eta", &Eta);
1799  t->SetBranchAddress("phi", &Phi);
1800  t->SetBranchAddress("depth", &Depth);
1801  t->SetBranchAddress("amp", &amp);
1802  t->SetBranchAddress("rms", &rms);
1803  t->SetBranchAddress("time", &time);
1804  t->SetBranchAddress("time_rms", &time_rms);
1805  t->SetBranchAddress("statistic",&Statistic);
1806  for(int ievt=0;ievt<t->GetEntries();ievt++){
1807  t->GetEntry(ievt);
1808  if(strcmp(subdet,"HB")==0){ nHB++;
1809  hb_data[Eta+42][Phi-1][Depth-1].set_data(amp,rms,time,time_rms);
1810  hb_data[Eta+42][Phi-1][Depth-1].set_statistics(Statistic);
1811  hb_data[Eta+42][Phi-1][Depth-1].set_statistics1(Statistic);
1812  }
1813  if(strcmp(subdet,"HE")==0){ nHE++;
1814  he_data[Eta+42][Phi-1][Depth-1].set_data(amp,rms,time,time_rms);
1815  he_data[Eta+42][Phi-1][Depth-1].set_statistics(Statistic);
1816  he_data[Eta+42][Phi-1][Depth-1].set_statistics1(Statistic);
1817  }
1818  if(strcmp(subdet,"HO")==0){ nHO++;
1819  ho_data[Eta+42][Phi-1][Depth-1].set_data(amp,rms,time,time_rms);
1820  ho_data[Eta+42][Phi-1][Depth-1].set_statistics(Statistic);
1821  ho_data[Eta+42][Phi-1][Depth-1].set_statistics1(Statistic);
1822  }
1823  if(strcmp(subdet,"HF")==0){ nHF++;
1824  hf_data[Eta+42][Phi-1][Depth-1].set_data(amp,rms,time,time_rms);
1825  hf_data[Eta+42][Phi-1][Depth-1].set_statistics(Statistic);
1826  hf_data[Eta+42][Phi-1][Depth-1].set_statistics1(Statistic);
1827  }
1828  if(strcmp(subdet,"CALIB_HB")==0){
1829  calib_data[1][Eta+2][Phi-1].set_data(amp,rms,time,time_rms);
1830  calib_data[1][Eta+2][Phi-1].set_statistics(Statistic);
1831  calib_data[1][Eta+2][Phi-1].set_statistics1(Statistic);
1832  }
1833  if(strcmp(subdet,"CALIB_HE")==0){
1834  calib_data[2][Eta+2][Phi-1].set_data(amp,rms,time,time_rms);
1835  calib_data[2][Eta+2][Phi-1].set_statistics(Statistic);
1836  calib_data[2][Eta+2][Phi-1].set_statistics1(Statistic);
1837  }
1838  if(strcmp(subdet,"CALIB_HO")==0){
1839  calib_data[3][Eta+2][Phi-1].set_data(amp,rms,time,time_rms);
1840  calib_data[3][Eta+2][Phi-1].set_statistics(Statistic);
1841  calib_data[3][Eta+2][Phi-1].set_statistics1(Statistic);
1842  }
1843  if(strcmp(subdet,"CALIB_HF")==0){
1844  calib_data[4][Eta+2][Phi-1].set_data(amp,rms,time,time_rms);
1845  calib_data[4][Eta+2][Phi-1].set_statistics(Statistic);
1846  calib_data[4][Eta+2][Phi-1].set_statistics1(Statistic);
1847  }
1848  }
1849  TObjString *STR1=(TObjString *)f->Get("run number");
1850  if(STR1){ int run; sscanf(STR1->String(),"%i",&run); meRUN_->Fill(run); run_number=run;}
1851 
1852  TObjString *STR2=(TObjString *)f->Get("Total events processed");
1853  if(STR2){ int events; sscanf(STR2->String(),"%i",&events); meEVT_->Fill(events); ievt_=events;}
1854 
1855  TObjString *STR3=(TObjString *)f->Get("Dataset number");
1856  if(STR3){ int ds; sscanf(STR3->String(),"%i",&ds); dataset_seq_number=ds;}
1857  f->Close();
1858 }
1859 
1861 float adc_range[20]={14,28,40,52,67,132,202,262,322,397,722,1072,1372,1672,2047,3672,5422,6922,8422,10297};
1862 int adc_bins[20]={1,2,3,4,5,5,10,15,20,25,25,50,75,100,125,125,250,375,500,625};
1863 char str[100];
1864  TF1 *fitFunc = new TF1("fitFunc","gaus");
1865  if(fitFunc==0) return;
1866  for(int i=0;i<56;i++){
1867  float sum1=0,sum2=0,n=0;
1868  S1[i]=S2[i]=0;
1869  for(int j=0;j<128;j++){
1870  sum1+=(adc2fC[j]-2.5)*Raddam_data[i].s1_adc[j];
1871  sum2+=(adc2fC[j]-2.5)*Raddam_data[i].s2_adc[j];
1872  n+=Raddam_data[i].s1_adc[j];
1873  }
1874  if(n<100) continue;
1875  sum1=sum1/n;
1876  sum2=sum2/n;
1877  int N=0;
1878  int Ws1=1,Ws2=1;
1879  for(N=1;N<19;N++) if(sum1>adc_range[N-1] && sum1<adc_range[N]) break;
1880  Ws1=adc_bins[N+1];
1881  for(N=1;N<19;N++) if(sum2>adc_range[N-1] && sum2<adc_range[N]) break;
1882  Ws2=adc_bins[N+1];
1883  sprintf(str,"Raddam(%i,%i,%i) S1",RADDAM_CH[i].eta,RADDAM_CH[i].phi,RADDAM_CH[i].depth);
1884  S1[i]=new TH1F(str,str,10000/Ws1,0,10000);
1885  sprintf(str,"Raddam(%i,%i,%i) S2",RADDAM_CH[i].eta,RADDAM_CH[i].phi,RADDAM_CH[i].depth);
1886  S2[i]=new TH1F(str,str,10000/Ws1,0,10000);
1887  for(int j=0;j<128;j++){
1888  S1[i]->Fill(adc2fC[j]-2.5,Raddam_data[i].s1_adc[j]);
1889  S2[i]->Fill(adc2fC[j]-2.5,Raddam_data[i].s2_adc[j]);
1890  }
1891  double parm[3];
1892  S1[i]->Fit("fitFunc");
1893  S1[i]->GetFunction("fitFunc")->GetParameters(parm);
1894  Raddam_data[i].S1MEAN=S1[i]->GetMean();
1895  Raddam_data[i].S1RMS=S1[i]->GetRMS();
1896  Raddam_data[i].S1FITMEAN=parm[1];
1897  Raddam_data[i].S1FITMEANER=S1[i]->GetFunction("fitFunc")->GetParError(1);
1898  Raddam_data[i].S1FITSIGMA=parm[2];
1899  Raddam_data[i].S1CHI2=S1[i]->GetFunction("fitFunc")->GetChisquare();
1900  Raddam_data[i].S1NDF=S1[i]->GetFunction("fitFunc")->GetNDF();
1901  Raddam_data[i].S1BINWIDTH=Ws1;
1902  S2[i]->Fit("fitFunc");
1903  S2[i]->GetFunction("fitFunc")->GetParameters(parm);
1904  Raddam_data[i].S2MEAN=S2[i]->GetMean();
1905  Raddam_data[i].S2RMS=S2[i]->GetRMS();
1906  Raddam_data[i].S2FITMEAN=parm[1];
1907  Raddam_data[i].S2FITMEANER=S2[i]->GetFunction("fitFunc")->GetParError(1);
1908  Raddam_data[i].S2FITSIGMA=parm[2];
1909  Raddam_data[i].S2CHI2=S2[i]->GetFunction("fitFunc")->GetChisquare();
1910  Raddam_data[i].S2NDF=S2[i]->GetFunction("fitFunc")->GetNDF();
1911  Raddam_data[i].S2BINWIDTH=Ws2;
1912  }
1913  if(XmlFilePath.size()>0){
1914  char TIME[40];
1915  Long_t t; t=time(0); strftime(TIME,30,"%F %T",localtime(&t));
1916  //create XML file
1917  if(!Overwrite){
1918  sprintf(str,"HcalDetDiagRaddam_%i_%i.xml",run_number,dataset_seq_number);
1919  }else{
1920  sprintf(str,"HcalDetDiagRaddam.xml");
1921  }
1922  std::string xmlName=str;
1923  ofstream xmlFile;
1924  xmlFile.open(xmlName.c_str());
1925  xmlFile<<"<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\" ?>\n";
1926  xmlFile<<"<ROOT>\n";
1927  xmlFile<<" <HEADER>\n";
1928  xmlFile<<" <TYPE>\n";
1929  xmlFile<<" <EXTENSION_TABLE_NAME>HCAL_RADDAM</EXTENSION_TABLE_NAME>\n";
1930  xmlFile<<" <NAME>HCAL Raddam</NAME>\n";
1931  xmlFile<<" </TYPE>\n";
1932  xmlFile<<" <!-- run details -->\n";
1933  xmlFile<<" <RUN>\n";
1934  xmlFile<<" <RUN_TYPE>TEST LOCAL-RUN</RUN_TYPE>\n";
1935  xmlFile<<" <RUN_NUMBER>"<<run_number<<"</RUN_NUMBER>\n";
1936  xmlFile<<" <RUN_BEGIN_TIMESTAMP>"<<TIME<<"</RUN_BEGIN_TIMESTAMP>\n";
1937  xmlFile<<" <COMMENT_DESCRIPTION>hcal raddam data</COMMENT_DESCRIPTION>\n";
1938  xmlFile<<" <LOCATION>P5</LOCATION>\n";
1939  xmlFile<<" <INITIATED_BY_USER>dma</INITIATED_BY_USER>\n";
1940  xmlFile<<" </RUN>\n";
1941  xmlFile<<" </HEADER>\n";
1942  xmlFile<<" <DATA_SET>\n";
1943  xmlFile<<" <COMMENT_DESCRIPTION>Test Raddam data</COMMENT_DESCRIPTION>\n";
1944  xmlFile<<" <CREATE_TIMESTAMP>"<<TIME<<"</CREATE_TIMESTAMP>\n";
1945  xmlFile<<" <CREATED_BY_USER>dma</CREATED_BY_USER>\n";
1946  xmlFile<<" <VERSION>Test_Version_1</VERSION>\n";
1947 
1948  for(int i=0;i<56;i++){
1949  xmlFile<<" <DATA>\n";
1950  xmlFile<<" <SUBDET>HF</SUBDET>\n";
1951  xmlFile<<" <IETA>"<<RADDAM_CH[i].eta<<"</IETA>\n";
1952  xmlFile<<" <IPHI>"<<RADDAM_CH[i].phi<<"</IPHI>\n";
1953  xmlFile<<" <DEPTH>"<<RADDAM_CH[i].depth<<"</DEPTH>\n";
1954 
1955  xmlFile<<" <TOTEVNT>"<<Raddam_data[i].TOTEVNT<<"</TOTEVNT>\n";
1956  xmlFile<<" <CUT1EVNT>"<<Raddam_data[i].CUT1EVNT<<"</CUT1EVNT>\n";
1957  xmlFile<<" <CUT2EVNT>"<<Raddam_data[i].CUT2EVNT<<"</CUT2EVNT>\n";
1958 
1959  xmlFile<<" <S1MEAN>"<<Raddam_data[i].S1MEAN <<"</S1MEAN>\n";
1960  xmlFile<<" <S1RMS>"<<Raddam_data[i].S1RMS <<"</S1RMS>\n";
1961  xmlFile<<" <S1FITMEAN>"<<Raddam_data[i].S1FITMEAN <<"</S1FITMEAN>\n";
1962  xmlFile<<" <S1FITMEANER>"<<Raddam_data[i].S1FITMEANER <<"</S1FITMEANER>\n";
1963  xmlFile<<" <S1FITSIGMA>"<<Raddam_data[i].S1FITSIGMA <<"</S1FITSIGMA>\n";
1964  xmlFile<<" <S1CHI2>"<<Raddam_data[i].S1CHI2 <<"</S1CHI2>\n";
1965  xmlFile<<" <S1NDF>"<<Raddam_data[i].S1NDF <<"</S1NDF>\n";
1966  xmlFile<<" <S1BINWIDTH>"<<Raddam_data[i].S1BINWIDTH <<"</S1BINWIDTH>\n";
1967 
1968  xmlFile<<" <S2MEAN>"<<Raddam_data[i].S2MEAN <<"</S2MEAN>\n";
1969  xmlFile<<" <S2RMS>"<<Raddam_data[i].S2RMS <<"</S2RMS>\n";
1970  xmlFile<<" <S2FITMEAN>"<<Raddam_data[i].S2FITMEAN <<"</S2FITMEAN>\n";
1971  xmlFile<<" <S2FITMEANER>"<<Raddam_data[i].S2FITMEANER <<"</S2FITMEANER>\n";
1972  xmlFile<<" <S2FITSIGMA>"<<Raddam_data[i].S2FITSIGMA <<"</S2FITSIGMA>\n";
1973  xmlFile<<" <S2CHI2>"<<Raddam_data[i].S2CHI2 <<"</S2CHI2>\n";
1974  xmlFile<<" <S2NDF>"<<Raddam_data[i].S2NDF <<"</S2NDF>\n";
1975  xmlFile<<" <S2BINWIDTH>"<<Raddam_data[i].S2BINWIDTH <<"</S2BINWIDTH>\n";
1976  xmlFile<<" </DATA>\n";
1977  }
1978  xmlFile<<" </DATA_SET>\n";
1979  xmlFile<<"</ROOT>\n";
1980 
1981  xmlFile.close();
1982  sprintf(str,"zip %s.zip %s",xmlName.c_str(),xmlName.c_str());
1983  system(str);
1984  sprintf(str,"rm -f %s",xmlName.c_str());
1985  system(str);
1986  sprintf(str,"mv -f %s.zip %s",xmlName.c_str(),XmlFilePath.c_str());
1987  system(str);
1988  }
1989  if(OutputFilePath.size()>0){
1990  if(!Overwrite){
1991  sprintf(str,"%sHcalDetDiagRaddamData_run%06i_%i.root",OutputFilePath.c_str(),run_number,dataset_seq_number);
1992  }else{
1993  sprintf(str,"%sHcalDetDiagRaddamData.root",OutputFilePath.c_str());
1994  }
1995  TFile *theFile = new TFile(str, "RECREATE");
1996  if(!theFile->IsOpen()) return;
1997  theFile->cd();
1998  for(int i=0;i<56;i++){
1999  if(S1[i]!=0)S1[i]->Write();
2000  if(S2[i]!=0)S2[i]->Write();
2001  }
2002  theFile->Write();
2003  theFile->Close();
2004  }
2005 }
2006 
2008  if(RaddamRun){
2009  SaveRaddamData();
2010  }
2011  if((LocalRun || !Online_ || createHTMLonly) && ievt_>10){
2019  if(!RaddamRun)SaveReference();
2020  }
2021 }
2022 
2025 
2026 //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
void setBinContent(int binx, double content)
set content of bin (1-D)
void add_statistics(double *data, int nTS)
std::vector< HcalElectronicsId > allElectronicsIdPrecision() const
double GetEnergy(double *data, int n)
HcalDetDiagLaserData * GetCalib(std::string sd, int eta, int phi)
virtual void analyze(const edm::Event &e, const edm::EventSetup &c)
void set_reference(float val, float rms, float time, float time_rms)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
void setAxisRange(double xmin, double xmax, int axis=1)
set x-, y- or z-axis range (axis=1, 2, 3 respectively)
bool get_average_amp(double *ave, double *rms)
void beginLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
bool get_average_amp1(double *ave, double *rms)
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
void beginRun(const edm::Run &run, const edm::EventSetup &c)
static const float adc2fC[128]
const HcalElectronicsMap * emap
std::vector< T >::const_iterator const_iterator
void setup(DQMStore *&m_dbe, std::string Name, std::string Units="")
void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
#define abs(x)
Definition: mlp_lapack.h:159
bool getByType(Handle< PROD > &result) const
Definition: Event.h:398
#define min(a, b)
Definition: mlp_lapack.h:161
bool get_ave_subdet(int sd, float *ave_t, float *ave_e, float *ave_t_r, float *ave_e_r)
HcalRaddamData Raddam_data[56]
T eta() const
bool get_ave_rbx(int sd, int side, int rbx, float *ave, float *rms)
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:49
bool get_average_time(double *ave, double *rms)
std::map< unsigned int, int > KnownBadCells_
void Fill(long long x)
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
Raddam_ch RADDAM_CH[56]
void endRun(const edm::Run &run, const edm::EventSetup &c)
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
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:683
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
std::vector< DetId > getAllChannels() const
T sqrt(T t)
Definition: SSEVec.h:46
int ieta() const
get the cell ieta
Definition: HcalDetId.h:38
int j
Definition: DBlmapReader.cc:9
double f[11][100]
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
int orbitNumber() const
Definition: EventBase.h:63
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:356
int k[5][pyjets_maxn]
int iphi() const
get the cell iphi
Definition: HcalDetId.h:40
Definition: DetId.h:20
HcalDetDiagLaserData hb_data[85][72][4]
HcalDetDiagLaserMonitor(const edm::ParameterSet &)
bool get_average_time1(double *ave, double *rms)
#define N
Definition: blowfish.cc:9
double sd
const T & get() const
Definition: EventSetup.h:55
#define PHI
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)
double GetTime(double *data, int n=10)
edm::EventID id() const
Definition: EventBase.h:56
HcalDetDiagLaserData hf_data[85][72][4]
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
tuple events
Definition: patZpeak.py:19
void analyze(const edm::Event &, const edm::EventSetup &)
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
bool get_reference(double *val, double *rms, double *time, double *time_rms)
void set_data(float val, float rms, float time, float time_rms)
dictionary rawdata
Definition: lumiPlot.py:393
tuple status
Definition: ntuplemaker.py:245
HcalDetDiagLaserData he_data[85][72][4]
MonitorElement * bookInt(const char *name)
Book int.
Definition: DQMStore.cc:624
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
Definition: DQMStore.cc:845
virtual void setup(void)
const Item * getValues(DetId fId) const
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
long double T
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
std::vector< std::string > problemnames_
void Reset(void)
reset ME (ie. contents, errors, etc)
HcalDetDiagLaserData ho_data[85][72][4]
void endLuminosityBlock(const edm::LuminosityBlock &lumiSeg, const edm::EventSetup &c)
HcalDetDiagLaserData calib_data[5][5][72]
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
TrackTransientTrack TTT
Definition: Run.h:33
Definition: DDAxes.h:10