CMS 3D CMS Logo

RemoteMonitoringGLOBAL.cc
Go to the documentation of this file.
1 // How to run:
2 //root -b -q -l RemoteMonitoringGLOBAL.C+
3 //root -b -q -l 'RemoteMonitoringGLOBAL.C+("/afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/CMTweb/histos/Global_190707.root")'
4 
5 #include "LogEleMapdb.h"
6 
7 #include <iostream>
8 #include <fstream>
9 
10 #include "TH1.h"
11 #include "TH2.h"
12 #include "TCanvas.h"
13 #include "TROOT.h"
14 #include <TMath.h>
15 #include "TStyle.h"
16 #include "TSystem.h"
17 #include "TLegend.h"
18 #include "TText.h"
19 #include "TAxis.h"
20 #include "TFile.h"
21 #include "TLine.h"
22 #include "TGraph.h"
23 #include <THStack.h>
24 #include <TPaveText.h>
25 
26 // https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT
27 // https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/CMT
28 
29 using namespace std;
30 //inline void HERE(const char *msg) { std::cout << msg << std::endl; } kfitq
31 int copyContents(TH1F **hDest, TString hname, TString htitle, const TH1F *hSrc, int lastBin);
32 
33 // -----------------------------------------------------
34 
35 int main(int argc, char *argv[]) {
36  gROOT->Reset();
37  gROOT->SetStyle("Plain");
38  gStyle->SetOptStat(0);
39  gStyle->SetOptTitle(1);
40 
41  if (argc < 1)
42  return 1;
43  char fname[300];
44  sprintf(fname, "%s", argv[1]);
45  std::cout << fname << std::endl;
46 
47  //======================================================================
48  // Connect the input files, parameters and get the 2-d histogram in memory
49  // TFile *hfile= new TFile("GlobalHist.root", "READ");
50  string promt = (string)fname;
51  string runnumber = "";
52  for (unsigned int i = promt.size() - 11; i < promt.size() - 5; i++)
53  runnumber += fname[i];
54 
55  TFile *hfile = new TFile(fname, "READ");
56  // Cut [test][sub][depth]
57  // Empty HB HE HO HF
58  double Cut0[7][5][8] = {
59  {{0., 0., 0., 0., 0., 0., 0., 0.},
60  {0., 1.0, 1.0, 0., 0., 0., 0., 0.},
61  {0., 1., 1., 1., 0., 0., 0., 0.},
62  {0., 0., 0., 0., 1., 0., 0., 0.},
63  {0., 1., 1., 0., 0., 0., 0., 0.}}, //CapID 0,HB,HE,HO,HF
64  // {{0.,0.,0.,0.,0.,0.,0.,0.}, {0.,35.,35.,0.,0.,0.,0.,0.}, {0.,100.,140.,150.,0.,0.,0.,0.}, {0.,0.,0.,0.,100.,0.,0.,0.}, {0.,170.,110.,170.,110.,0.,0.,0.} }, //Amplitude 0,HB,HE,HO,HF
65  {{0., 0., 0., 0., 0., 0., 0., 0.},
66  {0., 3500., 3500., 3500., 3500., 0., 0., 0.},
67  {0., 12000., 4500., 3500., 3500., 4000., 4500., 5500.},
68  {0., 0., 0., 0., 200., 0., 0., 0.},
69  {0., 4500., 4500., 4500., 4500., 0., 0., 0.}}, //Amplitude 0,HB,HE,HO,HF
70  {{0., 0., 0., 0., 0., 0., 0., 0.},
71  {0., 3., 3., 0., 0., 0., 0., 0.},
72  {0., 3., 3., 3., 0., 0., 0., 0.},
73  {0., 0., 0., 0., 3., 0., 0., 0.},
74  {0., 2., 2., 0., 0., 0., 0., 0.}}, //Width 0,HB,HE,HO,HF
75  {{0., 0., 0., 0., 0., 0., 0., 0.},
76  {0., 0.4, 0.4, 0., 0., 0., 0., 0.},
77  {0., 0.4, 0.4, 0.4, 0., 0., 0., 0.},
78  {0., 0., 0., 0., 0.4, 0., 0., 0.},
79  {0., 0.8, 0.8, 0., 0., 0., 0., 0.}}, //Ratio 0,HB,HE,HO,HF
80  {{0., 0., 0., 0., 0., 0., 0., 0.},
81  {0., 4.7, 4.7, 0., 0., 0., 0., 0.},
82  {0., 4.8, 4.8, 5.0, 0., 0., 0., 0.},
83  {0., 0., 0., 0., 4.8, 0., 0., 0.},
84  {0., 4.0, 4.0, 0., 0., 0., 0., 0.}}, //TSn 0,HB,HE,HO,HF
85  {{0., 0., 0., 0., 0., 0., 0., 0.},
86  {0., 3.5, 3.5, 0., 0., 0., 0., 0.},
87  {0., 4.0, 4.0, 4.0, 0., 0., 0., 0.},
88  {0., 0., 0., 0., 3., 0., 0., 0.},
89  {0., 3.5, 3.5, 0., 0., 0., 0., 0.}}, //TSx 0,HB,HE,HO,HF
90  {{0., 0., 0., 0., 0., 0., 0., 0.},
91  {0., 0., 0., 0., 0., 0., 0., 0.},
92  {0., 0., 0., 0., 0., 0., 0., 0.},
93  {0., 0., 0., 0., 0., 0., 0., 0.},
94  {0., 0., 0., 0., 0., 0., 0., 0.}}}; //Empty
95 
96  double CutAb[5][8] = {{0., 0., 0., 0., 0., 0., 0., 0.},
97  {0., 20., 7., 0., 0., 0., 0., 0.},
98  {0., 16., 13., 4., 0., 0., 0., 0.},
99  {0., 0., 0., 0., 45., 0., 0., 0.},
100  {0., 10., 5., 0., 0., 0., 0., 0.}}; // cut 1 for CapIdErrors 0,HB,HE,HO,HF
101 
102  double CutPo[5][8] = {{0., 0., 0., 0., 0., 0., 0., 0.},
103  {0., 9., 3., 0., 0., 0., 0., 0.},
104  {0., 8., 6., 2., 0., 0., 0., 0.},
105  {0., 0., 0., 0., 20., 0., 0., 0.},
106  {0., 5., 3., 0., 0., 0., 0., 0.}}; //cut 3 for CapIdErrors (portions) 0,HB,HE,HO,HF
107 
108  //======================================================================
109 
110  // CUTs FOR IPHI RBX:
111  int cutA_HB = 100;
112  int cutA_HE = 6000;
113  int cutA_HO = 150;
114  int cutA_HF = 500;
115  // CUTs FOR IETA RBX:
116  int cutB_HB = 100;
117  int cutB_HE = 10000;
118  int cutB_HO = 150;
119  int cutB_HF = 500;
120 
121  //======================================================================
122  // Prepare histograms and plot them to .png files
123  TCanvas *c1 = new TCanvas("c1", "Hcal4test", 200, 10, 700, 900);
124 
125  TCanvas *cHB = new TCanvas("cHB", "cHB", 1000, 500);
126  TCanvas *cHE = new TCanvas("cHE", "cHE", 1500, 500);
127  TCanvas *cONE = new TCanvas("cONE", "cONE", 500, 500);
128  TCanvas *cFour = new TCanvas("cFour", "cFour", 1500, 1000);
129  TCanvas *cFour1 = new TCanvas("cFour1", "cFour1", 1200, 800);
130  TCanvas *cNine = new TCanvas("cNine", "cNine", 1500, 1500);
131 
132  // RBX:
133  // TCanvas *c4x6 = new TCanvas("c4x6","c4x6",1500,3000);
134  TCanvas *c4x6 = new TCanvas("c4x6", "c4x6", 1200, 2400);
135  //TCanvas *c5x6 = new TCanvas("c5x6","c5x6",2000,3000);
136  TCanvas *c5x6 = new TCanvas("c5x6", "c5x6", 1500, 2400);
137  // TCanvas *cRBX1 = new TCanvas("cRBX1","cRBX1",200,10,1300,1110);
138  TCanvas *cRBX1 = new TCanvas("cRBX1", "cRBX1", 1200, 1000);
139  //
140  // TCanvas *cRBX31 = new TCanvas("cRBX31","cRBX31",1800,600);
141  TCanvas *cRBX31 = new TCanvas("cRBX31", "cRBX31", 1860, 600);
142  // TCanvas *cRBX31 = new TCanvas("cRBX31","cRBX31",200,10,,1800,600);
143 
144  // char *str = (char*)alloca(10000);
145 
146  int k_min[5] = {0, 1, 1, 4, 1}; // minimum depth for each subdet HB HE HO HF
147 
148  int k_max[5] = {0, 2, 3, 4, 2}; // maximum depth for each subdet HB HE HO HF
149  // int k_maxupgrade[5]={0,2,3,4,4}; // maximum depth for each subdet HB HE HO HF
150  int k_maxupgrade[5] = {0, 4, 7, 4, 4}; // maximum depth for each subdet HB HE HO HF
151 
152  //+++++++++++++++++++++++++++++
153  // Lumi iLumi and number of events
154  //+++++++++++++++++++++++++++++
155  cHB->Divide(2, 1);
156  cHB->cd(1);
157  TH1F *LumLum = (TH1F *)hfile->Get("h_lsnumber_per_eachLS");
158  int MaxLumDanila = LumLum->GetBinContent(LumLum->GetMaximumBin()); // old variant of Danila
159  cout << " MaxLumDanila= " << MaxLumDanila << endl;
160  gPad->SetGridy();
161  gPad->SetGridx();
162  LumLum->SetMarkerStyle(10);
163  LumLum->SetMarkerSize(0.8);
164  LumLum->GetYaxis()->SetLabelSize(0.04);
165  LumLum->SetTitle("Cont. number per LS \b");
166  LumLum->SetXTitle("Cont.number \b");
167  LumLum->SetYTitle("Ls \b");
168  LumLum->SetMarkerColor(4);
169  LumLum->SetLineColor(0);
170  LumLum->SetMinimum(0.8);
171  LumLum->GetXaxis()->SetRangeUser(0, MaxLumDanila);
172  LumLum->Draw("Error");
173 
174  cHB->cd(2);
175  TH1F *LumiEv = (TH1F *)hfile->Get("h_nevents_per_eachRealLS");
176  int MaxLum0 = LumiEv->GetBinContent(LumiEv->GetMaximumBin());
177  int MaxLum = 0;
178  for (int i = 1; i <= LumiEv->GetXaxis()->GetNbins(); i++) {
179  if (LumiEv->GetBinContent(i)) {
180  MaxLum = i;
181  }
182  }
183  cout << " MaxLum0= " << MaxLum0 << " MaxLum= " << MaxLum << endl;
184 
185  gPad->SetGridy();
186  gPad->SetGridx();
187  gPad->SetLogy();
188  // gPad->SetLogx();
189  LumiEv->GetYaxis()->SetLabelSize(0.04);
190  LumiEv->SetTitle("Number of events per LS");
191  LumiEv->SetXTitle("LS");
192  LumiEv->SetYTitle("Number of events ");
193  LumiEv->SetMarkerStyle(10);
194  LumiEv->SetMarkerSize(0.8);
195  LumiEv->SetMarkerColor(4);
196  LumiEv->SetLineColor(0);
197  // LumiEv->SetMinimum(0.8);
198  LumiEv->GetXaxis()->SetRangeUser(0, MaxLum);
199  LumiEv->Draw("Error");
200 
201  cHB->Print("LumiEvent.png");
202  cHB->Clear();
203 
204  //=======================================================================================================
205  // Shape criteria: 1d histogram first definition
206  //=======================================================================================================
207  TH1F *H_NumBadChanDepth[7][5][5]; // 1d histogramm for test,subdet, depth
208 
209  //+++++++++++++++++++++++++++++
210  // ADC Amplitude
211  //+++++++++++++++++++++++++++++
212 
213  H_NumBadChanDepth[1][1][1] = (TH1F *)hfile->Get("h_sumADCAmplLS1");
214  H_NumBadChanDepth[1][1][2] = (TH1F *)hfile->Get("h_sumADCAmplLS2");
215 
216  H_NumBadChanDepth[1][2][1] = (TH1F *)hfile->Get("h_sumADCAmplLS3");
217  H_NumBadChanDepth[1][2][2] = (TH1F *)hfile->Get("h_sumADCAmplLS4");
218  H_NumBadChanDepth[1][2][3] = (TH1F *)hfile->Get("h_sumADCAmplLS5");
219 
220  H_NumBadChanDepth[1][3][4] = (TH1F *)hfile->Get("h_sumADCAmplLS8");
221 
222  H_NumBadChanDepth[1][4][1] = (TH1F *)hfile->Get("h_sumADCAmplLS6");
223  H_NumBadChanDepth[1][4][2] = (TH1F *)hfile->Get("h_sumADCAmplLS7");
224 
225  //+++++++++++++++++++++++++++++
226  // Width
227  //+++++++++++++++++++++++++++++
228 
229  H_NumBadChanDepth[2][1][1] = (TH1F *)hfile->Get("h_sumAmplitudeLS1");
230  H_NumBadChanDepth[2][1][2] = (TH1F *)hfile->Get("h_sumAmplitudeLS2");
231 
232  H_NumBadChanDepth[2][2][1] = (TH1F *)hfile->Get("h_sumAmplitudeLS3");
233  H_NumBadChanDepth[2][2][2] = (TH1F *)hfile->Get("h_sumAmplitudeLS4");
234  H_NumBadChanDepth[2][2][3] = (TH1F *)hfile->Get("h_sumAmplitudeLS5");
235 
236  H_NumBadChanDepth[2][3][4] = (TH1F *)hfile->Get("h_sumAmplitudeLS8");
237 
238  H_NumBadChanDepth[2][4][1] = (TH1F *)hfile->Get("h_sumAmplitudeLS6");
239  H_NumBadChanDepth[2][4][2] = (TH1F *)hfile->Get("h_sumAmplitudeLS7");
240 
241  //+++++++++++++++++++++++++++++
242  // Ratio
243  //+++++++++++++++++++++++++++++
244 
245  H_NumBadChanDepth[3][1][1] = (TH1F *)hfile->Get("h_sumAmplLS1");
246  H_NumBadChanDepth[3][1][2] = (TH1F *)hfile->Get("h_sumAmplLS2");
247 
248  H_NumBadChanDepth[3][2][1] = (TH1F *)hfile->Get("h_sumAmplLS3");
249  H_NumBadChanDepth[3][2][2] = (TH1F *)hfile->Get("h_sumAmplLS4");
250  H_NumBadChanDepth[3][2][3] = (TH1F *)hfile->Get("h_sumAmplLS5");
251 
252  H_NumBadChanDepth[3][3][4] = (TH1F *)hfile->Get("h_sumAmplLS8");
253 
254  H_NumBadChanDepth[3][4][1] = (TH1F *)hfile->Get("h_sumAmplLS6");
255  H_NumBadChanDepth[3][4][2] = (TH1F *)hfile->Get("h_sumAmplLS7");
256 
257  //+++++++++++++++++++++++++++++
258  // Tmean
259  //+++++++++++++++++++++++++++++
260 
261  H_NumBadChanDepth[4][1][1] = (TH1F *)hfile->Get("h_sumTSmeanALS1");
262  H_NumBadChanDepth[4][1][2] = (TH1F *)hfile->Get("h_sumTSmeanALS2");
263 
264  H_NumBadChanDepth[4][2][1] = (TH1F *)hfile->Get("h_sumTSmeanALS3");
265  H_NumBadChanDepth[4][2][2] = (TH1F *)hfile->Get("h_sumTSmeanALS4");
266  H_NumBadChanDepth[4][2][3] = (TH1F *)hfile->Get("h_sumTSmeanALS5");
267 
268  H_NumBadChanDepth[4][3][4] = (TH1F *)hfile->Get("h_sumTSmeanALS8");
269 
270  H_NumBadChanDepth[4][4][1] = (TH1F *)hfile->Get("h_sumTSmeanALS6");
271  H_NumBadChanDepth[4][4][2] = (TH1F *)hfile->Get("h_sumTSmeanALS7");
272 
273  //+++++++++++++++++++++++++++++
274  // Tmax
275  //+++++++++++++++++++++++++++++
276 
277  H_NumBadChanDepth[5][1][1] = (TH1F *)hfile->Get("h_sumTSmaxALS1");
278  H_NumBadChanDepth[5][1][2] = (TH1F *)hfile->Get("h_sumTSmaxALS2");
279 
280  H_NumBadChanDepth[5][2][1] = (TH1F *)hfile->Get("h_sumTSmaxALS3");
281  H_NumBadChanDepth[5][2][2] = (TH1F *)hfile->Get("h_sumTSmaxALS4");
282  H_NumBadChanDepth[5][2][3] = (TH1F *)hfile->Get("h_sumTSmaxALS5");
283 
284  H_NumBadChanDepth[5][3][4] = (TH1F *)hfile->Get("h_sumTSmaxALS8");
285 
286  H_NumBadChanDepth[5][4][1] = (TH1F *)hfile->Get("h_sumTSmaxALS6");
287  H_NumBadChanDepth[5][4][2] = (TH1F *)hfile->Get("h_sumTSmaxALS7");
288 
289  gStyle->SetOptStat(110000);
290 
291  for (int test = 1; test <= 5; test++) { //Test: 0,
292  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
293  if (sub == 1)
294  cHB->Divide(2, 1);
295  if (sub == 2)
296  cHE->Divide(3, 1);
297  if (sub == 3)
298  cONE->Divide(1, 1);
299  if (sub == 4)
300  cHB->Divide(2, 1);
301  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
302  if (sub == 1)
303  cHB->cd(k);
304  if (sub == 2)
305  cHE->cd(k);
306  if (sub == 3)
307  cONE->cd(k - 3);
308  if (sub == 4)
309  cHB->cd(k);
310  gPad->SetGridy();
311  gPad->SetGridx();
312  gPad->SetLogy();
313  H_NumBadChanDepth[test][sub][k]->SetMarkerStyle(20);
314  H_NumBadChanDepth[test][sub][k]->SetMarkerSize(0.8);
315  if (k == 1)
316  H_NumBadChanDepth[test][sub][k]->SetTitle("Depth 1\b");
317  if (k == 2)
318  H_NumBadChanDepth[test][sub][k]->SetTitle("Depth 2\b");
319  if (k == 3)
320  H_NumBadChanDepth[test][sub][k]->SetTitle("Depth 3\b");
321  if (k == 4)
322  H_NumBadChanDepth[test][sub][k]->SetTitle("Depth 4\b");
323  if (test == 1)
324  H_NumBadChanDepth[test][sub][k]->SetXTitle(" <Amplitude> \b");
325  if (test == 2)
326  H_NumBadChanDepth[test][sub][k]->SetXTitle(" <Width> \b");
327  if (test == 3)
328  H_NumBadChanDepth[test][sub][k]->SetXTitle(" <Ratio> \b");
329  if (test == 4)
330  H_NumBadChanDepth[test][sub][k]->SetXTitle(" <TS mean> \b");
331  if (test == 5)
332  H_NumBadChanDepth[test][sub][k]->SetXTitle(" <TS max> \b");
333  H_NumBadChanDepth[test][sub][k]->SetYTitle("Number of channel-LSs\b");
334  H_NumBadChanDepth[test][sub][k]->SetMarkerColor(4);
335  H_NumBadChanDepth[test][sub][k]->SetLineColor(0);
336  // H_NumBadChanDepth[test][sub][k]->GetXaxis()->SetRangeUser(0, MaxLum);
337  H_NumBadChanDepth[test][sub][k]->SetMinimum(0.8);
338  H_NumBadChanDepth[test][sub][k]->Draw("Error");
339  }
340  if (test == 0) {
341  if (sub == 1) {
342  cHB->Print("H_NBCMNHB.png");
343  cHB->Clear();
344  }
345  if (sub == 2) {
346  cHE->Print("H_NBCMNHE.png");
347  cHE->Clear();
348  }
349  if (sub == 3) {
350  cONE->Print("H_NBCMNHO.png");
351  cONE->Clear();
352  }
353  if (sub == 4) {
354  cHB->Print("H_NBCMNHF.png");
355  cHB->Clear();
356  }
357  }
358 
359  if (test == 1) {
360  if (sub == 1) {
361  cHB->Print("H_ADCamplHB.png");
362  cHB->Clear();
363  }
364  if (sub == 2) {
365  cHE->Print("H_ADCamplHE.png");
366  cHE->Clear();
367  }
368  if (sub == 3) {
369  cONE->Print("H_ADCamplHO.png");
370  cONE->Clear();
371  }
372  if (sub == 4) {
373  cHB->Print("H_ADCamplHF.png");
374  cHB->Clear();
375  }
376  }
377  if (test == 2) {
378  if (sub == 1) {
379  cHB->Print("H_WidthHB.png");
380  cHB->Clear();
381  }
382  if (sub == 2) {
383  cHE->Print("H_WidthHE.png");
384  cHE->Clear();
385  }
386  if (sub == 3) {
387  cONE->Print("H_WidthHO.png");
388  cONE->Clear();
389  }
390  if (sub == 4) {
391  cHB->Print("H_WidthHF.png");
392  cHB->Clear();
393  }
394  }
395  if (test == 3) {
396  if (sub == 1) {
397  cHB->Print("H_RatioHB.png");
398  cHB->Clear();
399  }
400  if (sub == 2) {
401  cHE->Print("H_RatioHE.png");
402  cHE->Clear();
403  }
404  if (sub == 3) {
405  cONE->Print("H_RatioHO.png");
406  cONE->Clear();
407  }
408  if (sub == 4) {
409  cHB->Print("H_RatioHF.png");
410  cHB->Clear();
411  }
412  }
413  if (test == 4) {
414  if (sub == 1) {
415  cHB->Print("H_TmeanHB.png");
416  cHB->Clear();
417  }
418  if (sub == 2) {
419  cHE->Print("H_TmeanHE.png");
420  cHE->Clear();
421  }
422  if (sub == 3) {
423  cONE->Print("H_TmeanHO.png");
424  cONE->Clear();
425  }
426  if (sub == 4) {
427  cHB->Print("H_TmeanHF.png");
428  cHB->Clear();
429  }
430  }
431  if (test == 5) {
432  if (sub == 1) {
433  cHB->Print("H_TmaxHB.png");
434  cHB->Clear();
435  }
436  if (sub == 2) {
437  cHE->Print("H_TmaxHE.png");
438  cHE->Clear();
439  }
440  if (sub == 3) {
441  cONE->Print("H_TmaxHO.png");
442  cONE->Clear();
443  }
444  if (sub == 4) {
445  cHB->Print("H_TmaxHF.png");
446  cHB->Clear();
447  }
448  }
449  } // end sub
450  } //end test
451 
452  gStyle->SetOptStat(0);
453  //================================================================================================================================
454 
455  //=======================================================================================================
456  // 2-d histograms second definition
457  //=========================================================
458  TH2F *MapNumBadChanDepth[7][5][5]; // 1d Mapogramm for test,subdet, depth
459  TH2F *MapNumChanDepth[7][5][5]; // 1d Mapogramm for test,subdet, depth
460  TH2F *MapNumBadChanFull[7]; // 1d Mapogramm for test
461  TH2F *MapNumChanFull[7]; // 1d Mapogramm for test
462 
463  //+++++++++++++++++++++++++++++
464  // CapID
465  //+++++++++++++++++++++++++++++
466 
467  MapNumBadChanDepth[0][1][1] = (TH2F *)hfile->Get("h_mapDepth1Error_HB");
468  MapNumBadChanDepth[0][1][2] = (TH2F *)hfile->Get("h_mapDepth2Error_HB");
469 
470  MapNumBadChanDepth[0][2][1] = (TH2F *)hfile->Get("h_mapDepth1Error_HE");
471  MapNumBadChanDepth[0][2][2] = (TH2F *)hfile->Get("h_mapDepth2Error_HE");
472  MapNumBadChanDepth[0][2][3] = (TH2F *)hfile->Get("h_mapDepth3Error_HE");
473 
474  MapNumBadChanDepth[0][3][4] = (TH2F *)hfile->Get("h_mapDepth4Error_HO");
475 
476  MapNumBadChanDepth[0][4][1] = (TH2F *)hfile->Get("h_mapDepth1Error_HF");
477  MapNumBadChanDepth[0][4][2] = (TH2F *)hfile->Get("h_mapDepth2Error_HF");
478 
479  MapNumBadChanFull[0] = (TH2F *)MapNumBadChanDepth[0][1][1]->Clone();
480 
481  MapNumChanDepth[0][1][1] = (TH2F *)hfile->Get("h_mapDepth1_HB");
482  MapNumChanDepth[0][1][2] = (TH2F *)hfile->Get("h_mapDepth2_HB");
483 
484  MapNumChanDepth[0][2][1] = (TH2F *)hfile->Get("h_mapDepth1_HE");
485  MapNumChanDepth[0][2][2] = (TH2F *)hfile->Get("h_mapDepth2_HE");
486  MapNumChanDepth[0][2][3] = (TH2F *)hfile->Get("h_mapDepth3_HE");
487 
488  MapNumChanDepth[0][3][4] = (TH2F *)hfile->Get("h_mapDepth4_HO");
489 
490  MapNumChanDepth[0][4][1] = (TH2F *)hfile->Get("h_mapDepth1_HF");
491  MapNumChanDepth[0][4][2] = (TH2F *)hfile->Get("h_mapDepth2_HF");
492 
493  MapNumChanFull[0] = (TH2F *)MapNumChanDepth[0][1][1]->Clone();
494 
495  //+++++++++++++++++++++++++++++
496  // ADC Amplitude
497  //+++++++++++++++++++++++++++++
498 
499  MapNumBadChanDepth[1][1][1] = (TH2F *)hfile->Get("h_2DsumADCAmplLS1");
500  MapNumBadChanDepth[1][1][2] = (TH2F *)hfile->Get("h_2DsumADCAmplLS2");
501 
502  MapNumBadChanDepth[1][2][1] = (TH2F *)hfile->Get("h_2DsumADCAmplLS3");
503  MapNumBadChanDepth[1][2][2] = (TH2F *)hfile->Get("h_2DsumADCAmplLS4");
504  MapNumBadChanDepth[1][2][3] = (TH2F *)hfile->Get("h_2DsumADCAmplLS5");
505 
506  MapNumBadChanDepth[1][3][4] = (TH2F *)hfile->Get("h_2DsumADCAmplLS8");
507 
508  MapNumBadChanDepth[1][4][1] = (TH2F *)hfile->Get("h_2DsumADCAmplLS6");
509  MapNumBadChanDepth[1][4][2] = (TH2F *)hfile->Get("h_2DsumADCAmplLS7");
510 
511  MapNumBadChanFull[1] = (TH2F *)MapNumBadChanDepth[1][1][1]->Clone();
512 
513  MapNumChanDepth[1][1][1] = (TH2F *)hfile->Get("h_2D0sumADCAmplLS1");
514  MapNumChanDepth[1][1][2] = (TH2F *)hfile->Get("h_2D0sumADCAmplLS2");
515 
516  MapNumChanDepth[1][2][1] = (TH2F *)hfile->Get("h_2D0sumADCAmplLS3");
517  MapNumChanDepth[1][2][2] = (TH2F *)hfile->Get("h_2D0sumADCAmplLS4");
518  MapNumChanDepth[1][2][3] = (TH2F *)hfile->Get("h_2D0sumADCAmplLS5");
519 
520  MapNumChanDepth[1][3][4] = (TH2F *)hfile->Get("h_2D0sumADCAmplLS8");
521 
522  MapNumChanDepth[1][4][1] = (TH2F *)hfile->Get("h_2D0sumADCAmplLS6");
523  MapNumChanDepth[1][4][2] = (TH2F *)hfile->Get("h_2D0sumADCAmplLS7");
524 
525  MapNumChanFull[1] = (TH2F *)MapNumChanDepth[1][1][1]->Clone();
526 
527  //+++++++++++++++++++++++++++++
528  // Width
529  //+++++++++++++++++++++++++++++
530 
531  MapNumBadChanDepth[2][1][1] = (TH2F *)hfile->Get("h_2DsumAmplitudeLS1");
532  MapNumBadChanDepth[2][1][2] = (TH2F *)hfile->Get("h_2DsumAmplitudeLS2");
533 
534  MapNumBadChanDepth[2][2][1] = (TH2F *)hfile->Get("h_2DsumAmplitudeLS3");
535  MapNumBadChanDepth[2][2][2] = (TH2F *)hfile->Get("h_2DsumAmplitudeLS4");
536  MapNumBadChanDepth[2][2][3] = (TH2F *)hfile->Get("h_2DsumAmplitudeLS5");
537 
538  MapNumBadChanDepth[2][3][4] = (TH2F *)hfile->Get("h_2DsumAmplitudeLS8");
539 
540  MapNumBadChanDepth[2][4][1] = (TH2F *)hfile->Get("h_2DsumAmplitudeLS6");
541  MapNumBadChanDepth[2][4][2] = (TH2F *)hfile->Get("h_2DsumAmplitudeLS7");
542 
543  MapNumBadChanFull[2] = (TH2F *)MapNumBadChanDepth[2][1][1]->Clone();
544 
545  MapNumChanDepth[2][1][1] = (TH2F *)hfile->Get("h_2D0sumAmplitudeLS1");
546  MapNumChanDepth[2][1][2] = (TH2F *)hfile->Get("h_2D0sumAmplitudeLS2");
547 
548  MapNumChanDepth[2][2][1] = (TH2F *)hfile->Get("h_2D0sumAmplitudeLS3");
549  MapNumChanDepth[2][2][2] = (TH2F *)hfile->Get("h_2D0sumAmplitudeLS4");
550  MapNumChanDepth[2][2][3] = (TH2F *)hfile->Get("h_2D0sumAmplitudeLS5");
551 
552  MapNumChanDepth[2][3][4] = (TH2F *)hfile->Get("h_2D0sumAmplitudeLS8");
553 
554  MapNumChanDepth[2][4][1] = (TH2F *)hfile->Get("h_2D0sumAmplitudeLS6");
555  MapNumChanDepth[2][4][2] = (TH2F *)hfile->Get("h_2D0sumAmplitudeLS7");
556 
557  MapNumChanFull[2] = (TH2F *)MapNumChanDepth[2][1][1]->Clone();
558 
559  //+++++++++++++++++++++++++++++
560  // Ratio
561  //+++++++++++++++++++++++++++++
562 
563  MapNumBadChanDepth[3][1][1] = (TH2F *)hfile->Get("h_2DsumAmplLS1");
564  MapNumBadChanDepth[3][1][2] = (TH2F *)hfile->Get("h_2DsumAmplLS2");
565 
566  MapNumBadChanDepth[3][2][1] = (TH2F *)hfile->Get("h_2DsumAmplLS3");
567  MapNumBadChanDepth[3][2][2] = (TH2F *)hfile->Get("h_2DsumAmplLS4");
568  MapNumBadChanDepth[3][2][3] = (TH2F *)hfile->Get("h_2DsumAmplLS5");
569 
570  MapNumBadChanDepth[3][3][4] = (TH2F *)hfile->Get("h_2DsumAmplLS8");
571 
572  MapNumBadChanDepth[3][4][1] = (TH2F *)hfile->Get("h_2DsumAmplLS6");
573  MapNumBadChanDepth[3][4][2] = (TH2F *)hfile->Get("h_2DsumAmplLS7");
574 
575  MapNumBadChanFull[3] = (TH2F *)MapNumBadChanDepth[3][1][1]->Clone();
576 
577  MapNumChanDepth[3][1][1] = (TH2F *)hfile->Get("h_2D0sumAmplLS1");
578  MapNumChanDepth[3][1][2] = (TH2F *)hfile->Get("h_2D0sumAmplLS2");
579 
580  MapNumChanDepth[3][2][1] = (TH2F *)hfile->Get("h_2D0sumAmplLS3");
581  MapNumChanDepth[3][2][2] = (TH2F *)hfile->Get("h_2D0sumAmplLS4");
582  MapNumChanDepth[3][2][3] = (TH2F *)hfile->Get("h_2D0sumAmplLS5");
583 
584  MapNumChanDepth[3][3][4] = (TH2F *)hfile->Get("h_2D0sumAmplLS8");
585 
586  MapNumChanDepth[3][4][1] = (TH2F *)hfile->Get("h_2D0sumAmplLS6");
587  MapNumChanDepth[3][4][2] = (TH2F *)hfile->Get("h_2D0sumAmplLS7");
588 
589  MapNumChanFull[3] = (TH2F *)MapNumChanDepth[3][1][1]->Clone();
590 
591  //+++++++++++++++++++++++++++++
592  // Tmean
593  //+++++++++++++++++++++++++++++
594 
595  MapNumBadChanDepth[4][1][1] = (TH2F *)hfile->Get("h_2DsumTSmeanALS1");
596  MapNumBadChanDepth[4][1][2] = (TH2F *)hfile->Get("h_2DsumTSmeanALS2");
597 
598  MapNumBadChanDepth[4][2][1] = (TH2F *)hfile->Get("h_2DsumTSmeanALS3");
599  MapNumBadChanDepth[4][2][2] = (TH2F *)hfile->Get("h_2DsumTSmeanALS4");
600  MapNumBadChanDepth[4][2][3] = (TH2F *)hfile->Get("h_2DsumTSmeanALS5");
601 
602  MapNumBadChanDepth[4][3][4] = (TH2F *)hfile->Get("h_2DsumTSmeanALS8");
603 
604  MapNumBadChanDepth[4][4][1] = (TH2F *)hfile->Get("h_2DsumTSmeanALS6");
605  MapNumBadChanDepth[4][4][2] = (TH2F *)hfile->Get("h_2DsumTSmeanALS7");
606 
607  MapNumBadChanFull[4] = (TH2F *)MapNumBadChanDepth[4][1][1]->Clone();
608 
609  MapNumChanDepth[4][1][1] = (TH2F *)hfile->Get("h_2D0sumTSmeanALS1");
610  MapNumChanDepth[4][1][2] = (TH2F *)hfile->Get("h_2D0sumTSmeanALS2");
611 
612  MapNumChanDepth[4][2][1] = (TH2F *)hfile->Get("h_2D0sumTSmeanALS3");
613  MapNumChanDepth[4][2][2] = (TH2F *)hfile->Get("h_2D0sumTSmeanALS4");
614  MapNumChanDepth[4][2][3] = (TH2F *)hfile->Get("h_2D0sumTSmeanALS5");
615 
616  MapNumChanDepth[4][3][4] = (TH2F *)hfile->Get("h_2D0sumTSmeanALS8");
617 
618  MapNumChanDepth[4][4][1] = (TH2F *)hfile->Get("h_2D0sumTSmeanALS6");
619  MapNumChanDepth[4][4][2] = (TH2F *)hfile->Get("h_2D0sumTSmeanALS7");
620 
621  MapNumChanFull[4] = (TH2F *)MapNumChanDepth[4][1][1]->Clone();
622 
623  //+++++++++++++++++++++++++++++
624  // Tmax
625  //+++++++++++++++++++++++++++++
626 
627  MapNumBadChanDepth[5][1][1] = (TH2F *)hfile->Get("h_2DsumTSmaxALS1");
628  MapNumBadChanDepth[5][1][2] = (TH2F *)hfile->Get("h_2DsumTSmaxALS2");
629 
630  MapNumBadChanDepth[5][2][1] = (TH2F *)hfile->Get("h_2DsumTSmaxALS3");
631  MapNumBadChanDepth[5][2][2] = (TH2F *)hfile->Get("h_2DsumTSmaxALS4");
632  MapNumBadChanDepth[5][2][3] = (TH2F *)hfile->Get("h_2DsumTSmaxALS5");
633 
634  MapNumBadChanDepth[5][3][4] = (TH2F *)hfile->Get("h_2DsumTSmaxALS8");
635 
636  MapNumBadChanDepth[5][4][1] = (TH2F *)hfile->Get("h_2DsumTSmaxALS6");
637  MapNumBadChanDepth[5][4][2] = (TH2F *)hfile->Get("h_2DsumTSmaxALS7");
638 
639  MapNumBadChanFull[5] = (TH2F *)MapNumBadChanDepth[5][1][1]->Clone();
640 
641  MapNumChanDepth[5][1][1] = (TH2F *)hfile->Get("h_2D0sumTSmaxALS1");
642  MapNumChanDepth[5][1][2] = (TH2F *)hfile->Get("h_2D0sumTSmaxALS2");
643 
644  MapNumChanDepth[5][2][1] = (TH2F *)hfile->Get("h_2D0sumTSmaxALS3");
645  MapNumChanDepth[5][2][2] = (TH2F *)hfile->Get("h_2D0sumTSmaxALS4");
646  MapNumChanDepth[5][2][3] = (TH2F *)hfile->Get("h_2D0sumTSmaxALS5");
647 
648  MapNumChanDepth[5][3][4] = (TH2F *)hfile->Get("h_2D0sumTSmaxALS8");
649 
650  MapNumChanDepth[5][4][1] = (TH2F *)hfile->Get("h_2D0sumTSmaxALS6");
651  MapNumChanDepth[5][4][2] = (TH2F *)hfile->Get("h_2D0sumTSmaxALS7");
652 
653  MapNumChanFull[5] = (TH2F *)MapNumChanDepth[5][1][1]->Clone();
654 
655  for (int test = 0; test <= 5; test++) { //Test: 0,
656  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
657  if (sub == 1)
658  cHB->Divide(2, 1);
659  if (sub == 2)
660  cHE->Divide(3, 1);
661  if (sub == 3)
662  cONE->Divide(1, 1);
663  if (sub == 4)
664  cHB->Divide(2, 1);
665  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
666  if (sub == 1)
667  cHB->cd(k);
668  if (sub == 2)
669  cHE->cd(k);
670  if (sub == 3)
671  cONE->cd(k - 3);
672  if (sub == 4)
673  cHB->cd(k);
674  MapNumBadChanDepth[test][sub][k]->Divide(
675  MapNumBadChanDepth[test][sub][k], MapNumChanDepth[test][sub][k], 1, 1, "B");
676 
677  for (int x = 1; x <= MapNumBadChanFull[test]->GetXaxis()->GetNbins(); x++) {
678  for (int y = 1; y <= MapNumBadChanFull[test]->GetYaxis()->GetNbins(); y++) {
679  double ccc1 = MapNumBadChanDepth[test][sub][k]->GetBinContent(x, y);
680  MapNumBadChanFull[test]->SetBinContent(x, y, MapNumBadChanFull[test]->GetBinContent(x, y) + ccc1);
681  } //end y
682  } //end x
683 
684  if (k == 1)
685  MapNumBadChanDepth[test][sub][k]->SetTitle("Depth 1\b");
686  if (k == 2)
687  MapNumBadChanDepth[test][sub][k]->SetTitle("Depth 2\b");
688  if (k == 3)
689  MapNumBadChanDepth[test][sub][k]->SetTitle("Depth 3\b");
690  if (k == 4)
691  MapNumBadChanDepth[test][sub][k]->SetTitle("Depth 4\b");
692  gPad->SetGridy();
693  gPad->SetGridx();
694  gPad->SetLogz();
695  MapNumBadChanDepth[test][sub][k]->SetXTitle("#eta \b");
696  MapNumBadChanDepth[test][sub][k]->SetYTitle("#phi \b");
697  MapNumBadChanDepth[test][sub][k]->SetZTitle("Average estimator \b");
698  MapNumBadChanDepth[test][sub][k]->SetTitleOffset(0.75, "Z");
699  MapNumBadChanDepth[test][sub][k]->Draw("COLZ");
700  MapNumBadChanDepth[test][sub][k]->GetYaxis()->SetRangeUser(0, 72.);
701  // MapNumBadChanDepth[test][sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
702  }
703  if (test == 0) {
704  if (sub == 1) {
705  cHB->Print("MapCapIdErrorHB.png");
706  cHB->Clear();
707  }
708  if (sub == 2) {
709  cHE->Print("MapCapIdErrorHE.png");
710  cHE->Clear();
711  }
712  if (sub == 3) {
713  cONE->Print("MapCapIdErrorHO.png");
714  cONE->Clear();
715  }
716  if (sub == 4) {
717  cHB->Print("MapCapIdErrorHF.png");
718  cHB->Clear();
719  }
720  }
721  if (test == 1) {
722  if (sub == 1) {
723  cHB->Print("MapADCamplHB.png");
724  cHB->Clear();
725  }
726  if (sub == 2) {
727  cHE->Print("MapADCamplHE.png");
728  cHE->Clear();
729  }
730  if (sub == 3) {
731  cONE->Print("MapADCamplHO.png");
732  cONE->Clear();
733  }
734  if (sub == 4) {
735  cHB->Print("MapADCamplHF.png");
736  cHB->Clear();
737  }
738  }
739  if (test == 2) {
740  if (sub == 1) {
741  cHB->Print("MapWidthHB.png");
742  cHB->Clear();
743  }
744  if (sub == 2) {
745  cHE->Print("MapWidthHE.png");
746  cHE->Clear();
747  }
748  if (sub == 3) {
749  cONE->Print("MapWidthHO.png");
750  cONE->Clear();
751  }
752  if (sub == 4) {
753  cHB->Print("MapWidthHF.png");
754  cHB->Clear();
755  }
756  }
757  if (test == 3) {
758  if (sub == 1) {
759  cHB->Print("MapRatioHB.png");
760  cHB->Clear();
761  }
762  if (sub == 2) {
763  cHE->Print("MapRatioHE.png");
764  cHE->Clear();
765  }
766  if (sub == 3) {
767  cONE->Print("MapRatioHO.png");
768  cONE->Clear();
769  }
770  if (sub == 4) {
771  cHB->Print("MapRatioHF.png");
772  cHB->Clear();
773  }
774  }
775  if (test == 4) {
776  if (sub == 1) {
777  cHB->Print("MapTmeanHB.png");
778  cHB->Clear();
779  }
780  if (sub == 2) {
781  cHE->Print("MapTmeanHE.png");
782  cHE->Clear();
783  }
784  if (sub == 3) {
785  cONE->Print("MapTmeanHO.png");
786  cONE->Clear();
787  }
788  if (sub == 4) {
789  cHB->Print("MapTmeanHF.png");
790  cHB->Clear();
791  }
792  }
793  if (test == 5) {
794  if (sub == 1) {
795  cHB->Print("MapTmaxHB.png");
796  cHB->Clear();
797  }
798  if (sub == 2) {
799  cHE->Print("MapTmaxHE.png");
800  cHE->Clear();
801  }
802  if (sub == 3) {
803  cONE->Print("MapTmaxHO.png");
804  cONE->Clear();
805  }
806  if (sub == 4) {
807  cHB->Print("MapTmaxHF.png");
808  cHB->Clear();
809  }
810  }
811  } // end sub
812  cONE->Divide(1, 1);
813  cONE->cd(1);
814  gPad->SetGridy();
815  gPad->SetGridx();
816  gPad->SetLogz();
817  MapNumBadChanFull[test]->SetTitle("All subdetectors\b");
818  MapNumBadChanFull[test]->SetXTitle("#eta \b");
819  MapNumBadChanFull[test]->SetYTitle("#phi \b");
820  if (test == 0)
821  MapNumBadChanFull[test]->SetZTitle("Average Nbcs \b");
822  if (test != 0)
823  MapNumBadChanFull[test]->SetZTitle("Average estimator \b");
824  // MapNumBadChanFull[test]->GetZaxis()->SetLabelSize(0.008);
825  MapNumBadChanFull[test]->SetTitleOffset(0.75, "Z");
826  MapNumBadChanFull[test]->Draw("COLZ");
827  MapNumBadChanFull[test]->GetYaxis()->SetRangeUser(0, 72.);
828  // MapNumBadChanFull[test]->GetZaxis()->SetRangeUser(0.0001, 1.);
829  if (test == 0) {
830  cONE->Print("MapCapIdError.png");
831  cONE->Clear();
832  }
833  if (test == 1) {
834  cONE->Print("MapADCAmpl.png");
835  cONE->Clear();
836  }
837  if (test == 2) {
838  cONE->Print("MapWidth.png");
839  cONE->Clear();
840  }
841  if (test == 3) {
842  cONE->Print("MapRatio.png");
843  cONE->Clear();
844  }
845  if (test == 4) {
846  cONE->Print("MapTmean.png");
847  cONE->Clear();
848  }
849  if (test == 5) {
850  cONE->Print("MapTmax.png");
851  cONE->Clear();
852  }
853  } //end test
854 
855  //================================================================================================================================
856 
857  //=======================================================================================================
858  // 1-d histograms third definition
859 
860  TH1F *HistNumBadChanDepth[7][5][8]; // 1d histogramm for test,subdet, depth
861  TH1F *HistCutNumBadChanDepth[7][5][8]; // 1d histogramm for test,subdet, depth
862  TH1F *HistNumChanDepth[7][5][8]; // 1d histogramm for test,subdet, depth
863 
864  // TH1F *HistNumBadChanDepth[7][5][5]; // 1d histogramm for test,subdet, depth
865  // TH1F *HistCutNumBadChanDepth[7][5][5]; // 1d histogramm for test,subdet, depth
866  // TH1F *HistNumChanDepth[7][5][5]; // 1d histogramm for test,subdet, depth
867 
868  TH1F *HistNumBadChanFull[7]; // 1d histogramm for test
869  TH1F *HistNumChanFull[7]; // 1d histogramm for test
870 
871  //+++++++++++++++++++++++++++++
872  // Rate of Cap ID errors
873  //+++++++++++++++++++++++++++++
874 
875  HistNumBadChanDepth[0][1][1] = (TH1F *)hfile->Get("h_runnbadchannels_depth1_HB");
876  HistNumBadChanDepth[0][1][2] = (TH1F *)hfile->Get("h_runnbadchannels_depth2_HB");
877 
878  HistNumBadChanDepth[0][2][1] = (TH1F *)hfile->Get("h_runnbadchannels_depth1_HE");
879  HistNumBadChanDepth[0][2][2] = (TH1F *)hfile->Get("h_runnbadchannels_depth2_HE");
880  HistNumBadChanDepth[0][2][3] = (TH1F *)hfile->Get("h_runnbadchannels_depth3_HE");
881 
882  HistNumBadChanDepth[0][3][4] = (TH1F *)hfile->Get("h_runnbadchannels_depth4_HO");
883 
884  HistNumBadChanDepth[0][4][1] = (TH1F *)hfile->Get("h_runnbadchannels_depth1_HF");
885  HistNumBadChanDepth[0][4][2] = (TH1F *)hfile->Get("h_runnbadchannels_depth2_HF");
886 
887  HistNumBadChanFull[0] = (TH1F *)HistNumBadChanDepth[0][1][1]->Clone();
888 
889  HistCutNumBadChanDepth[0][1][1] = (TH1F *)hfile->Get("h_runnbadchannels_depth1_HB");
890  HistCutNumBadChanDepth[0][1][2] = (TH1F *)hfile->Get("h_runnbadchannels_depth2_HB");
891 
892  HistCutNumBadChanDepth[0][2][1] = (TH1F *)hfile->Get("h_runnbadchannels_depth1_HE");
893  HistCutNumBadChanDepth[0][2][2] = (TH1F *)hfile->Get("h_runnbadchannels_depth2_HE");
894  HistCutNumBadChanDepth[0][2][3] = (TH1F *)hfile->Get("h_runnbadchannels_depth3_HE");
895 
896  HistCutNumBadChanDepth[0][3][4] = (TH1F *)hfile->Get("h_runnbadchannels_depth4_HO");
897 
898  HistCutNumBadChanDepth[0][4][1] = (TH1F *)hfile->Get("h_runnbadchannels_depth1_HF");
899  HistCutNumBadChanDepth[0][4][2] = (TH1F *)hfile->Get("h_runnbadchannels_depth2_HF");
900 
901  HistNumChanDepth[0][1][1] = (TH1F *)hfile->Get("h_runbadrate0_depth1_HB");
902  HistNumChanDepth[0][1][2] = (TH1F *)hfile->Get("h_runbadrate0_depth2_HB");
903 
904  HistNumChanDepth[0][2][1] = (TH1F *)hfile->Get("h_runbadrate0_depth1_HE");
905  HistNumChanDepth[0][2][2] = (TH1F *)hfile->Get("h_runbadrate0_depth2_HE");
906  HistNumChanDepth[0][2][3] = (TH1F *)hfile->Get("h_runbadrate0_depth3_HE");
907 
908  HistNumChanDepth[0][3][4] = (TH1F *)hfile->Get("h_runbadrate0_depth4_HO");
909 
910  HistNumChanDepth[0][4][1] = (TH1F *)hfile->Get("h_runbadrate0_depth1_HF");
911  HistNumChanDepth[0][4][2] = (TH1F *)hfile->Get("h_runbadrate0_depth2_HF");
912 
913  HistNumChanFull[0] = (TH1F *)HistNumChanDepth[0][1][1]->Clone();
914 
915  //+++++++++++++++++++++++++++++
916  // ADC Amplitude
917  //+++++++++++++++++++++++++++++
918 
920  // HB:
921  HistNumBadChanDepth[1][1][1] = (TH1F *)hfile->Get("h_sumADCAmplperLS1");
922  HistNumBadChanDepth[1][1][2] = (TH1F *)hfile->Get("h_sumADCAmplperLS2");
923  // HB upgrade:
924  HistNumBadChanDepth[1][1][3] = (TH1F *)hfile->Get("h_sumADCAmplperLSdepth3HBu");
925  HistNumBadChanDepth[1][1][4] = (TH1F *)hfile->Get("h_sumADCAmplperLSdepth4HBu");
926 
927  // HE:
928  HistNumBadChanDepth[1][2][1] = (TH1F *)hfile->Get("h_sumADCAmplperLS3");
929  HistNumBadChanDepth[1][2][2] = (TH1F *)hfile->Get("h_sumADCAmplperLS4");
930  HistNumBadChanDepth[1][2][3] = (TH1F *)hfile->Get("h_sumADCAmplperLS5");
931  // HE upgrade:
932  HistNumBadChanDepth[1][2][4] = (TH1F *)hfile->Get("h_sumADCAmplperLSdepth4HEu");
933  HistNumBadChanDepth[1][2][5] = (TH1F *)hfile->Get("h_sumADCAmplperLSdepth5HEu");
934  HistNumBadChanDepth[1][2][6] = (TH1F *)hfile->Get("h_sumADCAmplperLSdepth6HEu");
935  HistNumBadChanDepth[1][2][7] = (TH1F *)hfile->Get("h_sumADCAmplperLSdepth7HEu");
936 
937  // HO:
938  HistNumBadChanDepth[1][3][4] = (TH1F *)hfile->Get("h_sumADCAmplperLS8");
939 
940  // HF:
941  HistNumBadChanDepth[1][4][1] = (TH1F *)hfile->Get("h_sumADCAmplperLS6");
942  HistNumBadChanDepth[1][4][2] = (TH1F *)hfile->Get("h_sumADCAmplperLS7");
943  // HF upgrade:
944  HistNumBadChanDepth[1][4][3] = (TH1F *)hfile->Get("h_sumADCAmplperLS6u");
945  HistNumBadChanDepth[1][4][4] = (TH1F *)hfile->Get("h_sumADCAmplperLS7u");
946 
947  // other cases:
948  HistNumBadChanFull[1] = (TH1F *)HistNumBadChanDepth[1][1][1]->Clone();
949 
951  // HB:
952  HistCutNumBadChanDepth[1][1][1] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS1");
953  HistCutNumBadChanDepth[1][1][2] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS2");
954  // HB upgrade:
955  HistCutNumBadChanDepth[1][1][3] = (TH1F *)hfile->Get("h_sumCutADCAmplperLSdepth3HBu");
956  HistCutNumBadChanDepth[1][1][4] = (TH1F *)hfile->Get("h_sumCutADCAmplperLSdepth4HBu");
957 
958  // HE:
959  HistCutNumBadChanDepth[1][2][1] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS3");
960  HistCutNumBadChanDepth[1][2][2] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS4");
961  HistCutNumBadChanDepth[1][2][3] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS5");
962  // HE upgrade:
963  HistCutNumBadChanDepth[1][2][4] = (TH1F *)hfile->Get("h_sumCutADCAmplperLSdepth4HEu");
964  HistCutNumBadChanDepth[1][2][5] = (TH1F *)hfile->Get("h_sumCutADCAmplperLSdepth5HEu");
965  HistCutNumBadChanDepth[1][2][6] = (TH1F *)hfile->Get("h_sumCutADCAmplperLSdepth6HEu");
966  HistCutNumBadChanDepth[1][2][7] = (TH1F *)hfile->Get("h_sumCutADCAmplperLSdepth7HEu");
967 
968  // HO:
969  HistCutNumBadChanDepth[1][3][4] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS8");
970 
971  // HF:
972  HistCutNumBadChanDepth[1][4][1] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS6");
973  HistCutNumBadChanDepth[1][4][2] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS7");
974  // HF upgrade:
975  HistCutNumBadChanDepth[1][4][3] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS6u");
976  HistCutNumBadChanDepth[1][4][4] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS7u");
977 
979  // HB:
980  HistNumChanDepth[1][1][1] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS1");
981  HistNumChanDepth[1][1][2] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS2");
982  // HB upgrade:
983  HistNumChanDepth[1][1][3] = (TH1F *)hfile->Get("h_sum0ADCAmplperLSdepth3HBu");
984  HistNumChanDepth[1][1][4] = (TH1F *)hfile->Get("h_sum0ADCAmplperLSdepth4HBu");
985 
986  // HE:
987  HistNumChanDepth[1][2][1] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS3");
988  HistNumChanDepth[1][2][2] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS4");
989  HistNumChanDepth[1][2][3] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS5");
990  // HE upgrade:
991  HistNumChanDepth[1][2][4] = (TH1F *)hfile->Get("h_sum0ADCAmplperLSdepth4HEu");
992  HistNumChanDepth[1][2][5] = (TH1F *)hfile->Get("h_sum0ADCAmplperLSdepth5HEu");
993  HistNumChanDepth[1][2][6] = (TH1F *)hfile->Get("h_sum0ADCAmplperLSdepth6HEu");
994  HistNumChanDepth[1][2][7] = (TH1F *)hfile->Get("h_sum0ADCAmplperLSdepth7HEu");
995 
996  // HO:
997  HistNumChanDepth[1][3][4] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS8");
998 
999  // HF:
1000  HistNumChanDepth[1][4][1] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS6");
1001  HistNumChanDepth[1][4][2] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS7");
1002  // HF upgrade:
1003  HistNumChanDepth[1][4][3] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS6u");
1004  HistNumChanDepth[1][4][4] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS7u");
1005 
1006  // other cases:
1007  HistNumChanFull[1] = (TH1F *)HistNumChanDepth[1][1][1]->Clone();
1008  // just initialization of [6] massive for alternative <A> calculation
1009  HistNumChanFull[6] = (TH1F *)HistNumChanDepth[1][1][1]->Clone();
1010 
1011  //+++++++++++++++++++++++++++++
1012  // Width
1013  //+++++++++++++++++++++++++++++
1014 
1015  HistNumBadChanDepth[2][1][1] = (TH1F *)hfile->Get("h_sumAmplitudeperLS1");
1016  HistNumBadChanDepth[2][1][2] = (TH1F *)hfile->Get("h_sumAmplitudeperLS2");
1017 
1018  HistNumBadChanDepth[2][2][1] = (TH1F *)hfile->Get("h_sumAmplitudeperLS3");
1019  HistNumBadChanDepth[2][2][2] = (TH1F *)hfile->Get("h_sumAmplitudeperLS4");
1020  HistNumBadChanDepth[2][2][3] = (TH1F *)hfile->Get("h_sumAmplitudeperLS5");
1021 
1022  HistNumBadChanDepth[2][3][4] = (TH1F *)hfile->Get("h_sumAmplitudeperLS8");
1023 
1024  HistNumBadChanDepth[2][4][1] = (TH1F *)hfile->Get("h_sumAmplitudeperLS6");
1025  HistNumBadChanDepth[2][4][2] = (TH1F *)hfile->Get("h_sumAmplitudeperLS7");
1026 
1027  HistNumBadChanFull[2] = (TH1F *)HistNumBadChanDepth[2][1][1]->Clone();
1028 
1029  HistCutNumBadChanDepth[2][1][1] = (TH1F *)hfile->Get("h_sumCutAmplitudeperLS1");
1030  HistCutNumBadChanDepth[2][1][2] = (TH1F *)hfile->Get("h_sumCutAmplitudeperLS2");
1031 
1032  HistCutNumBadChanDepth[2][2][1] = (TH1F *)hfile->Get("h_sumCutAmplitudeperLS3");
1033  HistCutNumBadChanDepth[2][2][2] = (TH1F *)hfile->Get("h_sumCutAmplitudeperLS4");
1034  HistCutNumBadChanDepth[2][2][3] = (TH1F *)hfile->Get("h_sumCutAmplitudeperLS5");
1035 
1036  HistCutNumBadChanDepth[2][3][4] = (TH1F *)hfile->Get("h_sumCutAmplitudeperLS8");
1037 
1038  HistCutNumBadChanDepth[2][4][1] = (TH1F *)hfile->Get("h_sumCutAmplitudeperLS6");
1039  HistCutNumBadChanDepth[2][4][2] = (TH1F *)hfile->Get("h_sumCutAmplitudeperLS7");
1040 
1041  HistNumChanDepth[2][1][1] = (TH1F *)hfile->Get("h_sum0AmplitudeperLS1");
1042  HistNumChanDepth[2][1][2] = (TH1F *)hfile->Get("h_sum0AmplitudeperLS2");
1043 
1044  HistNumChanDepth[2][2][1] = (TH1F *)hfile->Get("h_sum0AmplitudeperLS3");
1045  HistNumChanDepth[2][2][2] = (TH1F *)hfile->Get("h_sum0AmplitudeperLS4");
1046  HistNumChanDepth[2][2][3] = (TH1F *)hfile->Get("h_sum0AmplitudeperLS5");
1047 
1048  HistNumChanDepth[2][3][4] = (TH1F *)hfile->Get("h_sum0AmplitudeperLS8");
1049 
1050  HistNumChanDepth[2][4][1] = (TH1F *)hfile->Get("h_sum0AmplitudeperLS6");
1051  HistNumChanDepth[2][4][2] = (TH1F *)hfile->Get("h_sum0AmplitudeperLS7");
1052 
1053  HistNumChanFull[2] = (TH1F *)HistNumChanDepth[2][1][1]->Clone();
1054  //+++++++++++++++++++++++++++++
1055  // Ratio
1056  //+++++++++++++++++++++++++++++
1057 
1058  HistNumBadChanDepth[3][1][1] = (TH1F *)hfile->Get("h_sumAmplperLS1");
1059  HistNumBadChanDepth[3][1][2] = (TH1F *)hfile->Get("h_sumAmplperLS2");
1060 
1061  HistNumBadChanDepth[3][2][1] = (TH1F *)hfile->Get("h_sumAmplperLS3");
1062  HistNumBadChanDepth[3][2][2] = (TH1F *)hfile->Get("h_sumAmplperLS4");
1063  HistNumBadChanDepth[3][2][3] = (TH1F *)hfile->Get("h_sumAmplperLS5");
1064 
1065  HistNumBadChanDepth[3][3][4] = (TH1F *)hfile->Get("h_sumAmplperLS8");
1066 
1067  HistNumBadChanDepth[3][4][1] = (TH1F *)hfile->Get("h_sumAmplperLS6");
1068  HistNumBadChanDepth[3][4][2] = (TH1F *)hfile->Get("h_sumAmplperLS7");
1069 
1070  HistNumBadChanFull[3] = (TH1F *)HistNumBadChanDepth[3][1][1]->Clone();
1071 
1072  HistCutNumBadChanDepth[3][1][1] = (TH1F *)hfile->Get("h_sumCutAmplperLS1");
1073  HistCutNumBadChanDepth[3][1][2] = (TH1F *)hfile->Get("h_sumCutAmplperLS2");
1074 
1075  HistCutNumBadChanDepth[3][2][1] = (TH1F *)hfile->Get("h_sumCutAmplperLS3");
1076  HistCutNumBadChanDepth[3][2][2] = (TH1F *)hfile->Get("h_sumCutAmplperLS4");
1077  HistCutNumBadChanDepth[3][2][3] = (TH1F *)hfile->Get("h_sumCutAmplperLS5");
1078 
1079  HistCutNumBadChanDepth[3][3][4] = (TH1F *)hfile->Get("h_sumCutAmplperLS8");
1080 
1081  HistCutNumBadChanDepth[3][4][1] = (TH1F *)hfile->Get("h_sumCutAmplperLS6");
1082  HistCutNumBadChanDepth[3][4][2] = (TH1F *)hfile->Get("h_sumCutAmplperLS7");
1083 
1084  HistNumChanDepth[3][1][1] = (TH1F *)hfile->Get("h_sum0AmplperLS1");
1085  HistNumChanDepth[3][1][2] = (TH1F *)hfile->Get("h_sum0AmplperLS2");
1086 
1087  HistNumChanDepth[3][2][1] = (TH1F *)hfile->Get("h_sum0AmplperLS3");
1088  HistNumChanDepth[3][2][2] = (TH1F *)hfile->Get("h_sum0AmplperLS4");
1089  HistNumChanDepth[3][2][3] = (TH1F *)hfile->Get("h_sum0AmplperLS5");
1090 
1091  HistNumChanDepth[3][3][4] = (TH1F *)hfile->Get("h_sum0AmplperLS8");
1092 
1093  HistNumChanDepth[3][4][1] = (TH1F *)hfile->Get("h_sum0AmplperLS6");
1094  HistNumChanDepth[3][4][2] = (TH1F *)hfile->Get("h_sum0AmplperLS7");
1095 
1096  HistNumChanFull[3] = (TH1F *)HistNumChanDepth[3][1][1]->Clone();
1097  //+++++++++++++++++++++++++++++
1098  // Tmean
1099  //+++++++++++++++++++++++++++++
1100 
1101  HistNumBadChanDepth[4][1][1] = (TH1F *)hfile->Get("h_sumTSmeanAperLS1");
1102  HistNumBadChanDepth[4][1][2] = (TH1F *)hfile->Get("h_sumTSmeanAperLS2");
1103 
1104  HistNumBadChanDepth[4][2][1] = (TH1F *)hfile->Get("h_sumTSmeanAperLS3");
1105  HistNumBadChanDepth[4][2][2] = (TH1F *)hfile->Get("h_sumTSmeanAperLS4");
1106  HistNumBadChanDepth[4][2][3] = (TH1F *)hfile->Get("h_sumTSmeanAperLS5");
1107 
1108  HistNumBadChanDepth[4][3][4] = (TH1F *)hfile->Get("h_sumTSmeanAperLS8");
1109 
1110  HistNumBadChanDepth[4][4][1] = (TH1F *)hfile->Get("h_sumTSmeanAperLS6");
1111  HistNumBadChanDepth[4][4][2] = (TH1F *)hfile->Get("h_sumTSmeanAperLS7");
1112 
1113  HistNumBadChanFull[4] = (TH1F *)HistNumBadChanDepth[4][1][1]->Clone();
1114 
1115  HistCutNumBadChanDepth[4][1][1] = (TH1F *)hfile->Get("h_sumCutTSmeanAperLS1");
1116  HistCutNumBadChanDepth[4][1][2] = (TH1F *)hfile->Get("h_sumCutTSmeanAperLS2");
1117 
1118  HistCutNumBadChanDepth[4][2][1] = (TH1F *)hfile->Get("h_sumCutTSmeanAperLS3");
1119  HistCutNumBadChanDepth[4][2][2] = (TH1F *)hfile->Get("h_sumCutTSmeanAperLS4");
1120  HistCutNumBadChanDepth[4][2][3] = (TH1F *)hfile->Get("h_sumCutTSmeanAperLS5");
1121 
1122  HistCutNumBadChanDepth[4][3][4] = (TH1F *)hfile->Get("h_sumCutTSmeanAperLS8");
1123 
1124  HistCutNumBadChanDepth[4][4][1] = (TH1F *)hfile->Get("h_sumCutTSmeanAperLS6");
1125  HistCutNumBadChanDepth[4][4][2] = (TH1F *)hfile->Get("h_sumCutTSmeanAperLS7");
1126 
1127  HistNumChanDepth[4][1][1] = (TH1F *)hfile->Get("h_sum0TSmeanAperLS1");
1128  HistNumChanDepth[4][1][2] = (TH1F *)hfile->Get("h_sum0TSmeanAperLS2");
1129 
1130  HistNumChanDepth[4][2][1] = (TH1F *)hfile->Get("h_sum0TSmeanAperLS3");
1131  HistNumChanDepth[4][2][2] = (TH1F *)hfile->Get("h_sum0TSmeanAperLS4");
1132  HistNumChanDepth[4][2][3] = (TH1F *)hfile->Get("h_sum0TSmeanAperLS5");
1133 
1134  HistNumChanDepth[4][3][4] = (TH1F *)hfile->Get("h_sum0TSmeanAperLS8");
1135 
1136  HistNumChanDepth[4][4][1] = (TH1F *)hfile->Get("h_sum0TSmeanAperLS6");
1137  HistNumChanDepth[4][4][2] = (TH1F *)hfile->Get("h_sum0TSmeanAperLS7");
1138 
1139  HistNumChanFull[4] = (TH1F *)HistNumChanDepth[4][1][1]->Clone();
1140  //+++++++++++++++++++++++++++++
1141  // Tmax
1142  //+++++++++++++++++++++++++++++
1143 
1144  HistNumBadChanDepth[5][1][1] = (TH1F *)hfile->Get("h_sumTSmaxAperLS1");
1145  HistNumBadChanDepth[5][1][2] = (TH1F *)hfile->Get("h_sumTSmaxAperLS2");
1146 
1147  HistNumBadChanDepth[5][2][1] = (TH1F *)hfile->Get("h_sumTSmaxAperLS3");
1148  HistNumBadChanDepth[5][2][2] = (TH1F *)hfile->Get("h_sumTSmaxAperLS4");
1149  HistNumBadChanDepth[5][2][3] = (TH1F *)hfile->Get("h_sumTSmaxAperLS5");
1150 
1151  HistNumBadChanDepth[5][3][4] = (TH1F *)hfile->Get("h_sumTSmaxAperLS8");
1152 
1153  HistNumBadChanDepth[5][4][1] = (TH1F *)hfile->Get("h_sumTSmaxAperLS6");
1154  HistNumBadChanDepth[5][4][2] = (TH1F *)hfile->Get("h_sumTSmaxAperLS7");
1155 
1156  HistNumBadChanFull[5] = (TH1F *)HistNumBadChanDepth[5][1][1]->Clone();
1157 
1158  HistCutNumBadChanDepth[5][1][1] = (TH1F *)hfile->Get("h_sumCutTSmaxAperLS1");
1159  HistCutNumBadChanDepth[5][1][2] = (TH1F *)hfile->Get("h_sumCutTSmaxAperLS2");
1160 
1161  HistCutNumBadChanDepth[5][2][1] = (TH1F *)hfile->Get("h_sumCutTSmaxAperLS3");
1162  HistCutNumBadChanDepth[5][2][2] = (TH1F *)hfile->Get("h_sumCutTSmaxAperLS4");
1163  HistCutNumBadChanDepth[5][2][3] = (TH1F *)hfile->Get("h_sumCutTSmaxAperLS5");
1164 
1165  HistCutNumBadChanDepth[5][3][4] = (TH1F *)hfile->Get("h_sumCutTSmaxAperLS8");
1166 
1167  HistCutNumBadChanDepth[5][4][1] = (TH1F *)hfile->Get("h_sumCutTSmaxAperLS6");
1168  HistCutNumBadChanDepth[5][4][2] = (TH1F *)hfile->Get("h_sumCutTSmaxAperLS7");
1169 
1170  HistNumChanDepth[5][1][1] = (TH1F *)hfile->Get("h_sum0TSmaxAperLS1");
1171  HistNumChanDepth[5][1][2] = (TH1F *)hfile->Get("h_sum0TSmaxAperLS2");
1172 
1173  HistNumChanDepth[5][2][1] = (TH1F *)hfile->Get("h_sum0TSmaxAperLS3");
1174  HistNumChanDepth[5][2][2] = (TH1F *)hfile->Get("h_sum0TSmaxAperLS4");
1175  HistNumChanDepth[5][2][3] = (TH1F *)hfile->Get("h_sum0TSmaxAperLS5");
1176 
1177  HistNumChanDepth[5][3][4] = (TH1F *)hfile->Get("h_sum0TSmaxAperLS8");
1178 
1179  HistNumChanDepth[5][4][1] = (TH1F *)hfile->Get("h_sum0TSmaxAperLS6");
1180  HistNumChanDepth[5][4][2] = (TH1F *)hfile->Get("h_sum0TSmaxAperLS7");
1181 
1182  HistNumChanFull[5] = (TH1F *)HistNumChanDepth[5][1][1]->Clone();
1183 
1184  for (int test = 0; test <= 5; test++) { //Test: =0(CapIdErrors), =1(Amplitude), =2...
1185  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
1186  if (sub == 1 && test != 1)
1187  cHE->Divide(2, 1); //HB
1188  if (sub == 1 && test == 1) {
1189  cFour1->Clear();
1190  cFour1->Divide(2, 2);
1191  } //HB upgrade with new depthes 3,4 for Amplitude test only
1192  if (sub == 2 && test != 1)
1193  cHE->Divide(3, 1); //HE
1194  if (sub == 2 && test == 1) {
1195  cNine->Clear();
1196  cNine->Divide(3, 3);
1197  } //HE upgrade with new depthes 4,5,6,7 for Amplitude test only
1198  if (sub == 3)
1199  cHB->Divide(1, 1); //HO
1200  if (sub == 4 && test != 1)
1201  cHE->Divide(2, 1); //HF
1202  if (sub == 4 && test == 1) {
1203  cFour1->Clear();
1204  cFour1->Divide(2, 2);
1205  } // HF upgrade with new depthes 3 and 4 for Amplitude test only
1206 
1207  int kkkkkkmax = k_max[sub];
1208  // if ( (sub==4 || sub==2) && test==1) kkkkkkmax = k_maxupgrade[sub];
1209  if ((sub == 4 || sub == 2 || sub == 1) && test == 1)
1210  kkkkkkmax = k_maxupgrade[sub];
1211  for (int k = k_min[sub]; k <= kkkkkkmax; k++) { //Depth
1212  if (sub == 1 && test != 1)
1213  cHE->cd(k); //HB
1214  if (sub == 1 && test == 1)
1215  cFour1->cd(k); //HB
1216  if (sub == 2 && test != 1)
1217  cHE->cd(k); //HE
1218  if (sub == 2 && test == 1)
1219  cNine->cd(k); //HE upgrade with new depthes 4,5,6,7 for Amplitude test only
1220  if (sub == 3)
1221  cHB->cd(k - 3); //HO
1222  if (sub == 4 && test != 1)
1223  cHE->cd(k); //HF
1224  if (sub == 4 && test == 1)
1225  cFour1->cd(k); // HF upgrade with new depthes 3 and 4 for Amplitude test only
1226  gPad->SetGridy();
1227  gPad->SetGridx();
1228  // gPad->SetLogy();
1229 
1230  if (sub == 1 && k == 1) {
1231  } else {
1232  // use "else" because ...Full[test] are filled by estimastor for sub==1 && k== 1 at initialization of ...Full[test] variables
1233  for (int x = 1; x <= HistNumBadChanFull[test]->GetXaxis()->GetNbins(); x++) {
1234  double ccc1 = HistNumBadChanDepth[test][sub][k]->GetBinContent(x);
1235  HistNumBadChanFull[test]->SetBinContent(x, HistNumBadChanFull[test]->GetBinContent(x) + ccc1);
1236  double ccc2 = HistNumChanDepth[test][sub][k]->GetBinContent(x);
1237  HistNumChanFull[test]->SetBinContent(x, HistNumChanFull[test]->GetBinContent(x) + ccc2);
1238  }
1239  } //end x
1240 
1241  // !!!!!! change the sense of HistNumBadChanDepth: now it's averaged values(estimators)
1242  HistNumBadChanDepth[test][sub][k]->Divide(
1243  HistNumBadChanDepth[test][sub][k], HistNumChanDepth[test][sub][k], 1, 1, "B");
1244  // errors abnulling:
1245  for (int x = 1; x <= HistNumBadChanDepth[test][sub][k]->GetXaxis()->GetNbins(); x++) {
1246  HistNumBadChanDepth[test][sub][k]->SetBinError(float(x), 0.01);
1247  }
1248 
1249  // int myMaxLum= HistNumBadChanDepth[test][sub][k]->GetBinContent(HistNumBadChanDepth[test][sub][k]->GetMaximumBin());
1250  // cout<<"********************>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> myMaxLum = "<<myMaxLum<<" MaxLum = "<<MaxLum<<endl;
1251  HistNumBadChanDepth[test][sub][k]->GetXaxis()->SetRangeUser(0, MaxLum);
1252 
1253  // // // // // // // // // // // // // // // // // //
1254  HistNumBadChanDepth[test][sub][k]->SetMarkerStyle(20);
1255  HistNumBadChanDepth[test][sub][k]->SetMarkerSize(0.4);
1256  HistNumBadChanDepth[test][sub][k]->GetYaxis()->SetLabelSize(0.04);
1257  if (k == 1)
1258  HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 1\b");
1259  if (k == 2)
1260  HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 2\b");
1261  if (k == 3)
1262  HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 3\b");
1263  if (k == 4)
1264  HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 4\b");
1265  if (k == 5)
1266  HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 5\b");
1267  if (k == 6)
1268  HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 6\b");
1269  if (k == 7)
1270  HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 7\b");
1271  HistNumBadChanDepth[test][sub][k]->SetXTitle("LS \b");
1272  if (test == 0)
1273  HistNumBadChanDepth[test][sub][k]->SetYTitle("<Number of bad channels> \b");
1274  if (test != 0)
1275  HistNumBadChanDepth[test][sub][k]->SetYTitle("Averaged estimator \b");
1276  HistNumBadChanDepth[test][sub][k]->SetMarkerColor(2);
1277  HistNumBadChanDepth[test][sub][k]->SetLineColor(0);
1278  // gPad->SetGridx();
1279  gPad->SetLogy();
1280  gPad->SetGridy();
1281  gPad->SetGridx();
1282  // if (test == 1) HistNumBadChanDepth[test][sub][k]->SetMinimum(0.1);
1283  HistNumBadChanDepth[test][sub][k]->Draw("Error");
1284  /*
1285  if (k == 1) HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 1\b");
1286  if (k == 2) HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 2\b");
1287  if (k == 3) HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 3\b");
1288  if (k == 4) HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 4\b");
1289  HistNumBadChanDepth[test][sub][k]->SetXTitle("LS \b");
1290  if (test == 0) HistNumBadChanDepth[test][sub][k]->SetYTitle("<Number of bad channels> \b");
1291  if (test != 0) HistNumBadChanDepth[test][sub][k]->SetYTitle("Averaged estimator \b");
1292 
1293  if (MaxLum<=1000){
1294  HistNumBadChanDepth[test][sub][k]->SetMarkerStyle(20);
1295  HistNumBadChanDepth[test][sub][k]->SetMarkerSize(0.5);
1296  HistNumBadChanDepth[test][sub][k]->SetMarkerColor(2);
1297  HistNumBadChanDepth[test][sub][k]->SetLineColor(0);
1298  HistNumBadChanDepth[test][sub][k]->GetXaxis()->SetRangeUser(0, MaxLum);
1299  HistNumBadChanDepth[test][sub][k]->Draw("P");
1300  }
1301  else{
1302  HistNumBadChanDepth[test][sub][k]->SetLineColor(2);
1303  HistNumBadChanDepth[test][sub][k]->GetXaxis()->SetRangeUser(0, MaxLum);
1304  HistNumBadChanDepth[test][sub][k]->Draw("L");
1305  }
1306  */
1307  /*
1308  float min_x[] = {0,10000};
1309  float min_y[] = {(float)(Cut0[test][sub][k]),(float)(Cut0[test][sub][k])};
1310  TGraph* MIN = new TGraph(2, min_x, min_y);
1311  MIN->SetLineStyle(2);
1312  MIN->SetLineColor(5);
1313  MIN->SetLineWidth(2 + 100*100);
1314  MIN->SetFillStyle(3005);
1315  MIN->SetFillColor(5);
1316  gPad->SetGridy();
1317  gPad->SetGridx();
1318  MIN->Draw("L");
1319 */
1320 
1321  if (sub == 1 && test != 1) {
1322  cHE->Modified();
1323  }
1324  if (sub == 1 && test == 1) {
1325  cFour1->Modified();
1326  } // HB upgrade
1327  if (sub == 2 && test != 1) {
1328  cHE->Modified();
1329  }
1330  if (sub == 2 && test == 1) {
1331  cNine->Modified();
1332  } // HE upgrade
1333  if (sub == 3) {
1334  cHB->Modified();
1335  }
1336  if (sub == 4 && test != 1) {
1337  cHE->Modified();
1338  }
1339  if (sub == 4 && test == 1) {
1340  cFour1->Modified();
1341  } // HF upgrade
1342 
1343  } // k loop
1344 
1345  if (test == 0) {
1346  if (sub == 1) {
1347  cHE->Print("HistNBCMNHB.png");
1348  cHE->Clear();
1349  }
1350  if (sub == 2) {
1351  cHE->Print("HistNBCMNHE.png");
1352  cHE->Clear();
1353  }
1354  if (sub == 3) {
1355  cHB->Print("HistNBCMNHO.png");
1356  cHB->Clear();
1357  }
1358  if (sub == 4) {
1359  cHE->Print("HistNBCMNHF.png");
1360  cHE->Clear();
1361  }
1362  }
1363  // Amplitude:
1364  if (test == 1) {
1365  if (sub == 1) {
1366  cFour1->Print("HistADCamplHB.png");
1367  cFour1->Clear();
1368  } // HB upgrade
1369  if (sub == 2) {
1370  cNine->Print("HistADCamplHE.png");
1371  cNine->Clear();
1372  } // HE upgrade
1373  if (sub == 3) {
1374  cHB->Print("HistADCamplHO.png");
1375  cHB->Clear();
1376  }
1377  if (sub == 4) {
1378  cFour1->Print("HistADCamplHF.png");
1379  cFour1->Clear();
1380  } // HF upgrade
1381  }
1382  if (test == 2) {
1383  if (sub == 1) {
1384  cHE->Print("HistWidthHB.png");
1385  cHE->Clear();
1386  }
1387  if (sub == 2) {
1388  cHE->Print("HistWidthHE.png");
1389  cHE->Clear();
1390  }
1391  if (sub == 3) {
1392  cHB->Print("HistWidthHO.png");
1393  cHB->Clear();
1394  }
1395  if (sub == 4) {
1396  cHE->Print("HistWidthHF.png");
1397  cHE->Clear();
1398  }
1399  }
1400  if (test == 3) {
1401  if (sub == 1) {
1402  cHE->Print("HistRatioHB.png");
1403  cHE->Clear();
1404  }
1405  if (sub == 2) {
1406  cHE->Print("HistRatioHE.png");
1407  cHE->Clear();
1408  }
1409  if (sub == 3) {
1410  cHB->Print("HistRatioHO.png");
1411  cHB->Clear();
1412  }
1413  if (sub == 4) {
1414  cHE->Print("HistRatioHF.png");
1415  cHE->Clear();
1416  }
1417  }
1418  if (test == 4) {
1419  if (sub == 1) {
1420  cHE->Print("HistTmeanHB.png");
1421  cHE->Clear();
1422  }
1423  if (sub == 2) {
1424  cHE->Print("HistTmeanHE.png");
1425  cHE->Clear();
1426  }
1427  if (sub == 3) {
1428  cHB->Print("HistTmeanHO.png");
1429  cHB->Clear();
1430  }
1431  if (sub == 4) {
1432  cHE->Print("HistTmeanHF.png");
1433  cHE->Clear();
1434  }
1435  }
1436  if (test == 5) {
1437  if (sub == 1) {
1438  cHE->Print("HistTmaxHB.png");
1439  cHE->Clear();
1440  }
1441  if (sub == 2) {
1442  cHE->Print("HistTmaxHE.png");
1443  cHE->Clear();
1444  }
1445  if (sub == 3) {
1446  cHB->Print("HistTmaxHO.png");
1447  cHB->Clear();
1448  }
1449  if (sub == 4) {
1450  cHE->Print("HistTmaxHF.png");
1451  cHE->Clear();
1452  }
1453  }
1454  } // end sub
1456  if (test == 1) {
1457  for (int x = 1; x <= HistNumChanFull[6]->GetXaxis()->GetNbins(); x++) {
1458  HistNumChanFull[6]->SetBinContent(x, 0.0);
1459  int depthsubcount = 0.;
1460  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
1461  int kkkkkkmax = k_max[sub];
1462  if (sub == 4 || sub == 2 || sub == 1)
1463  kkkkkkmax = k_maxupgrade[sub];
1464  // if ( sub==4 || sub==2) kkkkkkmax = k_maxupgrade[sub];
1465  for (int k = k_min[sub]; k <= kkkkkkmax; k++) { //Depth
1466  // line below is temporary, just to avoid contribution of HEP(M)17 in depthes 4,5,6,7 but keep in depthes 1,2,3
1467  // if(sub==2 && k>3 ) break;
1468  depthsubcount++;
1469  double ccc1 = HistNumBadChanDepth[test][sub][k]->GetBinContent(x);
1470  HistNumChanFull[6]->SetBinContent(x, HistNumChanFull[6]->GetBinContent(x) + ccc1);
1471  } //depth
1472  } //sub
1473  if (depthsubcount > 0.) {
1474  HistNumChanFull[6]->SetBinContent(x, (HistNumChanFull[6]->GetBinContent(x)) / depthsubcount);
1475  } else {
1476  HistNumChanFull[6]->SetBinContent(x, (HistNumChanFull[6]->GetBinContent(x)) / 8.);
1477  }
1478  } //x
1479  } //test=1
1481  if (test != 1) {
1482  cHB->Divide(1, 1);
1483  cHB->cd(1);
1484  } else {
1485  cHE->Divide(2, 1);
1486  cHE->cd(1);
1487  }
1488  HistNumBadChanFull[test]->Divide(HistNumBadChanFull[test], HistNumChanFull[test], 1, 1, "B");
1489  TH1F *kfitq = new TH1F("kfitq", "", MaxLum, 1., MaxLum + 1.);
1490  int nx = kfitq->GetXaxis()->GetNbins();
1491  for (int i = 1; i <= nx; i++) {
1492  double ccc1 = HistNumBadChanFull[test]->GetBinContent(i);
1493  if (ccc1 > 0.) {
1494  kfitq->Fill(float(i), ccc1);
1495  kfitq->SetBinError(float(i), 0.01);
1496  }
1497  }
1498  kfitq->SetMarkerStyle(20);
1499  kfitq->SetMarkerSize(0.4);
1500  kfitq->GetYaxis()->SetLabelSize(0.04);
1501  if (test == 0)
1502  kfitq->SetTitle("Average Nbch for whole Hcal \b");
1503  if (test != 0)
1504  kfitq->SetTitle("Averaged estimator for whole Hcal \b");
1505  kfitq->SetXTitle("LS \b");
1506  if (test == 0)
1507  kfitq->SetYTitle("<Number of bad channels> \b");
1508  if (test != 0)
1509  kfitq->SetYTitle("Averaged estimator \b");
1510  kfitq->SetMarkerColor(2);
1511  kfitq->SetLineColor(0);
1512  gPad->SetGridx();
1513  kfitq->Draw("Error");
1514  /*
1515  HistNumBadChanFull[test]->SetMarkerStyle(20);
1516  HistNumBadChanFull[test]->SetMarkerSize(0.8);
1517  HistNumBadChanFull[test]->SetTitle("Averaged estimator for whole Hcal \b");
1518  HistNumBadChanFull[test]->SetXTitle("LS \b");
1519  if (test == 0) HistNumBadChanFull[test]->SetYTitle("<Number of bad channels> \b");
1520  if (test != 0) HistNumBadChanFull[test]->SetYTitle("Averaged estimator \b");
1521  if (MaxLum<=1000){
1522  HistNumBadChanFull[test]->SetMarkerColor(1);
1523  HistNumBadChanFull[test]->SetLineColor(0);
1524  HistNumBadChanFull[test]->Draw("P");
1525  }
1526  else {
1527  HistNumBadChanFull[test]->SetLineColor(1);
1528  HistNumBadChanFull[test]->Draw("L");
1529  }
1530  */
1531  if (test == 1) {
1532  cHE->cd(2);
1533  TH1F *lpuio = new TH1F("lpuio", "", MaxLum, 1., MaxLum + 1.);
1534  int nx = lpuio->GetXaxis()->GetNbins();
1535  for (int i = 1; i <= nx; i++) {
1536  double ccc1 = HistNumChanFull[6]->GetBinContent(i);
1537  if (ccc1 > 0.) {
1538  lpuio->Fill(float(i), ccc1);
1539  lpuio->SetBinError(float(i), 0.01);
1540  }
1541  }
1542  lpuio->SetMarkerStyle(20);
1543  lpuio->SetMarkerSize(0.4);
1544  lpuio->GetYaxis()->SetLabelSize(0.04);
1545  lpuio->SetTitle("Mean of Averaged Amplitudes over all Hcal sub-detectors \b");
1546  lpuio->SetXTitle("LS \b");
1547  lpuio->SetYTitle("Mean of Averaged estimator \b");
1548  lpuio->SetMarkerColor(2);
1549  lpuio->SetLineColor(0);
1550  gPad->SetGridx();
1551  lpuio->Draw("Error");
1552  }
1553  if (test == 0) {
1554  cHB->Print("HistCapID.png");
1555  cHB->Clear();
1556  }
1557  if (test == 1) {
1558  cHE->Print("HistADCAmpl.png");
1559  cHE->Clear();
1560  }
1561  if (test == 2) {
1562  cHB->Print("HistWidth.png");
1563  cHB->Clear();
1564  }
1565  if (test == 3) {
1566  cHB->Print("HistRatio.png");
1567  cHB->Clear();
1568  }
1569  if (test == 4) {
1570  cHB->Print("HistTmean.png");
1571  cHB->Clear();
1572  }
1573  if (test == 5) {
1574  cHB->Print("HistTmax.png");
1575  cHB->Clear();
1576  }
1577 
1578  // clean-up
1579  if (kfitq)
1580  delete kfitq;
1581  } //end test
1582 
1583  //================================================================================================================================
1584 
1585  //=======================================================================================================333
1586  //CapID 1-d histograms
1587 
1588  TH1F *HistAbnormNumBadChanDepth[5][5]; // 1d histogramm for subdet, depth
1589 
1590  //+++++++++++++++++++++++++++++
1591  // Abnormal Bad Channels Rate of Cap ID errors first set of histograms
1592  //+++++++++++++++++++++++++++++
1593 
1594  HistAbnormNumBadChanDepth[1][1] = (TH1F *)hfile->Get("h_runnbadchannelsC_depth1_HB");
1595  HistAbnormNumBadChanDepth[1][2] = (TH1F *)hfile->Get("h_runnbadchannelsC_depth2_HB");
1596  HistAbnormNumBadChanDepth[2][1] = (TH1F *)hfile->Get("h_runnbadchannelsC_depth1_HE");
1597  HistAbnormNumBadChanDepth[2][2] = (TH1F *)hfile->Get("h_runnbadchannelsC_depth2_HE");
1598  HistAbnormNumBadChanDepth[2][3] = (TH1F *)hfile->Get("h_runnbadchannelsC_depth3_HE");
1599  HistAbnormNumBadChanDepth[3][4] = (TH1F *)hfile->Get("h_runnbadchannelsC_depth4_HO");
1600  HistAbnormNumBadChanDepth[4][1] = (TH1F *)hfile->Get("h_runnbadchannelsC_depth1_HF");
1601  HistAbnormNumBadChanDepth[4][2] = (TH1F *)hfile->Get("h_runnbadchannelsC_depth2_HF");
1602 
1603  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
1604  if (sub == 1)
1605  cHB->Divide(2, 1);
1606  if (sub == 2)
1607  cHE->Divide(3, 1);
1608  if (sub == 3)
1609  cONE->Divide(1, 1);
1610  if (sub == 4)
1611  cHB->Divide(2, 1);
1612  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
1613  if (sub == 1)
1614  cHB->cd(k);
1615  if (sub == 2)
1616  cHE->cd(k);
1617  if (sub == 3)
1618  cONE->cd(k - 3);
1619  if (sub == 4)
1620  cHB->cd(k);
1621  gPad->SetGridy();
1622  gPad->SetGridx();
1623  // gPad->SetLogy();
1624  HistAbnormNumBadChanDepth[sub][k]->Divide(
1625  HistAbnormNumBadChanDepth[sub][k], HistNumChanDepth[0][sub][k], 1, 1, "B");
1626  if (k == 1)
1627  HistAbnormNumBadChanDepth[sub][k]->SetTitle("Depth 1\b");
1628  if (k == 2)
1629  HistAbnormNumBadChanDepth[sub][k]->SetTitle("Depth 2\b");
1630  if (k == 3)
1631  HistAbnormNumBadChanDepth[sub][k]->SetTitle("Depth 3\b");
1632  if (k == 4)
1633  HistAbnormNumBadChanDepth[sub][k]->SetTitle("Depth 4\b");
1634  HistAbnormNumBadChanDepth[sub][k]->SetXTitle("LS \b");
1635  HistAbnormNumBadChanDepth[sub][k]->SetYTitle("< Number of bad channels > \b");
1636  if (MaxLum <= 1000) {
1637  HistAbnormNumBadChanDepth[sub][k]->SetMarkerStyle(20);
1638  HistAbnormNumBadChanDepth[sub][k]->SetMarkerSize(0.5);
1639  HistAbnormNumBadChanDepth[sub][k]->SetMarkerColor(1);
1640  HistAbnormNumBadChanDepth[sub][k]->SetLineColor(0);
1641  HistAbnormNumBadChanDepth[sub][k]->GetXaxis()->SetRangeUser(0, MaxLum);
1642  HistAbnormNumBadChanDepth[sub][k]->Draw("P");
1643  } else {
1644  HistAbnormNumBadChanDepth[sub][k]->SetLineColor(1);
1645  HistAbnormNumBadChanDepth[sub][k]->GetXaxis()->SetRangeUser(0, MaxLum);
1646  HistAbnormNumBadChanDepth[sub][k]->Draw("L");
1647  }
1648  }
1649  if (sub == 1) {
1650  cHB->Print("Hist_CAPID_Abnorm_HB.png");
1651  cHB->Clear();
1652  }
1653  if (sub == 2) {
1654  cHE->Print("Hist_CAPID_Abnorm_HE.png");
1655  cHE->Clear();
1656  }
1657  if (sub == 3) {
1658  cONE->Print("Hist_CAPID_Abnorm_HO.png");
1659  cONE->Clear();
1660  }
1661  if (sub == 4) {
1662  cHB->Print("Hist_CAPID_Abnorm_HF.png");
1663  cHB->Clear();
1664  }
1665  } // end sub
1666 
1667  //+++++++++++++++++++++++++++++
1668  // Portions of bad channels events identified by Cap ID errors third set of histograms
1669  //+++++++++++++++++++++++++++++
1670 
1671  TH1F *HistPortBadEventsDepth[5][5]; // 1d histogramm for subdet, depth
1672 
1673  HistPortBadEventsDepth[1][1] = (TH1F *)hfile->Get("h_runbadrateC_depth1_HB");
1674  HistPortBadEventsDepth[1][2] = (TH1F *)hfile->Get("h_runbadrateC_depth2_HB");
1675  HistPortBadEventsDepth[2][1] = (TH1F *)hfile->Get("h_runbadrateC_depth1_HE");
1676  HistPortBadEventsDepth[2][2] = (TH1F *)hfile->Get("h_runbadrateC_depth2_HE");
1677  HistPortBadEventsDepth[2][3] = (TH1F *)hfile->Get("h_runbadrateC_depth3_HE");
1678  HistPortBadEventsDepth[3][4] = (TH1F *)hfile->Get("h_runbadrateC_depth4_HO");
1679  HistPortBadEventsDepth[4][1] = (TH1F *)hfile->Get("h_runbadrateC_depth1_HF");
1680  HistPortBadEventsDepth[4][2] = (TH1F *)hfile->Get("h_runbadrateC_depth2_HF");
1681 
1682  TH1F *HistNumRateDepth[5][5];
1683  HistNumRateDepth[1][1] = (TH1F *)hfile->Get("h_runbadrate0_depth1_HB");
1684  HistNumRateDepth[1][2] = (TH1F *)hfile->Get("h_runbadrate0_depth2_HB");
1685  HistNumRateDepth[2][1] = (TH1F *)hfile->Get("h_runbadrate0_depth1_HE");
1686  HistNumRateDepth[2][2] = (TH1F *)hfile->Get("h_runbadrate0_depth2_HE");
1687  HistNumRateDepth[2][3] = (TH1F *)hfile->Get("h_runbadrate0_depth3_HE");
1688  HistNumRateDepth[3][4] = (TH1F *)hfile->Get("h_runbadrate0_depth4_HO");
1689  HistNumRateDepth[4][1] = (TH1F *)hfile->Get("h_runbadrate0_depth1_HF");
1690  HistNumRateDepth[4][2] = (TH1F *)hfile->Get("h_runbadrate0_depth2_HF");
1691 
1692  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
1693  if (sub == 1)
1694  cHB->Divide(2, 1);
1695  if (sub == 2)
1696  cHE->Divide(3, 1);
1697  if (sub == 3)
1698  cONE->Divide(1, 1);
1699  if (sub == 4)
1700  cHB->Divide(2, 1);
1701  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
1702  if (sub == 1)
1703  cHB->cd(k);
1704  if (sub == 2)
1705  cHE->cd(k);
1706  if (sub == 3)
1707  cONE->cd(k - 3);
1708  if (sub == 4)
1709  cHB->cd(k);
1710  gPad->SetGridy();
1711  gPad->SetGridx();
1712  // gPad->SetLogy();
1713  HistPortBadEventsDepth[sub][k]->Divide(HistPortBadEventsDepth[sub][k], HistNumRateDepth[sub][k], 1, 1, "B");
1714 
1715  if (k == 1)
1716  HistPortBadEventsDepth[sub][k]->SetTitle("Depth 1\b");
1717  if (k == 2)
1718  HistPortBadEventsDepth[sub][k]->SetTitle("Depth 2\b");
1719  if (k == 3)
1720  HistPortBadEventsDepth[sub][k]->SetTitle("Depth 3\b");
1721  if (k == 4)
1722  HistPortBadEventsDepth[sub][k]->SetTitle("Depth 4\b");
1723  HistPortBadEventsDepth[sub][k]->SetXTitle("LS \b");
1724  HistPortBadEventsDepth[sub][k]->SetYTitle("< Number of bad channels > \b");
1725  if (MaxLum <= 1000) {
1726  HistPortBadEventsDepth[sub][k]->SetMarkerStyle(20);
1727  HistPortBadEventsDepth[sub][k]->SetMarkerSize(0.5);
1728  HistPortBadEventsDepth[sub][k]->SetMarkerColor(1);
1729  HistPortBadEventsDepth[sub][k]->SetLineColor(0);
1730  HistPortBadEventsDepth[sub][k]->GetXaxis()->SetRangeUser(0, MaxLum);
1731  HistPortBadEventsDepth[sub][k]->Draw("P");
1732  } else {
1733  HistPortBadEventsDepth[sub][k]->SetLineColor(1);
1734  HistPortBadEventsDepth[sub][k]->GetXaxis()->SetRangeUser(0, MaxLum);
1735  HistPortBadEventsDepth[sub][k]->Draw("L");
1736  }
1737  }
1738  if (sub == 1) {
1739  cHB->Print("HistPortHB.png");
1740  cHB->Clear();
1741  }
1742  if (sub == 2) {
1743  cHE->Print("HistPortHE.png");
1744  cHE->Clear();
1745  }
1746  if (sub == 3) {
1747  cONE->Print("HistPortHO.png");
1748  cONE->Clear();
1749  }
1750  if (sub == 4) {
1751  cHB->Print("HistPortHF.png");
1752  cHB->Clear();
1753  }
1754  } // end sub
1755 
1756  //================================================================================================================================
1757 
1758  //+++++++++++++++++++++++++++++
1759  // Number of bad channels events identified by Cap ID errors third set of histograms
1760  //+++++++++++++++++++++++++++++
1761 
1762  TH1F *HistNBadChsDepth[5][5]; // 1d histogramm for subdet, depth
1763 
1764  HistNBadChsDepth[1][1] = (TH1F *)hfile->Get("h_nbadchannels_depth1_HB");
1765  HistNBadChsDepth[1][2] = (TH1F *)hfile->Get("h_nbadchannels_depth2_HB");
1766  HistNBadChsDepth[2][1] = (TH1F *)hfile->Get("h_nbadchannels_depth1_HE");
1767  HistNBadChsDepth[2][2] = (TH1F *)hfile->Get("h_nbadchannels_depth2_HE");
1768  HistNBadChsDepth[2][3] = (TH1F *)hfile->Get("h_nbadchannels_depth3_HE");
1769  HistNBadChsDepth[3][4] = (TH1F *)hfile->Get("h_nbadchannels_depth4_HO");
1770  HistNBadChsDepth[4][1] = (TH1F *)hfile->Get("h_nbadchannels_depth1_HF");
1771  HistNBadChsDepth[4][2] = (TH1F *)hfile->Get("h_nbadchannels_depth2_HF");
1772 
1773  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
1774  if (sub == 1)
1775  cHB->Divide(2, 1);
1776  if (sub == 2)
1777  cHE->Divide(3, 1);
1778  if (sub == 3)
1779  cONE->Divide(1, 1);
1780  if (sub == 4)
1781  cHB->Divide(2, 1);
1782  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
1783  if (sub == 1)
1784  cHB->cd(k);
1785  if (sub == 2)
1786  cHE->cd(k);
1787  if (sub == 3)
1788  cONE->cd(k - 3);
1789  if (sub == 4)
1790  cHB->cd(k);
1791  gPad->SetGridy();
1792  gPad->SetGridx();
1793  gPad->SetLogy();
1794 
1795  if (k == 1)
1796  HistNBadChsDepth[sub][k]->SetTitle("Depth 1\b");
1797  if (k == 2)
1798  HistNBadChsDepth[sub][k]->SetTitle("Depth 2\b");
1799  if (k == 3)
1800  HistNBadChsDepth[sub][k]->SetTitle("Depth 3\b");
1801  if (k == 4)
1802  HistNBadChsDepth[sub][k]->SetTitle("Depth 4\b");
1803  HistNBadChsDepth[sub][k]->SetXTitle("Number of bad channels\b");
1804  HistNBadChsDepth[sub][k]->SetYTitle("Number of events\b");
1805  // HistNBadChsDepth[sub][k]->SetMarkerStyle(20);
1806  // HistNBadChsDepth[sub][k]->SetMarkerSize(0.5);
1807  // HistNBadChsDepth[sub][k]->SetMarkerColor(1);
1808  // HistNBadChsDepth[sub][k]->SetLineColor(0);
1809  HistNBadChsDepth[sub][k]->Draw("");
1810  }
1811  if (sub == 1) {
1812  cHB->Print("HistNBadChsHB.png");
1813  cHB->Clear();
1814  }
1815  if (sub == 2) {
1816  cHE->Print("HistNBadChsHE.png");
1817  cHE->Clear();
1818  }
1819  if (sub == 3) {
1820  cONE->Print("HistNBadChsHO.png");
1821  cONE->Clear();
1822  }
1823  if (sub == 4) {
1824  cHB->Print("HistNBadChsHF.png");
1825  cHB->Clear();
1826  }
1827  } // end sub
1828 
1829  //====================================================================== HB :
1830  //====================================================================== HB :
1831  //====================================================================== HB :
1832  // Special test of errors type A and B in HB
1833  // AZ 08.02.2016
1834 
1835  int flagErrAB_HB[2];
1836  flagErrAB_HB[0] = -1;
1837  flagErrAB_HB[1] = -1;
1838  double avedelta_HB = 0.;
1839  int lastLumiBin_HB = -1;
1840  int LSofFirstErrB_HB = -1;
1841  {
1842  const int specCountA = 4;
1843  const int specColors[specCountA] = {1, 2, 3, 4};
1844  const TString hnames[specCountA][2] = {{"h_sumADCAmplperLS1_P1", "h_sum0ADCAmplperLS1_P1"},
1845  {"h_sumADCAmplperLS1_P2", "h_sum0ADCAmplperLS1_P2"},
1846  {"h_sumADCAmplperLS1_M1", "h_sum0ADCAmplperLS1_M1"},
1847  {"h_sumADCAmplperLS1_M2", "h_sum0ADCAmplperLS1_M2"}};
1848 
1849  std::vector<TH1F *> hV;
1850  THStack *hs = new THStack("hs", "ADCAmplerLS1");
1851  cHB->Clear();
1852  // cHB->cd();
1853  cHB->Divide(2, 1);
1854  cHB->cd(1);
1855 
1857  for (int i = 0; i < specCountA; i++) {
1858  if (1)
1859  std::cout << "debugger: errA_HB : get histos for i=" << i << " " << hnames[i][0] << " and " << hnames[i][1]
1860  << "\n";
1861  TH1F *h1 = (TH1F *)hfile->Get(hnames[i][0]);
1862  TH1F *h0 = (TH1F *)hfile->Get(hnames[i][1]);
1863  if (!h1 || !h0) {
1864  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
1865  ptext->AddText("Missing histo");
1866  if (!h1) {
1867  std::cout << "\tfailed to get " << hnames[i][0] << "\n";
1868  ptext->AddText(hnames[i][0]);
1869  }
1870  if (!h0) {
1871  std::cout << "\tfailed to get " << hnames[i][1] << "\n";
1872  ptext->AddText(hnames[i][1]);
1873  }
1874  ptext->Draw();
1875  continue;
1876  }
1877  TH1F *hERT1orig = (TH1F *)h1->Clone(Form("ERT1orig_%d", i));
1878  hERT1orig->Divide(h1, h0, 1, 1, "B");
1879 
1880  if ((lastLumiBin_HB < 0) && (i == 0)) {
1881  for (int ibin = hERT1orig->GetNbinsX(); ibin >= 1; ibin--) {
1882  if (hERT1orig->GetBinContent(ibin) == 0)
1883  lastLumiBin_HB = ibin;
1884  else
1885  break;
1886  }
1887  lastLumiBin_HB += 3; // show more bins
1888  if (lastLumiBin_HB >= hERT1orig->GetNbinsX())
1889  lastLumiBin_HB = -1;
1890  }
1891  TH1F *hERT1 = NULL;
1892  if (lastLumiBin_HB > 1) {
1893  if (!copyContents(&hERT1, Form("ERT1_%d", i), "", hERT1orig, lastLumiBin_HB)) {
1894  std::cout << "code failed" << std::endl;
1895  gSystem->Exit(1);
1896  }
1897  } else
1898  hERT1 = hERT1orig;
1899 
1900  hERT1->GetXaxis()->SetTitle("<ADCAmpl> per LS HB: black-P1, red-P2,green-M1,blue-M2");
1901  hV.push_back(hERT1);
1902  hERT1->SetMarkerStyle(20);
1903  hERT1->SetMarkerSize(0.4);
1904  hERT1->SetXTitle("<A>(ev.in LS & ch.) - HB P1 - iLS \b");
1905  hERT1->SetMarkerColor(specColors[i]);
1906  hERT1->SetLineColor(0);
1907  hs->Add(hERT1);
1908  delete h1;
1909  delete h0;
1910  if (hERT1 != hERT1orig)
1911  delete hERT1orig;
1912  }
1913  hs->Draw("LPE1 nostack");
1914  cHB->Update(); // activate the axes
1915  hs->GetXaxis()->SetTitle("<A> per LS: black-P1, red-P2,green-M1,blue-M2");
1916  hs->Draw("LPE1 nostack");
1917  gPad->SetGridy();
1919 
1920  // AZ corrections 08.02.2016
1921  cHB->cd(2);
1922  TH1F *diff = new TH1F("diff", "", 100, 0., 4.);
1923 
1924  if (int(hV.size()) == specCountA) {
1925  flagErrAB_HB[0] = 0; // If we have the expected number of histograms, set the flag
1926  double sumdelta = 0.;
1927  int nnndelta = 0;
1928  for (int ibin = 1; ibin <= hV[0]->GetNbinsX(); ibin++) {
1929  double delta = 0.;
1930  double maxdelta = 0.;
1931  for (unsigned int i = 0; i < hV.size(); i++) {
1932  const TH1F *hi = hV[i];
1933  for (unsigned int j = 1; j < hV.size(); j++) {
1934  const TH1F *hj = hV[j];
1935  delta = fabs(hi->GetBinContent(ibin) - hj->GetBinContent(ibin));
1936  if (delta > maxdelta)
1937  maxdelta = delta;
1938  } //for
1939  } //for
1940  if (maxdelta > 0.) {
1941  diff->Fill(maxdelta);
1942  sumdelta += maxdelta;
1943  nnndelta++;
1944  }
1945  } //for ibin
1946  // avedelta_HB = sumdelta/hV[0]->GetNbinsX();
1947  avedelta_HB = sumdelta / nnndelta;
1948  std::cout << "******************>>>>>> ErrA_HB: avedelta_HB = " << avedelta_HB << std::endl;
1949  if (avedelta_HB > 0.24 || (avedelta_HB < 0.14 && avedelta_HB > 0.)) {
1950  flagErrAB_HB[0] = 1;
1951  } //if
1952  } //hV.size
1953  diff->SetMarkerStyle(20);
1954  diff->SetMarkerSize(0.8);
1955  diff->SetXTitle("max difference \b");
1956  diff->SetMarkerColor(2);
1957  diff->SetLineColor(0);
1958  gPad->SetGridx();
1959  gPad->SetLogy();
1960  diff->Draw("Error");
1962  cHB->Update();
1963  cHB->Print("HistErrA_HB.png");
1964  cHB->Clear();
1966 
1967  // clean-up
1968  if (diff)
1969  delete diff;
1970  for (unsigned int i = 0; i < hV.size(); i++)
1971  delete hV[i];
1972  } // ErrorA in HB
1973 
1975 
1976  { // errors type B
1977  const int specCountB = 4;
1978  const TString hnames[specCountB][2] = {{"h_2DsumErrorBLS1", "h_2D0sumErrorBLS1"},
1979  {"h_sumErrorBperLS1", "h_sum0ErrorBperLS1"},
1980  {"h_2DsumErrorBLS2", "h_2D0sumErrorBLS2"},
1981  {"h_sumErrorBperLS2", "h_sum0ErrorBperLS2"}};
1982 
1983  for (int depth = 1; depth <= 2; depth++) {
1984  cHB->Clear();
1985  cHB->Divide(2, 1);
1986  cHB->cd(1);
1987 
1988  TH1F *hRate2orig = NULL;
1989  TH2F *h2Cefz6 = NULL;
1990  TString hname1 = hnames[2 * depth - 2][0];
1991  TString hname0 = hnames[2 * depth - 2][1];
1992  TH2F *twod1 = (TH2F *)hfile->Get(hname1);
1993  TH2F *twod0 = (TH2F *)hfile->Get(hname0);
1994  if (1)
1995  std::cout << "debugger: errB_HB depth=" << depth << ". get 2D histos " << hname1 << " and " << hname0 << "\n";
1996  if (!twod1 || !twod0) {
1997  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
1998  ptext->AddText("Missing histos");
1999  if (!twod1) {
2000  std::cout << "\tfailed to get " << hname1 << "\n";
2001  ptext->AddText(hname1);
2002  }
2003  if (!twod0) {
2004  std::cout << "\tfailed to get " << hname0 << "\n";
2005  ptext->AddText(hname0);
2006  }
2007  ptext->Draw();
2008  } else {
2009  h2Cefz6 = (TH2F *)twod1->Clone(Form("Cefz6_%d", depth));
2010  h2Cefz6->SetTitle(Form("HB Depth %d \b", depth));
2011  h2Cefz6->Divide(twod1, twod0, 1, 1, "B");
2012 
2013  gPad->SetGridy();
2014  gPad->SetGridx();
2015  gPad->SetLogz();
2016  h2Cefz6->SetTitle(Form("Depth %d \b", depth));
2017  h2Cefz6->SetMarkerStyle(20);
2018  h2Cefz6->SetMarkerSize(0.4);
2019  // h2Cefz6->GetZaxis()->SetLabelSize(0.04);
2020  h2Cefz6->SetXTitle("#eta \b");
2021  h2Cefz6->SetYTitle("#phi \b");
2022  h2Cefz6->SetZTitle(Form("<ErrorB> - HB Depth%d \b", depth));
2023  h2Cefz6->SetMarkerColor(2);
2024  h2Cefz6->SetLineColor(2);
2025  h2Cefz6->Draw("COLZ");
2026 
2027  delete twod1;
2028  delete twod0;
2029  } // histos ok
2030 
2031  cHB->cd(2);
2032  hname1 = hnames[2 * depth - 1][0];
2033  hname0 = hnames[2 * depth - 1][1];
2034  TH1F *h1 = (TH1F *)hfile->Get(hname1);
2035  TH1F *h0 = (TH1F *)hfile->Get(hname0);
2036  if (1)
2037  std::cout << "errB_HB depth=" << depth << ". get 2D histos " << hname1 << " and " << hname0 << "\n";
2038  if (!h1 || !h0) {
2039  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2040  ptext->AddText("Missing histo");
2041  if (!h1) {
2042  std::cout << "\tfailed to get " << hname1 << "\n";
2043  ptext->AddText(hname1);
2044  }
2045  if (!h0) {
2046  std::cout << "\tfailed to get " << hname0 << "\n";
2047  ptext->AddText(hname0);
2048  }
2049  ptext->Draw();
2050  } else {
2051  gPad->SetGridx();
2052  gPad->SetGridy();
2053  // gPad->SetLogy();
2054  hRate2orig = (TH1F *)h1->Clone(Form("Rate2orig_%d", depth));
2055  hRate2orig->Divide(h1, h0, 1, 1, "B");
2056 
2057  TH1F *hRate2 = NULL;
2058  if (lastLumiBin_HB > 1) {
2059  if (!copyContents(&hRate2, Form("Rate2_%d", depth), "", hRate2orig, lastLumiBin_HB)) {
2060  std::cout << "code failed" << std::endl;
2061  gSystem->Exit(1);
2062  }
2063  } else
2064  hRate2 = hRate2orig;
2065 
2066  hRate2->SetTitle(Form("Depth %d \b", depth));
2067  hRate2->SetMarkerStyle(20);
2068  hRate2->SetMarkerSize(0.8);
2069  // hRate2->GetZaxis()->SetLabelSize(0.04);
2070  hRate2->SetXTitle(Form("<ErrorB>(ev.in LS & ch.) - HB depth%d - iLS \b", depth));
2071  hRate2->SetMarkerColor(2);
2072  hRate2->SetLineColor(0);
2073  hRate2->Draw("Error");
2074 
2075  if (LSofFirstErrB_HB == -1) {
2076  int nx = hRate2->GetXaxis()->GetNbins();
2077  for (int i = 1; i <= nx; i++) {
2078  double ccc1 = hRate2->GetBinContent(i);
2079  if (ccc1 > 0.) {
2080  cout << "****************>>>>>>>>>>> ErrB_HB bad LS start at iLS = " << i << " with rate = " << ccc1
2081  << endl;
2082  LSofFirstErrB_HB = i;
2083  break;
2084  }
2085  }
2086  }
2087 
2088  delete h1;
2089  delete h0;
2090  if (hRate2 != hRate2orig) {
2091  delete hRate2orig;
2092  hRate2orig = hRate2;
2093  }
2094  }
2095 
2096  cHB->Update();
2097  cHB->Print(Form("HistErrB_HB_%d.png", depth));
2098  cHB->Clear();
2099  if (h2Cefz6)
2100  delete h2Cefz6;
2101  if (hRate2orig)
2102  delete hRate2orig;
2103  }
2104  } // ErrorsB in HB
2105 
2106  //====================================================================== HE :
2107  //====================================================================== HE :
2108  //====================================================================== HE :
2109  // Special test of errors type A and B in HE
2110  // AZ 08.02.2016
2111 
2112  int flagErrAB_HE[2];
2113  flagErrAB_HE[0] = -1;
2114  flagErrAB_HE[1] = -1;
2115  double avedelta_HE = 0.;
2116  int lastLumiBin_HE = -1;
2117  int LSofFirstErrB_HE = -1;
2118  {
2119  const int specCountA = 4;
2120  const int specColors[specCountA] = {1, 2, 3, 4};
2121  const TString hnames[specCountA][2] = {{"h_sumADCAmplperLS3_P1", "h_sum0ADCAmplperLS3_P1"},
2122  {"h_sumADCAmplperLS3_P2", "h_sum0ADCAmplperLS3_P2"},
2123  {"h_sumADCAmplperLS3_M1", "h_sum0ADCAmplperLS3_M1"},
2124  {"h_sumADCAmplperLS3_M2", "h_sum0ADCAmplperLS3_M2"}};
2125 
2126  std::vector<TH1F *> hV;
2127  THStack *hs = new THStack("hs", "ADCAmplerLS1");
2128  cHB->Clear();
2129  // cHB->cd();
2130  cHB->Divide(2, 1);
2131  cHB->cd(1);
2132 
2134  for (int i = 0; i < specCountA; i++) {
2135  if (1)
2136  std::cout << "debugger: errA_HE : get histos for i=" << i << " " << hnames[i][0] << " and " << hnames[i][1]
2137  << "\n";
2138  TH1F *h1 = (TH1F *)hfile->Get(hnames[i][0]);
2139  TH1F *h0 = (TH1F *)hfile->Get(hnames[i][1]);
2140  if (!h1 || !h0) {
2141  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2142  ptext->AddText("Missing histo");
2143  if (!h1) {
2144  std::cout << "\tfailed to get " << hnames[i][0] << "\n";
2145  ptext->AddText(hnames[i][0]);
2146  }
2147  if (!h0) {
2148  std::cout << "\tfailed to get " << hnames[i][1] << "\n";
2149  ptext->AddText(hnames[i][1]);
2150  }
2151  ptext->Draw();
2152  continue;
2153  }
2154  TH1F *hERT1orig = (TH1F *)h1->Clone(Form("ERT1orig_%d", i));
2155  hERT1orig->Divide(h1, h0, 1, 1, "B");
2156 
2157  if ((lastLumiBin_HE < 0) && (i == 0)) {
2158  for (int ibin = hERT1orig->GetNbinsX(); ibin >= 1; ibin--) {
2159  if (hERT1orig->GetBinContent(ibin) == 0)
2160  lastLumiBin_HE = ibin;
2161  else
2162  break;
2163  }
2164  lastLumiBin_HE += 3; // show more bins
2165  if (lastLumiBin_HE >= hERT1orig->GetNbinsX())
2166  lastLumiBin_HE = -1;
2167  }
2168  TH1F *hERT1 = NULL;
2169  if (lastLumiBin_HE > 1) {
2170  if (!copyContents(&hERT1, Form("ERT1_%d", i), "", hERT1orig, lastLumiBin_HE)) {
2171  std::cout << "code failed" << std::endl;
2172  gSystem->Exit(1);
2173  }
2174  } else
2175  hERT1 = hERT1orig;
2176 
2177  hERT1->GetXaxis()->SetTitle("<ADCAmpl> per LS HE: black-P1, red-P2,green-M1,blue-M2");
2178  hV.push_back(hERT1);
2179  hERT1->SetMarkerStyle(20);
2180  hERT1->SetMarkerSize(0.4);
2181  hERT1->SetXTitle("<A>(ev.in LS & ch.) - HE P1 - iLS \b");
2182  hERT1->SetMarkerColor(specColors[i]);
2183  hERT1->SetLineColor(0);
2184  hs->Add(hERT1);
2185  delete h1;
2186  delete h0;
2187  if (hERT1 != hERT1orig)
2188  delete hERT1orig;
2189  }
2190  hs->Draw("LPE1 nostack");
2191  cHB->Update(); // activate the axes
2192  hs->GetXaxis()->SetTitle("<A> per LS: black-P1, red-P2,green-M1,blue-M2");
2193  hs->Draw("LPE1 nostack");
2194  gPad->SetGridy();
2196 
2197  // AZ corrections 08.02.2016
2198  cHB->cd(2);
2199  TH1F *diff = new TH1F("diff", "", 100, 0., 4.);
2200 
2201  if (int(hV.size()) == specCountA) {
2202  flagErrAB_HE[0] = 0; // If we have the expected number of histograms, set the flag
2203  double sumdelta = 0.;
2204  int nnndelta = 0;
2205  for (int ibin = 1; ibin <= hV[0]->GetNbinsX(); ibin++) {
2206  double delta = 0.;
2207  double maxdelta = 0.;
2208  for (unsigned int i = 0; i < hV.size(); i++) {
2209  const TH1F *hi = hV[i];
2210  for (unsigned int j = 1; j < hV.size(); j++) {
2211  const TH1F *hj = hV[j];
2212  delta = fabs(hi->GetBinContent(ibin) - hj->GetBinContent(ibin));
2213  if (delta > maxdelta)
2214  maxdelta = delta;
2215  } //for
2216  } //for
2217  if (maxdelta > 0.) {
2218  diff->Fill(maxdelta);
2219  sumdelta += maxdelta;
2220  nnndelta++;
2221  }
2222  } //for ibin
2223  // avedelta_HE = sumdelta/hV[0]->GetNbinsX();
2224  avedelta_HE = sumdelta / nnndelta;
2225  std::cout << "******************>>>>>> ErrA_HE: avedelta_HE = " << avedelta_HE << std::endl;
2226  if (avedelta_HE > 1.1 || (avedelta_HE < 0.5 && avedelta_HE > 0.)) {
2227  flagErrAB_HE[0] = 1;
2228  } //if
2229  } //hV.size
2230  diff->SetMarkerStyle(20);
2231  diff->SetMarkerSize(0.8);
2232  diff->SetXTitle("max difference \b");
2233  diff->SetMarkerColor(2);
2234  diff->SetLineColor(0);
2235  gPad->SetGridx();
2236  gPad->SetLogy();
2237  diff->Draw("Error");
2239  cHB->Update();
2240  cHB->Print("HistErrA_HE.png");
2241  cHB->Clear();
2243 
2244  // clean-up
2245  if (diff)
2246  delete diff;
2247  for (unsigned int i = 0; i < hV.size(); i++)
2248  delete hV[i];
2249  } // ErrorA in HE
2250 
2252 
2253  { // errors type B
2254  const int specCountB = 6;
2255  const TString hnames[specCountB][2] = {{"h_2DsumErrorBLS3", "h_2D0sumErrorBLS3"},
2256  {"h_sumErrorBperLS3", "h_sum0ErrorBperLS3"},
2257  {"h_2DsumErrorBLS4", "h_2D0sumErrorBLS4"},
2258  {"h_sumErrorBperLS4", "h_sum0ErrorBperLS4"},
2259  {"h_2DsumErrorBLS5", "h_2D0sumErrorBLS5"},
2260  {"h_sumErrorBperLS5", "h_sum0ErrorBperLS5"}};
2261 
2262  for (int depth = 1; depth <= 3; depth++) {
2263  cHB->Clear();
2264  cHB->Divide(2, 1);
2265  cHB->cd(1);
2266 
2267  TH1F *hRate2orig = NULL;
2268  TH2F *h2Cefz6 = NULL;
2269  TString hname1 = hnames[2 * depth - 2][0];
2270  TString hname0 = hnames[2 * depth - 2][1];
2271  TH2F *twod1 = (TH2F *)hfile->Get(hname1);
2272  TH2F *twod0 = (TH2F *)hfile->Get(hname0);
2273  if (1)
2274  std::cout << "debugger: errB_HE depth=" << depth << ". get 2D histos " << hname1 << " and " << hname0 << "\n";
2275  if (!twod1 || !twod0) {
2276  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2277  ptext->AddText("Missing histos");
2278  if (!twod1) {
2279  std::cout << "\tfailed to get " << hname1 << "\n";
2280  ptext->AddText(hname1);
2281  }
2282  if (!twod0) {
2283  std::cout << "\tfailed to get " << hname0 << "\n";
2284  ptext->AddText(hname0);
2285  }
2286  ptext->Draw();
2287  } else {
2288  h2Cefz6 = (TH2F *)twod1->Clone(Form("Cefz6_%d", depth));
2289  h2Cefz6->SetTitle(Form("HE Depth %d \b", depth));
2290  h2Cefz6->Divide(twod1, twod0, 1, 1, "B");
2291 
2292  gPad->SetGridy();
2293  gPad->SetGridx();
2294  gPad->SetLogz();
2295  h2Cefz6->SetTitle(Form("Depth %d \b", depth));
2296  h2Cefz6->SetMarkerStyle(20);
2297  h2Cefz6->SetMarkerSize(0.4);
2298  // h2Cefz6->GetZaxis()->SetLabelSize(0.04);
2299  h2Cefz6->SetXTitle("#eta \b");
2300  h2Cefz6->SetYTitle("#phi \b");
2301  h2Cefz6->SetZTitle(Form("<ErrorB> - HE Depth%d \b", depth));
2302  h2Cefz6->SetMarkerColor(2);
2303  h2Cefz6->SetLineColor(2);
2304  h2Cefz6->Draw("COLZ");
2305 
2306  delete twod1;
2307  delete twod0;
2308  } // histos ok
2309 
2310  cHB->cd(2);
2311  hname1 = hnames[2 * depth - 1][0];
2312  hname0 = hnames[2 * depth - 1][1];
2313  TH1F *h1 = (TH1F *)hfile->Get(hname1);
2314  TH1F *h0 = (TH1F *)hfile->Get(hname0);
2315  if (1)
2316  std::cout << "errB_HE depth=" << depth << ". get 2D histos " << hname1 << " and " << hname0 << "\n";
2317  if (!h1 || !h0) {
2318  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2319  ptext->AddText("Missing histo");
2320  if (!h1) {
2321  std::cout << "\tfailed to get " << hname1 << "\n";
2322  ptext->AddText(hname1);
2323  }
2324  if (!h0) {
2325  std::cout << "\tfailed to get " << hname0 << "\n";
2326  ptext->AddText(hname0);
2327  }
2328  ptext->Draw();
2329  } else {
2330  gPad->SetGridx();
2331  gPad->SetGridy();
2332  // gPad->SetLogy();
2333  hRate2orig = (TH1F *)h1->Clone(Form("Rate2orig_%d", depth));
2334  hRate2orig->Divide(h1, h0, 1, 1, "B");
2335 
2336  TH1F *hRate2 = NULL;
2337  if (lastLumiBin_HE > 1) {
2338  if (!copyContents(&hRate2, Form("Rate2_%d", depth), "", hRate2orig, lastLumiBin_HE)) {
2339  std::cout << "code failed" << std::endl;
2340  gSystem->Exit(1);
2341  }
2342  } else
2343  hRate2 = hRate2orig;
2344 
2345  hRate2->SetTitle(Form("Depth %d \b", depth));
2346  hRate2->SetMarkerStyle(20);
2347  hRate2->SetMarkerSize(0.8);
2348  // hRate2->GetZaxis()->SetLabelSize(0.04);
2349  hRate2->SetXTitle(Form("<ErrorB>(ev.in LS & ch.) - HE depth%d - iLS \b", depth));
2350  hRate2->SetMarkerColor(2);
2351  hRate2->SetLineColor(0);
2352  hRate2->Draw("Error");
2353 
2354  if (LSofFirstErrB_HE == -1) {
2355  int nx = hRate2->GetXaxis()->GetNbins();
2356  for (int i = 1; i <= nx; i++) {
2357  double ccc1 = hRate2->GetBinContent(i);
2358  if (ccc1 > 0.) {
2359  cout << "****************>>>>>>>>>>> ErrB_HE bad LS start at iLS = " << i << " with rate = " << ccc1
2360  << endl;
2361  LSofFirstErrB_HE = i;
2362  break;
2363  }
2364  }
2365  }
2366 
2367  delete h1;
2368  delete h0;
2369  if (hRate2 != hRate2orig) {
2370  delete hRate2orig;
2371  hRate2orig = hRate2;
2372  }
2373  }
2374 
2375  cHB->Update();
2376  cHB->Print(Form("HistErrB_HE_%d.png", depth));
2377  cHB->Clear();
2378  if (h2Cefz6)
2379  delete h2Cefz6;
2380  if (hRate2orig)
2381  delete hRate2orig;
2382  }
2383  } // ErrorsB in HE
2384 
2385  //====================================================================== HO :
2386  //====================================================================== HO :
2387  //====================================================================== HO :
2388  // Special test of errors type A and B in HO
2389  // AZ 08.02.2016
2390 
2391  int flagErrAB_HO[2];
2392  flagErrAB_HO[0] = -1;
2393  flagErrAB_HO[1] = -1;
2394  double avedelta_HO = 0.;
2395  int lastLumiBin_HO = -1;
2396  int LSofFirstErrB_HO = -1;
2397  {
2398  const int specCountA = 4;
2399  const int specColors[specCountA] = {1, 2, 3, 4};
2400  const TString hnames[specCountA][2] = {{"h_sumADCAmplperLS8_P1", "h_sum0ADCAmplperLS8_P1"},
2401  {"h_sumADCAmplperLS8_P2", "h_sum0ADCAmplperLS8_P2"},
2402  {"h_sumADCAmplperLS8_M1", "h_sum0ADCAmplperLS8_M1"},
2403  {"h_sumADCAmplperLS8_M2", "h_sum0ADCAmplperLS8_M2"}};
2404 
2405  std::vector<TH1F *> hV;
2406  THStack *hs = new THStack("hs", "ADCAmplerLS1");
2407  cHB->Clear();
2408  // cHB->cd();
2409  cHB->Divide(2, 1);
2410  cHB->cd(1);
2411 
2413  for (int i = 0; i < specCountA; i++) {
2414  if (1)
2415  std::cout << "debugger: errA_HO : get histos for i=" << i << " " << hnames[i][0] << " and " << hnames[i][1]
2416  << "\n";
2417  TH1F *h1 = (TH1F *)hfile->Get(hnames[i][0]);
2418  TH1F *h0 = (TH1F *)hfile->Get(hnames[i][1]);
2419  if (!h1 || !h0) {
2420  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2421  ptext->AddText("Missing histo");
2422  if (!h1) {
2423  std::cout << "\tfailed to get " << hnames[i][0] << "\n";
2424  ptext->AddText(hnames[i][0]);
2425  }
2426  if (!h0) {
2427  std::cout << "\tfailed to get " << hnames[i][1] << "\n";
2428  ptext->AddText(hnames[i][1]);
2429  }
2430  ptext->Draw();
2431  continue;
2432  }
2433  TH1F *hoRT1orig = (TH1F *)h1->Clone(Form("ERT1orig_%d", i));
2434  hoRT1orig->Divide(h1, h0, 1, 1, "B");
2435 
2436  if ((lastLumiBin_HO < 0) && (i == 0)) {
2437  for (int ibin = hoRT1orig->GetNbinsX(); ibin >= 1; ibin--) {
2438  if (hoRT1orig->GetBinContent(ibin) == 0)
2439  lastLumiBin_HO = ibin;
2440  else
2441  break;
2442  }
2443  lastLumiBin_HO += 3; // show more bins
2444  if (lastLumiBin_HO >= hoRT1orig->GetNbinsX())
2445  lastLumiBin_HO = -1;
2446  }
2447  TH1F *hoRT1 = NULL;
2448  if (lastLumiBin_HO > 1) {
2449  if (!copyContents(&hoRT1, Form("ERT1_%d", i), "", hoRT1orig, lastLumiBin_HO)) {
2450  std::cout << "code failed" << std::endl;
2451  gSystem->Exit(1);
2452  }
2453  } else
2454  hoRT1 = hoRT1orig;
2455 
2456  hoRT1->GetXaxis()->SetTitle("<ADCAmpl> per LS HO: black-P1, red-P2,green-M1,blue-M2");
2457  hV.push_back(hoRT1);
2458  hoRT1->SetMarkerStyle(20);
2459  hoRT1->SetMarkerSize(0.4);
2460  hoRT1->SetXTitle("<A>(ev.in LS & ch.) - HO P1 - iLS \b");
2461  hoRT1->SetMarkerColor(specColors[i]);
2462  hoRT1->SetLineColor(0);
2463  hs->Add(hoRT1);
2464  delete h1;
2465  delete h0;
2466  if (hoRT1 != hoRT1orig)
2467  delete hoRT1orig;
2468  }
2469  hs->Draw("LPE1 nostack");
2470  cHB->Update(); // activate tho axes
2471  hs->GetXaxis()->SetTitle("<A> per LS: black-P1, red-P2,green-M1,blue-M2");
2472  hs->Draw("LPE1 nostack");
2473  gPad->SetGridy();
2475 
2476  // AZ corrections 08.02.2016
2477  cHB->cd(2);
2478  TH1F *diff = new TH1F("diff", "", 100, 0., 4.);
2479 
2480  if (int(hV.size()) == specCountA) {
2481  flagErrAB_HO[0] = 0; // If we have tho expected number of histograms, set tho flag
2482  double sumdelta = 0.;
2483  int nnndelta = 0;
2484  for (int ibin = 1; ibin <= hV[0]->GetNbinsX(); ibin++) {
2485  double delta = 0.;
2486  double maxdelta = 0.;
2487  for (unsigned int i = 0; i < hV.size(); i++) {
2488  const TH1F *hi = hV[i];
2489  for (unsigned int j = 1; j < hV.size(); j++) {
2490  const TH1F *hj = hV[j];
2491  delta = fabs(hi->GetBinContent(ibin) - hj->GetBinContent(ibin));
2492  if (delta > maxdelta)
2493  maxdelta = delta;
2494  } //for
2495  } //for
2496  if (maxdelta > 0.) {
2497  diff->Fill(maxdelta);
2498  sumdelta += maxdelta;
2499  nnndelta++;
2500  }
2501  } //for ibin
2502  // avedelta_HO = sumdelta/hV[0]->GetNbinsX();
2503  avedelta_HO = sumdelta / nnndelta;
2504  std::cout << "******************>>>>>> ErrA_HO: avedelta_HO = " << avedelta_HO << std::endl;
2505  if (avedelta_HO > 0.8 || (avedelta_HO < 0.2 && avedelta_HO > 0.)) {
2506  flagErrAB_HO[0] = 1;
2507  } //if
2508  } //hV.size
2509  diff->SetMarkerStyle(20);
2510  diff->SetMarkerSize(0.8);
2511  diff->SetXTitle("max difference \b");
2512  diff->SetMarkerColor(2);
2513  diff->SetLineColor(0);
2514  gPad->SetGridx();
2515  gPad->SetLogy();
2516  diff->Draw("Error");
2518  cHB->Update();
2519  cHB->Print("HistErrA_HO.png");
2520  cHB->Clear();
2522 
2523  // clean-up
2524  if (diff)
2525  delete diff;
2526  for (unsigned int i = 0; i < hV.size(); i++)
2527  delete hV[i];
2528  } // ErrorA in HO
2529 
2531 
2532  { // errors type B
2533  const int specCountB = 2;
2534  const TString hnames[specCountB][2] = {{"h_2DsumErrorBLS8", "h_2D0sumErrorBLS8"},
2535  {"h_sumErrorBperLS8", "h_sum0ErrorBperLS8"}};
2536 
2537  for (int depth = 4; depth <= 4; depth++) {
2538  cHB->Clear();
2539  cHB->Divide(2, 1);
2540  cHB->cd(1);
2541 
2542  TH1F *hRate2orig = NULL;
2543  TH2F *h2Cefz6 = NULL;
2544  TString hname1 = hnames[2 * depth - 8][0];
2545  TString hname0 = hnames[2 * depth - 8][1];
2546  TH2F *twod1 = (TH2F *)hfile->Get(hname1);
2547  TH2F *twod0 = (TH2F *)hfile->Get(hname0);
2548  if (1)
2549  std::cout << "debugger: errB_HO depth=" << depth << ". get 2D histos " << hname1 << " and " << hname0 << "\n";
2550  if (!twod1 || !twod0) {
2551  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2552  ptext->AddText("Missing histos");
2553  if (!twod1) {
2554  std::cout << "\tfailed to get " << hname1 << "\n";
2555  ptext->AddText(hname1);
2556  }
2557  if (!twod0) {
2558  std::cout << "\tfailed to get " << hname0 << "\n";
2559  ptext->AddText(hname0);
2560  }
2561  ptext->Draw();
2562  } else {
2563  h2Cefz6 = (TH2F *)twod1->Clone(Form("Cefz6_%d", depth));
2564  h2Cefz6->SetTitle(Form("HO Depth %d \b", depth));
2565  h2Cefz6->Divide(twod1, twod0, 1, 1, "B");
2566 
2567  gPad->SetGridy();
2568  gPad->SetGridx();
2569  gPad->SetLogz();
2570  h2Cefz6->SetTitle(Form("Depth %d \b", depth));
2571  h2Cefz6->SetMarkerStyle(20);
2572  h2Cefz6->SetMarkerSize(0.4);
2573  // h2Cefz6->GetZaxis()->SetLabelSize(0.04);
2574  h2Cefz6->SetXTitle("#eta \b");
2575  h2Cefz6->SetYTitle("#phi \b");
2576  h2Cefz6->SetZTitle(Form("<ErrorB> - HO Depth%d \b", depth));
2577  h2Cefz6->SetMarkerColor(2);
2578  h2Cefz6->SetLineColor(2);
2579  h2Cefz6->Draw("COLZ");
2580 
2581  delete twod1;
2582  delete twod0;
2583  } // histos ok
2584 
2585  cHB->cd(2);
2586  hname1 = hnames[2 * depth - 7][0];
2587  hname0 = hnames[2 * depth - 7][1];
2588  TH1F *h1 = (TH1F *)hfile->Get(hname1);
2589  TH1F *h0 = (TH1F *)hfile->Get(hname0);
2590  if (1)
2591  std::cout << "errB_HO depth=" << depth << ". get 2D histos " << hname1 << " and " << hname0 << "\n";
2592  if (!h1 || !h0) {
2593  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2594  ptext->AddText("Missing histo");
2595  if (!h1) {
2596  std::cout << "\tfailed to get " << hname1 << "\n";
2597  ptext->AddText(hname1);
2598  }
2599  if (!h0) {
2600  std::cout << "\tfailed to get " << hname0 << "\n";
2601  ptext->AddText(hname0);
2602  }
2603  ptext->Draw();
2604  } else {
2605  gPad->SetGridx();
2606  gPad->SetGridy();
2607  // gPad->SetLogy();
2608  hRate2orig = (TH1F *)h1->Clone(Form("Rate2orig_%d", depth));
2609  hRate2orig->Divide(h1, h0, 1, 1, "B");
2610 
2611  TH1F *hRate2 = NULL;
2612  if (lastLumiBin_HO > 1) {
2613  if (!copyContents(&hRate2, Form("Rate2_%d", depth), "", hRate2orig, lastLumiBin_HO)) {
2614  std::cout << "code failed" << std::endl;
2615  gSystem->Exit(1);
2616  }
2617  } else
2618  hRate2 = hRate2orig;
2619 
2620  hRate2->SetTitle(Form("Depth %d \b", depth));
2621  hRate2->SetMarkerStyle(20);
2622  hRate2->SetMarkerSize(0.8);
2623  // hRate2->GetZaxis()->SetLabelSize(0.04);
2624  hRate2->SetXTitle(Form("<ErrorB>(ev.in LS & ch.) - HO depth%d - iLS \b", depth));
2625  hRate2->SetMarkerColor(2);
2626  hRate2->SetLineColor(0);
2627  hRate2->Draw("Error");
2628 
2629  if (LSofFirstErrB_HO == -1) {
2630  int nx = hRate2->GetXaxis()->GetNbins();
2631  for (int i = 1; i <= nx; i++) {
2632  double ccc1 = hRate2->GetBinContent(i);
2633  if (ccc1 > 0.) {
2634  cout << "****************>>>>>>>>>>> ErrB_HO bad LS start at iLS = " << i << " with rate = " << ccc1
2635  << endl;
2636  LSofFirstErrB_HO = i;
2637  break;
2638  }
2639  }
2640  }
2641 
2642  delete h1;
2643  delete h0;
2644  if (hRate2 != hRate2orig) {
2645  delete hRate2orig;
2646  hRate2orig = hRate2;
2647  }
2648  }
2649 
2650  cHB->Update();
2651  cHB->Print(Form("HistErrB_HO_%d.png", depth));
2652  cHB->Clear();
2653  if (h2Cefz6)
2654  delete h2Cefz6;
2655  if (hRate2orig)
2656  delete hRate2orig;
2657  }
2658  } // ErrorsB in HO
2659 
2660  //====================================================================== done by Andrius for HF:
2661  //====================================================================== done by Andrius for HF:
2662  //====================================================================== done by Andrius for HF:
2663  // Special test of errors type A and B in HF
2664 
2665  int flagErrAB_HF[2];
2666  flagErrAB_HF[0] = -1;
2667  flagErrAB_HF[1] = -1;
2668  double avedelta_HF = 0.;
2669  int lastLumiBin_HF = -1;
2670  int LSofFirstErrB_HF = -1;
2671  {
2672  const int specCountA = 4;
2673  const int specColors[specCountA] = {1, 2, 3, 4};
2674  const TString hnames[specCountA][2] = {{"h_sumADCAmplperLS6_P1", "h_sum0ADCAmplperLS6_P1"},
2675  {"h_sumADCAmplperLS6_P2", "h_sum0ADCAmplperLS6_P2"},
2676  {"h_sumADCAmplperLS6_M1", "h_sum0ADCAmplperLS6_M1"},
2677  {"h_sumADCAmplperLS6_M2", "h_sum0ADCAmplperLS6_M2"}};
2678 
2679  std::vector<TH1F *> hV;
2680  THStack *hs = new THStack("hs", "ADCAmplerLS6");
2681  cHB->Clear();
2682  // cHB->cd();
2683  cHB->Divide(2, 1);
2684  cHB->cd(1);
2685 
2687  for (int i = 0; i < specCountA; i++) {
2688  if (1)
2689  std::cout << "debugger: errA_HF : get histos for i=" << i << " " << hnames[i][0] << " and " << hnames[i][1]
2690  << "\n";
2691  TH1F *h1 = (TH1F *)hfile->Get(hnames[i][0]);
2692  TH1F *h0 = (TH1F *)hfile->Get(hnames[i][1]);
2693  if (!h1 || !h0) {
2694  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2695  ptext->AddText("Missing histo");
2696  if (!h1) {
2697  std::cout << "\tfailed to get " << hnames[i][0] << "\n";
2698  ptext->AddText(hnames[i][0]);
2699  }
2700  if (!h0) {
2701  std::cout << "\tfailed to get " << hnames[i][1] << "\n";
2702  ptext->AddText(hnames[i][1]);
2703  }
2704  ptext->Draw();
2705  continue;
2706  }
2707  TH1F *hERT1orig = (TH1F *)h1->Clone(Form("ERT1orig_%d", i));
2708  hERT1orig->Divide(h1, h0, 1, 1, "B");
2709 
2710  if ((lastLumiBin_HF < 0) && (i == 0)) {
2711  for (int ibin = hERT1orig->GetNbinsX(); ibin >= 1; ibin--) {
2712  if (hERT1orig->GetBinContent(ibin) == 0)
2713  lastLumiBin_HF = ibin;
2714  else
2715  break;
2716  }
2717  lastLumiBin_HF += 3; // show more bins
2718  if (lastLumiBin_HF >= hERT1orig->GetNbinsX())
2719  lastLumiBin_HF = -1;
2720  }
2721  TH1F *hERT1 = NULL;
2722  if (lastLumiBin_HF > 1) {
2723  if (!copyContents(&hERT1, Form("ERT1_%d", i), "", hERT1orig, lastLumiBin_HF)) {
2724  std::cout << "code failed" << std::endl;
2725  gSystem->Exit(1);
2726  }
2727  } else
2728  hERT1 = hERT1orig;
2729 
2730  hERT1->GetXaxis()->SetTitle("<ADCAmpl> per LS HF: black-P1, red-P2,green-M1,blue-M2");
2731  hV.push_back(hERT1);
2732  hERT1->SetMarkerStyle(20);
2733  hERT1->SetMarkerSize(0.4);
2734  hERT1->SetXTitle("<A>(ev.in LS & ch.) - HF P1 - iLS \b");
2735  hERT1->SetMarkerColor(specColors[i]);
2736  hERT1->SetLineColor(0);
2737  hs->Add(hERT1);
2738  delete h1;
2739  delete h0;
2740  if (hERT1 != hERT1orig)
2741  delete hERT1orig;
2742  }
2743  hs->Draw("LPE1 nostack");
2744  cHB->Update(); // activate the axes
2745  hs->GetXaxis()->SetTitle("<A> per LS: black-P1, red-P2,green-M1,blue-M2");
2746  hs->Draw("LPE1 nostack");
2747  gPad->SetGridy();
2749 
2750  // AZ corrections 04.02.2016
2751  cHB->cd(2);
2752  TH1F *diff = new TH1F("diff", "", 100, 0., 4.);
2753 
2754  if (int(hV.size()) == specCountA) {
2755  flagErrAB_HF[0] = 0; // If we have the expected number of histograms, set the flag
2756  double sumdelta = 0.;
2757  int nnndelta = 0;
2758  std::cout << "******** GetNbinsX = " << hV[0]->GetNbinsX() << std::endl;
2759  for (int ibin = 1; ibin <= hV[0]->GetNbinsX(); ibin++) {
2760  double delta = 0.;
2761  double maxdelta = 0.;
2762  for (unsigned int i = 0; i < hV.size(); i++) {
2763  const TH1F *hi = hV[i];
2764  for (unsigned int j = 1; j < hV.size(); j++) {
2765  const TH1F *hj = hV[j];
2766  delta = fabs(hi->GetBinContent(ibin) - hj->GetBinContent(ibin));
2767  if (delta > maxdelta)
2768  maxdelta = delta;
2769  } //for
2770  } //for
2771  // std::cout << "***** ibin = " << ibin << " nnndelta= " << nnndelta << " maxdelta= " << maxdelta <<std::endl;
2772  if (maxdelta > 0.) {
2773  diff->Fill(maxdelta);
2774  sumdelta += maxdelta;
2775  nnndelta++;
2776  }
2777  } //for ibin
2778  // avedelta_HF = sumdelta/hV[0]->GetNbinsX();
2779  avedelta_HF = sumdelta / nnndelta;
2780  // std::cout << "******************>>>>>> ErrA_HF: avedelta_HF = " << avedelta_HF << " Npoints for comparison= " << nnndelta <<std::endl;
2781  if (avedelta_HF > 2.4 || (avedelta_HF < 0.8 && avedelta_HF > 0.)) {
2782  flagErrAB_HF[0] = 1;
2783  } //if
2784  } //hV.size
2785  diff->SetMarkerStyle(20);
2786  diff->SetMarkerSize(0.8);
2787  diff->SetXTitle("max difference \b");
2788  diff->SetMarkerColor(2);
2789  diff->SetLineColor(0);
2790  gPad->SetGridx();
2791  gPad->SetLogy();
2792  diff->Draw("Error");
2794  cHB->Update();
2795  cHB->Print("HistErrA_HF.png");
2796  cHB->Clear();
2798  // clean-up
2799  if (diff)
2800  delete diff;
2801  for (unsigned int i = 0; i < hV.size(); i++)
2802  delete hV[i];
2803  } // ErrorA in HF
2806  { // errors type B
2807  const int specCountB = 4;
2808  const TString hnames[specCountB][2] = {{"h_2DsumErrorBLS6", "h_2D0sumErrorBLS6"},
2809  {"h_sumErrorBperLS6", "h_sum0ErrorBperLS6"},
2810  {"h_2DsumErrorBLS7", "h_2D0sumErrorBLS7"},
2811  {"h_sumErrorBperLS7", "h_sum0ErrorBperLS7"}};
2812 
2813  for (int depth = 1; depth <= 2; depth++) {
2814  cHB->Clear();
2815  cHB->Divide(2, 1);
2816  cHB->cd(1);
2817  TH1F *hRate2orig = NULL;
2818  TH2F *h2Cefz6 = NULL;
2819  TString hname1 = hnames[2 * depth - 2][0];
2820  TString hname0 = hnames[2 * depth - 2][1];
2821  TH2F *twod1 = (TH2F *)hfile->Get(hname1);
2822  TH2F *twod0 = (TH2F *)hfile->Get(hname0);
2823  if (1)
2824  std::cout << "debugger: errB_HF depth=" << depth << ". get 2D histos " << hname1 << " and " << hname0 << "\n";
2825  if (!twod1 || !twod0) {
2826  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2827  ptext->AddText("Missing histos");
2828  if (!twod1) {
2829  std::cout << "\tfailed to get " << hname1 << "\n";
2830  ptext->AddText(hname1);
2831  }
2832  if (!twod0) {
2833  std::cout << "\tfailed to get " << hname0 << "\n";
2834  ptext->AddText(hname0);
2835  }
2836  ptext->Draw();
2837  } else {
2838  h2Cefz6 = (TH2F *)twod1->Clone(Form("Cefz6_%d", depth));
2839  h2Cefz6->SetTitle(Form("HF Depth %d \b", depth));
2840  h2Cefz6->Divide(twod1, twod0, 1, 1, "B");
2841 
2842  gPad->SetGridy();
2843  gPad->SetGridx();
2844  gPad->SetLogz();
2845  h2Cefz6->SetTitle(Form("Depth %d \b", depth));
2846  h2Cefz6->SetMarkerStyle(20);
2847  h2Cefz6->SetMarkerSize(0.4);
2848  // h2Cefz6->GetZaxis()->SetLabelSize(0.04);
2849  h2Cefz6->SetXTitle("#eta \b");
2850  h2Cefz6->SetYTitle("#phi \b");
2851  h2Cefz6->SetZTitle(Form("<ErrorB> - HF Depth%d \b", depth));
2852  h2Cefz6->SetMarkerColor(2);
2853  h2Cefz6->SetLineColor(2);
2854  h2Cefz6->Draw("COLZ");
2855  delete twod1;
2856  delete twod0;
2857  } // histos ok
2858  cHB->cd(2);
2859  hname1 = hnames[2 * depth - 1][0];
2860  hname0 = hnames[2 * depth - 1][1];
2861  TH1F *h1 = (TH1F *)hfile->Get(hname1);
2862  TH1F *h0 = (TH1F *)hfile->Get(hname0);
2863  if (1)
2864  std::cout << "errB_HF depth=" << depth << ". get 2D histos " << hname1 << " and " << hname0 << "\n";
2865  if (!h1 || !h0) {
2866  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2867  ptext->AddText("Missing histo");
2868  if (!h1) {
2869  std::cout << "\tfailed to get " << hname1 << "\n";
2870  ptext->AddText(hname1);
2871  }
2872  if (!h0) {
2873  std::cout << "\tfailed to get " << hname0 << "\n";
2874  ptext->AddText(hname0);
2875  }
2876  ptext->Draw();
2877  } else {
2878  gPad->SetGridx();
2879  gPad->SetGridy();
2880  // gPad->SetLogy();
2881  hRate2orig = (TH1F *)h1->Clone(Form("Rate2orig_%d", depth));
2882  hRate2orig->Divide(h1, h0, 1, 1, "B");
2883 
2884  TH1F *hRate2 = NULL;
2885  if (lastLumiBin_HF > 1) {
2886  if (!copyContents(&hRate2, Form("Rate2_%d", depth), "", hRate2orig, lastLumiBin_HF)) {
2887  std::cout << "code failed" << std::endl;
2888  gSystem->Exit(1);
2889  }
2890  } else
2891  hRate2 = hRate2orig;
2892  hRate2->SetTitle(Form("Depth %d \b", depth));
2893  hRate2->SetMarkerStyle(20);
2894  hRate2->SetMarkerSize(0.8);
2895  // hRate2->GetZaxis()->SetLabelSize(0.04);
2896  hRate2->SetXTitle(Form("<ErrorB>(ev.in LS & ch.) - HF depth%d - iLS \b", depth));
2897  hRate2->SetMarkerColor(2);
2898  hRate2->SetLineColor(0);
2899  hRate2->Draw("Error");
2900  if (LSofFirstErrB_HF == -1) {
2901  int nx = hRate2->GetXaxis()->GetNbins();
2902  for (int i = 1; i <= nx; i++) {
2903  double ccc1 = hRate2->GetBinContent(i);
2904  if (ccc1 > 0.) {
2905  cout << "****************>>>>>>>>>>> ErrB_HF bad LS start at iLS = " << i << " with rate = " << ccc1
2906  << endl;
2907  LSofFirstErrB_HF = i;
2908  break;
2909  }
2910  }
2911  }
2912  delete h1;
2913  delete h0;
2914  if (hRate2 != hRate2orig) {
2915  delete hRate2orig;
2916  hRate2orig = hRate2;
2917  }
2918  }
2919  cHB->Update();
2920  cHB->Print(Form("HistErrB_HF_%d.png", depth));
2921  cHB->Clear();
2922  if (h2Cefz6)
2923  delete h2Cefz6;
2924  if (hRate2orig)
2925  delete hRate2orig;
2926  }
2927  } // ErrorsB in HF
2928 
2930 
2931  //=============================================================================== err A HB
2933  // For 2D and 1D plots with Amplitude. Produces ChkErrA_HBx.png
2934 
2935  for (int depth = 1; depth <= 2; depth++) {
2936  TH2F *h2Ceff = NULL;
2937  TH2F *h2Diffe = NULL;
2938  // TH1F* h1diffADCAmpl= NULL;
2939  TH2F *h3Ceff = NULL;
2940 
2941  cHE->Clear();
2942  cHE->Divide(3, 1);
2943 
2944  cHE->cd(1);
2945  // h_mapDepth1ADCAmpl_HB div h_mapDepth1_HB
2946  TString hname1 = Form("h_mapDepth%dADCAmpl_HB", depth);
2947  TString hname0 = Form("h_mapDepth%d_HB", depth);
2948  TH2F *twod1 = (TH2F *)hfile->Get(hname1);
2949  TH2F *twod0 = (TH2F *)hfile->Get(hname0);
2950  if (!twod1 || !twod0) {
2951  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2952  ptext->AddText("Missing histo");
2953  std::cout << "specHB test: failed to load " << hname1 << " and/or " << hname0 << "\n";
2954  if (!twod1)
2955  ptext->AddText(hname1);
2956  if (!twod0)
2957  ptext->AddText(hname0);
2958  ptext->Draw();
2959  continue;
2960  } else {
2961  // To IDENTIFY: see color different bins in eta-phi space
2962  h2Ceff = (TH2F *)twod1->Clone(Form("Ceff_HB%d", depth));
2963  h2Ceff->SetTitle(Form("HB Depth %d. (No cut) \b", depth));
2964  h2Ceff->Divide(twod1, twod0, 1, 1, "B");
2965 
2966  gPad->SetGridy();
2967  gPad->SetGridx();
2968  gPad->SetLogz();
2969  h2Ceff->SetMarkerStyle(20);
2970  h2Ceff->SetMarkerSize(0.4);
2971  //h2Ceff->GetZaxis()->SetLabelSize(0.08);
2972  h2Ceff->SetXTitle("#eta \b");
2973  h2Ceff->SetYTitle("#phi \b");
2974  h2Ceff->SetZTitle("h_mapDepth1ADCAmpl_HB \b");
2975  h2Ceff->SetMarkerColor(2);
2976  h2Ceff->SetLineColor(2);
2977  h2Ceff->Draw("COLZ");
2978  }
2979 
2980  cHE->cd(2);
2982  if (h2Ceff) {
2983  // TO IDENTIFY: see red bins in eta-phi space
2984  h2Diffe = (TH2F *)h2Ceff->Clone(Form("Diffe_Depth%d_HB", depth));
2985  h2Diffe->SetTitle(Form("HB Depth %d. Cut avg(ADCAmpl) > 25 \b", depth));
2986  int nx = h2Ceff->GetXaxis()->GetNbins();
2987  int ny = h2Ceff->GetYaxis()->GetNbins();
2988  for (int i = 1; i <= nx; i++) {
2989  for (int j = 1; j <= ny; j++) {
2990  double ccc1 = h2Ceff->GetBinContent(i, j);
2991  h2Diffe->SetBinContent(i, j, 0.);
2992  if (ccc1 > 25.)
2993  h2Diffe->SetBinContent(i, j, ccc1);
2994  }
2995  }
2996  gPad->SetGridy();
2997  gPad->SetGridx();
2998  gPad->SetLogz();
2999  h2Diffe->SetMarkerStyle(20);
3000  h2Diffe->SetMarkerSize(0.4);
3001  //h2Diffe->GetZaxis()->SetLabelSize(0.08);
3002  h2Diffe->SetXTitle("#eta \b");
3003  h2Diffe->SetYTitle("#phi \b");
3004  h2Diffe->SetZTitle("<ADCAmpl> bigger 25.- HB Depth1 \b");
3005  h2Diffe->SetMarkerColor(2);
3006  h2Diffe->SetLineColor(2);
3007  h2Diffe->Draw("COLZ");
3008  }
3009 
3010  cHE->cd(3);
3011  TString hname3 = Form("h_mapDepth%dADCAmpl225Copy_HB", depth);
3012  TH2F *twod3 = (TH2F *)hfile->Get(hname3);
3013  if (!twod3 || !twod0) {
3014  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
3015  ptext->AddText("Missing histo");
3016  std::cout << "specHB test: failed to load " << hname3 << " and/or " << hname0 << "\n";
3017  if (!twod3)
3018  ptext->AddText(hname3);
3019  if (!twod0)
3020  ptext->AddText(hname0);
3021  ptext->Draw();
3022  continue;
3023  } else {
3024  // To IDENTIFY: see color different bins in eta-phi space
3025  h3Ceff = (TH2F *)twod3->Clone(Form("CeffA_HB%d", depth));
3026  h3Ceff->SetTitle(Form("HB Depth %d. \b", depth));
3027  h3Ceff->Divide(twod3, twod0, 1, 1, "B");
3028  gPad->SetGridy();
3029  gPad->SetGridx();
3030  gPad->SetLogz();
3031  h3Ceff->SetMarkerStyle(20);
3032  h3Ceff->SetMarkerSize(0.4);
3033  // h3Ceff->GetZaxis()->SetLabelSize(0.08);
3034  h3Ceff->SetXTitle("#eta \b");
3035  h3Ceff->SetYTitle("#phi \b");
3036  h3Ceff->SetZTitle("rate for channels of HB \b");
3037  h3Ceff->SetMarkerColor(2);
3038  h3Ceff->SetLineColor(2);
3039  h3Ceff->Draw("COLZ");
3040  }
3041 
3042  cHE->Update();
3043  cHE->Print(Form("ChkErrA_HB%d.png", depth));
3044  cHE->Clear();
3045 
3046  if (h2Ceff)
3047  delete h2Ceff;
3048  if (h2Diffe)
3049  delete h2Diffe;
3050  // if (h1diffADCAmpl) delete h1diffADCAmpl;
3051  // if (twod0) delete twod0;// do not delete - sometimes causes trouble later
3052  if (twod1)
3053  delete twod1;
3054  if (twod3)
3055  delete twod3;
3056  if (h3Ceff)
3057  delete h3Ceff;
3058  } // depth
3059 
3060  //=============================================================================== err A HE
3062  // For 2D and 1D plots with Amplitude. Produces ChkErrA_HEx.png
3063 
3064  for (int depth = 1; depth <= 3; depth++) {
3065  TH2F *h2Ceff = NULL;
3066  TH2F *h2Diffe = NULL;
3067  // TH1F* h1diffADCAmpl= NULL;
3068  TH2F *h3Ceff = NULL;
3069 
3070  cHE->Clear();
3071  cHE->Divide(3, 1);
3072 
3073  cHE->cd(1);
3074  // h_mapDepth1ADCAmpl_HE div h_mapDepth1_HE
3075  TString hname1 = Form("h_mapDepth%dADCAmpl_HE", depth);
3076  TString hname0 = Form("h_mapDepth%d_HE", depth);
3077  TH2F *twod1 = (TH2F *)hfile->Get(hname1);
3078  TH2F *twod0 = (TH2F *)hfile->Get(hname0);
3079  if (!twod1 || !twod0) {
3080  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
3081  ptext->AddText("Missing histo");
3082  std::cout << "specHE test: failed to load " << hname1 << " and/or " << hname0 << "\n";
3083  if (!twod1)
3084  ptext->AddText(hname1);
3085  if (!twod0)
3086  ptext->AddText(hname0);
3087  ptext->Draw();
3088  continue;
3089  } else {
3090  // To IDENTIFY: see color different bins in eta-phi space
3091  h2Ceff = (TH2F *)twod1->Clone(Form("Ceff_HE%d", depth));
3092  h2Ceff->SetTitle(Form("HE Depth %d. (No cut) \b", depth));
3093  h2Ceff->Divide(twod1, twod0, 1, 1, "B");
3094 
3095  gPad->SetGridy();
3096  gPad->SetGridx();
3097  gPad->SetLogz();
3098  h2Ceff->SetMarkerStyle(20);
3099  h2Ceff->SetMarkerSize(0.4);
3100  //h2Ceff->GetZaxis()->SetLabelSize(0.08);
3101  h2Ceff->SetXTitle("#eta \b");
3102  h2Ceff->SetYTitle("#phi \b");
3103  h2Ceff->SetZTitle("h_mapDepth1ADCAmpl_HE \b");
3104  h2Ceff->SetMarkerColor(2);
3105  h2Ceff->SetLineColor(2);
3106  h2Ceff->Draw("COLZ");
3107  }
3108 
3109  cHE->cd(2);
3111  if (h2Ceff) {
3112  // TO IDENTIFY: see red bins in eta-phi space
3113  h2Diffe = (TH2F *)h2Ceff->Clone(Form("Diffe_Depth%d_HE", depth));
3114  h2Diffe->SetTitle(Form("HE Depth %d. Cut avg(ADCAmpl) > 1000 fC \b", depth));
3115  int nx = h2Ceff->GetXaxis()->GetNbins();
3116  int ny = h2Ceff->GetYaxis()->GetNbins();
3117  for (int i = 1; i <= nx; i++) {
3118  for (int j = 1; j <= ny; j++) {
3119  double ccc1 = h2Ceff->GetBinContent(i, j);
3120  h2Diffe->SetBinContent(i, j, 0.);
3121  if (ccc1 > 1000.)
3122  h2Diffe->SetBinContent(i, j, ccc1);
3123  }
3124  }
3125  gPad->SetGridy();
3126  gPad->SetGridx();
3127  gPad->SetLogz();
3128  h2Diffe->SetMarkerStyle(20);
3129  h2Diffe->SetMarkerSize(0.4);
3130  //h2Diffe->GetZaxis()->SetLabelSize(0.08);
3131  h2Diffe->SetXTitle("#eta \b");
3132  h2Diffe->SetYTitle("#phi \b");
3133  h2Diffe->SetZTitle("<ADCAmpl> bigger 1000.fC - HE Depth1 \b");
3134  h2Diffe->SetMarkerColor(2);
3135  h2Diffe->SetLineColor(2);
3136  h2Diffe->Draw("COLZ");
3137  }
3138 
3139  cHE->cd(3);
3140  TString hname3 = Form("h_mapDepth%dADCAmpl225Copy_HE", depth);
3141  TH2F *twod3 = (TH2F *)hfile->Get(hname3);
3142  if (!twod3 || !twod0) {
3143  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
3144  ptext->AddText("Missing histo");
3145  std::cout << "specHE test: failed to load " << hname3 << " and/or " << hname0 << "\n";
3146  if (!twod3)
3147  ptext->AddText(hname3);
3148  if (!twod0)
3149  ptext->AddText(hname0);
3150  ptext->Draw();
3151  continue;
3152  } else {
3153  // To IDENTIFY: see color different bins in eta-phi space
3154  h3Ceff = (TH2F *)twod3->Clone(Form("CeffA_HE%d", depth));
3155  h3Ceff->SetTitle(Form("HE Depth %d. \b", depth));
3156  h3Ceff->Divide(twod3, twod0, 1, 1, "B");
3157  gPad->SetGridy();
3158  gPad->SetGridx();
3159  gPad->SetLogz();
3160  h3Ceff->SetMarkerStyle(20);
3161  h3Ceff->SetMarkerSize(0.4);
3162  // h3Ceff->GetZaxis()->SetLabelSize(0.08);
3163  h3Ceff->SetXTitle("#eta \b");
3164  h3Ceff->SetYTitle("#phi \b");
3165  h3Ceff->SetZTitle("rate for channels of HE \b");
3166  h3Ceff->SetMarkerColor(2);
3167  h3Ceff->SetLineColor(2);
3168  h3Ceff->Draw("COLZ");
3169  }
3170 
3171  cHE->Update();
3172  cHE->Print(Form("ChkErrA_HE%d.png", depth));
3173  cHE->Clear();
3174 
3175  if (h2Ceff)
3176  delete h2Ceff;
3177  if (h2Diffe)
3178  delete h2Diffe;
3179  // if (h1diffADCAmpl) delete h1diffADCAmpl;
3180  // if (twod0) delete twod0;// do not delete - sometimes causes trouble later
3181  if (twod1)
3182  delete twod1;
3183  if (twod3)
3184  delete twod3;
3185  if (h3Ceff)
3186  delete h3Ceff;
3187  } // depth
3188 
3189  //=============================================================================== err A HO
3191  // For 2D and 1D plots with Amplitude. Produces ChkErrA_HOx.png
3192 
3193  for (int depth = 4; depth <= 4; depth++) {
3194  TH2F *h2Ceff = NULL;
3195  TH2F *h2Diffe = NULL;
3196  // TH1F* h1diffADCAmpl= NULL;
3197  TH2F *h3Ceff = NULL;
3198 
3199  cHE->Clear();
3200  cHE->Divide(3, 1);
3201 
3202  cHE->cd(1);
3203  // h_mapDepth1ADCAmpl_HO div h_mapDepth1_HO
3204  TString hname1 = Form("h_mapDepth%dADCAmpl_HO", depth);
3205  TString hname0 = Form("h_mapDepth%d_HO", depth);
3206  TH2F *twod1 = (TH2F *)hfile->Get(hname1);
3207  TH2F *twod0 = (TH2F *)hfile->Get(hname0);
3208  if (!twod1 || !twod0) {
3209  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
3210  ptext->AddText("Missing histo");
3211  std::cout << "specHO test: failed to load " << hname1 << " and/or " << hname0 << "\n";
3212  if (!twod1)
3213  ptext->AddText(hname1);
3214  if (!twod0)
3215  ptext->AddText(hname0);
3216  ptext->Draw();
3217  continue;
3218  } else {
3219  // To IDENTIFY: see color different bins in eta-phi space
3220  h2Ceff = (TH2F *)twod1->Clone(Form("Ceff_HO%d", depth));
3221  h2Ceff->SetTitle(Form("HO Depth %d. (No cut) \b", depth));
3222  h2Ceff->Divide(twod1, twod0, 1, 1, "B");
3223 
3224  gPad->SetGridy();
3225  gPad->SetGridx();
3226  gPad->SetLogz();
3227  h2Ceff->SetMarkerStyle(20);
3228  h2Ceff->SetMarkerSize(0.4);
3229  //h2Ceff->GetZaxis()->SetLabelSize(0.08);
3230  h2Ceff->SetXTitle("#eta \b");
3231  h2Ceff->SetYTitle("#phi \b");
3232  h2Ceff->SetZTitle("h_mapDepth1ADCAmpl_HO \b");
3233  h2Ceff->SetMarkerColor(2);
3234  h2Ceff->SetLineColor(2);
3235  h2Ceff->Draw("COLZ");
3236  }
3237 
3238  cHE->cd(2);
3240  if (h2Ceff) {
3241  // TO IDENTIFY: see red bins in eta-phi space (applied cut on Aij: <20 || >3000
3242  h2Diffe = (TH2F *)h2Ceff->Clone(Form("Diffe_Depth%d_HO", depth));
3243  h2Diffe->SetTitle(Form("HO Depth %d. Cut avg(ADCAmpl) > 80 \b", depth));
3244  int nx = h2Ceff->GetXaxis()->GetNbins();
3245  int ny = h2Ceff->GetYaxis()->GetNbins();
3246  for (int i = 1; i <= nx; i++) {
3247  for (int j = 1; j <= ny; j++) {
3248  double ccc1 = h2Ceff->GetBinContent(i, j);
3249  h2Diffe->SetBinContent(i, j, 0.);
3250  if (ccc1 > 20.)
3251  h2Diffe->SetBinContent(i, j, ccc1);
3252  }
3253  }
3254  gPad->SetGridy();
3255  gPad->SetGridx();
3256  gPad->SetLogz();
3257  h2Diffe->SetMarkerStyle(20);
3258  h2Diffe->SetMarkerSize(0.4);
3259  //h2Diffe->GetZaxis()->SetLabelSize(0.08);
3260  h2Diffe->SetXTitle("#eta \b");
3261  h2Diffe->SetYTitle("#phi \b");
3262  h2Diffe->SetZTitle("<ADCAmpl> bigger 80.- HO Depth1 \b");
3263  h2Diffe->SetMarkerColor(2);
3264  h2Diffe->SetLineColor(2);
3265  h2Diffe->Draw("COLZ");
3266  }
3267 
3268  cHE->cd(3);
3269  TString hname3 = Form("h_mapDepth%dADCAmpl225Copy_HO", depth);
3270  TH2F *twod3 = (TH2F *)hfile->Get(hname3);
3271  if (!twod3 || !twod0) {
3272  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
3273  ptext->AddText("Missing histo");
3274  std::cout << "specHO test: failed to load " << hname3 << " and/or " << hname0 << "\n";
3275  if (!twod3)
3276  ptext->AddText(hname3);
3277  if (!twod0)
3278  ptext->AddText(hname0);
3279  ptext->Draw();
3280  continue;
3281  } else {
3282  // To IDENTIFY: see color different bins in eta-phi space
3283  h3Ceff = (TH2F *)twod3->Clone(Form("CeffA_HO%d", depth));
3284  h3Ceff->SetTitle(Form("HO Depth %d. \b", depth));
3285  h3Ceff->Divide(twod3, twod0, 1, 1, "B");
3286  gPad->SetGridy();
3287  gPad->SetGridx();
3288  gPad->SetLogz();
3289  h3Ceff->SetMarkerStyle(20);
3290  h3Ceff->SetMarkerSize(0.4);
3291  // h3Ceff->GetZaxis()->SetLabelSize(0.08);
3292  h3Ceff->SetXTitle("#eta \b");
3293  h3Ceff->SetYTitle("#phi \b");
3294  h3Ceff->SetZTitle("rate for channels of HO \b");
3295  h3Ceff->SetMarkerColor(2);
3296  h3Ceff->SetLineColor(2);
3297  h3Ceff->Draw("COLZ");
3298  }
3299 
3300  cHE->Update();
3301  cHE->Print(Form("ChkErrA_HO%d.png", depth));
3302  cHE->Clear();
3303 
3304  if (h2Ceff)
3305  delete h2Ceff;
3306  if (h2Diffe)
3307  delete h2Diffe;
3308  // if (h1diffADCAmpl) delete h1diffADCAmpl;
3309  // if (twod0) delete twod0;// do not delete - sometimes causes trouble later
3310  if (twod1)
3311  delete twod1;
3312  if (twod3)
3313  delete twod3;
3314  if (h3Ceff)
3315  delete h3Ceff;
3316  } // depth
3317 
3318  //=============================================================================== err A HF
3320  // For 2D and 1D plots with Amplitude. Produces ChkErrA_HFx.png
3321 
3322  for (int depth = 1; depth <= 2; depth++) {
3323  TH2F *h2Ceff = NULL;
3324  TH2F *h2Diffe = NULL;
3325  // TH1F* h1diffADCAmpl= NULL;
3326  TH2F *h3Ceff = NULL;
3327 
3328  cHE->Clear();
3329  cHE->Divide(3, 1);
3330 
3331  cHE->cd(1);
3332  // h_mapDepth1ADCAmpl_HF div h_mapDepth1_HF
3333  TString hname1 = Form("h_mapDepth%dADCAmpl_HF", depth);
3334  TString hname0 = Form("h_mapDepth%d_HF", depth);
3335  TH2F *twod1 = (TH2F *)hfile->Get(hname1);
3336  TH2F *twod0 = (TH2F *)hfile->Get(hname0);
3337  if (!twod1 || !twod0) {
3338  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
3339  ptext->AddText("Missing histo");
3340  std::cout << "specHF test: failed to load " << hname1 << " and/or " << hname0 << "\n";
3341  if (!twod1)
3342  ptext->AddText(hname1);
3343  if (!twod0)
3344  ptext->AddText(hname0);
3345  ptext->Draw();
3346  continue;
3347  } else {
3348  // To IDENTIFY: see color different bins in eta-phi space
3349  h2Ceff = (TH2F *)twod1->Clone(Form("Ceff_HF%d", depth));
3350  h2Ceff->SetTitle(Form("HF Depth %d. (No cut) \b", depth));
3351  h2Ceff->Divide(twod1, twod0, 1, 1, "B");
3352 
3353  gPad->SetGridy();
3354  gPad->SetGridx();
3355  gPad->SetLogz();
3356  h2Ceff->SetMarkerStyle(20);
3357  h2Ceff->SetMarkerSize(0.4);
3358  //h2Ceff->GetZaxis()->SetLabelSize(0.08);
3359  h2Ceff->SetXTitle("#eta \b");
3360  h2Ceff->SetYTitle("#phi \b");
3361  h2Ceff->SetZTitle("h_mapDepth1ADCAmpl_HF \b");
3362  h2Ceff->SetMarkerColor(2);
3363  h2Ceff->SetLineColor(2);
3364  h2Ceff->Draw("COLZ");
3365  }
3366 
3367  cHE->cd(2);
3369  if (h2Ceff) {
3370  // TO IDENTIFY: see red bins in eta-phi space (applied cut on Aij: <20 || >3000
3371  h2Diffe = (TH2F *)h2Ceff->Clone(Form("Diffe_Depth%d_HF", depth));
3372  h2Diffe->SetTitle(Form("HF Depth %d. Cut avg(ADCAmpl) > 20 \b", depth));
3373  int nx = h2Ceff->GetXaxis()->GetNbins();
3374  int ny = h2Ceff->GetYaxis()->GetNbins();
3375  for (int i = 1; i <= nx; i++) {
3376  for (int j = 1; j <= ny; j++) {
3377  double ccc1 = h2Ceff->GetBinContent(i, j);
3378  h2Diffe->SetBinContent(i, j, 0.);
3379  if (ccc1 > 20.)
3380  h2Diffe->SetBinContent(i, j, ccc1);
3381  }
3382  }
3383  gPad->SetGridy();
3384  gPad->SetGridx();
3385  gPad->SetLogz();
3386  h2Diffe->SetMarkerStyle(20);
3387  h2Diffe->SetMarkerSize(0.4);
3388  //h2Diffe->GetZaxis()->SetLabelSize(0.08);
3389  h2Diffe->SetXTitle("#eta \b");
3390  h2Diffe->SetYTitle("#phi \b");
3391  h2Diffe->SetZTitle("<ADCAmpl> bigger 20.- HF Depth1 \b");
3392  h2Diffe->SetMarkerColor(2);
3393  h2Diffe->SetLineColor(2);
3394  h2Diffe->Draw("COLZ");
3395  }
3396 
3397  cHE->cd(3);
3398  /*
3399  if (h2Ceff) {
3400  h1diffADCAmpl = new TH1F(Form("diffADCAmpl_Depth%d_HF",depth),"",
3401  100, -20.,200.);
3402  h1diffADCAmpl->SetTitle(Form("HF Depth %d \b",depth));
3403  int nx = h2Ceff->GetXaxis()->GetNbins();
3404  int ny = h2Ceff->GetYaxis()->GetNbins();
3405  for (int i=1;i<=nx;i++) {
3406  for (int j=1;j<=ny;j++) {
3407  if(h2Ceff->GetBinContent(i,j) !=0 ) {
3408  double ccc1 = h2Ceff->GetBinContent(i,j) ;
3409  h1diffADCAmpl->Fill(ccc1);
3410  }
3411  }
3412  }
3413  gPad->SetLogy();
3414  h1diffADCAmpl->SetMarkerStyle(20);
3415  h1diffADCAmpl->SetMarkerSize(0.4);
3416  h1diffADCAmpl->GetYaxis()->SetLabelSize(0.04);
3417  h1diffADCAmpl->SetXTitle("<ADCAmpl> in each cell \b");
3418  h1diffADCAmpl->SetMarkerColor(2);
3419  h1diffADCAmpl->SetLineColor(2);
3420  h1diffADCAmpl->Draw("");
3421  }
3422  */
3423  TString hname3 = Form("h_mapDepth%dADCAmpl225Copy_HF", depth);
3424  TH2F *twod3 = (TH2F *)hfile->Get(hname3);
3425  if (!twod3 || !twod0) {
3426  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
3427  ptext->AddText("Missing histo");
3428  std::cout << "specHF test: failed to load " << hname3 << " and/or " << hname0 << "\n";
3429  if (!twod3)
3430  ptext->AddText(hname3);
3431  if (!twod0)
3432  ptext->AddText(hname0);
3433  ptext->Draw();
3434  continue;
3435  } else {
3436  // To IDENTIFY: see color different bins in eta-phi space
3437  h3Ceff = (TH2F *)twod3->Clone(Form("CeffA_HF%d", depth));
3438  h3Ceff->SetTitle(Form("HF Depth %d. \b", depth));
3439  h3Ceff->Divide(twod3, twod0, 1, 1, "B");
3440  gPad->SetGridy();
3441  gPad->SetGridx();
3442  gPad->SetLogz();
3443  h3Ceff->SetMarkerStyle(20);
3444  h3Ceff->SetMarkerSize(0.4);
3445  // h3Ceff->GetZaxis()->SetLabelSize(0.08);
3446  h3Ceff->SetXTitle("#eta \b");
3447  h3Ceff->SetYTitle("#phi \b");
3448  h3Ceff->SetZTitle("rate for channels of HF \b");
3449  h3Ceff->SetMarkerColor(2);
3450  h3Ceff->SetLineColor(2);
3451  h3Ceff->Draw("COLZ");
3452  }
3453 
3454  cHE->Update();
3455  cHE->Print(Form("ChkErrA_HF%d.png", depth));
3456  cHE->Clear();
3457 
3458  if (h2Ceff)
3459  delete h2Ceff;
3460  if (h2Diffe)
3461  delete h2Diffe;
3462  // if (h1diffADCAmpl) delete h1diffADCAmpl;
3463  // if (twod0) delete twod0;// do not delete - sometimes causes trouble later
3464  if (twod1)
3465  delete twod1;
3466  if (twod3)
3467  delete twod3;
3468  if (h3Ceff)
3469  delete h3Ceff;
3470  } // depth
3471 
3472  std::cout << "************>>> average Amplitudes done" << std::endl;
3473 
3474  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
3475  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
3476  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
3477  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
3478  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
3479 
3484 
3485  cout << " RBX analysis START for **************************" << endl;
3486  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
3487  // int njeta = 22; int njphi = 18; int lsmax=2600;
3488  int njeta = 22;
3489  int njphi = 18;
3490  int lsmax = 1800;
3491  cout << ">>>>>>>>>>>>>>>>>>>>>>>> int njeta = 22; int njphi = 18; int lsmax=1800; "
3492  << endl;
3493 
3494  double alexall[njeta][njphi][lsmax];
3495 
3496  // for phi tables(!):
3497  double alexhb[njphi][lsmax];
3498  double alexhe[njphi][lsmax];
3499  double alexho[njphi][lsmax];
3500  double alexhf[njphi][lsmax];
3501 
3502  // for eta tables(!):
3503  double blexhb[njeta][lsmax];
3504  double blexhe[njeta][lsmax];
3505  double blexho[njeta][lsmax];
3506  double blexhf[njeta][lsmax];
3507 
3508  cout << ">>>>>>>>>>>>>>>>>>>>>>>> alexall [njeta][njphi][lsmax]; " << endl;
3509  int maxbinsRBX = MaxLum;
3510  int nx = maxbinsRBX; // # LS
3511  cout << ">>>>>>>>>>>>>>>>>>>>>>>> maxbinsRBX = MaxLum; " << endl;
3512  if (MaxLum > lsmax)
3513  cout << "*********************************** ERROR ERROR ERROR ERROR: MaxLum > 1800 " << endl;
3514  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
3515 
3516  for (int i = 0; i < nx; i++) {
3517  for (int jphi = 0; jphi < njphi; jphi++) {
3518  alexhb[jphi][i] = 0.;
3519  alexhe[jphi][i] = 0.;
3520  alexho[jphi][i] = 0.;
3521  alexhf[jphi][i] = 0.;
3522 
3523  for (int jeta = 0; jeta < njeta; jeta++) {
3524  if (jphi == 0) {
3525  blexhb[jeta][i] = 0.;
3526  blexhe[jeta][i] = 0.;
3527  blexho[jeta][i] = 0.;
3528  blexhf[jeta][i] = 0.;
3529  }
3530 
3531  alexall[jeta][jphi][i] = 0.;
3532  }
3533  }
3534  }
3535 
3537  /*
3538  // j = ietaphi = 1- 396
3539  int ietaphimax = 396;
3540  int ny = ietaphimax + 1 ;
3541  for (int j=1;j<ny;j++) {
3542  int jeta = (j-1)/znphi;
3543  int jphi = (j-1)-znphi*jeta+1;// jphi=1-18
3544  jeta += 1;// jeta = 1-22 }
3545 // Outout is jeta = 1-22 jphi=1-18
3546 HB: j = 7,8,9,10 11,12,13,14
3547 HE: j = 3,4,5, 6, 7 14,15,16,17,18
3548 HO: j = 7,8,9,10 11,12,13,14
3549 HF: j = 0,1,2, 3 18,19,20,21
3550 */
3551 
3553  //======================================================================
3554  //======================================================================
3555  //======================================================================
3556  cout << " RBX general for HB **************************" << endl;
3557  TH2F *Ghb1KKK = (TH2F *)hfile->Get("h_2DsumADCAmplEtaPhiLs0");
3558  TH2F *Ghb1LLL = (TH2F *)hfile->Get("h_2DsumADCAmplEtaPhiLs00");
3559  TH2F *Ghb1 = (TH2F *)Ghb1LLL->Clone("Ghb1");
3560  Ghb1->Divide(Ghb1KKK, Ghb1LLL, 1, 1, "B"); // average A
3561  // Ghb1->Sumw2();
3562  // int nx = Ghb1->GetXaxis()->GetNbins(); // # LS
3563  int ny = Ghb1->GetYaxis()->GetNbins(); // # jetaphi indexes = 396 = 18*22
3564  // cout<<"***************************************** HB 54 ny= "<< ny <<endl;
3565  for (int j = 1; j <= ny; j++) {
3566  int jeta = (j - 1) / njphi; // jeta = 0-21
3567  if (jeta > 6 && jeta < 15) {
3568  int jphi = (j - 1) - njphi * jeta; // jphi=0-17
3569  // cout<<"HB 54 jeta= "<< jeta <<" jphi = "<<jphi <<endl;
3570  // over LS:
3571  for (int i = 1; i <= nx; i++) {
3572  double ccc1 = Ghb1->GetBinContent(i, j);
3573  alexall[jeta][jphi][i - 1] = ccc1;
3574  // if( i == 1 ) cout<<"HB 54 for LS=1 ccc1= "<< ccc1 <<endl;
3575  // if( ccc1 <= 0 ) cout<<"HB 54 ccc1= "<< ccc1 <<" iLS= "<< i <<" eta= "<< jeta <<" phi= "<< jphi <<endl;
3576  // cout<<"HB 54 ccc1= "<< ccc1 <<" j= "<< j <<" iLS= "<< i <<" eta= "<< jeta <<" phi= "<< jphi <<endl;
3577  } //i
3578  } //if
3579  } //j
3580  // clean-up
3581  if (Ghb1KKK)
3582  delete Ghb1KKK;
3583  if (Ghb1LLL)
3584  delete Ghb1LLL;
3585  // if (Ghb1) delete Ghb1;
3586 
3587  //====================================================================== alexhb[k][i]
3588  for (int jphi = 0; jphi < njphi; jphi++) {
3589  for (int i = 0; i < nx; i++) {
3590  double sumccc1 = 0.;
3591  int isum = 0;
3592  for (int jeta = 0; jeta < njeta; jeta++) {
3593  double ccc1 = alexall[jeta][jphi][i];
3594  if (ccc1 > 0.) {
3595  sumccc1 += ccc1;
3596  isum++;
3597  }
3598  } // for jeta
3599  if (isum > 0.)
3600  sumccc1 /= isum;
3601  alexhb[jphi][i] = sumccc1;
3602  }
3603  } //for for
3604 
3605  //====================================================================== blexhb[k][i]
3606  for (int keta = 0; keta < njeta; keta++) {
3607  for (int i = 0; i < nx; i++) {
3608  double sumccc1 = 0.;
3609  int isum = 0;
3610  for (int kphi = 0; kphi < njphi; kphi++) {
3611  double ccc1 = alexall[keta][kphi][i];
3612  if (ccc1 > 0.) {
3613  sumccc1 += ccc1;
3614  isum++;
3615  }
3616  } // for kphi
3617  if (isum > 0.)
3618  sumccc1 /= isum;
3619  blexhb[keta][i] = sumccc1;
3620  }
3621  } //for for
3622 
3624  //========================================================================================== 11 HB:: 2D jeta = 0 - 21 jphi =0 - 17
3625  //======================================================================
3626  //======================================================================
3627  //======================================================================
3628  //======================================================================
3629  cout << " RBX HB 2D plot *****" << endl;
3630  cRBX1->Clear();
3632  cRBX1->Divide(1, 1);
3633  cRBX1->cd(1);
3634  // int ietaphi = 0; ietaphi = ((k2+1)-1)*nphi + (k3+1) ; k2=0-neta-1; k3=0-nphi-1; neta=18; nphi=22;
3635  // TH2F* Ghb42D = new TH2F("Ghb42D","", 22, -11., 11., 18, 0., 18. );
3636  // TH2F* Ghb42D0 = new TH2F("Ghb42D0","", 22, -11., 11., 18, 0., 18. );
3637  TH2F *Ghb42D = new TH2F("Ghb42D", "", 23, -11.5, 11.5, 18, 0., 18.);
3638  TH2F *Ghb42D0 = new TH2F("Ghb42D0", "", 23, -11.5, 11.5, 18, 0., 18.);
3639  TH2F *Ghb42DF = (TH2F *)Ghb42D0->Clone("Ghb42DF");
3640  for (int jphi = 0; jphi < njphi; jphi++) {
3641  for (int jeta = 0; jeta < njeta; jeta++) {
3642  for (int i = 0; i < nx; i++) {
3643  double ccc1 = alexall[jeta][jphi][i];
3644  int neweta = jeta - 11 - 0.5;
3645  if (jeta >= 11)
3646  neweta = jeta - 11 + 1.5;
3647  if (ccc1 > 0.) {
3648  Ghb42D->Fill(neweta, jphi, ccc1);
3649  Ghb42D0->Fill(neweta, jphi, 1.);
3650  }
3651  // if(ccc1>0.) {Ghb42D ->Fill(jeta-11,jphi,ccc1); Ghb42D0 ->Fill(jeta-11,jphi,1.); }
3652  }
3653  }
3654  }
3655  Ghb42DF->Divide(Ghb42D, Ghb42D0, 1, 1, "B"); // average A
3656  // Ghb1->Sumw2();
3657  gPad->SetGridy();
3658  gPad->SetGridx(); // gPad->SetLogz();
3659  Ghb42DF->SetMarkerStyle(20);
3660  Ghb42DF->SetMarkerSize(0.4);
3661  Ghb42DF->GetZaxis()->SetLabelSize(0.04);
3662  Ghb42DF->SetXTitle("<A>_RBX #eta \b");
3663  Ghb42DF->SetYTitle(" #phi \b");
3664  Ghb42DF->SetZTitle("<A>_RBX - All \b");
3665  Ghb42DF->SetMarkerColor(2);
3666  Ghb42DF->SetLineColor(2); // Ghb42DF->SetMaximum(1.000); // Ghb42DF->SetMinimum(1.0);
3667  Ghb42DF->Draw("COLZ");
3668 
3670  cRBX1->Update();
3671  cRBX1->Print("RBX-HB-2Dplot.png");
3672  cRBX1->Clear();
3673  // clean-up
3674  if (Ghb42D)
3675  delete Ghb42D;
3676  if (Ghb42D0)
3677  delete Ghb42D0;
3678  if (Ghb42DF)
3679  delete Ghb42DF;
3680 
3681  //========================================================================================== 61 HB:: 1D j = 7,8,9,10 ; 11,12,13,14 jphi =0 - 17
3682  //======================================================================
3683  //======================================================================
3684  //======================================================================
3685  //======================================================================
3686  cout << " RBX HB 1D plot *****" << endl;
3687  cRBX1->Clear();
3689  cRBX1->Divide(1, 1);
3690  cRBX1->cd(1);
3691  TH1F *GphiHB1D = new TH1F("GphiHB1D", "", 18, 0., 18.);
3692  TH1F *GphiHB1D0 = new TH1F("GphiHB1D0", "", 18, 0., 18.);
3693  TH1F *GphiHB1DF = (TH1F *)GphiHB1D0->Clone("GphiHB1DF");
3694  for (int jphi = 0; jphi < 18; jphi++) {
3695  for (int jeta = 0; jeta < 22; jeta++) {
3696  for (int i = 0; i < nx; i++) {
3697  double ccc1 = alexall[jeta][jphi][i];
3698  if (ccc1 > 0.) {
3699  GphiHB1D->Fill(jphi, ccc1);
3700  GphiHB1D0->Fill(jphi, 1.);
3701  }
3702  }
3703  }
3704  }
3705  // GphiHB1D->Sumw2();GphiHB1D0->Sumw2();
3706  GphiHB1DF->Divide(GphiHB1D, GphiHB1D0, 1, 1, "B"); // average A
3707  // GphiHB1DF->Sumw2();
3708  for (int jphi = 1; jphi < 19; jphi++) {
3709  GphiHB1DF->SetBinError(jphi, 0.01);
3710  }
3711  gPad->SetGridy();
3712  gPad->SetGridx(); // gPad->SetLogz();
3713  GphiHB1DF->SetMarkerStyle(20);
3714  GphiHB1DF->SetMarkerSize(1.4);
3715  GphiHB1DF->GetZaxis()->SetLabelSize(0.08);
3716  GphiHB1DF->SetXTitle("PHI of RBX\b");
3717  GphiHB1DF->SetYTitle(" <Amplitude> \b");
3718  GphiHB1DF->SetZTitle("<A>_PHI - All \b");
3719  GphiHB1DF->SetMarkerColor(4);
3720  GphiHB1DF->SetLineColor(4);
3721  GphiHB1DF->SetMinimum(0.8); // GphiHB1DF->SetMaximum(1.000);
3722  GphiHB1DF->Draw("Error");
3724  cRBX1->Update();
3725  cRBX1->Print("RBX-HB-1Dplot.png");
3726  cRBX1->Clear();
3727  // clean-up
3728  if (GphiHB1D)
3729  delete GphiHB1D;
3730  if (GphiHB1D0)
3731  delete GphiHB1D0;
3732  if (GphiHB1DF)
3733  delete GphiHB1DF;
3734 
3735  //========================================================================================== 62 HB:: 1D j = 7,8,9,10 ; 11,12,13,14 jphi =0 - 17
3736  //======================================================================
3737  //======================================================================
3738  //======================================================================
3739  //======================================================================
3740  cout << " RBX HB 11D plot *eta*" << endl;
3741  cRBX1->Clear();
3743  cRBX1->Divide(1, 1);
3744  cRBX1->cd(1);
3745  TH1F *GetaHB11D = new TH1F("GetaHB11D", "", 23, -11.5, 11.5);
3746  TH1F *GetaHB11D0 = new TH1F("GetaHB11D0", "", 23, -11.5, 11.5);
3747  TH1F *GetaHB11DF = (TH1F *)GetaHB11D0->Clone("GetaHB11DF");
3748 
3749  for (int jeta = 0; jeta < 22; jeta++) {
3750  for (int jphi = 0; jphi < 18; jphi++) {
3751  for (int i = 0; i < nx; i++) {
3752  double ccc1 = alexall[jeta][jphi][i];
3753  int neweta = jeta - 11 - 0.5;
3754  if (jeta >= 11)
3755  neweta = jeta - 11 + 1.5;
3756  if (ccc1 > 0.) {
3757  GetaHB11D->Fill(neweta, ccc1);
3758  GetaHB11D0->Fill(neweta, 1.);
3759  // if( i == 0 ) cout<<"62 HB: ibin= "<< i <<" jphi= "<< jphi <<" jeta= "<< jeta <<" A= "<< ccc1 <<endl;
3760  }
3761  }
3762  }
3763  }
3764  // GetaHB11D->Sumw2();GetaHB11D0->Sumw2();
3765  GetaHB11DF->Divide(GetaHB11D, GetaHB11D0, 1, 1, "B"); // average A
3766  // GetaHB11DF->Sumw2();
3767  for (int jeta = 1; jeta < 24; jeta++) {
3768  GetaHB11DF->SetBinError(jeta, 0.01);
3769  }
3770  gPad->SetGridy();
3771  gPad->SetGridx(); // gPad->SetLogz();
3772  GetaHB11DF->SetMarkerStyle(20);
3773  GetaHB11DF->SetMarkerSize(1.4);
3774  GetaHB11DF->GetZaxis()->SetLabelSize(0.08);
3775  GetaHB11DF->SetXTitle("#eta \b");
3776  GetaHB11DF->SetYTitle(" <A> \b");
3777  GetaHB11DF->SetZTitle("<A>_ETA - All \b");
3778  GetaHB11DF->SetMarkerColor(4);
3779  GetaHB11DF->SetLineColor(4);
3780  GetaHB11DF->SetMinimum(0.8); // GetaHB11DF->SetMaximum(1.000);
3781  GetaHB11DF->Draw("Error");
3782 
3784  cRBX1->Update();
3785  cRBX1->Print("RBX-HB-11Dplot.png");
3786  cRBX1->Clear();
3787  // clean-up
3788  if (GetaHB11D)
3789  delete GetaHB11D;
3790  if (GetaHB11D0)
3791  delete GetaHB11D0;
3792  if (GetaHB11DF)
3793  delete GetaHB11DF;
3794 
3795  //========================================================================================== 22 HB:: Ratio plots jeta = 0 - 21 jphi =0 - 17
3796  //======================================================================
3797  //======================================================================22.11.2018
3798  //======================================================================
3799  //======================================================================
3800 
3801  gStyle->SetOptStat(1110000);
3802  cout << " RBX HB Ratio plots *****" << endl;
3803  cRBX31->Clear();
3805  // gain stabilitY:
3806  // Rij = Aij / A1j , where i-over LSs, j-channels
3807  //
3808  // nx = maxbinsRBX; // # LS
3809  //
3810  double ccc0HB = 0.;
3811  cRBX31->Divide(3, 1);
3812  //================
3813  cRBX31->cd(1);
3814  // TH1F* Ghb5 = new TH1F("Ghb5","", nx, 1., nx+1.);
3815  TH1F *Ghb51 = new TH1F("Ghb51", "", nx, 1., nx + 1.);
3816  TH1F *Ghb50 = new TH1F("Ghb50", "", nx, 1., nx + 1.);
3817  TH1F *Ghb5 = (TH1F *)Ghb50->Clone("Ghb5");
3818  // j - etaphi index:
3819  for (int j = 1; j <= ny; j++) {
3820  ccc0HB = Ghb1->GetBinContent(1, j);
3821  // if(ccc0HB <=0.) for (int i=1;i<=nx;i++) {double ccc2 = Ghb1->GetBinContent(i,j);if(ccc2>0.){ccc0HB=ccc2;cout<<"!!! ccc0HB= "<<ccc0HB<<endl;break;} }
3822  if (ccc0HB <= 0.)
3823  for (int i = 1; i <= nx; i++) {
3824  double ccc2 = Ghb1->GetBinContent(i, j);
3825  if (ccc2 > 0.) {
3826  ccc0HB = ccc2;
3827  break;
3828  }
3829  }
3830  if (ccc0HB > 0.) {
3831  // i - # LSs:
3832  for (int i = 1; i <= nx; i++) {
3833  double ccc1 = Ghb1->GetBinContent(i, j);
3834  if (ccc1 > 0.) {
3835  double Rij = ccc1 / ccc0HB;
3836  // Ghb5 ->Fill( float(i), Rij);
3837  Ghb51->Fill(float(i), Rij);
3838  Ghb50->Fill(float(i), 1.);
3839  }
3840  }
3841  }
3842  }
3843  Ghb5->Divide(Ghb51, Ghb50, 1, 1, "B"); // average A
3844  for (int i = 1; i <= nx; i++) {
3845  Ghb5->SetBinError(i, 0.0001);
3846  }
3847  Ghb5->SetMarkerStyle(20);
3848  Ghb5->SetMarkerSize(0.4);
3849  Ghb5->GetYaxis()->SetLabelSize(0.04);
3850  Ghb5->SetMarkerColor(2);
3851  Ghb5->SetLineColor(0);
3852  Ghb5->SetXTitle(" iLS \b");
3853  Ghb5->SetYTitle(" <R> \b");
3854  Ghb5->SetTitle("<Ri> vs iLS \b");
3855  Ghb5->SetMinimum(0.); //Ghb5->SetMaximum(2.5);
3856  // gPad->SetLogy();
3857  gPad->SetGridy();
3858  gPad->SetGridx();
3859  Ghb5->SetStats(0);
3860  Ghb5->GetYaxis()->SetLabelSize(0.025);
3861  Ghb5->Draw("Error");
3862  //================
3863  cRBX31->cd(2);
3864  TH2F *Ghb60 = new TH2F("Ghb60", "", 22, -11., 11., 18, 0., 18.);
3865  TH2F *Ghb61 = new TH2F("Ghb61", "", 22, -11., 11., 18, 0., 18.);
3866  TH2F *Ghb6 = new TH2F("Ghb6", "", 22, -11., 11., 18, 0., 18.);
3867 
3868  TH2F *G20hb60 = new TH2F("G20hb60", "", 22, -11., 11., 18, 0., 18.);
3869  TH2F *G20hb61 = new TH2F("G20hb61", "", 22, -11., 11., 18, 0., 18.);
3870  TH2F *G20hb6 = new TH2F("G20hb6", "", 22, -11., 11., 18, 0., 18.);
3871  TH2F *G30hb60 = new TH2F("G30hb60", "", 22, -11., 11., 18, 0., 18.);
3872  TH2F *G30hb61 = new TH2F("G30hb61", "", 22, -11., 11., 18, 0., 18.);
3873  TH2F *G30hb6 = new TH2F("G30hb6", "", 22, -11., 11., 18, 0., 18.);
3874  TH2F *G40hb60 = new TH2F("G40hb60", "", 22, -11., 11., 18, 0., 18.);
3875  TH2F *G40hb61 = new TH2F("G40hb61", "", 22, -11., 11., 18, 0., 18.);
3876  TH2F *G40hb6 = new TH2F("G40hb6", "", 22, -11., 11., 18, 0., 18.);
3877  // j - etaphi index; i - # LSs;
3878  //
3879  // define mean and RMS:
3880  double sumjHB = 0.;
3881  int njHB = 0;
3882  double meanjHB = 0.;
3883  for (int j = 1; j <= ny; j++) {
3884  ccc0HB = Ghb1->GetBinContent(1, j);
3885  if (ccc0HB <= 0.)
3886  for (int i = 1; i <= nx; i++) {
3887  double ccc2 = Ghb1->GetBinContent(i, j);
3888  if (ccc2 > 0.) {
3889  ccc0HB = ccc2;
3890  break;
3891  }
3892  }
3893  if (ccc0HB > 0.) {
3894  for (int i = 1; i <= nx; i++) {
3895  double ccc1 = Ghb1->GetBinContent(i, j) / ccc0HB;
3896  if (ccc1 > 0.) {
3897  sumjHB += ccc1;
3898  njHB++;
3899  }
3900  }
3901  meanjHB = sumjHB / njHB;
3902  }
3903  } // j
3904 
3905  double ssumjHB = 0.;
3906  njHB = 0;
3907  double sigmajHB = 0.;
3908  for (int j = 1; j <= ny; j++) {
3909  ccc0HB = Ghb1->GetBinContent(1, j);
3910  if (ccc0HB <= 0.)
3911  for (int i = 1; i <= nx; i++) {
3912  double ccc2 = Ghb1->GetBinContent(i, j);
3913  if (ccc2 > 0.) {
3914  ccc0HB = ccc2;
3915  break;
3916  }
3917  }
3918  if (ccc0HB > 0.) {
3919  for (int i = 1; i <= nx; i++) {
3920  double ccc1 = Ghb1->GetBinContent(i, j) / ccc0HB;
3921  if (ccc1 > 0.) {
3922  ssumjHB += (ccc1 - meanjHB) * (ccc1 - meanjHB);
3923  njHB++;
3924  }
3925  }
3926  sigmajHB = sqrt(ssumjHB / njHB);
3927  }
3928  } // j
3929 
3930  double dif3rmsHBMIN = meanjHB - 3 * sigmajHB;
3931  if (dif3rmsHBMIN < 0.)
3932  dif3rmsHBMIN = 0.;
3933  double dif3rmsHBMAX = meanjHB + 3 * sigmajHB;
3934  cout << "22HB-2 meanjHB= " << meanjHB << " sigmajHB= " << sigmajHB << " dif3rmsHBMIN= " << dif3rmsHBMIN
3935  << " dif3rmsHBMAX= " << dif3rmsHBMAX << endl;
3936 
3937  double MAXdif3rmsHBMIN = dif3rmsHBMIN;
3938  double MINdif3rmsHBMAX = dif3rmsHBMAX;
3939  if (MAXdif3rmsHBMIN < 0.95)
3940  MAXdif3rmsHBMIN = 0.95;
3941  if (MINdif3rmsHBMAX > 1.05)
3942  MINdif3rmsHBMAX = 1.05;
3943  cout << "22HB-2 MAXdif3rmsHBMIN= " << MAXdif3rmsHBMIN << " MINdif3rmsHBMAX= " << MINdif3rmsHBMAX << endl;
3944  //
3945  for (int j = 1; j <= ny; j++) {
3946  ccc0HB = Ghb1->GetBinContent(1, j);
3947  if (ccc0HB <= 0.)
3948  for (int i = 1; i <= nx; i++) {
3949  double ccc2 = Ghb1->GetBinContent(i, j);
3950  if (ccc2 > 0.) {
3951  ccc0HB = ccc2;
3952  break;
3953  }
3954  }
3955  if (ccc0HB > 0.) {
3956  int jeta = (j - 1) / 18; // jeta = 0-21
3957  int jphi = (j - 1) - 18 * jeta; // jphi=0-17
3958  // i - # LSs:
3959  for (int i = 1; i <= nx; i++) {
3960  double ccc1 = Ghb1->GetBinContent(i, j);
3961  if (ccc1 > 0.) {
3962  double Rij = ccc1 / ccc0HB;
3963  if (Rij < MAXdif3rmsHBMIN || Rij > MINdif3rmsHBMAX) {
3964  Ghb61->Fill(jeta - 11, jphi, Rij);
3965  Ghb60->Fill(jeta - 11, jphi, 1.);
3966  }
3967  if (Rij < 0.8 || Rij > 1.2) {
3968  G20hb61->Fill(jeta - 11, jphi, Rij);
3969  G20hb60->Fill(jeta - 11, jphi, 1.);
3970  }
3971  if (Rij < 0.7 || Rij > 1.3) {
3972  G30hb61->Fill(jeta - 11, jphi, Rij);
3973  G30hb60->Fill(jeta - 11, jphi, 1.);
3974  }
3975  if (Rij < 0.6 || Rij > 1.4) {
3976  G40hb61->Fill(jeta - 11, jphi, Rij);
3977  G40hb60->Fill(jeta - 11, jphi, 1.);
3978  }
3979  } //if(ccc1>0.
3980  } // i
3981  } //if(ccc0HB>0
3982  } // j
3983  Ghb6->Divide(Ghb61, Ghb60, 1, 1, "B"); // average R
3984  G20hb6->Divide(G20hb61, G20hb60, 1, 1, "B"); // average R
3985  G30hb6->Divide(G30hb61, G30hb60, 1, 1, "B"); // average R
3986  G40hb6->Divide(G40hb61, G40hb60, 1, 1, "B"); // average R
3987 
3988  Ghb6->GetZaxis()->SetLabelSize(0.025);
3989  Ghb6->SetXTitle(" #eta \b");
3990  Ghb6->SetYTitle(" #phi \b");
3991  Ghb6->SetTitle("<Rj> for |1-<R>| > 0.05 \b");
3992  Ghb6->SetStats(0);
3993  Ghb6->Draw("COLZ");
3994  //================
3995  cRBX31->cd(3);
3996  TH1F *Ghb7 = new TH1F("Ghb7", "", 120, 0.4, 1.6);
3997  // j - etaphi index:
3998  for (int j = 1; j <= ny; j++) {
3999  ccc0HB = Ghb1->GetBinContent(1, j);
4000  if (ccc0HB <= 0.)
4001  for (int i = 1; i <= nx; i++) {
4002  double ccc2 = Ghb1->GetBinContent(i, j);
4003  if (ccc2 > 0.) {
4004  ccc0HB = ccc2;
4005  break;
4006  }
4007  }
4008  if (ccc0HB > 0.) {
4009  // i - # LSs:
4010  for (int i = 1; i <= nx; i++) {
4011  double ccc1 = Ghb1->GetBinContent(i, j);
4012  if (ccc1 > 0.) {
4013  double Rij = ccc1 / ccc0HB;
4014  Ghb7->Fill(Rij);
4015  }
4016  }
4017  }
4018  }
4019  Ghb7->SetMarkerStyle(20);
4020  Ghb7->SetMarkerSize(0.4);
4021  Ghb7->GetYaxis()->SetLabelSize(0.04);
4022  Ghb7->SetMarkerColor(2);
4023  Ghb7->SetLineColor(0);
4024  Ghb7->SetYTitle(" N \b");
4025  Ghb7->SetXTitle(" Rij \b");
4026  Ghb7->SetTitle(" Rij \b");
4027  //Ghb7->SetMinimum(0.8);Ghb7->SetMaximum(500.);
4028  gPad->SetGridy();
4029  gPad->SetGridx(); // gPad->SetLogy();
4030  // Ghb7->SetStats(1110000);
4031  Ghb7->GetYaxis()->SetLabelSize(0.025);
4032  Ghb7->Draw("Error");
4033  Float_t ymaxHB = Ghb7->GetMaximum();
4034  cout << "22HB-3 ymaxHB= " << ymaxHB << " MAXdif3rmsHBMIN= " << MAXdif3rmsHBMIN
4035  << " MINdif3rmsHBMAX= " << MINdif3rmsHBMAX << endl;
4036  TLine *lineHB = new TLine(MAXdif3rmsHBMIN, 0., MAXdif3rmsHBMIN, ymaxHB);
4037  lineHB->SetLineColor(kBlue);
4038  lineHB->Draw();
4039  TLine *line1HB = new TLine(MINdif3rmsHBMAX, 0., MINdif3rmsHBMAX, ymaxHB);
4040  line1HB->SetLineColor(kBlue);
4041  line1HB->Draw();
4042  //================
4044  cRBX31->Update();
4045  cRBX31->Print("RBX-HB-3plots.png");
4046  cRBX31->Clear();
4047  // clean-up
4048  if (Ghb5)
4049  delete Ghb5;
4050  if (Ghb60)
4051  delete Ghb60;
4052  if (Ghb61)
4053  delete Ghb61;
4054  if (Ghb6)
4055  delete Ghb6;
4056  if (Ghb7)
4057  delete Ghb7;
4058 
4059  if (G20hb60)
4060  delete G20hb60;
4061  if (G20hb61)
4062  delete G20hb61;
4063  if (G30hb60)
4064  delete G30hb60;
4065  if (G30hb61)
4066  delete G30hb61;
4067  if (G40hb60)
4068  delete G40hb60;
4069  if (G40hb61)
4070  delete G40hb61;
4071 
4072  if (Ghb1)
4073  delete Ghb1;
4074  //========================================================================================== 22-1 HB:: Ratio plots jeta = 0 - 21 jphi =0 - 17
4075  //======================================================================
4076  //======================================================================28.11.2018
4077  //======================================================================
4078  //======================================================================
4079 
4080  gStyle->SetOptStat(1110000);
4081  cout << " RBX HB Ratio plotsmore *****" << endl;
4082  cRBX31->Clear();
4084  cRBX31->Divide(3, 1);
4085  //================
4086  cRBX31->cd(1);
4087  G20hb6->GetZaxis()->SetLabelSize(0.025);
4088  G20hb6->SetXTitle(" #eta \b");
4089  G20hb6->SetYTitle(" #phi \b");
4090  G20hb6->SetTitle("<Rj> for |1-<R>| > 0.20 \b");
4091  G20hb6->SetStats(0);
4092  G20hb6->Draw("COLZ");
4093  //================
4094  cRBX31->cd(2);
4095  G30hb6->GetZaxis()->SetLabelSize(0.025);
4096  G30hb6->SetXTitle(" #eta \b");
4097  G30hb6->SetYTitle(" #phi \b");
4098  G30hb6->SetTitle("<Rj> for |1-<R>| > 0.30 \b");
4099  G30hb6->SetStats(0);
4100  G30hb6->Draw("COLZ");
4101  //================
4102  cRBX31->cd(3);
4103  G40hb6->GetZaxis()->SetLabelSize(0.025);
4104  G40hb6->SetXTitle(" #eta \b");
4105  G40hb6->SetYTitle(" #phi \b");
4106  G40hb6->SetTitle("<Rj> for |1-<R>| > 0.40 \b");
4107  G40hb6->SetStats(0);
4108  G40hb6->Draw("COLZ");
4109  //================
4110 
4112  cRBX31->Update();
4113  cRBX31->Print("RBX-HB-3plotsmore.png");
4114  cRBX31->Clear();
4115 
4116  // clean-up
4117  if (G20hb6)
4118  delete G20hb6;
4119  if (G30hb6)
4120  delete G30hb6;
4121  if (G40hb6)
4122  delete G40hb6;
4123  gStyle->SetOptStat(0);
4124 
4126 
4127  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
4128  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
4129  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
4130  for (int jphi = 0; jphi < njphi; jphi++) {
4131  for (int jeta = 0; jeta < njeta; jeta++) {
4132  for (int i = 0; i < nx; i++) {
4133  alexall[jeta][jphi][i] = 0.;
4134  }
4135  }
4136  } // nulling
4137 
4139 
4141  //======================================================================
4142  //======================================================================
4143  //======================================================================
4144  cout << " RBX general for HE **************************" << endl;
4145  TH2F *Ghe1KKK = (TH2F *)hfile->Get("h_2DsumADCAmplEtaPhiLs1");
4146  TH2F *Ghe1LLL = (TH2F *)hfile->Get("h_2DsumADCAmplEtaPhiLs10");
4147  TH2F *Ghe1 = (TH2F *)Ghe1LLL->Clone("Ghe1");
4148  Ghe1->Divide(Ghe1KKK, Ghe1LLL, 1, 1, "B"); // average A
4149  // Ghe1->Sumw2();
4150  // int nx = Ghe1->GetXaxis()->GetNbins(); // # LS
4151  // nx = maxbinsRBX; // # LS
4152  ny = Ghe1->GetYaxis()->GetNbins(); // # jetaphi indexes
4153  for (int j = 1; j <= ny; j++) {
4154  int jeta = (j - 1) / njphi; // jeta = 0-21
4155  if ((jeta < 8 && jeta > 2) || (jeta < 19 && jeta > 13)) {
4156  int jphi = (j - 1) - njphi * jeta; // jphi=0-17
4157  // cout<<"HE 54 jeta= "<< jeta <<" jphi = "<<jphi <<endl;
4158  // over LS:
4159  for (int i = 1; i <= nx; i++) {
4160  double ccc1 = Ghe1->GetBinContent(i, j);
4161  alexall[jeta][jphi][i - 1] = ccc1;
4162  // if( i == 1 ) cout<<"HE 54 for LS=1 ccc1= "<< ccc1 <<endl;
4163  } //i
4164  } //if
4165  } //j
4166  // clean-up
4167  if (Ghe1KKK)
4168  delete Ghe1KKK;
4169  if (Ghe1LLL)
4170  delete Ghe1LLL;
4171  // if (Ghe1) delete Ghe1;
4172 
4173  //====================================================================== alexhe[k][i]
4174  for (int jphi = 0; jphi < njphi; jphi++) {
4175  for (int i = 0; i < nx; i++) {
4176  double sumccc1 = 0.;
4177  int isum = 0;
4178  for (int jeta = 0; jeta < njeta; jeta++) {
4179  double ccc1 = alexall[jeta][jphi][i];
4180  if (ccc1 > 0.) {
4181  sumccc1 += ccc1;
4182  isum++;
4183  }
4184  } // for jeta
4185  if (isum > 0.)
4186  sumccc1 /= isum;
4187  alexhe[jphi][i] = sumccc1;
4188  }
4189  } //for for
4190  //====================================================================== blexhe[k][i]
4191  for (int keta = 0; keta < njeta; keta++) {
4192  for (int i = 0; i < nx; i++) {
4193  double sumccc1 = 0.;
4194  int isum = 0;
4195  for (int kphi = 0; kphi < njphi; kphi++) {
4196  double ccc1 = alexall[keta][kphi][i];
4197  if (ccc1 > 0.) {
4198  sumccc1 += ccc1;
4199  isum++;
4200  }
4201  } // for kphi
4202  if (isum > 0.)
4203  sumccc1 /= isum;
4204  blexhe[keta][i] = sumccc1;
4205  }
4206  } //for for
4208  //========================================================================================== 21 HE:: 2D jeta = 0 - 21 jphi =0 - 17
4209  //======================================================================
4210  //======================================================================
4211  //======================================================================
4212  //======================================================================
4213  cout << " RBX HE 2D plot *****" << endl;
4214  cRBX1->Clear();
4216  cRBX1->Divide(1, 1);
4217  cRBX1->cd(1);
4218  // int ietaphi = 0; ietaphi = ((k2+1)-1)*nphi + (k3+1) ; k2=0-neta-1; k3=0-nphi-1; neta=18; nphi=22;
4219  TH2F *Ghe42D = new TH2F("Ghe42D", "", 23, -11.5, 11.5, 18, 0., 18.);
4220  TH2F *Ghe42D0 = new TH2F("Ghe42D0", "", 23, -11.5, 11.5, 18, 0., 18.);
4221  // TH2F* Ghe42D = new TH2F("Ghe42D","", 22, -11., 11., 18, 0., 18. );
4222  // TH2F* Ghe42D0 = new TH2F("Ghe42D0","", 22, -11., 11., 18, 0., 18. );
4223  TH2F *Ghe42DF = (TH2F *)Ghe42D0->Clone("Ghe42DF");
4224  for (int jphi = 0; jphi < njphi; jphi++) {
4225  for (int jeta = 0; jeta < njeta; jeta++) {
4226  for (int i = 0; i < nx; i++) {
4227  double ccc1 = alexall[jeta][jphi][i];
4228  int neweta = jeta - 11 - 0.5;
4229  if (jeta >= 11)
4230  neweta = jeta - 11 + 1.5;
4231  if (ccc1 > 0.) {
4232  Ghe42D->Fill(neweta, jphi, ccc1);
4233  Ghe42D0->Fill(neweta, jphi, 1.);
4234  }
4235  // if(ccc1>0.) {Ghe42D ->Fill(jeta-11,jphi,ccc1); Ghe42D0 ->Fill(jeta-11,jphi,1.); }
4236  }
4237  }
4238  }
4239  Ghe42DF->Divide(Ghe42D, Ghe42D0, 1, 1, "B"); // average A
4240  // Ghe1->Sumw2();
4241  gPad->SetGridy();
4242  gPad->SetGridx(); // gPad->SetLogz();
4243  Ghe42DF->SetMarkerStyle(20);
4244  Ghe42DF->SetMarkerSize(0.4);
4245  Ghe42DF->GetZaxis()->SetLabelSize(0.04);
4246  Ghe42DF->SetXTitle("<A>_RBX #eta \b");
4247  Ghe42DF->SetYTitle(" #phi \b");
4248  Ghe42DF->SetZTitle("<A>_RBX - All \b");
4249  Ghe42DF->SetMarkerColor(2);
4250  Ghe42DF->SetLineColor(2); // Ghe42DF->SetMaximum(1.000); // Ghe42DF->SetMinimum(1.0);
4251  Ghe42DF->Draw("COLZ");
4252 
4254  cRBX1->Update();
4255  cRBX1->Print("RBX-HE-2Dplot.png");
4256  cRBX1->Clear();
4257  // clean-up
4258  if (Ghe42D)
4259  delete Ghe42D;
4260  if (Ghe42D0)
4261  delete Ghe42D0;
4262  if (Ghe42DF)
4263  delete Ghe42DF;
4264 
4265  //========================================================================================== 61 HE:: 1D j = 3,4,5, 6, 7 14,15,16,17,18 jphi =0 - 17
4266  //======================================================================
4267  //======================================================================
4268  //======================================================================
4269  //======================================================================
4270  cout << " RBX HE 1D plot *****" << endl;
4271  cRBX1->Clear();
4273  cRBX1->Divide(1, 1);
4274  cRBX1->cd(1);
4275  TH1F *GphiHE1D = new TH1F("GphiHE1D", "", 18, 0., 18.);
4276  TH1F *GphiHE1D0 = new TH1F("GphiHE1D0", "", 18, 0., 18.);
4277  TH1F *GphiHE1DF = (TH1F *)GphiHE1D0->Clone("GphiHE1DF");
4278  for (int jphi = 0; jphi < 18; jphi++) {
4279  for (int jeta = 0; jeta < 22; jeta++) {
4280  for (int i = 0; i < nx; i++) {
4281  double ccc1 = alexall[jeta][jphi][i];
4282  if (ccc1 > 0.) {
4283  GphiHE1D->Fill(jphi, ccc1);
4284  GphiHE1D0->Fill(jphi, 1.);
4285  }
4286  }
4287  }
4288  }
4289  // GphiHE1D->Sumw2();GphiHE1D0->Sumw2();
4290  GphiHE1DF->Divide(GphiHE1D, GphiHE1D0, 1, 1, "B"); // average A
4291  // GphiHE1DF->Sumw2();
4292  for (int jphi = 1; jphi < 19; jphi++) {
4293  GphiHE1DF->SetBinError(jphi, 0.01);
4294  }
4295  gPad->SetGridy();
4296  gPad->SetGridx(); // gPad->SetLogz();
4297  GphiHE1DF->SetMarkerStyle(20);
4298  GphiHE1DF->SetMarkerSize(1.4);
4299  GphiHE1DF->GetZaxis()->SetLabelSize(0.08);
4300  GphiHE1DF->SetXTitle("PHI of RBX\b");
4301  GphiHE1DF->SetYTitle(" <Amplitude> \b");
4302  GphiHE1DF->SetZTitle("<A>_PHI - All \b");
4303  GphiHE1DF->SetMarkerColor(4);
4304  GphiHE1DF->SetLineColor(4);
4305  GphiHE1DF->SetMinimum(0.8); // GphiHE1DF->SetMaximum(1.000);
4306  GphiHE1DF->Draw("Error");
4308  cRBX1->Update();
4309  cRBX1->Print("RBX-HE-1Dplot.png");
4310  cRBX1->Clear();
4311  // clean-up
4312  if (GphiHE1D)
4313  delete GphiHE1D;
4314  if (GphiHE1D0)
4315  delete GphiHE1D0;
4316  if (GphiHE1DF)
4317  delete GphiHE1DF;
4318 
4319  //========================================================================================== 62 HE:: 1D j = 3,4,5, 6, 7 14,15,16,17,18 jphi =0 - 17
4320  //======================================================================
4321  //======================================================================
4322  //======================================================================
4323  //======================================================================
4324  cout << " RBX HE 11D plot *eta*" << endl;
4325  cRBX1->Clear();
4327  cRBX1->Divide(1, 1);
4328  cRBX1->cd(1);
4329  TH1F *GetaHE11D = new TH1F("GetaHE11D", "", 23, -11.5, 11.5);
4330  TH1F *GetaHE11D0 = new TH1F("GetaHE11D0", "", 23, -11.5, 11.5);
4331  TH1F *GetaHE11DF = (TH1F *)GetaHE11D0->Clone("GetaHE11DF");
4332 
4333  for (int jeta = 0; jeta < 22; jeta++) {
4334  for (int jphi = 0; jphi < 18; jphi++) {
4335  for (int i = 0; i < nx; i++) {
4336  double ccc1 = alexall[jeta][jphi][i];
4337  int neweta = jeta - 11 - 0.5;
4338  if (jeta >= 11)
4339  neweta = jeta - 11 + 1.5;
4340  if (ccc1 > 0.) {
4341  GetaHE11D->Fill(neweta, ccc1);
4342  GetaHE11D0->Fill(neweta, 1.);
4343  // if( i == 0 ) cout<<"62 HE: ibin= "<< i <<" jphi= "<< jphi <<" jeta= "<< jeta <<" A= "<< ccc1 <<endl;
4344  }
4345  }
4346  }
4347  }
4348  // GetaHE11D->Sumw2();GetaHE11D0->Sumw2();
4349  GetaHE11DF->Divide(GetaHE11D, GetaHE11D0, 1, 1, "B"); // average A
4350  // GetaHE11DF->Sumw2();
4351  for (int jeta = 1; jeta < 24; jeta++) {
4352  GetaHE11DF->SetBinError(jeta, 0.01);
4353  }
4354  gPad->SetGridy();
4355  gPad->SetGridx(); // gPad->SetLogz();
4356  GetaHE11DF->SetMarkerStyle(20);
4357  GetaHE11DF->SetMarkerSize(1.4);
4358  GetaHE11DF->GetZaxis()->SetLabelSize(0.08);
4359  GetaHE11DF->SetXTitle("#eta \b");
4360  GetaHE11DF->SetYTitle(" <A> \b");
4361  GetaHE11DF->SetZTitle("<A>_ETA - All \b");
4362  GetaHE11DF->SetMarkerColor(4);
4363  GetaHE11DF->SetLineColor(4);
4364  GetaHE11DF->SetMinimum(0.8); // GetaHE11DF->SetMaximum(1.000);
4365  GetaHE11DF->Draw("Error");
4366 
4368  cRBX1->Update();
4369  cRBX1->Print("RBX-HE-11Dplot.png");
4370  cRBX1->Clear();
4371  // clean-up
4372  if (GetaHE11D)
4373  delete GetaHE11D;
4374  if (GetaHE11D0)
4375  delete GetaHE11D0;
4376  if (GetaHE11DF)
4377  delete GetaHE11DF;
4378 
4379  //========================================================================================== 22 HE:: Ratio plots jeta = 0 - 21 jphi =0 - 17
4380  //======================================================================
4381  //======================================================================22.11.2018
4382  //======================================================================
4383  //======================================================================
4384 
4385  gStyle->SetOptStat(1110000);
4386  cout << " RBX HE Ratio plots *****" << endl;
4387  cRBX31->Clear();
4389  // gain stabilitY:
4390  // Rij = Aij / A1j , where i-over LSs, j-channels
4391  //
4392  // nx = maxbinsRBX; // # LS
4393  //
4394  double ccc0HE = 0.;
4395  cRBX31->Divide(3, 1);
4396  //================
4397  cRBX31->cd(1);
4398  // TH1F* Ghe5 = new TH1F("Ghe5","", nx, 1., nx+1.);
4399  TH1F *Ghe51 = new TH1F("Ghe51", "", nx, 1., nx + 1.);
4400  TH1F *Ghe50 = new TH1F("Ghe50", "", nx, 1., nx + 1.);
4401  TH1F *Ghe5 = (TH1F *)Ghe50->Clone("Ghe5");
4402  // j - etaphi index:
4403  for (int j = 1; j <= ny; j++) {
4404  ccc0HE = Ghe1->GetBinContent(1, j);
4405  // if(ccc0HE <=0.) for (int i=1;i<=nx;i++) {double ccc2 = Ghe1->GetBinContent(i,j);if(ccc2>0.){ccc0HE=ccc2;cout<<"!!! ccc0HE= "<<ccc0HE<<endl;break;} }
4406  if (ccc0HE <= 0.)
4407  for (int i = 1; i <= nx; i++) {
4408  double ccc2 = Ghe1->GetBinContent(i, j);
4409  if (ccc2 > 0.) {
4410  ccc0HE = ccc2;
4411  break;
4412  }
4413  }
4414  if (ccc0HE > 0.) {
4415  // i - # LSs:
4416  for (int i = 1; i <= nx; i++) {
4417  double ccc1 = Ghe1->GetBinContent(i, j);
4418  if (ccc1 > 0.) {
4419  double Rij = ccc1 / ccc0HE;
4420  // Ghe5 ->Fill( float(i), Rij);
4421  Ghe51->Fill(float(i), Rij);
4422  Ghe50->Fill(float(i), 1.);
4423  }
4424  }
4425  }
4426  }
4427  Ghe5->Divide(Ghe51, Ghe50, 1, 1, "B"); // average A
4428  for (int i = 1; i <= nx; i++) {
4429  Ghe5->SetBinError(i, 0.0001);
4430  }
4431  Ghe5->SetMarkerStyle(20);
4432  Ghe5->SetMarkerSize(0.4);
4433  Ghe5->GetYaxis()->SetLabelSize(0.04);
4434  Ghe5->SetMarkerColor(2);
4435  Ghe5->SetLineColor(0);
4436  Ghe5->SetXTitle(" iLS \b");
4437  Ghe5->SetYTitle(" <R> \b");
4438  Ghe5->SetTitle("<Ri> vs iLS \b");
4439  Ghe5->SetMinimum(0.); //Ghe5->SetMaximum(2.5);
4440  // gPad->SetLogy();
4441  gPad->SetGridy();
4442  gPad->SetGridx();
4443  Ghe5->SetStats(0);
4444  Ghe5->GetYaxis()->SetLabelSize(0.025);
4445  Ghe5->Draw("Error");
4446  //================
4447  cRBX31->cd(2);
4448  TH2F *Ghe60 = new TH2F("Ghe60", "", 22, -11., 11., 18, 0., 18.);
4449  TH2F *Ghe61 = new TH2F("Ghe61", "", 22, -11., 11., 18, 0., 18.);
4450  TH2F *Ghe6 = new TH2F("Ghe6", "", 22, -11., 11., 18, 0., 18.);
4451 
4452  TH2F *G20he60 = new TH2F("G20he60", "", 22, -11., 11., 18, 0., 18.);
4453  TH2F *G20he61 = new TH2F("G20he61", "", 22, -11., 11., 18, 0., 18.);
4454  TH2F *G20he6 = new TH2F("G20he6", "", 22, -11., 11., 18, 0., 18.);
4455  TH2F *G30he60 = new TH2F("G30he60", "", 22, -11., 11., 18, 0., 18.);
4456  TH2F *G30he61 = new TH2F("G30he61", "", 22, -11., 11., 18, 0., 18.);
4457  TH2F *G30he6 = new TH2F("G30he6", "", 22, -11., 11., 18, 0., 18.);
4458  TH2F *G40he60 = new TH2F("G40he60", "", 22, -11., 11., 18, 0., 18.);
4459  TH2F *G40he61 = new TH2F("G40he61", "", 22, -11., 11., 18, 0., 18.);
4460  TH2F *G40he6 = new TH2F("G40he6", "", 22, -11., 11., 18, 0., 18.);
4461  // j - etaphi index; i - # LSs;
4462  //
4463  // define mean and RMS:
4464  double sumjHE = 0.;
4465  int njHE = 0;
4466  double meanjHE = 0.;
4467  for (int j = 1; j <= ny; j++) {
4468  ccc0HE = Ghe1->GetBinContent(1, j);
4469  if (ccc0HE <= 0.)
4470  for (int i = 1; i <= nx; i++) {
4471  double ccc2 = Ghe1->GetBinContent(i, j);
4472  if (ccc2 > 0.) {
4473  ccc0HE = ccc2;
4474  break;
4475  }
4476  }
4477  if (ccc0HE > 0.) {
4478  for (int i = 1; i <= nx; i++) {
4479  double ccc1 = Ghe1->GetBinContent(i, j) / ccc0HE;
4480  if (ccc1 > 0.) {
4481  sumjHE += ccc1;
4482  njHE++;
4483  }
4484  }
4485  meanjHE = sumjHE / njHE;
4486  }
4487  } // j
4488 
4489  double ssumjHE = 0.;
4490  njHE = 0;
4491  double sigmajHE = 0.;
4492  for (int j = 1; j <= ny; j++) {
4493  ccc0HE = Ghe1->GetBinContent(1, j);
4494  if (ccc0HE <= 0.)
4495  for (int i = 1; i <= nx; i++) {
4496  double ccc2 = Ghe1->GetBinContent(i, j);
4497  if (ccc2 > 0.) {
4498  ccc0HE = ccc2;
4499  break;
4500  }
4501  }
4502  if (ccc0HE > 0.) {
4503  for (int i = 1; i <= nx; i++) {
4504  double ccc1 = Ghe1->GetBinContent(i, j) / ccc0HE;
4505  if (ccc1 > 0.) {
4506  ssumjHE += (ccc1 - meanjHE) * (ccc1 - meanjHE);
4507  njHE++;
4508  }
4509  }
4510  sigmajHE = sqrt(ssumjHE / njHE);
4511  }
4512  } // j
4513 
4514  double dif3rmsHEMIN = meanjHE - 3 * sigmajHE;
4515  if (dif3rmsHEMIN < 0.)
4516  dif3rmsHEMIN = 0.;
4517  double dif3rmsHEMAX = meanjHE + 3 * sigmajHE;
4518  cout << "22HE-2 meanjHE= " << meanjHE << " sigmajHE= " << sigmajHE << " dif3rmsHEMIN= " << dif3rmsHEMIN
4519  << " dif3rmsHEMAX= " << dif3rmsHEMAX << endl;
4520 
4521  double MAXdif3rmsHEMIN = dif3rmsHEMIN;
4522  double MINdif3rmsHEMAX = dif3rmsHEMAX;
4523  if (MAXdif3rmsHEMIN < 0.95)
4524  MAXdif3rmsHEMIN = 0.95;
4525  if (MINdif3rmsHEMAX > 1.05)
4526  MINdif3rmsHEMAX = 1.05;
4527  cout << "22HE-2 MAXdif3rmsHEMIN= " << MAXdif3rmsHEMIN << " MINdif3rmsHEMAX= " << MINdif3rmsHEMAX << endl;
4528  //
4529  for (int j = 1; j <= ny; j++) {
4530  ccc0HE = Ghe1->GetBinContent(1, j);
4531  if (ccc0HE <= 0.)
4532  for (int i = 1; i <= nx; i++) {
4533  double ccc2 = Ghe1->GetBinContent(i, j);
4534  if (ccc2 > 0.) {
4535  ccc0HE = ccc2;
4536  break;
4537  }
4538  }
4539  if (ccc0HE > 0.) {
4540  int jeta = (j - 1) / 18; // jeta = 0-21
4541  int jphi = (j - 1) - 18 * jeta; // jphi=0-17
4542  // i - # LSs:
4543  for (int i = 1; i <= nx; i++) {
4544  double ccc1 = Ghe1->GetBinContent(i, j);
4545  if (ccc1 > 0.) {
4546  double Rij = ccc1 / ccc0HE;
4547  if (Rij < MAXdif3rmsHEMIN || Rij > MINdif3rmsHEMAX) {
4548  Ghe61->Fill(jeta - 11, jphi, Rij);
4549  Ghe60->Fill(jeta - 11, jphi, 1.);
4550  }
4551  if (Rij < 0.8 || Rij > 1.2) {
4552  G20he61->Fill(jeta - 11, jphi, Rij);
4553  G20he60->Fill(jeta - 11, jphi, 1.);
4554  }
4555  if (Rij < 0.7 || Rij > 1.3) {
4556  G30he61->Fill(jeta - 11, jphi, Rij);
4557  G30he60->Fill(jeta - 11, jphi, 1.);
4558  }
4559  if (Rij < 0.6 || Rij > 1.4) {
4560  G40he61->Fill(jeta - 11, jphi, Rij);
4561  G40he60->Fill(jeta - 11, jphi, 1.);
4562  }
4563  } //if(ccc1>0.
4564  } // i
4565  } //if(ccc0HE>0
4566  } // j
4567  Ghe6->Divide(Ghe61, Ghe60, 1, 1, "B"); // average R
4568  G20he6->Divide(G20he61, G20he60, 1, 1, "B"); // average R
4569  G30he6->Divide(G30he61, G30he60, 1, 1, "B"); // average R
4570  G40he6->Divide(G40he61, G40he60, 1, 1, "B"); // average R
4571 
4572  // Ghe6->SetLabelOffset (Float_t offset=0.005, Option_t *axis="X")//Set offset between axis and axis' labels
4573  // Ghe6->GetZaxis()->SetLabelOffset(-0.05);
4574  Ghe6->GetZaxis()->SetLabelSize(0.025);
4575 
4576  Ghe6->SetXTitle(" #eta \b");
4577  Ghe6->SetYTitle(" #phi \b");
4578  Ghe6->SetTitle(
4579  "<Rj> for |1-<R>| > 0.05 \b"); // Ghe6->SetMaximum(1.000); // Ghe6->SetMinimum(1.0); //Ghe6->SetZTitle("Rij averaged over LSs \b"); //Ghe6->GetZaxis()->SetLabelSize(0.04); //Ghe6->SetMarkerStyle(20);// Ghe6->SetMarkerSize(0.4);//Ghe6->SetMarkerColor(2); //Ghe6->SetLineColor(2);
4580  //gStyle->SetOptStat(kFALSE);
4581  Ghe6->SetStats(0);
4582  Ghe6->Draw("COLZ");
4583  //================
4584  cRBX31->cd(3);
4585  TH1F *Ghe7 = new TH1F("Ghe7", "", 120, 0.4, 1.6);
4586  // j - etaphi index:
4587  for (int j = 1; j <= ny; j++) {
4588  ccc0HE = Ghe1->GetBinContent(1, j);
4589  if (ccc0HE <= 0.)
4590  for (int i = 1; i <= nx; i++) {
4591  double ccc2 = Ghe1->GetBinContent(i, j);
4592  if (ccc2 > 0.) {
4593  ccc0HE = ccc2;
4594  break;
4595  }
4596  }
4597  if (ccc0HE > 0.) {
4598  // i - # LSs:
4599  for (int i = 1; i <= nx; i++) {
4600  double ccc1 = Ghe1->GetBinContent(i, j);
4601  if (ccc1 > 0.) {
4602  double Rij = ccc1 / ccc0HE;
4603  Ghe7->Fill(Rij);
4604  }
4605  }
4606  }
4607  }
4608  Ghe7->SetMarkerStyle(20);
4609  Ghe7->SetMarkerSize(0.4);
4610  Ghe7->GetYaxis()->SetLabelSize(0.04);
4611  Ghe7->SetMarkerColor(2);
4612  Ghe7->SetLineColor(0);
4613  Ghe7->SetYTitle(" N \b");
4614  Ghe7->SetXTitle(" Rij \b");
4615  Ghe7->SetTitle(" Rij \b");
4616  //Ghe7->SetMinimum(0.8);Ghe7->SetMaximum(500.);
4617  gPad->SetGridy();
4618  gPad->SetGridx(); // gPad->SetLogy();
4619  // Ghe7->SetStats(1110000);
4620  Ghe7->GetYaxis()->SetLabelSize(0.025);
4621  Ghe7->Draw("Error");
4622  Float_t ymaxHE = Ghe7->GetMaximum();
4623  cout << "22HE-3 ymaxHE= " << ymaxHE << " MAXdif3rmsHEMIN= " << MAXdif3rmsHEMIN
4624  << " MINdif3rmsHEMAX= " << MINdif3rmsHEMAX << endl;
4625  TLine *lineHE = new TLine(MAXdif3rmsHEMIN, 0., MAXdif3rmsHEMIN, ymaxHE);
4626  lineHE->SetLineColor(kBlue);
4627  lineHE->Draw();
4628  TLine *line1HE = new TLine(MINdif3rmsHEMAX, 0., MINdif3rmsHEMAX, ymaxHE);
4629  line1HE->SetLineColor(kBlue);
4630  line1HE->Draw();
4631  //================
4633  cRBX31->Update();
4634  cRBX31->Print("RBX-HE-3plots.png");
4635  cRBX31->Clear();
4636  // clean-up
4637  if (Ghe5)
4638  delete Ghe5;
4639  if (Ghe60)
4640  delete Ghe60;
4641  if (Ghe61)
4642  delete Ghe61;
4643  if (Ghe6)
4644  delete Ghe6;
4645  if (Ghe7)
4646  delete Ghe7;
4647 
4648  if (G20he60)
4649  delete G20he60;
4650  if (G20he61)
4651  delete G20he61;
4652  if (G30he60)
4653  delete G30he60;
4654  if (G30he61)
4655  delete G30he61;
4656  if (G40he60)
4657  delete G40he60;
4658  if (G40he61)
4659  delete G40he61;
4660 
4661  if (Ghe1)
4662  delete Ghe1;
4663  //========================================================================================== 22-1 HE:: Ratio plots jeta = 0 - 21 jphi =0 - 17
4664  //======================================================================
4665  //======================================================================28.11.2018
4666  //======================================================================
4667  //======================================================================
4668 
4669  gStyle->SetOptStat(1110000);
4670  cout << " RBX HE Ratio plotsmore *****" << endl;
4671  cRBX31->Clear();
4673  cRBX31->Divide(3, 1);
4674  //================
4675  cRBX31->cd(1);
4676  G20he6->GetZaxis()->SetLabelSize(0.025);
4677  G20he6->SetXTitle(" #eta \b");
4678  G20he6->SetYTitle(" #phi \b");
4679  G20he6->SetTitle("<Rj> for |1-<R>| > 0.20 \b");
4680  G20he6->SetStats(0);
4681  G20he6->Draw("COLZ");
4682  //================
4683  cRBX31->cd(2);
4684  G30he6->GetZaxis()->SetLabelSize(0.025);
4685  G30he6->SetXTitle(" #eta \b");
4686  G30he6->SetYTitle(" #phi \b");
4687  G30he6->SetTitle("<Rj> for |1-<R>| > 0.30 \b");
4688  G30he6->SetStats(0);
4689  G30he6->Draw("COLZ");
4690  //================
4691  cRBX31->cd(3);
4692  G40he6->GetZaxis()->SetLabelSize(0.025);
4693  G40he6->SetXTitle(" #eta \b");
4694  G40he6->SetYTitle(" #phi \b");
4695  G40he6->SetTitle("<Rj> for |1-<R>| > 0.40 \b");
4696  G40he6->SetStats(0);
4697  G40he6->Draw("COLZ");
4698  //================
4699 
4701  cRBX31->Update();
4702  cRBX31->Print("RBX-HE-3plotsmore.png");
4703  cRBX31->Clear();
4704 
4705  // clean-up
4706  if (G20he6)
4707  delete G20he6;
4708  if (G30he6)
4709  delete G30he6;
4710  if (G40he6)
4711  delete G40he6;
4712  gStyle->SetOptStat(0);
4714 
4715  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
4716  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
4717  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
4718  for (int jphi = 0; jphi < njphi; jphi++) {
4719  for (int jeta = 0; jeta < njeta; jeta++) {
4720  for (int i = 0; i < nx; i++) {
4721  alexall[jeta][jphi][i] = 0.;
4722  }
4723  }
4724  } // nulling
4725 
4727 
4729  //======================================================================
4730  //======================================================================
4731  //======================================================================
4732  cout << " RBX general for HO **************************" << endl;
4733  TH2F *Gho1KKK = (TH2F *)hfile->Get("h_2DsumADCAmplEtaPhiLs2");
4734  TH2F *Gho1LLL = (TH2F *)hfile->Get("h_2DsumADCAmplEtaPhiLs20");
4735  TH2F *Gho1 = (TH2F *)Gho1LLL->Clone("Gho1");
4736  Gho1->Divide(Gho1KKK, Gho1LLL, 1, 1, "B"); // average A
4737  // Gho1->Sumw2();
4738  // int nx = Gho1->GetXaxis()->GetNbins(); // # LS
4739  // nx = maxbinsRBX; // # LS
4740  ny = Gho1->GetYaxis()->GetNbins(); // # jetaphi indexes
4741  for (int j = 1; j <= ny; j++) {
4742  int jeta = (j - 1) / njphi; // jeta = 0-21
4743  if (jeta < 15 && jeta > 6) {
4744  int jphi = (j - 1) - njphi * jeta; // jphi=0-17
4745  // cout<<"HO 54 jeta= "<< jeta <<" jphi = "<<jphi <<endl;
4746  // over LS:
4747  for (int i = 1; i <= nx; i++) {
4748  double ccc1 = Gho1->GetBinContent(i, j);
4749  alexall[jeta][jphi][i - 1] = ccc1;
4750  // if( i == 1 ) cout<<"HO 54 for LS=1 ccc1= "<< ccc1 <<endl;
4751  } //i
4752  } //if
4753  } //j
4754  // clean-up
4755  if (Gho1KKK)
4756  delete Gho1KKK;
4757  if (Gho1LLL)
4758  delete Gho1LLL;
4759  // if (Gho1) delete Gho1;
4760 
4761  //====================================================================== alexho[k][i]
4762  for (int jphi = 0; jphi < njphi; jphi++) {
4763  for (int i = 0; i < nx; i++) {
4764  double sumccc1 = 0.;
4765  int isum = 0;
4766  for (int jeta = 0; jeta < njeta; jeta++) {
4767  double ccc1 = alexall[jeta][jphi][i];
4768  if (ccc1 > 0.) {
4769  sumccc1 += ccc1;
4770  isum++;
4771  }
4772  } // for jeta
4773  if (isum > 0.)
4774  sumccc1 /= isum;
4775  alexho[jphi][i] = sumccc1;
4776  }
4777  } //for for
4778  //====================================================================== blexho[k][i]
4779  for (int keta = 0; keta < njeta; keta++) {
4780  for (int i = 0; i < nx; i++) {
4781  double sumccc1 = 0.;
4782  int isum = 0;
4783  for (int kphi = 0; kphi < njphi; kphi++) {
4784  double ccc1 = alexall[keta][kphi][i];
4785  if (ccc1 > 0.) {
4786  sumccc1 += ccc1;
4787  isum++;
4788  }
4789  } // for kphi
4790  if (isum > 0.)
4791  sumccc1 /= isum;
4792  blexho[keta][i] = sumccc1;
4793  }
4794  } //for for
4795 
4797  //========================================================================================== 33 HO:: 2D jeta = 0 - 21 jphi =0 - 17
4798  //======================================================================
4799  //======================================================================
4800  //======================================================================
4801  //======================================================================
4802  cout << " RBX HO 2D plot *****" << endl;
4803  cRBX1->Clear();
4805  cRBX1->Divide(1, 1);
4806  cRBX1->cd(1);
4807  // int ietaphi = 0; ietaphi = ((k2+1)-1)*nphi + (k3+1) ; k2=0-neta-1; k3=0-nphi-1; neta=18; nphi=22;
4808  TH2F *Gho42D = new TH2F("Gho42D", "", 23, -11.5, 11.5, 18, 0., 18.);
4809  TH2F *Gho42D0 = new TH2F("Gho42D0", "", 23, -11.5, 11.5, 18, 0., 18.);
4810  // TH2F* Gho42D = new TH2F("Gho42D","", 22, -11., 11., 18, 0., 18. );
4811  // TH2F* Gho42D0 = new TH2F("Gho42D0","", 22, -11., 11., 18, 0., 18. );
4812  TH2F *Gho42DF = (TH2F *)Gho42D0->Clone("Gho42DF");
4813  for (int jphi = 0; jphi < njphi; jphi++) {
4814  for (int jeta = 0; jeta < njeta; jeta++) {
4815  for (int i = 0; i < nx; i++) {
4816  double ccc1 = alexall[jeta][jphi][i];
4817  int neweta = jeta - 11 - 0.5;
4818  if (jeta >= 11)
4819  neweta = jeta - 11 + 1.5;
4820  if (ccc1 > 0.) {
4821  Gho42D->Fill(neweta, jphi, ccc1);
4822  Gho42D0->Fill(neweta, jphi, 1.);
4823  }
4824  // if(ccc1>0.) {Gho42D ->Fill(jeta-11,jphi,ccc1); Gho42D0 ->Fill(jeta-11,jphi,1.); }
4825  }
4826  }
4827  }
4828  Gho42DF->Divide(Gho42D, Gho42D0, 1, 1, "B"); // average A
4829  // Gho1->Sumw2();
4830  gPad->SetGridy();
4831  gPad->SetGridx(); // gPad->SetLogz();
4832  Gho42DF->SetMarkerStyle(20);
4833  Gho42DF->SetMarkerSize(0.4);
4834  Gho42DF->GetZaxis()->SetLabelSize(0.04);
4835  Gho42DF->SetXTitle("<A>_RBX #eta \b");
4836  Gho42DF->SetYTitle(" #phi \b");
4837  Gho42DF->SetZTitle("<A>_RBX - All \b");
4838  Gho42DF->SetMarkerColor(2);
4839  Gho42DF->SetLineColor(2); // Gho42DF->SetMaximum(1.000); // Gho42DF->SetMinimum(1.0);
4840  Gho42DF->Draw("COLZ");
4841 
4843  cRBX1->Update();
4844  cRBX1->Print("RBX-HO-2Dplot.png");
4845  cRBX1->Clear();
4846  // clean-up
4847  if (Gho42D)
4848  delete Gho42D;
4849  if (Gho42D0)
4850  delete Gho42D0;
4851  if (Gho42DF)
4852  delete Gho42DF;
4853 
4854  //========================================================================================== 61 HO:: 1D j = 7,8,9,10 ; 11,12,13,14 jphi =0 - 17
4855  //======================================================================
4856  //======================================================================
4857  //======================================================================
4858  //======================================================================
4859  cout << " RBX HO 1D plot *****" << endl;
4860  cRBX1->Clear();
4862  cRBX1->Divide(1, 1);
4863  cRBX1->cd(1);
4864  TH1F *GphiHO1D = new TH1F("GphiHO1D", "", 18, 0., 18.);
4865  TH1F *GphiHO1D0 = new TH1F("GphiHO1D0", "", 18, 0., 18.);
4866  TH1F *GphiHO1DF = (TH1F *)GphiHO1D0->Clone("GphiHO1DF");
4867  for (int jphi = 0; jphi < 18; jphi++) {
4868  for (int jeta = 0; jeta < 22; jeta++) {
4869  for (int i = 0; i < nx; i++) {
4870  double ccc1 = alexall[jeta][jphi][i];
4871  if (ccc1 > 0.) {
4872  GphiHO1D->Fill(jphi, ccc1);
4873  GphiHO1D0->Fill(jphi, 1.);
4874  }
4875  }
4876  }
4877  }
4878  // GphiHO1D->Sumw2();GphiHO1D0->Sumw2();
4879  GphiHO1DF->Divide(GphiHO1D, GphiHO1D0, 1, 1, "B"); // average A
4880  // GphiHO1DF->Sumw2();
4881  for (int jphi = 1; jphi < 19; jphi++) {
4882  GphiHO1DF->SetBinError(jphi, 0.01);
4883  }
4884  gPad->SetGridy();
4885  gPad->SetGridx(); // gPad->SetLogz();
4886  GphiHO1DF->SetMarkerStyle(20);
4887  GphiHO1DF->SetMarkerSize(1.4);
4888  GphiHO1DF->GetZaxis()->SetLabelSize(0.08);
4889  GphiHO1DF->SetXTitle("PHI of RBX\b");
4890  GphiHO1DF->SetYTitle(" <Amplitude> \b");
4891  GphiHO1DF->SetZTitle("<A>_PHI - All \b");
4892  GphiHO1DF->SetMarkerColor(4);
4893  GphiHO1DF->SetLineColor(4);
4894  GphiHO1DF->SetMinimum(0.8); // GphiHO1DF->SetMaximum(1.000);
4895  GphiHO1DF->Draw("Error");
4897  cRBX1->Update();
4898  cRBX1->Print("RBX-HO-1Dplot.png");
4899  cRBX1->Clear();
4900  // clean-up
4901  if (GphiHO1D)
4902  delete GphiHO1D;
4903  if (GphiHO1D0)
4904  delete GphiHO1D0;
4905  if (GphiHO1DF)
4906  delete GphiHO1DF;
4907 
4908  //========================================================================================== 62 HO:: 1D j = 7,8,9,10 ; 11,12,13,14 jphi =0 - 17
4909  //======================================================================
4910  //======================================================================
4911  //======================================================================
4912  //======================================================================
4913  cout << " RBX HO 11D plot *eta*" << endl;
4914  cRBX1->Clear();
4916  cRBX1->Divide(1, 1);
4917  cRBX1->cd(1);
4918  TH1F *GetaHO11D = new TH1F("GetaHO11D", "", 23, -11.5, 11.5);
4919  TH1F *GetaHO11D0 = new TH1F("GetaHO11D0", "", 23, -11.5, 11.5);
4920  TH1F *GetaHO11DF = (TH1F *)GetaHO11D0->Clone("GetaHO11DF");
4921 
4922  for (int jeta = 0; jeta < 22; jeta++) {
4923  for (int jphi = 0; jphi < 18; jphi++) {
4924  for (int i = 0; i < nx; i++) {
4925  double ccc1 = alexall[jeta][jphi][i];
4926  int neweta = jeta - 11 - 0.5;
4927  if (jeta >= 11)
4928  neweta = jeta - 11 + 1.5;
4929  if (ccc1 > 0.) {
4930  GetaHO11D->Fill(neweta, ccc1);
4931  GetaHO11D0->Fill(neweta, 1.);
4932  // if( i == 0 ) cout<<"62 HO: ibin= "<< i <<" jphi= "<< jphi <<" jeta= "<< jeta <<" A= "<< ccc1 <<endl;
4933  }
4934  }
4935  }
4936  }
4937  // GetaHO11D->Sumw2();GetaHO11D0->Sumw2();
4938  GetaHO11DF->Divide(GetaHO11D, GetaHO11D0, 1, 1, "B"); // average A
4939  // GetaHO11DF->Sumw2();
4940  for (int jeta = 1; jeta < 24; jeta++) {
4941  GetaHO11DF->SetBinError(jeta, 0.01);
4942  }
4943  gPad->SetGridy();
4944  gPad->SetGridx(); // gPad->SetLogz();
4945  GetaHO11DF->SetMarkerStyle(20);
4946  GetaHO11DF->SetMarkerSize(1.4);
4947  GetaHO11DF->GetZaxis()->SetLabelSize(0.08);
4948  GetaHO11DF->SetXTitle("#eta \b");
4949  GetaHO11DF->SetYTitle(" <A> \b");
4950  GetaHO11DF->SetZTitle("<A>_ETA - All \b");
4951  GetaHO11DF->SetMarkerColor(4);
4952  GetaHO11DF->SetLineColor(4);
4953  GetaHO11DF->SetMinimum(0.8); // GetaHO11DF->SetMaximum(1.000);
4954  GetaHO11DF->Draw("Error");
4955 
4957  cRBX1->Update();
4958  cRBX1->Print("RBX-HO-11Dplot.png");
4959  cRBX1->Clear();
4960  // clean-up
4961  if (GetaHO11D)
4962  delete GetaHO11D;
4963  if (GetaHO11D0)
4964  delete GetaHO11D0;
4965  if (GetaHO11DF)
4966  delete GetaHO11DF;
4967 
4968  //========================================================================================== 22 HO:: Ratio plots jeta = 0 - 21 jphi =0 - 17
4969  //======================================================================
4970  //======================================================================22.11.2018
4971  //======================================================================
4972  //======================================================================
4973 
4974  gStyle->SetOptStat(1110000);
4975  cout << " RBX HO Ratio plots *****" << endl;
4976  cRBX31->Clear();
4978  // gain stabilitY:
4979  // Rij = Aij / A1j , where i-over LSs, j-channels
4980  //
4981  // nx = maxbinsRBX; // # LS
4982  //
4983  double ccc0HO = 0.;
4984  cRBX31->Divide(3, 1);
4985  //================
4986  cRBX31->cd(1);
4987  // TH1F* Gho5 = new TH1F("Gho5","", nx, 1., nx+1.);
4988  TH1F *Gho51 = new TH1F("Gho51", "", nx, 1., nx + 1.);
4989  TH1F *Gho50 = new TH1F("Gho50", "", nx, 1., nx + 1.);
4990  TH1F *Gho5 = (TH1F *)Gho50->Clone("Gho5");
4991  // j - etaphi index:
4992  for (int j = 1; j <= ny; j++) {
4993  ccc0HO = Gho1->GetBinContent(1, j);
4994  // if(ccc0HO <=0.) for (int i=1;i<=nx;i++) {double ccc2 = Gho1->GetBinContent(i,j);if(ccc2>0.){ccc0HO=ccc2;cout<<"!!! ccc0HO= "<<ccc0HO<<endl;break;} }
4995  if (ccc0HO <= 0.)
4996  for (int i = 1; i <= nx; i++) {
4997  double ccc2 = Gho1->GetBinContent(i, j);
4998  if (ccc2 > 0.) {
4999  ccc0HO = ccc2;
5000  break;
5001  }
5002  }
5003  if (ccc0HO > 0.) {
5004  // i - # LSs:
5005  for (int i = 1; i <= nx; i++) {
5006  double ccc1 = Gho1->GetBinContent(i, j);
5007  if (ccc1 > 0.) {
5008  double Rij = ccc1 / ccc0HO;
5009  // Gho5 ->Fill( float(i), Rij);
5010  Gho51->Fill(float(i), Rij);
5011  Gho50->Fill(float(i), 1.);
5012  }
5013  }
5014  }
5015  }
5016  Gho5->Divide(Gho51, Gho50, 1, 1, "B"); // average A
5017  for (int i = 1; i <= nx; i++) {
5018  Gho5->SetBinError(i, 0.0001);
5019  }
5020  Gho5->SetMarkerStyle(20);
5021  Gho5->SetMarkerSize(0.4);
5022  Gho5->GetYaxis()->SetLabelSize(0.04);
5023  Gho5->SetMarkerColor(2);
5024  Gho5->SetLineColor(0);
5025  Gho5->SetXTitle(" iLS \b");
5026  Gho5->SetYTitle(" <R> \b");
5027  Gho5->SetTitle("<Ri> vs iLS \b");
5028  Gho5->SetMinimum(0.); //Gho5->SetMaximum(2.5);
5029  // gPad->SetLogy();
5030  gPad->SetGridy();
5031  gPad->SetGridx();
5032  Gho5->SetStats(0);
5033  Gho5->GetYaxis()->SetLabelSize(0.025);
5034  Gho5->Draw("Error");
5035  //================
5036  cRBX31->cd(2);
5037  TH2F *Gho60 = new TH2F("Gho60", "", 22, -11., 11., 18, 0., 18.);
5038  TH2F *Gho61 = new TH2F("Gho61", "", 22, -11., 11., 18, 0., 18.);
5039  TH2F *Gho6 = new TH2F("Gho6", "", 22, -11., 11., 18, 0., 18.);
5040 
5041  TH2F *G20ho60 = new TH2F("G20ho60", "", 22, -11., 11., 18, 0., 18.);
5042  TH2F *G20ho61 = new TH2F("G20ho61", "", 22, -11., 11., 18, 0., 18.);
5043  TH2F *G20ho6 = new TH2F("G20ho6", "", 22, -11., 11., 18, 0., 18.);
5044  TH2F *G30ho60 = new TH2F("G30ho60", "", 22, -11., 11., 18, 0., 18.);
5045  TH2F *G30ho61 = new TH2F("G30ho61", "", 22, -11., 11., 18, 0., 18.);
5046  TH2F *G30ho6 = new TH2F("G30ho6", "", 22, -11., 11., 18, 0., 18.);
5047  TH2F *G40ho60 = new TH2F("G40ho60", "", 22, -11., 11., 18, 0., 18.);
5048  TH2F *G40ho61 = new TH2F("G40ho61", "", 22, -11., 11., 18, 0., 18.);
5049  TH2F *G40ho6 = new TH2F("G40ho6", "", 22, -11., 11., 18, 0., 18.);
5050 
5051  // j - etaphi index; i - # LSs;
5052  //
5053  // define mean and RMS:
5054  double sumjHO = 0.;
5055  int njHO = 0;
5056  double meanjHO = 0.;
5057  for (int j = 1; j <= ny; j++) {
5058  ccc0HO = Gho1->GetBinContent(1, j);
5059  if (ccc0HO <= 0.)
5060  for (int i = 1; i <= nx; i++) {
5061  double ccc2 = Gho1->GetBinContent(i, j);
5062  if (ccc2 > 0.) {
5063  ccc0HO = ccc2;
5064  break;
5065  }
5066  }
5067  if (ccc0HO > 0.) {
5068  for (int i = 1; i <= nx; i++) {
5069  double ccc1 = Gho1->GetBinContent(i, j) / ccc0HO;
5070  if (ccc1 > 0.) {
5071  sumjHO += ccc1;
5072  njHO++;
5073  }
5074  }
5075  meanjHO = sumjHO / njHO;
5076  }
5077  } // j
5078 
5079  double ssumjHO = 0.;
5080  njHO = 0;
5081  double sigmajHO = 0.;
5082  for (int j = 1; j <= ny; j++) {
5083  ccc0HO = Gho1->GetBinContent(1, j);
5084  if (ccc0HO <= 0.)
5085  for (int i = 1; i <= nx; i++) {
5086  double ccc2 = Gho1->GetBinContent(i, j);
5087  if (ccc2 > 0.) {
5088  ccc0HO = ccc2;
5089  break;
5090  }
5091  }
5092  if (ccc0HO > 0.) {
5093  for (int i = 1; i <= nx; i++) {
5094  double ccc1 = Gho1->GetBinContent(i, j) / ccc0HO;
5095  if (ccc1 > 0.) {
5096  ssumjHO += (ccc1 - meanjHO) * (ccc1 - meanjHO);
5097  njHO++;
5098  }
5099  }
5100  sigmajHO = sqrt(ssumjHO / njHO);
5101  }
5102  } // j
5103 
5104  double dif3rmsHOMIN = meanjHO - 3 * sigmajHO;
5105  if (dif3rmsHOMIN < 0.)
5106  dif3rmsHOMIN = 0.;
5107  double dif3rmsHOMAX = meanjHO + 3 * sigmajHO;
5108  cout << "22HO-2 meanjHO= " << meanjHO << " sigmajHO= " << sigmajHO << " dif3rmsHOMIN= " << dif3rmsHOMIN
5109  << " dif3rmsHOMAX= " << dif3rmsHOMAX << endl;
5110 
5111  double MAXdif3rmsHOMIN = dif3rmsHOMIN;
5112  double MINdif3rmsHOMAX = dif3rmsHOMAX;
5113  if (MAXdif3rmsHOMIN < 0.95)
5114  MAXdif3rmsHOMIN = 0.95;
5115  if (MINdif3rmsHOMAX > 1.05)
5116  MINdif3rmsHOMAX = 1.05;
5117  cout << "22HO-2 MAXdif3rmsHOMIN= " << MAXdif3rmsHOMIN << " MINdif3rmsHOMAX= " << MINdif3rmsHOMAX << endl;
5118  //
5119  for (int j = 1; j <= ny; j++) {
5120  ccc0HO = Gho1->GetBinContent(1, j);
5121  if (ccc0HO <= 0.)
5122  for (int i = 1; i <= nx; i++) {
5123  double ccc2 = Gho1->GetBinContent(i, j);
5124  if (ccc2 > 0.) {
5125  ccc0HO = ccc2;
5126  break;
5127  }
5128  }
5129  if (ccc0HO > 0.) {
5130  int jeta = (j - 1) / 18; // jeta = 0-21
5131  int jphi = (j - 1) - 18 * jeta; // jphi=0-17
5132  // i - # LSs:
5133  for (int i = 1; i <= nx; i++) {
5134  double ccc1 = Gho1->GetBinContent(i, j);
5135  if (ccc1 > 0.) {
5136  double Rij = ccc1 / ccc0HO;
5137  if (Rij < MAXdif3rmsHOMIN || Rij > MINdif3rmsHOMAX) {
5138  Gho61->Fill(jeta - 11, jphi, Rij);
5139  Gho60->Fill(jeta - 11, jphi, 1.);
5140  }
5141  if (Rij < 0.8 || Rij > 1.2) {
5142  G20ho61->Fill(jeta - 11, jphi, Rij);
5143  G20ho60->Fill(jeta - 11, jphi, 1.);
5144  }
5145  if (Rij < 0.7 || Rij > 1.3) {
5146  G30ho61->Fill(jeta - 11, jphi, Rij);
5147  G30ho60->Fill(jeta - 11, jphi, 1.);
5148  }
5149  if (Rij < 0.6 || Rij > 1.4) {
5150  G40ho61->Fill(jeta - 11, jphi, Rij);
5151  G40ho60->Fill(jeta - 11, jphi, 1.);
5152  }
5153  } //if(ccc1>0.
5154  } // i
5155  } //if(ccc0HO>0
5156  } // j
5157  Gho6->Divide(Gho61, Gho60, 1, 1, "B"); // average R
5158  G20ho6->Divide(G20ho61, G20ho60, 1, 1, "B"); // average R
5159  G30ho6->Divide(G30ho61, G30ho60, 1, 1, "B"); // average R
5160  G40ho6->Divide(G40ho61, G40ho60, 1, 1, "B"); // average R
5161  // Gho6->SetLabelOffset (Float_t offset=0.005, Option_t *axis="X")//Set offset between axis and axis' labels
5162  // Gho6->GetZaxis()->SetLabelOffset(-0.05);
5163  Gho6->GetZaxis()->SetLabelSize(0.025);
5164 
5165  Gho6->SetXTitle(" #eta \b");
5166  Gho6->SetYTitle(" #phi \b");
5167  Gho6->SetTitle(
5168  "<Rj> for |1-<R>| > 0.05 \b"); // Gho6->SetMaximum(1.000); // Gho6->SetMinimum(1.0); //Gho6->SetZTitle("Rij averaged over LSs \b"); //Gho6->GetZaxis()->SetLabelSize(0.04); //Gho6->SetMarkerStyle(20);// Gho6->SetMarkerSize(0.4);//Gho6->SetMarkerColor(2); //Gho6->SetLineColor(2);
5169  //gStyle->SetOptStat(kFALSE);
5170  Gho6->SetStats(0);
5171  Gho6->Draw("COLZ");
5172  //================
5173  cRBX31->cd(3);
5174  TH1F *Gho7 = new TH1F("Gho7", "", 120, 0.4, 1.6);
5175  // j - etaphi index:
5176  for (int j = 1; j <= ny; j++) {
5177  ccc0HO = Gho1->GetBinContent(1, j);
5178  if (ccc0HO <= 0.)
5179  for (int i = 1; i <= nx; i++) {
5180  double ccc2 = Gho1->GetBinContent(i, j);
5181  if (ccc2 > 0.) {
5182  ccc0HO = ccc2;
5183  break;
5184  }
5185  }
5186  if (ccc0HO > 0.) {
5187  // i - # LSs:
5188  for (int i = 1; i <= nx; i++) {
5189  double ccc1 = Gho1->GetBinContent(i, j);
5190  if (ccc1 > 0.) {
5191  double Rij = ccc1 / ccc0HO;
5192  Gho7->Fill(Rij);
5193  }
5194  }
5195  }
5196  }
5197  Gho7->SetMarkerStyle(20);
5198  Gho7->SetMarkerSize(0.4);
5199  Gho7->GetYaxis()->SetLabelSize(0.04);
5200  Gho7->SetMarkerColor(2);
5201  Gho7->SetLineColor(0);
5202  Gho7->SetYTitle(" N \b");
5203  Gho7->SetXTitle(" Rij \b");
5204  Gho7->SetTitle(" Rij \b");
5205  //Gho7->SetMinimum(0.8);Gho7->SetMaximum(500.);
5206  gPad->SetGridy();
5207  gPad->SetGridx(); // gPad->SetLogy();
5208  // Gho7->SetStats(1110000);
5209  Gho7->GetYaxis()->SetLabelSize(0.025);
5210  Gho7->Draw("Error");
5211  Float_t ymaxHO = Gho7->GetMaximum();
5212  cout << "22HO-3 ymaxHO= " << ymaxHO << " MAXdif3rmsHOMIN= " << MAXdif3rmsHOMIN
5213  << " MINdif3rmsHOMAX= " << MINdif3rmsHOMAX << endl;
5214  TLine *lineHO = new TLine(MAXdif3rmsHOMIN, 0., MAXdif3rmsHOMIN, ymaxHO);
5215  lineHO->SetLineColor(kBlue);
5216  lineHO->Draw();
5217  TLine *line1HO = new TLine(MINdif3rmsHOMAX, 0., MINdif3rmsHOMAX, ymaxHO);
5218  line1HO->SetLineColor(kBlue);
5219  line1HO->Draw();
5220  //================
5222  cRBX31->Update();
5223  cRBX31->Print("RBX-HO-3plots.png");
5224  cRBX31->Clear();
5225  // clean-up
5226  if (Gho5)
5227  delete Gho5;
5228  if (Gho60)
5229  delete Gho60;
5230  if (Gho61)
5231  delete Gho61;
5232  if (Gho6)
5233  delete Gho6;
5234  if (Gho7)
5235  delete Gho7;
5236 
5237  if (G20ho60)
5238  delete G20ho60;
5239  if (G20ho61)
5240  delete G20ho61;
5241  if (G30ho60)
5242  delete G30ho60;
5243  if (G30ho61)
5244  delete G30ho61;
5245  if (G40ho60)
5246  delete G40ho60;
5247  if (G40ho61)
5248  delete G40ho61;
5249 
5250  if (Gho1)
5251  delete Gho1;
5252  //========================================================================================== 22-1 HO:: Ratio plots jeta = 0 - 21 jphi =0 - 17
5253  //======================================================================
5254  //======================================================================28.11.2018
5255  //======================================================================
5256  //======================================================================
5257 
5258  gStyle->SetOptStat(1110000);
5259  cout << " RBX HO Ratio plotsmore *****" << endl;
5260  cRBX31->Clear();
5262  cRBX31->Divide(3, 1);
5263  //================
5264  cRBX31->cd(1);
5265  G20ho6->GetZaxis()->SetLabelSize(0.025);
5266  G20ho6->SetXTitle(" #eta \b");
5267  G20ho6->SetYTitle(" #phi \b");
5268  G20ho6->SetTitle("<Rj> for |1-<R>| > 0.20 \b");
5269  G20ho6->SetStats(0);
5270  G20ho6->Draw("COLZ");
5271  //================
5272  cRBX31->cd(2);
5273  G30ho6->GetZaxis()->SetLabelSize(0.025);
5274  G30ho6->SetXTitle(" #eta \b");
5275  G30ho6->SetYTitle(" #phi \b");
5276  G30ho6->SetTitle("<Rj> for |1-<R>| > 0.30 \b");
5277  G30ho6->SetStats(0);
5278  G30ho6->Draw("COLZ");
5279  //================
5280  cRBX31->cd(3);
5281  G40ho6->GetZaxis()->SetLabelSize(0.025);
5282  G40ho6->SetXTitle(" #eta \b");
5283  G40ho6->SetYTitle(" #phi \b");
5284  G40ho6->SetTitle("<Rj> for |1-<R>| > 0.40 \b");
5285  G40ho6->SetStats(0);
5286  G40ho6->Draw("COLZ");
5287  //================
5288 
5290  cRBX31->Update();
5291  cRBX31->Print("RBX-HO-3plotsmore.png");
5292  cRBX31->Clear();
5293 
5294  // clean-up
5295  if (G20ho6)
5296  delete G20ho6;
5297  if (G30ho6)
5298  delete G30ho6;
5299  if (G40ho6)
5300  delete G40ho6;
5301  gStyle->SetOptStat(0);
5303 
5304  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
5305  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
5306  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
5307  for (int jphi = 0; jphi < njphi; jphi++) {
5308  for (int jeta = 0; jeta < njeta; jeta++) {
5309  for (int i = 0; i < nx; i++) {
5310  alexall[jeta][jphi][i] = 0.;
5311  }
5312  }
5313  } // nulling
5314 
5316 
5318  //======================================================================
5319  //======================================================================
5320  //======================================================================
5321  cout << " RBX general for HF **************************" << endl;
5322  TH2F *Ghf1KKK = (TH2F *)hfile->Get("h_2DsumADCAmplEtaPhiLs3");
5323  TH2F *Ghf1LLL = (TH2F *)hfile->Get("h_2DsumADCAmplEtaPhiLs30");
5324  TH2F *Ghf1 = (TH2F *)Ghf1LLL->Clone("Ghf1");
5325  Ghf1->Divide(Ghf1KKK, Ghf1LLL, 1, 1, "B"); // average A
5326  // Ghf1->Sumw2();
5327  // int nx = Ghf1->GetXaxis()->GetNbins(); // # LS
5328  // nx = maxbinsRBX; // # LS
5329  ny = Ghf1->GetYaxis()->GetNbins(); // # jetaphi indexes
5330  for (int j = 1; j <= ny; j++) {
5331  int jeta = (j - 1) / njphi; // jeta = 0-21
5332  if (jeta < 4 || jeta > 17) {
5333  int jphi = (j - 1) - njphi * jeta; // jphi=0-17
5334  // cout<<"HF 54 jeta= "<< jeta <<" jphi = "<<jphi <<endl;
5335  // over LS:
5336  for (int i = 1; i <= nx; i++) {
5337  double ccc1 = Ghf1->GetBinContent(i, j);
5338  alexall[jeta][jphi][i - 1] = ccc1;
5339  // if( i == 1 ) cout<<"HF 54 for LS=1 ccc1= "<< ccc1 <<endl;
5340  } //i
5341  } //if
5342  } //j
5343  // clean-up
5344  if (Ghf1KKK)
5345  delete Ghf1KKK;
5346  if (Ghf1LLL)
5347  delete Ghf1LLL;
5348  // if (Ghf1) delete Ghf1;
5349 
5350  //====================================================================== alexhf[k][i]
5351  for (int jphi = 0; jphi < njphi; jphi++) {
5352  for (int i = 0; i < nx; i++) {
5353  double sumccc1 = 0.;
5354  int isum = 0;
5355  for (int jeta = 0; jeta < njeta; jeta++) {
5356  double ccc1 = alexall[jeta][jphi][i];
5357  if (ccc1 > 0.) {
5358  sumccc1 += ccc1;
5359  isum++;
5360  }
5361  } // for jeta
5362  if (isum > 0.)
5363  sumccc1 /= isum;
5364  alexhf[jphi][i] = sumccc1;
5365  }
5366  } //for for
5367  //====================================================================== blexhf[k][i]
5368  for (int keta = 0; keta < njeta; keta++) {
5369  for (int i = 0; i < nx; i++) {
5370  double sumccc1 = 0.;
5371  int isum = 0;
5372  for (int kphi = 0; kphi < njphi; kphi++) {
5373  double ccc1 = alexall[keta][kphi][i];
5374  if (ccc1 > 0.) {
5375  sumccc1 += ccc1;
5376  isum++;
5377  }
5378  } // for kphi
5379  if (isum > 0.)
5380  sumccc1 /= isum;
5381  blexhf[keta][i] = sumccc1;
5382  }
5383  } //for for
5385  //========================================================================================== 60 HF:: 2D jeta = 0 - 21 jphi =0 - 17
5386  //======================================================================
5387  //======================================================================
5388  //======================================================================
5389  //======================================================================
5390  cout << " RBX HF 2D plot *****" << endl;
5391  cRBX1->Clear();
5393  cRBX1->Divide(1, 1);
5394  cRBX1->cd(1);
5395  // int ietaphi = 0; ietaphi = ((k2+1)-1)*nphi + (k3+1) ; k2=0-neta-1; k3=0-nphi-1; neta=18; nphi=22;
5396  TH2F *Ghf42D = new TH2F("Ghf42D", "", 23, -11.5, 11.5, 18, 0., 18.);
5397  TH2F *Ghf42D0 = new TH2F("Ghf42D0", "", 23, -11.5, 11.5, 18, 0., 18.);
5398  // TH2F* Ghf42D = new TH2F("Ghf42D","", 22, -11., 11., 18, 0., 18. );
5399  // TH2F* Ghf42D0 = new TH2F("Ghf42D0","", 22, -11., 11., 18, 0., 18. );
5400  TH2F *Ghf42DF = (TH2F *)Ghf42D0->Clone("Ghf42DF");
5401  for (int jphi = 0; jphi < njphi; jphi++) {
5402  for (int jeta = 0; jeta < njeta; jeta++) {
5403  for (int i = 0; i < nx; i++) {
5404  double ccc1 = alexall[jeta][jphi][i];
5405  int neweta = jeta - 11 - 0.5;
5406  if (jeta >= 11)
5407  neweta = jeta - 11 + 1.5;
5408  if (ccc1 > 0.) {
5409  Ghf42D->Fill(neweta, jphi, ccc1);
5410  Ghf42D0->Fill(neweta, jphi, 1.);
5411  }
5412  // if(ccc1>0.) {Ghf42D ->Fill(jeta-11,jphi,ccc1); Ghf42D0 ->Fill(jeta-11,jphi,1.); }
5413  }
5414  }
5415  }
5416  Ghf42DF->Divide(Ghf42D, Ghf42D0, 1, 1, "B"); // average A
5417  // Ghf1->Sumw2();
5418  gPad->SetGridy();
5419  gPad->SetGridx(); // gPad->SetLogz();
5420  Ghf42DF->SetMarkerStyle(20);
5421  Ghf42DF->SetMarkerSize(0.4);
5422  Ghf42DF->GetZaxis()->SetLabelSize(0.04);
5423  Ghf42DF->SetXTitle("<A>_RBX #eta \b");
5424  Ghf42DF->SetYTitle(" #phi \b");
5425  Ghf42DF->SetZTitle("<A>_RBX - All \b");
5426  Ghf42DF->SetMarkerColor(2);
5427  Ghf42DF->SetLineColor(2); // Ghf42DF->SetMaximum(1.000); // Ghf42DF->SetMinimum(1.0);
5428  Ghf42DF->Draw("COLZ");
5429 
5431  cRBX1->Update();
5432  cRBX1->Print("RBX-HF-2Dplot.png");
5433  cRBX1->Clear();
5434  // clean-up
5435  if (Ghf42D)
5436  delete Ghf42D;
5437  if (Ghf42D0)
5438  delete Ghf42D0;
5439  if (Ghf42DF)
5440  delete Ghf42DF;
5441 
5442  //========================================================================================== 61 HF:: 1D j = 7,8,9,10 ; 11,12,13,14 jphi =0 - 17
5443  //======================================================================
5444  //======================================================================
5445  //======================================================================
5446  //======================================================================
5447  cout << " RBX HF 1D plot *****" << endl;
5448  cRBX1->Clear();
5450  cRBX1->Divide(1, 1);
5451  cRBX1->cd(1);
5452  TH1F *GphiHF1D = new TH1F("GphiHF1D", "", 18, 0., 18.);
5453  TH1F *GphiHF1D0 = new TH1F("GphiHF1D0", "", 18, 0., 18.);
5454  TH1F *GphiHF1DF = (TH1F *)GphiHF1D0->Clone("GphiHF1DF");
5455  for (int jphi = 0; jphi < 18; jphi++) {
5456  for (int jeta = 0; jeta < 22; jeta++) {
5457  for (int i = 0; i < nx; i++) {
5458  double ccc1 = alexall[jeta][jphi][i];
5459  if (ccc1 > 0.) {
5460  GphiHF1D->Fill(jphi, ccc1);
5461  GphiHF1D0->Fill(jphi, 1.);
5462  }
5463  }
5464  }
5465  }
5466  // GphiHF1D->Sumw2();GphiHF1D0->Sumw2();
5467  GphiHF1DF->Divide(GphiHF1D, GphiHF1D0, 1, 1, "B"); // average A
5468  // GphiHF1DF->Sumw2();
5469  for (int jphi = 1; jphi < 19; jphi++) {
5470  GphiHF1DF->SetBinError(jphi, 0.01);
5471  }
5472  gPad->SetGridy();
5473  gPad->SetGridx(); // gPad->SetLogz();
5474  GphiHF1DF->SetMarkerStyle(20);
5475  GphiHF1DF->SetMarkerSize(1.4);
5476  GphiHF1DF->GetZaxis()->SetLabelSize(0.08);
5477  GphiHF1DF->SetXTitle("PHI of RBX\b");
5478  GphiHF1DF->SetYTitle(" <Amplitude> \b");
5479  GphiHF1DF->SetZTitle("<A>_PHI - All \b");
5480  GphiHF1DF->SetMarkerColor(4);
5481  GphiHF1DF->SetLineColor(4);
5482  GphiHF1DF->SetMinimum(0.8); // GphiHF1DF->SetMaximum(1.000);
5483  GphiHF1DF->Draw("Error");
5485  cRBX1->Update();
5486  cRBX1->Print("RBX-HF-1Dplot.png");
5487  cRBX1->Clear();
5488  // clean-up
5489  if (GphiHF1D)
5490  delete GphiHF1D;
5491  if (GphiHF1D0)
5492  delete GphiHF1D0;
5493  if (GphiHF1DF)
5494  delete GphiHF1DF;
5495 
5496  //========================================================================================== 62 HF:: 1D j = 7,8,9,10 ; 11,12,13,14 jphi =0 - 17
5497  //======================================================================
5498  //======================================================================
5499  //======================================================================
5500  //======================================================================
5501  cout << " RBX HF 11D plot *eta*" << endl;
5502  cRBX1->Clear();
5504  cRBX1->Divide(1, 1);
5505  cRBX1->cd(1);
5506  TH1F *GetaHF11D = new TH1F("GetaHF11D", "", 23, -11.5, 11.5);
5507  TH1F *GetaHF11D0 = new TH1F("GetaHF11D0", "", 23, -11.5, 11.5);
5508  TH1F *GetaHF11DF = (TH1F *)GetaHF11D0->Clone("GetaHF11DF");
5509 
5510  for (int jeta = 0; jeta < 22; jeta++) {
5511  for (int jphi = 0; jphi < 18; jphi++) {
5512  for (int i = 0; i < nx; i++) {
5513  double ccc1 = alexall[jeta][jphi][i];
5514  int neweta = jeta - 11 - 0.5;
5515  if (jeta >= 11)
5516  neweta = jeta - 11 + 1.5;
5517  if (ccc1 > 0.) {
5518  GetaHF11D->Fill(neweta, ccc1);
5519  GetaHF11D0->Fill(neweta, 1.);
5520  // if( i == 0 ) cout<<"62 HF: ibin= "<< i <<" jphi= "<< jphi <<" jeta= "<< jeta <<" A= "<< ccc1 <<endl;
5521  }
5522  }
5523  }
5524  }
5525  // GetaHF11D->Sumw2();GetaHF11D0->Sumw2();
5526  GetaHF11DF->Divide(GetaHF11D, GetaHF11D0, 1, 1, "B"); // average A
5527  // GetaHF11DF->Sumw2();
5528  for (int jeta = 1; jeta < 24; jeta++) {
5529  GetaHF11DF->SetBinError(jeta, 0.01);
5530  }
5531  gPad->SetGridy();
5532  gPad->SetGridx(); // gPad->SetLogz();
5533  GetaHF11DF->SetMarkerStyle(20);
5534  GetaHF11DF->SetMarkerSize(1.4);
5535  GetaHF11DF->GetZaxis()->SetLabelSize(0.08);
5536  GetaHF11DF->SetXTitle("#eta \b");
5537  GetaHF11DF->SetYTitle(" <A> \b");
5538  GetaHF11DF->SetZTitle("<A>_ETA - All \b");
5539  GetaHF11DF->SetMarkerColor(4);
5540  GetaHF11DF->SetLineColor(4);
5541  GetaHF11DF->SetMinimum(0.8); // GetaHF11DF->SetMaximum(1.000);
5542  GetaHF11DF->Draw("Error");
5543 
5545  cRBX1->Update();
5546  cRBX1->Print("RBX-HF-11Dplot.png");
5547  cRBX1->Clear();
5548  // clean-up
5549  if (GetaHF11D)
5550  delete GetaHF11D;
5551  if (GetaHF11D0)
5552  delete GetaHF11D0;
5553  if (GetaHF11DF)
5554  delete GetaHF11DF;
5555 
5556  //========================================================================================== 22 HF:: Ratio plots jeta = 0 - 21 jphi =0 - 17
5557  //======================================================================
5558  //======================================================================22.11.2018
5559  //======================================================================
5560  //======================================================================
5561 
5562  gStyle->SetOptStat(1110000);
5563  cout << " RBX HF Ratio plots *****" << endl;
5564  cRBX31->Clear();
5566  // gain stabilitY:
5567  // Rij = Aij / A1j , where i-over LSs, j-channels
5568  //
5569  // nx = maxbinsRBX; // # LS
5570  //
5571  double ccc0HF = 0.;
5572  cRBX31->Divide(3, 1);
5573  //================
5574  cRBX31->cd(1);
5575  // TH1F* Ghf5 = new TH1F("Ghf5","", nx, 1., nx+1.);
5576  TH1F *Ghf51 = new TH1F("Ghf51", "", nx, 1., nx + 1.);
5577  TH1F *Ghf50 = new TH1F("Ghf50", "", nx, 1., nx + 1.);
5578  TH1F *Ghf5 = (TH1F *)Ghf50->Clone("Ghf5");
5579  // j - etaphi index:
5580  for (int j = 1; j <= ny; j++) {
5581  ccc0HF = Ghf1->GetBinContent(1, j);
5582  // if(ccc0HF <=0.) for (int i=1;i<=nx;i++) {double ccc2 = Ghf1->GetBinContent(i,j);if(ccc2>0.){ccc0HF=ccc2;cout<<"!!! ccc0HF= "<<ccc0HF<<endl;break;} }
5583  if (ccc0HF <= 0.)
5584  for (int i = 1; i <= nx; i++) {
5585  double ccc2 = Ghf1->GetBinContent(i, j);
5586  if (ccc2 > 0.) {
5587  ccc0HF = ccc2;
5588  break;
5589  }
5590  }
5591  if (ccc0HF > 0.) {
5592  // i - # LSs:
5593  for (int i = 1; i <= nx; i++) {
5594  double ccc1 = Ghf1->GetBinContent(i, j);
5595  if (ccc1 > 0.) {
5596  double Rij = ccc1 / ccc0HF;
5597  // Ghf5 ->Fill( float(i), Rij);
5598  Ghf51->Fill(float(i), Rij);
5599  Ghf50->Fill(float(i), 1.);
5600  }
5601  }
5602  }
5603  }
5604  Ghf5->Divide(Ghf51, Ghf50, 1, 1, "B"); // average A
5605  for (int i = 1; i <= nx; i++) {
5606  Ghf5->SetBinError(i, 0.0001);
5607  }
5608  Ghf5->SetMarkerStyle(20);
5609  Ghf5->SetMarkerSize(0.4);
5610  Ghf5->GetYaxis()->SetLabelSize(0.04);
5611  Ghf5->SetMarkerColor(2);
5612  Ghf5->SetLineColor(0);
5613  Ghf5->SetXTitle(" iLS \b");
5614  Ghf5->SetYTitle(" <R> \b");
5615  Ghf5->SetTitle("<Ri> vs iLS \b");
5616  Ghf5->SetMinimum(0.); //Ghf5->SetMaximum(2.5);
5617  // gPad->SetLogy();
5618  gPad->SetGridy();
5619  gPad->SetGridx();
5620  Ghf5->SetStats(0);
5621  Ghf5->GetYaxis()->SetLabelSize(0.025);
5622  Ghf5->Draw("Error");
5623  //================
5624  cRBX31->cd(2);
5625  TH2F *Ghf60 = new TH2F("Ghf60", "", 22, -11., 11., 18, 0., 18.);
5626  TH2F *Ghf61 = new TH2F("Ghf61", "", 22, -11., 11., 18, 0., 18.);
5627  TH2F *Ghf6 = new TH2F("Ghf6", "", 22, -11., 11., 18, 0., 18.);
5628 
5629  TH2F *G20hf60 = new TH2F("G20hf60", "", 22, -11., 11., 18, 0., 18.);
5630  TH2F *G20hf61 = new TH2F("G20hf61", "", 22, -11., 11., 18, 0., 18.);
5631  TH2F *G20hf6 = new TH2F("G20hf6", "", 22, -11., 11., 18, 0., 18.);
5632  TH2F *G30hf60 = new TH2F("G30hf60", "", 22, -11., 11., 18, 0., 18.);
5633  TH2F *G30hf61 = new TH2F("G30hf61", "", 22, -11., 11., 18, 0., 18.);
5634  TH2F *G30hf6 = new TH2F("G30hf6", "", 22, -11., 11., 18, 0., 18.);
5635  TH2F *G40hf60 = new TH2F("G40hf60", "", 22, -11., 11., 18, 0., 18.);
5636  TH2F *G40hf61 = new TH2F("G40hf61", "", 22, -11., 11., 18, 0., 18.);
5637  TH2F *G40hf6 = new TH2F("G40hf6", "", 22, -11., 11., 18, 0., 18.);
5638  // j - etaphi index; i - # LSs;
5639  //
5640  // define mean and RMS:
5641  double sumjHF = 0.;
5642  int njHF = 0;
5643  double meanjHF = 0.;
5644  for (int j = 1; j <= ny; j++) {
5645  ccc0HF = Ghf1->GetBinContent(1, j);
5646  if (ccc0HF <= 0.)
5647  for (int i = 1; i <= nx; i++) {
5648  double ccc2 = Ghf1->GetBinContent(i, j);
5649  if (ccc2 > 0.) {
5650  ccc0HF = ccc2;
5651  break;
5652  }
5653  }
5654  if (ccc0HF > 0.) {
5655  for (int i = 1; i <= nx; i++) {
5656  double ccc1 = Ghf1->GetBinContent(i, j) / ccc0HF;
5657  if (ccc1 > 0.) {
5658  sumjHF += ccc1;
5659  njHF++;
5660  }
5661  }
5662  meanjHF = sumjHF / njHF;
5663  }
5664  } // j
5665 
5666  double ssumjHF = 0.;
5667  njHF = 0;
5668  double sigmajHF = 0.;
5669  for (int j = 1; j <= ny; j++) {
5670  ccc0HF = Ghf1->GetBinContent(1, j);
5671  if (ccc0HF <= 0.)
5672  for (int i = 1; i <= nx; i++) {
5673  double ccc2 = Ghf1->GetBinContent(i, j);
5674  if (ccc2 > 0.) {
5675  ccc0HF = ccc2;
5676  break;
5677  }
5678  }
5679  if (ccc0HF > 0.) {
5680  for (int i = 1; i <= nx; i++) {
5681  double ccc1 = Ghf1->GetBinContent(i, j) / ccc0HF;
5682  if (ccc1 > 0.) {
5683  ssumjHF += (ccc1 - meanjHF) * (ccc1 - meanjHF);
5684  njHF++;
5685  }
5686  }
5687  sigmajHF = sqrt(ssumjHF / njHF);
5688  }
5689  } // j
5690 
5691  double dif3rmsHFMIN = meanjHF - 3 * sigmajHF;
5692  if (dif3rmsHFMIN < 0.)
5693  dif3rmsHFMIN = 0.;
5694  double dif3rmsHFMAX = meanjHF + 3 * sigmajHF;
5695  cout << "22HF-2 meanjHF= " << meanjHF << " sigmajHF= " << sigmajHF << " dif3rmsHFMIN= " << dif3rmsHFMIN
5696  << " dif3rmsHFMAX= " << dif3rmsHFMAX << endl;
5697 
5698  double MAXdif3rmsHFMIN = dif3rmsHFMIN;
5699  double MINdif3rmsHFMAX = dif3rmsHFMAX;
5700  if (MAXdif3rmsHFMIN < 0.95)
5701  MAXdif3rmsHFMIN = 0.95;
5702  if (MINdif3rmsHFMAX > 1.05)
5703  MINdif3rmsHFMAX = 1.05;
5704  cout << "22HF-2 MAXdif3rmsHFMIN= " << MAXdif3rmsHFMIN << " MINdif3rmsHFMAX= " << MINdif3rmsHFMAX << endl;
5705  //
5706  for (int j = 1; j <= ny; j++) {
5707  ccc0HF = Ghf1->GetBinContent(1, j);
5708  if (ccc0HF <= 0.)
5709  for (int i = 1; i <= nx; i++) {
5710  double ccc2 = Ghf1->GetBinContent(i, j);
5711  if (ccc2 > 0.) {
5712  ccc0HF = ccc2;
5713  break;
5714  }
5715  }
5716  if (ccc0HF > 0.) {
5717  int jeta = (j - 1) / 18; // jeta = 0-21
5718  int jphi = (j - 1) - 18 * jeta; // jphi=0-17
5719  // i - # LSs:
5720  for (int i = 1; i <= nx; i++) {
5721  double ccc1 = Ghf1->GetBinContent(i, j);
5722  if (ccc1 > 0.) {
5723  double Rij = ccc1 / ccc0HF;
5724  if (Rij < MAXdif3rmsHFMIN || Rij > MINdif3rmsHFMAX) {
5725  Ghf61->Fill(jeta - 11, jphi, Rij);
5726  Ghf60->Fill(jeta - 11, jphi, 1.);
5727  }
5728  if (Rij < 0.8 || Rij > 1.2) {
5729  G20hf61->Fill(jeta - 11, jphi, Rij);
5730  G20hf60->Fill(jeta - 11, jphi, 1.);
5731  }
5732  if (Rij < 0.7 || Rij > 1.3) {
5733  G30hf61->Fill(jeta - 11, jphi, Rij);
5734  G30hf60->Fill(jeta - 11, jphi, 1.);
5735  }
5736  if (Rij < 0.6 || Rij > 1.4) {
5737  G40hf61->Fill(jeta - 11, jphi, Rij);
5738  G40hf60->Fill(jeta - 11, jphi, 1.);
5739  }
5740  } //if(ccc1>0.
5741  } // i
5742  } //if(ccc0HF>0
5743  } // j
5744  Ghf6->Divide(Ghf61, Ghf60, 1, 1, "B"); // average R
5745  G20hf6->Divide(G20hf61, G20hf60, 1, 1, "B"); // average R
5746  G30hf6->Divide(G30hf61, G30hf60, 1, 1, "B"); // average R
5747  G40hf6->Divide(G40hf61, G40hf60, 1, 1, "B"); // average R
5748  // Ghf6->SetLabelOffset (Float_t offset=0.005, Option_t *axis="X")//Set offset between axis and axis' labels
5749  // Ghf6->GetZaxis()->SetLabelOffset(-0.05);
5750  Ghf6->GetZaxis()->SetLabelSize(0.025);
5751 
5752  Ghf6->SetXTitle(" #eta \b");
5753  Ghf6->SetYTitle(" #phi \b");
5754  Ghf6->SetTitle(
5755  "<Rj> for |1-<R>| > 0.05 \b"); // Ghf6->SetMaximum(1.000); // Ghf6->SetMinimum(1.0); //Ghf6->SetZTitle("Rij averaged over LSs \b"); //Ghf6->GetZaxis()->SetLabelSize(0.04); //Ghf6->SetMarkerStyle(20);// Ghf6->SetMarkerSize(0.4);//Ghf6->SetMarkerColor(2); //Ghf6->SetLineColor(2);
5756  //gStyle->SetOptStat(kFALSE);
5757  Ghf6->SetStats(0);
5758  Ghf6->Draw("COLZ");
5759  //================
5760  cRBX31->cd(3);
5761  TH1F *Ghf7 = new TH1F("Ghf7", "", 120, 0.4, 1.6);
5762  // j - etaphi index:
5763  for (int j = 1; j <= ny; j++) {
5764  ccc0HF = Ghf1->GetBinContent(1, j);
5765  if (ccc0HF <= 0.)
5766  for (int i = 1; i <= nx; i++) {
5767  double ccc2 = Ghf1->GetBinContent(i, j);
5768  if (ccc2 > 0.) {
5769  ccc0HF = ccc2;
5770  break;
5771  }
5772  }
5773  if (ccc0HF > 0.) {
5774  // i - # LSs:
5775  for (int i = 1; i <= nx; i++) {
5776  double ccc1 = Ghf1->GetBinContent(i, j);
5777  if (ccc1 > 0.) {
5778  double Rij = ccc1 / ccc0HF;
5779  Ghf7->Fill(Rij);
5780  }
5781  }
5782  }
5783  }
5784  Ghf7->SetMarkerStyle(20);
5785  Ghf7->SetMarkerSize(0.4);
5786  Ghf7->GetYaxis()->SetLabelSize(0.04);
5787  Ghf7->SetMarkerColor(2);
5788  Ghf7->SetLineColor(0);
5789  Ghf7->SetYTitle(" N \b");
5790  Ghf7->SetXTitle(" Rij \b");
5791  Ghf7->SetTitle(" Rij \b");
5792  //Ghf7->SetMinimum(0.8);Ghf7->SetMaximum(500.);
5793  gPad->SetGridy();
5794  gPad->SetGridx(); // gPad->SetLogy();
5795  // Ghf7->SetStats(1110000);
5796  Ghf7->GetYaxis()->SetLabelSize(0.025);
5797  Ghf7->Draw("Error");
5798  Float_t ymaxHF = Ghf7->GetMaximum();
5799  cout << "22HF-3 ymaxHF= " << ymaxHF << " MAXdif3rmsHFMIN= " << MAXdif3rmsHFMIN
5800  << " MINdif3rmsHFMAX= " << MINdif3rmsHFMAX << endl;
5801  TLine *lineHF = new TLine(MAXdif3rmsHFMIN, 0., MAXdif3rmsHFMIN, ymaxHF);
5802  lineHF->SetLineColor(kBlue);
5803  lineHF->Draw();
5804  TLine *line1HF = new TLine(MINdif3rmsHFMAX, 0., MINdif3rmsHFMAX, ymaxHF);
5805  line1HF->SetLineColor(kBlue);
5806  line1HF->Draw();
5807  //================
5809  cRBX31->Update();
5810  cRBX31->Print("RBX-HF-3plots.png");
5811  cRBX31->Clear();
5812  // clean-up
5813  if (Ghf5)
5814  delete Ghf5;
5815  if (Ghf60)
5816  delete Ghf60;
5817  if (Ghf61)
5818  delete Ghf61;
5819  if (Ghf6)
5820  delete Ghf6;
5821  if (Ghf7)
5822  delete Ghf7;
5823 
5824  if (G20hf60)
5825  delete G20hf60;
5826  if (G20hf61)
5827  delete G20hf61;
5828  if (G30hf60)
5829  delete G30hf60;
5830  if (G30hf61)
5831  delete G30hf61;
5832  if (G40hf60)
5833  delete G40hf60;
5834  if (G40hf61)
5835  delete G40hf61;
5836 
5837  if (Ghf1)
5838  delete Ghf1;
5839  //========================================================================================== 22-1 HF:: Ratio plots jeta = 0 - 21 jphi =0 - 17
5840  //======================================================================
5841  //======================================================================28.11.2018
5842  //======================================================================
5843  //======================================================================
5844 
5845  gStyle->SetOptStat(1110000);
5846  cout << " RBX HF Ratio plotsmore *****" << endl;
5847  cRBX31->Clear();
5849  cRBX31->Divide(3, 1);
5850  //================
5851  cRBX31->cd(1);
5852  G20hf6->GetZaxis()->SetLabelSize(0.025);
5853  G20hf6->SetXTitle(" #eta \b");
5854  G20hf6->SetYTitle(" #phi \b");
5855  G20hf6->SetTitle("<Rj> for |1-<R>| > 0.20 \b");
5856  G20hf6->SetStats(0);
5857  G20hf6->Draw("COLZ");
5858  //================
5859  cRBX31->cd(2);
5860  G30hf6->GetZaxis()->SetLabelSize(0.025);
5861  G30hf6->SetXTitle(" #eta \b");
5862  G30hf6->SetYTitle(" #phi \b");
5863  G30hf6->SetTitle("<Rj> for |1-<R>| > 0.30 \b");
5864  G30hf6->SetStats(0);
5865  G30hf6->Draw("COLZ");
5866  //================
5867  cRBX31->cd(3);
5868  G40hf6->GetZaxis()->SetLabelSize(0.025);
5869  G40hf6->SetXTitle(" #eta \b");
5870  G40hf6->SetYTitle(" #phi \b");
5871  G40hf6->SetTitle("<Rj> for |1-<R>| > 0.40 \b");
5872  G40hf6->SetStats(0);
5873  G40hf6->Draw("COLZ");
5874  //================
5875 
5877  cRBX31->Update();
5878  cRBX31->Print("RBX-HF-3plotsmore.png");
5879  cRBX31->Clear();
5880 
5881  // clean-up
5882  if (G20hf6)
5883  delete G20hf6;
5884  if (G30hf6)
5885  delete G30hf6;
5886  if (G40hf6)
5887  delete G40hf6;
5888  gStyle->SetOptStat(0);
5890  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
5891  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
5892  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
5894 
5896 
5898  //=============================================================================== occupancyHB
5899  // For occupancy plots. Produces OccPlots_HBx.png (x=1)
5900  int mymaxbins = MaxLum;
5901  {
5902  cHB->Clear();
5903  cHB->Divide(2, 1);
5905  cHB->cd(1);
5906  TH2F *occhbm = (TH2F *)hfile->Get("h_RatioOccupancy_HBM");
5907  TH1F *uyhbm = new TH1F("uyhbm", "", mymaxbins, 1., mymaxbins + 1.);
5908  for (int i = 1; i <= occhbm->GetXaxis()->GetNbins(); i++) {
5909  double ccc1 = occhbm->GetBinContent(i);
5910  // if(ccc1>0.) cout<<" depth1_HB iLS = "<<i<<" <As> per LS= "<<ccc1<<endl;
5911  if (ccc1 > 0.)
5912  uyhbm->Fill(float(i), ccc1);
5913  }
5914  // gPad->SetLogy();
5915  uyhbm->SetMarkerStyle(20);
5916  uyhbm->SetMarkerSize(0.6);
5917  uyhbm->GetYaxis()->SetLabelSize(0.04);
5918  uyhbm->SetXTitle("min/av occupancy - HBM \b");
5919  uyhbm->SetMarkerColor(2);
5920  uyhbm->SetLineColor(0);
5921  uyhbm->SetMaximum(1.0);
5922  uyhbm->SetMinimum(0.2);
5923  gPad->SetGridy();
5924  uyhbm->Draw("Error");
5926  cHB->cd(2);
5927  TH2F *occhbp = (TH2F *)hfile->Get("h_RatioOccupancy_HBP");
5928  TH1F *uyhbp = new TH1F("uyhbp", "", mymaxbins, 1., mymaxbins + 1.);
5929  for (int i = 1; i <= occhbp->GetXaxis()->GetNbins(); i++) {
5930  double ccc1 = occhbp->GetBinContent(i);
5931  // if(ccc1>0.) cout<<" depth1_HB iLS = "<<i<<" <As> per LS= "<<ccc1<<endl;
5932  if (ccc1 > 0.)
5933  uyhbp->Fill(float(i), ccc1);
5934  }
5935  // gPad->SetLogy();
5936  uyhbp->SetMarkerStyle(20);
5937  uyhbp->SetMarkerSize(0.6);
5938  uyhbp->GetYaxis()->SetLabelSize(0.04);
5939  uyhbp->SetXTitle("min/av occupancy - HBP \b");
5940  uyhbp->SetMarkerColor(2);
5941  uyhbp->SetLineColor(0);
5942  uyhbp->SetMaximum(1.0);
5943  uyhbp->SetMinimum(0.2);
5944  gPad->SetGridy();
5945  uyhbp->Draw("Error");
5947 
5949  cHB->Update();
5950  cHB->Print(Form("OccPlots_HB.png"));
5951  cHB->Clear();
5952 
5953  // clean-up
5954  if (occhbm)
5955  delete occhbm;
5956  if (uyhbm)
5957  delete uyhbm;
5958  if (occhbp)
5959  delete occhbp;
5960  if (uyhbp)
5961  delete uyhbp;
5962  }
5963  //=============================================================================== occupancyHE
5964  // For occupancy plots. Produces OccPlots_HEx.png (x=1)
5965  {
5966  cHB->Clear();
5967  cHB->Divide(2, 1);
5969  cHB->cd(1);
5970  TH2F *occhem = (TH2F *)hfile->Get("h_RatioOccupancy_HEM");
5971  TH1F *uyhem = new TH1F("uyhem", "", mymaxbins, 1., mymaxbins + 1.);
5972  for (int i = 1; i <= occhem->GetXaxis()->GetNbins(); i++) {
5973  double ccc1 = occhem->GetBinContent(i);
5974  // if(ccc1>0.) cout<<" depth1_HE iLS = "<<i<<" <As> per LS= "<<ccc1<<endl;
5975  if (ccc1 > 0.)
5976  uyhem->Fill(float(i), ccc1);
5977  }
5978  // gPad->SetLogy();
5979  uyhem->SetMarkerStyle(20);
5980  uyhem->SetMarkerSize(0.6);
5981  uyhem->GetYaxis()->SetLabelSize(0.04);
5982  uyhem->SetXTitle("min/av occupancy - HEM \b");
5983  uyhem->SetMarkerColor(2);
5984  uyhem->SetLineColor(0);
5985  uyhem->SetMaximum(1.0);
5986  uyhem->SetMinimum(0.2);
5987  gPad->SetGridy();
5988  uyhem->Draw("Error");
5990  cHB->cd(2);
5991  TH2F *occhep = (TH2F *)hfile->Get("h_RatioOccupancy_HEP");
5992  TH1F *uyhep = new TH1F("uyhep", "", mymaxbins, 1., mymaxbins + 1.);
5993  for (int i = 1; i <= occhep->GetXaxis()->GetNbins(); i++) {
5994  double ccc1 = occhep->GetBinContent(i);
5995  // if(ccc1>0.) cout<<" depth1_HE iLS = "<<i<<" <As> per LS= "<<ccc1<<endl;
5996  if (ccc1 > 0.)
5997  uyhep->Fill(float(i), ccc1);
5998  }
5999  // gPad->SetLogy();
6000  uyhep->SetMarkerStyle(20);
6001  uyhep->SetMarkerSize(0.6);
6002  uyhep->GetYaxis()->SetLabelSize(0.04);
6003  uyhep->SetXTitle("min/av occupancy - HEP \b");
6004  uyhep->SetMarkerColor(2);
6005  uyhep->SetLineColor(0);
6006  uyhep->SetMaximum(1.0);
6007  uyhep->SetMinimum(0.2);
6008  gPad->SetGridy();
6009  uyhep->Draw("Error");
6011 
6013  cHB->Update();
6014  cHB->Print(Form("OccPlots_HE.png"));
6015  cHB->Clear();
6016 
6017  // clean-up
6018  if (occhem)
6019  delete occhem;
6020  if (uyhem)
6021  delete uyhem;
6022  if (occhep)
6023  delete occhep;
6024  if (uyhep)
6025  delete uyhep;
6026  }
6027  //=============================================================================== occupancyHO
6028  // For occupancy plots. Produces OccPlots_HOx.png (x=1)
6029  {
6030  cHB->Clear();
6031  cHB->Divide(2, 1);
6033  cHB->cd(1);
6034  TH2F *occhom = (TH2F *)hfile->Get("h_RatioOccupancy_HOM");
6035  TH1F *uyhom = new TH1F("uyhom", "", mymaxbins, 1., mymaxbins + 1.);
6036  for (int i = 1; i <= occhom->GetXaxis()->GetNbins(); i++) {
6037  double ccc1 = occhom->GetBinContent(i);
6038  // if(ccc1>0.) cout<<" depth1_HO iLS = "<<i<<" <As> per LS= "<<ccc1<<endl;
6039  if (ccc1 > 0.)
6040  uyhom->Fill(float(i), ccc1);
6041  }
6042  // gPad->SetLogy();
6043  uyhom->SetMarkerStyle(20);
6044  uyhom->SetMarkerSize(0.6);
6045  uyhom->GetYaxis()->SetLabelSize(0.04);
6046  uyhom->SetXTitle("min/av occupancy - HOM \b");
6047  uyhom->SetMarkerColor(2);
6048  uyhom->SetLineColor(0);
6049  uyhom->SetMaximum(1.0);
6050  uyhom->SetMinimum(0.2);
6051  gPad->SetGridy();
6052  uyhom->Draw("Error");
6054  cHB->cd(2);
6055  TH2F *occhop = (TH2F *)hfile->Get("h_RatioOccupancy_HOP");
6056  TH1F *uyhop = new TH1F("uyhop", "", mymaxbins, 1., mymaxbins + 1.);
6057  for (int i = 1; i <= occhop->GetXaxis()->GetNbins(); i++) {
6058  double ccc1 = occhop->GetBinContent(i);
6059  // if(ccc1>0.) cout<<" depth1_HO iLS = "<<i<<" <As> per LS= "<<ccc1<<endl;
6060  if (ccc1 > 0.)
6061  uyhop->Fill(float(i), ccc1);
6062  }
6063  // gPad->SetLogy();
6064  uyhop->SetMarkerStyle(20);
6065  uyhop->SetMarkerSize(0.6);
6066  uyhop->GetYaxis()->SetLabelSize(0.04);
6067  uyhop->SetXTitle("min/av occupancy - HOP \b");
6068  uyhop->SetMarkerColor(2);
6069  uyhop->SetLineColor(0);
6070  uyhop->SetMaximum(1.0);
6071  uyhop->SetMinimum(0.2);
6072  gPad->SetGridy();
6073  uyhop->Draw("Error");
6075 
6077  cHB->Update();
6078  cHB->Print(Form("OccPlots_HO.png"));
6079  cHB->Clear();
6080 
6081  // clean-up
6082  if (occhom)
6083  delete occhom;
6084  if (uyhom)
6085  delete uyhom;
6086  if (occhop)
6087  delete occhop;
6088  if (uyhop)
6089  delete uyhop;
6090  }
6091  //=============================================================================== occupancyHF
6092  // For occupancy plots. Produces OccPlots_HFx.png (x=1)
6093  {
6094  cHB->Clear();
6095  cHB->Divide(2, 1);
6097  cHB->cd(1);
6098  TH2F *occhfm = (TH2F *)hfile->Get("h_RatioOccupancy_HFM");
6099  TH1F *uyhfm = new TH1F("uyhfm", "", mymaxbins, 1., mymaxbins + 1.);
6100  for (int i = 1; i <= occhfm->GetXaxis()->GetNbins(); i++) {
6101  double ccc1 = occhfm->GetBinContent(i);
6102  // if(ccc1>0.) cout<<" depth1_HF iLS = "<<i<<" <As> per LS= "<<ccc1<<endl;
6103  if (ccc1 > 0.)
6104  uyhfm->Fill(float(i), ccc1);
6105  }
6106  // gPad->SetLogy();
6107  uyhfm->SetMarkerStyle(20);
6108  uyhfm->SetMarkerSize(0.6);
6109  uyhfm->GetYaxis()->SetLabelSize(0.04);
6110  uyhfm->SetXTitle("min/av occupancy - HFM \b");
6111  uyhfm->SetMarkerColor(2);
6112  uyhfm->SetLineColor(0);
6113  uyhfm->SetMaximum(1.0);
6114  uyhfm->SetMinimum(0.2);
6115  gPad->SetGridy();
6116  uyhfm->Draw("Error");
6118  cHB->cd(2);
6119  TH2F *occhfp = (TH2F *)hfile->Get("h_RatioOccupancy_HFP");
6120  TH1F *uyhfp = new TH1F("uyhfp", "", mymaxbins, 1., mymaxbins + 1.);
6121  for (int i = 1; i <= occhfp->GetXaxis()->GetNbins(); i++) {
6122  double ccc1 = occhfp->GetBinContent(i);
6123  // if(ccc1>0.) cout<<" depth1_HF iLS = "<<i<<" <As> per LS= "<<ccc1<<endl;
6124  if (ccc1 > 0.)
6125  uyhfp->Fill(float(i), ccc1);
6126  }
6127  // gPad->SetLogy();
6128  uyhfp->SetMarkerStyle(20);
6129  uyhfp->SetMarkerSize(0.6);
6130  uyhfp->GetYaxis()->SetLabelSize(0.04);
6131  uyhfp->SetXTitle("min/av occupancy - HFP \b");
6132  uyhfp->SetMarkerColor(2);
6133  uyhfp->SetLineColor(0);
6134  uyhfp->SetMaximum(1.0);
6135  uyhfp->SetMinimum(0.2);
6136  gPad->SetGridy();
6137  uyhfp->Draw("Error");
6139 
6141  cHB->Update();
6142  cHB->Print(Form("OccPlots_HF.png"));
6143  cHB->Clear();
6144 
6145  // clean-up
6146  if (occhfm)
6147  delete occhfm;
6148  if (uyhfm)
6149  delete uyhfm;
6150  if (occhfp)
6151  delete occhfp;
6152  if (uyhfp)
6153  delete uyhfp;
6154  }
6155  std::cout << "************>>> occupancy plots done" << std::endl;
6156 
6161  //************************* ***** Signal *****
6162  cout << ">>>>>>>>>>>>>>>>>>>>>>>>start Summed Amplitude Plots " << endl;
6163  int maxbins = MaxLum;
6164  cout << ">>>> maxbins = " << maxbins << endl;
6165  TH1F *SummedAmplitudeHisto[4]; // 1d histogramm for subdet
6166  SummedAmplitudeHisto[0] = (TH1F *)hfile->Get("h_averSIGNALsumamplitude_HB");
6167  SummedAmplitudeHisto[1] = (TH1F *)hfile->Get("h_averSIGNALsumamplitude_HE");
6168  SummedAmplitudeHisto[2] = (TH1F *)hfile->Get("h_averSIGNALsumamplitude_HO");
6169  SummedAmplitudeHisto[3] = (TH1F *)hfile->Get("h_averSIGNALsumamplitude_HF");
6170  TH1F *SummedAmplitudeOccupancyHisto[4]; // 1d histogramm for subdet
6171  SummedAmplitudeOccupancyHisto[0] = (TH1F *)hfile->Get("h_averSIGNALoccupancy_HB");
6172  SummedAmplitudeOccupancyHisto[1] = (TH1F *)hfile->Get("h_averSIGNALoccupancy_HE");
6173  SummedAmplitudeOccupancyHisto[2] = (TH1F *)hfile->Get("h_averSIGNALoccupancy_HO");
6174  SummedAmplitudeOccupancyHisto[3] = (TH1F *)hfile->Get("h_averSIGNALoccupancy_HF");
6175  for (int sub = 0; sub < 4; sub++) {
6176  cHE->Clear();
6177  cHE->Divide(2, 1);
6178  cHE->cd(1);
6179  TH1F *kslpq = new TH1F("kslpq", "", maxbins, 1., maxbins + 1.);
6180  // cout<<">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> sub = "<< sub <<endl;
6181  for (int i = 1; i <= kslpq->GetXaxis()->GetNbins(); i++) {
6182  double ccc1 = 0.;
6183  if (SummedAmplitudeHisto[sub])
6184  ccc1 = SummedAmplitudeHisto[sub]->GetBinContent(i);
6185  // if(ccc1>0.) cout<<" iLS = "<<i<<" LS= "<<ccc1<<endl;
6186  if (ccc1 > 0.)
6187  kslpq->Fill(float(i), ccc1);
6188  }
6189  // gPad->SetLogy();
6190  kslpq->SetMarkerStyle(20);
6191  kslpq->SetMarkerSize(0.8);
6192  kslpq->GetYaxis()->SetLabelSize(0.04);
6193  kslpq->SetXTitle("SumA of channels w/ signal per LS \b");
6194  kslpq->SetMarkerColor(2);
6195  kslpq->SetLineColor(0);
6196  // kslpq->SetMinimum(0.8);
6197  gPad->SetGridx();
6198  kslpq->Draw("Error");
6200  cHE->cd(2);
6201  TH1F *pqmks = new TH1F("pqmks", "", maxbins, 1., maxbins + 1.);
6202  for (int i = 1; i <= pqmks->GetXaxis()->GetNbins(); i++) {
6203  double ccc1 = 0.;
6204  if (SummedAmplitudeOccupancyHisto[sub])
6205  ccc1 = SummedAmplitudeOccupancyHisto[sub]->GetBinContent(i);
6206  // if(ccc1>0.) cout<<" iLS = "<<i<<" LS= "<<ccc1<<endl;
6207  if (ccc1 > 0.)
6208  pqmks->Fill(float(i), ccc1);
6209  }
6210  // gPad->SetLogy();
6211  pqmks->SetMarkerStyle(20);
6212  pqmks->SetMarkerSize(0.8);
6213  pqmks->GetYaxis()->SetLabelSize(0.04);
6214  pqmks->SetXTitle("Occupancy of channels w/ signal per LS \b");
6215  pqmks->SetMarkerColor(4);
6216  pqmks->SetLineColor(0);
6217  // pqmks->SetMinimum(0.8);
6218  gPad->SetGridx();
6219  pqmks->Draw("Error");
6220  cHE->Update();
6221  if (sub == 0)
6222  cHE->Print("SummedAmplitudesSignal_HB.png");
6223  if (sub == 1)
6224  cHE->Print("SummedAmplitudesSignal_HE.png");
6225  if (sub == 2)
6226  cHE->Print("SummedAmplitudesSignal_HO.png");
6227  if (sub == 3)
6228  cHE->Print("SummedAmplitudesSignal_HF.png");
6229  cHE->Clear();
6230  if (kslpq)
6231  delete kslpq;
6232  if (pqmks)
6233  delete pqmks;
6234  } //for
6235  // clean-up
6236  //for (unsigned int i=0; i<4; i++) {delete SummedAmplitudeHisto[i];delete SummedAmplitudeOccupancyHisto[i];}
6237 
6240  //************************* ***** NoSignal *****
6241  cout << ">>>>>>>>>>>>>>>>>>>>>>>>start Summed Amplitude Plots NoSignal " << endl;
6242  TH1F *NoSignalSummedAmplitudeHisto[4]; // 1d histogramm for subdet
6243  NoSignalSummedAmplitudeHisto[0] = (TH1F *)hfile->Get("h_averNOSIGNALsumamplitude_HB");
6244  NoSignalSummedAmplitudeHisto[1] = (TH1F *)hfile->Get("h_averNOSIGNALsumamplitude_HE");
6245  NoSignalSummedAmplitudeHisto[2] = (TH1F *)hfile->Get("h_averNOSIGNALsumamplitude_HO");
6246  NoSignalSummedAmplitudeHisto[3] = (TH1F *)hfile->Get("h_averNOSIGNALsumamplitude_HF");
6247  TH1F *NoSignalSummedAmplitudeOccupancyHisto[4]; // 1d histogramm for subdet
6248  NoSignalSummedAmplitudeOccupancyHisto[0] = (TH1F *)hfile->Get("h_averNOSIGNALoccupancy_HB");
6249  NoSignalSummedAmplitudeOccupancyHisto[1] = (TH1F *)hfile->Get("h_averNOSIGNALoccupancy_HE");
6250  NoSignalSummedAmplitudeOccupancyHisto[2] = (TH1F *)hfile->Get("h_averNOSIGNALoccupancy_HO");
6251  NoSignalSummedAmplitudeOccupancyHisto[3] = (TH1F *)hfile->Get("h_averNOSIGNALoccupancy_HF");
6252  for (int sub = 0; sub < 4; sub++) {
6253  cHE->Clear();
6254  cHE->Divide(2, 1);
6255 
6256  cHE->cd(1);
6257  TH1F *kslpq = new TH1F("kslpq", "", maxbins, 1., maxbins + 1.);
6258  for (int i = 1; i <= kslpq->GetXaxis()->GetNbins(); i++) {
6259  double ccc1 = 0.;
6260  if (NoSignalSummedAmplitudeHisto[sub])
6261  ccc1 = NoSignalSummedAmplitudeHisto[sub]->GetBinContent(i);
6262  // if(ccc1>0.) cout<<" iLS = "<<i<<" LS= "<<ccc1<<endl;
6263  if (ccc1 > 0.)
6264  kslpq->Fill(float(i), ccc1);
6265  }
6266  // gPad->SetLogy();
6267  kslpq->SetMarkerStyle(20);
6268  kslpq->SetMarkerSize(0.8);
6269  kslpq->GetYaxis()->SetLabelSize(0.04);
6270  kslpq->SetXTitle("SumA of channels w/o signal per LS \b");
6271  kslpq->SetMarkerColor(2);
6272  kslpq->SetLineColor(0);
6273  if (sub == 0) {
6274  kslpq->SetMaximum(20000.);
6275  kslpq->SetMinimum(5000.);
6276  } else if (sub == 1) {
6277  kslpq->SetMaximum(40000.);
6278  kslpq->SetMinimum(0.);
6279  } else if (sub == 2) {
6280  kslpq->SetMaximum(10000.);
6281  kslpq->SetMinimum(15000.);
6282  } else if (sub == 3) {
6283  kslpq->SetMaximum(100000.);
6284  kslpq->SetMinimum(0.);
6285  }
6286  gPad->SetGridx();
6287  kslpq->Draw("Error");
6289  cHE->cd(2);
6290  TH1F *pqmks = new TH1F("pqmks", "", maxbins, 1., maxbins + 1.);
6291  for (int i = 1; i <= pqmks->GetXaxis()->GetNbins(); i++) {
6292  double ccc1 = 0.;
6293  if (NoSignalSummedAmplitudeOccupancyHisto[sub])
6294  ccc1 = NoSignalSummedAmplitudeOccupancyHisto[sub]->GetBinContent(i);
6295  // if(ccc1>0.) cout<<" iLS = "<<i<<" LS= "<<ccc1<<endl;
6296  if (ccc1 > 0.)
6297  pqmks->Fill(float(i), ccc1);
6298  }
6299  // gPad->SetLogy();
6300  pqmks->SetMarkerStyle(20);
6301  pqmks->SetMarkerSize(0.8);
6302  pqmks->GetYaxis()->SetLabelSize(0.04);
6303  pqmks->SetXTitle("Occupancy of channels w/o signal per LS \b");
6304  pqmks->SetMarkerColor(4);
6305  pqmks->SetLineColor(0);
6306  if (sub == 0) {
6307  pqmks->SetMaximum(600.);
6308  pqmks->SetMinimum(200.);
6309  } else if (sub == 1) {
6310  pqmks->SetMaximum(910.);
6311  pqmks->SetMinimum(10.);
6312  } else if (sub == 2) {
6313  pqmks->SetMaximum(200.);
6314  pqmks->SetMinimum(50.);
6315  } else if (sub == 3) {
6316  pqmks->SetMaximum(866.);
6317  pqmks->SetMinimum(856.);
6318  }
6319  gPad->SetGridx();
6320  pqmks->Draw("Error");
6321  cHE->Update();
6322  if (sub == 0)
6323  cHE->Print("NoSignalSummedAmplitudes_HB.png");
6324  if (sub == 1)
6325  cHE->Print("NoSignalSummedAmplitudes_HE.png");
6326  if (sub == 2)
6327  cHE->Print("NoSignalSummedAmplitudes_HO.png");
6328  if (sub == 3)
6329  cHE->Print("NoSignalSummedAmplitudes_HF.png");
6330  cHE->Clear();
6331  if (kslpq)
6332  delete kslpq;
6333  if (pqmks)
6334  delete pqmks;
6335  } //for
6336  // clean-up
6337  //for (unsigned int i=0; i<4; i++) {delete NoSignalSummedAmplitudeHisto[i];delete NoSignalSummedAmplitudeOccupancyHisto[i];}
6339 
6342  //************************* ***** MaxxValues *****
6343  cout << ">>>>>>>>>>>>>>>>>>>>>>>>start Summed Amplitude Plots Maxx " << endl;
6344  TH1F *MaxxSummedAmplitudeHisto[4]; // 1d histogramm for subdet
6345  MaxxSummedAmplitudeHisto[0] = (TH1F *)hfile->Get("h_maxxSUMAmpl_HB");
6346  MaxxSummedAmplitudeHisto[1] = (TH1F *)hfile->Get("h_maxxSUMAmpl_HE");
6347  MaxxSummedAmplitudeHisto[2] = (TH1F *)hfile->Get("h_maxxSUMAmpl_HO");
6348  MaxxSummedAmplitudeHisto[3] = (TH1F *)hfile->Get("h_maxxSUMAmpl_HF");
6349  TH1F *MaxxSummedAmplitudeOccupancyHisto[4]; // 1d histogramm for subdet
6350  MaxxSummedAmplitudeOccupancyHisto[0] = (TH1F *)hfile->Get("h_maxxOCCUP_HB");
6351  MaxxSummedAmplitudeOccupancyHisto[1] = (TH1F *)hfile->Get("h_maxxOCCUP_HE");
6352  MaxxSummedAmplitudeOccupancyHisto[2] = (TH1F *)hfile->Get("h_maxxOCCUP_HO");
6353  MaxxSummedAmplitudeOccupancyHisto[3] = (TH1F *)hfile->Get("h_maxxOCCUP_HF");
6354  TH1F *SAmplitudeHisto[4]; // 1d histogramm for subdet
6355  SAmplitudeHisto[0] = (TH1F *)hfile->Get("h_eventamplitude_HB");
6356  SAmplitudeHisto[1] = (TH1F *)hfile->Get("h_eventamplitude_HE");
6357  SAmplitudeHisto[2] = (TH1F *)hfile->Get("h_eventamplitude_HO");
6358  SAmplitudeHisto[3] = (TH1F *)hfile->Get("h_eventamplitude_HF");
6359  TH1F *OccupancyHisto[4]; // 1d histogramm for subdet
6360  OccupancyHisto[0] = (TH1F *)hfile->Get("h_eventoccupancy_HB");
6361  OccupancyHisto[1] = (TH1F *)hfile->Get("h_eventoccupancy_HE");
6362  OccupancyHisto[2] = (TH1F *)hfile->Get("h_eventoccupancy_HO");
6363  OccupancyHisto[3] = (TH1F *)hfile->Get("h_eventoccupancy_HF");
6364 
6365  int countamplmaxHB = 0;
6366  int countamplmaxHE = 0;
6367  int countamplmaxHO = 0;
6368  int countamplmaxHF = 0;
6369  int countoccumaxHB = 0;
6370  int countoccumaxHE = 0;
6371  int countoccumaxHO = 0;
6372  int countoccumaxHF = 0;
6373  unsigned long int countamplHB = 0;
6374  unsigned long int countamplHE = 0;
6375  unsigned long int countamplHO = 0;
6376  unsigned long int countamplHF = 0;
6377  unsigned long int countoccuHB = 0;
6378  unsigned long int countoccuHE = 0;
6379  unsigned long int countoccuHO = 0;
6380  unsigned long int countoccuHF = 0;
6381  gStyle->SetOptStat(110000);
6382  for (int sub = 0; sub < 4; sub++) {
6383  cFour->Clear();
6384  cFour->Divide(2, 2);
6385 
6386  cFour->cd(1);
6387  TH1F *lpqxc = new TH1F("lpqxc", "", maxbins, 1., maxbins + 1.);
6388  for (int i = 1; i <= lpqxc->GetXaxis()->GetNbins(); i++) {
6389  double ccc1 = 0.;
6390  if (MaxxSummedAmplitudeHisto[sub])
6391  ccc1 = MaxxSummedAmplitudeHisto[sub]->GetBinContent(i);
6392  // if(ccc1>0.) cout<<"111111111111111111111111111 iLS = "<<i<<" LS= "<<ccc1<<endl;
6393  if (ccc1 > 0.)
6394  lpqxc->Fill(float(i), ccc1);
6395  if (sub == 0 && ccc1 > 60000.)
6396  countamplmaxHB++;
6397  if (sub == 1 && ccc1 > 60000.)
6398  countamplmaxHE++;
6399  if (sub == 2 && ccc1 > 150000.)
6400  countamplmaxHO++;
6401  if (sub == 3 && ccc1 > 22000.)
6402  countamplmaxHF++;
6403  }
6404  // gPad->SetLogy();
6405  lpqxc->SetMarkerStyle(20);
6406  lpqxc->SetMarkerSize(0.8);
6407  // lpqxc->GetYaxis()->SetLabelSize(0.08);
6408  if (sub == 0)
6409  lpqxc->SetXTitle("HB: max SA over LS-events per LS \b");
6410  if (sub == 1)
6411  lpqxc->SetXTitle("HE: max SA over LS-events per LS \b");
6412  if (sub == 2)
6413  lpqxc->SetXTitle("HO: max SA over LS-events per LS \b");
6414  if (sub == 3)
6415  lpqxc->SetXTitle("HF: max SA over LS-events per LS \b");
6416  lpqxc->SetMarkerColor(2);
6417  lpqxc->SetLineColor(0);
6418  gPad->SetGridx();
6419  lpqxc->Draw("Error");
6420 
6422  cFour->cd(2);
6423  TH1F *hpzlm = new TH1F("hpzlm", "", maxbins, 1., maxbins + 1.);
6424  for (int i = 1; i <= hpzlm->GetXaxis()->GetNbins(); i++) {
6425  double ccc1 = 0.;
6426  if (MaxxSummedAmplitudeOccupancyHisto[sub])
6427  ccc1 = MaxxSummedAmplitudeOccupancyHisto[sub]->GetBinContent(i);
6428  // if(ccc1>0.) cout<<"2222222222222222222222222 iLS = "<<i<<" LS= "<<ccc1<<endl;
6429  if (ccc1 > 0.)
6430  hpzlm->Fill(float(i), ccc1);
6431  if (sub == 0 && ccc1 > 2000.)
6432  countoccumaxHB++;
6433  if (sub == 1 && ccc1 > 1200.)
6434  countoccumaxHE++;
6435  if (sub == 2 && ccc1 > 2000.)
6436  countoccumaxHO++;
6437  if (sub == 3 && ccc1 > 860.)
6438  countoccumaxHF++;
6439  }
6440  // gPad->SetLogy();
6441  hpzlm->SetMarkerStyle(20);
6442  hpzlm->SetMarkerSize(0.8);
6443  // hpzlm->GetYaxis()->SetLabelSize(0.08);
6444  if (sub == 0)
6445  hpzlm->SetXTitle("HB: max Occupancy over LS-events per LS \b");
6446  if (sub == 1)
6447  hpzlm->SetXTitle("HE: max Occupancy over LS-events per LS \b");
6448  if (sub == 2)
6449  hpzlm->SetXTitle("HO: max Occupancy over LS-events per LS \b");
6450  if (sub == 3)
6451  hpzlm->SetXTitle("HF: max Occupancy over LS-events per LS \b");
6452  hpzlm->SetMarkerColor(4);
6453  hpzlm->SetLineColor(0);
6454  gPad->SetGridx();
6455  if (sub == 3) {
6456  hpzlm->SetMaximum(866.);
6457  hpzlm->SetMinimum(856.);
6458  }
6459  hpzlm->Draw("Error");
6460 
6462  cFour->cd(3);
6463  gPad->SetLogy();
6464  if (SAmplitudeHisto[sub]) {
6465  for (int i = 1; i <= SAmplitudeHisto[sub]->GetXaxis()->GetNbins(); i++) {
6466  // if(sub==0 && i * 800> 60000.) {
6467  // cout<<">=>=>>=> countamplHB= "<<countamplHB<<" content = "<<SAmplitudeHisto[sub]->GetBinContent(i)<<" sub= "<<sub<<" i= "<<i<< endl;
6468  // countamplHB+=SAmplitudeHisto[sub]->GetBinContent(i);
6469  // }
6470  if (sub == 0 && i * 800 > 60000.)
6471  countamplHB += SAmplitudeHisto[sub]->GetBinContent(i);
6472  if (sub == 1 && i * 1000 > 60000.)
6473  countamplHE += SAmplitudeHisto[sub]->GetBinContent(i);
6474  if (sub == 2 && i * 2500 > 150000.)
6475  countamplHO += SAmplitudeHisto[sub]->GetBinContent(i);
6476  if (sub == 3 && i * 1400 > 22000.)
6477  countamplHF += SAmplitudeHisto[sub]->GetBinContent(i);
6478  }
6479  SAmplitudeHisto[sub]->SetMarkerStyle(20);
6480  SAmplitudeHisto[sub]->SetMarkerSize(0.8);
6481  if (sub == 0)
6482  SAmplitudeHisto[sub]->SetTitle("HB event Amplitude\b");
6483  if (sub == 1)
6484  SAmplitudeHisto[sub]->SetTitle("HE event Amplitude\b");
6485  if (sub == 2)
6486  SAmplitudeHisto[sub]->SetTitle("HO event Amplitude\b");
6487  if (sub == 3)
6488  SAmplitudeHisto[sub]->SetTitle("HF event Amplitude\b");
6489  // SAmplitudeHisto[sub]->GetYaxis()->SetLabelSize(0.08);
6490  SAmplitudeHisto[sub]->SetXTitle("event amplitude \b");
6491  SAmplitudeHisto[sub]->SetMarkerColor(2);
6492  SAmplitudeHisto[sub]->SetLineColor(2);
6493  SAmplitudeHisto[sub]->Draw("");
6494  }
6496  cFour->cd(4);
6497  gPad->SetLogy();
6498  if (OccupancyHisto[sub]) {
6499  for (int i = 1; i <= OccupancyHisto[sub]->GetXaxis()->GetNbins(); i++) {
6500  if (sub == 0 && i * 30 > 2000.)
6501  countoccuHB += OccupancyHisto[sub]->GetBinContent(i);
6502  if (sub == 1 && i * 20 > 1200.)
6503  countoccuHE += OccupancyHisto[sub]->GetBinContent(i);
6504  if (sub == 2 && i * 25 > 2000.)
6505  countoccuHO += OccupancyHisto[sub]->GetBinContent(i);
6506  if (sub == 3 && i * 10 > 860.)
6507  countoccuHF += OccupancyHisto[sub]->GetBinContent(i);
6508  }
6509  OccupancyHisto[sub]->SetMarkerStyle(20);
6510  OccupancyHisto[sub]->SetMarkerSize(0.8);
6511  if (sub == 0)
6512  OccupancyHisto[sub]->SetTitle("HB event Occupancy\b");
6513  if (sub == 1)
6514  OccupancyHisto[sub]->SetTitle("HE event Occupancy\b");
6515  if (sub == 2)
6516  OccupancyHisto[sub]->SetTitle("HO event Occupancy\b");
6517  if (sub == 3)
6518  OccupancyHisto[sub]->SetTitle("HF event Occupancy\b");
6519  // OccupancyHisto[sub]->GetYaxis()->SetLabelSize(0.08);
6520  OccupancyHisto[sub]->SetXTitle("event occupancy \b");
6521  OccupancyHisto[sub]->SetMarkerColor(4);
6522  OccupancyHisto[sub]->SetLineColor(4);
6523  OccupancyHisto[sub]->Draw("");
6524  }
6525 
6526  cFour->Update();
6527  if (sub == 0)
6528  cFour->Print("MaxxSummedAmplitudes_HB.png");
6529  if (sub == 1)
6530  cFour->Print("MaxxSummedAmplitudes_HE.png");
6531  if (sub == 2)
6532  cFour->Print("MaxxSummedAmplitudes_HO.png");
6533  if (sub == 3)
6534  cFour->Print("MaxxSummedAmplitudes_HF.png");
6535  cFour->Clear();
6536  if (lpqxc)
6537  delete lpqxc;
6538  if (hpzlm)
6539  delete hpzlm;
6540  } //for
6541  gStyle->SetOptStat(0);
6543  cout << ">=>=>>=> countamplmaxHB= " << countamplmaxHB << " countamplmaxHE= " << countamplmaxHE
6544  << " countamplmaxHO= " << countamplmaxHO << " countamplmaxHF= " << countamplmaxHF << endl;
6545  cout << ">=>=>>=> countoccumaxHB= " << countoccumaxHB << " countoccumaxHE= " << countoccumaxHE
6546  << " countoccumaxHO= " << countoccumaxHO << " countoccumaxHF= " << countoccumaxHF << endl;
6547  cout << ">=>=>>=> countamplHB= " << countamplHB << " countamplHE= " << countamplHE << " countamplHO= " << countamplHO
6548  << " countamplHF= " << countamplHF << endl;
6549  cout << ">=>=>>=> countoccuHB= " << countoccuHB << " countoccuHE= " << countoccuHE << " countoccuHO= " << countoccuHO
6550  << " countoccuHF= " << countoccuHF << endl;
6551 
6554  //************************* ***** channelsummedA over depths *****
6555  cout << ">>>>>>>>>>>>>>>>>>>>>>>>channelsummedA over depths " << endl;
6556  TH1F *ChannelDepthsummedAmplitudesPlots[4]; // 1d histogramm for subdet
6557  ChannelDepthsummedAmplitudesPlots[0] = (TH1F *)hfile->Get("h_sumamplitudechannel_HB");
6558  ChannelDepthsummedAmplitudesPlots[1] = (TH1F *)hfile->Get("h_sumamplitudechannel_HE");
6559  ChannelDepthsummedAmplitudesPlots[2] = (TH1F *)hfile->Get("h_sumamplitudechannel_HO");
6560  ChannelDepthsummedAmplitudesPlots[3] = (TH1F *)hfile->Get("h_sumamplitudechannel_HF");
6561  TLine *litebdt[4];
6562  if (ChannelDepthsummedAmplitudesPlots[0])
6563  litebdt[0] = new TLine(80., 0.8, 80., ChannelDepthsummedAmplitudesPlots[0]->GetBinContent(4) + 100.);
6564  if (ChannelDepthsummedAmplitudesPlots[1])
6565  litebdt[1] = new TLine(200., 0.8, 200., ChannelDepthsummedAmplitudesPlots[1]->GetBinContent(7) + 100.);
6566  if (ChannelDepthsummedAmplitudesPlots[2])
6567  litebdt[2] = new TLine(1200., 0.8, 1200., ChannelDepthsummedAmplitudesPlots[2]->GetBinContent(17) + 100.);
6568  if (ChannelDepthsummedAmplitudesPlots[3])
6569  litebdt[3] = new TLine(600., 0.8, 600., ChannelDepthsummedAmplitudesPlots[3]->GetBinContent(6) + 100.);
6570 
6571  gStyle->SetOptStat(110000);
6572  cFour1->Clear();
6573  cFour1->Divide(2, 2);
6574  for (int sub = 0; sub < 4; sub++) {
6575  if (sub == 0)
6576  cFour1->cd(1);
6577  if (sub == 1)
6578  cFour1->cd(2);
6579  if (sub == 2)
6580  cFour1->cd(3);
6581  if (sub == 3)
6582  cFour1->cd(4);
6583  gPad->SetLogy();
6584  ChannelDepthsummedAmplitudesPlots[sub]->SetMarkerStyle(20);
6585  ChannelDepthsummedAmplitudesPlots[sub]->SetMarkerSize(0.8);
6586  if (sub == 0)
6587  ChannelDepthsummedAmplitudesPlots[sub]->SetTitle("HB channel Amplitudes\b");
6588  if (sub == 1)
6589  ChannelDepthsummedAmplitudesPlots[sub]->SetTitle("HE channel Amplitudes\b");
6590  if (sub == 2)
6591  ChannelDepthsummedAmplitudesPlots[sub]->SetTitle("HO channel Amplitudes\b");
6592  if (sub == 3)
6593  ChannelDepthsummedAmplitudesPlots[sub]->SetTitle("HF channel Amplitudes\b");
6594  if (sub == 0)
6595  ChannelDepthsummedAmplitudesPlots[sub]->SetXTitle("HB channel depths summed Amplitudes \b");
6596  if (sub == 1)
6597  ChannelDepthsummedAmplitudesPlots[sub]->SetXTitle("HE channel depths summed Amplitudes \b");
6598  if (sub == 2)
6599  ChannelDepthsummedAmplitudesPlots[sub]->SetXTitle("HO channel depths summed Amplitudes \b");
6600  if (sub == 3)
6601  ChannelDepthsummedAmplitudesPlots[sub]->SetXTitle("HF channel depths summed Amplitudes \b");
6602  ChannelDepthsummedAmplitudesPlots[sub]->SetMarkerColor(2);
6603  ChannelDepthsummedAmplitudesPlots[sub]->SetLineColor(2);
6604  ChannelDepthsummedAmplitudesPlots[sub]->Draw("");
6605  litebdt[sub]->SetLineColor(kBlue);
6606  litebdt[sub]->Draw("s");
6607  } //for
6608  cFour1->Update();
6609  cFour1->Print("ChannelDepthsummedAmplitudes.png");
6610  cFour1->Clear();
6611  gStyle->SetOptStat(0);
6612 
6615  //************************* ***** Ataildepth1_HB *****
6616  cout << ">>>>>>>>>>>>>>>>>>>>>>>>2DAtaildepth " << endl;
6618  cHB->Clear();
6619  cHB->Divide(2, 1);
6620 
6621  TH2F *DAtaildepth1[2]; // 1d histogramm for subdet
6622  DAtaildepth1[0] = (TH2F *)hfile->Get("h_2DAtaildepth1_HB");
6623  DAtaildepth1[1] = (TH2F *)hfile->Get("h_2D0Ataildepth1_HB");
6624  cHB->cd(1);
6625  if (!DAtaildepth1[0] || !DAtaildepth1[1]) {
6626  cout << ">>>>>>>>>>>>>>>>>>>>>>>>Ataildepth1_HB EMPTY histoes for 2DAtaildepth 1" << endl;
6627  } else {
6628  TH2F *tail1 = (TH2F *)DAtaildepth1[0]->Clone("tail1");
6629  tail1->Divide(DAtaildepth1[0], DAtaildepth1[1], 1, 1, "B");
6630  // tail1->Sumw2();
6631  gPad->SetGridy();
6632  gPad->SetGridx();
6633  gPad->SetLogz();
6634  tail1->SetMarkerStyle(20);
6635  tail1->SetMarkerSize(0.4);
6636  tail1->SetTitle("Amplitudes for tail-events (HBdepth1) \b");
6637  tail1->SetXTitle("#eta \b");
6638  tail1->SetYTitle("#phi \b");
6639  tail1->SetZTitle("2D <A> in the tail - HB Depth1 \b");
6640  tail1->SetMarkerColor(2);
6641  tail1->SetLineColor(2);
6642  tail1->Draw("COLZ");
6643  }
6644  TH2F *DAtaildepth2[2]; // 1d histogramm for subdet
6645  DAtaildepth2[0] = (TH2F *)hfile->Get("h_2DAtaildepth2_HB");
6646  DAtaildepth2[1] = (TH2F *)hfile->Get("h_2D0Ataildepth2_HB");
6647  cHB->cd(2);
6648  if (!DAtaildepth2[0] || !DAtaildepth2[1]) {
6649  cout << ">>>>>>>>>>>>>>>>>>>>>>>>Ataildepth1_HB EMPTY histoes for 2DAtaildepth 2" << endl;
6650  } else {
6651  TH2F *tail2 = (TH2F *)DAtaildepth2[0]->Clone("tail2");
6652  tail2->Divide(DAtaildepth2[0], DAtaildepth2[1], 1, 1, "B");
6653  // tail2->Sumw2();
6654  gPad->SetGridy();
6655  gPad->SetGridx();
6656  gPad->SetLogz();
6657  tail2->SetMarkerStyle(20);
6658  tail2->SetMarkerSize(0.4);
6659  tail2->SetTitle("Amplitudes for tail-events (HBdepth2) \b");
6660  tail2->SetXTitle("#eta \b");
6661  tail2->SetYTitle("#phi \b");
6662  tail2->SetZTitle("2D <A> in the tail - HB Depth2 \b");
6663  tail2->SetMarkerColor(2);
6664  tail2->SetLineColor(2);
6665  tail2->Draw("COLZ");
6666  }
6667 
6668  cHB->Update();
6669  cHB->Print("AtaildepthHB.png");
6670  cHB->Clear();
6671 
6674  //************************* ***** sum(Signal+NoSignal) occupancy for HF *****
6675  cout << ">>>>>>>>>>>>>>>>>>>>>>>>sumOccupancyHF " << endl;
6677  cHB->Clear();
6678  cHB->Divide(1, 1);
6679  cHB->cd(1);
6680  if (SummedAmplitudeOccupancyHisto[3]) {
6681  TH1F *ufrew1 = (TH1F *)SummedAmplitudeOccupancyHisto[3]->Clone("ufrew1");
6682  if (SummedAmplitudeOccupancyHisto[3] && NoSignalSummedAmplitudeOccupancyHisto[3])
6683  ufrew1->Add(SummedAmplitudeOccupancyHisto[3], NoSignalSummedAmplitudeOccupancyHisto[3], 1, 1);
6684  ufrew1->GetXaxis()->SetRangeUser(1., maxbins + 1.);
6685  gPad->SetGridx();
6686  ufrew1->SetMarkerStyle(20);
6687  ufrew1->SetMarkerSize(0.8);
6688  ufrew1->GetYaxis()->SetLabelSize(0.04);
6689  ufrew1->SetTitle("HF Occupancy vs LS\b");
6690  ufrew1->SetXTitle("average occupancy per LS HF\b");
6691  ufrew1->SetMarkerColor(4);
6692  ufrew1->SetLineColor(0);
6693  ufrew1->SetMaximum(866.);
6694  ufrew1->SetMinimum(856.);
6695  ufrew1->Draw("Error");
6696  cHB->Update();
6697  cHB->Print("sumOccupancyHF.png");
6698  cHB->Clear();
6699  if (ufrew1)
6700  delete ufrew1;
6701  }
6702 
6710  //====================================================================================================================
6711  cout << ">>>>>>>>>>>>>>>>>>>>>>>> =====================================================================" << endl;
6712 
6713  //=====================================================================================================
6714  cout << ">>>>>>>>>>>>>>>>>>>>>>>> ==================================================" << endl;
6715 
6716  //=====================================================================================
6717  cout << ">>>>>>>>>>>>>>>>>>>>>>>> =================================" << endl;
6718  cout << ">>>>>>>>>>>>>>>>>>>>>>>> =================================" << endl;
6719  cout << ">>>>>>>>>>>>>>>>>>>>>>>> =================================" << endl;
6720  cout << ">>>>>>>>>>>>>>>>>>>>>>>> =================================" << endl;
6721 
6722  cout << ">>>>>>> START NOW CREATING OF HTML PAGES <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << endl;
6723  //======================================================================
6724  // Creating each test kind for each subdet html pages:
6725  std::string raw_class;
6726  int ind = 0;
6727  ofstream htmlFile;
6728  for (int test = 0; test <= 5; test++) { //Test: 0,
6729  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
6730 
6731  // cout<<"Creating each test kind for each subdet html pages: test= "<< test << " sub= " << sub << endl;
6732  if (test == 0) {
6733  if (sub == 1) {
6734  htmlFile.open("HB_CapID.html");
6735  }
6736  if (sub == 2) {
6737  htmlFile.open("HE_CapID.html");
6738  }
6739  if (sub == 3) {
6740  htmlFile.open("HO_CapID.html");
6741  }
6742  if (sub == 4) {
6743  htmlFile.open("HF_CapID.html");
6744  }
6745  }
6746  if (test == 1) {
6747  if (sub == 1) {
6748  htmlFile.open("HB_ADCampl.html");
6749  }
6750  if (sub == 2) {
6751  htmlFile.open("HE_ADCampl.html");
6752  }
6753  if (sub == 3) {
6754  htmlFile.open("HO_ADCampl.html");
6755  }
6756  if (sub == 4) {
6757  htmlFile.open("HF_ADCampl.html");
6758  }
6759  }
6760  if (test == 2) {
6761  if (sub == 1) {
6762  htmlFile.open("HB_Width.html");
6763  }
6764  if (sub == 2) {
6765  htmlFile.open("HE_Width.html");
6766  }
6767  if (sub == 3) {
6768  htmlFile.open("HO_Width.html");
6769  }
6770  if (sub == 4) {
6771  htmlFile.open("HF_Width.html");
6772  }
6773  }
6774  if (test == 3) {
6775  if (sub == 1) {
6776  htmlFile.open("HB_Ratio.html");
6777  }
6778  if (sub == 2) {
6779  htmlFile.open("HE_Ratio.html");
6780  }
6781  if (sub == 3) {
6782  htmlFile.open("HO_Ratio.html");
6783  }
6784  if (sub == 4) {
6785  htmlFile.open("HF_Ratio.html");
6786  }
6787  }
6788  if (test == 4) {
6789  if (sub == 1) {
6790  htmlFile.open("HB_Tmean.html");
6791  }
6792  if (sub == 2) {
6793  htmlFile.open("HE_Tmean.html");
6794  }
6795  if (sub == 3) {
6796  htmlFile.open("HO_Tmean.html");
6797  }
6798  if (sub == 4) {
6799  htmlFile.open("HF_Tmean.html");
6800  }
6801  }
6802  if (test == 5) {
6803  if (sub == 1) {
6804  htmlFile.open("HB_Tmax.html");
6805  }
6806  if (sub == 2) {
6807  htmlFile.open("HE_Tmax.html");
6808  }
6809  if (sub == 3) {
6810  htmlFile.open("HO_Tmax.html");
6811  }
6812  if (sub == 4) {
6813  htmlFile.open("HF_Tmax.html");
6814  }
6815  }
6816 
6817  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
6818  htmlFile << "<head>" << std::endl;
6819  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
6820  htmlFile << "<title> Certification Monitoring Tool </title>" << std::endl;
6821  htmlFile << "<style type=\"text/css\">" << std::endl;
6822  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
6823  << std::endl;
6824  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
6825  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
6826  "text-align: center;}"
6827  << std::endl;
6828  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
6829  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
6830  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
6831  htmlFile << " td.s5 { font-family: arial, arial ce, helvetica; background-color: #00FF00; }" << std::endl;
6832  htmlFile << " td.s6 { font-family: arial, arial ce, helvetica; background-color: #FF0000; }" << std::endl;
6833  htmlFile << "</style>" << std::endl;
6834  htmlFile << "<body>" << std::endl;
6835 
6836  if (test == 0) {
6837  if (sub == 1)
6838  htmlFile << "<h1> Cap ID estimator for HB, RUN = " << runnumber << " </h1>" << std::endl;
6839  if (sub == 2)
6840  htmlFile << "<h1> Cap ID estimator for HE, RUN = " << runnumber << " </h1>" << std::endl;
6841  if (sub == 3)
6842  htmlFile << "<h1> Cap ID estimator for HO, RUN = " << runnumber << " </h1>" << std::endl;
6843  if (sub == 4)
6844  htmlFile << "<h1> Cap ID estimator for HF, RUN = " << runnumber << " </h1>" << std::endl;
6845  }
6846  if (test == 1) {
6847  if (sub == 1)
6848  htmlFile << "<h1> Mean ADC Amplitude estimator for HB, RUN = " << runnumber << " </h1>" << std::endl;
6849  if (sub == 2)
6850  htmlFile << "<h1> Mean ADC Amplitude estimator for HE, RUN = " << runnumber << " </h1>" << std::endl;
6851  if (sub == 3)
6852  htmlFile << "<h1> Mean ADC Amplitude estimator for HO, RUN = " << runnumber << " </h1>" << std::endl;
6853  if (sub == 4)
6854  htmlFile << "<h1> Mean ADC Amplitude estimator for HF, RUN = " << runnumber << " </h1>" << std::endl;
6855  }
6856  if (test == 2) {
6857  if (sub == 1)
6858  htmlFile << "<h1> Width estimator for HB, RUN = " << runnumber << " </h1>" << std::endl;
6859  if (sub == 2)
6860  htmlFile << "<h1> Width estimator for HE, RUN = " << runnumber << " </h1>" << std::endl;
6861  if (sub == 3)
6862  htmlFile << "<h1> Width estimator for HO, RUN = " << runnumber << " </h1>" << std::endl;
6863  if (sub == 4)
6864  htmlFile << "<h1> Width estimator for HF, RUN = " << runnumber << " </h1>" << std::endl;
6865  }
6866  if (test == 3) {
6867  if (sub == 1)
6868  htmlFile << "<h1> Ratio estimator for HB, RUN = " << runnumber << " </h1>" << std::endl;
6869  if (sub == 2)
6870  htmlFile << "<h1> Ratio estimator for HE, RUN = " << runnumber << " </h1>" << std::endl;
6871  if (sub == 3)
6872  htmlFile << "<h1> Ratio estimator for HO, RUN = " << runnumber << " </h1>" << std::endl;
6873  if (sub == 4)
6874  htmlFile << "<h1> Ratio estimator for HF, RUN = " << runnumber << " </h1>" << std::endl;
6875  }
6876  if (test == 4) {
6877  if (sub == 1)
6878  htmlFile << "<h1> Mean bin timing estimator for HB, RUN = " << runnumber << " </h1>" << std::endl;
6879  if (sub == 2)
6880  htmlFile << "<h1> Mean bin timing estimator for HE, RUN = " << runnumber << " </h1>" << std::endl;
6881  if (sub == 3)
6882  htmlFile << "<h1> Mean bin timing estimator for HO, RUN = " << runnumber << " </h1>" << std::endl;
6883  if (sub == 4)
6884  htmlFile << "<h1> Mean bin timing estimator for HF, RUN = " << runnumber << " </h1>" << std::endl;
6885  }
6886  if (test == 5) {
6887  if (sub == 1)
6888  htmlFile << "<h1> Maximum bin timing estimator for HB, RUN = " << runnumber << " </h1>" << std::endl;
6889  if (sub == 2)
6890  htmlFile << "<h1> Maximum bin timing estimator for HE, RUN = " << runnumber << " </h1>" << std::endl;
6891  if (sub == 3)
6892  htmlFile << "<h1> Maximum bin timing estimator for HO, RUN = " << runnumber << " </h1>" << std::endl;
6893  if (sub == 4)
6894  htmlFile << "<h1> Maximum bin timing estimator for HF, RUN = " << runnumber << " </h1>" << std::endl;
6895  }
6896 
6897  if (test == 1) {
6898  htmlFile << "<a name=\"Top\"></a>\n";
6899  htmlFile << "<b>Contents:<br>\n";
6900  htmlFile << "1. <a href=\"#Aij\">A_ij_LS (averaged over events in LS) </a><br>\n";
6901  htmlFile << "2. <a href=\"#OverflowAij\">A_ij_LS in overflow & underflow</a><br>\n";
6902  htmlFile << "3. <a href=\"#MainEstimator\">Main Estimator !!! </a><br>\n";
6903  htmlFile << "4. <a href=\"#ErrorA\">Error type A </a><br>\n";
6904  htmlFile << "5. <a href=\"#ErrorAaverage\">ErrorA cross check</a><br>\n";
6905  htmlFile << "6. <a href=\"#ErrorAoccupancy\">ErrorA occupancy plots</a><br>\n";
6906  htmlFile << "7. <a href=\"#ErrorB\">Error type B</a><br>\n";
6907  htmlFile << "8. <a href=\"#LSstatus\">Table of Average channel-Amplitude in Depthes over LSs </a><br>\n";
6908  htmlFile << "9. <a href=\"#RBXstatus\">RBX Status </a><br>\n";
6909  htmlFile << "10. <a href=\"#RBXPHItable\">Table of Average RBX-Amplitude in Phi over LSs </a><br>\n";
6910  htmlFile << "11. <a href=\"#RBXETAtable\">Table of Average RBX-Amplitude in Eta over LSs </a><br>\n";
6911  htmlFile << "12. <a href=\"#RBX3plots\">RBX A-Ratio to 1st LS: 3 plots </a><br>\n";
6913  }
6914 
6915  // htmlFile << "<a href=\"#Top\">to top</a><br>\n";
6916 
6917  htmlFile << "<br>" << std::endl;
6918  if (test == 0) {
6919  htmlFile << "<h2> 0. Rate of CapID failures over all events of Run </h2>" << std::endl;
6920  htmlFile << "<h3> Channel legend: green - good, other colour - suspicious </h3>" << std::endl;
6921  if (sub == 1)
6922  htmlFile << " <img src=\"MapCapIdErrorHB.png\" />" << std::endl;
6923  if (sub == 2)
6924  htmlFile << " <img src=\"MapCapIdErrorHE.png\" />" << std::endl;
6925  if (sub == 3)
6926  htmlFile << " <img src=\"MapCapIdErrorHO.png\" />" << std::endl;
6927  if (sub == 4)
6928  htmlFile << " <img src=\"MapCapIdErrorHF.png\" />" << std::endl;
6929  }
6930  if (test == 1)
6931  htmlFile << "<a name=\"Aij\"></a>\n";
6932  if (test != 0)
6933  htmlFile << "<h2> 1. Distribution of estimator averaged over events in LS, histogramed over all channels and "
6934  "all LSs </h2>"
6935  << std::endl;
6936  if (test == 0) {
6937  if (sub == 1)
6938  htmlFile << "<h2> 1. Average Nbcs for only LS containing events with abnormal number of Bad channels >"
6939  << CutAb[sub][1] << " (Depth1), " << CutAb[sub][2] << " (Depth2).</h2>" << std::endl;
6940  if (sub == 2)
6941  htmlFile << "<h2> 1. Average Nbcs for only LS containing events with abnormal number of Bad channels >"
6942  << CutAb[sub][1] << " (Depth1), " << CutAb[sub][2] << " (Depth2), " << CutAb[sub][3]
6943  << " (Depth3).</h2>" << std::endl;
6944  if (sub == 3)
6945  htmlFile << "<h2> 1. Average Nbcs for only LS containing events with abnormal number of Bad channels >"
6946  << CutAb[sub][1] << " (Depth4).</h2>" << std::endl;
6947  if (sub == 4)
6948  htmlFile << "<h2> 1. Average Nbcs for only LS containing events with abnormal number of Bad channels >"
6949  << CutAb[sub][1] << " (Depth1), " << CutAb[sub][2] << " (Depth2).</h2>" << std::endl;
6950  }
6951 
6952  if (test != 0)
6953  htmlFile << "<h3> see Overflow and Underflow </h3>" << std::endl;
6954  if (test == 0)
6955  htmlFile << "<h3> Legend: dots correspond to BAD LS candidates.</h3>" << std::endl;
6956 
6957  if (test == 0) {
6958  if (sub == 1)
6959  htmlFile << " <img src=\"Hist_CAPID_Abnorm_HB.png\" />" << std::endl;
6960  if (sub == 2)
6961  htmlFile << " <img src=\"Hist_CAPID_Abnorm_HE.png\" />" << std::endl;
6962  if (sub == 3)
6963  htmlFile << " <img src=\"Hist_CAPID_Abnorm_HO.png\" />" << std::endl;
6964  if (sub == 4)
6965  htmlFile << " <img src=\"Hist_CAPID_Abnorm_HF.png\" />" << std::endl;
6966  }
6967  if (test == 1) {
6968  if (sub == 1)
6969  htmlFile << " <img src=\"H_ADCamplHB.png\" />" << std::endl;
6970  if (sub == 2)
6971  htmlFile << " <img src=\"H_ADCamplHE.png\" />" << std::endl;
6972  if (sub == 3)
6973  htmlFile << " <img src=\"H_ADCamplHO.png\" />" << std::endl;
6974  if (sub == 4)
6975  htmlFile << " <img src=\"H_ADCamplHF.png\" />" << std::endl;
6976  }
6977  if (test == 2) {
6978  if (sub == 1)
6979  htmlFile << " <img src=\"H_WidthHB.png\" />" << std::endl;
6980  if (sub == 2)
6981  htmlFile << " <img src=\"H_WidthHE.png\" />" << std::endl;
6982  if (sub == 3)
6983  htmlFile << " <img src=\"H_WidthHO.png\" />" << std::endl;
6984  if (sub == 4)
6985  htmlFile << " <img src=\"H_WidthHF.png\" />" << std::endl;
6986  }
6987  if (test == 3) {
6988  if (sub == 1)
6989  htmlFile << " <img src=\"H_RatioHB.png\" />" << std::endl;
6990  if (sub == 2)
6991  htmlFile << " <img src=\"H_RatioHE.png\" />" << std::endl;
6992  if (sub == 3)
6993  htmlFile << " <img src=\"H_RatioHO.png\" />" << std::endl;
6994  if (sub == 4)
6995  htmlFile << " <img src=\"H_RatioHF.png\" />" << std::endl;
6996  }
6997  if (test == 4) {
6998  if (sub == 1)
6999  htmlFile << " <img src=\"H_TmeanHB.png\" />" << std::endl;
7000  if (sub == 2)
7001  htmlFile << " <img src=\"H_TmeanHE.png\" />" << std::endl;
7002  if (sub == 3)
7003  htmlFile << " <img src=\"H_TmeanHO.png\" />" << std::endl;
7004  if (sub == 4)
7005  htmlFile << " <img src=\"H_TmeanHF.png\" />" << std::endl;
7006  }
7007  if (test == 5) {
7008  if (sub == 1)
7009  htmlFile << " <img src=\"H_TmaxHB.png\" />" << std::endl;
7010  if (sub == 2)
7011  htmlFile << " <img src=\"H_TmaxHE.png\" />" << std::endl;
7012  if (sub == 3)
7013  htmlFile << " <img src=\"H_TmaxHO.png\" />" << std::endl;
7014  if (sub == 4)
7015  htmlFile << " <img src=\"H_TmaxHF.png\" />" << std::endl;
7016  }
7017  htmlFile << "<br>" << std::endl;
7018  if (test == 1)
7019  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7020 
7021  if (test == 0)
7022  htmlFile << "<h2> 2a. Number of bad channels per event distribution in Run</h2>" << std::endl;
7023  if (test == 0)
7024  htmlFile << "<h3> Legends: dots correspond to BAD LS candidates. </h3>" << std::endl;
7025  if (test == 0) {
7026  if (sub == 1)
7027  htmlFile << " <img src=\"HistNBadChsHB.png\" />" << std::endl;
7028  if (sub == 2)
7029  htmlFile << " <img src=\"HistNBadChsHE.png\" />" << std::endl;
7030  if (sub == 3)
7031  htmlFile << " <img src=\"HistNBadChsHO.png\" />" << std::endl;
7032  if (sub == 4)
7033  htmlFile << " <img src=\"HistNBadChsHF.png\" />" << std::endl;
7034  }
7035 
7036  if (test == 1)
7037  htmlFile << "<a name=\"OverflowAij\"></a>\n";
7038  if (test != 0)
7039  htmlFile << "<h2> 2. Estimator averaged over all events in the RUN for entries in overflow and underflow of "
7040  "corresponding histogram above </h2>"
7041  << std::endl;
7042  // if (test !=0) htmlFile << "<h2> 2. Estimator averaged over all events in the RUN </h2>"<< std::endl;
7043  if (test == 0)
7044  htmlFile << "<h2> 2b. Averaged number of bad channels for each LS </h2>" << std::endl;
7045  // if (test !=0) htmlFile << "<h3> Channel legend: white - good, other colour - bad. </h3>"<< std::endl;
7046  if (test == 0) {
7047  if (sub == 1)
7048  htmlFile << "<h3> Legends: dots selected with following cuts: <td class=\"s6\" align=\"center\">"
7049  << Cut0[test][sub][1] << " (Depth1), " << Cut0[test][sub][2]
7050  << " (Depth2) correspond BAD LS.</td></h3>" << std::endl;
7051  if (sub == 2)
7052  htmlFile << "<h3> Legends: dots selected with following cuts: " << Cut0[test][sub][1] << " (Depth1), "
7053  << Cut0[test][sub][2] << " (Depth2), " << Cut0[test][sub][3] << " (Depth3) correspond BAD LS.</h3>"
7054  << std::endl;
7055  if (sub == 3)
7056  htmlFile << "<h3> Legends: dots selected with following cuts: " << Cut0[test][sub][4]
7057  << " (Depth4) correspond BAD LS.</h3>" << std::endl;
7058  if (sub == 4)
7059  htmlFile << "<h3> Legends: dots selected with following cuts: " << Cut0[test][sub][1] << " (Depth1), "
7060  << Cut0[test][sub][2] << " (Depth2) correspond BAD LS.</h3>" << std::endl;
7061  }
7062  if (test == 0) {
7063  if (sub == 1)
7064  htmlFile << " <img src=\"HistNBCMNHB.png\" />" << std::endl;
7065  if (sub == 2)
7066  htmlFile << " <img src=\"HistNBCMNHE.png\" />" << std::endl;
7067  if (sub == 3)
7068  htmlFile << " <img src=\"HistNBCMNHO.png\" />" << std::endl;
7069  if (sub == 4)
7070  htmlFile << " <img src=\"HistNBCMNHF.png\" />" << std::endl;
7071  }
7072  if (test == 1) {
7073  if (sub == 1)
7074  htmlFile << " <img src=\"MapADCamplHB.png\" />" << std::endl;
7075  if (sub == 2)
7076  htmlFile << " <img src=\"MapADCamplHE.png\" />" << std::endl;
7077  if (sub == 3)
7078  htmlFile << " <img src=\"MapADCamplHO.png\" />" << std::endl;
7079  if (sub == 4)
7080  htmlFile << " <img src=\"MapADCamplHF.png\" />" << std::endl;
7081  }
7082  if (test == 2) {
7083  if (sub == 1)
7084  htmlFile << " <img src=\"MapWidthHB.png\" />" << std::endl;
7085  if (sub == 2)
7086  htmlFile << " <img src=\"MapWidthHE.png\" />" << std::endl;
7087  if (sub == 3)
7088  htmlFile << " <img src=\"MapWidthHO.png\" />" << std::endl;
7089  if (sub == 4)
7090  htmlFile << " <img src=\"MapWidthHF.png\" />" << std::endl;
7091  }
7092  if (test == 3) {
7093  if (sub == 1)
7094  htmlFile << " <img src=\"MapRatioHB.png\" />" << std::endl;
7095  if (sub == 2)
7096  htmlFile << " <img src=\"MapRatioHE.png\" />" << std::endl;
7097  if (sub == 3)
7098  htmlFile << " <img src=\"MapRatioHO.png\" />" << std::endl;
7099  if (sub == 4)
7100  htmlFile << " <img src=\"MapRatioHF.png\" />" << std::endl;
7101  }
7102  if (test == 4) {
7103  if (sub == 1)
7104  htmlFile << " <img src=\"MapTmeanHB.png\" />" << std::endl;
7105  if (sub == 2)
7106  htmlFile << " <img src=\"MapTmeanHE.png\" />" << std::endl;
7107  if (sub == 3)
7108  htmlFile << " <img src=\"MapTmeanHO.png\" />" << std::endl;
7109  if (sub == 4)
7110  htmlFile << " <img src=\"MapTmeanHF.png\" />" << std::endl;
7111  }
7112  if (test == 5) {
7113  if (sub == 1)
7114  htmlFile << " <img src=\"MapTmaxHB.png\" />" << std::endl;
7115  if (sub == 2)
7116  htmlFile << " <img src=\"MapTmaxHE.png\" />" << std::endl;
7117  if (sub == 3)
7118  htmlFile << " <img src=\"MapTmaxHO.png\" />" << std::endl;
7119  if (sub == 4)
7120  htmlFile << " <img src=\"MapTmaxHF.png\" />" << std::endl;
7121  }
7122  htmlFile << "<br>" << std::endl;
7123  if (test == 1)
7124  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7125 
7126  if (test == 1)
7127  htmlFile << "<a name=\"MainEstimator\"></a>\n";
7128  if (test != 0)
7129  htmlFile
7130  << "<h2> 3. Distribution of estimator averaged over events in LS and over all channels for each LS </h2>"
7131  << std::endl;
7132  if (test == 0) {
7133  if (sub == 1)
7134  htmlFile << "<h2> 3. Portion of events with Nbcs>" << CutPo[sub][1] << " (Depth1), " << CutPo[sub][2]
7135  << " (Depth2) in each LS.</h2>" << std::endl;
7136  if (sub == 2)
7137  htmlFile << "<h2> 3. Portion of events with Nbcs>" << CutPo[sub][1] << " (Depth1), " << CutPo[sub][2]
7138  << " (Depth2), " << CutPo[sub][3] << " (Depth3) in each LS.</h2>" << std::endl;
7139  if (sub == 3)
7140  htmlFile << "<h2> 3. Portion of events with Nbcs>" << CutPo[sub][4] << " (Depth4) in each LS.</h2>"
7141  << std::endl;
7142  if (sub == 4)
7143  htmlFile << "<h2> 3. Portion of events with Nbcs>" << CutPo[sub][1] << " (Depth1), " << CutPo[sub][2]
7144  << " (Depth2) in each LS.</h2>" << std::endl;
7145  htmlFile << "<h3> Legend: dots correspond to BAD LS candidates.</h3>" << std::endl;
7146  }
7147  if (test != 0) {
7148  if (sub == 1)
7149  htmlFile << "<h3> Legends: dots selected with following cuts: <td class=\"s6\" align=\"center\">"
7150  << Cut0[test][sub][1] << " (Depth1), " << Cut0[test][sub][2]
7151  << " (Depth2) correspond BAD LS.</td></h3>" << std::endl;
7152  if (sub == 2)
7153  htmlFile << "<h3> Legends: dots selected with following cuts: " << Cut0[test][sub][1] << " (Depth1), "
7154  << Cut0[test][sub][2] << " (Depth2), " << Cut0[test][sub][3] << " (Depth3), " << Cut0[test][sub][4]
7155  << " (Depth4), " << Cut0[test][sub][5] << " (Depth5), " << Cut0[test][sub][6] << " (Depth6), "
7156  << Cut0[test][sub][7] << " (Depth7) correspond BAD LS. </h3>" << std::endl;
7157  if (sub == 3)
7158  htmlFile << "<h3> Legends: dots selected with following cuts: " << Cut0[test][sub][4]
7159  << " (Depth4) correspond BAD LS. </h3>" << std::endl;
7160  if (sub == 4)
7161  htmlFile << "<h3> Legends: dots selected with following cuts: " << Cut0[test][sub][1] << " (Depth1), "
7162  << Cut0[test][sub][2] << " (Depth2), " << Cut0[test][sub][3] << " (Depth3), " << Cut0[test][sub][4]
7163  << " (Depth4) correspond BAD LS. </h3>" << std::endl;
7164  }
7165  if (test == 0) {
7166  if (sub == 1)
7167  htmlFile << " <img src=\"HistPortHB.png\" />" << std::endl;
7168  if (sub == 2)
7169  htmlFile << " <img src=\"HistPortHE.png\" />" << std::endl;
7170  if (sub == 3)
7171  htmlFile << " <img src=\"HistPortHO.png\" />" << std::endl;
7172  if (sub == 4)
7173  htmlFile << " <img src=\"HistPortHF.png\" />" << std::endl;
7174  }
7175  if (test == 1) {
7176  if (sub == 1)
7177  htmlFile << " <img src=\"HistADCamplHB.png\" />" << std::endl;
7178  if (sub == 2)
7179  htmlFile << " <img src=\"HistADCamplHE.png\" />" << std::endl;
7180  if (sub == 3)
7181  htmlFile << " <img src=\"HistADCamplHO.png\" />" << std::endl;
7182  if (sub == 4)
7183  htmlFile << " <img src=\"HistADCamplHF.png\" />" << std::endl;
7184  }
7185  if (test == 2) {
7186  if (sub == 1)
7187  htmlFile << " <img src=\"HistWidthHB.png\" />" << std::endl;
7188  if (sub == 2)
7189  htmlFile << " <img src=\"HistWidthHE.png\" />" << std::endl;
7190  if (sub == 3)
7191  htmlFile << " <img src=\"HistWidthHO.png\" />" << std::endl;
7192  if (sub == 4)
7193  htmlFile << " <img src=\"HistWidthHF.png\" />" << std::endl;
7194  }
7195  if (test == 3) {
7196  if (sub == 1)
7197  htmlFile << " <img src=\"HistRatioHB.png\" />" << std::endl;
7198  if (sub == 2)
7199  htmlFile << " <img src=\"HistRatioHE.png\" />" << std::endl;
7200  if (sub == 3)
7201  htmlFile << " <img src=\"HistRatioHO.png\" />" << std::endl;
7202  if (sub == 4)
7203  htmlFile << " <img src=\"HistRatioHF.png\" />" << std::endl;
7204  }
7205  if (test == 4) {
7206  if (sub == 1)
7207  htmlFile << " <img src=\"HistTmeanHB.png\" />" << std::endl;
7208  if (sub == 2)
7209  htmlFile << " <img src=\"HistTmeanHE.png\" />" << std::endl;
7210  if (sub == 3)
7211  htmlFile << " <img src=\"HistTmeanHO.png\" />" << std::endl;
7212  if (sub == 4)
7213  htmlFile << " <img src=\"HistTmeanHF.png\" />" << std::endl;
7214  }
7215  if (test == 5) {
7216  if (sub == 1)
7217  htmlFile << " <img src=\"HistTmaxHB.png\" />" << std::endl;
7218  if (sub == 2)
7219  htmlFile << " <img src=\"HistTmaxHE.png\" />" << std::endl;
7220  if (sub == 3)
7221  htmlFile << " <img src=\"HistTmaxHO.png\" />" << std::endl;
7222  if (sub == 4)
7223  htmlFile << " <img src=\"HistTmaxHF.png\" />" << std::endl;
7224  }
7225  htmlFile << "<br>" << std::endl;
7226 
7227  if (test == 1) {
7228  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7229  htmlFile << "<a name=\"ErrorA\"></a>\n";
7230  htmlFile << "<h2> 4. Error type A</h2>\n";
7231  htmlFile << "<h3> note: no sence to see plots of this item if max difference is too large(due to very high A "
7232  "of some channels)</h3>\n";
7233  htmlFile << "<br>\n";
7234 
7235  //HB:
7236  if (sub == 1) {
7237  htmlFile << "<h3>Mean of max difference between dependencies to be within: 0.1-1.6 (p-p collisions) </h3>\n";
7238  htmlFile << " <img src=\"HistErrA_HB.png\" />\n";
7239  htmlFile << "<br>\n";
7240  if (flagErrAB_HB[0] == -1)
7241  htmlFile << "<h3>test was not possible</h3>\n";
7242  else if (flagErrAB_HB[0] == 0)
7243  htmlFile << "<h3> Fine:NoErrorA_HB (Mean of max difference " << avedelta_HB
7244  << " is within 0.1-1.6) </h3>\n";
7245  else if (flagErrAB_HB[0] == 1)
7246  htmlFile << "<<h3> ErrorA_HB is available once Mean of max difference " << avedelta_HB
7247  << " is out 0.1-1.6 (p-p collisions)</font></h3>\n";
7248  else
7249  htmlFile << "<h3>auto-interpretation is not available</h3>\n";
7250  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7251 
7252  htmlFile << "<a name=\"ErrorAaverage\"></a>\n";
7253 
7254  htmlFile << "<h2> 5. Error type A cross check: see 2D pattern of channels </h2>\n";
7255  htmlFile << "<h2> 1) with average channel Amplitudes(No cut), 2) with average channel Amplitudes(<A> >25), "
7256  "3) with channel Amplitude (A<35); </h2>\n";
7257  htmlFile << " <img src=\"ChkErrA_HB1.png\" /><br><br>\n";
7258  htmlFile << " <img src=\"ChkErrA_HB2.png\" /><br>\n";
7259  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7260 
7261  htmlFile << "<a name=\"ErrorAoccupancy\"></a>\n";
7262  htmlFile << "<h2> 6. Error type A: min/ave ratio for occupancy distributions with Amplitude bigger 25 "
7263  "(HBM:neg.eta;HBP:pos.eta) </h2>\n";
7264  htmlFile << "<h2> FOR CROSS-CHECK OLNY !!!</h2>\n";
7265  htmlFile << "<h2> TO IDENTIFY A-type errors: for most of LSs the ratio to be lower 0.6 at least for HF- or "
7266  "HF+ </h2>\n";
7267  htmlFile << "<h2> For runs without A-type errors: for most of LSs the ratio is higher 0.6 and is the same "
7268  "for HF- and HF+ </h2>\n";
7269  htmlFile << " <img src=\"OccPlots_HB.png\" /><br><br>\n";
7270  htmlFile << "<br>\n";
7271  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7272 
7273  htmlFile << "<a name=\"ErrorB\"></a>\n";
7274  htmlFile << "<h2> 7. Error type B\n";
7275  htmlFile << "<h3> ErrorB identification: digi-collection size != 10.</h3>\n";
7276  htmlFile << " <img src=\"HistErrB_HB_1.png\" />\n<br>\n";
7277  htmlFile << " <img src=\"HistErrB_HB_2.png\" />\n<br>\n";
7278  htmlFile << "<br>\n";
7279  htmlFile << "<h3> if Error type B is available, it start from: " << LSofFirstErrB_HB << " LS </h3>\n";
7280  htmlFile << "<br>\n";
7281  }
7282 
7283  //HE:
7284  if (sub == 2) {
7285  htmlFile << "<h3>Mean of max difference between dependencies to be within: 0.2-1.8 (p-p collisions) </h3>\n";
7286  htmlFile << " <img src=\"HistErrA_HE.png\" />\n";
7287  htmlFile << "<br>\n";
7288  if (flagErrAB_HE[0] == -1)
7289  htmlFile << "<h3>test was not possible</h3>\n";
7290  else if (flagErrAB_HE[0] == 0)
7291  htmlFile << "<h3> Fine:NoErrorA_HE (Mean of max difference " << avedelta_HE
7292  << " is within 0.2-1.8) </h3>\n";
7293  else if (flagErrAB_HE[0] == 1)
7294  htmlFile << "<<h3> ErrorA_HE is available once Mean of max difference " << avedelta_HE
7295  << " is out 0.2-1.8 (p-p collisions)</font></h3>\n";
7296  else
7297  htmlFile << "<h3>auto-interpretation is not available</h3>\n";
7298  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7299 
7300  htmlFile << "<a name=\"ErrorAaverage\"></a>\n";
7301 
7302  htmlFile << "<h2> 5. Error type A cross check: see 2D pattern of channels </h2>\n";
7303  htmlFile << "<h2> 1) with average channel Amplitudes(No cut), 2) with average channel Amplitudes(<A> "
7304  ">1000.fC), 3) with channel Amplitude (A<500fC); </h2>\n";
7305  htmlFile << " <img src=\"ChkErrA_HE1.png\" /><br><br>\n";
7306  htmlFile << " <img src=\"ChkErrA_HE2.png\" /><br>\n";
7307  htmlFile << " <img src=\"ChkErrA_HE3.png\" /><br>\n";
7308  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7309 
7310  htmlFile << "<a name=\"ErrorAoccupancy\"></a>\n";
7311  htmlFile << "<h2> 6. Error type A: min/ave ratio for occupancy distributions with Amplitude bigger 35 "
7312  "(HEM:neg.eta;HEP:pos.eta) </h2>\n";
7313  htmlFile << "<h2> FOR CROSS-CHECK OLNY !!!</h2>\n";
7314  htmlFile << "<h2> TO IDENTIFY A-type errors: for most of LSs the ratio to be lower 0.3 at least for HF- or "
7315  "HF+ </h2>\n";
7316  htmlFile << "<h2> For runs without A-type errors: for most of LSs the ratio is higher 0.3 and is the same "
7317  "for HF- and HF+ </h2>\n";
7318  htmlFile << " <img src=\"OccPlots_HE.png\" /><br><br>\n";
7319  htmlFile << "<br>\n";
7320  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7321 
7322  htmlFile << "<a name=\"ErrorB\"></a>\n";
7323  htmlFile << "<h2> 7. Error type B\n";
7324  htmlFile << "<h3> ErrorB identification: digi-collection size != 8.</h3>\n";
7325  htmlFile << " <img src=\"HistErrB_HE_1.png\" />\n<br>\n";
7326  htmlFile << " <img src=\"HistErrB_HE_2.png\" />\n<br>\n";
7327  htmlFile << " <img src=\"HistErrB_HE_3.png\" />\n<br>\n";
7328  htmlFile << "<br>\n";
7329  htmlFile << "<h3> if Error type B is available, it start from: " << LSofFirstErrB_HE << " LS </h3>\n";
7330  htmlFile << "<br>\n";
7331  }
7332 
7333  //HO:
7334  if (sub == 3) {
7335  htmlFile << "<h3>Mean of max difference between dependencies to be within: 0.1-1.5 (p-p collisions) </h3>\n";
7336  htmlFile << " <img src=\"HistErrA_HO.png\" />\n";
7337  htmlFile << "<br>\n";
7338  if (flagErrAB_HO[0] == -1)
7339  htmlFile << "<h3>test was not possible</h3>\n";
7340  else if (flagErrAB_HO[0] == 0)
7341  htmlFile << "<h3> Fine:NoErrorA_HO (Mean of max difference " << avedelta_HO
7342  << " is within 0.1-1.5) </h3>\n";
7343  else if (flagErrAB_HO[0] == 1)
7344  htmlFile << "<<h3> ErrorA_HO is available once Mean of max difference " << avedelta_HO
7345  << " is out 0.1-1.5 (p-p collisions)</font></h3>\n";
7346  else
7347  htmlFile << "<h3>auto-interpretation is not available</h3>\n";
7348  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7349 
7350  htmlFile << "<a name=\"ErrorAaverage\"></a>\n";
7351 
7352  htmlFile << "<h2> 5. Error type A cross check: see 2D pattern of channels </h2>\n";
7353  htmlFile << "<h2> 1) with average channel Amplitudes(No cut), 2) with average channel Amplitudes(<A> >80), "
7354  "3) with channel Amplitude (A<100); </h2>\n";
7355  // htmlFile << "<h2> 2D. Cross check for error A</h2>\n";
7356  htmlFile << " <img src=\"ChkErrA_HO4.png\" /><br><br>\n";
7357  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7358 
7359  htmlFile << "<a name=\"ErrorAoccupancy\"></a>\n";
7360  htmlFile << "<h2> 6. Error type A: min/ave ratio for occupancy distributions with Amplitude bigger 80 "
7361  "(HOM:neg.eta;HOP:pos.eta) </h2>\n";
7362  htmlFile << "<h2> FOR CROSS-CHECK OLNY !!!</h2>\n";
7363  htmlFile << "<h2> TO IDENTIFY A-type errors: for most of LSs the ratio to be lower 0.8 at least for HF- or "
7364  "HF+ </h2>\n";
7365  htmlFile << "<h2> For runs without A-type errors: for most of LSs the ratio is higher 0.8 and is the same "
7366  "for HF- and HF+ </h2>\n";
7367  htmlFile << " <img src=\"OccPlots_HO.png\" /><br><br>\n";
7368  htmlFile << "<br>\n";
7369  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7370 
7371  htmlFile << "<a name=\"ErrorB\"></a>\n";
7372  htmlFile << "<h2> 7. Error type B\n";
7373  htmlFile << "<h3> ErrorB identification: digi-collection size != 10. </h3>\n";
7374  htmlFile << " <img src=\"HistErrB_HO_4.png\" />\n<br>\n";
7375  htmlFile << "<br>\n";
7376  htmlFile << "<h3> if Error type B is available, it start from: " << LSofFirstErrB_HO << " LS </h3>\n";
7377  htmlFile << "<br>\n";
7378  }
7379 
7380  //HF:
7381  if (sub == 4) {
7382  // flagSpecHF+=1;
7383  htmlFile << "<h3>Mean of max difference between dependencies to be within: 0.8-2.4 (p-p collisions) </h3>\n";
7384  htmlFile << " <img src=\"HistErrA_HF.png\" />\n";
7385  htmlFile << "<br>\n";
7386  if (flagErrAB_HF[0] == -1)
7387  htmlFile << "<h3>test was not possible</h3>\n";
7388  else if (flagErrAB_HF[0] == 0)
7389  htmlFile << "<h3> Fine:NoErrorA_HF (Mean of max difference " << avedelta_HF
7390  << " is within 0.8-2.4) </h3>\n";
7391  else if (flagErrAB_HF[0] == 1)
7392  htmlFile << "<<h3> ErrorA_HF is available once Mean of max difference " << avedelta_HF
7393  << " is out 0.8-2.4 (p-p collisions)</font></h3>\n";
7394  else
7395  htmlFile << "<h3>auto-interpretation is not available</h3>\n";
7396  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7397 
7398  htmlFile << "<a name=\"ErrorAaverage\"></a>\n";
7399 
7400  htmlFile << "<h2> 5. Error type A cross check: see 2D pattern of channels </h2>\n";
7401  htmlFile << "<h2> 1) with average channel Amplitudes(No cut), 2) with average channel Amplitudes(<A> >20), "
7402  "3) with channel Amplitude (A<20); </h2>\n";
7403  // htmlFile << "<h2> 2D. Cross check for error A</h2>\n";
7404  htmlFile << " <img src=\"ChkErrA_HF1.png\" /><br><br>\n";
7405  htmlFile << " <img src=\"ChkErrA_HF2.png\" /><br>\n";
7406  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7407 
7408  htmlFile << "<a name=\"ErrorAoccupancy\"></a>\n";
7409  htmlFile << "<h2> 6. Error type A: min/ave ratio for occupancy distributions with Amplitude bigger 20 "
7410  "(HFM:neg.eta;HFP:pos.eta) </h2>\n";
7411  htmlFile << "<h2> FOR CROSS-CHECK OLNY !!!</h2>\n";
7412  htmlFile << "<h2> TO IDENTIFY A-type errors: for most of LSs the ratio to be lower 0.8 at least for HF- or "
7413  "HF+ </h2>\n";
7414  htmlFile << "<h2> For runs without A-type errors: for most of LSs the ratio is higher 0.8 and is the same "
7415  "for HF- and HF+ </h2>\n";
7416  htmlFile << " <img src=\"OccPlots_HF.png\" /><br><br>\n";
7417  htmlFile << "<br>\n";
7418  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7419 
7420  htmlFile << "<a name=\"ErrorB\"></a>\n";
7421  htmlFile << "<h2> 7. Error type B\n";
7422  htmlFile << "<h3> ErrorB identification: digi-collection size != 4. </h3>\n";
7423  htmlFile << " <img src=\"HistErrB_HF_1.png\" />\n<br>\n";
7424  htmlFile << " <img src=\"HistErrB_HF_2.png\" />\n<br>\n";
7425  htmlFile << "<br>\n";
7426  htmlFile << "<h3> if Error type B is available, it start from: " << LSofFirstErrB_HF << " LS </h3>\n";
7427  htmlFile << "<br>\n";
7428  }
7429  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7430 
7431  } //test=1 Amplitude
7432 
7433  if (test == 1)
7434  htmlFile << "<a name=\"LSstatus\"></a>\n";
7435  // Continue with common sections
7436  if (sub == 1) {
7437  htmlFile << "<h2> 8.Lumisection Status for HB: </h2>" << std::endl;
7438  // htmlFile << "<h3> Legends: Red boxes correspond BAD LS selected with following cuts: <td class=\"s6\" align=\"center\">"<<Cut0[test][sub][1]<<" (Depth1), "<<Cut0[test][sub][2]<<" (Depth2). </td></h3>"<< std::endl;
7439  htmlFile << "<h3> Legends: Red boxes correspond BAD LS selected with following cuts: " << Cut0[test][sub][1]
7440  << " (Depth1), " << Cut0[test][sub][2] << " (Depth2), " << Cut0[test][sub][3] << " (Depth3), "
7441  << Cut0[test][sub][4] << " (Depth4), </h3>" << std::endl;
7442  }
7443  if (sub == 2) {
7444  htmlFile << "<h2> 8.Lumisection Status for HE: </h2>" << std::endl;
7445  htmlFile << "<h3> Legends: Red boxes correspond BAD LS selected with following cuts: " << Cut0[test][sub][1]
7446  << " (Depth1), " << Cut0[test][sub][2] << " (Depth2), " << Cut0[test][sub][3] << " (Depth3),"
7447  << Cut0[test][sub][4] << " (Depth4)," << Cut0[test][sub][5] << " (Depth5)," << Cut0[test][sub][6]
7448  << " (Depth6)," << Cut0[test][sub][7] << " (Depth7). </h3>" << std::endl;
7449  }
7450  if (sub == 3) {
7451  // htmlFile << Form("<h2> %d.Lumisection Status for HO </h2>",4+flagSpecHF)<< std::endl;
7452  htmlFile << "<h2> 8.Lumisection Status for HO: </h2>" << std::endl;
7453  htmlFile << "<h3> Legends: Red boxes correspond BAD LS selected with following cuts: " << Cut0[test][sub][4]
7454  << " (Depth4). </h3>" << std::endl;
7455  }
7456  if (sub == 4) {
7457  htmlFile << "<h2> 8.Lumisection Status for HF: </h2>" << std::endl;
7458  htmlFile << "<h3> Legends: Red boxes correspond BAD LS selected with following cuts: " << Cut0[test][sub][1]
7459  << " (Depth1), " << Cut0[test][sub][2] << " (Depth2), " << Cut0[test][sub][3] << " (Depth3), "
7460  << Cut0[test][sub][4] << " (Depth4), </h3>" << std::endl;
7461  }
7462  htmlFile << "<br>" << std::endl;
7463  htmlFile << "<table>" << std::endl;
7464  htmlFile << "<tr>";
7465  htmlFile << "<td class=\"s4\" align=\"center\">LS</td>" << std::endl;
7466  // htmlFile << "<td class=\"s1\" align=\"center\">LS</td>" << std::endl;
7467  htmlFile << "<td class=\"s1\" align=\"center\">Number of events</td>" << std::endl;
7469 
7470  int kkkkkkmax = k_max[sub];
7471  if ((sub == 4 || sub == 2 || sub == 1) && test == 1)
7472  kkkkkkmax = k_maxupgrade[sub];
7473  // if ( (sub==4 || sub==2) && test==1) kkkkkkmax = k_maxupgrade[sub];
7474  // if (test==1 && sub==4) kkkkkkmax = k_maxupgrade[sub];
7475 
7476  if (test == 0)
7477  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
7478  htmlFile << "<td class=\"s1\" align=\"center\">< Nbcs > Depth " << k << " </td>" << std::endl;
7479  if (test == 1)
7480  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
7481  htmlFile << "<td class=\"s1\" align=\"center\">< A > Depth " << k << " </td>" << std::endl;
7482  if (test == 2)
7483  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
7484  htmlFile << "<td class=\"s1\" align=\"center\">< W > Depth " << k << " </td>" << std::endl;
7485  if (test == 3)
7486  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
7487  htmlFile << "<td class=\"s1\" align=\"center\">< R > Depth " << k << " </td>" << std::endl;
7488  if (test == 4)
7489  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
7490  htmlFile << "<td class=\"s1\" align=\"center\">< TSn > Depth " << k << " </td>" << std::endl;
7491  if (test == 5)
7492  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
7493  htmlFile << "<td class=\"s1\" align=\"center\">< TSx > Depth " << k << " </td>" << std::endl;
7494  htmlFile << "</tr>" << std::endl;
7495 
7496  ind = 0;
7497  for (int i = 1; i <= MaxLum; i++) {
7498  if ((ind % 2) == 1)
7499  raw_class = "<td class=\"s2\" align=\"center\">";
7500  else
7501  raw_class = "<td class=\"s3\" align=\"center\">";
7502  htmlFile << "<tr>" << std::endl;
7503  htmlFile << "<td class=\"s4\" align=\"center\">" << i << "</td>" << std::endl;
7504  // htmlFile << raw_class<< LumLum->GetBinContent(i)<<"</td>"<< std::endl;
7505  htmlFile << raw_class << LumiEv->GetBinContent(i) << "</td>" << std::endl;
7506  for (int k = k_min[sub]; k <= kkkkkkmax; k++) {
7507  if (HistNumBadChanDepth[test][sub][k]->GetBinContent(i) > Cut0[test][sub][k]) {
7508  if (test == 1)
7509  htmlFile << "<td class=\"s6\" align=\"center\">"
7510  << int(HistNumBadChanDepth[test][sub][k]->GetBinContent(i)) << "</td>" << std::endl;
7511  else
7512  htmlFile << "<td class=\"s6\" align=\"center\">" << (HistNumBadChanDepth[test][sub][k]->GetBinContent(i))
7513  << "</td>" << std::endl;
7514  } else {
7515  if (test == 1)
7516  htmlFile << raw_class << int(HistNumBadChanDepth[test][sub][k]->GetBinContent(i)) << "</td>" << std::endl;
7517  else
7518  htmlFile << raw_class << (HistNumBadChanDepth[test][sub][k]->GetBinContent(i)) << "</td>" << std::endl;
7519  }
7520  }
7521  htmlFile << "</tr>" << std::endl;
7522  ind += 1;
7523  }
7524  htmlFile << "</table>" << std::endl;
7525 
7526  htmlFile << "<br>" << std::endl;
7527  if (test == 1)
7528  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7529  htmlFile << "<br>" << std::endl;
7530 
7531  // Only for Amplitudes (test=1):
7533  if (test == 1) {
7536  htmlFile << "<a name=\"RBXstatus\"></a>\n";
7537 
7538  //HB j = 7,8,9,10 11,12,13,14
7539  if (sub == 1) {
7540  htmlFile << "<h2> 9. Average Amplitudes of RBX for HB: </h2>" << std::endl;
7541  htmlFile << "<h3> where </h3>" << std::endl;
7542  htmlFile << "<h3> jeta = 7,8,9,10 (Negative direction); ............&& ............ jeta = 11,12,13,14 "
7543  "(Positive direction); </h3>"
7544  << std::endl;
7545  htmlFile << "<h3> jphi = 0, 1,..... 16, 17 </h3>" << std::endl;
7546  // htmlFile << "<h3> jphi = 0, 1, 2, 3, 4, 5 (range 1) ............&& ............ jphi = 6, 7, 8, 9,10,11 (range 2) ............&& ............ jphi = 12,13,14,15,16,17 (range 3)</h3>"<< std::endl;
7547  htmlFile << " <img src=\"RBX-HB-2Dplot.png\" />\n";
7548  htmlFile << "<br>\n";
7549 
7550  htmlFile << "<h2> Average Amplitudes of RBX-PHI for HB: </h2>" << std::endl;
7551  htmlFile << " <img src=\"RBX-HB-1Dplot.png\" />\n";
7552  htmlFile << "<br>\n";
7553 
7554  htmlFile << "<h2> Average Amplitudes of RBX-ETA for HB: </h2>" << std::endl;
7555  htmlFile << " <img src=\"RBX-HB-11Dplot.png\" />\n";
7556  htmlFile << "<br>\n";
7557 
7558  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7559  }
7560  // HE: j = 3,4,5, 6, 7 14,15,16,17,18
7561  if (sub == 2) {
7562  htmlFile << "<h2> 9. Averaged Amplitudes of RBX for HE: </h2>" << std::endl;
7563  htmlFile << "<h3> where </h3>" << std::endl;
7564  htmlFile << "<h3> jeta = 3,4,5, 6, 7 (Negative direction); ............&& ............ jeta = "
7565  "14,15,16,17,18 (Positive direction); </h3>"
7566  << std::endl;
7567  htmlFile << "<h3> jphi = 0, 1,..... 16, 17 </h3>" << std::endl;
7568  // htmlFile << "<h3> jphi = 0, 1, 2, 3, 4, 5 (range 1) ............&& ............ jphi = 6, 7, 8, 9,10,11 (range 2) ............&& ............ jphi = 12,13,14,15,16,17 (range 3)</h3>"<< std::endl;
7569  htmlFile << " <img src=\"RBX-HE-2Dplot.png\" />\n";
7570  htmlFile << "<br>\n";
7571 
7572  htmlFile << "<h2> Average Amplitudes of RBX-PHI for HE: </h2>" << std::endl;
7573  htmlFile << " <img src=\"RBX-HE-1Dplot.png\" />\n";
7574  htmlFile << "<br>\n";
7575 
7576  htmlFile << "<h2> Average Amplitudes of RBX-ETA for HE: </h2>" << std::endl;
7577  htmlFile << " <img src=\"RBX-HE-11Dplot.png\" />\n";
7578  htmlFile << "<br>\n";
7579 
7580  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7581  }
7582  // HO: j = 7,8,9,10 11,12,13,14
7583  if (sub == 3) {
7584  htmlFile << "<h2> 9. Averaged Amplitudes of RBX for HO: </h2>" << std::endl;
7585  htmlFile << "<h3> where </h3>" << std::endl;
7586  htmlFile << "<h3> jeta = 7,8,9,10 (Negative direction); ............&& ............ jeta = 11,12,13,14 "
7587  "(Positive direction); </h3>"
7588  << std::endl;
7589  htmlFile << "<h3> jphi = 0, 1,..... 16, 17 </h3>" << std::endl;
7590  // htmlFile << "<h3> jphi = 0, 1, 2, 3, 4, 5 (range 1) ............&& ............ jphi = 6, 7, 8, 9,10,11 (range 2) ............&& ............ jphi = 12,13,14,15,16,17 (range 3)</h3>"<< std::endl;
7591  htmlFile << " <img src=\"RBX-HO-2Dplot.png\" />\n";
7592  htmlFile << "<br>\n";
7593 
7594  htmlFile << "<h2> Average Amplitudes of RBX-PHI for HO: </h2>" << std::endl;
7595  htmlFile << " <img src=\"RBX-HO-1Dplot.png\" />\n";
7596  htmlFile << "<br>\n";
7597 
7598  htmlFile << "<h2> Average Amplitudes of RBX-ETA for HO: </h2>" << std::endl;
7599  htmlFile << " <img src=\"RBX-HO-11Dplot.png\" />\n";
7600  htmlFile << "<br>\n";
7601 
7602  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7603  }
7604  //HF:j = 0,1,2, 3 18,19,20,21
7605  if (sub == 4) {
7606  htmlFile << "<h2> 9. Averaged Amplitudes of RBX for HF: </h2>" << std::endl;
7607  htmlFile << "<h3> where </h3>" << std::endl;
7608  htmlFile << "<h3> jeta = 0,1,2, 3 (Negative direction); ............&& ............ jeta = 18,19,20,21 "
7609  "(Positive direction); </h3>"
7610  << std::endl;
7611  htmlFile << "<h3> jphi = 0, 1,..... 16, 17 </h3>" << std::endl;
7612  // htmlFile << "<h3> jphi = 0, 1, 2, 3, 4, 5 (range 1) ............&& ............ jphi = 6, 7, 8, 9,10,11 (range 2) ............&& ............ jphi = 12,13,14,15,16,17 (range 3)</h3>"<< std::endl;
7613  htmlFile << " <img src=\"RBX-HF-2Dplot.png\" />\n";
7614  htmlFile << "<br>\n";
7615 
7616  htmlFile << "<h2> Average Amplitudes of RBX-PHI for HF: </h2>" << std::endl;
7617  htmlFile << " <img src=\"RBX-HF-1Dplot.png\" />\n";
7618  htmlFile << "<br>\n";
7619 
7620  htmlFile << "<h2> Average Amplitudes of RBX-ETA for HF: </h2>" << std::endl;
7621  htmlFile << " <img src=\"RBX-HF-11Dplot.png\" />\n";
7622  htmlFile << "<br>\n";
7623 
7624  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7625  }
7626  htmlFile << "<br>" << std::endl;
7627 
7630 
7631  htmlFile << "<a name=\"RBXPHItable\"></a>\n";
7632  int cutA_ALL = 0;
7633  // float cutA_HB = 100.;float cutA_HE = 1000000.;float cutA_HO = 150.;float cutA_HF = 500.;
7634  if (sub == 1) {
7635  htmlFile << "<h2> 10. Average RBX-Amplitude in Phi over LSs for HB: </h2>" << std::endl;
7636  htmlFile
7637  << "<h3> Legends: Red boxes correspond BAD LS selected with cut = <td class=\"s6\" align=\"center\">"
7638  << cutA_HB << std::endl;
7639  cutA_ALL = cutA_HB;
7640  }
7641  if (sub == 2) {
7642  htmlFile << "<h2> 10. Average RBX-Amplitude in Phi over LSs for HE: </h2>" << std::endl;
7643  htmlFile
7644  << "<h3> Legends: Red boxes correspond BAD LS selected with cut = <td class=\"s6\" align=\"center\">"
7645  << cutA_HE << std::endl;
7646  cutA_ALL = cutA_HE;
7647  }
7648  if (sub == 3) {
7649  htmlFile << "<h2> 10. Average RBX-Amplitude in Phi over LSs for HO: </h2>" << std::endl;
7650  htmlFile
7651  << "<h3> Legends: Red boxes correspond BAD LS selected with cut = <td class=\"s6\" align=\"center\">"
7652  << cutA_HO << std::endl;
7653  cutA_ALL = cutA_HO;
7654  }
7655  if (sub == 4) {
7656  htmlFile << "<h2> 10. Average RBX-Amplitude in Phi over LSs for HF: </h2>" << std::endl;
7657  htmlFile
7658  << "<h3> Legends: Red boxes correspond BAD LS selected with cut = <td class=\"s6\" align=\"center\">"
7659  << cutA_HF << std::endl;
7660  cutA_ALL = cutA_HF;
7661  }
7662 
7663  htmlFile << "<br>" << std::endl;
7664  htmlFile << "<table>" << std::endl;
7665  htmlFile << "<tr>";
7666  htmlFile << "<td class=\"s4\" align=\"center\">LS</td>" << std::endl;
7667  // htmlFile << "<td class=\"s1\" align=\"center\">LS</td>" << std::endl;
7668  htmlFile << "<td class=\"s1\" align=\"center\">Number of events</td>" << std::endl;
7670 
7671  // k is jphi
7672  for (int k = 0; k < njphi; k++)
7673  htmlFile << "<td class=\"s1\" align=\"center\"> iPHI " << k << " </td>" << std::endl;
7674  htmlFile << "</tr>" << std::endl;
7676 
7677  ind = 0;
7678  // i is LS
7679  for (int i = 1; i <= MaxLum; i++) {
7680  if ((ind % 2) == 1)
7681  raw_class = "<td class=\"s2\" align=\"center\">";
7682  else
7683  raw_class = "<td class=\"s3\" align=\"center\">";
7684  htmlFile << "<tr>" << std::endl;
7685  htmlFile << "<td class=\"s4\" align=\"center\">" << i << "</td>" << std::endl;
7686  // htmlFile << raw_class<< LumLum->GetBinContent(i)<<"</td>"<< std::endl;
7687  htmlFile << raw_class << LumiEv->GetBinContent(i) << "</td>" << std::endl;
7688 
7689  // k is jphi
7690  for (int k = 0; k < njphi; k++) {
7691  if (sub == 1) {
7692  if (int(alexhb[k][i - 1]) > cutA_ALL) {
7693  htmlFile << "<td class=\"s6\" align=\"center\">" << int(alexhb[k][i - 1]) << "</td>" << std::endl;
7694  } else {
7695  htmlFile << raw_class << int(alexhb[k][i - 1]) << "</td>" << std::endl;
7696  }
7697  } // HB end
7698  if (sub == 2) {
7699  if (int(alexhe[k][i - 1]) > cutA_ALL) {
7700  htmlFile << "<td class=\"s6\" align=\"center\">" << int(alexhe[k][i - 1]) << "</td>" << std::endl;
7701  } else {
7702  htmlFile << raw_class << int(alexhe[k][i - 1]) << "</td>" << std::endl;
7703  }
7704  } // HE end
7705  if (sub == 3) {
7706  if (int(alexho[k][i - 1]) > cutA_ALL) {
7707  htmlFile << "<td class=\"s6\" align=\"center\">" << int(alexho[k][i - 1]) << "</td>" << std::endl;
7708  } else {
7709  htmlFile << raw_class << int(alexho[k][i - 1]) << "</td>" << std::endl;
7710  }
7711  } // HO end
7712  if (sub == 4) {
7713  if (int(alexhf[k][i - 1]) > cutA_ALL) {
7714  htmlFile << "<td class=\"s6\" align=\"center\">" << int(alexhf[k][i - 1]) << "</td>" << std::endl;
7715  } else {
7716  htmlFile << raw_class << int(alexhf[k][i - 1]) << "</td>" << std::endl;
7717  }
7718  } // HF end
7720  } // k over PHI-RBX
7721  htmlFile << "</tr>" << std::endl;
7722  ind += 1;
7723  } // i over LSs
7724  htmlFile << "</table>" << std::endl;
7725  htmlFile << "<br>" << std::endl;
7726  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7727  htmlFile << "<br>" << std::endl;
7729 
7730  htmlFile << "<a name=\"RBXETAtable\"></a>\n";
7731  int cutB_ALL = 0;
7732  // float cutB_HB = 100.;float cutB_HE = 1000000.;float cutB_HO = 150.;float cutB_HF = 500.;
7733  if (sub == 1) {
7734  htmlFile << "<h2> 11. Average RBX-Amplitude in Eta over LSs for HB: </h2>" << std::endl;
7735  htmlFile
7736  << "<h3> Legends: Red boxes correspond BAD LS selected with cut = <td class=\"s6\" align=\"center\">"
7737  << cutB_HB << std::endl;
7738  cutB_ALL = cutB_HB;
7739  }
7740  if (sub == 2) {
7741  htmlFile << "<h2> 11. Average RBX-Amplitude in Eta over LSs for HE: </h2>" << std::endl;
7742  htmlFile
7743  << "<h3> Legends: Red boxes correspond BAD LS selected with cut = <td class=\"s6\" align=\"center\">"
7744  << cutB_HE << std::endl;
7745  cutB_ALL = cutB_HE;
7746  }
7747  if (sub == 3) {
7748  htmlFile << "<h2> 11. Average RBX-Amplitude in Eta over LSs for HO: </h2>" << std::endl;
7749  htmlFile
7750  << "<h3> Legends: Red boxes correspond BAD LS selected with cut = <td class=\"s6\" align=\"center\">"
7751  << cutB_HO << std::endl;
7752  cutB_ALL = cutB_HO;
7753  }
7754  if (sub == 4) {
7755  htmlFile << "<h2> 11. Average RBX-Amplitude in Eta over LSs for HF: </h2>" << std::endl;
7756  htmlFile
7757  << "<h3> Legends: Red boxes correspond BAD LS selected with cut = <td class=\"s6\" align=\"center\">"
7758  << cutB_HF << std::endl;
7759  cutB_ALL = cutB_HF;
7760  }
7761 
7762  htmlFile << "<br>" << std::endl;
7763  htmlFile << "<table>" << std::endl;
7764  htmlFile << "<tr>";
7765  htmlFile << "<td class=\"s4\" align=\"center\">LS</td>" << std::endl;
7766  // htmlFile << "<td class=\"s1\" align=\"center\">LS</td>" << std::endl;
7767  htmlFile << "<td class=\"s1\" align=\"center\">Number of events</td>" << std::endl;
7769 
7770  // k is jeta
7771  for (int k = 0; k < njeta; k++)
7772  htmlFile << "<td class=\"s1\" align=\"center\"> iETA " << k << " </td>" << std::endl;
7773  htmlFile << "</tr>" << std::endl;
7775 
7776  ind = 0;
7777  // i is LS
7778  for (int i = 1; i <= MaxLum; i++) {
7779  if ((ind % 2) == 1)
7780  raw_class = "<td class=\"s2\" align=\"center\">";
7781  else
7782  raw_class = "<td class=\"s3\" align=\"center\">";
7783  htmlFile << "<tr>" << std::endl;
7784  htmlFile << "<td class=\"s4\" align=\"center\">" << i << "</td>" << std::endl;
7785  // htmlFile << raw_class<< LumLum->GetBinContent(i)<<"</td>"<< std::endl;
7786  htmlFile << raw_class << LumiEv->GetBinContent(i) << "</td>" << std::endl;
7787 
7788  // k is jeta
7789  for (int k = 0; k < njeta; k++) {
7790  if (sub == 1) {
7791  if (int(blexhb[k][i - 1]) > cutB_ALL) {
7792  htmlFile << "<td class=\"s6\" align=\"center\">" << int(blexhb[k][i - 1]) << "</td>" << std::endl;
7793  } else {
7794  htmlFile << raw_class << int(blexhb[k][i - 1]) << "</td>" << std::endl;
7795  }
7796  } // HB end
7797  if (sub == 2) {
7798  if (int(blexhe[k][i - 1]) > cutB_ALL) {
7799  htmlFile << "<td class=\"s6\" align=\"center\">" << int(blexhe[k][i - 1]) << "</td>" << std::endl;
7800  } else {
7801  htmlFile << raw_class << int(blexhe[k][i - 1]) << "</td>" << std::endl;
7802  }
7803  } // HE end
7804  if (sub == 3) {
7805  if (int(blexho[k][i - 1]) > cutB_ALL) {
7806  htmlFile << "<td class=\"s6\" align=\"center\">" << int(blexho[k][i - 1]) << "</td>" << std::endl;
7807  } else {
7808  htmlFile << raw_class << int(blexho[k][i - 1]) << "</td>" << std::endl;
7809  }
7810  } // HO end
7811  if (sub == 4) {
7812  if (int(blexhf[k][i - 1]) > cutB_ALL) {
7813  htmlFile << "<td class=\"s6\" align=\"center\">" << int(blexhf[k][i - 1]) << "</td>" << std::endl;
7814  } else {
7815  htmlFile << raw_class << int(blexhf[k][i - 1]) << "</td>" << std::endl;
7816  }
7817  } // HF end
7819  } // k over ETA-RBX
7820  htmlFile << "</tr>" << std::endl;
7821  ind += 1;
7822  } // i over LSs
7823  htmlFile << "</table>" << std::endl;
7824  htmlFile << "<br>" << std::endl;
7825  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7826  htmlFile << "<br>" << std::endl;
7828 
7831  htmlFile << "<a name=\"RBX3plots\"></a>\n";
7832  htmlFile << "<br>\n";
7833  htmlFile << "<h2> 12. (Rij) - RBX-amplitudes normilized on reference LS (~=1st) </h2>" << std::endl;
7834  htmlFile << "<h3> ( Rji . . is ratio of . . . . A_j_i . . to . . A_j_ref . . . . for . . j-RBX . . and . . "
7835  "i-LS . ) </h3>"
7836  << std::endl;
7837 
7838  htmlFile << "<br>\n";
7839  htmlFile << "<h2> . . . . . . . . . . . . . . 1) . average Ri vs iLS:. . . . . . . . . . . . . . . . . . . . . "
7840  ". . 2) . average Rj shown for Rij outside meanValue range either 0.95-1.05 or 3RMS: . . . . . . . "
7841  ". . . . . . . . . . . . . . . . . . 3) . Rij: </h2>"
7842  << std::endl;
7843  htmlFile << "<br>\n";
7844  if (sub == 1) {
7845  htmlFile << " <img src=\"RBX-HB-3plots.png\" />\n";
7846  }
7847  if (sub == 2) {
7848  htmlFile << " <img src=\"RBX-HE-3plots.png\" />\n";
7849  }
7850  if (sub == 3) {
7851  htmlFile << " <img src=\"RBX-HO-3plots.png\" />\n";
7852  }
7853  if (sub == 4) {
7854  htmlFile << " <img src=\"RBX-HF-3plots.png\" />\n";
7855  }
7856  htmlFile << "<br>\n";
7857 
7858  htmlFile << "<br>\n";
7859  htmlFile << "<h2> . 4). average Rj shown for Rij outside meanValue range 0.80-1.20: . . . . . . . .5) . "
7860  "average Rj shown for Rij outside meanValue range 0.70-1.30: . . . . . . . .6). average Rj shown "
7861  "for Rij outside meanValue range 0.60-1.40: </h2>"
7862  << std::endl;
7863  htmlFile << "<br>\n";
7864  if (sub == 1) {
7865  htmlFile << " <img src=\"RBX-HB-3plotsmore.png\" />\n";
7866  }
7867  if (sub == 2) {
7868  htmlFile << " <img src=\"RBX-HE-3plotsmore.png\" />\n";
7869  }
7870  if (sub == 3) {
7871  htmlFile << " <img src=\"RBX-HO-3plotsmore.png\" />\n";
7872  }
7873  if (sub == 4) {
7874  htmlFile << " <img src=\"RBX-HF-3plotsmore.png\" />\n";
7875  }
7876  htmlFile << "<br>\n";
7877 
7878  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7879 
7880  //=========================================================
7881 
7882  } // test=1
7883 
7884  //===============================================================================
7885 
7886  htmlFile.close();
7887  } // sub main loop
7888  } //test main loop
7889  //===============================================================================
7890  //===============================================================================
7891  //===============================================================================
7892  //===============================================================================
7893  //===============================================================================
7894 
7895  //======================================================================
7896  // Creating tests html pages:
7897 
7898  for (int test = 0; test <= 5; test++) { //Test: 0,
7899  if (test == 0)
7900  htmlFile.open("CapID_GL.html");
7901  if (test == 1)
7902  htmlFile.open("ADCampl_GL.html");
7903  if (test == 2)
7904  htmlFile.open("Width_GL.html");
7905  if (test == 3)
7906  htmlFile.open("Ratio_GL.html");
7907  if (test == 4)
7908  htmlFile.open("Tmean_GL.html");
7909  if (test == 5)
7910  htmlFile.open("Tmax_GL.html");
7911 
7912  // cout<<"Creating tests html pages: test= "<< test << endl;
7913 
7914  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
7915  htmlFile << "<head>" << std::endl;
7916  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
7917  htmlFile << "<title> Certification Monitoring Tool </title>" << std::endl;
7918  htmlFile << "<style type=\"text/css\">" << std::endl;
7919  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
7920  << std::endl;
7921  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
7922  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
7923  "text-align: center;}"
7924  << std::endl;
7925  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
7926  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
7927  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
7928  htmlFile << " td.s5 { font-family: arial, arial ce, helvetica; background-color: #00FF00; }" << std::endl;
7929  htmlFile << " td.s6 { font-family: arial, arial ce, helvetica; background-color: #FF0000; }" << std::endl;
7930  htmlFile << "</style>" << std::endl;
7931  htmlFile << "<body>" << std::endl;
7932  if (test == 0)
7933  htmlFile << "<h1> CAP ID ERRORS, GLOBAL RUN = " << runnumber << " </h1>" << std::endl;
7934  if (test == 1)
7935  htmlFile << "<h1> ADC AMPLITIDE, GLOBAL RUN = " << runnumber << " </h1>" << std::endl;
7936  if (test == 2)
7937  htmlFile << "<h1> WIDTH, GLOBAL RUN = " << runnumber << " </h1>" << std::endl;
7938  if (test == 3)
7939  htmlFile << "<h1> RATIO, GLOBAL RUN = " << runnumber << " </h1>" << std::endl;
7940  if (test == 4)
7941  htmlFile << "<h1> TIMING MEAN, GLOBAL RUN = " << runnumber << " </h1>" << std::endl;
7942  if (test == 5)
7943  htmlFile << "<h1> TIMING MAX, GLOBAL RUN = " << runnumber << " </h1>" << std::endl;
7944  htmlFile << "<br>" << std::endl;
7945  htmlFile << "<h2> 1. Map of suspicious channels with this criterion for whole HCAL </h2>" << std::endl;
7946  htmlFile << "<h3> Channel legend: green - good, other colour - suspicious </h3>" << std::endl;
7947  htmlFile << "<br>" << std::endl;
7948  if (test == 0)
7949  htmlFile << " <img src=\"MapCapIdError.png\" />" << std::endl;
7950  if (test == 1)
7951  htmlFile << " <img src=\"MapADCAmpl.png\" />" << std::endl;
7952  if (test == 2)
7953  htmlFile << " <img src=\"MapWidth.png\" />" << std::endl;
7954  if (test == 3)
7955  htmlFile << " <img src=\"MapRatio.png\" />" << std::endl;
7956  if (test == 4)
7957  htmlFile << " <img src=\"MapTmean.png\" />" << std::endl;
7958  if (test == 5)
7959  htmlFile << " <img src=\"MapTmax.png\" />" << std::endl;
7960  htmlFile << "<br>" << std::endl;
7961  htmlFile << "<h2> 2. For whole HCAL: </h2>" << std::endl;
7962  htmlFile << "<br>" << std::endl;
7963  if (test == 0)
7964  htmlFile << " <img src=\"HistCapID.png\" />" << std::endl;
7965  if (test == 1)
7966  htmlFile << " <img src=\"HistADCAmpl.png\" />" << std::endl;
7967  if (test == 2)
7968  htmlFile << " <img src=\"HistWidth.png\" />" << std::endl;
7969  if (test == 3)
7970  htmlFile << " <img src=\"HistRatio.png\" />" << std::endl;
7971  if (test == 4)
7972  htmlFile << " <img src=\"HistTmean.png\" />" << std::endl;
7973  if (test == 5)
7974  htmlFile << " <img src=\"HistTmax.png\" />" << std::endl;
7975  htmlFile << "<br>" << std::endl;
7976  htmlFile << "<h2> 3. Status of subdetectors </h2>" << std::endl;
7977  htmlFile << "<table width=\"400\">" << std::endl;
7978  htmlFile << "<tr>" << std::endl;
7979  if (test == 0) {
7980  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
7981  << "/HB_CapID.html\">HB</a></td>" << std::endl;
7982  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
7983  << "/HE_CapID.html\">HE</a></td>" << std::endl;
7984  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
7985  << "/HO_CapID.html\">HO</a></td>" << std::endl;
7986  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
7987  << "/HF_CapID.html\">HF</a></td>" << std::endl;
7988  }
7989  if (test == 1) {
7990  // AZ 11.03.2019
7991  /*
7992  htmlFile << " <td><a href=\"HB_ADCampl.html\">HB</a></td>"<< std::endl;
7993  htmlFile << " <td><a href=\"HE_ADCampl.html\">HE</a></td>"<< std::endl;
7994  htmlFile << " <td><a href=\"HO_ADCampl.html\">HO</a></td>"<< std::endl;
7995  htmlFile << " <td><a href=\"HF_ADCampl.html\">HF</a></td>"<< std::endl;
7996 */
7997 
7998  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
7999  << "/HB_ADCampl.html\">HB</a></td>" << std::endl;
8000  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8001  << "/HE_ADCampl.html\">HE</a></td>" << std::endl;
8002  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8003  << "/HO_ADCampl.html\">HO</a></td>" << std::endl;
8004  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8005  << "/HF_ADCampl.html\">HF</a></td>" << std::endl;
8006  }
8007  if (test == 2) {
8008  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8009  << "/HB_Width.html\">HB</a></td>" << std::endl;
8010  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8011  << "/HE_Width.html\">HE</a></td>" << std::endl;
8012  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8013  << "/HO_Width.html\">HO</a></td>" << std::endl;
8014  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8015  << "/HF_Width.html\">HF</a></td>" << std::endl;
8016  }
8017  if (test == 3) {
8018  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8019  << "/HB_Ratio.html\">HB</a></td>" << std::endl;
8020  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8021  << "/HE_Ratio.html\">HE</a></td>" << std::endl;
8022  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8023  << "/HO_Ratio.html\">HO</a></td>" << std::endl;
8024  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8025  << "/HF_Ratio.html\">HF</a></td>" << std::endl;
8026  }
8027  if (test == 4) {
8028  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8029  << "/HB_Tmean.html\">HB</a></td>" << std::endl;
8030  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8031  << "/HE_Tmean.html\">HE</a></td>" << std::endl;
8032  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8033  << "/HO_Tmean.html\">HO</a></td>" << std::endl;
8034  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8035  << "/HF_Tmean.html\">HF</a></td>" << std::endl;
8036  }
8037  if (test == 5) {
8038  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8039  << "/HB_Tmax.html\">HB</a></td>" << std::endl;
8040  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8041  << "/HE_Tmax.html\">HE</a></td>" << std::endl;
8042  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8043  << "/HO_Tmax.html\">HO</a></td>" << std::endl;
8044  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8045  << "/HF_Tmax.html\">HF</a></td>" << std::endl;
8046  }
8047 
8048  htmlFile << "</tr>" << std::endl;
8049  htmlFile << "</table>" << std::endl;
8050  htmlFile << "<br>" << std::endl;
8051  // cout<<"Creating tests html pages: 111111" << endl;
8052 
8053  if (test != 0)
8054  htmlFile << "<h2> 4. Table of estimator-values in sub-detectors for ONLY suspicious LSs </h3>" << std::endl;
8055  if (test == 0)
8056  htmlFile << "<h2> 4. Table of average Nbcs in sub-detectors for ONLY suspicious LSs </h3>" << std::endl;
8057  htmlFile << "<table>" << std::endl;
8058  htmlFile << "<tr>";
8059  htmlFile << "<td class=\"s4\" align=\"center\">LS</td>" << std::endl;
8060  // htmlFile << "<td class=\"s1\" align=\"center\">LS</td>" << std::endl;
8061  htmlFile << "<td class=\"s1\" align=\"center\">Number of events</td>" << std::endl;
8063  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
8064 
8065  // cout<<"Creating each test kind for each subdet html pages: test= "<< test << " sub= " << sub << endl;
8066  int kkkkkkmax = k_max[sub];
8067  if ((sub == 4 || sub == 2 || sub == 1) && test == 1)
8068  kkkkkkmax = k_maxupgrade[sub];
8069  // if ( (sub==4 || sub==2) && test==1) kkkkkkmax = k_maxupgrade[sub];
8070  // if (test==1 && sub==4) kkkkkkmax = k_maxupgrade[sub];
8071  if (sub == 1) {
8072  if (test == 0)
8073  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8074  htmlFile << "<td class=\"s1\" align=\"center\">< Nbcs > HBdep " << k << " </td>" << std::endl;
8075  if (test == 1)
8076  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8077  htmlFile << "<td class=\"s1\" align=\"center\">< A > HBdepth " << k << " </td>" << std::endl;
8078  if (test == 2)
8079  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8080  htmlFile << "<td class=\"s1\" align=\"center\">< W > HBdepth " << k << " </td>" << std::endl;
8081  if (test == 3)
8082  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8083  htmlFile << "<td class=\"s1\" align=\"center\">< R > HBdepth " << k << " </td>" << std::endl;
8084  if (test == 4)
8085  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8086  htmlFile << "<td class=\"s1\" align=\"center\">< TSn > HBdep " << k << " </td>" << std::endl;
8087  if (test == 5)
8088  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8089  htmlFile << "<td class=\"s1\" align=\"center\">< TSx > HBdep " << k << " </td>" << std::endl;
8090  } //
8091  if (sub == 2) {
8092  if (test == 0)
8093  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8094  htmlFile << "<td class=\"s1\" align=\"center\">< Nbcs > HEdep " << k << " </td>" << std::endl;
8095  if (test == 1)
8096  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8097  htmlFile << "<td class=\"s1\" align=\"center\">< A > HEdepth " << k << " </td>" << std::endl;
8098  if (test == 2)
8099  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8100  htmlFile << "<td class=\"s1\" align=\"center\">< W > HEdepth " << k << " </td>" << std::endl;
8101  if (test == 3)
8102  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8103  htmlFile << "<td class=\"s1\" align=\"center\">< R > HEdepth " << k << " </td>" << std::endl;
8104  if (test == 4)
8105  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8106  htmlFile << "<td class=\"s1\" align=\"center\">< TSn > HEdep " << k << " </td>" << std::endl;
8107  if (test == 5)
8108  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8109  htmlFile << "<td class=\"s1\" align=\"center\">< TSx > HEdep " << k << " </td>" << std::endl;
8110  } //
8111  if (sub == 3) {
8112  if (test == 0)
8113  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8114  htmlFile << "<td class=\"s1\" align=\"center\">< Nbcs > HOdep " << k << " </td>" << std::endl;
8115  if (test == 1)
8116  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8117  htmlFile << "<td class=\"s1\" align=\"center\">< A > HOdepth " << k << " </td>" << std::endl;
8118  if (test == 2)
8119  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8120  htmlFile << "<td class=\"s1\" align=\"center\">< W > HOdepth " << k << " </td>" << std::endl;
8121  if (test == 3)
8122  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8123  htmlFile << "<td class=\"s1\" align=\"center\">< R > HOdepth " << k << " </td>" << std::endl;
8124  if (test == 4)
8125  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8126  htmlFile << "<td class=\"s1\" align=\"center\">< TSn > HOdep " << k << " </td>" << std::endl;
8127  if (test == 5)
8128  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8129  htmlFile << "<td class=\"s1\" align=\"center\">< TSx > HOdep " << k << " </td>" << std::endl;
8130  } //
8131  if (sub == 4) {
8132  if (test == 0)
8133  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8134  htmlFile << "<td class=\"s1\" align=\"center\">< Nbcs > HFdep " << k << " </td>" << std::endl;
8135  if (test == 1)
8136  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8137  htmlFile << "<td class=\"s1\" align=\"center\">< A > HFdepth " << k << " </td>" << std::endl;
8138  if (test == 2)
8139  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8140  htmlFile << "<td class=\"s1\" align=\"center\">< W > HFdepth " << k << " </td>" << std::endl;
8141  if (test == 3)
8142  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8143  htmlFile << "<td class=\"s1\" align=\"center\">< R > HFdepth " << k << " </td>" << std::endl;
8144  if (test == 4)
8145  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8146  htmlFile << "<td class=\"s1\" align=\"center\">< TSn > HFdep " << k << " </td>" << std::endl;
8147  if (test == 5)
8148  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8149  htmlFile << "<td class=\"s1\" align=\"center\">< TSx > HFdep " << k << " </td>" << std::endl;
8150  } //
8151  } // sub
8152  htmlFile << "</tr>" << std::endl;
8153 
8154  // htmlFile << "<td class=\"s1\" align=\"center\">HB Depth 1</td>"<< std::endl;
8155  // htmlFile << "<td class=\"s1\" align=\"center\">HB Depth 2</td>" << std::endl;
8156  // htmlFile << "<td class=\"s1\" align=\"center\">HE Depth 1</td>" << std::endl;
8157  // htmlFile << "<td class=\"s1\" align=\"center\">HE Depth 2</td>" << std::endl;
8158  // htmlFile << "<td class=\"s1\" align=\"center\">HE Depth 3</td>" << std::endl;
8159  // htmlFile << "<td class=\"s1\" align=\"center\">HE Depth 4</td>" << std::endl;
8160  // htmlFile << "<td class=\"s1\" align=\"center\">HE Depth 5</td>" << std::endl;
8161  // htmlFile << "<td class=\"s1\" align=\"center\">HE Depth 6</td>" << std::endl;
8162  // htmlFile << "<td class=\"s1\" align=\"center\">HE Depth 7</td>" << std::endl;
8163  // htmlFile << "<td class=\"s1\" align=\"center\">HO Depth 4</td>" << std::endl;
8164  // htmlFile << "<td class=\"s1\" align=\"center\">HF Depth 1</td>" << std::endl;
8165  // htmlFile << "<td class=\"s1\" align=\"center\">HF Depth 2</td>" << std::endl;
8166  // htmlFile << "<td class=\"s1\" align=\"center\">HF Depth 3</td>" << std::endl;
8167  // htmlFile << "<td class=\"s1\" align=\"center\">HF Depth 4</td>" << std::endl;
8168  // htmlFile << "</tr>" << std::endl;
8169 
8170  ind = 0;
8171  // cout<<"Creating tests html pages: 222222" << endl;
8172  for (int i = 1; i <= MaxLum; i++) {
8173  // define al least one exceed in any sub-detector
8174  int met = 0;
8175  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
8176  int kkkkkkmax = k_max[sub];
8177  if ((sub == 4 || sub == 2 || sub == 1) && test == 1)
8178  kkkkkkmax = k_maxupgrade[sub];
8179  // if ( (sub==4 || sub==2) && test==1) kkkkkkmax = k_maxupgrade[sub];
8180  for (int k = k_min[sub]; k <= kkkkkkmax; k++) {
8181  // line below is temporary, just to avoid contribution of HEP(M)17 in depthes 4,5,6,7 but keep in depthes 1,2,3
8182  if (sub == 2 && k > 3) {
8183  } else {
8184  if (HistNumBadChanDepth[test][sub][k]->GetBinContent(i) > Cut0[test][sub][k])
8185  met = 1;
8186  }
8187  } //depth
8188  } //sub
8189  // if exceed then plot the line for all sub-detectors
8190  if (met == 1) {
8191  if ((ind % 2) == 1)
8192  raw_class = "<td class=\"s2\" align=\"center\">";
8193  else
8194  raw_class = "<td class=\"s3\" align=\"center\">";
8195  htmlFile << "<tr>" << std::endl;
8196  htmlFile << "<td class=\"s4\" align=\"center\">" << i << "</td>" << std::endl;
8197  // htmlFile << raw_class<< LumLum->GetBinContent(i)<<"</td>"<< std::endl;
8198  htmlFile << raw_class << LumiEv->GetBinContent(i) << "</td>" << std::endl;
8199  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
8200  int kkkkkkmax = k_max[sub];
8201  if ((sub == 4 || sub == 2 || sub == 1) && test == 1)
8202  kkkkkkmax = k_maxupgrade[sub];
8203  // if ( (sub==4 || sub==2) && test==1) kkkkkkmax = k_maxupgrade[sub];
8204  for (int k = k_min[sub]; k <= kkkkkkmax; k++) {
8205  if (HistNumBadChanDepth[test][sub][k]->GetBinContent(i) > Cut0[test][sub][k])
8206  htmlFile << "<td class=\"s6\" align=\"center\">" << HistNumBadChanDepth[test][sub][k]->GetBinContent(i)
8207  << "</td>" << std::endl;
8208  else
8209  htmlFile << raw_class << HistNumBadChanDepth[test][sub][k]->GetBinContent(i) << "</td>" << std::endl;
8210  // htmlFile << "</tr>" << std::endl;
8211  /*
8212  if (HistNumBadChanDepth[test][1][1]->GetBinContent(i) > Cut0[test][1][1]) htmlFile << "<td class=\"s6\" align=\"center\">"<<HistNumBadChanDepth[test][1][1]->GetBinContent(i)<<"</td>"<< std::endl;
8213  else htmlFile <<raw_class<<HistNumBadChanDepth[test][1][1]->GetBinContent(i)<<"</td>"<< std::endl;
8214  if (HistNumBadChanDepth[test][1][2]->GetBinContent(i) > Cut0[test][1][2]) htmlFile << "<td class=\"s6\" align=\"center\">"<<HistNumBadChanDepth[test][1][2]->GetBinContent(i)<<"</td>"<< std::endl;
8215  else htmlFile <<raw_class<<HistNumBadChanDepth[test][1][2]->GetBinContent(i)<<"</td>"<< std::endl;
8216  if (HistNumBadChanDepth[test][2][1]->GetBinContent(i) > Cut0[test][2][1]) htmlFile << "<td class=\"s6\" align=\"center\">"<<HistNumBadChanDepth[test][2][1]->GetBinContent(i)<<"</td>"<< std::endl;
8217  else htmlFile <<raw_class<<HistNumBadChanDepth[test][2][1]->GetBinContent(i)<<"</td>"<< std::endl;
8218  if (HistNumBadChanDepth[test][2][2]->GetBinContent(i) > Cut0[test][2][2]) htmlFile << "<td class=\"s6\" align=\"center\">"<<HistNumBadChanDepth[test][2][2]->GetBinContent(i)<<"</td>"<< std::endl;
8219  else htmlFile <<raw_class<<HistNumBadChanDepth[test][2][2]->GetBinContent(i)<<"</td>"<< std::endl;
8220  if (HistNumBadChanDepth[test][2][3]->GetBinContent(i) > Cut0[test][2][3]) htmlFile << "<td class=\"s6\" align=\"center\">"<<HistNumBadChanDepth[test][2][3]->GetBinContent(i)<<"</td>"<< std::endl;
8221  else htmlFile <<raw_class<<HistNumBadChanDepth[test][2][3]->GetBinContent(i)<<"</td>"<< std::endl;
8222  if (HistNumBadChanDepth[test][2][4]->GetBinContent(i) > Cut0[test][2][4]) htmlFile << "<td class=\"s6\" align=\"center\">"<<HistNumBadChanDepth[test][2][4]->GetBinContent(i)<<"</td>"<< std::endl;
8223  else htmlFile <<raw_class<<HistNumBadChanDepth[test][2][4]->GetBinContent(i)<<"</td>"<< std::endl;
8224  if (HistNumBadChanDepth[test][2][5]->GetBinContent(i) > Cut0[test][2][5]) htmlFile << "<td class=\"s6\" align=\"center\">"<<HistNumBadChanDepth[test][2][5]->GetBinContent(i)<<"</td>"<< std::endl;
8225  else htmlFile <<raw_class<<HistNumBadChanDepth[test][2][5]->GetBinContent(i)<<"</td>"<< std::endl;
8226  if (HistNumBadChanDepth[test][2][6]->GetBinContent(i) > Cut0[test][2][6]) htmlFile << "<td class=\"s6\" align=\"center\">"<<HistNumBadChanDepth[test][2][6]->GetBinContent(i)<<"</td>"<< std::endl;
8227  else htmlFile <<raw_class<<HistNumBadChanDepth[test][2][6]->GetBinContent(i)<<"</td>"<< std::endl;
8228  if (HistNumBadChanDepth[test][2][7]->GetBinContent(i) > Cut0[test][2][7]) htmlFile << "<td class=\"s6\" align=\"center\">"<<HistNumBadChanDepth[test][2][7]->GetBinContent(i)<<"</td>"<< std::endl;
8229  else htmlFile <<raw_class<<HistNumBadChanDepth[test][2][7]->GetBinContent(i)<<"</td>"<< std::endl;
8230  if (HistNumBadChanDepth[test][3][4]->GetBinContent(i) > Cut0[test][3][4]) htmlFile << "<td class=\"s6\" align=\"center\">"<<HistNumBadChanDepth[test][3][4]->GetBinContent(i)<<"</td>"<< std::endl;
8231  else htmlFile <<raw_class<<HistNumBadChanDepth[test][3][4]->GetBinContent(i)<<"</td>"<< std::endl;
8232  if (HistNumBadChanDepth[test][4][1]->GetBinContent(i) > Cut0[test][4][1]) htmlFile << "<td class=\"s6\" align=\"center\">"<<HistNumBadChanDepth[test][4][1]->GetBinContent(i)<<"</td>"<< std::endl;
8233  else htmlFile <<raw_class<<HistNumBadChanDepth[test][4][1]->GetBinContent(i)<<"</td>"<< std::endl;
8234  if (HistNumBadChanDepth[test][4][2]->GetBinContent(i) > Cut0[test][4][2]) htmlFile << "<td class=\"s6\" align=\"center\">"<<HistNumBadChanDepth[test][4][2]->GetBinContent(i)<<"</td>"<< std::endl;
8235  else htmlFile <<raw_class<<HistNumBadChanDepth[test][4][2]->GetBinContent(i)<<"</td>"<< std::endl;
8236  */
8237  } //k depthes
8238  } //sub
8239  htmlFile << "</tr>" << std::endl;
8240  ind += 1;
8241  } // met=1
8242  } //i bin lines
8243  // cout<<"Creating tests html pages: 333333" << endl;
8244  htmlFile << "</table>" << std::endl;
8245  htmlFile << "<br>" << std::endl;
8246  htmlFile << "</body> " << std::endl;
8247  htmlFile << "</html> " << std::endl;
8248  htmlFile.close();
8249  } //test
8250  //======================================================================
8251  // cout<<"for summed Amplitudes of each sub-detector" << endl;
8252 
8253  // for summed Amplitudes of each sub-detector
8254  htmlFile.open("SummedAmplitudes_GL.html");
8255  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
8256  htmlFile << "<head>" << std::endl;
8257  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
8258  htmlFile << "<title> for summed Amplitudes of each sub-detector </title>" << std::endl;
8259  htmlFile << "<style type=\"text/css\">" << std::endl;
8260  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
8261  << std::endl;
8262  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
8263  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
8264  "text-align: center;}"
8265  << std::endl;
8266  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
8267  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
8268  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
8269  htmlFile << " td.s5 { font-family: arial, arial ce, helvetica; background-color: #00FF00; }" << std::endl;
8270  htmlFile << " td.s6 { font-family: arial, arial ce, helvetica; background-color: #FF0000; }" << std::endl;
8271 
8272  htmlFile << "</style>" << std::endl;
8273  htmlFile << "<body>" << std::endl;
8274  htmlFile << "<h1> Averaged Summed Amplitudes & corresponding occupancy of each sub-detector in Global Run = "
8275  << runnumber << " </h1>" << std::endl;
8276  htmlFile << "<a name=\"Top\"></a>\n";
8277  htmlFile << "<b>Contents:<br>\n";
8278  htmlFile << "1. <a href=\"#SAhigh\">average SA&Occupancy for Signal </a><br>\n";
8279  htmlFile << "2. <a href=\"#SAlow\">average SA&Occupancy for NoSignal </a><br>\n";
8280  htmlFile << "3. <a href=\"#SAmax\"> maxSA & maxOccupancy; SA & Occupancy; </a><br>\n";
8281  htmlFile << "4. <a href=\"#FullTable\">Table(avA; avSA; avOccupancy; maxSA; maxOccupancy;) </a><br>\n";
8282 
8283  htmlFile << "<h2> Clarifying on averaged Summed Amplitude (avSA) : </h2>" << std::endl;
8284  htmlFile << "<h3> Summed Amplitudes (SA) are averaged over all events of each LS: avSA_LS = SUM (SA_eventsInLS) / "
8285  "N_eventsInLS ,</h3>"
8286  << std::endl;
8287  htmlFile << "<h3> where SA = SUM(A_i) ,and means that Amplitude is summed over all sub-detector channels, </h3>"
8288  << std::endl;
8289  htmlFile << "<h3> where A_i = SUM(A_depth) denotes channel amplitude summed over depths; </h3>" << std::endl;
8290  // htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_"<<runnumber<<"/HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
8291  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/SAwriteup.html\"> see "
8292  "more details for SummedAmplitudes</a></td>"
8293  << std::endl;
8294  htmlFile << "<h2> Apply cuts on A_i to take into account channels with or/and without a'la Signal: </h2>"
8295  << std::endl;
8296  htmlFile << " <img src=\"ChannelDepthsummedAmplitudes.png\" />" << std::endl;
8297  htmlFile << "<br>" << std::endl;
8298  htmlFile << "<br>" << std::endl;
8299  htmlFile << "<a name=\"SAhigh\"></a>\n";
8300  htmlFile << "<h1> 1. for channels with signal </h1>" << std::endl;
8301  htmlFile << "<br>" << std::endl;
8302  htmlFile << "<h2> for HB: A_i> 80; </h2>" << std::endl;
8303  htmlFile << " <img src=\"SummedAmplitudesSignal_HB.png\" />" << std::endl;
8304  htmlFile << "<br>" << std::endl;
8305  htmlFile << "<h2> for HE: A_i> 200;</h2>" << std::endl;
8306  htmlFile << " <img src=\"SummedAmplitudesSignal_HE.png\" />" << std::endl;
8307  htmlFile << "<br>" << std::endl;
8308  htmlFile << "<h2> for HO: A_i> 1200;</h2>" << std::endl;
8309  htmlFile << " <img src=\"SummedAmplitudesSignal_HO.png\" />" << std::endl;
8310  htmlFile << "<br>" << std::endl;
8311  htmlFile << "<h2> for HF: A_i> 600;</h2>" << std::endl;
8312  htmlFile << " <img src=\"SummedAmplitudesSignal_HF.png\" />" << std::endl;
8313  htmlFile << "<br>" << std::endl;
8314  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
8315 
8316  htmlFile << "<a name=\"SAlow\"></a>\n";
8317  htmlFile << "<h1> 2. for channels w/o signal </h1>" << std::endl;
8318  htmlFile << "<br>" << std::endl;
8319  htmlFile << "<h2> for HB: A_i< 80;</h2>" << std::endl;
8320  htmlFile << " <img src=\"NoSignalSummedAmplitudes_HB.png\" />" << std::endl;
8321  htmlFile << "<br>" << std::endl;
8322  htmlFile << "<h2> for HE: A_i< 200;</h2>" << std::endl;
8323  htmlFile << " <img src=\"NoSignalSummedAmplitudes_HE.png\" />" << std::endl;
8324  htmlFile << "<br>" << std::endl;
8325  htmlFile << "<h2> for HO: A_i< 1200;</h2>" << std::endl;
8326  htmlFile << " <img src=\"NoSignalSummedAmplitudes_HO.png\" />" << std::endl;
8327  htmlFile << "<br>" << std::endl;
8328  htmlFile << "<h2> for HF: A_i< 600;</h2>" << std::endl;
8329  htmlFile << " <img src=\"NoSignalSummedAmplitudes_HF.png\" />" << std::endl;
8330  htmlFile << "<br>" << std::endl;
8331  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
8332 
8333  htmlFile << "<br>" << std::endl;
8334  htmlFile << "<br>" << std::endl;
8335  htmlFile << "<a name=\"SAmax\"></a>\n";
8336  htmlFile << "<h1> 3. four plots: ---1---> max SA ---2---> max Occupancy ---3---> SA ---4---> Occupancy over all "
8337  "events of LS </h1>"
8338  << std::endl;
8339  htmlFile << "<br>" << std::endl;
8340 
8341  htmlFile << "<h2> for HB: maxSA vs LS, masOccupancy vs LS, SA, Occupancy </h2>" << std::endl;
8342  htmlFile << " <img src=\"MaxxSummedAmplitudes_HB.png\" />" << std::endl;
8343  htmlFile << "<h2>"
8344  " ......(forCut:SAmax>60000) N= "
8345  << countamplmaxHB << " ...... (forCut:OCCUPmax>2000) N= " << countoccumaxHB << " </h2>" << std::endl;
8346  htmlFile << "<h2>"
8347  " ......(forCut:SA>60000) N= "
8348  << countamplHB << " ...... (forCut:OCCUP>2000) N= " << countoccuHB << " </h2>" << std::endl;
8349  htmlFile << "<br>" << std::endl;
8350  htmlFile << "<h3> ONLY for HB (cross-check): channel Amplitudes for events in the Tail (averaged): </h3>"
8351  << std::endl;
8352  htmlFile << " <img src=\"AtaildepthHB.png\" />" << std::endl;
8353  htmlFile << "<br>" << std::endl;
8354 
8355  htmlFile << "<h2> for HE: maxSA vs LS, masOccupancy vs LS, SA, Occupancy </h2>" << std::endl;
8356  htmlFile << " <img src=\"MaxxSummedAmplitudes_HE.png\" />" << std::endl;
8357  htmlFile << "<h2>"
8358  " ......(forCut:SAmax>60000) N= "
8359  << countamplmaxHE << " ...... (forCut:OCCUPmax>1200) N= " << countoccumaxHE << " </h2>" << std::endl;
8360  htmlFile << "<h2>"
8361  " ......(forCut:SA>60000) N= "
8362  << countamplHE << " ...... (forCut:OCCUP>1200) N= " << countoccuHE << " </h2>" << std::endl;
8363  htmlFile << "<br>" << std::endl;
8364 
8365  htmlFile << "<h2> for HO: maxSA vs LS, masOccupancy vs LS, SA, Occupancy </h2>" << std::endl;
8366  htmlFile << " <img src=\"MaxxSummedAmplitudes_HO.png\" />" << std::endl;
8367  htmlFile << "<h2>"
8368  " ......(forCut:SAmax>150000) N= "
8369  << countamplmaxHO << " ...... (forCut:OCCUPmax>2000) N= " << countoccumaxHO << " </h2>" << std::endl;
8370  htmlFile << "<h2>"
8371  " ......(forCut:SA>150000) N= "
8372  << countamplHO << " ...... (forCut:OCCUP>2000) N= " << countoccuHO << " </h2>" << std::endl;
8373  htmlFile << "<br>" << std::endl;
8374 
8375  htmlFile << "<h2> for HF: maxSA vs LS, masOccupancy vs LS, SA, Occupancy </h2>" << std::endl;
8376  htmlFile << " <img src=\"MaxxSummedAmplitudes_HF.png\" />" << std::endl;
8377  htmlFile << "<h2>"
8378  " ......(forCut:SAmax>22000) N= "
8379  << countamplmaxHF << " ...... (forCut:OCCUPmax>860) N= " << countoccumaxHF << " </h2>" << std::endl;
8380  htmlFile << "<h2>"
8381  " ......(forCut:SA>22000) N= "
8382  << countamplHF << " ...... (forCut:OCCUP>860) N= " << countoccuHF << " </h2>" << std::endl;
8383  htmlFile << "<br>" << std::endl;
8384  htmlFile << "<h2> Occupancy HF (ONLY) vs LS </h2>" << std::endl;
8385  htmlFile << " <img src=\"sumOccupancyHF.png\" />" << std::endl;
8386  htmlFile << "<br>" << std::endl;
8387  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
8388 
8389  htmlFile << "<a name=\"FullTable\"></a>\n";
8390  htmlFile << "<h2> 4.Lumisection Status: </h2>" << std::endl;
8391  htmlFile << "<h3> Legends: HBdepth1 red boxes correspond LSs selected with cut: <td class=\"s6\" align=\"center\">"
8392  << Cut0[1][1][1] << std::endl;
8393  htmlFile << "<h3> Legends: HEdepth1 red boxes correspond LSs selected with cut: <td class=\"s6\" align=\"center\">"
8394  << Cut0[1][2][1] << std::endl;
8395  htmlFile << "<h3> Legends: HOdepth4 red boxes correspond LSs selected with cut: <td class=\"s6\" align=\"center\">"
8396  << Cut0[1][3][4] << std::endl;
8397  htmlFile << "<h3> Legends: HFdepth1 red boxes correspond LSs selected with cut: <td class=\"s6\" align=\"center\">"
8398  << Cut0[1][4][1] << std::endl;
8399  htmlFile << "<br>" << std::endl;
8400  // SummedAmplitudeHisto[i] SummedAmplitudeOccupancyHisto[i] NoSignalSummedAmplitudeHisto[i] NoSignalSummedAmplitudeOccupancyHisto[i]; i=0-3;(HF:i=3)
8401  htmlFile << "<br>" << std::endl;
8402  htmlFile << "<table>" << std::endl;
8403  htmlFile << "<tr>";
8404  htmlFile << "<td class=\"s4\" align=\"center\">LS</td>" << std::endl;
8405  // htmlFile << "<td class=\"s1\" align=\"center\">LS</td>" << std::endl;
8406  htmlFile << "<td class=\"s1\" align=\"center\"> Num.of ev.</td>" << std::endl;
8407 
8408  // for (int k=k_min[sub];k<=k_max[sub]; k++) htmlFile << "<td class=\"s1\" align=\"center\">< A > Depth "<< k <<" </td>" << std::endl;
8409  // for (int sub=1;sub<=4;sub++) htmlFile << "<td class=\"s1\" align=\"center\">< A > Depth1, sub "<< sub <<" </td>" << std::endl;
8410 
8411  htmlFile << "<td class=\"s1\" align=\"center\">< A >HB Depth1</td>" << std::endl;
8412  htmlFile << "<td class=\"s1\" align=\"center\">< A >HE Depth1</td>" << std::endl;
8413  htmlFile << "<td class=\"s1\" align=\"center\">< A >HO Depth4</td>" << std::endl;
8414  htmlFile << "<td class=\"s1\" align=\"center\">< A >HF Depth1</td>" << std::endl;
8415 
8416  htmlFile << "<td class=\"s1\" align=\"center\">< SA >HB (Signal) </td>" << std::endl;
8417  htmlFile << "<td class=\"s1\" align=\"center\">< Occup. > HB (Signal) </td>" << std::endl;
8418  htmlFile << "<td class=\"s1\" align=\"center\">< SA >HF (Signal) </td>" << std::endl;
8419  htmlFile << "<td class=\"s1\" align=\"center\">< Occup. > HF (Signal) </td>" << std::endl;
8420 
8421  htmlFile << "<td class=\"s1\" align=\"center\">< SA >HB (NoSignal) </td>" << std::endl;
8422  htmlFile << "<td class=\"s1\" align=\"center\">< Occup. > HB (NoSignal) </td>" << std::endl;
8423  htmlFile << "<td class=\"s1\" align=\"center\">< SA >HF (NoSignal) </td>" << std::endl;
8424  htmlFile << "<td class=\"s1\" align=\"center\">< Occup. > HF (NoSignal) </td>" << std::endl;
8425 
8426  htmlFile << "<td class=\"s1\" align=\"center\"> maxSA HB </td>" << std::endl;
8427  htmlFile << "<td class=\"s1\" align=\"center\"> maxOccup. HB </td>" << std::endl;
8428  htmlFile << "<td class=\"s1\" align=\"center\"> maxSA HF </td>" << std::endl;
8429  htmlFile << "<td class=\"s1\" align=\"center\"> maxOccup. HF </td>" << std::endl;
8430 
8431  htmlFile << "</tr>" << std::endl;
8432 
8433  ind = 0;
8434  for (int i = 1; i <= MaxLum; i++) {
8435  if ((ind % 2) == 1)
8436  raw_class = "<td class=\"s2\" align=\"center\">";
8437  else
8438  raw_class = "<td class=\"s3\" align=\"center\">";
8439  htmlFile << "<tr>" << std::endl;
8440 
8441  htmlFile << "<td class=\"s4\" align=\"center\">" << i << "</td>" << std::endl;
8442 
8443  // htmlFile << raw_class<< LumLum->GetBinContent(i)<<"</td>"<< std::endl;
8444  htmlFile << raw_class << LumiEv->GetBinContent(i) << "</td>" << std::endl;
8445 
8446  // (test==1) <Amplitude>
8447  int test = 1;
8448  // for (int k=k_min[sub];k<=k_max[sub]; k++) {
8449  for (int sub = 1; sub <= 4; sub++) {
8450  for (int k = k_min[sub]; k <= k_min[sub]; k++) {
8451  if (HistNumBadChanDepth[test][sub][k]->GetBinContent(i) > Cut0[test][sub][k])
8452  htmlFile << "<td class=\"s6\" align=\"center\">" << HistNumBadChanDepth[test][sub][k]->GetBinContent(i)
8453  << "</td>" << std::endl;
8454 
8455  else
8456  htmlFile << raw_class << HistNumBadChanDepth[test][sub][k]->GetBinContent(i) << "</td>" << std::endl;
8457  }
8458  }
8459  if (SummedAmplitudeHisto[0]) {
8460  htmlFile << raw_class << SummedAmplitudeHisto[0]->GetBinContent(i) << "</td>" << std::endl;
8461  htmlFile << raw_class << SummedAmplitudeOccupancyHisto[0]->GetBinContent(i) << "</td>" << std::endl;
8462  htmlFile << raw_class << SummedAmplitudeHisto[3]->GetBinContent(i) << "</td>" << std::endl;
8463  htmlFile << raw_class << SummedAmplitudeOccupancyHisto[3]->GetBinContent(i) << "</td>" << std::endl;
8464 
8465  htmlFile << raw_class << NoSignalSummedAmplitudeHisto[0]->GetBinContent(i) << "</td>" << std::endl;
8466  htmlFile << raw_class << NoSignalSummedAmplitudeOccupancyHisto[0]->GetBinContent(i) << "</td>" << std::endl;
8467  htmlFile << raw_class << NoSignalSummedAmplitudeHisto[3]->GetBinContent(i) << "</td>" << std::endl;
8468  htmlFile << raw_class << NoSignalSummedAmplitudeOccupancyHisto[3]->GetBinContent(i) << "</td>" << std::endl;
8469 
8470  htmlFile << raw_class << MaxxSummedAmplitudeHisto[0]->GetBinContent(i) << "</td>" << std::endl;
8471  htmlFile << raw_class << MaxxSummedAmplitudeOccupancyHisto[0]->GetBinContent(i) << "</td>" << std::endl;
8472  htmlFile << raw_class << MaxxSummedAmplitudeHisto[3]->GetBinContent(i) << "</td>" << std::endl;
8473  htmlFile << raw_class << MaxxSummedAmplitudeOccupancyHisto[3]->GetBinContent(i) << "</td>" << std::endl;
8474  }
8475  htmlFile << "</tr>" << std::endl;
8476  ind += 1;
8477  }
8478  htmlFile << "</table>" << std::endl;
8479  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
8480 
8481  htmlFile << "<br>" << std::endl;
8482  htmlFile << "</body> " << std::endl;
8483  htmlFile << "</html> " << std::endl;
8484  htmlFile.close();
8485 
8486  //====================================================================== // Creating description of html-files
8487 
8488  /*
8489  //======================================================================
8490  // Creating description HELP.html file:
8491  htmlFile.open("HELP.html");
8492  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">"<< std::endl;
8493  htmlFile << "<head>"<< std::endl;
8494  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>"<< std::endl;
8495  htmlFile << "<title> Certification Monitoring Tool </title>"<< std::endl;
8496  htmlFile << "<style type=\"text/css\">"<< std::endl;
8497  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"<< std::endl;
8498  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }"<< std::endl;
8499  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; text-align: center;}"<< std::endl;
8500  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }"<< std::endl;
8501  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }"<< std::endl;
8502  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }"<< std::endl;
8503  htmlFile << "</style>"<< std::endl;
8504  htmlFile << "<body>"<< std::endl;
8505  htmlFile << "<h1> Description of Remote Monitoring Tool criteria for bad channel selection</h1>"<< std::endl;
8506  htmlFile << "<br>"<< std::endl;
8507  htmlFile << "<h3> - CAPID Errors assuming we inspect CAPID non-rotation,error & validation bits, and for this criterion - no need to apply any cuts to select bcs.</h3> "<< std::endl;
8508  htmlFile << "<br>"<< std::endl;
8509  htmlFile << "<h3> - Amplitude is full amplitude collected over all time slices </h3> "<< std::endl;
8510  htmlFile << "<h3> - Ratio criterion is where we define as a bad, the channels, for which the signal portion in 4 middle TSs(plus one, minus two around TS with maximal amplitude) is out of some range of reasonable values </h3> "<< std::endl;
8511  htmlFile << "<br>"<< std::endl;
8512  htmlFile << "<h3> - Width of shape distribution. Width is defined as square root from dispersion. </h3> "<< std::endl;
8513  htmlFile << "<br>"<< std::endl;
8514  htmlFile << "<h3> - Mean TS time slice position of adc signal. </h3> "<< std::endl;
8515  htmlFile << "<br>"<< std::endl;
8516  htmlFile << "<h3> - TS number of maximum signal </h3> "<< std::endl;
8517  htmlFile << "<br>"<< std::endl;
8518  htmlFile << "<h3> For more details see https://twiki.cern.ch/twiki/bin/viewauth/CMS/HcalRemoteCertificationMonitoring </h3> "<< std::endl;
8519  htmlFile << "</body> " << std::endl;
8520  htmlFile << "</html> " << std::endl;
8521  htmlFile.close();
8522 */
8523  //======================================================================
8524  // Creating description CMTresults.html file:
8525  htmlFile.open("CMTresults.html");
8526  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
8527  htmlFile << "<head>" << std::endl;
8528  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
8529  htmlFile << "<title> Certification Monitoring Tool </title>" << std::endl;
8530  htmlFile << "<style type=\"text/css\">" << std::endl;
8531  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
8532  << std::endl;
8533  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
8534  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
8535  "text-align: center;}"
8536  << std::endl;
8537  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
8538  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
8539  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
8540  htmlFile << "</style>" << std::endl;
8541  htmlFile << "<body>" << std::endl;
8542  htmlFile << "<h1> LS-certification (recommendation) from analysis of CMT-dependencies of THIS run </h1>"
8543  << std::endl;
8544  htmlFile << "<br>" << std::endl;
8545  htmlFile << "<br>" << std::endl;
8546  htmlFile << "<h2> - List of suspicious LSs: </h2> " << std::endl;
8547  htmlFile << "<br>" << std::endl;
8548  htmlFile << "<h3> to be added </h3> " << std::endl;
8549  htmlFile << "<br>" << std::endl;
8550  htmlFile << "<br>" << std::endl;
8551  htmlFile << "<br>" << std::endl;
8552  htmlFile << "<h2> - Comments: </h2> " << std::endl;
8553  htmlFile << "<br>" << std::endl;
8554  htmlFile << "<h3> to be added </h3> " << std::endl;
8555  htmlFile << "<br>" << std::endl;
8556  htmlFile << "<br>" << std::endl;
8557  htmlFile << "<br>" << std::endl;
8558  htmlFile << "</body> " << std::endl;
8559  htmlFile << "</html> " << std::endl;
8560  htmlFile.close();
8561 
8562  //======================================================================
8563  // Creating main html file:
8564 
8565  htmlFile.open("LumiList.html");
8566  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
8567  htmlFile << "<head>" << std::endl;
8568  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
8569  htmlFile << "<title> Certification Monitoring Tool </title>" << std::endl;
8570  htmlFile << "<style type=\"text/css\">" << std::endl;
8571  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
8572  << std::endl;
8573  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
8574  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
8575  "text-align: center;}"
8576  << std::endl;
8577  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
8578  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
8579  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
8580  htmlFile << " td.s5 { font-family: arial, arial ce, helvetica; background-color: #00FF00; }" << std::endl;
8581  htmlFile << " td.s6 { font-family: arial, arial ce, helvetica; background-color: #FF0000; }" << std::endl;
8582 
8583  htmlFile << "</style>" << std::endl;
8584  htmlFile << "<body>" << std::endl;
8585 
8586  htmlFile << "<h1> Certification Monitoring Tool, GLOBAL RUN = " << runnumber << ". </h1>" << std::endl;
8587  htmlFile << "<br>" << std::endl;
8588  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8589  << "/CMTresults.html\"> CMT-analysis RESULTS (for this run) </a></td>" << std::endl;
8590  htmlFile << "<br>" << std::endl;
8591  htmlFile << "<br>" << std::endl;
8592 
8593  // htmlFile << "<h2> 1. General information </h2>"<< std::endl;
8594  htmlFile << "<h2> 1. General information (Full number of LS = " << MaxLum << " ). </h2>" << std::endl;
8595  htmlFile << " <img src=\"LumiEvent.png\" />" << std::endl;
8596  htmlFile << "<br>" << std::endl;
8597 
8598  htmlFile << "<h2> 2. HCAL status for different criteria </h2>" << std::endl;
8599  // htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_"<<runnumber<<"/HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
8600  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/HELP.html\"> "
8601  "Description of criteria for bad channel selection</a></td>"
8602  << std::endl;
8603  htmlFile << "<br>" << std::endl;
8604  htmlFile << "<table width=\"600\">" << std::endl;
8605  htmlFile << "<tr>" << std::endl;
8606  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8607  << "/CapID_GL.html\">Cap ID errors</a></td>" << std::endl;
8608  // AZ 11.03.2019
8609  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8610  << "/ADCampl_GL.html\">Amplitude</a></td>" << std::endl;
8611  // htmlFile << " <td><a href=\"ADCampl_GL.html\">Amplitude</a></td>"<< std::endl;
8612  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8613  << "/Width_GL.html\">Width</a></td>" << std::endl;
8614  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8615  << "/Ratio_GL.html\">Ratio</a></td>" << std::endl;
8616  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8617  << "/Tmean_GL.html\">TS mean</a></td>" << std::endl;
8618  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8619  << "/Tmax_GL.html\">TS max</a></td>" << std::endl;
8620 
8621  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8622  << "/SummedAmplitudes_GL.html\">SummedAmplitudes</a></td>" << std::endl;
8623 
8624  htmlFile << "</tr>" << std::endl;
8625  htmlFile << "</table>" << std::endl;
8626  htmlFile << "<br>" << std::endl;
8627  htmlFile << "</body> " << std::endl;
8628  htmlFile << "</html> " << std::endl;
8629  htmlFile.close();
8630  //======================================================================
8631 
8632  //======================================================================
8633  // Close and delete all possible things:
8634  hfile->Close();
8635  // hfile->Delete();
8636  // Exit Root
8637  gSystem->Exit(0);
8638  //======================================================================
8639 }
8640 
8641 // ------------------------------------------------------------
8642 
8643 int copyContents(TH1F **hDest, TString hname, TString htitle, const TH1F *hSrc, int lastBin) {
8644  if (lastBin > hSrc->GetNbinsX()) {
8645  std::cout << "copyContents from " << hSrc->GetName() << ": histo has " << hSrc->GetNbinsX()
8646  << " bins, when lastBin=" << lastBin << " was requested\n";
8647  return 0;
8648  }
8649 
8650  (*hDest) = new TH1F(hname, htitle, lastBin, 0, lastBin);
8651  (*hDest)->SetDirectory(0);
8652  (*hDest)->SetStats(0);
8653 
8654  for (int ibin = 1; ibin <= lastBin; ibin++) {
8655  (*hDest)->SetBinContent(ibin, hSrc->GetBinContent(ibin));
8656  (*hDest)->SetBinError(ibin, hSrc->GetBinError(ibin));
8657  }
8658  return 1;
8659 }
8660 
8661 // ------------------------------------------------------------
change_name.diff
diff
Definition: change_name.py:13
cmsBatch.argv
argv
Definition: cmsBatch.py:279
mps_fire.i
i
Definition: mps_fire.py:355
dir2webdir.argc
argc
Definition: dir2webdir.py:39
METSignificanceParams_cfi.jeta
jeta
Definition: METSignificanceParams_cfi.py:12
gather_cfg.cout
cout
Definition: gather_cfg.py:144
BTaggingMonitor_cfi.met
met
Definition: BTaggingMonitor_cfi.py:84
copyContents
int copyContents(TH1F **hDest, TString hname, TString htitle, const TH1F *hSrc, int lastBin)
Definition: RemoteMonitoringGLOBAL.cc:8643
main
int main(int argc, char *argv[])
Definition: RemoteMonitoringGLOBAL.cc:35
test
Definition: SmallWORMDict.h:13
ctpps_dqm_sourceclient-live_cfg.test
test
Definition: ctpps_dqm_sourceclient-live_cfg.py:7
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
dqmdumpme.k
k
Definition: dqmdumpme.py:60
LEDCalibrationChannels.depth
depth
Definition: LEDCalibrationChannels.py:65
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
LogEleMapdb.h
cond::runnumber
Definition: Time.h:19
dumpMFGeometry_cfg.delta
delta
Definition: dumpMFGeometry_cfg.py:25
remoteMonitoring_LED_IterMethod_cfg.lsmax
lsmax
Definition: remoteMonitoring_LED_IterMethod_cfg.py:215
createfilelist.int
int
Definition: createfilelist.py:10
alignmentValidation.c1
c1
do drawing
Definition: alignmentValidation.py:1025
NULL
#define NULL
Definition: scimark2.h:8
alignmentValidation.fname
string fname
main script
Definition: alignmentValidation.py:959
hi
Definition: HiEvtPlaneList.h:38
std
Definition: JetResolutionObject.h:76
isum
double isum
Definition: MuScleFitUtils.cc:77
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66