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