CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
RemoteMonitoringGLOBALTest.cc File Reference
#include "LogEleMapdb.h"
#include <iostream>
#include <fstream>
#include "TH1.h"
#include "TH2.h"
#include "TCanvas.h"
#include "TROOT.h"
#include <TMath.h>
#include "TStyle.h"
#include "TSystem.h"
#include "TLegend.h"
#include "TText.h"
#include "TAxis.h"
#include "TFile.h"
#include "TLine.h"
#include "TGraph.h"
#include <THStack.h>
#include <TPaveText.h>

Go to the source code of this file.

Functions

int copyContents (TH1F **hDest, TString hname, TString htitle, const TH1F *hSrc, int lastBin)
 
int main (int argc, char *argv[])
 

Function Documentation

int copyContents ( TH1F **  hDest,
TString  hname,
TString  htitle,
const TH1F *  hSrc,
int  lastBin 
)
int main ( int  argc,
char *  argv[] 
)

errA with average Amplitudes

errA with average Amplitudes

errA with average Amplitudes

errA with average Amplitudes

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

Summed Amplitude Plots:

RBX:

Definition at line 32 of file RemoteMonitoringGLOBALTest.cc.

References alignmentValidation::c1, copyContents(), gather_cfg::cout, CommonMethods::delta(), HLT_FULL_cff::depth, change_name::diff, alignmentValidation::fname, mps_fire::i, isum, dqmiolumiharvest::j, isotrackApplyRegressor::k, remoteMonitoring_LASER_era2018_cfg::lsmax, objects.METAnalyzer::met, NULL, cond::runnumber, mathSSE::sqrt(), AlCaHLTBitMon_QueryRunRegistry::string, and ctpps_dqm_sourceclient-live_cfg::test.

32  {
33  gROOT->Reset();
34  gROOT->SetStyle("Plain");
35  gStyle->SetOptStat(0);
36  gStyle->SetOptTitle(1);
37 
38  if (argc < 1)
39  return 1;
40  char fname[300];
41  sprintf(fname, "%s", argv[1]);
42  std::cout << fname << std::endl;
43 
44  //======================================================================
45  // Connect the input files, parameters and get the 2-d histogram in memory
46  // TFile *hfile= new TFile("GlobalHist.root", "READ");
47  string promt = (string)fname;
48  string runnumber = "";
49  for (unsigned int i = promt.size() - 11; i < promt.size() - 5; i++)
50  runnumber += fname[i];
51 
52  TFile *hfile = new TFile(fname, "READ");
53  // Cut [test][sub][depth]
54  // Empty HB HE HO HF
55  double Cut0[7][5][8] = {
56  {{0., 0., 0., 0., 0., 0., 0., 0.},
57  {0., 1.0, 1.0, 0., 0., 0., 0., 0.},
58  {0., 1., 1., 1., 0., 0., 0., 0.},
59  {0., 0., 0., 0., 1., 0., 0., 0.},
60  {0., 1., 1., 0., 0., 0., 0., 0.}}, //CapID 0,HB,HE,HO,HF
61  // {{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
62  {{0., 0., 0., 0., 0., 0., 0., 0.},
63  {0., 3500., 3500., 3500., 3500., 0., 0., 0.},
64  {0., 12000., 4500., 3500., 3500., 4000., 4500., 5500.},
65  {0., 0., 0., 0., 200., 0., 0., 0.},
66  {0., 4500., 4500., 4500., 4500., 0., 0., 0.}}, //Amplitude 0,HB,HE,HO,HF
67  {{0., 0., 0., 0., 0., 0., 0., 0.},
68  {0., 3., 3., 0., 0., 0., 0., 0.},
69  {0., 3., 3., 3., 0., 0., 0., 0.},
70  {0., 0., 0., 0., 3., 0., 0., 0.},
71  {0., 2., 2., 0., 0., 0., 0., 0.}}, //Width 0,HB,HE,HO,HF
72  {{0., 0., 0., 0., 0., 0., 0., 0.},
73  {0., 0.4, 0.4, 0., 0., 0., 0., 0.},
74  {0., 0.4, 0.4, 0.4, 0., 0., 0., 0.},
75  {0., 0., 0., 0., 0.4, 0., 0., 0.},
76  {0., 0.8, 0.8, 0., 0., 0., 0., 0.}}, //Ratio 0,HB,HE,HO,HF
77  {{0., 0., 0., 0., 0., 0., 0., 0.},
78  {0., 4.7, 4.7, 0., 0., 0., 0., 0.},
79  {0., 4.8, 4.8, 5.0, 0., 0., 0., 0.},
80  {0., 0., 0., 0., 4.8, 0., 0., 0.},
81  {0., 4.0, 4.0, 0., 0., 0., 0., 0.}}, //TSn 0,HB,HE,HO,HF
82  {{0., 0., 0., 0., 0., 0., 0., 0.},
83  {0., 3.5, 3.5, 0., 0., 0., 0., 0.},
84  {0., 4.0, 4.0, 4.0, 0., 0., 0., 0.},
85  {0., 0., 0., 0., 3., 0., 0., 0.},
86  {0., 3.5, 3.5, 0., 0., 0., 0., 0.}}, //TSx 0,HB,HE,HO,HF
87  {{0., 0., 0., 0., 0., 0., 0., 0.},
88  {0., 0., 0., 0., 0., 0., 0., 0.},
89  {0., 0., 0., 0., 0., 0., 0., 0.},
90  {0., 0., 0., 0., 0., 0., 0., 0.},
91  {0., 0., 0., 0., 0., 0., 0., 0.}}}; //Empty
92 
93  double CutAb[5][8] = {{0., 0., 0., 0., 0., 0., 0., 0.},
94  {0., 20., 7., 0., 0., 0., 0., 0.},
95  {0., 16., 13., 4., 0., 0., 0., 0.},
96  {0., 0., 0., 0., 45., 0., 0., 0.},
97  {0., 10., 5., 0., 0., 0., 0., 0.}}; // cut 1 for CapIdErrors 0,HB,HE,HO,HF
98 
99  double CutPo[5][8] = {{0., 0., 0., 0., 0., 0., 0., 0.},
100  {0., 9., 3., 0., 0., 0., 0., 0.},
101  {0., 8., 6., 2., 0., 0., 0., 0.},
102  {0., 0., 0., 0., 20., 0., 0., 0.},
103  {0., 5., 3., 0., 0., 0., 0., 0.}}; //cut 3 for CapIdErrors (portions) 0,HB,HE,HO,HF
104 
105  //======================================================================
106 
107  // CUTs FOR IPHI RBX:
108  int cutA_HB = 100;
109  int cutA_HE = 6000;
110  int cutA_HO = 150;
111  int cutA_HF = 500;
112  // CUTs FOR IETA RBX:
113  int cutB_HB = 100;
114  int cutB_HE = 10000;
115  int cutB_HO = 150;
116  int cutB_HF = 500;
117 
118  //======================================================================
119  // Prepare histograms and plot them to .png files
120  TCanvas *c1 = new TCanvas("c1", "Hcal4test", 200, 10, 700, 900);
121 
122  TCanvas *cHB = new TCanvas("cHB", "cHB", 1000, 500);
123  TCanvas *cHE = new TCanvas("cHE", "cHE", 1500, 500);
124  TCanvas *cONE = new TCanvas("cONE", "cONE", 500, 500);
125  TCanvas *cFour = new TCanvas("cFour", "cFour", 1500, 1000);
126  TCanvas *cFour1 = new TCanvas("cFour1", "cFour1", 1200, 800);
127  TCanvas *cNine = new TCanvas("cNine", "cNine", 1500, 1500);
128 
129  // RBX:
130  // TCanvas *c4x6 = new TCanvas("c4x6","c4x6",1500,3000);
131  TCanvas *c4x6 = new TCanvas("c4x6", "c4x6", 1200, 2400);
132  //TCanvas *c5x6 = new TCanvas("c5x6","c5x6",2000,3000);
133  TCanvas *c5x6 = new TCanvas("c5x6", "c5x6", 1500, 2400);
134  // TCanvas *cRBX1 = new TCanvas("cRBX1","cRBX1",200,10,1300,1110);
135  TCanvas *cRBX1 = new TCanvas("cRBX1", "cRBX1", 1200, 1000);
136  //
137  // TCanvas *cRBX31 = new TCanvas("cRBX31","cRBX31",1800,600);
138  TCanvas *cRBX31 = new TCanvas("cRBX31", "cRBX31", 1860, 600);
139  // TCanvas *cRBX31 = new TCanvas("cRBX31","cRBX31",200,10,,1800,600);
140 
141  // char *str = (char*)alloca(10000);
142 
143  int k_min[5] = {0, 1, 1, 4, 1}; // minimum depth for each subdet HB HE HO HF
144 
145  int k_max[5] = {0, 2, 3, 4, 2}; // maximum depth for each subdet HB HE HO HF
146  // int k_maxupgrade[5]={0,2,3,4,4}; // maximum depth for each subdet HB HE HO HF
147  int k_maxupgrade[5] = {0, 4, 7, 4, 4}; // maximum depth for each subdet HB HE HO HF
148 
149  //+++++++++++++++++++++++++++++
150  // Lumi iLumi and number of events
151  //+++++++++++++++++++++++++++++
152  cHB->Divide(2, 1);
153  cHB->cd(1);
154  TH1F *LumLum = (TH1F *)hfile->Get("h_lsnumber_per_eachLS");
155  int MaxLumDanila = LumLum->GetBinContent(LumLum->GetMaximumBin()); // old variant of Danila
156  cout << " MaxLumDanila= " << MaxLumDanila << endl;
157  gPad->SetGridy();
158  gPad->SetGridx();
159  LumLum->SetMarkerStyle(10);
160  LumLum->SetMarkerSize(0.8);
161  LumLum->GetYaxis()->SetLabelSize(0.04);
162  LumLum->SetTitle("Cont. number per LS \b");
163  LumLum->SetXTitle("Cont.number \b");
164  LumLum->SetYTitle("Ls \b");
165  LumLum->SetMarkerColor(4);
166  LumLum->SetLineColor(0);
167  LumLum->SetMinimum(0.8);
168  LumLum->GetXaxis()->SetRangeUser(0, MaxLumDanila);
169  LumLum->Draw("Error");
170 
171  cHB->cd(2);
172  TH1F *LumiEv = (TH1F *)hfile->Get("h_nevents_per_eachRealLS");
173  int MaxLum0 = LumiEv->GetBinContent(LumiEv->GetMaximumBin());
174  int MaxLum = 0;
175  for (int i = 1; i <= LumiEv->GetXaxis()->GetNbins(); i++) {
176  if (LumiEv->GetBinContent(i)) {
177  MaxLum = i;
178  }
179  }
180  cout << " MaxLum0= " << MaxLum0 << " MaxLum= " << MaxLum << endl;
181 
182  gPad->SetGridy();
183  gPad->SetGridx();
184  gPad->SetLogy();
185  // gPad->SetLogx();
186  LumiEv->GetYaxis()->SetLabelSize(0.04);
187  LumiEv->SetTitle("Number of events per LS");
188  LumiEv->SetXTitle("LS");
189  LumiEv->SetYTitle("Number of events ");
190  LumiEv->SetMarkerStyle(10);
191  LumiEv->SetMarkerSize(0.8);
192  LumiEv->SetMarkerColor(4);
193  LumiEv->SetLineColor(0);
194  // LumiEv->SetMinimum(0.8);
195  LumiEv->GetXaxis()->SetRangeUser(0, MaxLum);
196  LumiEv->Draw("Error");
197 
198  cHB->Print("LumiEvent.png");
199  cHB->Clear();
200 
201  //=======================================================================================================
202  // Shape criteria: 1d histogram first definition
203  //=======================================================================================================
204  TH1F *H_NumBadChanDepth[7][5][5]; // 1d histogramm for test,subdet, depth
205 
206  //+++++++++++++++++++++++++++++
207  // ADC Amplitude
208  //+++++++++++++++++++++++++++++
209 
210  H_NumBadChanDepth[1][1][1] = (TH1F *)hfile->Get("h_sumADCAmplLS1");
211  H_NumBadChanDepth[1][1][2] = (TH1F *)hfile->Get("h_sumADCAmplLS2");
212 
213  H_NumBadChanDepth[1][2][1] = (TH1F *)hfile->Get("h_sumADCAmplLS3");
214  H_NumBadChanDepth[1][2][2] = (TH1F *)hfile->Get("h_sumADCAmplLS4");
215  H_NumBadChanDepth[1][2][3] = (TH1F *)hfile->Get("h_sumADCAmplLS5");
216 
217  H_NumBadChanDepth[1][3][4] = (TH1F *)hfile->Get("h_sumADCAmplLS8");
218 
219  H_NumBadChanDepth[1][4][1] = (TH1F *)hfile->Get("h_sumADCAmplLS6");
220  H_NumBadChanDepth[1][4][2] = (TH1F *)hfile->Get("h_sumADCAmplLS7");
221 
222  //+++++++++++++++++++++++++++++
223  // Width
224  //+++++++++++++++++++++++++++++
225 
226  H_NumBadChanDepth[2][1][1] = (TH1F *)hfile->Get("h_sumAmplitudeLS1");
227  H_NumBadChanDepth[2][1][2] = (TH1F *)hfile->Get("h_sumAmplitudeLS2");
228 
229  H_NumBadChanDepth[2][2][1] = (TH1F *)hfile->Get("h_sumAmplitudeLS3");
230  H_NumBadChanDepth[2][2][2] = (TH1F *)hfile->Get("h_sumAmplitudeLS4");
231  H_NumBadChanDepth[2][2][3] = (TH1F *)hfile->Get("h_sumAmplitudeLS5");
232 
233  H_NumBadChanDepth[2][3][4] = (TH1F *)hfile->Get("h_sumAmplitudeLS8");
234 
235  H_NumBadChanDepth[2][4][1] = (TH1F *)hfile->Get("h_sumAmplitudeLS6");
236  H_NumBadChanDepth[2][4][2] = (TH1F *)hfile->Get("h_sumAmplitudeLS7");
237 
238  //+++++++++++++++++++++++++++++
239  // Ratio
240  //+++++++++++++++++++++++++++++
241 
242  H_NumBadChanDepth[3][1][1] = (TH1F *)hfile->Get("h_sumAmplLS1");
243  H_NumBadChanDepth[3][1][2] = (TH1F *)hfile->Get("h_sumAmplLS2");
244 
245  H_NumBadChanDepth[3][2][1] = (TH1F *)hfile->Get("h_sumAmplLS3");
246  H_NumBadChanDepth[3][2][2] = (TH1F *)hfile->Get("h_sumAmplLS4");
247  H_NumBadChanDepth[3][2][3] = (TH1F *)hfile->Get("h_sumAmplLS5");
248 
249  H_NumBadChanDepth[3][3][4] = (TH1F *)hfile->Get("h_sumAmplLS8");
250 
251  H_NumBadChanDepth[3][4][1] = (TH1F *)hfile->Get("h_sumAmplLS6");
252  H_NumBadChanDepth[3][4][2] = (TH1F *)hfile->Get("h_sumAmplLS7");
253 
254  //+++++++++++++++++++++++++++++
255  // Tmean
256  //+++++++++++++++++++++++++++++
257 
258  H_NumBadChanDepth[4][1][1] = (TH1F *)hfile->Get("h_sumTSmeanALS1");
259  H_NumBadChanDepth[4][1][2] = (TH1F *)hfile->Get("h_sumTSmeanALS2");
260 
261  H_NumBadChanDepth[4][2][1] = (TH1F *)hfile->Get("h_sumTSmeanALS3");
262  H_NumBadChanDepth[4][2][2] = (TH1F *)hfile->Get("h_sumTSmeanALS4");
263  H_NumBadChanDepth[4][2][3] = (TH1F *)hfile->Get("h_sumTSmeanALS5");
264 
265  H_NumBadChanDepth[4][3][4] = (TH1F *)hfile->Get("h_sumTSmeanALS8");
266 
267  H_NumBadChanDepth[4][4][1] = (TH1F *)hfile->Get("h_sumTSmeanALS6");
268  H_NumBadChanDepth[4][4][2] = (TH1F *)hfile->Get("h_sumTSmeanALS7");
269 
270  //+++++++++++++++++++++++++++++
271  // Tmax
272  //+++++++++++++++++++++++++++++
273 
274  H_NumBadChanDepth[5][1][1] = (TH1F *)hfile->Get("h_sumTSmaxALS1");
275  H_NumBadChanDepth[5][1][2] = (TH1F *)hfile->Get("h_sumTSmaxALS2");
276 
277  H_NumBadChanDepth[5][2][1] = (TH1F *)hfile->Get("h_sumTSmaxALS3");
278  H_NumBadChanDepth[5][2][2] = (TH1F *)hfile->Get("h_sumTSmaxALS4");
279  H_NumBadChanDepth[5][2][3] = (TH1F *)hfile->Get("h_sumTSmaxALS5");
280 
281  H_NumBadChanDepth[5][3][4] = (TH1F *)hfile->Get("h_sumTSmaxALS8");
282 
283  H_NumBadChanDepth[5][4][1] = (TH1F *)hfile->Get("h_sumTSmaxALS6");
284  H_NumBadChanDepth[5][4][2] = (TH1F *)hfile->Get("h_sumTSmaxALS7");
285 
286  gStyle->SetOptStat(110000);
287 
288  for (int test = 1; test <= 5; test++) { //Test: 0,
289  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
290  if (sub == 1)
291  cHB->Divide(2, 1);
292  if (sub == 2)
293  cHE->Divide(3, 1);
294  if (sub == 3)
295  cONE->Divide(1, 1);
296  if (sub == 4)
297  cHB->Divide(2, 1);
298  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
299  if (sub == 1)
300  cHB->cd(k);
301  if (sub == 2)
302  cHE->cd(k);
303  if (sub == 3)
304  cONE->cd(k - 3);
305  if (sub == 4)
306  cHB->cd(k);
307  gPad->SetGridy();
308  gPad->SetGridx();
309  gPad->SetLogy();
310  H_NumBadChanDepth[test][sub][k]->SetMarkerStyle(20);
311  H_NumBadChanDepth[test][sub][k]->SetMarkerSize(0.8);
312  if (k == 1)
313  H_NumBadChanDepth[test][sub][k]->SetTitle("Depth 1\b");
314  if (k == 2)
315  H_NumBadChanDepth[test][sub][k]->SetTitle("Depth 2\b");
316  if (k == 3)
317  H_NumBadChanDepth[test][sub][k]->SetTitle("Depth 3\b");
318  if (k == 4)
319  H_NumBadChanDepth[test][sub][k]->SetTitle("Depth 4\b");
320  if (test == 1)
321  H_NumBadChanDepth[test][sub][k]->SetXTitle(" <Amplitude> \b");
322  if (test == 2)
323  H_NumBadChanDepth[test][sub][k]->SetXTitle(" <Width> \b");
324  if (test == 3)
325  H_NumBadChanDepth[test][sub][k]->SetXTitle(" <Ratio> \b");
326  if (test == 4)
327  H_NumBadChanDepth[test][sub][k]->SetXTitle(" <TS mean> \b");
328  if (test == 5)
329  H_NumBadChanDepth[test][sub][k]->SetXTitle(" <TS max> \b");
330  H_NumBadChanDepth[test][sub][k]->SetYTitle("Number of channel-LSs\b");
331  H_NumBadChanDepth[test][sub][k]->SetMarkerColor(4);
332  H_NumBadChanDepth[test][sub][k]->SetLineColor(0);
333  // H_NumBadChanDepth[test][sub][k]->GetXaxis()->SetRangeUser(0, MaxLum);
334  H_NumBadChanDepth[test][sub][k]->SetMinimum(0.8);
335  H_NumBadChanDepth[test][sub][k]->Draw("Error");
336  }
337  if (test == 0) {
338  if (sub == 1) {
339  cHB->Print("H_NBCMNHB.png");
340  cHB->Clear();
341  }
342  if (sub == 2) {
343  cHE->Print("H_NBCMNHE.png");
344  cHE->Clear();
345  }
346  if (sub == 3) {
347  cONE->Print("H_NBCMNHO.png");
348  cONE->Clear();
349  }
350  if (sub == 4) {
351  cHB->Print("H_NBCMNHF.png");
352  cHB->Clear();
353  }
354  }
355 
356  if (test == 1) {
357  if (sub == 1) {
358  cHB->Print("H_ADCamplHB.png");
359  cHB->Clear();
360  }
361  if (sub == 2) {
362  cHE->Print("H_ADCamplHE.png");
363  cHE->Clear();
364  }
365  if (sub == 3) {
366  cONE->Print("H_ADCamplHO.png");
367  cONE->Clear();
368  }
369  if (sub == 4) {
370  cHB->Print("H_ADCamplHF.png");
371  cHB->Clear();
372  }
373  }
374  if (test == 2) {
375  if (sub == 1) {
376  cHB->Print("H_WidthHB.png");
377  cHB->Clear();
378  }
379  if (sub == 2) {
380  cHE->Print("H_WidthHE.png");
381  cHE->Clear();
382  }
383  if (sub == 3) {
384  cONE->Print("H_WidthHO.png");
385  cONE->Clear();
386  }
387  if (sub == 4) {
388  cHB->Print("H_WidthHF.png");
389  cHB->Clear();
390  }
391  }
392  if (test == 3) {
393  if (sub == 1) {
394  cHB->Print("H_RatioHB.png");
395  cHB->Clear();
396  }
397  if (sub == 2) {
398  cHE->Print("H_RatioHE.png");
399  cHE->Clear();
400  }
401  if (sub == 3) {
402  cONE->Print("H_RatioHO.png");
403  cONE->Clear();
404  }
405  if (sub == 4) {
406  cHB->Print("H_RatioHF.png");
407  cHB->Clear();
408  }
409  }
410  if (test == 4) {
411  if (sub == 1) {
412  cHB->Print("H_TmeanHB.png");
413  cHB->Clear();
414  }
415  if (sub == 2) {
416  cHE->Print("H_TmeanHE.png");
417  cHE->Clear();
418  }
419  if (sub == 3) {
420  cONE->Print("H_TmeanHO.png");
421  cONE->Clear();
422  }
423  if (sub == 4) {
424  cHB->Print("H_TmeanHF.png");
425  cHB->Clear();
426  }
427  }
428  if (test == 5) {
429  if (sub == 1) {
430  cHB->Print("H_TmaxHB.png");
431  cHB->Clear();
432  }
433  if (sub == 2) {
434  cHE->Print("H_TmaxHE.png");
435  cHE->Clear();
436  }
437  if (sub == 3) {
438  cONE->Print("H_TmaxHO.png");
439  cONE->Clear();
440  }
441  if (sub == 4) {
442  cHB->Print("H_TmaxHF.png");
443  cHB->Clear();
444  }
445  }
446  } // end sub
447  } //end test
448 
449  gStyle->SetOptStat(0);
450  //================================================================================================================================
451 
452  //=======================================================================================================
453  // 2-d histograms second definition
454  //=========================================================
455  TH2F *MapNumBadChanDepth[7][5][5]; // 1d Mapogramm for test,subdet, depth
456  TH2F *MapNumChanDepth[7][5][5]; // 1d Mapogramm for test,subdet, depth
457  TH2F *MapNumBadChanFull[7]; // 1d Mapogramm for test
458  TH2F *MapNumChanFull[7]; // 1d Mapogramm for test
459 
460  //+++++++++++++++++++++++++++++
461  // CapID
462  //+++++++++++++++++++++++++++++
463 
464  MapNumBadChanDepth[0][1][1] = (TH2F *)hfile->Get("h_mapDepth1Error_HB");
465  MapNumBadChanDepth[0][1][2] = (TH2F *)hfile->Get("h_mapDepth2Error_HB");
466 
467  MapNumBadChanDepth[0][2][1] = (TH2F *)hfile->Get("h_mapDepth1Error_HE");
468  MapNumBadChanDepth[0][2][2] = (TH2F *)hfile->Get("h_mapDepth2Error_HE");
469  MapNumBadChanDepth[0][2][3] = (TH2F *)hfile->Get("h_mapDepth3Error_HE");
470 
471  MapNumBadChanDepth[0][3][4] = (TH2F *)hfile->Get("h_mapDepth4Error_HO");
472 
473  MapNumBadChanDepth[0][4][1] = (TH2F *)hfile->Get("h_mapDepth1Error_HF");
474  MapNumBadChanDepth[0][4][2] = (TH2F *)hfile->Get("h_mapDepth2Error_HF");
475 
476  MapNumBadChanFull[0] = (TH2F *)MapNumBadChanDepth[0][1][1]->Clone();
477 
478  MapNumChanDepth[0][1][1] = (TH2F *)hfile->Get("h_mapDepth1_HB");
479  MapNumChanDepth[0][1][2] = (TH2F *)hfile->Get("h_mapDepth2_HB");
480 
481  MapNumChanDepth[0][2][1] = (TH2F *)hfile->Get("h_mapDepth1_HE");
482  MapNumChanDepth[0][2][2] = (TH2F *)hfile->Get("h_mapDepth2_HE");
483  MapNumChanDepth[0][2][3] = (TH2F *)hfile->Get("h_mapDepth3_HE");
484 
485  MapNumChanDepth[0][3][4] = (TH2F *)hfile->Get("h_mapDepth4_HO");
486 
487  MapNumChanDepth[0][4][1] = (TH2F *)hfile->Get("h_mapDepth1_HF");
488  MapNumChanDepth[0][4][2] = (TH2F *)hfile->Get("h_mapDepth2_HF");
489 
490  MapNumChanFull[0] = (TH2F *)MapNumChanDepth[0][1][1]->Clone();
491 
492  //+++++++++++++++++++++++++++++
493  // ADC Amplitude
494  //+++++++++++++++++++++++++++++
495 
496  MapNumBadChanDepth[1][1][1] = (TH2F *)hfile->Get("h_2DsumADCAmplLS1");
497  MapNumBadChanDepth[1][1][2] = (TH2F *)hfile->Get("h_2DsumADCAmplLS2");
498 
499  MapNumBadChanDepth[1][2][1] = (TH2F *)hfile->Get("h_2DsumADCAmplLS3");
500  MapNumBadChanDepth[1][2][2] = (TH2F *)hfile->Get("h_2DsumADCAmplLS4");
501  MapNumBadChanDepth[1][2][3] = (TH2F *)hfile->Get("h_2DsumADCAmplLS5");
502 
503  MapNumBadChanDepth[1][3][4] = (TH2F *)hfile->Get("h_2DsumADCAmplLS8");
504 
505  MapNumBadChanDepth[1][4][1] = (TH2F *)hfile->Get("h_2DsumADCAmplLS6");
506  MapNumBadChanDepth[1][4][2] = (TH2F *)hfile->Get("h_2DsumADCAmplLS7");
507 
508  MapNumBadChanFull[1] = (TH2F *)MapNumBadChanDepth[1][1][1]->Clone();
509 
510  MapNumChanDepth[1][1][1] = (TH2F *)hfile->Get("h_2D0sumADCAmplLS1");
511  MapNumChanDepth[1][1][2] = (TH2F *)hfile->Get("h_2D0sumADCAmplLS2");
512 
513  MapNumChanDepth[1][2][1] = (TH2F *)hfile->Get("h_2D0sumADCAmplLS3");
514  MapNumChanDepth[1][2][2] = (TH2F *)hfile->Get("h_2D0sumADCAmplLS4");
515  MapNumChanDepth[1][2][3] = (TH2F *)hfile->Get("h_2D0sumADCAmplLS5");
516 
517  MapNumChanDepth[1][3][4] = (TH2F *)hfile->Get("h_2D0sumADCAmplLS8");
518 
519  MapNumChanDepth[1][4][1] = (TH2F *)hfile->Get("h_2D0sumADCAmplLS6");
520  MapNumChanDepth[1][4][2] = (TH2F *)hfile->Get("h_2D0sumADCAmplLS7");
521 
522  MapNumChanFull[1] = (TH2F *)MapNumChanDepth[1][1][1]->Clone();
523 
524  //+++++++++++++++++++++++++++++
525  // Width
526  //+++++++++++++++++++++++++++++
527 
528  MapNumBadChanDepth[2][1][1] = (TH2F *)hfile->Get("h_2DsumAmplitudeLS1");
529  MapNumBadChanDepth[2][1][2] = (TH2F *)hfile->Get("h_2DsumAmplitudeLS2");
530 
531  MapNumBadChanDepth[2][2][1] = (TH2F *)hfile->Get("h_2DsumAmplitudeLS3");
532  MapNumBadChanDepth[2][2][2] = (TH2F *)hfile->Get("h_2DsumAmplitudeLS4");
533  MapNumBadChanDepth[2][2][3] = (TH2F *)hfile->Get("h_2DsumAmplitudeLS5");
534 
535  MapNumBadChanDepth[2][3][4] = (TH2F *)hfile->Get("h_2DsumAmplitudeLS8");
536 
537  MapNumBadChanDepth[2][4][1] = (TH2F *)hfile->Get("h_2DsumAmplitudeLS6");
538  MapNumBadChanDepth[2][4][2] = (TH2F *)hfile->Get("h_2DsumAmplitudeLS7");
539 
540  MapNumBadChanFull[2] = (TH2F *)MapNumBadChanDepth[2][1][1]->Clone();
541 
542  MapNumChanDepth[2][1][1] = (TH2F *)hfile->Get("h_2D0sumAmplitudeLS1");
543  MapNumChanDepth[2][1][2] = (TH2F *)hfile->Get("h_2D0sumAmplitudeLS2");
544 
545  MapNumChanDepth[2][2][1] = (TH2F *)hfile->Get("h_2D0sumAmplitudeLS3");
546  MapNumChanDepth[2][2][2] = (TH2F *)hfile->Get("h_2D0sumAmplitudeLS4");
547  MapNumChanDepth[2][2][3] = (TH2F *)hfile->Get("h_2D0sumAmplitudeLS5");
548 
549  MapNumChanDepth[2][3][4] = (TH2F *)hfile->Get("h_2D0sumAmplitudeLS8");
550 
551  MapNumChanDepth[2][4][1] = (TH2F *)hfile->Get("h_2D0sumAmplitudeLS6");
552  MapNumChanDepth[2][4][2] = (TH2F *)hfile->Get("h_2D0sumAmplitudeLS7");
553 
554  MapNumChanFull[2] = (TH2F *)MapNumChanDepth[2][1][1]->Clone();
555 
556  //+++++++++++++++++++++++++++++
557  // Ratio
558  //+++++++++++++++++++++++++++++
559 
560  MapNumBadChanDepth[3][1][1] = (TH2F *)hfile->Get("h_2DsumAmplLS1");
561  MapNumBadChanDepth[3][1][2] = (TH2F *)hfile->Get("h_2DsumAmplLS2");
562 
563  MapNumBadChanDepth[3][2][1] = (TH2F *)hfile->Get("h_2DsumAmplLS3");
564  MapNumBadChanDepth[3][2][2] = (TH2F *)hfile->Get("h_2DsumAmplLS4");
565  MapNumBadChanDepth[3][2][3] = (TH2F *)hfile->Get("h_2DsumAmplLS5");
566 
567  MapNumBadChanDepth[3][3][4] = (TH2F *)hfile->Get("h_2DsumAmplLS8");
568 
569  MapNumBadChanDepth[3][4][1] = (TH2F *)hfile->Get("h_2DsumAmplLS6");
570  MapNumBadChanDepth[3][4][2] = (TH2F *)hfile->Get("h_2DsumAmplLS7");
571 
572  MapNumBadChanFull[3] = (TH2F *)MapNumBadChanDepth[3][1][1]->Clone();
573 
574  MapNumChanDepth[3][1][1] = (TH2F *)hfile->Get("h_2D0sumAmplLS1");
575  MapNumChanDepth[3][1][2] = (TH2F *)hfile->Get("h_2D0sumAmplLS2");
576 
577  MapNumChanDepth[3][2][1] = (TH2F *)hfile->Get("h_2D0sumAmplLS3");
578  MapNumChanDepth[3][2][2] = (TH2F *)hfile->Get("h_2D0sumAmplLS4");
579  MapNumChanDepth[3][2][3] = (TH2F *)hfile->Get("h_2D0sumAmplLS5");
580 
581  MapNumChanDepth[3][3][4] = (TH2F *)hfile->Get("h_2D0sumAmplLS8");
582 
583  MapNumChanDepth[3][4][1] = (TH2F *)hfile->Get("h_2D0sumAmplLS6");
584  MapNumChanDepth[3][4][2] = (TH2F *)hfile->Get("h_2D0sumAmplLS7");
585 
586  MapNumChanFull[3] = (TH2F *)MapNumChanDepth[3][1][1]->Clone();
587 
588  //+++++++++++++++++++++++++++++
589  // Tmean
590  //+++++++++++++++++++++++++++++
591 
592  MapNumBadChanDepth[4][1][1] = (TH2F *)hfile->Get("h_2DsumTSmeanALS1");
593  MapNumBadChanDepth[4][1][2] = (TH2F *)hfile->Get("h_2DsumTSmeanALS2");
594 
595  MapNumBadChanDepth[4][2][1] = (TH2F *)hfile->Get("h_2DsumTSmeanALS3");
596  MapNumBadChanDepth[4][2][2] = (TH2F *)hfile->Get("h_2DsumTSmeanALS4");
597  MapNumBadChanDepth[4][2][3] = (TH2F *)hfile->Get("h_2DsumTSmeanALS5");
598 
599  MapNumBadChanDepth[4][3][4] = (TH2F *)hfile->Get("h_2DsumTSmeanALS8");
600 
601  MapNumBadChanDepth[4][4][1] = (TH2F *)hfile->Get("h_2DsumTSmeanALS6");
602  MapNumBadChanDepth[4][4][2] = (TH2F *)hfile->Get("h_2DsumTSmeanALS7");
603 
604  MapNumBadChanFull[4] = (TH2F *)MapNumBadChanDepth[4][1][1]->Clone();
605 
606  MapNumChanDepth[4][1][1] = (TH2F *)hfile->Get("h_2D0sumTSmeanALS1");
607  MapNumChanDepth[4][1][2] = (TH2F *)hfile->Get("h_2D0sumTSmeanALS2");
608 
609  MapNumChanDepth[4][2][1] = (TH2F *)hfile->Get("h_2D0sumTSmeanALS3");
610  MapNumChanDepth[4][2][2] = (TH2F *)hfile->Get("h_2D0sumTSmeanALS4");
611  MapNumChanDepth[4][2][3] = (TH2F *)hfile->Get("h_2D0sumTSmeanALS5");
612 
613  MapNumChanDepth[4][3][4] = (TH2F *)hfile->Get("h_2D0sumTSmeanALS8");
614 
615  MapNumChanDepth[4][4][1] = (TH2F *)hfile->Get("h_2D0sumTSmeanALS6");
616  MapNumChanDepth[4][4][2] = (TH2F *)hfile->Get("h_2D0sumTSmeanALS7");
617 
618  MapNumChanFull[4] = (TH2F *)MapNumChanDepth[4][1][1]->Clone();
619 
620  //+++++++++++++++++++++++++++++
621  // Tmax
622  //+++++++++++++++++++++++++++++
623 
624  MapNumBadChanDepth[5][1][1] = (TH2F *)hfile->Get("h_2DsumTSmaxALS1");
625  MapNumBadChanDepth[5][1][2] = (TH2F *)hfile->Get("h_2DsumTSmaxALS2");
626 
627  MapNumBadChanDepth[5][2][1] = (TH2F *)hfile->Get("h_2DsumTSmaxALS3");
628  MapNumBadChanDepth[5][2][2] = (TH2F *)hfile->Get("h_2DsumTSmaxALS4");
629  MapNumBadChanDepth[5][2][3] = (TH2F *)hfile->Get("h_2DsumTSmaxALS5");
630 
631  MapNumBadChanDepth[5][3][4] = (TH2F *)hfile->Get("h_2DsumTSmaxALS8");
632 
633  MapNumBadChanDepth[5][4][1] = (TH2F *)hfile->Get("h_2DsumTSmaxALS6");
634  MapNumBadChanDepth[5][4][2] = (TH2F *)hfile->Get("h_2DsumTSmaxALS7");
635 
636  MapNumBadChanFull[5] = (TH2F *)MapNumBadChanDepth[5][1][1]->Clone();
637 
638  MapNumChanDepth[5][1][1] = (TH2F *)hfile->Get("h_2D0sumTSmaxALS1");
639  MapNumChanDepth[5][1][2] = (TH2F *)hfile->Get("h_2D0sumTSmaxALS2");
640 
641  MapNumChanDepth[5][2][1] = (TH2F *)hfile->Get("h_2D0sumTSmaxALS3");
642  MapNumChanDepth[5][2][2] = (TH2F *)hfile->Get("h_2D0sumTSmaxALS4");
643  MapNumChanDepth[5][2][3] = (TH2F *)hfile->Get("h_2D0sumTSmaxALS5");
644 
645  MapNumChanDepth[5][3][4] = (TH2F *)hfile->Get("h_2D0sumTSmaxALS8");
646 
647  MapNumChanDepth[5][4][1] = (TH2F *)hfile->Get("h_2D0sumTSmaxALS6");
648  MapNumChanDepth[5][4][2] = (TH2F *)hfile->Get("h_2D0sumTSmaxALS7");
649 
650  MapNumChanFull[5] = (TH2F *)MapNumChanDepth[5][1][1]->Clone();
651 
652  for (int test = 0; test <= 5; test++) { //Test: 0,
653  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
654  if (sub == 1)
655  cHB->Divide(2, 1);
656  if (sub == 2)
657  cHE->Divide(3, 1);
658  if (sub == 3)
659  cONE->Divide(1, 1);
660  if (sub == 4)
661  cHB->Divide(2, 1);
662  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
663  if (sub == 1)
664  cHB->cd(k);
665  if (sub == 2)
666  cHE->cd(k);
667  if (sub == 3)
668  cONE->cd(k - 3);
669  if (sub == 4)
670  cHB->cd(k);
671  MapNumBadChanDepth[test][sub][k]->Divide(
672  MapNumBadChanDepth[test][sub][k], MapNumChanDepth[test][sub][k], 1, 1, "B");
673 
674  for (int x = 1; x <= MapNumBadChanFull[test]->GetXaxis()->GetNbins(); x++) {
675  for (int y = 1; y <= MapNumBadChanFull[test]->GetYaxis()->GetNbins(); y++) {
676  double ccc1 = MapNumBadChanDepth[test][sub][k]->GetBinContent(x, y);
677  MapNumBadChanFull[test]->SetBinContent(x, y, MapNumBadChanFull[test]->GetBinContent(x, y) + ccc1);
678  } //end y
679  } //end x
680 
681  if (k == 1)
682  MapNumBadChanDepth[test][sub][k]->SetTitle("Depth 1\b");
683  if (k == 2)
684  MapNumBadChanDepth[test][sub][k]->SetTitle("Depth 2\b");
685  if (k == 3)
686  MapNumBadChanDepth[test][sub][k]->SetTitle("Depth 3\b");
687  if (k == 4)
688  MapNumBadChanDepth[test][sub][k]->SetTitle("Depth 4\b");
689  gPad->SetGridy();
690  gPad->SetGridx();
691  gPad->SetLogz();
692  MapNumBadChanDepth[test][sub][k]->SetXTitle("#eta \b");
693  MapNumBadChanDepth[test][sub][k]->SetYTitle("#phi \b");
694  MapNumBadChanDepth[test][sub][k]->SetZTitle("Average estimator \b");
695  MapNumBadChanDepth[test][sub][k]->SetTitleOffset(0.75, "Z");
696  MapNumBadChanDepth[test][sub][k]->Draw("COLZ");
697  MapNumBadChanDepth[test][sub][k]->GetYaxis()->SetRangeUser(0, 72.);
698  // MapNumBadChanDepth[test][sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
699  }
700  if (test == 0) {
701  if (sub == 1) {
702  cHB->Print("MapCapIdErrorHB.png");
703  cHB->Clear();
704  }
705  if (sub == 2) {
706  cHE->Print("MapCapIdErrorHE.png");
707  cHE->Clear();
708  }
709  if (sub == 3) {
710  cONE->Print("MapCapIdErrorHO.png");
711  cONE->Clear();
712  }
713  if (sub == 4) {
714  cHB->Print("MapCapIdErrorHF.png");
715  cHB->Clear();
716  }
717  }
718  if (test == 1) {
719  if (sub == 1) {
720  cHB->Print("MapADCamplHB.png");
721  cHB->Clear();
722  }
723  if (sub == 2) {
724  cHE->Print("MapADCamplHE.png");
725  cHE->Clear();
726  }
727  if (sub == 3) {
728  cONE->Print("MapADCamplHO.png");
729  cONE->Clear();
730  }
731  if (sub == 4) {
732  cHB->Print("MapADCamplHF.png");
733  cHB->Clear();
734  }
735  }
736  if (test == 2) {
737  if (sub == 1) {
738  cHB->Print("MapWidthHB.png");
739  cHB->Clear();
740  }
741  if (sub == 2) {
742  cHE->Print("MapWidthHE.png");
743  cHE->Clear();
744  }
745  if (sub == 3) {
746  cONE->Print("MapWidthHO.png");
747  cONE->Clear();
748  }
749  if (sub == 4) {
750  cHB->Print("MapWidthHF.png");
751  cHB->Clear();
752  }
753  }
754  if (test == 3) {
755  if (sub == 1) {
756  cHB->Print("MapRatioHB.png");
757  cHB->Clear();
758  }
759  if (sub == 2) {
760  cHE->Print("MapRatioHE.png");
761  cHE->Clear();
762  }
763  if (sub == 3) {
764  cONE->Print("MapRatioHO.png");
765  cONE->Clear();
766  }
767  if (sub == 4) {
768  cHB->Print("MapRatioHF.png");
769  cHB->Clear();
770  }
771  }
772  if (test == 4) {
773  if (sub == 1) {
774  cHB->Print("MapTmeanHB.png");
775  cHB->Clear();
776  }
777  if (sub == 2) {
778  cHE->Print("MapTmeanHE.png");
779  cHE->Clear();
780  }
781  if (sub == 3) {
782  cONE->Print("MapTmeanHO.png");
783  cONE->Clear();
784  }
785  if (sub == 4) {
786  cHB->Print("MapTmeanHF.png");
787  cHB->Clear();
788  }
789  }
790  if (test == 5) {
791  if (sub == 1) {
792  cHB->Print("MapTmaxHB.png");
793  cHB->Clear();
794  }
795  if (sub == 2) {
796  cHE->Print("MapTmaxHE.png");
797  cHE->Clear();
798  }
799  if (sub == 3) {
800  cONE->Print("MapTmaxHO.png");
801  cONE->Clear();
802  }
803  if (sub == 4) {
804  cHB->Print("MapTmaxHF.png");
805  cHB->Clear();
806  }
807  }
808  } // end sub
809  cONE->Divide(1, 1);
810  cONE->cd(1);
811  gPad->SetGridy();
812  gPad->SetGridx();
813  gPad->SetLogz();
814  MapNumBadChanFull[test]->SetTitle("All subdetectors\b");
815  MapNumBadChanFull[test]->SetXTitle("#eta \b");
816  MapNumBadChanFull[test]->SetYTitle("#phi \b");
817  if (test == 0)
818  MapNumBadChanFull[test]->SetZTitle("Average Nbcs \b");
819  if (test != 0)
820  MapNumBadChanFull[test]->SetZTitle("Average estimator \b");
821  // MapNumBadChanFull[test]->GetZaxis()->SetLabelSize(0.008);
822  MapNumBadChanFull[test]->SetTitleOffset(0.75, "Z");
823  MapNumBadChanFull[test]->Draw("COLZ");
824  MapNumBadChanFull[test]->GetYaxis()->SetRangeUser(0, 72.);
825  // MapNumBadChanFull[test]->GetZaxis()->SetRangeUser(0.0001, 1.);
826  if (test == 0) {
827  cONE->Print("MapCapIdError.png");
828  cONE->Clear();
829  }
830  if (test == 1) {
831  cONE->Print("MapADCAmpl.png");
832  cONE->Clear();
833  }
834  if (test == 2) {
835  cONE->Print("MapWidth.png");
836  cONE->Clear();
837  }
838  if (test == 3) {
839  cONE->Print("MapRatio.png");
840  cONE->Clear();
841  }
842  if (test == 4) {
843  cONE->Print("MapTmean.png");
844  cONE->Clear();
845  }
846  if (test == 5) {
847  cONE->Print("MapTmax.png");
848  cONE->Clear();
849  }
850  } //end test
851 
852  //================================================================================================================================
853 
854  //=======================================================================================================
855  // 1-d histograms third definition
856 
857  TH1F *HistNumBadChanDepth[7][5][8]; // 1d histogramm for test,subdet, depth
858  TH1F *HistCutNumBadChanDepth[7][5][8]; // 1d histogramm for test,subdet, depth
859  TH1F *HistNumChanDepth[7][5][8]; // 1d histogramm for test,subdet, depth
860 
861  // TH1F *HistNumBadChanDepth[7][5][5]; // 1d histogramm for test,subdet, depth
862  // TH1F *HistCutNumBadChanDepth[7][5][5]; // 1d histogramm for test,subdet, depth
863  // TH1F *HistNumChanDepth[7][5][5]; // 1d histogramm for test,subdet, depth
864 
865  TH1F *HistNumBadChanFull[7]; // 1d histogramm for test
866  TH1F *HistNumChanFull[7]; // 1d histogramm for test
867 
868  //+++++++++++++++++++++++++++++
869  // Rate of Cap ID errors
870  //+++++++++++++++++++++++++++++
871 
872  HistNumBadChanDepth[0][1][1] = (TH1F *)hfile->Get("h_runnbadchannels_depth1_HB");
873  HistNumBadChanDepth[0][1][2] = (TH1F *)hfile->Get("h_runnbadchannels_depth2_HB");
874 
875  HistNumBadChanDepth[0][2][1] = (TH1F *)hfile->Get("h_runnbadchannels_depth1_HE");
876  HistNumBadChanDepth[0][2][2] = (TH1F *)hfile->Get("h_runnbadchannels_depth2_HE");
877  HistNumBadChanDepth[0][2][3] = (TH1F *)hfile->Get("h_runnbadchannels_depth3_HE");
878 
879  HistNumBadChanDepth[0][3][4] = (TH1F *)hfile->Get("h_runnbadchannels_depth4_HO");
880 
881  HistNumBadChanDepth[0][4][1] = (TH1F *)hfile->Get("h_runnbadchannels_depth1_HF");
882  HistNumBadChanDepth[0][4][2] = (TH1F *)hfile->Get("h_runnbadchannels_depth2_HF");
883 
884  HistNumBadChanFull[0] = (TH1F *)HistNumBadChanDepth[0][1][1]->Clone();
885 
886  HistCutNumBadChanDepth[0][1][1] = (TH1F *)hfile->Get("h_runnbadchannels_depth1_HB");
887  HistCutNumBadChanDepth[0][1][2] = (TH1F *)hfile->Get("h_runnbadchannels_depth2_HB");
888 
889  HistCutNumBadChanDepth[0][2][1] = (TH1F *)hfile->Get("h_runnbadchannels_depth1_HE");
890  HistCutNumBadChanDepth[0][2][2] = (TH1F *)hfile->Get("h_runnbadchannels_depth2_HE");
891  HistCutNumBadChanDepth[0][2][3] = (TH1F *)hfile->Get("h_runnbadchannels_depth3_HE");
892 
893  HistCutNumBadChanDepth[0][3][4] = (TH1F *)hfile->Get("h_runnbadchannels_depth4_HO");
894 
895  HistCutNumBadChanDepth[0][4][1] = (TH1F *)hfile->Get("h_runnbadchannels_depth1_HF");
896  HistCutNumBadChanDepth[0][4][2] = (TH1F *)hfile->Get("h_runnbadchannels_depth2_HF");
897 
898  HistNumChanDepth[0][1][1] = (TH1F *)hfile->Get("h_runbadrate0_depth1_HB");
899  HistNumChanDepth[0][1][2] = (TH1F *)hfile->Get("h_runbadrate0_depth2_HB");
900 
901  HistNumChanDepth[0][2][1] = (TH1F *)hfile->Get("h_runbadrate0_depth1_HE");
902  HistNumChanDepth[0][2][2] = (TH1F *)hfile->Get("h_runbadrate0_depth2_HE");
903  HistNumChanDepth[0][2][3] = (TH1F *)hfile->Get("h_runbadrate0_depth3_HE");
904 
905  HistNumChanDepth[0][3][4] = (TH1F *)hfile->Get("h_runbadrate0_depth4_HO");
906 
907  HistNumChanDepth[0][4][1] = (TH1F *)hfile->Get("h_runbadrate0_depth1_HF");
908  HistNumChanDepth[0][4][2] = (TH1F *)hfile->Get("h_runbadrate0_depth2_HF");
909 
910  HistNumChanFull[0] = (TH1F *)HistNumChanDepth[0][1][1]->Clone();
911 
912  //+++++++++++++++++++++++++++++
913  // ADC Amplitude
914  //+++++++++++++++++++++++++++++
915 
917  // HB:
918  HistNumBadChanDepth[1][1][1] = (TH1F *)hfile->Get("h_sumADCAmplperLS1");
919  HistNumBadChanDepth[1][1][2] = (TH1F *)hfile->Get("h_sumADCAmplperLS2");
920  // HB upgrade:
921  HistNumBadChanDepth[1][1][3] = (TH1F *)hfile->Get("h_sumADCAmplperLSdepth3HBu");
922  HistNumBadChanDepth[1][1][4] = (TH1F *)hfile->Get("h_sumADCAmplperLSdepth4HBu");
923 
924  // HE:
925  HistNumBadChanDepth[1][2][1] = (TH1F *)hfile->Get("h_sumADCAmplperLS3");
926  HistNumBadChanDepth[1][2][2] = (TH1F *)hfile->Get("h_sumADCAmplperLS4");
927  HistNumBadChanDepth[1][2][3] = (TH1F *)hfile->Get("h_sumADCAmplperLS5");
928  // HE upgrade:
929  HistNumBadChanDepth[1][2][4] = (TH1F *)hfile->Get("h_sumADCAmplperLSdepth4HEu");
930  HistNumBadChanDepth[1][2][5] = (TH1F *)hfile->Get("h_sumADCAmplperLSdepth5HEu");
931  HistNumBadChanDepth[1][2][6] = (TH1F *)hfile->Get("h_sumADCAmplperLSdepth6HEu");
932  HistNumBadChanDepth[1][2][7] = (TH1F *)hfile->Get("h_sumADCAmplperLSdepth7HEu");
933 
934  // HO:
935  HistNumBadChanDepth[1][3][4] = (TH1F *)hfile->Get("h_sumADCAmplperLS8");
936 
937  // HF:
938  HistNumBadChanDepth[1][4][1] = (TH1F *)hfile->Get("h_sumADCAmplperLS6");
939  HistNumBadChanDepth[1][4][2] = (TH1F *)hfile->Get("h_sumADCAmplperLS7");
940  // HF upgrade:
941  HistNumBadChanDepth[1][4][3] = (TH1F *)hfile->Get("h_sumADCAmplperLS6u");
942  HistNumBadChanDepth[1][4][4] = (TH1F *)hfile->Get("h_sumADCAmplperLS7u");
943 
944  // other cases:
945  HistNumBadChanFull[1] = (TH1F *)HistNumBadChanDepth[1][1][1]->Clone();
946 
948  // HB:
949  HistCutNumBadChanDepth[1][1][1] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS1");
950  HistCutNumBadChanDepth[1][1][2] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS2");
951  // HB upgrade:
952  HistCutNumBadChanDepth[1][1][3] = (TH1F *)hfile->Get("h_sumCutADCAmplperLSdepth3HBu");
953  HistCutNumBadChanDepth[1][1][4] = (TH1F *)hfile->Get("h_sumCutADCAmplperLSdepth4HBu");
954 
955  // HE:
956  HistCutNumBadChanDepth[1][2][1] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS3");
957  HistCutNumBadChanDepth[1][2][2] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS4");
958  HistCutNumBadChanDepth[1][2][3] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS5");
959  // HE upgrade:
960  HistCutNumBadChanDepth[1][2][4] = (TH1F *)hfile->Get("h_sumCutADCAmplperLSdepth4HEu");
961  HistCutNumBadChanDepth[1][2][5] = (TH1F *)hfile->Get("h_sumCutADCAmplperLSdepth5HEu");
962  HistCutNumBadChanDepth[1][2][6] = (TH1F *)hfile->Get("h_sumCutADCAmplperLSdepth6HEu");
963  HistCutNumBadChanDepth[1][2][7] = (TH1F *)hfile->Get("h_sumCutADCAmplperLSdepth7HEu");
964 
965  // HO:
966  HistCutNumBadChanDepth[1][3][4] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS8");
967 
968  // HF:
969  HistCutNumBadChanDepth[1][4][1] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS6");
970  HistCutNumBadChanDepth[1][4][2] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS7");
971  // HF upgrade:
972  HistCutNumBadChanDepth[1][4][3] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS6u");
973  HistCutNumBadChanDepth[1][4][4] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS7u");
974 
976  // HB:
977  HistNumChanDepth[1][1][1] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS1");
978  HistNumChanDepth[1][1][2] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS2");
979  // HB upgrade:
980  HistNumChanDepth[1][1][3] = (TH1F *)hfile->Get("h_sum0ADCAmplperLSdepth3HBu");
981  HistNumChanDepth[1][1][4] = (TH1F *)hfile->Get("h_sum0ADCAmplperLSdepth4HBu");
982 
983  // HE:
984  HistNumChanDepth[1][2][1] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS3");
985  HistNumChanDepth[1][2][2] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS4");
986  HistNumChanDepth[1][2][3] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS5");
987  // HE upgrade:
988  HistNumChanDepth[1][2][4] = (TH1F *)hfile->Get("h_sum0ADCAmplperLSdepth4HEu");
989  HistNumChanDepth[1][2][5] = (TH1F *)hfile->Get("h_sum0ADCAmplperLSdepth5HEu");
990  HistNumChanDepth[1][2][6] = (TH1F *)hfile->Get("h_sum0ADCAmplperLSdepth6HEu");
991  HistNumChanDepth[1][2][7] = (TH1F *)hfile->Get("h_sum0ADCAmplperLSdepth7HEu");
992 
993  // HO:
994  HistNumChanDepth[1][3][4] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS8");
995 
996  // HF:
997  HistNumChanDepth[1][4][1] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS6");
998  HistNumChanDepth[1][4][2] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS7");
999  // HF upgrade:
1000  HistNumChanDepth[1][4][3] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS6u");
1001  HistNumChanDepth[1][4][4] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS7u");
1002 
1003  // other cases:
1004  HistNumChanFull[1] = (TH1F *)HistNumChanDepth[1][1][1]->Clone();
1005  // just initialization of [6] massive for alternative <A> calculation
1006  HistNumChanFull[6] = (TH1F *)HistNumChanDepth[1][1][1]->Clone();
1007 
1008  //+++++++++++++++++++++++++++++
1009  // Width
1010  //+++++++++++++++++++++++++++++
1011 
1012  HistNumBadChanDepth[2][1][1] = (TH1F *)hfile->Get("h_sumAmplitudeperLS1");
1013  HistNumBadChanDepth[2][1][2] = (TH1F *)hfile->Get("h_sumAmplitudeperLS2");
1014 
1015  HistNumBadChanDepth[2][2][1] = (TH1F *)hfile->Get("h_sumAmplitudeperLS3");
1016  HistNumBadChanDepth[2][2][2] = (TH1F *)hfile->Get("h_sumAmplitudeperLS4");
1017  HistNumBadChanDepth[2][2][3] = (TH1F *)hfile->Get("h_sumAmplitudeperLS5");
1018 
1019  HistNumBadChanDepth[2][3][4] = (TH1F *)hfile->Get("h_sumAmplitudeperLS8");
1020 
1021  HistNumBadChanDepth[2][4][1] = (TH1F *)hfile->Get("h_sumAmplitudeperLS6");
1022  HistNumBadChanDepth[2][4][2] = (TH1F *)hfile->Get("h_sumAmplitudeperLS7");
1023 
1024  HistNumBadChanFull[2] = (TH1F *)HistNumBadChanDepth[2][1][1]->Clone();
1025 
1026  HistCutNumBadChanDepth[2][1][1] = (TH1F *)hfile->Get("h_sumCutAmplitudeperLS1");
1027  HistCutNumBadChanDepth[2][1][2] = (TH1F *)hfile->Get("h_sumCutAmplitudeperLS2");
1028 
1029  HistCutNumBadChanDepth[2][2][1] = (TH1F *)hfile->Get("h_sumCutAmplitudeperLS3");
1030  HistCutNumBadChanDepth[2][2][2] = (TH1F *)hfile->Get("h_sumCutAmplitudeperLS4");
1031  HistCutNumBadChanDepth[2][2][3] = (TH1F *)hfile->Get("h_sumCutAmplitudeperLS5");
1032 
1033  HistCutNumBadChanDepth[2][3][4] = (TH1F *)hfile->Get("h_sumCutAmplitudeperLS8");
1034 
1035  HistCutNumBadChanDepth[2][4][1] = (TH1F *)hfile->Get("h_sumCutAmplitudeperLS6");
1036  HistCutNumBadChanDepth[2][4][2] = (TH1F *)hfile->Get("h_sumCutAmplitudeperLS7");
1037 
1038  HistNumChanDepth[2][1][1] = (TH1F *)hfile->Get("h_sum0AmplitudeperLS1");
1039  HistNumChanDepth[2][1][2] = (TH1F *)hfile->Get("h_sum0AmplitudeperLS2");
1040 
1041  HistNumChanDepth[2][2][1] = (TH1F *)hfile->Get("h_sum0AmplitudeperLS3");
1042  HistNumChanDepth[2][2][2] = (TH1F *)hfile->Get("h_sum0AmplitudeperLS4");
1043  HistNumChanDepth[2][2][3] = (TH1F *)hfile->Get("h_sum0AmplitudeperLS5");
1044 
1045  HistNumChanDepth[2][3][4] = (TH1F *)hfile->Get("h_sum0AmplitudeperLS8");
1046 
1047  HistNumChanDepth[2][4][1] = (TH1F *)hfile->Get("h_sum0AmplitudeperLS6");
1048  HistNumChanDepth[2][4][2] = (TH1F *)hfile->Get("h_sum0AmplitudeperLS7");
1049 
1050  HistNumChanFull[2] = (TH1F *)HistNumChanDepth[2][1][1]->Clone();
1051  //+++++++++++++++++++++++++++++
1052  // Ratio
1053  //+++++++++++++++++++++++++++++
1054 
1055  HistNumBadChanDepth[3][1][1] = (TH1F *)hfile->Get("h_sumAmplperLS1");
1056  HistNumBadChanDepth[3][1][2] = (TH1F *)hfile->Get("h_sumAmplperLS2");
1057 
1058  HistNumBadChanDepth[3][2][1] = (TH1F *)hfile->Get("h_sumAmplperLS3");
1059  HistNumBadChanDepth[3][2][2] = (TH1F *)hfile->Get("h_sumAmplperLS4");
1060  HistNumBadChanDepth[3][2][3] = (TH1F *)hfile->Get("h_sumAmplperLS5");
1061 
1062  HistNumBadChanDepth[3][3][4] = (TH1F *)hfile->Get("h_sumAmplperLS8");
1063 
1064  HistNumBadChanDepth[3][4][1] = (TH1F *)hfile->Get("h_sumAmplperLS6");
1065  HistNumBadChanDepth[3][4][2] = (TH1F *)hfile->Get("h_sumAmplperLS7");
1066 
1067  HistNumBadChanFull[3] = (TH1F *)HistNumBadChanDepth[3][1][1]->Clone();
1068 
1069  HistCutNumBadChanDepth[3][1][1] = (TH1F *)hfile->Get("h_sumCutAmplperLS1");
1070  HistCutNumBadChanDepth[3][1][2] = (TH1F *)hfile->Get("h_sumCutAmplperLS2");
1071 
1072  HistCutNumBadChanDepth[3][2][1] = (TH1F *)hfile->Get("h_sumCutAmplperLS3");
1073  HistCutNumBadChanDepth[3][2][2] = (TH1F *)hfile->Get("h_sumCutAmplperLS4");
1074  HistCutNumBadChanDepth[3][2][3] = (TH1F *)hfile->Get("h_sumCutAmplperLS5");
1075 
1076  HistCutNumBadChanDepth[3][3][4] = (TH1F *)hfile->Get("h_sumCutAmplperLS8");
1077 
1078  HistCutNumBadChanDepth[3][4][1] = (TH1F *)hfile->Get("h_sumCutAmplperLS6");
1079  HistCutNumBadChanDepth[3][4][2] = (TH1F *)hfile->Get("h_sumCutAmplperLS7");
1080 
1081  HistNumChanDepth[3][1][1] = (TH1F *)hfile->Get("h_sum0AmplperLS1");
1082  HistNumChanDepth[3][1][2] = (TH1F *)hfile->Get("h_sum0AmplperLS2");
1083 
1084  HistNumChanDepth[3][2][1] = (TH1F *)hfile->Get("h_sum0AmplperLS3");
1085  HistNumChanDepth[3][2][2] = (TH1F *)hfile->Get("h_sum0AmplperLS4");
1086  HistNumChanDepth[3][2][3] = (TH1F *)hfile->Get("h_sum0AmplperLS5");
1087 
1088  HistNumChanDepth[3][3][4] = (TH1F *)hfile->Get("h_sum0AmplperLS8");
1089 
1090  HistNumChanDepth[3][4][1] = (TH1F *)hfile->Get("h_sum0AmplperLS6");
1091  HistNumChanDepth[3][4][2] = (TH1F *)hfile->Get("h_sum0AmplperLS7");
1092 
1093  HistNumChanFull[3] = (TH1F *)HistNumChanDepth[3][1][1]->Clone();
1094  //+++++++++++++++++++++++++++++
1095  // Tmean
1096  //+++++++++++++++++++++++++++++
1097 
1098  HistNumBadChanDepth[4][1][1] = (TH1F *)hfile->Get("h_sumTSmeanAperLS1");
1099  HistNumBadChanDepth[4][1][2] = (TH1F *)hfile->Get("h_sumTSmeanAperLS2");
1100 
1101  HistNumBadChanDepth[4][2][1] = (TH1F *)hfile->Get("h_sumTSmeanAperLS3");
1102  HistNumBadChanDepth[4][2][2] = (TH1F *)hfile->Get("h_sumTSmeanAperLS4");
1103  HistNumBadChanDepth[4][2][3] = (TH1F *)hfile->Get("h_sumTSmeanAperLS5");
1104 
1105  HistNumBadChanDepth[4][3][4] = (TH1F *)hfile->Get("h_sumTSmeanAperLS8");
1106 
1107  HistNumBadChanDepth[4][4][1] = (TH1F *)hfile->Get("h_sumTSmeanAperLS6");
1108  HistNumBadChanDepth[4][4][2] = (TH1F *)hfile->Get("h_sumTSmeanAperLS7");
1109 
1110  HistNumBadChanFull[4] = (TH1F *)HistNumBadChanDepth[4][1][1]->Clone();
1111 
1112  HistCutNumBadChanDepth[4][1][1] = (TH1F *)hfile->Get("h_sumCutTSmeanAperLS1");
1113  HistCutNumBadChanDepth[4][1][2] = (TH1F *)hfile->Get("h_sumCutTSmeanAperLS2");
1114 
1115  HistCutNumBadChanDepth[4][2][1] = (TH1F *)hfile->Get("h_sumCutTSmeanAperLS3");
1116  HistCutNumBadChanDepth[4][2][2] = (TH1F *)hfile->Get("h_sumCutTSmeanAperLS4");
1117  HistCutNumBadChanDepth[4][2][3] = (TH1F *)hfile->Get("h_sumCutTSmeanAperLS5");
1118 
1119  HistCutNumBadChanDepth[4][3][4] = (TH1F *)hfile->Get("h_sumCutTSmeanAperLS8");
1120 
1121  HistCutNumBadChanDepth[4][4][1] = (TH1F *)hfile->Get("h_sumCutTSmeanAperLS6");
1122  HistCutNumBadChanDepth[4][4][2] = (TH1F *)hfile->Get("h_sumCutTSmeanAperLS7");
1123 
1124  HistNumChanDepth[4][1][1] = (TH1F *)hfile->Get("h_sum0TSmeanAperLS1");
1125  HistNumChanDepth[4][1][2] = (TH1F *)hfile->Get("h_sum0TSmeanAperLS2");
1126 
1127  HistNumChanDepth[4][2][1] = (TH1F *)hfile->Get("h_sum0TSmeanAperLS3");
1128  HistNumChanDepth[4][2][2] = (TH1F *)hfile->Get("h_sum0TSmeanAperLS4");
1129  HistNumChanDepth[4][2][3] = (TH1F *)hfile->Get("h_sum0TSmeanAperLS5");
1130 
1131  HistNumChanDepth[4][3][4] = (TH1F *)hfile->Get("h_sum0TSmeanAperLS8");
1132 
1133  HistNumChanDepth[4][4][1] = (TH1F *)hfile->Get("h_sum0TSmeanAperLS6");
1134  HistNumChanDepth[4][4][2] = (TH1F *)hfile->Get("h_sum0TSmeanAperLS7");
1135 
1136  HistNumChanFull[4] = (TH1F *)HistNumChanDepth[4][1][1]->Clone();
1137  //+++++++++++++++++++++++++++++
1138  // Tmax
1139  //+++++++++++++++++++++++++++++
1140 
1141  HistNumBadChanDepth[5][1][1] = (TH1F *)hfile->Get("h_sumTSmaxAperLS1");
1142  HistNumBadChanDepth[5][1][2] = (TH1F *)hfile->Get("h_sumTSmaxAperLS2");
1143 
1144  HistNumBadChanDepth[5][2][1] = (TH1F *)hfile->Get("h_sumTSmaxAperLS3");
1145  HistNumBadChanDepth[5][2][2] = (TH1F *)hfile->Get("h_sumTSmaxAperLS4");
1146  HistNumBadChanDepth[5][2][3] = (TH1F *)hfile->Get("h_sumTSmaxAperLS5");
1147 
1148  HistNumBadChanDepth[5][3][4] = (TH1F *)hfile->Get("h_sumTSmaxAperLS8");
1149 
1150  HistNumBadChanDepth[5][4][1] = (TH1F *)hfile->Get("h_sumTSmaxAperLS6");
1151  HistNumBadChanDepth[5][4][2] = (TH1F *)hfile->Get("h_sumTSmaxAperLS7");
1152 
1153  HistNumBadChanFull[5] = (TH1F *)HistNumBadChanDepth[5][1][1]->Clone();
1154 
1155  HistCutNumBadChanDepth[5][1][1] = (TH1F *)hfile->Get("h_sumCutTSmaxAperLS1");
1156  HistCutNumBadChanDepth[5][1][2] = (TH1F *)hfile->Get("h_sumCutTSmaxAperLS2");
1157 
1158  HistCutNumBadChanDepth[5][2][1] = (TH1F *)hfile->Get("h_sumCutTSmaxAperLS3");
1159  HistCutNumBadChanDepth[5][2][2] = (TH1F *)hfile->Get("h_sumCutTSmaxAperLS4");
1160  HistCutNumBadChanDepth[5][2][3] = (TH1F *)hfile->Get("h_sumCutTSmaxAperLS5");
1161 
1162  HistCutNumBadChanDepth[5][3][4] = (TH1F *)hfile->Get("h_sumCutTSmaxAperLS8");
1163 
1164  HistCutNumBadChanDepth[5][4][1] = (TH1F *)hfile->Get("h_sumCutTSmaxAperLS6");
1165  HistCutNumBadChanDepth[5][4][2] = (TH1F *)hfile->Get("h_sumCutTSmaxAperLS7");
1166 
1167  HistNumChanDepth[5][1][1] = (TH1F *)hfile->Get("h_sum0TSmaxAperLS1");
1168  HistNumChanDepth[5][1][2] = (TH1F *)hfile->Get("h_sum0TSmaxAperLS2");
1169 
1170  HistNumChanDepth[5][2][1] = (TH1F *)hfile->Get("h_sum0TSmaxAperLS3");
1171  HistNumChanDepth[5][2][2] = (TH1F *)hfile->Get("h_sum0TSmaxAperLS4");
1172  HistNumChanDepth[5][2][3] = (TH1F *)hfile->Get("h_sum0TSmaxAperLS5");
1173 
1174  HistNumChanDepth[5][3][4] = (TH1F *)hfile->Get("h_sum0TSmaxAperLS8");
1175 
1176  HistNumChanDepth[5][4][1] = (TH1F *)hfile->Get("h_sum0TSmaxAperLS6");
1177  HistNumChanDepth[5][4][2] = (TH1F *)hfile->Get("h_sum0TSmaxAperLS7");
1178 
1179  HistNumChanFull[5] = (TH1F *)HistNumChanDepth[5][1][1]->Clone();
1180 
1181  for (int test = 0; test <= 5; test++) { //Test: =0(CapIdErrors), =1(Amplitude), =2...
1182  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
1183  if (sub == 1 && test != 1)
1184  cHE->Divide(2, 1); //HB
1185  if (sub == 1 && test == 1) {
1186  cFour1->Clear();
1187  cFour1->Divide(2, 2);
1188  } //HB upgrade with new depthes 3,4 for Amplitude test only
1189  if (sub == 2 && test != 1)
1190  cHE->Divide(3, 1); //HE
1191  if (sub == 2 && test == 1) {
1192  cNine->Clear();
1193  cNine->Divide(3, 3);
1194  } //HE upgrade with new depthes 4,5,6,7 for Amplitude test only
1195  if (sub == 3)
1196  cHB->Divide(1, 1); //HO
1197  if (sub == 4 && test != 1)
1198  cHE->Divide(2, 1); //HF
1199  if (sub == 4 && test == 1) {
1200  cFour1->Clear();
1201  cFour1->Divide(2, 2);
1202  } // HF upgrade with new depthes 3 and 4 for Amplitude test only
1203 
1204  int kkkkkkmax = k_max[sub];
1205  // if ( (sub==4 || sub==2) && test==1) kkkkkkmax = k_maxupgrade[sub];
1206  if ((sub == 4 || sub == 2 || sub == 1) && test == 1)
1207  kkkkkkmax = k_maxupgrade[sub];
1208  for (int k = k_min[sub]; k <= kkkkkkmax; k++) { //Depth
1209  if (sub == 1 && test != 1)
1210  cHE->cd(k); //HB
1211  if (sub == 1 && test == 1)
1212  cFour1->cd(k); //HB
1213  if (sub == 2 && test != 1)
1214  cHE->cd(k); //HE
1215  if (sub == 2 && test == 1)
1216  cNine->cd(k); //HE upgrade with new depthes 4,5,6,7 for Amplitude test only
1217  if (sub == 3)
1218  cHB->cd(k - 3); //HO
1219  if (sub == 4 && test != 1)
1220  cHE->cd(k); //HF
1221  if (sub == 4 && test == 1)
1222  cFour1->cd(k); // HF upgrade with new depthes 3 and 4 for Amplitude test only
1223  gPad->SetGridy();
1224  gPad->SetGridx();
1225  // gPad->SetLogy();
1226 
1227  if (sub == 1 && k == 1) {
1228  } else {
1229  // use "else" because ...Full[test] are filled by estimastor for sub==1 && k== 1 at initialization of ...Full[test] variables
1230  for (int x = 1; x <= HistNumBadChanFull[test]->GetXaxis()->GetNbins(); x++) {
1231  double ccc1 = HistNumBadChanDepth[test][sub][k]->GetBinContent(x);
1232  HistNumBadChanFull[test]->SetBinContent(x, HistNumBadChanFull[test]->GetBinContent(x) + ccc1);
1233  double ccc2 = HistNumChanDepth[test][sub][k]->GetBinContent(x);
1234  HistNumChanFull[test]->SetBinContent(x, HistNumChanFull[test]->GetBinContent(x) + ccc2);
1235  }
1236  } //end x
1237 
1238  // !!!!!! change the sense of HistNumBadChanDepth: now it's averaged values(estimators)
1239  HistNumBadChanDepth[test][sub][k]->Divide(
1240  HistNumBadChanDepth[test][sub][k], HistNumChanDepth[test][sub][k], 1, 1, "B");
1241  // errors abnulling:
1242  for (int x = 1; x <= HistNumBadChanDepth[test][sub][k]->GetXaxis()->GetNbins(); x++) {
1243  HistNumBadChanDepth[test][sub][k]->SetBinError(float(x), 0.01);
1244  }
1245 
1246  // int myMaxLum= HistNumBadChanDepth[test][sub][k]->GetBinContent(HistNumBadChanDepth[test][sub][k]->GetMaximumBin());
1247  // cout<<"********************>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> myMaxLum = "<<myMaxLum<<" MaxLum = "<<MaxLum<<endl;
1248  HistNumBadChanDepth[test][sub][k]->GetXaxis()->SetRangeUser(0, MaxLum);
1249 
1250  // // // // // // // // // // // // // // // // // //
1251  HistNumBadChanDepth[test][sub][k]->SetMarkerStyle(20);
1252  HistNumBadChanDepth[test][sub][k]->SetMarkerSize(0.4);
1253  HistNumBadChanDepth[test][sub][k]->GetYaxis()->SetLabelSize(0.04);
1254  if (k == 1)
1255  HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 1\b");
1256  if (k == 2)
1257  HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 2\b");
1258  if (k == 3)
1259  HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 3\b");
1260  if (k == 4)
1261  HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 4\b");
1262  if (k == 5)
1263  HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 5\b");
1264  if (k == 6)
1265  HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 6\b");
1266  if (k == 7)
1267  HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 7\b");
1268  HistNumBadChanDepth[test][sub][k]->SetXTitle("LS \b");
1269  if (test == 0)
1270  HistNumBadChanDepth[test][sub][k]->SetYTitle("<Number of bad channels> \b");
1271  if (test != 0)
1272  HistNumBadChanDepth[test][sub][k]->SetYTitle("Averaged estimator \b");
1273  HistNumBadChanDepth[test][sub][k]->SetMarkerColor(2);
1274  HistNumBadChanDepth[test][sub][k]->SetLineColor(0);
1275  // gPad->SetGridx();
1276  gPad->SetLogy();
1277  gPad->SetGridy();
1278  gPad->SetGridx();
1279  // if (test == 1) HistNumBadChanDepth[test][sub][k]->SetMinimum(0.1);
1280  HistNumBadChanDepth[test][sub][k]->Draw("Error");
1281  /*
1282  if (k == 1) HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 1\b");
1283  if (k == 2) HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 2\b");
1284  if (k == 3) HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 3\b");
1285  if (k == 4) HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 4\b");
1286  HistNumBadChanDepth[test][sub][k]->SetXTitle("LS \b");
1287  if (test == 0) HistNumBadChanDepth[test][sub][k]->SetYTitle("<Number of bad channels> \b");
1288  if (test != 0) HistNumBadChanDepth[test][sub][k]->SetYTitle("Averaged estimator \b");
1289 
1290  if (MaxLum<=1000){
1291  HistNumBadChanDepth[test][sub][k]->SetMarkerStyle(20);
1292  HistNumBadChanDepth[test][sub][k]->SetMarkerSize(0.5);
1293  HistNumBadChanDepth[test][sub][k]->SetMarkerColor(2);
1294  HistNumBadChanDepth[test][sub][k]->SetLineColor(0);
1295  HistNumBadChanDepth[test][sub][k]->GetXaxis()->SetRangeUser(0, MaxLum);
1296  HistNumBadChanDepth[test][sub][k]->Draw("P");
1297  }
1298  else{
1299  HistNumBadChanDepth[test][sub][k]->SetLineColor(2);
1300  HistNumBadChanDepth[test][sub][k]->GetXaxis()->SetRangeUser(0, MaxLum);
1301  HistNumBadChanDepth[test][sub][k]->Draw("L");
1302  }
1303  */
1304  /*
1305  float min_x[] = {0,10000};
1306  float min_y[] = {(float)(Cut0[test][sub][k]),(float)(Cut0[test][sub][k])};
1307  TGraph* MIN = new TGraph(2, min_x, min_y);
1308  MIN->SetLineStyle(2);
1309  MIN->SetLineColor(5);
1310  MIN->SetLineWidth(2 + 100*100);
1311  MIN->SetFillStyle(3005);
1312  MIN->SetFillColor(5);
1313  gPad->SetGridy();
1314  gPad->SetGridx();
1315  MIN->Draw("L");
1316 */
1317 
1318  if (sub == 1 && test != 1) {
1319  cHE->Modified();
1320  }
1321  if (sub == 1 && test == 1) {
1322  cFour1->Modified();
1323  } // HB upgrade
1324  if (sub == 2 && test != 1) {
1325  cHE->Modified();
1326  }
1327  if (sub == 2 && test == 1) {
1328  cNine->Modified();
1329  } // HE upgrade
1330  if (sub == 3) {
1331  cHB->Modified();
1332  }
1333  if (sub == 4 && test != 1) {
1334  cHE->Modified();
1335  }
1336  if (sub == 4 && test == 1) {
1337  cFour1->Modified();
1338  } // HF upgrade
1339 
1340  } // k loop
1341 
1342  if (test == 0) {
1343  if (sub == 1) {
1344  cHE->Print("HistNBCMNHB.png");
1345  cHE->Clear();
1346  }
1347  if (sub == 2) {
1348  cHE->Print("HistNBCMNHE.png");
1349  cHE->Clear();
1350  }
1351  if (sub == 3) {
1352  cHB->Print("HistNBCMNHO.png");
1353  cHB->Clear();
1354  }
1355  if (sub == 4) {
1356  cHE->Print("HistNBCMNHF.png");
1357  cHE->Clear();
1358  }
1359  }
1360  // Amplitude:
1361  if (test == 1) {
1362  if (sub == 1) {
1363  cFour1->Print("HistADCamplHB.png");
1364  cFour1->Clear();
1365  } // HB upgrade
1366  if (sub == 2) {
1367  cNine->Print("HistADCamplHE.png");
1368  cNine->Clear();
1369  } // HE upgrade
1370  if (sub == 3) {
1371  cHB->Print("HistADCamplHO.png");
1372  cHB->Clear();
1373  }
1374  if (sub == 4) {
1375  cFour1->Print("HistADCamplHF.png");
1376  cFour1->Clear();
1377  } // HF upgrade
1378  }
1379  if (test == 2) {
1380  if (sub == 1) {
1381  cHE->Print("HistWidthHB.png");
1382  cHE->Clear();
1383  }
1384  if (sub == 2) {
1385  cHE->Print("HistWidthHE.png");
1386  cHE->Clear();
1387  }
1388  if (sub == 3) {
1389  cHB->Print("HistWidthHO.png");
1390  cHB->Clear();
1391  }
1392  if (sub == 4) {
1393  cHE->Print("HistWidthHF.png");
1394  cHE->Clear();
1395  }
1396  }
1397  if (test == 3) {
1398  if (sub == 1) {
1399  cHE->Print("HistRatioHB.png");
1400  cHE->Clear();
1401  }
1402  if (sub == 2) {
1403  cHE->Print("HistRatioHE.png");
1404  cHE->Clear();
1405  }
1406  if (sub == 3) {
1407  cHB->Print("HistRatioHO.png");
1408  cHB->Clear();
1409  }
1410  if (sub == 4) {
1411  cHE->Print("HistRatioHF.png");
1412  cHE->Clear();
1413  }
1414  }
1415  if (test == 4) {
1416  if (sub == 1) {
1417  cHE->Print("HistTmeanHB.png");
1418  cHE->Clear();
1419  }
1420  if (sub == 2) {
1421  cHE->Print("HistTmeanHE.png");
1422  cHE->Clear();
1423  }
1424  if (sub == 3) {
1425  cHB->Print("HistTmeanHO.png");
1426  cHB->Clear();
1427  }
1428  if (sub == 4) {
1429  cHE->Print("HistTmeanHF.png");
1430  cHE->Clear();
1431  }
1432  }
1433  if (test == 5) {
1434  if (sub == 1) {
1435  cHE->Print("HistTmaxHB.png");
1436  cHE->Clear();
1437  }
1438  if (sub == 2) {
1439  cHE->Print("HistTmaxHE.png");
1440  cHE->Clear();
1441  }
1442  if (sub == 3) {
1443  cHB->Print("HistTmaxHO.png");
1444  cHB->Clear();
1445  }
1446  if (sub == 4) {
1447  cHE->Print("HistTmaxHF.png");
1448  cHE->Clear();
1449  }
1450  }
1451  } // end sub
1453  if (test == 1) {
1454  for (int x = 1; x <= HistNumChanFull[6]->GetXaxis()->GetNbins(); x++) {
1455  HistNumChanFull[6]->SetBinContent(x, 0.0);
1456  int depthsubcount = 0.;
1457  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
1458  int kkkkkkmax = k_max[sub];
1459  if (sub == 4 || sub == 2 || sub == 1)
1460  kkkkkkmax = k_maxupgrade[sub];
1461  // if ( sub==4 || sub==2) kkkkkkmax = k_maxupgrade[sub];
1462  for (int k = k_min[sub]; k <= kkkkkkmax; k++) { //Depth
1463  // 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
1464  // if(sub==2 && k>3 ) break;
1465  depthsubcount++;
1466  double ccc1 = HistNumBadChanDepth[test][sub][k]->GetBinContent(x);
1467  HistNumChanFull[6]->SetBinContent(x, HistNumChanFull[6]->GetBinContent(x) + ccc1);
1468  } //depth
1469  } //sub
1470  if (depthsubcount > 0.) {
1471  HistNumChanFull[6]->SetBinContent(x, (HistNumChanFull[6]->GetBinContent(x)) / depthsubcount);
1472  } else {
1473  HistNumChanFull[6]->SetBinContent(x, (HistNumChanFull[6]->GetBinContent(x)) / 8.);
1474  }
1475  } //x
1476  } //test=1
1478  if (test != 1) {
1479  cHB->Divide(1, 1);
1480  cHB->cd(1);
1481  } else {
1482  cHE->Divide(2, 1);
1483  cHE->cd(1);
1484  }
1485  HistNumBadChanFull[test]->Divide(HistNumBadChanFull[test], HistNumChanFull[test], 1, 1, "B");
1486  TH1F *kfitq = new TH1F("kfitq", "", MaxLum, 1., MaxLum + 1.);
1487  int nx = kfitq->GetXaxis()->GetNbins();
1488  for (int i = 1; i <= nx; i++) {
1489  double ccc1 = HistNumBadChanFull[test]->GetBinContent(i);
1490  if (ccc1 > 0.) {
1491  kfitq->Fill(float(i), ccc1);
1492  kfitq->SetBinError(float(i), 0.01);
1493  }
1494  }
1495  kfitq->SetMarkerStyle(20);
1496  kfitq->SetMarkerSize(0.4);
1497  kfitq->GetYaxis()->SetLabelSize(0.04);
1498  if (test == 0)
1499  kfitq->SetTitle("Average Nbch for whole Hcal \b");
1500  if (test != 0)
1501  kfitq->SetTitle("Averaged estimator for whole Hcal \b");
1502  kfitq->SetXTitle("LS \b");
1503  if (test == 0)
1504  kfitq->SetYTitle("<Number of bad channels> \b");
1505  if (test != 0)
1506  kfitq->SetYTitle("Averaged estimator \b");
1507  kfitq->SetMarkerColor(2);
1508  kfitq->SetLineColor(0);
1509  gPad->SetGridx();
1510  kfitq->Draw("Error");
1511  /*
1512  HistNumBadChanFull[test]->SetMarkerStyle(20);
1513  HistNumBadChanFull[test]->SetMarkerSize(0.8);
1514  HistNumBadChanFull[test]->SetTitle("Averaged estimator for whole Hcal \b");
1515  HistNumBadChanFull[test]->SetXTitle("LS \b");
1516  if (test == 0) HistNumBadChanFull[test]->SetYTitle("<Number of bad channels> \b");
1517  if (test != 0) HistNumBadChanFull[test]->SetYTitle("Averaged estimator \b");
1518  if (MaxLum<=1000){
1519  HistNumBadChanFull[test]->SetMarkerColor(1);
1520  HistNumBadChanFull[test]->SetLineColor(0);
1521  HistNumBadChanFull[test]->Draw("P");
1522  }
1523  else {
1524  HistNumBadChanFull[test]->SetLineColor(1);
1525  HistNumBadChanFull[test]->Draw("L");
1526  }
1527  */
1528  if (test == 1) {
1529  cHE->cd(2);
1530  TH1F *lpuio = new TH1F("lpuio", "", MaxLum, 1., MaxLum + 1.);
1531  int nx = lpuio->GetXaxis()->GetNbins();
1532  for (int i = 1; i <= nx; i++) {
1533  double ccc1 = HistNumChanFull[6]->GetBinContent(i);
1534  if (ccc1 > 0.) {
1535  lpuio->Fill(float(i), ccc1);
1536  lpuio->SetBinError(float(i), 0.01);
1537  }
1538  }
1539  lpuio->SetMarkerStyle(20);
1540  lpuio->SetMarkerSize(0.4);
1541  lpuio->GetYaxis()->SetLabelSize(0.04);
1542  lpuio->SetTitle("Mean of Averaged Amplitudes over all Hcal sub-detectors \b");
1543  lpuio->SetXTitle("LS \b");
1544  lpuio->SetYTitle("Mean of Averaged estimator \b");
1545  lpuio->SetMarkerColor(2);
1546  lpuio->SetLineColor(0);
1547  gPad->SetGridx();
1548  lpuio->Draw("Error");
1549  }
1550  if (test == 0) {
1551  cHB->Print("HistCapID.png");
1552  cHB->Clear();
1553  }
1554  if (test == 1) {
1555  cHE->Print("HistADCAmpl.png");
1556  cHE->Clear();
1557  }
1558  if (test == 2) {
1559  cHB->Print("HistWidth.png");
1560  cHB->Clear();
1561  }
1562  if (test == 3) {
1563  cHB->Print("HistRatio.png");
1564  cHB->Clear();
1565  }
1566  if (test == 4) {
1567  cHB->Print("HistTmean.png");
1568  cHB->Clear();
1569  }
1570  if (test == 5) {
1571  cHB->Print("HistTmax.png");
1572  cHB->Clear();
1573  }
1574 
1575  // clean-up
1576  if (kfitq)
1577  delete kfitq;
1578  } //end test
1579 
1580  //================================================================================================================================
1581 
1582  //=======================================================================================================333
1583  //CapID 1-d histograms
1584 
1585  TH1F *HistAbnormNumBadChanDepth[5][5]; // 1d histogramm for subdet, depth
1586 
1587  //+++++++++++++++++++++++++++++
1588  // Abnormal Bad Channels Rate of Cap ID errors first set of histograms
1589  //+++++++++++++++++++++++++++++
1590 
1591  HistAbnormNumBadChanDepth[1][1] = (TH1F *)hfile->Get("h_runnbadchannelsC_depth1_HB");
1592  HistAbnormNumBadChanDepth[1][2] = (TH1F *)hfile->Get("h_runnbadchannelsC_depth2_HB");
1593  HistAbnormNumBadChanDepth[2][1] = (TH1F *)hfile->Get("h_runnbadchannelsC_depth1_HE");
1594  HistAbnormNumBadChanDepth[2][2] = (TH1F *)hfile->Get("h_runnbadchannelsC_depth2_HE");
1595  HistAbnormNumBadChanDepth[2][3] = (TH1F *)hfile->Get("h_runnbadchannelsC_depth3_HE");
1596  HistAbnormNumBadChanDepth[3][4] = (TH1F *)hfile->Get("h_runnbadchannelsC_depth4_HO");
1597  HistAbnormNumBadChanDepth[4][1] = (TH1F *)hfile->Get("h_runnbadchannelsC_depth1_HF");
1598  HistAbnormNumBadChanDepth[4][2] = (TH1F *)hfile->Get("h_runnbadchannelsC_depth2_HF");
1599 
1600  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
1601  if (sub == 1)
1602  cHB->Divide(2, 1);
1603  if (sub == 2)
1604  cHE->Divide(3, 1);
1605  if (sub == 3)
1606  cONE->Divide(1, 1);
1607  if (sub == 4)
1608  cHB->Divide(2, 1);
1609  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
1610  if (sub == 1)
1611  cHB->cd(k);
1612  if (sub == 2)
1613  cHE->cd(k);
1614  if (sub == 3)
1615  cONE->cd(k - 3);
1616  if (sub == 4)
1617  cHB->cd(k);
1618  gPad->SetGridy();
1619  gPad->SetGridx();
1620  // gPad->SetLogy();
1621  HistAbnormNumBadChanDepth[sub][k]->Divide(
1622  HistAbnormNumBadChanDepth[sub][k], HistNumChanDepth[0][sub][k], 1, 1, "B");
1623  if (k == 1)
1624  HistAbnormNumBadChanDepth[sub][k]->SetTitle("Depth 1\b");
1625  if (k == 2)
1626  HistAbnormNumBadChanDepth[sub][k]->SetTitle("Depth 2\b");
1627  if (k == 3)
1628  HistAbnormNumBadChanDepth[sub][k]->SetTitle("Depth 3\b");
1629  if (k == 4)
1630  HistAbnormNumBadChanDepth[sub][k]->SetTitle("Depth 4\b");
1631  HistAbnormNumBadChanDepth[sub][k]->SetXTitle("LS \b");
1632  HistAbnormNumBadChanDepth[sub][k]->SetYTitle("< Number of bad channels > \b");
1633  if (MaxLum <= 1000) {
1634  HistAbnormNumBadChanDepth[sub][k]->SetMarkerStyle(20);
1635  HistAbnormNumBadChanDepth[sub][k]->SetMarkerSize(0.5);
1636  HistAbnormNumBadChanDepth[sub][k]->SetMarkerColor(1);
1637  HistAbnormNumBadChanDepth[sub][k]->SetLineColor(0);
1638  HistAbnormNumBadChanDepth[sub][k]->GetXaxis()->SetRangeUser(0, MaxLum);
1639  HistAbnormNumBadChanDepth[sub][k]->Draw("P");
1640  } else {
1641  HistAbnormNumBadChanDepth[sub][k]->SetLineColor(1);
1642  HistAbnormNumBadChanDepth[sub][k]->GetXaxis()->SetRangeUser(0, MaxLum);
1643  HistAbnormNumBadChanDepth[sub][k]->Draw("L");
1644  }
1645  }
1646  if (sub == 1) {
1647  cHB->Print("Hist_CAPID_Abnorm_HB.png");
1648  cHB->Clear();
1649  }
1650  if (sub == 2) {
1651  cHE->Print("Hist_CAPID_Abnorm_HE.png");
1652  cHE->Clear();
1653  }
1654  if (sub == 3) {
1655  cONE->Print("Hist_CAPID_Abnorm_HO.png");
1656  cONE->Clear();
1657  }
1658  if (sub == 4) {
1659  cHB->Print("Hist_CAPID_Abnorm_HF.png");
1660  cHB->Clear();
1661  }
1662  } // end sub
1663 
1664  //+++++++++++++++++++++++++++++
1665  // Portions of bad channels events identified by Cap ID errors third set of histograms
1666  //+++++++++++++++++++++++++++++
1667 
1668  TH1F *HistPortBadEventsDepth[5][5]; // 1d histogramm for subdet, depth
1669 
1670  HistPortBadEventsDepth[1][1] = (TH1F *)hfile->Get("h_runbadrateC_depth1_HB");
1671  HistPortBadEventsDepth[1][2] = (TH1F *)hfile->Get("h_runbadrateC_depth2_HB");
1672  HistPortBadEventsDepth[2][1] = (TH1F *)hfile->Get("h_runbadrateC_depth1_HE");
1673  HistPortBadEventsDepth[2][2] = (TH1F *)hfile->Get("h_runbadrateC_depth2_HE");
1674  HistPortBadEventsDepth[2][3] = (TH1F *)hfile->Get("h_runbadrateC_depth3_HE");
1675  HistPortBadEventsDepth[3][4] = (TH1F *)hfile->Get("h_runbadrateC_depth4_HO");
1676  HistPortBadEventsDepth[4][1] = (TH1F *)hfile->Get("h_runbadrateC_depth1_HF");
1677  HistPortBadEventsDepth[4][2] = (TH1F *)hfile->Get("h_runbadrateC_depth2_HF");
1678 
1679  TH1F *HistNumRateDepth[5][5];
1680  HistNumRateDepth[1][1] = (TH1F *)hfile->Get("h_runbadrate0_depth1_HB");
1681  HistNumRateDepth[1][2] = (TH1F *)hfile->Get("h_runbadrate0_depth2_HB");
1682  HistNumRateDepth[2][1] = (TH1F *)hfile->Get("h_runbadrate0_depth1_HE");
1683  HistNumRateDepth[2][2] = (TH1F *)hfile->Get("h_runbadrate0_depth2_HE");
1684  HistNumRateDepth[2][3] = (TH1F *)hfile->Get("h_runbadrate0_depth3_HE");
1685  HistNumRateDepth[3][4] = (TH1F *)hfile->Get("h_runbadrate0_depth4_HO");
1686  HistNumRateDepth[4][1] = (TH1F *)hfile->Get("h_runbadrate0_depth1_HF");
1687  HistNumRateDepth[4][2] = (TH1F *)hfile->Get("h_runbadrate0_depth2_HF");
1688 
1689  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
1690  if (sub == 1)
1691  cHB->Divide(2, 1);
1692  if (sub == 2)
1693  cHE->Divide(3, 1);
1694  if (sub == 3)
1695  cONE->Divide(1, 1);
1696  if (sub == 4)
1697  cHB->Divide(2, 1);
1698  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
1699  if (sub == 1)
1700  cHB->cd(k);
1701  if (sub == 2)
1702  cHE->cd(k);
1703  if (sub == 3)
1704  cONE->cd(k - 3);
1705  if (sub == 4)
1706  cHB->cd(k);
1707  gPad->SetGridy();
1708  gPad->SetGridx();
1709  // gPad->SetLogy();
1710  HistPortBadEventsDepth[sub][k]->Divide(HistPortBadEventsDepth[sub][k], HistNumRateDepth[sub][k], 1, 1, "B");
1711 
1712  if (k == 1)
1713  HistPortBadEventsDepth[sub][k]->SetTitle("Depth 1\b");
1714  if (k == 2)
1715  HistPortBadEventsDepth[sub][k]->SetTitle("Depth 2\b");
1716  if (k == 3)
1717  HistPortBadEventsDepth[sub][k]->SetTitle("Depth 3\b");
1718  if (k == 4)
1719  HistPortBadEventsDepth[sub][k]->SetTitle("Depth 4\b");
1720  HistPortBadEventsDepth[sub][k]->SetXTitle("LS \b");
1721  HistPortBadEventsDepth[sub][k]->SetYTitle("< Number of bad channels > \b");
1722  if (MaxLum <= 1000) {
1723  HistPortBadEventsDepth[sub][k]->SetMarkerStyle(20);
1724  HistPortBadEventsDepth[sub][k]->SetMarkerSize(0.5);
1725  HistPortBadEventsDepth[sub][k]->SetMarkerColor(1);
1726  HistPortBadEventsDepth[sub][k]->SetLineColor(0);
1727  HistPortBadEventsDepth[sub][k]->GetXaxis()->SetRangeUser(0, MaxLum);
1728  HistPortBadEventsDepth[sub][k]->Draw("P");
1729  } else {
1730  HistPortBadEventsDepth[sub][k]->SetLineColor(1);
1731  HistPortBadEventsDepth[sub][k]->GetXaxis()->SetRangeUser(0, MaxLum);
1732  HistPortBadEventsDepth[sub][k]->Draw("L");
1733  }
1734  }
1735  if (sub == 1) {
1736  cHB->Print("HistPortHB.png");
1737  cHB->Clear();
1738  }
1739  if (sub == 2) {
1740  cHE->Print("HistPortHE.png");
1741  cHE->Clear();
1742  }
1743  if (sub == 3) {
1744  cONE->Print("HistPortHO.png");
1745  cONE->Clear();
1746  }
1747  if (sub == 4) {
1748  cHB->Print("HistPortHF.png");
1749  cHB->Clear();
1750  }
1751  } // end sub
1752 
1753  //================================================================================================================================
1754 
1755  //+++++++++++++++++++++++++++++
1756  // Number of bad channels events identified by Cap ID errors third set of histograms
1757  //+++++++++++++++++++++++++++++
1758 
1759  TH1F *HistNBadChsDepth[5][5]; // 1d histogramm for subdet, depth
1760 
1761  HistNBadChsDepth[1][1] = (TH1F *)hfile->Get("h_nbadchannels_depth1_HB");
1762  HistNBadChsDepth[1][2] = (TH1F *)hfile->Get("h_nbadchannels_depth2_HB");
1763  HistNBadChsDepth[2][1] = (TH1F *)hfile->Get("h_nbadchannels_depth1_HE");
1764  HistNBadChsDepth[2][2] = (TH1F *)hfile->Get("h_nbadchannels_depth2_HE");
1765  HistNBadChsDepth[2][3] = (TH1F *)hfile->Get("h_nbadchannels_depth3_HE");
1766  HistNBadChsDepth[3][4] = (TH1F *)hfile->Get("h_nbadchannels_depth4_HO");
1767  HistNBadChsDepth[4][1] = (TH1F *)hfile->Get("h_nbadchannels_depth1_HF");
1768  HistNBadChsDepth[4][2] = (TH1F *)hfile->Get("h_nbadchannels_depth2_HF");
1769 
1770  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
1771  if (sub == 1)
1772  cHB->Divide(2, 1);
1773  if (sub == 2)
1774  cHE->Divide(3, 1);
1775  if (sub == 3)
1776  cONE->Divide(1, 1);
1777  if (sub == 4)
1778  cHB->Divide(2, 1);
1779  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
1780  if (sub == 1)
1781  cHB->cd(k);
1782  if (sub == 2)
1783  cHE->cd(k);
1784  if (sub == 3)
1785  cONE->cd(k - 3);
1786  if (sub == 4)
1787  cHB->cd(k);
1788  gPad->SetGridy();
1789  gPad->SetGridx();
1790  gPad->SetLogy();
1791 
1792  if (k == 1)
1793  HistNBadChsDepth[sub][k]->SetTitle("Depth 1\b");
1794  if (k == 2)
1795  HistNBadChsDepth[sub][k]->SetTitle("Depth 2\b");
1796  if (k == 3)
1797  HistNBadChsDepth[sub][k]->SetTitle("Depth 3\b");
1798  if (k == 4)
1799  HistNBadChsDepth[sub][k]->SetTitle("Depth 4\b");
1800  HistNBadChsDepth[sub][k]->SetXTitle("Number of bad channels\b");
1801  HistNBadChsDepth[sub][k]->SetYTitle("Number of events\b");
1802  // HistNBadChsDepth[sub][k]->SetMarkerStyle(20);
1803  // HistNBadChsDepth[sub][k]->SetMarkerSize(0.5);
1804  // HistNBadChsDepth[sub][k]->SetMarkerColor(1);
1805  // HistNBadChsDepth[sub][k]->SetLineColor(0);
1806  HistNBadChsDepth[sub][k]->Draw("");
1807  }
1808  if (sub == 1) {
1809  cHB->Print("HistNBadChsHB.png");
1810  cHB->Clear();
1811  }
1812  if (sub == 2) {
1813  cHE->Print("HistNBadChsHE.png");
1814  cHE->Clear();
1815  }
1816  if (sub == 3) {
1817  cONE->Print("HistNBadChsHO.png");
1818  cONE->Clear();
1819  }
1820  if (sub == 4) {
1821  cHB->Print("HistNBadChsHF.png");
1822  cHB->Clear();
1823  }
1824  } // end sub
1825 
1826  //====================================================================== HB :
1827  //====================================================================== HB :
1828  //====================================================================== HB :
1829  // Special test of errors type A and B in HB
1830  // AZ 08.02.2016
1831 
1832  int flagErrAB_HB[2];
1833  flagErrAB_HB[0] = -1;
1834  flagErrAB_HB[1] = -1;
1835  double avedelta_HB = 0.;
1836  int lastLumiBin_HB = -1;
1837  int LSofFirstErrB_HB = -1;
1838  {
1839  const int specCountA = 4;
1840  const int specColors[specCountA] = {1, 2, 3, 4};
1841  const TString hnames[specCountA][2] = {{"h_sumADCAmplperLS1_P1", "h_sum0ADCAmplperLS1_P1"},
1842  {"h_sumADCAmplperLS1_P2", "h_sum0ADCAmplperLS1_P2"},
1843  {"h_sumADCAmplperLS1_M1", "h_sum0ADCAmplperLS1_M1"},
1844  {"h_sumADCAmplperLS1_M2", "h_sum0ADCAmplperLS1_M2"}};
1845 
1846  std::vector<TH1F *> hV;
1847  THStack *hs = new THStack("hs", "ADCAmplerLS1");
1848  cHB->Clear();
1849  // cHB->cd();
1850  cHB->Divide(2, 1);
1851  cHB->cd(1);
1852 
1854  for (int i = 0; i < specCountA; i++) {
1855  if (1)
1856  std::cout << "debugger: errA_HB : get histos for i=" << i << " " << hnames[i][0] << " and " << hnames[i][1]
1857  << "\n";
1858  TH1F *h1 = (TH1F *)hfile->Get(hnames[i][0]);
1859  TH1F *h0 = (TH1F *)hfile->Get(hnames[i][1]);
1860  if (!h1 || !h0) {
1861  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
1862  ptext->AddText("Missing histo");
1863  if (!h1) {
1864  std::cout << "\tfailed to get " << hnames[i][0] << "\n";
1865  ptext->AddText(hnames[i][0]);
1866  }
1867  if (!h0) {
1868  std::cout << "\tfailed to get " << hnames[i][1] << "\n";
1869  ptext->AddText(hnames[i][1]);
1870  }
1871  ptext->Draw();
1872  continue;
1873  }
1874  TH1F *hERT1orig = (TH1F *)h1->Clone(Form("ERT1orig_%d", i));
1875  hERT1orig->Divide(h1, h0, 1, 1, "B");
1876 
1877  if ((lastLumiBin_HB < 0) && (i == 0)) {
1878  for (int ibin = hERT1orig->GetNbinsX(); ibin >= 1; ibin--) {
1879  if (hERT1orig->GetBinContent(ibin) == 0)
1880  lastLumiBin_HB = ibin;
1881  else
1882  break;
1883  }
1884  lastLumiBin_HB += 3; // show more bins
1885  if (lastLumiBin_HB >= hERT1orig->GetNbinsX())
1886  lastLumiBin_HB = -1;
1887  }
1888  TH1F *hERT1 = NULL;
1889  if (lastLumiBin_HB > 1) {
1890  if (!copyContents(&hERT1, Form("ERT1_%d", i), "", hERT1orig, lastLumiBin_HB)) {
1891  std::cout << "code failed" << std::endl;
1892  gSystem->Exit(1);
1893  }
1894  } else
1895  hERT1 = hERT1orig;
1896 
1897  hERT1->GetXaxis()->SetTitle("<ADCAmpl> per LS HB: black-P1, red-P2,green-M1,blue-M2");
1898  hV.push_back(hERT1);
1899  hERT1->SetMarkerStyle(20);
1900  hERT1->SetMarkerSize(0.4);
1901  hERT1->SetXTitle("<A>(ev.in LS & ch.) - HB P1 - iLS \b");
1902  hERT1->SetMarkerColor(specColors[i]);
1903  hERT1->SetLineColor(0);
1904  hs->Add(hERT1);
1905  delete h1;
1906  delete h0;
1907  if (hERT1 != hERT1orig)
1908  delete hERT1orig;
1909  }
1910  hs->Draw("LPE1 nostack");
1911  cHB->Update(); // activate the axes
1912  hs->GetXaxis()->SetTitle("<A> per LS: black-P1, red-P2,green-M1,blue-M2");
1913  hs->Draw("LPE1 nostack");
1914  gPad->SetGridy();
1916 
1917  // AZ corrections 08.02.2016
1918  cHB->cd(2);
1919  TH1F *diff = new TH1F("diff", "", 100, 0., 4.);
1920 
1921  if (int(hV.size()) == specCountA) {
1922  flagErrAB_HB[0] = 0; // If we have the expected number of histograms, set the flag
1923  double sumdelta = 0.;
1924  int nnndelta = 0;
1925  for (int ibin = 1; ibin <= hV[0]->GetNbinsX(); ibin++) {
1926  double delta = 0.;
1927  double maxdelta = 0.;
1928  for (unsigned int i = 0; i < hV.size(); i++) {
1929  const TH1F *hi = hV[i];
1930  for (unsigned int j = 1; j < hV.size(); j++) {
1931  const TH1F *hj = hV[j];
1932  delta = fabs(hi->GetBinContent(ibin) - hj->GetBinContent(ibin));
1933  if (delta > maxdelta)
1934  maxdelta = delta;
1935  } //for
1936  } //for
1937  if (maxdelta > 0.) {
1938  diff->Fill(maxdelta);
1939  sumdelta += maxdelta;
1940  nnndelta++;
1941  }
1942  } //for ibin
1943  // avedelta_HB = sumdelta/hV[0]->GetNbinsX();
1944  avedelta_HB = sumdelta / nnndelta;
1945  std::cout << "******************>>>>>> ErrA_HB: avedelta_HB = " << avedelta_HB << std::endl;
1946  if (avedelta_HB > 0.24 || (avedelta_HB < 0.14 && avedelta_HB > 0.)) {
1947  flagErrAB_HB[0] = 1;
1948  } //if
1949  } //hV.size
1950  diff->SetMarkerStyle(20);
1951  diff->SetMarkerSize(0.8);
1952  diff->SetXTitle("max difference \b");
1953  diff->SetMarkerColor(2);
1954  diff->SetLineColor(0);
1955  gPad->SetGridx();
1956  gPad->SetLogy();
1957  diff->Draw("Error");
1959  cHB->Update();
1960  cHB->Print("HistErrA_HB.png");
1961  cHB->Clear();
1963 
1964  // clean-up
1965  if (diff)
1966  delete diff;
1967  for (unsigned int i = 0; i < hV.size(); i++)
1968  delete hV[i];
1969  } // ErrorA in HB
1970 
1972 
1973  { // errors type B
1974  const int specCountB = 4;
1975  const TString hnames[specCountB][2] = {{"h_2DsumErrorBLS1", "h_2D0sumErrorBLS1"},
1976  {"h_sumErrorBperLS1", "h_sum0ErrorBperLS1"},
1977  {"h_2DsumErrorBLS2", "h_2D0sumErrorBLS2"},
1978  {"h_sumErrorBperLS2", "h_sum0ErrorBperLS2"}};
1979 
1980  for (int depth = 1; depth <= 2; depth++) {
1981  cHB->Clear();
1982  cHB->Divide(2, 1);
1983  cHB->cd(1);
1984 
1985  TH1F *hRate2orig = NULL;
1986  TH2F *h2Cefz6 = NULL;
1987  TString hname1 = hnames[2 * depth - 2][0];
1988  TString hname0 = hnames[2 * depth - 2][1];
1989  TH2F *twod1 = (TH2F *)hfile->Get(hname1);
1990  TH2F *twod0 = (TH2F *)hfile->Get(hname0);
1991  if (1)
1992  std::cout << "debugger: errB_HB depth=" << depth << ". get 2D histos " << hname1 << " and " << hname0 << "\n";
1993  if (!twod1 || !twod0) {
1994  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
1995  ptext->AddText("Missing histos");
1996  if (!twod1) {
1997  std::cout << "\tfailed to get " << hname1 << "\n";
1998  ptext->AddText(hname1);
1999  }
2000  if (!twod0) {
2001  std::cout << "\tfailed to get " << hname0 << "\n";
2002  ptext->AddText(hname0);
2003  }
2004  ptext->Draw();
2005  } else {
2006  h2Cefz6 = (TH2F *)twod1->Clone(Form("Cefz6_%d", depth));
2007  h2Cefz6->SetTitle(Form("HB Depth %d \b", depth));
2008  h2Cefz6->Divide(twod1, twod0, 1, 1, "B");
2009 
2010  gPad->SetGridy();
2011  gPad->SetGridx();
2012  gPad->SetLogz();
2013  h2Cefz6->SetTitle(Form("Depth %d \b", depth));
2014  h2Cefz6->SetMarkerStyle(20);
2015  h2Cefz6->SetMarkerSize(0.4);
2016  // h2Cefz6->GetZaxis()->SetLabelSize(0.04);
2017  h2Cefz6->SetXTitle("#eta \b");
2018  h2Cefz6->SetYTitle("#phi \b");
2019  h2Cefz6->SetZTitle(Form("<ErrorB> - HB Depth%d \b", depth));
2020  h2Cefz6->SetMarkerColor(2);
2021  h2Cefz6->SetLineColor(2);
2022  h2Cefz6->Draw("COLZ");
2023 
2024  delete twod1;
2025  delete twod0;
2026  } // histos ok
2027 
2028  cHB->cd(2);
2029  hname1 = hnames[2 * depth - 1][0];
2030  hname0 = hnames[2 * depth - 1][1];
2031  TH1F *h1 = (TH1F *)hfile->Get(hname1);
2032  TH1F *h0 = (TH1F *)hfile->Get(hname0);
2033  if (1)
2034  std::cout << "errB_HB depth=" << depth << ". get 2D histos " << hname1 << " and " << hname0 << "\n";
2035  if (!h1 || !h0) {
2036  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2037  ptext->AddText("Missing histo");
2038  if (!h1) {
2039  std::cout << "\tfailed to get " << hname1 << "\n";
2040  ptext->AddText(hname1);
2041  }
2042  if (!h0) {
2043  std::cout << "\tfailed to get " << hname0 << "\n";
2044  ptext->AddText(hname0);
2045  }
2046  ptext->Draw();
2047  } else {
2048  gPad->SetGridx();
2049  gPad->SetGridy();
2050  // gPad->SetLogy();
2051  hRate2orig = (TH1F *)h1->Clone(Form("Rate2orig_%d", depth));
2052  hRate2orig->Divide(h1, h0, 1, 1, "B");
2053 
2054  TH1F *hRate2 = NULL;
2055  if (lastLumiBin_HB > 1) {
2056  if (!copyContents(&hRate2, Form("Rate2_%d", depth), "", hRate2orig, lastLumiBin_HB)) {
2057  std::cout << "code failed" << std::endl;
2058  gSystem->Exit(1);
2059  }
2060  } else
2061  hRate2 = hRate2orig;
2062 
2063  hRate2->SetTitle(Form("Depth %d \b", depth));
2064  hRate2->SetMarkerStyle(20);
2065  hRate2->SetMarkerSize(0.8);
2066  // hRate2->GetZaxis()->SetLabelSize(0.04);
2067  hRate2->SetXTitle(Form("<ErrorB>(ev.in LS & ch.) - HB depth%d - iLS \b", depth));
2068  hRate2->SetMarkerColor(2);
2069  hRate2->SetLineColor(0);
2070  hRate2->Draw("Error");
2071 
2072  if (LSofFirstErrB_HB == -1) {
2073  int nx = hRate2->GetXaxis()->GetNbins();
2074  for (int i = 1; i <= nx; i++) {
2075  double ccc1 = hRate2->GetBinContent(i);
2076  if (ccc1 > 0.) {
2077  cout << "****************>>>>>>>>>>> ErrB_HB bad LS start at iLS = " << i << " with rate = " << ccc1
2078  << endl;
2079  LSofFirstErrB_HB = i;
2080  break;
2081  }
2082  }
2083  }
2084 
2085  delete h1;
2086  delete h0;
2087  if (hRate2 != hRate2orig) {
2088  delete hRate2orig;
2089  hRate2orig = hRate2;
2090  }
2091  }
2092 
2093  cHB->Update();
2094  cHB->Print(Form("HistErrB_HB_%d.png", depth));
2095  cHB->Clear();
2096  if (h2Cefz6)
2097  delete h2Cefz6;
2098  if (hRate2orig)
2099  delete hRate2orig;
2100  }
2101  } // ErrorsB in HB
2102 
2103  //====================================================================== HE :
2104  //====================================================================== HE :
2105  //====================================================================== HE :
2106  // Special test of errors type A and B in HE
2107  // AZ 08.02.2016
2108 
2109  int flagErrAB_HE[2];
2110  flagErrAB_HE[0] = -1;
2111  flagErrAB_HE[1] = -1;
2112  double avedelta_HE = 0.;
2113  int lastLumiBin_HE = -1;
2114  int LSofFirstErrB_HE = -1;
2115  {
2116  const int specCountA = 4;
2117  const int specColors[specCountA] = {1, 2, 3, 4};
2118  const TString hnames[specCountA][2] = {{"h_sumADCAmplperLS3_P1", "h_sum0ADCAmplperLS3_P1"},
2119  {"h_sumADCAmplperLS3_P2", "h_sum0ADCAmplperLS3_P2"},
2120  {"h_sumADCAmplperLS3_M1", "h_sum0ADCAmplperLS3_M1"},
2121  {"h_sumADCAmplperLS3_M2", "h_sum0ADCAmplperLS3_M2"}};
2122 
2123  std::vector<TH1F *> hV;
2124  THStack *hs = new THStack("hs", "ADCAmplerLS1");
2125  cHB->Clear();
2126  // cHB->cd();
2127  cHB->Divide(2, 1);
2128  cHB->cd(1);
2129 
2131  for (int i = 0; i < specCountA; i++) {
2132  if (1)
2133  std::cout << "debugger: errA_HE : get histos for i=" << i << " " << hnames[i][0] << " and " << hnames[i][1]
2134  << "\n";
2135  TH1F *h1 = (TH1F *)hfile->Get(hnames[i][0]);
2136  TH1F *h0 = (TH1F *)hfile->Get(hnames[i][1]);
2137  if (!h1 || !h0) {
2138  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2139  ptext->AddText("Missing histo");
2140  if (!h1) {
2141  std::cout << "\tfailed to get " << hnames[i][0] << "\n";
2142  ptext->AddText(hnames[i][0]);
2143  }
2144  if (!h0) {
2145  std::cout << "\tfailed to get " << hnames[i][1] << "\n";
2146  ptext->AddText(hnames[i][1]);
2147  }
2148  ptext->Draw();
2149  continue;
2150  }
2151  TH1F *hERT1orig = (TH1F *)h1->Clone(Form("ERT1orig_%d", i));
2152  hERT1orig->Divide(h1, h0, 1, 1, "B");
2153 
2154  if ((lastLumiBin_HE < 0) && (i == 0)) {
2155  for (int ibin = hERT1orig->GetNbinsX(); ibin >= 1; ibin--) {
2156  if (hERT1orig->GetBinContent(ibin) == 0)
2157  lastLumiBin_HE = ibin;
2158  else
2159  break;
2160  }
2161  lastLumiBin_HE += 3; // show more bins
2162  if (lastLumiBin_HE >= hERT1orig->GetNbinsX())
2163  lastLumiBin_HE = -1;
2164  }
2165  TH1F *hERT1 = NULL;
2166  if (lastLumiBin_HE > 1) {
2167  if (!copyContents(&hERT1, Form("ERT1_%d", i), "", hERT1orig, lastLumiBin_HE)) {
2168  std::cout << "code failed" << std::endl;
2169  gSystem->Exit(1);
2170  }
2171  } else
2172  hERT1 = hERT1orig;
2173 
2174  hERT1->GetXaxis()->SetTitle("<ADCAmpl> per LS HE: black-P1, red-P2,green-M1,blue-M2");
2175  hV.push_back(hERT1);
2176  hERT1->SetMarkerStyle(20);
2177  hERT1->SetMarkerSize(0.4);
2178  hERT1->SetXTitle("<A>(ev.in LS & ch.) - HE P1 - iLS \b");
2179  hERT1->SetMarkerColor(specColors[i]);
2180  hERT1->SetLineColor(0);
2181  hs->Add(hERT1);
2182  delete h1;
2183  delete h0;
2184  if (hERT1 != hERT1orig)
2185  delete hERT1orig;
2186  }
2187  hs->Draw("LPE1 nostack");
2188  cHB->Update(); // activate the axes
2189  hs->GetXaxis()->SetTitle("<A> per LS: black-P1, red-P2,green-M1,blue-M2");
2190  hs->Draw("LPE1 nostack");
2191  gPad->SetGridy();
2193 
2194  // AZ corrections 08.02.2016
2195  cHB->cd(2);
2196  TH1F *diff = new TH1F("diff", "", 100, 0., 4.);
2197 
2198  if (int(hV.size()) == specCountA) {
2199  flagErrAB_HE[0] = 0; // If we have the expected number of histograms, set the flag
2200  double sumdelta = 0.;
2201  int nnndelta = 0;
2202  for (int ibin = 1; ibin <= hV[0]->GetNbinsX(); ibin++) {
2203  double delta = 0.;
2204  double maxdelta = 0.;
2205  for (unsigned int i = 0; i < hV.size(); i++) {
2206  const TH1F *hi = hV[i];
2207  for (unsigned int j = 1; j < hV.size(); j++) {
2208  const TH1F *hj = hV[j];
2209  delta = fabs(hi->GetBinContent(ibin) - hj->GetBinContent(ibin));
2210  if (delta > maxdelta)
2211  maxdelta = delta;
2212  } //for
2213  } //for
2214  if (maxdelta > 0.) {
2215  diff->Fill(maxdelta);
2216  sumdelta += maxdelta;
2217  nnndelta++;
2218  }
2219  } //for ibin
2220  // avedelta_HE = sumdelta/hV[0]->GetNbinsX();
2221  avedelta_HE = sumdelta / nnndelta;
2222  std::cout << "******************>>>>>> ErrA_HE: avedelta_HE = " << avedelta_HE << std::endl;
2223  if (avedelta_HE > 1.1 || (avedelta_HE < 0.5 && avedelta_HE > 0.)) {
2224  flagErrAB_HE[0] = 1;
2225  } //if
2226  } //hV.size
2227  diff->SetMarkerStyle(20);
2228  diff->SetMarkerSize(0.8);
2229  diff->SetXTitle("max difference \b");
2230  diff->SetMarkerColor(2);
2231  diff->SetLineColor(0);
2232  gPad->SetGridx();
2233  gPad->SetLogy();
2234  diff->Draw("Error");
2236  cHB->Update();
2237  cHB->Print("HistErrA_HE.png");
2238  cHB->Clear();
2240 
2241  // clean-up
2242  if (diff)
2243  delete diff;
2244  for (unsigned int i = 0; i < hV.size(); i++)
2245  delete hV[i];
2246  } // ErrorA in HE
2247 
2249 
2250  { // errors type B
2251  const int specCountB = 6;
2252  const TString hnames[specCountB][2] = {{"h_2DsumErrorBLS3", "h_2D0sumErrorBLS3"},
2253  {"h_sumErrorBperLS3", "h_sum0ErrorBperLS3"},
2254  {"h_2DsumErrorBLS4", "h_2D0sumErrorBLS4"},
2255  {"h_sumErrorBperLS4", "h_sum0ErrorBperLS4"},
2256  {"h_2DsumErrorBLS5", "h_2D0sumErrorBLS5"},
2257  {"h_sumErrorBperLS5", "h_sum0ErrorBperLS5"}};
2258 
2259  for (int depth = 1; depth <= 3; depth++) {
2260  cHB->Clear();
2261  cHB->Divide(2, 1);
2262  cHB->cd(1);
2263 
2264  TH1F *hRate2orig = NULL;
2265  TH2F *h2Cefz6 = NULL;
2266  TString hname1 = hnames[2 * depth - 2][0];
2267  TString hname0 = hnames[2 * depth - 2][1];
2268  TH2F *twod1 = (TH2F *)hfile->Get(hname1);
2269  TH2F *twod0 = (TH2F *)hfile->Get(hname0);
2270  if (1)
2271  std::cout << "debugger: errB_HE depth=" << depth << ". get 2D histos " << hname1 << " and " << hname0 << "\n";
2272  if (!twod1 || !twod0) {
2273  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2274  ptext->AddText("Missing histos");
2275  if (!twod1) {
2276  std::cout << "\tfailed to get " << hname1 << "\n";
2277  ptext->AddText(hname1);
2278  }
2279  if (!twod0) {
2280  std::cout << "\tfailed to get " << hname0 << "\n";
2281  ptext->AddText(hname0);
2282  }
2283  ptext->Draw();
2284  } else {
2285  h2Cefz6 = (TH2F *)twod1->Clone(Form("Cefz6_%d", depth));
2286  h2Cefz6->SetTitle(Form("HE Depth %d \b", depth));
2287  h2Cefz6->Divide(twod1, twod0, 1, 1, "B");
2288 
2289  gPad->SetGridy();
2290  gPad->SetGridx();
2291  gPad->SetLogz();
2292  h2Cefz6->SetTitle(Form("Depth %d \b", depth));
2293  h2Cefz6->SetMarkerStyle(20);
2294  h2Cefz6->SetMarkerSize(0.4);
2295  // h2Cefz6->GetZaxis()->SetLabelSize(0.04);
2296  h2Cefz6->SetXTitle("#eta \b");
2297  h2Cefz6->SetYTitle("#phi \b");
2298  h2Cefz6->SetZTitle(Form("<ErrorB> - HE Depth%d \b", depth));
2299  h2Cefz6->SetMarkerColor(2);
2300  h2Cefz6->SetLineColor(2);
2301  h2Cefz6->Draw("COLZ");
2302 
2303  delete twod1;
2304  delete twod0;
2305  } // histos ok
2306 
2307  cHB->cd(2);
2308  hname1 = hnames[2 * depth - 1][0];
2309  hname0 = hnames[2 * depth - 1][1];
2310  TH1F *h1 = (TH1F *)hfile->Get(hname1);
2311  TH1F *h0 = (TH1F *)hfile->Get(hname0);
2312  if (1)
2313  std::cout << "errB_HE depth=" << depth << ". get 2D histos " << hname1 << " and " << hname0 << "\n";
2314  if (!h1 || !h0) {
2315  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2316  ptext->AddText("Missing histo");
2317  if (!h1) {
2318  std::cout << "\tfailed to get " << hname1 << "\n";
2319  ptext->AddText(hname1);
2320  }
2321  if (!h0) {
2322  std::cout << "\tfailed to get " << hname0 << "\n";
2323  ptext->AddText(hname0);
2324  }
2325  ptext->Draw();
2326  } else {
2327  gPad->SetGridx();
2328  gPad->SetGridy();
2329  // gPad->SetLogy();
2330  hRate2orig = (TH1F *)h1->Clone(Form("Rate2orig_%d", depth));
2331  hRate2orig->Divide(h1, h0, 1, 1, "B");
2332 
2333  TH1F *hRate2 = NULL;
2334  if (lastLumiBin_HE > 1) {
2335  if (!copyContents(&hRate2, Form("Rate2_%d", depth), "", hRate2orig, lastLumiBin_HE)) {
2336  std::cout << "code failed" << std::endl;
2337  gSystem->Exit(1);
2338  }
2339  } else
2340  hRate2 = hRate2orig;
2341 
2342  hRate2->SetTitle(Form("Depth %d \b", depth));
2343  hRate2->SetMarkerStyle(20);
2344  hRate2->SetMarkerSize(0.8);
2345  // hRate2->GetZaxis()->SetLabelSize(0.04);
2346  hRate2->SetXTitle(Form("<ErrorB>(ev.in LS & ch.) - HE depth%d - iLS \b", depth));
2347  hRate2->SetMarkerColor(2);
2348  hRate2->SetLineColor(0);
2349  hRate2->Draw("Error");
2350 
2351  if (LSofFirstErrB_HE == -1) {
2352  int nx = hRate2->GetXaxis()->GetNbins();
2353  for (int i = 1; i <= nx; i++) {
2354  double ccc1 = hRate2->GetBinContent(i);
2355  if (ccc1 > 0.) {
2356  cout << "****************>>>>>>>>>>> ErrB_HE bad LS start at iLS = " << i << " with rate = " << ccc1
2357  << endl;
2358  LSofFirstErrB_HE = i;
2359  break;
2360  }
2361  }
2362  }
2363 
2364  delete h1;
2365  delete h0;
2366  if (hRate2 != hRate2orig) {
2367  delete hRate2orig;
2368  hRate2orig = hRate2;
2369  }
2370  }
2371 
2372  cHB->Update();
2373  cHB->Print(Form("HistErrB_HE_%d.png", depth));
2374  cHB->Clear();
2375  if (h2Cefz6)
2376  delete h2Cefz6;
2377  if (hRate2orig)
2378  delete hRate2orig;
2379  }
2380  } // ErrorsB in HE
2381 
2382  //====================================================================== HO :
2383  //====================================================================== HO :
2384  //====================================================================== HO :
2385  // Special test of errors type A and B in HO
2386  // AZ 08.02.2016
2387 
2388  int flagErrAB_HO[2];
2389  flagErrAB_HO[0] = -1;
2390  flagErrAB_HO[1] = -1;
2391  double avedelta_HO = 0.;
2392  int lastLumiBin_HO = -1;
2393  int LSofFirstErrB_HO = -1;
2394  {
2395  const int specCountA = 4;
2396  const int specColors[specCountA] = {1, 2, 3, 4};
2397  const TString hnames[specCountA][2] = {{"h_sumADCAmplperLS8_P1", "h_sum0ADCAmplperLS8_P1"},
2398  {"h_sumADCAmplperLS8_P2", "h_sum0ADCAmplperLS8_P2"},
2399  {"h_sumADCAmplperLS8_M1", "h_sum0ADCAmplperLS8_M1"},
2400  {"h_sumADCAmplperLS8_M2", "h_sum0ADCAmplperLS8_M2"}};
2401 
2402  std::vector<TH1F *> hV;
2403  THStack *hs = new THStack("hs", "ADCAmplerLS1");
2404  cHB->Clear();
2405  // cHB->cd();
2406  cHB->Divide(2, 1);
2407  cHB->cd(1);
2408 
2410  for (int i = 0; i < specCountA; i++) {
2411  if (1)
2412  std::cout << "debugger: errA_HO : get histos for i=" << i << " " << hnames[i][0] << " and " << hnames[i][1]
2413  << "\n";
2414  TH1F *h1 = (TH1F *)hfile->Get(hnames[i][0]);
2415  TH1F *h0 = (TH1F *)hfile->Get(hnames[i][1]);
2416  if (!h1 || !h0) {
2417  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2418  ptext->AddText("Missing histo");
2419  if (!h1) {
2420  std::cout << "\tfailed to get " << hnames[i][0] << "\n";
2421  ptext->AddText(hnames[i][0]);
2422  }
2423  if (!h0) {
2424  std::cout << "\tfailed to get " << hnames[i][1] << "\n";
2425  ptext->AddText(hnames[i][1]);
2426  }
2427  ptext->Draw();
2428  continue;
2429  }
2430  TH1F *hoRT1orig = (TH1F *)h1->Clone(Form("ERT1orig_%d", i));
2431  hoRT1orig->Divide(h1, h0, 1, 1, "B");
2432 
2433  if ((lastLumiBin_HO < 0) && (i == 0)) {
2434  for (int ibin = hoRT1orig->GetNbinsX(); ibin >= 1; ibin--) {
2435  if (hoRT1orig->GetBinContent(ibin) == 0)
2436  lastLumiBin_HO = ibin;
2437  else
2438  break;
2439  }
2440  lastLumiBin_HO += 3; // show more bins
2441  if (lastLumiBin_HO >= hoRT1orig->GetNbinsX())
2442  lastLumiBin_HO = -1;
2443  }
2444  TH1F *hoRT1 = NULL;
2445  if (lastLumiBin_HO > 1) {
2446  if (!copyContents(&hoRT1, Form("ERT1_%d", i), "", hoRT1orig, lastLumiBin_HO)) {
2447  std::cout << "code failed" << std::endl;
2448  gSystem->Exit(1);
2449  }
2450  } else
2451  hoRT1 = hoRT1orig;
2452 
2453  hoRT1->GetXaxis()->SetTitle("<ADCAmpl> per LS HO: black-P1, red-P2,green-M1,blue-M2");
2454  hV.push_back(hoRT1);
2455  hoRT1->SetMarkerStyle(20);
2456  hoRT1->SetMarkerSize(0.4);
2457  hoRT1->SetXTitle("<A>(ev.in LS & ch.) - HO P1 - iLS \b");
2458  hoRT1->SetMarkerColor(specColors[i]);
2459  hoRT1->SetLineColor(0);
2460  hs->Add(hoRT1);
2461  delete h1;
2462  delete h0;
2463  if (hoRT1 != hoRT1orig)
2464  delete hoRT1orig;
2465  }
2466  hs->Draw("LPE1 nostack");
2467  cHB->Update(); // activate tho axes
2468  hs->GetXaxis()->SetTitle("<A> per LS: black-P1, red-P2,green-M1,blue-M2");
2469  hs->Draw("LPE1 nostack");
2470  gPad->SetGridy();
2472 
2473  // AZ corrections 08.02.2016
2474  cHB->cd(2);
2475  TH1F *diff = new TH1F("diff", "", 100, 0., 4.);
2476 
2477  if (int(hV.size()) == specCountA) {
2478  flagErrAB_HO[0] = 0; // If we have tho expected number of histograms, set tho flag
2479  double sumdelta = 0.;
2480  int nnndelta = 0;
2481  for (int ibin = 1; ibin <= hV[0]->GetNbinsX(); ibin++) {
2482  double delta = 0.;
2483  double maxdelta = 0.;
2484  for (unsigned int i = 0; i < hV.size(); i++) {
2485  const TH1F *hi = hV[i];
2486  for (unsigned int j = 1; j < hV.size(); j++) {
2487  const TH1F *hj = hV[j];
2488  delta = fabs(hi->GetBinContent(ibin) - hj->GetBinContent(ibin));
2489  if (delta > maxdelta)
2490  maxdelta = delta;
2491  } //for
2492  } //for
2493  if (maxdelta > 0.) {
2494  diff->Fill(maxdelta);
2495  sumdelta += maxdelta;
2496  nnndelta++;
2497  }
2498  } //for ibin
2499  // avedelta_HO = sumdelta/hV[0]->GetNbinsX();
2500  avedelta_HO = sumdelta / nnndelta;
2501  std::cout << "******************>>>>>> ErrA_HO: avedelta_HO = " << avedelta_HO << std::endl;
2502  if (avedelta_HO > 0.8 || (avedelta_HO < 0.2 && avedelta_HO > 0.)) {
2503  flagErrAB_HO[0] = 1;
2504  } //if
2505  } //hV.size
2506  diff->SetMarkerStyle(20);
2507  diff->SetMarkerSize(0.8);
2508  diff->SetXTitle("max difference \b");
2509  diff->SetMarkerColor(2);
2510  diff->SetLineColor(0);
2511  gPad->SetGridx();
2512  gPad->SetLogy();
2513  diff->Draw("Error");
2515  cHB->Update();
2516  cHB->Print("HistErrA_HO.png");
2517  cHB->Clear();
2519 
2520  // clean-up
2521  if (diff)
2522  delete diff;
2523  for (unsigned int i = 0; i < hV.size(); i++)
2524  delete hV[i];
2525  } // ErrorA in HO
2526 
2528 
2529  { // errors type B
2530  const int specCountB = 2;
2531  const TString hnames[specCountB][2] = {{"h_2DsumErrorBLS8", "h_2D0sumErrorBLS8"},
2532  {"h_sumErrorBperLS8", "h_sum0ErrorBperLS8"}};
2533 
2534  for (int depth = 4; depth <= 4; depth++) {
2535  cHB->Clear();
2536  cHB->Divide(2, 1);
2537  cHB->cd(1);
2538 
2539  TH1F *hRate2orig = NULL;
2540  TH2F *h2Cefz6 = NULL;
2541  TString hname1 = hnames[2 * depth - 8][0];
2542  TString hname0 = hnames[2 * depth - 8][1];
2543  TH2F *twod1 = (TH2F *)hfile->Get(hname1);
2544  TH2F *twod0 = (TH2F *)hfile->Get(hname0);
2545  if (1)
2546  std::cout << "debugger: errB_HO depth=" << depth << ". get 2D histos " << hname1 << " and " << hname0 << "\n";
2547  if (!twod1 || !twod0) {
2548  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2549  ptext->AddText("Missing histos");
2550  if (!twod1) {
2551  std::cout << "\tfailed to get " << hname1 << "\n";
2552  ptext->AddText(hname1);
2553  }
2554  if (!twod0) {
2555  std::cout << "\tfailed to get " << hname0 << "\n";
2556  ptext->AddText(hname0);
2557  }
2558  ptext->Draw();
2559  } else {
2560  h2Cefz6 = (TH2F *)twod1->Clone(Form("Cefz6_%d", depth));
2561  h2Cefz6->SetTitle(Form("HO Depth %d \b", depth));
2562  h2Cefz6->Divide(twod1, twod0, 1, 1, "B");
2563 
2564  gPad->SetGridy();
2565  gPad->SetGridx();
2566  gPad->SetLogz();
2567  h2Cefz6->SetTitle(Form("Depth %d \b", depth));
2568  h2Cefz6->SetMarkerStyle(20);
2569  h2Cefz6->SetMarkerSize(0.4);
2570  // h2Cefz6->GetZaxis()->SetLabelSize(0.04);
2571  h2Cefz6->SetXTitle("#eta \b");
2572  h2Cefz6->SetYTitle("#phi \b");
2573  h2Cefz6->SetZTitle(Form("<ErrorB> - HO Depth%d \b", depth));
2574  h2Cefz6->SetMarkerColor(2);
2575  h2Cefz6->SetLineColor(2);
2576  h2Cefz6->Draw("COLZ");
2577 
2578  delete twod1;
2579  delete twod0;
2580  } // histos ok
2581 
2582  cHB->cd(2);
2583  hname1 = hnames[2 * depth - 7][0];
2584  hname0 = hnames[2 * depth - 7][1];
2585  TH1F *h1 = (TH1F *)hfile->Get(hname1);
2586  TH1F *h0 = (TH1F *)hfile->Get(hname0);
2587  if (1)
2588  std::cout << "errB_HO depth=" << depth << ". get 2D histos " << hname1 << " and " << hname0 << "\n";
2589  if (!h1 || !h0) {
2590  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2591  ptext->AddText("Missing histo");
2592  if (!h1) {
2593  std::cout << "\tfailed to get " << hname1 << "\n";
2594  ptext->AddText(hname1);
2595  }
2596  if (!h0) {
2597  std::cout << "\tfailed to get " << hname0 << "\n";
2598  ptext->AddText(hname0);
2599  }
2600  ptext->Draw();
2601  } else {
2602  gPad->SetGridx();
2603  gPad->SetGridy();
2604  // gPad->SetLogy();
2605  hRate2orig = (TH1F *)h1->Clone(Form("Rate2orig_%d", depth));
2606  hRate2orig->Divide(h1, h0, 1, 1, "B");
2607 
2608  TH1F *hRate2 = NULL;
2609  if (lastLumiBin_HO > 1) {
2610  if (!copyContents(&hRate2, Form("Rate2_%d", depth), "", hRate2orig, lastLumiBin_HO)) {
2611  std::cout << "code failed" << std::endl;
2612  gSystem->Exit(1);
2613  }
2614  } else
2615  hRate2 = hRate2orig;
2616 
2617  hRate2->SetTitle(Form("Depth %d \b", depth));
2618  hRate2->SetMarkerStyle(20);
2619  hRate2->SetMarkerSize(0.8);
2620  // hRate2->GetZaxis()->SetLabelSize(0.04);
2621  hRate2->SetXTitle(Form("<ErrorB>(ev.in LS & ch.) - HO depth%d - iLS \b", depth));
2622  hRate2->SetMarkerColor(2);
2623  hRate2->SetLineColor(0);
2624  hRate2->Draw("Error");
2625 
2626  if (LSofFirstErrB_HO == -1) {
2627  int nx = hRate2->GetXaxis()->GetNbins();
2628  for (int i = 1; i <= nx; i++) {
2629  double ccc1 = hRate2->GetBinContent(i);
2630  if (ccc1 > 0.) {
2631  cout << "****************>>>>>>>>>>> ErrB_HO bad LS start at iLS = " << i << " with rate = " << ccc1
2632  << endl;
2633  LSofFirstErrB_HO = i;
2634  break;
2635  }
2636  }
2637  }
2638 
2639  delete h1;
2640  delete h0;
2641  if (hRate2 != hRate2orig) {
2642  delete hRate2orig;
2643  hRate2orig = hRate2;
2644  }
2645  }
2646 
2647  cHB->Update();
2648  cHB->Print(Form("HistErrB_HO_%d.png", depth));
2649  cHB->Clear();
2650  if (h2Cefz6)
2651  delete h2Cefz6;
2652  if (hRate2orig)
2653  delete hRate2orig;
2654  }
2655  } // ErrorsB in HO
2656 
2657  //====================================================================== done by Andrius for HF:
2658  //====================================================================== done by Andrius for HF:
2659  //====================================================================== done by Andrius for HF:
2660  // Special test of errors type A and B in HF
2661 
2662  int flagErrAB_HF[2];
2663  flagErrAB_HF[0] = -1;
2664  flagErrAB_HF[1] = -1;
2665  double avedelta_HF = 0.;
2666  int lastLumiBin_HF = -1;
2667  int LSofFirstErrB_HF = -1;
2668  {
2669  const int specCountA = 4;
2670  const int specColors[specCountA] = {1, 2, 3, 4};
2671  const TString hnames[specCountA][2] = {{"h_sumADCAmplperLS6_P1", "h_sum0ADCAmplperLS6_P1"},
2672  {"h_sumADCAmplperLS6_P2", "h_sum0ADCAmplperLS6_P2"},
2673  {"h_sumADCAmplperLS6_M1", "h_sum0ADCAmplperLS6_M1"},
2674  {"h_sumADCAmplperLS6_M2", "h_sum0ADCAmplperLS6_M2"}};
2675 
2676  std::vector<TH1F *> hV;
2677  THStack *hs = new THStack("hs", "ADCAmplerLS6");
2678  cHB->Clear();
2679  // cHB->cd();
2680  cHB->Divide(2, 1);
2681  cHB->cd(1);
2682 
2684  for (int i = 0; i < specCountA; i++) {
2685  if (1)
2686  std::cout << "debugger: errA_HF : get histos for i=" << i << " " << hnames[i][0] << " and " << hnames[i][1]
2687  << "\n";
2688  TH1F *h1 = (TH1F *)hfile->Get(hnames[i][0]);
2689  TH1F *h0 = (TH1F *)hfile->Get(hnames[i][1]);
2690  if (!h1 || !h0) {
2691  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2692  ptext->AddText("Missing histo");
2693  if (!h1) {
2694  std::cout << "\tfailed to get " << hnames[i][0] << "\n";
2695  ptext->AddText(hnames[i][0]);
2696  }
2697  if (!h0) {
2698  std::cout << "\tfailed to get " << hnames[i][1] << "\n";
2699  ptext->AddText(hnames[i][1]);
2700  }
2701  ptext->Draw();
2702  continue;
2703  }
2704  TH1F *hERT1orig = (TH1F *)h1->Clone(Form("ERT1orig_%d", i));
2705  hERT1orig->Divide(h1, h0, 1, 1, "B");
2706 
2707  if ((lastLumiBin_HF < 0) && (i == 0)) {
2708  for (int ibin = hERT1orig->GetNbinsX(); ibin >= 1; ibin--) {
2709  if (hERT1orig->GetBinContent(ibin) == 0)
2710  lastLumiBin_HF = ibin;
2711  else
2712  break;
2713  }
2714  lastLumiBin_HF += 3; // show more bins
2715  if (lastLumiBin_HF >= hERT1orig->GetNbinsX())
2716  lastLumiBin_HF = -1;
2717  }
2718  TH1F *hERT1 = NULL;
2719  if (lastLumiBin_HF > 1) {
2720  if (!copyContents(&hERT1, Form("ERT1_%d", i), "", hERT1orig, lastLumiBin_HF)) {
2721  std::cout << "code failed" << std::endl;
2722  gSystem->Exit(1);
2723  }
2724  } else
2725  hERT1 = hERT1orig;
2726 
2727  hERT1->GetXaxis()->SetTitle("<ADCAmpl> per LS HF: black-P1, red-P2,green-M1,blue-M2");
2728  hV.push_back(hERT1);
2729  hERT1->SetMarkerStyle(20);
2730  hERT1->SetMarkerSize(0.4);
2731  hERT1->SetXTitle("<A>(ev.in LS & ch.) - HF P1 - iLS \b");
2732  hERT1->SetMarkerColor(specColors[i]);
2733  hERT1->SetLineColor(0);
2734  hs->Add(hERT1);
2735  delete h1;
2736  delete h0;
2737  if (hERT1 != hERT1orig)
2738  delete hERT1orig;
2739  }
2740  hs->Draw("LPE1 nostack");
2741  cHB->Update(); // activate the axes
2742  hs->GetXaxis()->SetTitle("<A> per LS: black-P1, red-P2,green-M1,blue-M2");
2743  hs->Draw("LPE1 nostack");
2744  gPad->SetGridy();
2746 
2747  // AZ corrections 04.02.2016
2748  cHB->cd(2);
2749  TH1F *diff = new TH1F("diff", "", 100, 0., 4.);
2750 
2751  if (int(hV.size()) == specCountA) {
2752  flagErrAB_HF[0] = 0; // If we have the expected number of histograms, set the flag
2753  double sumdelta = 0.;
2754  int nnndelta = 0;
2755  std::cout << "******** GetNbinsX = " << hV[0]->GetNbinsX() << std::endl;
2756  for (int ibin = 1; ibin <= hV[0]->GetNbinsX(); ibin++) {
2757  double delta = 0.;
2758  double maxdelta = 0.;
2759  for (unsigned int i = 0; i < hV.size(); i++) {
2760  const TH1F *hi = hV[i];
2761  for (unsigned int j = 1; j < hV.size(); j++) {
2762  const TH1F *hj = hV[j];
2763  delta = fabs(hi->GetBinContent(ibin) - hj->GetBinContent(ibin));
2764  if (delta > maxdelta)
2765  maxdelta = delta;
2766  } //for
2767  } //for
2768  // std::cout << "***** ibin = " << ibin << " nnndelta= " << nnndelta << " maxdelta= " << maxdelta <<std::endl;
2769  if (maxdelta > 0.) {
2770  diff->Fill(maxdelta);
2771  sumdelta += maxdelta;
2772  nnndelta++;
2773  }
2774  } //for ibin
2775  // avedelta_HF = sumdelta/hV[0]->GetNbinsX();
2776  avedelta_HF = sumdelta / nnndelta;
2777  // std::cout << "******************>>>>>> ErrA_HF: avedelta_HF = " << avedelta_HF << " Npoints for comparison= " << nnndelta <<std::endl;
2778  if (avedelta_HF > 2.4 || (avedelta_HF < 0.8 && avedelta_HF > 0.)) {
2779  flagErrAB_HF[0] = 1;
2780  } //if
2781  } //hV.size
2782  diff->SetMarkerStyle(20);
2783  diff->SetMarkerSize(0.8);
2784  diff->SetXTitle("max difference \b");
2785  diff->SetMarkerColor(2);
2786  diff->SetLineColor(0);
2787  gPad->SetGridx();
2788  gPad->SetLogy();
2789  diff->Draw("Error");
2791  cHB->Update();
2792  cHB->Print("HistErrA_HF.png");
2793  cHB->Clear();
2795  // clean-up
2796  if (diff)
2797  delete diff;
2798  for (unsigned int i = 0; i < hV.size(); i++)
2799  delete hV[i];
2800  } // ErrorA in HF
2803  { // errors type B
2804  const int specCountB = 4;
2805  const TString hnames[specCountB][2] = {{"h_2DsumErrorBLS6", "h_2D0sumErrorBLS6"},
2806  {"h_sumErrorBperLS6", "h_sum0ErrorBperLS6"},
2807  {"h_2DsumErrorBLS7", "h_2D0sumErrorBLS7"},
2808  {"h_sumErrorBperLS7", "h_sum0ErrorBperLS7"}};
2809 
2810  for (int depth = 1; depth <= 2; depth++) {
2811  cHB->Clear();
2812  cHB->Divide(2, 1);
2813  cHB->cd(1);
2814  TH1F *hRate2orig = NULL;
2815  TH2F *h2Cefz6 = NULL;
2816  TString hname1 = hnames[2 * depth - 2][0];
2817  TString hname0 = hnames[2 * depth - 2][1];
2818  TH2F *twod1 = (TH2F *)hfile->Get(hname1);
2819  TH2F *twod0 = (TH2F *)hfile->Get(hname0);
2820  if (1)
2821  std::cout << "debugger: errB_HF depth=" << depth << ". get 2D histos " << hname1 << " and " << hname0 << "\n";
2822  if (!twod1 || !twod0) {
2823  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2824  ptext->AddText("Missing histos");
2825  if (!twod1) {
2826  std::cout << "\tfailed to get " << hname1 << "\n";
2827  ptext->AddText(hname1);
2828  }
2829  if (!twod0) {
2830  std::cout << "\tfailed to get " << hname0 << "\n";
2831  ptext->AddText(hname0);
2832  }
2833  ptext->Draw();
2834  } else {
2835  h2Cefz6 = (TH2F *)twod1->Clone(Form("Cefz6_%d", depth));
2836  h2Cefz6->SetTitle(Form("HF Depth %d \b", depth));
2837  h2Cefz6->Divide(twod1, twod0, 1, 1, "B");
2838 
2839  gPad->SetGridy();
2840  gPad->SetGridx();
2841  gPad->SetLogz();
2842  h2Cefz6->SetTitle(Form("Depth %d \b", depth));
2843  h2Cefz6->SetMarkerStyle(20);
2844  h2Cefz6->SetMarkerSize(0.4);
2845  // h2Cefz6->GetZaxis()->SetLabelSize(0.04);
2846  h2Cefz6->SetXTitle("#eta \b");
2847  h2Cefz6->SetYTitle("#phi \b");
2848  h2Cefz6->SetZTitle(Form("<ErrorB> - HF Depth%d \b", depth));
2849  h2Cefz6->SetMarkerColor(2);
2850  h2Cefz6->SetLineColor(2);
2851  h2Cefz6->Draw("COLZ");
2852  delete twod1;
2853  delete twod0;
2854  } // histos ok
2855  cHB->cd(2);
2856  hname1 = hnames[2 * depth - 1][0];
2857  hname0 = hnames[2 * depth - 1][1];
2858  TH1F *h1 = (TH1F *)hfile->Get(hname1);
2859  TH1F *h0 = (TH1F *)hfile->Get(hname0);
2860  if (1)
2861  std::cout << "errB_HF depth=" << depth << ". get 2D histos " << hname1 << " and " << hname0 << "\n";
2862  if (!h1 || !h0) {
2863  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2864  ptext->AddText("Missing histo");
2865  if (!h1) {
2866  std::cout << "\tfailed to get " << hname1 << "\n";
2867  ptext->AddText(hname1);
2868  }
2869  if (!h0) {
2870  std::cout << "\tfailed to get " << hname0 << "\n";
2871  ptext->AddText(hname0);
2872  }
2873  ptext->Draw();
2874  } else {
2875  gPad->SetGridx();
2876  gPad->SetGridy();
2877  // gPad->SetLogy();
2878  hRate2orig = (TH1F *)h1->Clone(Form("Rate2orig_%d", depth));
2879  hRate2orig->Divide(h1, h0, 1, 1, "B");
2880 
2881  TH1F *hRate2 = NULL;
2882  if (lastLumiBin_HF > 1) {
2883  if (!copyContents(&hRate2, Form("Rate2_%d", depth), "", hRate2orig, lastLumiBin_HF)) {
2884  std::cout << "code failed" << std::endl;
2885  gSystem->Exit(1);
2886  }
2887  } else
2888  hRate2 = hRate2orig;
2889  hRate2->SetTitle(Form("Depth %d \b", depth));
2890  hRate2->SetMarkerStyle(20);
2891  hRate2->SetMarkerSize(0.8);
2892  // hRate2->GetZaxis()->SetLabelSize(0.04);
2893  hRate2->SetXTitle(Form("<ErrorB>(ev.in LS & ch.) - HF depth%d - iLS \b", depth));
2894  hRate2->SetMarkerColor(2);
2895  hRate2->SetLineColor(0);
2896  hRate2->Draw("Error");
2897  if (LSofFirstErrB_HF == -1) {
2898  int nx = hRate2->GetXaxis()->GetNbins();
2899  for (int i = 1; i <= nx; i++) {
2900  double ccc1 = hRate2->GetBinContent(i);
2901  if (ccc1 > 0.) {
2902  cout << "****************>>>>>>>>>>> ErrB_HF bad LS start at iLS = " << i << " with rate = " << ccc1
2903  << endl;
2904  LSofFirstErrB_HF = i;
2905  break;
2906  }
2907  }
2908  }
2909  delete h1;
2910  delete h0;
2911  if (hRate2 != hRate2orig) {
2912  delete hRate2orig;
2913  hRate2orig = hRate2;
2914  }
2915  }
2916  cHB->Update();
2917  cHB->Print(Form("HistErrB_HF_%d.png", depth));
2918  cHB->Clear();
2919  if (h2Cefz6)
2920  delete h2Cefz6;
2921  if (hRate2orig)
2922  delete hRate2orig;
2923  }
2924  } // ErrorsB in HF
2925 
2927 
2928  //=============================================================================== err A HB
2930  // For 2D and 1D plots with Amplitude. Produces ChkErrA_HBx.png
2931 
2932  for (int depth = 1; depth <= 2; depth++) {
2933  TH2F *h2Ceff = NULL;
2934  TH2F *h2Diffe = NULL;
2935  // TH1F* h1diffADCAmpl= NULL;
2936  TH2F *h3Ceff = NULL;
2937 
2938  cHE->Clear();
2939  cHE->Divide(3, 1);
2940 
2941  cHE->cd(1);
2942  // h_mapDepth1ADCAmpl_HB div h_mapDepth1_HB
2943  TString hname1 = Form("h_mapDepth%dADCAmpl_HB", depth);
2944  TString hname0 = Form("h_mapDepth%d_HB", depth);
2945  TH2F *twod1 = (TH2F *)hfile->Get(hname1);
2946  TH2F *twod0 = (TH2F *)hfile->Get(hname0);
2947  if (!twod1 || !twod0) {
2948  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2949  ptext->AddText("Missing histo");
2950  std::cout << "specHB test: failed to load " << hname1 << " and/or " << hname0 << "\n";
2951  if (!twod1)
2952  ptext->AddText(hname1);
2953  if (!twod0)
2954  ptext->AddText(hname0);
2955  ptext->Draw();
2956  continue;
2957  } else {
2958  // To IDENTIFY: see color different bins in eta-phi space
2959  h2Ceff = (TH2F *)twod1->Clone(Form("Ceff_HB%d", depth));
2960  h2Ceff->SetTitle(Form("HB Depth %d. (No cut) \b", depth));
2961  h2Ceff->Divide(twod1, twod0, 1, 1, "B");
2962 
2963  gPad->SetGridy();
2964  gPad->SetGridx();
2965  gPad->SetLogz();
2966  h2Ceff->SetMarkerStyle(20);
2967  h2Ceff->SetMarkerSize(0.4);
2968  //h2Ceff->GetZaxis()->SetLabelSize(0.08);
2969  h2Ceff->SetXTitle("#eta \b");
2970  h2Ceff->SetYTitle("#phi \b");
2971  h2Ceff->SetZTitle("h_mapDepth1ADCAmpl_HB \b");
2972  h2Ceff->SetMarkerColor(2);
2973  h2Ceff->SetLineColor(2);
2974  h2Ceff->Draw("COLZ");
2975  }
2976 
2977  cHE->cd(2);
2979  if (h2Ceff) {
2980  // TO IDENTIFY: see red bins in eta-phi space
2981  h2Diffe = (TH2F *)h2Ceff->Clone(Form("Diffe_Depth%d_HB", depth));
2982  h2Diffe->SetTitle(Form("HB Depth %d. Cut avg(ADCAmpl) > 25 \b", depth));
2983  int nx = h2Ceff->GetXaxis()->GetNbins();
2984  int ny = h2Ceff->GetYaxis()->GetNbins();
2985  for (int i = 1; i <= nx; i++) {
2986  for (int j = 1; j <= ny; j++) {
2987  double ccc1 = h2Ceff->GetBinContent(i, j);
2988  h2Diffe->SetBinContent(i, j, 0.);
2989  if (ccc1 > 25.)
2990  h2Diffe->SetBinContent(i, j, ccc1);
2991  }
2992  }
2993  gPad->SetGridy();
2994  gPad->SetGridx();
2995  gPad->SetLogz();
2996  h2Diffe->SetMarkerStyle(20);
2997  h2Diffe->SetMarkerSize(0.4);
2998  //h2Diffe->GetZaxis()->SetLabelSize(0.08);
2999  h2Diffe->SetXTitle("#eta \b");
3000  h2Diffe->SetYTitle("#phi \b");
3001  h2Diffe->SetZTitle("<ADCAmpl> bigger 25.- HB Depth1 \b");
3002  h2Diffe->SetMarkerColor(2);
3003  h2Diffe->SetLineColor(2);
3004  h2Diffe->Draw("COLZ");
3005  }
3006 
3007  cHE->cd(3);
3008  TString hname3 = Form("h_mapDepth%dADCAmpl225Copy_HB", depth);
3009  TH2F *twod3 = (TH2F *)hfile->Get(hname3);
3010  if (!twod3 || !twod0) {
3011  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
3012  ptext->AddText("Missing histo");
3013  std::cout << "specHB test: failed to load " << hname3 << " and/or " << hname0 << "\n";
3014  if (!twod3)
3015  ptext->AddText(hname3);
3016  if (!twod0)
3017  ptext->AddText(hname0);
3018  ptext->Draw();
3019  continue;
3020  } else {
3021  // To IDENTIFY: see color different bins in eta-phi space
3022  h3Ceff = (TH2F *)twod3->Clone(Form("CeffA_HB%d", depth));
3023  h3Ceff->SetTitle(Form("HB Depth %d. \b", depth));
3024  h3Ceff->Divide(twod3, twod0, 1, 1, "B");
3025  gPad->SetGridy();
3026  gPad->SetGridx();
3027  gPad->SetLogz();
3028  h3Ceff->SetMarkerStyle(20);
3029  h3Ceff->SetMarkerSize(0.4);
3030  // h3Ceff->GetZaxis()->SetLabelSize(0.08);
3031  h3Ceff->SetXTitle("#eta \b");
3032  h3Ceff->SetYTitle("#phi \b");
3033  h3Ceff->SetZTitle("rate for channels of HB \b");
3034  h3Ceff->SetMarkerColor(2);
3035  h3Ceff->SetLineColor(2);
3036  h3Ceff->Draw("COLZ");
3037  }
3038 
3039  cHE->Update();
3040  cHE->Print(Form("ChkErrA_HB%d.png", depth));
3041  cHE->Clear();
3042 
3043  if (h2Ceff)
3044  delete h2Ceff;
3045  if (h2Diffe)
3046  delete h2Diffe;
3047  // if (h1diffADCAmpl) delete h1diffADCAmpl;
3048  // if (twod0) delete twod0;// do not delete - sometimes causes trouble later
3049  if (twod1)
3050  delete twod1;
3051  if (twod3)
3052  delete twod3;
3053  if (h3Ceff)
3054  delete h3Ceff;
3055  } // depth
3056 
3057  //=============================================================================== err A HE
3059  // For 2D and 1D plots with Amplitude. Produces ChkErrA_HEx.png
3060 
3061  for (int depth = 1; depth <= 3; depth++) {
3062  TH2F *h2Ceff = NULL;
3063  TH2F *h2Diffe = NULL;
3064  // TH1F* h1diffADCAmpl= NULL;
3065  TH2F *h3Ceff = NULL;
3066 
3067  cHE->Clear();
3068  cHE->Divide(3, 1);
3069 
3070  cHE->cd(1);
3071  // h_mapDepth1ADCAmpl_HE div h_mapDepth1_HE
3072  TString hname1 = Form("h_mapDepth%dADCAmpl_HE", depth);
3073  TString hname0 = Form("h_mapDepth%d_HE", depth);
3074  TH2F *twod1 = (TH2F *)hfile->Get(hname1);
3075  TH2F *twod0 = (TH2F *)hfile->Get(hname0);
3076  if (!twod1 || !twod0) {
3077  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
3078  ptext->AddText("Missing histo");
3079  std::cout << "specHE test: failed to load " << hname1 << " and/or " << hname0 << "\n";
3080  if (!twod1)
3081  ptext->AddText(hname1);
3082  if (!twod0)
3083  ptext->AddText(hname0);
3084  ptext->Draw();
3085  continue;
3086  } else {
3087  // To IDENTIFY: see color different bins in eta-phi space
3088  h2Ceff = (TH2F *)twod1->Clone(Form("Ceff_HE%d", depth));
3089  h2Ceff->SetTitle(Form("HE Depth %d. (No cut) \b", depth));
3090  h2Ceff->Divide(twod1, twod0, 1, 1, "B");
3091 
3092  gPad->SetGridy();
3093  gPad->SetGridx();
3094  gPad->SetLogz();
3095  h2Ceff->SetMarkerStyle(20);
3096  h2Ceff->SetMarkerSize(0.4);
3097  //h2Ceff->GetZaxis()->SetLabelSize(0.08);
3098  h2Ceff->SetXTitle("#eta \b");
3099  h2Ceff->SetYTitle("#phi \b");
3100  h2Ceff->SetZTitle("h_mapDepth1ADCAmpl_HE \b");
3101  h2Ceff->SetMarkerColor(2);
3102  h2Ceff->SetLineColor(2);
3103  h2Ceff->Draw("COLZ");
3104  }
3105 
3106  cHE->cd(2);
3108  if (h2Ceff) {
3109  // TO IDENTIFY: see red bins in eta-phi space
3110  h2Diffe = (TH2F *)h2Ceff->Clone(Form("Diffe_Depth%d_HE", depth));
3111  h2Diffe->SetTitle(Form("HE Depth %d. Cut avg(ADCAmpl) > 1000 fC \b", depth));
3112  int nx = h2Ceff->GetXaxis()->GetNbins();
3113  int ny = h2Ceff->GetYaxis()->GetNbins();
3114  for (int i = 1; i <= nx; i++) {
3115  for (int j = 1; j <= ny; j++) {
3116  double ccc1 = h2Ceff->GetBinContent(i, j);
3117  h2Diffe->SetBinContent(i, j, 0.);
3118  if (ccc1 > 1000.)
3119  h2Diffe->SetBinContent(i, j, ccc1);
3120  }
3121  }
3122  gPad->SetGridy();
3123  gPad->SetGridx();
3124  gPad->SetLogz();
3125  h2Diffe->SetMarkerStyle(20);
3126  h2Diffe->SetMarkerSize(0.4);
3127  //h2Diffe->GetZaxis()->SetLabelSize(0.08);
3128  h2Diffe->SetXTitle("#eta \b");
3129  h2Diffe->SetYTitle("#phi \b");
3130  h2Diffe->SetZTitle("<ADCAmpl> bigger 1000.fC - HE Depth1 \b");
3131  h2Diffe->SetMarkerColor(2);
3132  h2Diffe->SetLineColor(2);
3133  h2Diffe->Draw("COLZ");
3134  }
3135 
3136  cHE->cd(3);
3137  TString hname3 = Form("h_mapDepth%dADCAmpl225Copy_HE", depth);
3138  TH2F *twod3 = (TH2F *)hfile->Get(hname3);
3139  if (!twod3 || !twod0) {
3140  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
3141  ptext->AddText("Missing histo");
3142  std::cout << "specHE test: failed to load " << hname3 << " and/or " << hname0 << "\n";
3143  if (!twod3)
3144  ptext->AddText(hname3);
3145  if (!twod0)
3146  ptext->AddText(hname0);
3147  ptext->Draw();
3148  continue;
3149  } else {
3150  // To IDENTIFY: see color different bins in eta-phi space
3151  h3Ceff = (TH2F *)twod3->Clone(Form("CeffA_HE%d", depth));
3152  h3Ceff->SetTitle(Form("HE Depth %d. \b", depth));
3153  h3Ceff->Divide(twod3, twod0, 1, 1, "B");
3154  gPad->SetGridy();
3155  gPad->SetGridx();
3156  gPad->SetLogz();
3157  h3Ceff->SetMarkerStyle(20);
3158  h3Ceff->SetMarkerSize(0.4);
3159  // h3Ceff->GetZaxis()->SetLabelSize(0.08);
3160  h3Ceff->SetXTitle("#eta \b");
3161  h3Ceff->SetYTitle("#phi \b");
3162  h3Ceff->SetZTitle("rate for channels of HE \b");
3163  h3Ceff->SetMarkerColor(2);
3164  h3Ceff->SetLineColor(2);
3165  h3Ceff->Draw("COLZ");
3166  }
3167 
3168  cHE->Update();
3169  cHE->Print(Form("ChkErrA_HE%d.png", depth));
3170  cHE->Clear();
3171 
3172  if (h2Ceff)
3173  delete h2Ceff;
3174  if (h2Diffe)
3175  delete h2Diffe;
3176  // if (h1diffADCAmpl) delete h1diffADCAmpl;
3177  // if (twod0) delete twod0;// do not delete - sometimes causes trouble later
3178  if (twod1)
3179  delete twod1;
3180  if (twod3)
3181  delete twod3;
3182  if (h3Ceff)
3183  delete h3Ceff;
3184  } // depth
3185 
3186  //=============================================================================== err A HO
3188  // For 2D and 1D plots with Amplitude. Produces ChkErrA_HOx.png
3189 
3190  for (int depth = 4; depth <= 4; depth++) {
3191  TH2F *h2Ceff = NULL;
3192  TH2F *h2Diffe = NULL;
3193  // TH1F* h1diffADCAmpl= NULL;
3194  TH2F *h3Ceff = NULL;
3195 
3196  cHE->Clear();
3197  cHE->Divide(3, 1);
3198 
3199  cHE->cd(1);
3200  // h_mapDepth1ADCAmpl_HO div h_mapDepth1_HO
3201  TString hname1 = Form("h_mapDepth%dADCAmpl_HO", depth);
3202  TString hname0 = Form("h_mapDepth%d_HO", depth);
3203  TH2F *twod1 = (TH2F *)hfile->Get(hname1);
3204  TH2F *twod0 = (TH2F *)hfile->Get(hname0);
3205  if (!twod1 || !twod0) {
3206  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
3207  ptext->AddText("Missing histo");
3208  std::cout << "specHO test: failed to load " << hname1 << " and/or " << hname0 << "\n";
3209  if (!twod1)
3210  ptext->AddText(hname1);
3211  if (!twod0)
3212  ptext->AddText(hname0);
3213  ptext->Draw();
3214  continue;
3215  } else {
3216  // To IDENTIFY: see color different bins in eta-phi space
3217  h2Ceff = (TH2F *)twod1->Clone(Form("Ceff_HO%d", depth));
3218  h2Ceff->SetTitle(Form("HO Depth %d. (No cut) \b", depth));
3219  h2Ceff->Divide(twod1, twod0, 1, 1, "B");
3220 
3221  gPad->SetGridy();
3222  gPad->SetGridx();
3223  gPad->SetLogz();
3224  h2Ceff->SetMarkerStyle(20);
3225  h2Ceff->SetMarkerSize(0.4);
3226  //h2Ceff->GetZaxis()->SetLabelSize(0.08);
3227  h2Ceff->SetXTitle("#eta \b");
3228  h2Ceff->SetYTitle("#phi \b");
3229  h2Ceff->SetZTitle("h_mapDepth1ADCAmpl_HO \b");
3230  h2Ceff->SetMarkerColor(2);
3231  h2Ceff->SetLineColor(2);
3232  h2Ceff->Draw("COLZ");
3233  }
3234 
3235  cHE->cd(2);
3237  if (h2Ceff) {
3238  // TO IDENTIFY: see red bins in eta-phi space (applied cut on Aij: <20 || >3000
3239  h2Diffe = (TH2F *)h2Ceff->Clone(Form("Diffe_Depth%d_HO", depth));
3240  h2Diffe->SetTitle(Form("HO Depth %d. Cut avg(ADCAmpl) > 80 \b", depth));
3241  int nx = h2Ceff->GetXaxis()->GetNbins();
3242  int ny = h2Ceff->GetYaxis()->GetNbins();
3243  for (int i = 1; i <= nx; i++) {
3244  for (int j = 1; j <= ny; j++) {
3245  double ccc1 = h2Ceff->GetBinContent(i, j);
3246  h2Diffe->SetBinContent(i, j, 0.);
3247  if (ccc1 > 20.)
3248  h2Diffe->SetBinContent(i, j, ccc1);
3249  }
3250  }
3251  gPad->SetGridy();
3252  gPad->SetGridx();
3253  gPad->SetLogz();
3254  h2Diffe->SetMarkerStyle(20);
3255  h2Diffe->SetMarkerSize(0.4);
3256  //h2Diffe->GetZaxis()->SetLabelSize(0.08);
3257  h2Diffe->SetXTitle("#eta \b");
3258  h2Diffe->SetYTitle("#phi \b");
3259  h2Diffe->SetZTitle("<ADCAmpl> bigger 80.- HO Depth1 \b");
3260  h2Diffe->SetMarkerColor(2);
3261  h2Diffe->SetLineColor(2);
3262  h2Diffe->Draw("COLZ");
3263  }
3264 
3265  cHE->cd(3);
3266  TString hname3 = Form("h_mapDepth%dADCAmpl225Copy_HO", depth);
3267  TH2F *twod3 = (TH2F *)hfile->Get(hname3);
3268  if (!twod3 || !twod0) {
3269  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
3270  ptext->AddText("Missing histo");
3271  std::cout << "specHO test: failed to load " << hname3 << " and/or " << hname0 << "\n";
3272  if (!twod3)
3273  ptext->AddText(hname3);
3274  if (!twod0)
3275  ptext->AddText(hname0);
3276  ptext->Draw();
3277  continue;
3278  } else {
3279  // To IDENTIFY: see color different bins in eta-phi space
3280  h3Ceff = (TH2F *)twod3->Clone(Form("CeffA_HO%d", depth));
3281  h3Ceff->SetTitle(Form("HO Depth %d. \b", depth));
3282  h3Ceff->Divide(twod3, twod0, 1, 1, "B");
3283  gPad->SetGridy();
3284  gPad->SetGridx();
3285  gPad->SetLogz();
3286  h3Ceff->SetMarkerStyle(20);
3287  h3Ceff->SetMarkerSize(0.4);
3288  // h3Ceff->GetZaxis()->SetLabelSize(0.08);
3289  h3Ceff->SetXTitle("#eta \b");
3290  h3Ceff->SetYTitle("#phi \b");
3291  h3Ceff->SetZTitle("rate for channels of HO \b");
3292  h3Ceff->SetMarkerColor(2);
3293  h3Ceff->SetLineColor(2);
3294  h3Ceff->Draw("COLZ");
3295  }
3296 
3297  cHE->Update();
3298  cHE->Print(Form("ChkErrA_HO%d.png", depth));
3299  cHE->Clear();
3300 
3301  if (h2Ceff)
3302  delete h2Ceff;
3303  if (h2Diffe)
3304  delete h2Diffe;
3305  // if (h1diffADCAmpl) delete h1diffADCAmpl;
3306  // if (twod0) delete twod0;// do not delete - sometimes causes trouble later
3307  if (twod1)
3308  delete twod1;
3309  if (twod3)
3310  delete twod3;
3311  if (h3Ceff)
3312  delete h3Ceff;
3313  } // depth
3314 
3315  //=============================================================================== err A HF
3317  // For 2D and 1D plots with Amplitude. Produces ChkErrA_HFx.png
3318 
3319  for (int depth = 1; depth <= 2; depth++) {
3320  TH2F *h2Ceff = NULL;
3321  TH2F *h2Diffe = NULL;
3322  // TH1F* h1diffADCAmpl= NULL;
3323  TH2F *h3Ceff = NULL;
3324 
3325  cHE->Clear();
3326  cHE->Divide(3, 1);
3327 
3328  cHE->cd(1);
3329  // h_mapDepth1ADCAmpl_HF div h_mapDepth1_HF
3330  TString hname1 = Form("h_mapDepth%dADCAmpl_HF", depth);
3331  TString hname0 = Form("h_mapDepth%d_HF", depth);
3332  TH2F *twod1 = (TH2F *)hfile->Get(hname1);
3333  TH2F *twod0 = (TH2F *)hfile->Get(hname0);
3334  if (!twod1 || !twod0) {
3335  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
3336  ptext->AddText("Missing histo");
3337  std::cout << "specHF test: failed to load " << hname1 << " and/or " << hname0 << "\n";
3338  if (!twod1)
3339  ptext->AddText(hname1);
3340  if (!twod0)
3341  ptext->AddText(hname0);
3342  ptext->Draw();
3343  continue;
3344  } else {
3345  // To IDENTIFY: see color different bins in eta-phi space
3346  h2Ceff = (TH2F *)twod1->Clone(Form("Ceff_HF%d", depth));
3347  h2Ceff->SetTitle(Form("HF Depth %d. (No cut) \b", depth));
3348  h2Ceff->Divide(twod1, twod0, 1, 1, "B");
3349 
3350  gPad->SetGridy();
3351  gPad->SetGridx();
3352  gPad->SetLogz();
3353  h2Ceff->SetMarkerStyle(20);
3354  h2Ceff->SetMarkerSize(0.4);
3355  //h2Ceff->GetZaxis()->SetLabelSize(0.08);
3356  h2Ceff->SetXTitle("#eta \b");
3357  h2Ceff->SetYTitle("#phi \b");
3358  h2Ceff->SetZTitle("h_mapDepth1ADCAmpl_HF \b");
3359  h2Ceff->SetMarkerColor(2);
3360  h2Ceff->SetLineColor(2);
3361  h2Ceff->Draw("COLZ");
3362  }
3363 
3364  cHE->cd(2);
3366  if (h2Ceff) {
3367  // TO IDENTIFY: see red bins in eta-phi space (applied cut on Aij: <20 || >3000
3368  h2Diffe = (TH2F *)h2Ceff->Clone(Form("Diffe_Depth%d_HF", depth));
3369  h2Diffe->SetTitle(Form("HF Depth %d. Cut avg(ADCAmpl) > 20 \b", depth));
3370  int nx = h2Ceff->GetXaxis()->GetNbins();
3371  int ny = h2Ceff->GetYaxis()->GetNbins();
3372  for (int i = 1; i <= nx; i++) {
3373  for (int j = 1; j <= ny; j++) {
3374  double ccc1 = h2Ceff->GetBinContent(i, j);
3375  h2Diffe->SetBinContent(i, j, 0.);
3376  if (ccc1 > 20.)
3377  h2Diffe->SetBinContent(i, j, ccc1);
3378  }
3379  }
3380  gPad->SetGridy();
3381  gPad->SetGridx();
3382  gPad->SetLogz();
3383  h2Diffe->SetMarkerStyle(20);
3384  h2Diffe->SetMarkerSize(0.4);
3385  //h2Diffe->GetZaxis()->SetLabelSize(0.08);
3386  h2Diffe->SetXTitle("#eta \b");
3387  h2Diffe->SetYTitle("#phi \b");
3388  h2Diffe->SetZTitle("<ADCAmpl> bigger 20.- HF Depth1 \b");
3389  h2Diffe->SetMarkerColor(2);
3390  h2Diffe->SetLineColor(2);
3391  h2Diffe->Draw("COLZ");
3392  }
3393 
3394  cHE->cd(3);
3395  /*
3396  if (h2Ceff) {
3397  h1diffADCAmpl = new TH1F(Form("diffADCAmpl_Depth%d_HF",depth),"",
3398  100, -20.,200.);
3399  h1diffADCAmpl->SetTitle(Form("HF Depth %d \b",depth));
3400  int nx = h2Ceff->GetXaxis()->GetNbins();
3401  int ny = h2Ceff->GetYaxis()->GetNbins();
3402  for (int i=1;i<=nx;i++) {
3403  for (int j=1;j<=ny;j++) {
3404  if(h2Ceff->GetBinContent(i,j) !=0 ) {
3405  double ccc1 = h2Ceff->GetBinContent(i,j) ;
3406  h1diffADCAmpl->Fill(ccc1);
3407  }
3408  }
3409  }
3410  gPad->SetLogy();
3411  h1diffADCAmpl->SetMarkerStyle(20);
3412  h1diffADCAmpl->SetMarkerSize(0.4);
3413  h1diffADCAmpl->GetYaxis()->SetLabelSize(0.04);
3414  h1diffADCAmpl->SetXTitle("<ADCAmpl> in each cell \b");
3415  h1diffADCAmpl->SetMarkerColor(2);
3416  h1diffADCAmpl->SetLineColor(2);
3417  h1diffADCAmpl->Draw("");
3418  }
3419  */
3420  TString hname3 = Form("h_mapDepth%dADCAmpl225Copy_HF", depth);
3421  TH2F *twod3 = (TH2F *)hfile->Get(hname3);
3422  if (!twod3 || !twod0) {
3423  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
3424  ptext->AddText("Missing histo");
3425  std::cout << "specHF test: failed to load " << hname3 << " and/or " << hname0 << "\n";
3426  if (!twod3)
3427  ptext->AddText(hname3);
3428  if (!twod0)
3429  ptext->AddText(hname0);
3430  ptext->Draw();
3431  continue;
3432  } else {
3433  // To IDENTIFY: see color different bins in eta-phi space
3434  h3Ceff = (TH2F *)twod3->Clone(Form("CeffA_HF%d", depth));
3435  h3Ceff->SetTitle(Form("HF Depth %d. \b", depth));
3436  h3Ceff->Divide(twod3, twod0, 1, 1, "B");
3437  gPad->SetGridy();
3438  gPad->SetGridx();
3439  gPad->SetLogz();
3440  h3Ceff->SetMarkerStyle(20);
3441  h3Ceff->SetMarkerSize(0.4);
3442  // h3Ceff->GetZaxis()->SetLabelSize(0.08);
3443  h3Ceff->SetXTitle("#eta \b");
3444  h3Ceff->SetYTitle("#phi \b");
3445  h3Ceff->SetZTitle("rate for channels of HF \b");
3446  h3Ceff->SetMarkerColor(2);
3447  h3Ceff->SetLineColor(2);
3448  h3Ceff->Draw("COLZ");
3449  }
3450 
3451  cHE->Update();
3452  cHE->Print(Form("ChkErrA_HF%d.png", depth));
3453  cHE->Clear();
3454 
3455  if (h2Ceff)
3456  delete h2Ceff;
3457  if (h2Diffe)
3458  delete h2Diffe;
3459  // if (h1diffADCAmpl) delete h1diffADCAmpl;
3460  // if (twod0) delete twod0;// do not delete - sometimes causes trouble later
3461  if (twod1)
3462  delete twod1;
3463  if (twod3)
3464  delete twod3;
3465  if (h3Ceff)
3466  delete h3Ceff;
3467  } // depth
3468 
3469  std::cout << "************>>> average Amplitudes done" << std::endl;
3470 
3471  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
3472  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
3473  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
3474  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
3475  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
3476 
3481 
3482  cout << " RBX analysis START for **************************" << endl;
3483  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
3484  // int njeta = 22; int njphi = 18; int lsmax=2600;
3485  int njeta = 22;
3486  int njphi = 18;
3487  int lsmax = 2600;
3488  cout << ">>>>>>>>>>>>>>>>>>>>>>>> int njeta = 22; int njphi = 18; int lsmax=2600; "
3489  << endl;
3490 
3491  double alexall[njeta][njphi][lsmax];
3492 
3493  // for phi tables(!):
3494  double alexhb[njphi][lsmax];
3495  double alexhe[njphi][lsmax];
3496  double alexho[njphi][lsmax];
3497  double alexhf[njphi][lsmax];
3498 
3499  // for eta tables(!):
3500  double blexhb[njeta][lsmax];
3501  double blexhe[njeta][lsmax];
3502  double blexho[njeta][lsmax];
3503  double blexhf[njeta][lsmax];
3504 
3505  cout << ">>>>>>>>>>>>>>>>>>>>>>>> alexall [njeta][njphi][lsmax]; " << endl;
3506  int maxbinsRBX = MaxLum;
3507  int nx = maxbinsRBX; // # LS
3508  cout << ">>>>>>>>>>>>>>>>>>>>>>>> maxbinsRBX = MaxLum; " << endl;
3509  if (MaxLum > lsmax)
3510  cout << "*********************************** ERROR ERROR ERROR ERROR: MaxLum > 2600 " << endl;
3511  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
3512 
3513  for (int i = 0; i < nx; i++) {
3514  for (int jphi = 0; jphi < njphi; jphi++) {
3515  alexhb[jphi][i] = 0.;
3516  alexhe[jphi][i] = 0.;
3517  alexho[jphi][i] = 0.;
3518  alexhf[jphi][i] = 0.;
3519 
3520  for (int jeta = 0; jeta < njeta; jeta++) {
3521  if (jphi == 0) {
3522  blexhb[jeta][i] = 0.;
3523  blexhe[jeta][i] = 0.;
3524  blexho[jeta][i] = 0.;
3525  blexhf[jeta][i] = 0.;
3526  }
3527 
3528  alexall[jeta][jphi][i] = 0.;
3529  }
3530  }
3531  }
3532 
3534  /*
3535  // j = ietaphi = 1- 396
3536  int ietaphimax = 396;
3537  int ny = ietaphimax + 1 ;
3538  for (int j=1;j<ny;j++) {
3539  int jeta = (j-1)/znphi;
3540  int jphi = (j-1)-znphi*jeta+1;// jphi=1-18
3541  jeta += 1;// jeta = 1-22 }
3542 // Outout is jeta = 1-22 jphi=1-18
3543 HB: j = 7,8,9,10 11,12,13,14
3544 HE: j = 3,4,5, 6, 7 14,15,16,17,18
3545 HO: j = 7,8,9,10 11,12,13,14
3546 HF: j = 0,1,2, 3 18,19,20,21
3547 */
3548 
3550  //======================================================================
3551  //======================================================================
3552  //======================================================================
3553  cout << " RBX general for HB **************************" << endl;
3554  TH2F *Ghb1KKK = (TH2F *)hfile->Get("h_2DsumADCAmplEtaPhiLs0");
3555  TH2F *Ghb1LLL = (TH2F *)hfile->Get("h_2DsumADCAmplEtaPhiLs00");
3556  TH2F *Ghb1 = (TH2F *)Ghb1LLL->Clone("Ghb1");
3557  Ghb1->Divide(Ghb1KKK, Ghb1LLL, 1, 1, "B"); // average A
3558  // Ghb1->Sumw2();
3559  // int nx = Ghb1->GetXaxis()->GetNbins(); // # LS
3560  int ny = Ghb1->GetYaxis()->GetNbins(); // # jetaphi indexes = 396 = 18*22
3561  // cout<<"***************************************** HB 54 ny= "<< ny <<endl;
3562  for (int j = 1; j <= ny; j++) {
3563  int jeta = (j - 1) / njphi; // jeta = 0-21
3564  if (jeta > 6 && jeta < 15) {
3565  int jphi = (j - 1) - njphi * jeta; // jphi=0-17
3566  // cout<<"HB 54 jeta= "<< jeta <<" jphi = "<<jphi <<endl;
3567  // over LS:
3568  for (int i = 1; i <= nx; i++) {
3569  double ccc1 = Ghb1->GetBinContent(i, j);
3570  alexall[jeta][jphi][i - 1] = ccc1;
3571  // if( i == 1 ) cout<<"HB 54 for LS=1 ccc1= "<< ccc1 <<endl;
3572  // if( ccc1 <= 0 ) cout<<"HB 54 ccc1= "<< ccc1 <<" iLS= "<< i <<" eta= "<< jeta <<" phi= "<< jphi <<endl;
3573  // cout<<"HB 54 ccc1= "<< ccc1 <<" j= "<< j <<" iLS= "<< i <<" eta= "<< jeta <<" phi= "<< jphi <<endl;
3574  } //i
3575  } //if
3576  } //j
3577  // clean-up
3578  if (Ghb1KKK)
3579  delete Ghb1KKK;
3580  if (Ghb1LLL)
3581  delete Ghb1LLL;
3582  // if (Ghb1) delete Ghb1;
3583 
3584  //====================================================================== alexhb[k][i]
3585  for (int jphi = 0; jphi < njphi; jphi++) {
3586  for (int i = 0; i < nx; i++) {
3587  double sumccc1 = 0.;
3588  int isum = 0;
3589  for (int jeta = 0; jeta < njeta; jeta++) {
3590  double ccc1 = alexall[jeta][jphi][i];
3591  if (ccc1 > 0.) {
3592  sumccc1 += ccc1;
3593  isum++;
3594  }
3595  } // for jeta
3596  if (isum > 0.)
3597  sumccc1 /= isum;
3598  alexhb[jphi][i] = sumccc1;
3599  }
3600  } //for for
3601 
3602  //====================================================================== blexhb[k][i]
3603  for (int keta = 0; keta < njeta; keta++) {
3604  for (int i = 0; i < nx; i++) {
3605  double sumccc1 = 0.;
3606  int isum = 0;
3607  for (int kphi = 0; kphi < njphi; kphi++) {
3608  double ccc1 = alexall[keta][kphi][i];
3609  if (ccc1 > 0.) {
3610  sumccc1 += ccc1;
3611  isum++;
3612  }
3613  } // for kphi
3614  if (isum > 0.)
3615  sumccc1 /= isum;
3616  blexhb[keta][i] = sumccc1;
3617  }
3618  } //for for
3619 
3621  //========================================================================================== 11 HB:: 2D jeta = 0 - 21 jphi =0 - 17
3622  //======================================================================
3623  //======================================================================
3624  //======================================================================
3625  //======================================================================
3626  cout << " RBX HB 2D plot *****" << endl;
3627  cRBX1->Clear();
3629  cRBX1->Divide(1, 1);
3630  cRBX1->cd(1);
3631  // int ietaphi = 0; ietaphi = ((k2+1)-1)*nphi + (k3+1) ; k2=0-neta-1; k3=0-nphi-1; neta=18; nphi=22;
3632  // TH2F* Ghb42D = new TH2F("Ghb42D","", 22, -11., 11., 18, 0., 18. );
3633  // TH2F* Ghb42D0 = new TH2F("Ghb42D0","", 22, -11., 11., 18, 0., 18. );
3634  TH2F *Ghb42D = new TH2F("Ghb42D", "", 23, -11.5, 11.5, 18, 0., 18.);
3635  TH2F *Ghb42D0 = new TH2F("Ghb42D0", "", 23, -11.5, 11.5, 18, 0., 18.);
3636  TH2F *Ghb42DF = (TH2F *)Ghb42D0->Clone("Ghb42DF");
3637  for (int jphi = 0; jphi < njphi; jphi++) {
3638  for (int jeta = 0; jeta < njeta; jeta++) {
3639  for (int i = 0; i < nx; i++) {
3640  double ccc1 = alexall[jeta][jphi][i];
3641  int neweta = jeta - 11 - 0.5;
3642  if (jeta >= 11)
3643  neweta = jeta - 11 + 1.5;
3644  if (ccc1 > 0.) {
3645  Ghb42D->Fill(neweta, jphi, ccc1);
3646  Ghb42D0->Fill(neweta, jphi, 1.);
3647  }
3648  // if(ccc1>0.) {Ghb42D ->Fill(jeta-11,jphi,ccc1); Ghb42D0 ->Fill(jeta-11,jphi,1.); }
3649  }
3650  }
3651  }
3652  Ghb42DF->Divide(Ghb42D, Ghb42D0, 1, 1, "B"); // average A
3653  // Ghb1->Sumw2();
3654  gPad->SetGridy();
3655  gPad->SetGridx(); // gPad->SetLogz();
3656  Ghb42DF->SetMarkerStyle(20);
3657  Ghb42DF->SetMarkerSize(0.4);
3658  Ghb42DF->GetZaxis()->SetLabelSize(0.04);
3659  Ghb42DF->SetXTitle("<A>_RBX #eta \b");
3660  Ghb42DF->SetYTitle(" #phi \b");
3661  Ghb42DF->SetZTitle("<A>_RBX - All \b");
3662  Ghb42DF->SetMarkerColor(2);
3663  Ghb42DF->SetLineColor(2); // Ghb42DF->SetMaximum(1.000); // Ghb42DF->SetMinimum(1.0);
3664  Ghb42DF->Draw("COLZ");
3665 
3667  cRBX1->Update();
3668  cRBX1->Print("RBX-HB-2Dplot.png");
3669  cRBX1->Clear();
3670  // clean-up
3671  if (Ghb42D)
3672  delete Ghb42D;
3673  if (Ghb42D0)
3674  delete Ghb42D0;
3675  if (Ghb42DF)
3676  delete Ghb42DF;
3677 
3678  //========================================================================================== 61 HB:: 1D j = 7,8,9,10 ; 11,12,13,14 jphi =0 - 17
3679  //======================================================================
3680  //======================================================================
3681  //======================================================================
3682  //======================================================================
3683  cout << " RBX HB 1D plot *****" << endl;
3684  cRBX1->Clear();
3686  cRBX1->Divide(1, 1);
3687  cRBX1->cd(1);
3688  TH1F *GphiHB1D = new TH1F("GphiHB1D", "", 18, 0., 18.);
3689  TH1F *GphiHB1D0 = new TH1F("GphiHB1D0", "", 18, 0., 18.);
3690  TH1F *GphiHB1DF = (TH1F *)GphiHB1D0->Clone("GphiHB1DF");
3691  for (int jphi = 0; jphi < 18; jphi++) {
3692  for (int jeta = 0; jeta < 22; jeta++) {
3693  for (int i = 0; i < nx; i++) {
3694  double ccc1 = alexall[jeta][jphi][i];
3695  if (ccc1 > 0.) {
3696  GphiHB1D->Fill(jphi, ccc1);
3697  GphiHB1D0->Fill(jphi, 1.);
3698  }
3699  }
3700  }
3701  }
3702  // GphiHB1D->Sumw2();GphiHB1D0->Sumw2();
3703  GphiHB1DF->Divide(GphiHB1D, GphiHB1D0, 1, 1, "B"); // average A
3704  // GphiHB1DF->Sumw2();
3705  for (int jphi = 1; jphi < 19; jphi++) {
3706  GphiHB1DF->SetBinError(jphi, 0.01);
3707  }
3708  gPad->SetGridy();
3709  gPad->SetGridx(); // gPad->SetLogz();
3710  GphiHB1DF->SetMarkerStyle(20);
3711  GphiHB1DF->SetMarkerSize(1.4);
3712  GphiHB1DF->GetZaxis()->SetLabelSize(0.08);
3713  GphiHB1DF->SetXTitle("PHI of RBX\b");
3714  GphiHB1DF->SetYTitle(" <Amplitude> \b");
3715  GphiHB1DF->SetZTitle("<A>_PHI - All \b");
3716  GphiHB1DF->SetMarkerColor(4);
3717  GphiHB1DF->SetLineColor(4);
3718  GphiHB1DF->SetMinimum(0.8); // GphiHB1DF->SetMaximum(1.000);
3719  GphiHB1DF->Draw("Error");
3721  cRBX1->Update();
3722  cRBX1->Print("RBX-HB-1Dplot.png");
3723  cRBX1->Clear();
3724  // clean-up
3725  if (GphiHB1D)
3726  delete GphiHB1D;
3727  if (GphiHB1D0)
3728  delete GphiHB1D0;
3729  if (GphiHB1DF)
3730  delete GphiHB1DF;
3731 
3732  //========================================================================================== 62 HB:: 1D j = 7,8,9,10 ; 11,12,13,14 jphi =0 - 17
3733  //======================================================================
3734  //======================================================================
3735  //======================================================================
3736  //======================================================================
3737  cout << " RBX HB 11D plot *eta*" << endl;
3738  cRBX1->Clear();
3740  cRBX1->Divide(1, 1);
3741  cRBX1->cd(1);
3742  TH1F *GetaHB11D = new TH1F("GetaHB11D", "", 23, -11.5, 11.5);
3743  TH1F *GetaHB11D0 = new TH1F("GetaHB11D0", "", 23, -11.5, 11.5);
3744  TH1F *GetaHB11DF = (TH1F *)GetaHB11D0->Clone("GetaHB11DF");
3745 
3746  for (int jeta = 0; jeta < 22; jeta++) {
3747  for (int jphi = 0; jphi < 18; jphi++) {
3748  for (int i = 0; i < nx; i++) {
3749  double ccc1 = alexall[jeta][jphi][i];
3750  int neweta = jeta - 11 - 0.5;
3751  if (jeta >= 11)
3752  neweta = jeta - 11 + 1.5;
3753  if (ccc1 > 0.) {
3754  GetaHB11D->Fill(neweta, ccc1);
3755  GetaHB11D0->Fill(neweta, 1.);
3756  // if( i == 0 ) cout<<"62 HB: ibin= "<< i <<" jphi= "<< jphi <<" jeta= "<< jeta <<" A= "<< ccc1 <<endl;
3757  }
3758  }
3759  }
3760  }
3761  // GetaHB11D->Sumw2();GetaHB11D0->Sumw2();
3762  GetaHB11DF->Divide(GetaHB11D, GetaHB11D0, 1, 1, "B"); // average A
3763  // GetaHB11DF->Sumw2();
3764  for (int jeta = 1; jeta < 24; jeta++) {
3765  GetaHB11DF->SetBinError(jeta, 0.01);
3766  }
3767  gPad->SetGridy();
3768  gPad->SetGridx(); // gPad->SetLogz();
3769  GetaHB11DF->SetMarkerStyle(20);
3770  GetaHB11DF->SetMarkerSize(1.4);
3771  GetaHB11DF->GetZaxis()->SetLabelSize(0.08);
3772  GetaHB11DF->SetXTitle("#eta \b");
3773  GetaHB11DF->SetYTitle(" <A> \b");
3774  GetaHB11DF->SetZTitle("<A>_ETA - All \b");
3775  GetaHB11DF->SetMarkerColor(4);
3776  GetaHB11DF->SetLineColor(4);
3777  GetaHB11DF->SetMinimum(0.8); // GetaHB11DF->SetMaximum(1.000);
3778  GetaHB11DF->Draw("Error");
3779 
3781  cRBX1->Update();
3782  cRBX1->Print("RBX-HB-11Dplot.png");
3783  cRBX1->Clear();
3784  // clean-up
3785  if (GetaHB11D)
3786  delete GetaHB11D;
3787  if (GetaHB11D0)
3788  delete GetaHB11D0;
3789  if (GetaHB11DF)
3790  delete GetaHB11DF;
3791 
3792  //========================================================================================== 22 HB:: Ratio plots jeta = 0 - 21 jphi =0 - 17
3793  //======================================================================
3794  //======================================================================22.11.2018
3795  //======================================================================
3796  //======================================================================
3797 
3798  gStyle->SetOptStat(1110000);
3799  cout << " RBX HB Ratio plots *****" << endl;
3800  cRBX31->Clear();
3802  // gain stabilitY:
3803  // Rij = Aij / A1j , where i-over LSs, j-channels
3804  //
3805  // nx = maxbinsRBX; // # LS
3806  //
3807  double ccc0HB = 0.;
3808  cRBX31->Divide(3, 1);
3809  //================
3810  cRBX31->cd(1);
3811  // TH1F* Ghb5 = new TH1F("Ghb5","", nx, 1., nx+1.);
3812  TH1F *Ghb51 = new TH1F("Ghb51", "", nx, 1., nx + 1.);
3813  TH1F *Ghb50 = new TH1F("Ghb50", "", nx, 1., nx + 1.);
3814  TH1F *Ghb5 = (TH1F *)Ghb50->Clone("Ghb5");
3815  // j - etaphi index:
3816  for (int j = 1; j <= ny; j++) {
3817  ccc0HB = Ghb1->GetBinContent(1, j);
3818  // 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;} }
3819  if (ccc0HB <= 0.)
3820  for (int i = 1; i <= nx; i++) {
3821  double ccc2 = Ghb1->GetBinContent(i, j);
3822  if (ccc2 > 0.) {
3823  ccc0HB = ccc2;
3824  break;
3825  }
3826  }
3827  if (ccc0HB > 0.) {
3828  // i - # LSs:
3829  for (int i = 1; i <= nx; i++) {
3830  double ccc1 = Ghb1->GetBinContent(i, j);
3831  if (ccc1 > 0.) {
3832  double Rij = ccc1 / ccc0HB;
3833  // Ghb5 ->Fill( float(i), Rij);
3834  Ghb51->Fill(float(i), Rij);
3835  Ghb50->Fill(float(i), 1.);
3836  }
3837  }
3838  }
3839  }
3840  Ghb5->Divide(Ghb51, Ghb50, 1, 1, "B"); // average A
3841  for (int i = 1; i <= nx; i++) {
3842  Ghb5->SetBinError(i, 0.0001);
3843  }
3844  Ghb5->SetMarkerStyle(20);
3845  Ghb5->SetMarkerSize(0.4);
3846  Ghb5->GetYaxis()->SetLabelSize(0.04);
3847  Ghb5->SetMarkerColor(2);
3848  Ghb5->SetLineColor(0);
3849  Ghb5->SetXTitle(" iLS \b");
3850  Ghb5->SetYTitle(" <R> \b");
3851  Ghb5->SetTitle("<Ri> vs iLS \b");
3852  Ghb5->SetMinimum(0.); //Ghb5->SetMaximum(2.5);
3853  // gPad->SetLogy();
3854  gPad->SetGridy();
3855  gPad->SetGridx();
3856  Ghb5->SetStats(0);
3857  Ghb5->GetYaxis()->SetLabelSize(0.025);
3858  Ghb5->Draw("Error");
3859  //================
3860  cRBX31->cd(2);
3861  TH2F *Ghb60 = new TH2F("Ghb60", "", 22, -11., 11., 18, 0., 18.);
3862  TH2F *Ghb61 = new TH2F("Ghb61", "", 22, -11., 11., 18, 0., 18.);
3863  TH2F *Ghb6 = new TH2F("Ghb6", "", 22, -11., 11., 18, 0., 18.);
3864 
3865  TH2F *G20hb60 = new TH2F("G20hb60", "", 22, -11., 11., 18, 0., 18.);
3866  TH2F *G20hb61 = new TH2F("G20hb61", "", 22, -11., 11., 18, 0., 18.);
3867  TH2F *G20hb6 = new TH2F("G20hb6", "", 22, -11., 11., 18, 0., 18.);
3868  TH2F *G30hb60 = new TH2F("G30hb60", "", 22, -11., 11., 18, 0., 18.);
3869  TH2F *G30hb61 = new TH2F("G30hb61", "", 22, -11., 11., 18, 0., 18.);
3870  TH2F *G30hb6 = new TH2F("G30hb6", "", 22, -11., 11., 18, 0., 18.);
3871  TH2F *G40hb60 = new TH2F("G40hb60", "", 22, -11., 11., 18, 0., 18.);
3872  TH2F *G40hb61 = new TH2F("G40hb61", "", 22, -11., 11., 18, 0., 18.);
3873  TH2F *G40hb6 = new TH2F("G40hb6", "", 22, -11., 11., 18, 0., 18.);
3874  // j - etaphi index; i - # LSs;
3875  //
3876  // define mean and RMS:
3877  double sumjHB = 0.;
3878  int njHB = 0;
3879  double meanjHB = 0.;
3880  for (int j = 1; j <= ny; j++) {
3881  ccc0HB = Ghb1->GetBinContent(1, j);
3882  if (ccc0HB <= 0.)
3883  for (int i = 1; i <= nx; i++) {
3884  double ccc2 = Ghb1->GetBinContent(i, j);
3885  if (ccc2 > 0.) {
3886  ccc0HB = ccc2;
3887  break;
3888  }
3889  }
3890  if (ccc0HB > 0.) {
3891  for (int i = 1; i <= nx; i++) {
3892  double ccc1 = Ghb1->GetBinContent(i, j) / ccc0HB;
3893  if (ccc1 > 0.) {
3894  sumjHB += ccc1;
3895  njHB++;
3896  }
3897  }
3898  meanjHB = sumjHB / njHB;
3899  }
3900  } // j
3901 
3902  double ssumjHB = 0.;
3903  njHB = 0;
3904  double sigmajHB = 0.;
3905  for (int j = 1; j <= ny; j++) {
3906  ccc0HB = Ghb1->GetBinContent(1, j);
3907  if (ccc0HB <= 0.)
3908  for (int i = 1; i <= nx; i++) {
3909  double ccc2 = Ghb1->GetBinContent(i, j);
3910  if (ccc2 > 0.) {
3911  ccc0HB = ccc2;
3912  break;
3913  }
3914  }
3915  if (ccc0HB > 0.) {
3916  for (int i = 1; i <= nx; i++) {
3917  double ccc1 = Ghb1->GetBinContent(i, j) / ccc0HB;
3918  if (ccc1 > 0.) {
3919  ssumjHB += (ccc1 - meanjHB) * (ccc1 - meanjHB);
3920  njHB++;
3921  }
3922  }
3923  sigmajHB = sqrt(ssumjHB / njHB);
3924  }
3925  } // j
3926 
3927  double dif3rmsHBMIN = meanjHB - 3 * sigmajHB;
3928  if (dif3rmsHBMIN < 0.)
3929  dif3rmsHBMIN = 0.;
3930  double dif3rmsHBMAX = meanjHB + 3 * sigmajHB;
3931  cout << "22HB-2 meanjHB= " << meanjHB << " sigmajHB= " << sigmajHB << " dif3rmsHBMIN= " << dif3rmsHBMIN
3932  << " dif3rmsHBMAX= " << dif3rmsHBMAX << endl;
3933 
3934  double MAXdif3rmsHBMIN = dif3rmsHBMIN;
3935  double MINdif3rmsHBMAX = dif3rmsHBMAX;
3936  if (MAXdif3rmsHBMIN < 0.95)
3937  MAXdif3rmsHBMIN = 0.95;
3938  if (MINdif3rmsHBMAX > 1.05)
3939  MINdif3rmsHBMAX = 1.05;
3940  cout << "22HB-2 MAXdif3rmsHBMIN= " << MAXdif3rmsHBMIN << " MINdif3rmsHBMAX= " << MINdif3rmsHBMAX << endl;
3941  //
3942  for (int j = 1; j <= ny; j++) {
3943  ccc0HB = Ghb1->GetBinContent(1, j);
3944  if (ccc0HB <= 0.)
3945  for (int i = 1; i <= nx; i++) {
3946  double ccc2 = Ghb1->GetBinContent(i, j);
3947  if (ccc2 > 0.) {
3948  ccc0HB = ccc2;
3949  break;
3950  }
3951  }
3952  if (ccc0HB > 0.) {
3953  int jeta = (j - 1) / 18; // jeta = 0-21
3954  int jphi = (j - 1) - 18 * jeta; // jphi=0-17
3955  // i - # LSs:
3956  for (int i = 1; i <= nx; i++) {
3957  double ccc1 = Ghb1->GetBinContent(i, j);
3958  if (ccc1 > 0.) {
3959  double Rij = ccc1 / ccc0HB;
3960  if (Rij < MAXdif3rmsHBMIN || Rij > MINdif3rmsHBMAX) {
3961  Ghb61->Fill(jeta - 11, jphi, Rij);
3962  Ghb60->Fill(jeta - 11, jphi, 1.);
3963  }
3964  if (Rij < 0.8 || Rij > 1.2) {
3965  G20hb61->Fill(jeta - 11, jphi, Rij);
3966  G20hb60->Fill(jeta - 11, jphi, 1.);
3967  }
3968  if (Rij < 0.7 || Rij > 1.3) {
3969  G30hb61->Fill(jeta - 11, jphi, Rij);
3970  G30hb60->Fill(jeta - 11, jphi, 1.);
3971  }
3972  if (Rij < 0.6 || Rij > 1.4) {
3973  G40hb61->Fill(jeta - 11, jphi, Rij);
3974  G40hb60->Fill(jeta - 11, jphi, 1.);
3975  }
3976  } //if(ccc1>0.
3977  } // i
3978  } //if(ccc0HB>0
3979  } // j
3980  Ghb6->Divide(Ghb61, Ghb60, 1, 1, "B"); // average R
3981  G20hb6->Divide(G20hb61, G20hb60, 1, 1, "B"); // average R
3982  G30hb6->Divide(G30hb61, G30hb60, 1, 1, "B"); // average R
3983  G40hb6->Divide(G40hb61, G40hb60, 1, 1, "B"); // average R
3984 
3985  Ghb6->GetZaxis()->SetLabelSize(0.025);
3986  Ghb6->SetXTitle(" #eta \b");
3987  Ghb6->SetYTitle(" #phi \b");
3988  Ghb6->SetTitle("<Rj> for |1-<R>| > 0.05 \b");
3989  Ghb6->SetStats(0);
3990  Ghb6->Draw("COLZ");
3991  //================
3992  cRBX31->cd(3);
3993  TH1F *Ghb7 = new TH1F("Ghb7", "", 120, 0.4, 1.6);
3994  // j - etaphi index:
3995  for (int j = 1; j <= ny; j++) {
3996  ccc0HB = Ghb1->GetBinContent(1, j);
3997  if (ccc0HB <= 0.)
3998  for (int i = 1; i <= nx; i++) {
3999  double ccc2 = Ghb1->GetBinContent(i, j);
4000  if (ccc2 > 0.) {
4001  ccc0HB = ccc2;
4002  break;
4003  }
4004  }
4005  if (ccc0HB > 0.) {
4006  // i - # LSs:
4007  for (int i = 1; i <= nx; i++) {
4008  double ccc1 = Ghb1->GetBinContent(i, j);
4009  if (ccc1 > 0.) {
4010  double Rij = ccc1 / ccc0HB;
4011  Ghb7->Fill(Rij);
4012  }
4013  }
4014  }
4015  }
4016  Ghb7->SetMarkerStyle(20);
4017  Ghb7->SetMarkerSize(0.4);
4018  Ghb7->GetYaxis()->SetLabelSize(0.04);
4019  Ghb7->SetMarkerColor(2);
4020  Ghb7->SetLineColor(0);
4021  Ghb7->SetYTitle(" N \b");
4022  Ghb7->SetXTitle(" Rij \b");
4023  Ghb7->SetTitle(" Rij \b");
4024  //Ghb7->SetMinimum(0.8);Ghb7->SetMaximum(500.);
4025  gPad->SetGridy();
4026  gPad->SetGridx(); // gPad->SetLogy();
4027  // Ghb7->SetStats(1110000);
4028  Ghb7->GetYaxis()->SetLabelSize(0.025);
4029  Ghb7->Draw("Error");
4030  Float_t ymaxHB = Ghb7->GetMaximum();
4031  cout << "22HB-3 ymaxHB= " << ymaxHB << " MAXdif3rmsHBMIN= " << MAXdif3rmsHBMIN
4032  << " MINdif3rmsHBMAX= " << MINdif3rmsHBMAX << endl;
4033  TLine *lineHB = new TLine(MAXdif3rmsHBMIN, 0., MAXdif3rmsHBMIN, ymaxHB);
4034  lineHB->SetLineColor(kBlue);
4035  lineHB->Draw();
4036  TLine *line1HB = new TLine(MINdif3rmsHBMAX, 0., MINdif3rmsHBMAX, ymaxHB);
4037  line1HB->SetLineColor(kBlue);
4038  line1HB->Draw();
4039  //================
4041  cRBX31->Update();
4042  cRBX31->Print("RBX-HB-3plots.png");
4043  cRBX31->Clear();
4044  // clean-up
4045  if (Ghb5)
4046  delete Ghb5;
4047  if (Ghb60)
4048  delete Ghb60;
4049  if (Ghb61)
4050  delete Ghb61;
4051  if (Ghb6)
4052  delete Ghb6;
4053  if (Ghb7)
4054  delete Ghb7;
4055 
4056  if (G20hb60)
4057  delete G20hb60;
4058  if (G20hb61)
4059  delete G20hb61;
4060  if (G30hb60)
4061  delete G30hb60;
4062  if (G30hb61)
4063  delete G30hb61;
4064  if (G40hb60)
4065  delete G40hb60;
4066  if (G40hb61)
4067  delete G40hb61;
4068 
4069  if (Ghb1)
4070  delete Ghb1;
4071  //========================================================================================== 22-1 HB:: Ratio plots jeta = 0 - 21 jphi =0 - 17
4072  //======================================================================
4073  //======================================================================28.11.2018
4074  //======================================================================
4075  //======================================================================
4076 
4077  gStyle->SetOptStat(1110000);
4078  cout << " RBX HB Ratio plotsmore *****" << endl;
4079  cRBX31->Clear();
4081  cRBX31->Divide(3, 1);
4082  //================
4083  cRBX31->cd(1);
4084  G20hb6->GetZaxis()->SetLabelSize(0.025);
4085  G20hb6->SetXTitle(" #eta \b");
4086  G20hb6->SetYTitle(" #phi \b");
4087  G20hb6->SetTitle("<Rj> for |1-<R>| > 0.20 \b");
4088  G20hb6->SetStats(0);
4089  G20hb6->Draw("COLZ");
4090  //================
4091  cRBX31->cd(2);
4092  G30hb6->GetZaxis()->SetLabelSize(0.025);
4093  G30hb6->SetXTitle(" #eta \b");
4094  G30hb6->SetYTitle(" #phi \b");
4095  G30hb6->SetTitle("<Rj> for |1-<R>| > 0.30 \b");
4096  G30hb6->SetStats(0);
4097  G30hb6->Draw("COLZ");
4098  //================
4099  cRBX31->cd(3);
4100  G40hb6->GetZaxis()->SetLabelSize(0.025);
4101  G40hb6->SetXTitle(" #eta \b");
4102  G40hb6->SetYTitle(" #phi \b");
4103  G40hb6->SetTitle("<Rj> for |1-<R>| > 0.40 \b");
4104  G40hb6->SetStats(0);
4105  G40hb6->Draw("COLZ");
4106  //================
4107 
4109  cRBX31->Update();
4110  cRBX31->Print("RBX-HB-3plotsmore.png");
4111  cRBX31->Clear();
4112 
4113  // clean-up
4114  if (G20hb6)
4115  delete G20hb6;
4116  if (G30hb6)
4117  delete G30hb6;
4118  if (G40hb6)
4119  delete G40hb6;
4120  gStyle->SetOptStat(0);
4121 
4123 
4124  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
4125  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
4126  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
4127  for (int jphi = 0; jphi < njphi; jphi++) {
4128  for (int jeta = 0; jeta < njeta; jeta++) {
4129  for (int i = 0; i < nx; i++) {
4130  alexall[jeta][jphi][i] = 0.;
4131  }
4132  }
4133  } // nulling
4134 
4136 
4138  //======================================================================
4139  //======================================================================
4140  //======================================================================
4141  cout << " RBX general for HE **************************" << endl;
4142  TH2F *Ghe1KKK = (TH2F *)hfile->Get("h_2DsumADCAmplEtaPhiLs1");
4143  TH2F *Ghe1LLL = (TH2F *)hfile->Get("h_2DsumADCAmplEtaPhiLs10");
4144  TH2F *Ghe1 = (TH2F *)Ghe1LLL->Clone("Ghe1");
4145  Ghe1->Divide(Ghe1KKK, Ghe1LLL, 1, 1, "B"); // average A
4146  // Ghe1->Sumw2();
4147  // int nx = Ghe1->GetXaxis()->GetNbins(); // # LS
4148  // nx = maxbinsRBX; // # LS
4149  ny = Ghe1->GetYaxis()->GetNbins(); // # jetaphi indexes
4150  for (int j = 1; j <= ny; j++) {
4151  int jeta = (j - 1) / njphi; // jeta = 0-21
4152  if ((jeta < 8 && jeta > 2) || (jeta < 19 && jeta > 13)) {
4153  int jphi = (j - 1) - njphi * jeta; // jphi=0-17
4154  // cout<<"HE 54 jeta= "<< jeta <<" jphi = "<<jphi <<endl;
4155  // over LS:
4156  for (int i = 1; i <= nx; i++) {
4157  double ccc1 = Ghe1->GetBinContent(i, j);
4158  alexall[jeta][jphi][i - 1] = ccc1;
4159  // if( i == 1 ) cout<<"HE 54 for LS=1 ccc1= "<< ccc1 <<endl;
4160  } //i
4161  } //if
4162  } //j
4163  // clean-up
4164  if (Ghe1KKK)
4165  delete Ghe1KKK;
4166  if (Ghe1LLL)
4167  delete Ghe1LLL;
4168  // if (Ghe1) delete Ghe1;
4169 
4170  //====================================================================== alexhe[k][i]
4171  for (int jphi = 0; jphi < njphi; jphi++) {
4172  for (int i = 0; i < nx; i++) {
4173  double sumccc1 = 0.;
4174  int isum = 0;
4175  for (int jeta = 0; jeta < njeta; jeta++) {
4176  double ccc1 = alexall[jeta][jphi][i];
4177  if (ccc1 > 0.) {
4178  sumccc1 += ccc1;
4179  isum++;
4180  }
4181  } // for jeta
4182  if (isum > 0.)
4183  sumccc1 /= isum;
4184  alexhe[jphi][i] = sumccc1;
4185  }
4186  } //for for
4187  //====================================================================== blexhe[k][i]
4188  for (int keta = 0; keta < njeta; keta++) {
4189  for (int i = 0; i < nx; i++) {
4190  double sumccc1 = 0.;
4191  int isum = 0;
4192  for (int kphi = 0; kphi < njphi; kphi++) {
4193  double ccc1 = alexall[keta][kphi][i];
4194  if (ccc1 > 0.) {
4195  sumccc1 += ccc1;
4196  isum++;
4197  }
4198  } // for kphi
4199  if (isum > 0.)
4200  sumccc1 /= isum;
4201  blexhe[keta][i] = sumccc1;
4202  }
4203  } //for for
4205  //========================================================================================== 21 HE:: 2D jeta = 0 - 21 jphi =0 - 17
4206  //======================================================================
4207  //======================================================================
4208  //======================================================================
4209  //======================================================================
4210  cout << " RBX HE 2D plot *****" << endl;
4211  cRBX1->Clear();
4213  cRBX1->Divide(1, 1);
4214  cRBX1->cd(1);
4215  // int ietaphi = 0; ietaphi = ((k2+1)-1)*nphi + (k3+1) ; k2=0-neta-1; k3=0-nphi-1; neta=18; nphi=22;
4216  TH2F *Ghe42D = new TH2F("Ghe42D", "", 23, -11.5, 11.5, 18, 0., 18.);
4217  TH2F *Ghe42D0 = new TH2F("Ghe42D0", "", 23, -11.5, 11.5, 18, 0., 18.);
4218  // TH2F* Ghe42D = new TH2F("Ghe42D","", 22, -11., 11., 18, 0., 18. );
4219  // TH2F* Ghe42D0 = new TH2F("Ghe42D0","", 22, -11., 11., 18, 0., 18. );
4220  TH2F *Ghe42DF = (TH2F *)Ghe42D0->Clone("Ghe42DF");
4221  for (int jphi = 0; jphi < njphi; jphi++) {
4222  for (int jeta = 0; jeta < njeta; jeta++) {
4223  for (int i = 0; i < nx; i++) {
4224  double ccc1 = alexall[jeta][jphi][i];
4225  int neweta = jeta - 11 - 0.5;
4226  if (jeta >= 11)
4227  neweta = jeta - 11 + 1.5;
4228  if (ccc1 > 0.) {
4229  Ghe42D->Fill(neweta, jphi, ccc1);
4230  Ghe42D0->Fill(neweta, jphi, 1.);
4231  }
4232  // if(ccc1>0.) {Ghe42D ->Fill(jeta-11,jphi,ccc1); Ghe42D0 ->Fill(jeta-11,jphi,1.); }
4233  }
4234  }
4235  }
4236  Ghe42DF->Divide(Ghe42D, Ghe42D0, 1, 1, "B"); // average A
4237  // Ghe1->Sumw2();
4238  gPad->SetGridy();
4239  gPad->SetGridx(); // gPad->SetLogz();
4240  Ghe42DF->SetMarkerStyle(20);
4241  Ghe42DF->SetMarkerSize(0.4);
4242  Ghe42DF->GetZaxis()->SetLabelSize(0.04);
4243  Ghe42DF->SetXTitle("<A>_RBX #eta \b");
4244  Ghe42DF->SetYTitle(" #phi \b");
4245  Ghe42DF->SetZTitle("<A>_RBX - All \b");
4246  Ghe42DF->SetMarkerColor(2);
4247  Ghe42DF->SetLineColor(2); // Ghe42DF->SetMaximum(1.000); // Ghe42DF->SetMinimum(1.0);
4248  Ghe42DF->Draw("COLZ");
4249 
4251  cRBX1->Update();
4252  cRBX1->Print("RBX-HE-2Dplot.png");
4253  cRBX1->Clear();
4254  // clean-up
4255  if (Ghe42D)
4256  delete Ghe42D;
4257  if (Ghe42D0)
4258  delete Ghe42D0;
4259  if (Ghe42DF)
4260  delete Ghe42DF;
4261 
4262  //========================================================================================== 61 HE:: 1D j = 3,4,5, 6, 7 14,15,16,17,18 jphi =0 - 17
4263  //======================================================================
4264  //======================================================================
4265  //======================================================================
4266  //======================================================================
4267  cout << " RBX HE 1D plot *****" << endl;
4268  cRBX1->Clear();
4270  cRBX1->Divide(1, 1);
4271  cRBX1->cd(1);
4272  TH1F *GphiHE1D = new TH1F("GphiHE1D", "", 18, 0., 18.);
4273  TH1F *GphiHE1D0 = new TH1F("GphiHE1D0", "", 18, 0., 18.);
4274  TH1F *GphiHE1DF = (TH1F *)GphiHE1D0->Clone("GphiHE1DF");
4275  for (int jphi = 0; jphi < 18; jphi++) {
4276  for (int jeta = 0; jeta < 22; jeta++) {
4277  for (int i = 0; i < nx; i++) {
4278  double ccc1 = alexall[jeta][jphi][i];
4279  if (ccc1 > 0.) {
4280  GphiHE1D->Fill(jphi, ccc1);
4281  GphiHE1D0->Fill(jphi, 1.);
4282  }
4283  }
4284  }
4285  }
4286  // GphiHE1D->Sumw2();GphiHE1D0->Sumw2();
4287  GphiHE1DF->Divide(GphiHE1D, GphiHE1D0, 1, 1, "B"); // average A
4288  // GphiHE1DF->Sumw2();
4289  for (int jphi = 1; jphi < 19; jphi++) {
4290  GphiHE1DF->SetBinError(jphi, 0.01);
4291  }
4292  gPad->SetGridy();
4293  gPad->SetGridx(); // gPad->SetLogz();
4294  GphiHE1DF->SetMarkerStyle(20);
4295  GphiHE1DF->SetMarkerSize(1.4);
4296  GphiHE1DF->GetZaxis()->SetLabelSize(0.08);
4297  GphiHE1DF->SetXTitle("PHI of RBX\b");
4298  GphiHE1DF->SetYTitle(" <Amplitude> \b");
4299  GphiHE1DF->SetZTitle("<A>_PHI - All \b");
4300  GphiHE1DF->SetMarkerColor(4);
4301  GphiHE1DF->SetLineColor(4);
4302  GphiHE1DF->SetMinimum(0.8); // GphiHE1DF->SetMaximum(1.000);
4303  GphiHE1DF->Draw("Error");
4305  cRBX1->Update();
4306  cRBX1->Print("RBX-HE-1Dplot.png");
4307  cRBX1->Clear();
4308  // clean-up
4309  if (GphiHE1D)
4310  delete GphiHE1D;
4311  if (GphiHE1D0)
4312  delete GphiHE1D0;
4313  if (GphiHE1DF)
4314  delete GphiHE1DF;
4315 
4316  //========================================================================================== 62 HE:: 1D j = 3,4,5, 6, 7 14,15,16,17,18 jphi =0 - 17
4317  //======================================================================
4318  //======================================================================
4319  //======================================================================
4320  //======================================================================
4321  cout << " RBX HE 11D plot *eta*" << endl;
4322  cRBX1->Clear();
4324  cRBX1->Divide(1, 1);
4325  cRBX1->cd(1);
4326  TH1F *GetaHE11D = new TH1F("GetaHE11D", "", 23, -11.5, 11.5);
4327  TH1F *GetaHE11D0 = new TH1F("GetaHE11D0", "", 23, -11.5, 11.5);
4328  TH1F *GetaHE11DF = (TH1F *)GetaHE11D0->Clone("GetaHE11DF");
4329 
4330  for (int jeta = 0; jeta < 22; jeta++) {
4331  for (int jphi = 0; jphi < 18; jphi++) {
4332  for (int i = 0; i < nx; i++) {
4333  double ccc1 = alexall[jeta][jphi][i];
4334  int neweta = jeta - 11 - 0.5;
4335  if (jeta >= 11)
4336  neweta = jeta - 11 + 1.5;
4337  if (ccc1 > 0.) {
4338  GetaHE11D->Fill(neweta, ccc1);
4339  GetaHE11D0->Fill(neweta, 1.);
4340  // if( i == 0 ) cout<<"62 HE: ibin= "<< i <<" jphi= "<< jphi <<" jeta= "<< jeta <<" A= "<< ccc1 <<endl;
4341  }
4342  }
4343  }
4344  }
4345  // GetaHE11D->Sumw2();GetaHE11D0->Sumw2();
4346  GetaHE11DF->Divide(GetaHE11D, GetaHE11D0, 1, 1, "B"); // average A
4347  // GetaHE11DF->Sumw2();
4348  for (int jeta = 1; jeta < 24; jeta++) {
4349  GetaHE11DF->SetBinError(jeta, 0.01);
4350  }
4351  gPad->SetGridy();
4352  gPad->SetGridx(); // gPad->SetLogz();
4353  GetaHE11DF->SetMarkerStyle(20);
4354  GetaHE11DF->SetMarkerSize(1.4);
4355  GetaHE11DF->GetZaxis()->SetLabelSize(0.08);
4356  GetaHE11DF->SetXTitle("#eta \b");
4357  GetaHE11DF->SetYTitle(" <A> \b");
4358  GetaHE11DF->SetZTitle("<A>_ETA - All \b");
4359  GetaHE11DF->SetMarkerColor(4);
4360  GetaHE11DF->SetLineColor(4);
4361  GetaHE11DF->SetMinimum(0.8); // GetaHE11DF->SetMaximum(1.000);
4362  GetaHE11DF->Draw("Error");
4363 
4365  cRBX1->Update();
4366  cRBX1->Print("RBX-HE-11Dplot.png");
4367  cRBX1->Clear();
4368  // clean-up
4369  if (GetaHE11D)
4370  delete GetaHE11D;
4371  if (GetaHE11D0)
4372  delete GetaHE11D0;
4373  if (GetaHE11DF)
4374  delete GetaHE11DF;
4375 
4376  //========================================================================================== 22 HE:: Ratio plots jeta = 0 - 21 jphi =0 - 17
4377  //======================================================================
4378  //======================================================================22.11.2018
4379  //======================================================================
4380  //======================================================================
4381 
4382  gStyle->SetOptStat(1110000);
4383  cout << " RBX HE Ratio plots *****" << endl;
4384  cRBX31->Clear();
4386  // gain stabilitY:
4387  // Rij = Aij / A1j , where i-over LSs, j-channels
4388  //
4389  // nx = maxbinsRBX; // # LS
4390  //
4391  double ccc0HE = 0.;
4392  cRBX31->Divide(3, 1);
4393  //================
4394  cRBX31->cd(1);
4395  // TH1F* Ghe5 = new TH1F("Ghe5","", nx, 1., nx+1.);
4396  TH1F *Ghe51 = new TH1F("Ghe51", "", nx, 1., nx + 1.);
4397  TH1F *Ghe50 = new TH1F("Ghe50", "", nx, 1., nx + 1.);
4398  TH1F *Ghe5 = (TH1F *)Ghe50->Clone("Ghe5");
4399  // j - etaphi index:
4400  for (int j = 1; j <= ny; j++) {
4401  ccc0HE = Ghe1->GetBinContent(1, j);
4402  // 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;} }
4403  if (ccc0HE <= 0.)
4404  for (int i = 1; i <= nx; i++) {
4405  double ccc2 = Ghe1->GetBinContent(i, j);
4406  if (ccc2 > 0.) {
4407  ccc0HE = ccc2;
4408  break;
4409  }
4410  }
4411  if (ccc0HE > 0.) {
4412  // i - # LSs:
4413  for (int i = 1; i <= nx; i++) {
4414  double ccc1 = Ghe1->GetBinContent(i, j);
4415  if (ccc1 > 0.) {
4416  double Rij = ccc1 / ccc0HE;
4417  // Ghe5 ->Fill( float(i), Rij);
4418  Ghe51->Fill(float(i), Rij);
4419  Ghe50->Fill(float(i), 1.);
4420  }
4421  }
4422  }
4423  }
4424  Ghe5->Divide(Ghe51, Ghe50, 1, 1, "B"); // average A
4425  for (int i = 1; i <= nx; i++) {
4426  Ghe5->SetBinError(i, 0.0001);
4427  }
4428  Ghe5->SetMarkerStyle(20);
4429  Ghe5->SetMarkerSize(0.4);
4430  Ghe5->GetYaxis()->SetLabelSize(0.04);
4431  Ghe5->SetMarkerColor(2);
4432  Ghe5->SetLineColor(0);
4433  Ghe5->SetXTitle(" iLS \b");
4434  Ghe5->SetYTitle(" <R> \b");
4435  Ghe5->SetTitle("<Ri> vs iLS \b");
4436  Ghe5->SetMinimum(0.); //Ghe5->SetMaximum(2.5);
4437  // gPad->SetLogy();
4438  gPad->SetGridy();
4439  gPad->SetGridx();
4440  Ghe5->SetStats(0);
4441  Ghe5->GetYaxis()->SetLabelSize(0.025);
4442  Ghe5->Draw("Error");
4443  //================
4444  cRBX31->cd(2);
4445  TH2F *Ghe60 = new TH2F("Ghe60", "", 22, -11., 11., 18, 0., 18.);
4446  TH2F *Ghe61 = new TH2F("Ghe61", "", 22, -11., 11., 18, 0., 18.);
4447  TH2F *Ghe6 = new TH2F("Ghe6", "", 22, -11., 11., 18, 0., 18.);
4448 
4449  TH2F *G20he60 = new TH2F("G20he60", "", 22, -11., 11., 18, 0., 18.);
4450  TH2F *G20he61 = new TH2F("G20he61", "", 22, -11., 11., 18, 0., 18.);
4451  TH2F *G20he6 = new TH2F("G20he6", "", 22, -11., 11., 18, 0., 18.);
4452  TH2F *G30he60 = new TH2F("G30he60", "", 22, -11., 11., 18, 0., 18.);
4453  TH2F *G30he61 = new TH2F("G30he61", "", 22, -11., 11., 18, 0., 18.);
4454  TH2F *G30he6 = new TH2F("G30he6", "", 22, -11., 11., 18, 0., 18.);
4455  TH2F *G40he60 = new TH2F("G40he60", "", 22, -11., 11., 18, 0., 18.);
4456  TH2F *G40he61 = new TH2F("G40he61", "", 22, -11., 11., 18, 0., 18.);
4457  TH2F *G40he6 = new TH2F("G40he6", "", 22, -11., 11., 18, 0., 18.);
4458  // j - etaphi index; i - # LSs;
4459  //
4460  // define mean and RMS:
4461  double sumjHE = 0.;
4462  int njHE = 0;
4463  double meanjHE = 0.;
4464  for (int j = 1; j <= ny; j++) {
4465  ccc0HE = Ghe1->GetBinContent(1, j);
4466  if (ccc0HE <= 0.)
4467  for (int i = 1; i <= nx; i++) {
4468  double ccc2 = Ghe1->GetBinContent(i, j);
4469  if (ccc2 > 0.) {
4470  ccc0HE = ccc2;
4471  break;
4472  }
4473  }
4474  if (ccc0HE > 0.) {
4475  for (int i = 1; i <= nx; i++) {
4476  double ccc1 = Ghe1->GetBinContent(i, j) / ccc0HE;
4477  if (ccc1 > 0.) {
4478  sumjHE += ccc1;
4479  njHE++;
4480  }
4481  }
4482  meanjHE = sumjHE / njHE;
4483  }
4484  } // j
4485 
4486  double ssumjHE = 0.;
4487  njHE = 0;
4488  double sigmajHE = 0.;
4489  for (int j = 1; j <= ny; j++) {
4490  ccc0HE = Ghe1->GetBinContent(1, j);
4491  if (ccc0HE <= 0.)
4492  for (int i = 1; i <= nx; i++) {
4493  double ccc2 = Ghe1->GetBinContent(i, j);
4494  if (ccc2 > 0.) {
4495  ccc0HE = ccc2;
4496  break;
4497  }
4498  }
4499  if (ccc0HE > 0.) {
4500  for (int i = 1; i <= nx; i++) {
4501  double ccc1 = Ghe1->GetBinContent(i, j) / ccc0HE;
4502  if (ccc1 > 0.) {
4503  ssumjHE += (ccc1 - meanjHE) * (ccc1 - meanjHE);
4504  njHE++;
4505  }
4506  }
4507  sigmajHE = sqrt(ssumjHE / njHE);
4508  }
4509  } // j
4510 
4511  double dif3rmsHEMIN = meanjHE - 3 * sigmajHE;
4512  if (dif3rmsHEMIN < 0.)
4513  dif3rmsHEMIN = 0.;
4514  double dif3rmsHEMAX = meanjHE + 3 * sigmajHE;
4515  cout << "22HE-2 meanjHE= " << meanjHE << " sigmajHE= " << sigmajHE << " dif3rmsHEMIN= " << dif3rmsHEMIN
4516  << " dif3rmsHEMAX= " << dif3rmsHEMAX << endl;
4517 
4518  double MAXdif3rmsHEMIN = dif3rmsHEMIN;
4519  double MINdif3rmsHEMAX = dif3rmsHEMAX;
4520  if (MAXdif3rmsHEMIN < 0.95)
4521  MAXdif3rmsHEMIN = 0.95;
4522  if (MINdif3rmsHEMAX > 1.05)
4523  MINdif3rmsHEMAX = 1.05;
4524  cout << "22HE-2 MAXdif3rmsHEMIN= " << MAXdif3rmsHEMIN << " MINdif3rmsHEMAX= " << MINdif3rmsHEMAX << endl;
4525  //
4526  for (int j = 1; j <= ny; j++) {
4527  ccc0HE = Ghe1->GetBinContent(1, j);
4528  if (ccc0HE <= 0.)
4529  for (int i = 1; i <= nx; i++) {
4530  double ccc2 = Ghe1->GetBinContent(i, j);
4531  if (ccc2 > 0.) {
4532  ccc0HE = ccc2;
4533  break;
4534  }
4535  }
4536  if (ccc0HE > 0.) {
4537  int jeta = (j - 1) / 18; // jeta = 0-21
4538  int jphi = (j - 1) - 18 * jeta; // jphi=0-17
4539  // i - # LSs:
4540  for (int i = 1; i <= nx; i++) {
4541  double ccc1 = Ghe1->GetBinContent(i, j);
4542  if (ccc1 > 0.) {
4543  double Rij = ccc1 / ccc0HE;
4544  if (Rij < MAXdif3rmsHEMIN || Rij > MINdif3rmsHEMAX) {
4545  Ghe61->Fill(jeta - 11, jphi, Rij);
4546  Ghe60->Fill(jeta - 11, jphi, 1.);
4547  }
4548  if (Rij < 0.8 || Rij > 1.2) {
4549  G20he61->Fill(jeta - 11, jphi, Rij);
4550  G20he60->Fill(jeta - 11, jphi, 1.);
4551  }
4552  if (Rij < 0.7 || Rij > 1.3) {
4553  G30he61->Fill(jeta - 11, jphi, Rij);
4554  G30he60->Fill(jeta - 11, jphi, 1.);
4555  }
4556  if (Rij < 0.6 || Rij > 1.4) {
4557  G40he61->Fill(jeta - 11, jphi, Rij);
4558  G40he60->Fill(jeta - 11, jphi, 1.);
4559  }
4560  } //if(ccc1>0.
4561  } // i
4562  } //if(ccc0HE>0
4563  } // j
4564  Ghe6->Divide(Ghe61, Ghe60, 1, 1, "B"); // average R
4565  G20he6->Divide(G20he61, G20he60, 1, 1, "B"); // average R
4566  G30he6->Divide(G30he61, G30he60, 1, 1, "B"); // average R
4567  G40he6->Divide(G40he61, G40he60, 1, 1, "B"); // average R
4568 
4569  // Ghe6->SetLabelOffset (Float_t offset=0.005, Option_t *axis="X")//Set offset between axis and axis' labels
4570  // Ghe6->GetZaxis()->SetLabelOffset(-0.05);
4571  Ghe6->GetZaxis()->SetLabelSize(0.025);
4572 
4573  Ghe6->SetXTitle(" #eta \b");
4574  Ghe6->SetYTitle(" #phi \b");
4575  Ghe6->SetTitle(
4576  "<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);
4577  //gStyle->SetOptStat(kFALSE);
4578  Ghe6->SetStats(0);
4579  Ghe6->Draw("COLZ");
4580  //================
4581  cRBX31->cd(3);
4582  TH1F *Ghe7 = new TH1F("Ghe7", "", 120, 0.4, 1.6);
4583  // j - etaphi index:
4584  for (int j = 1; j <= ny; j++) {
4585  ccc0HE = Ghe1->GetBinContent(1, j);
4586  if (ccc0HE <= 0.)
4587  for (int i = 1; i <= nx; i++) {
4588  double ccc2 = Ghe1->GetBinContent(i, j);
4589  if (ccc2 > 0.) {
4590  ccc0HE = ccc2;
4591  break;
4592  }
4593  }
4594  if (ccc0HE > 0.) {
4595  // i - # LSs:
4596  for (int i = 1; i <= nx; i++) {
4597  double ccc1 = Ghe1->GetBinContent(i, j);
4598  if (ccc1 > 0.) {
4599  double Rij = ccc1 / ccc0HE;
4600  Ghe7->Fill(Rij);
4601  }
4602  }
4603  }
4604  }
4605  Ghe7->SetMarkerStyle(20);
4606  Ghe7->SetMarkerSize(0.4);
4607  Ghe7->GetYaxis()->SetLabelSize(0.04);
4608  Ghe7->SetMarkerColor(2);
4609  Ghe7->SetLineColor(0);
4610  Ghe7->SetYTitle(" N \b");
4611  Ghe7->SetXTitle(" Rij \b");
4612  Ghe7->SetTitle(" Rij \b");
4613  //Ghe7->SetMinimum(0.8);Ghe7->SetMaximum(500.);
4614  gPad->SetGridy();
4615  gPad->SetGridx(); // gPad->SetLogy();
4616  // Ghe7->SetStats(1110000);
4617  Ghe7->GetYaxis()->SetLabelSize(0.025);
4618  Ghe7->Draw("Error");
4619  Float_t ymaxHE = Ghe7->GetMaximum();
4620  cout << "22HE-3 ymaxHE= " << ymaxHE << " MAXdif3rmsHEMIN= " << MAXdif3rmsHEMIN
4621  << " MINdif3rmsHEMAX= " << MINdif3rmsHEMAX << endl;
4622  TLine *lineHE = new TLine(MAXdif3rmsHEMIN, 0., MAXdif3rmsHEMIN, ymaxHE);
4623  lineHE->SetLineColor(kBlue);
4624  lineHE->Draw();
4625  TLine *line1HE = new TLine(MINdif3rmsHEMAX, 0., MINdif3rmsHEMAX, ymaxHE);
4626  line1HE->SetLineColor(kBlue);
4627  line1HE->Draw();
4628  //================
4630  cRBX31->Update();
4631  cRBX31->Print("RBX-HE-3plots.png");
4632  cRBX31->Clear();
4633  // clean-up
4634  if (Ghe5)
4635  delete Ghe5;
4636  if (Ghe60)
4637  delete Ghe60;
4638  if (Ghe61)
4639  delete Ghe61;
4640  if (Ghe6)
4641  delete Ghe6;
4642  if (Ghe7)
4643  delete Ghe7;
4644 
4645  if (G20he60)
4646  delete G20he60;
4647  if (G20he61)
4648  delete G20he61;
4649  if (G30he60)
4650  delete G30he60;
4651  if (G30he61)
4652  delete G30he61;
4653  if (G40he60)
4654  delete G40he60;
4655  if (G40he61)
4656  delete G40he61;
4657 
4658  if (Ghe1)
4659  delete Ghe1;
4660  //========================================================================================== 22-1 HE:: Ratio plots jeta = 0 - 21 jphi =0 - 17
4661  //======================================================================
4662  //======================================================================28.11.2018
4663  //======================================================================
4664  //======================================================================
4665 
4666  gStyle->SetOptStat(1110000);
4667  cout << " RBX HE Ratio plotsmore *****" << endl;
4668  cRBX31->Clear();
4670  cRBX31->Divide(3, 1);
4671  //================
4672  cRBX31->cd(1);
4673  G20he6->GetZaxis()->SetLabelSize(0.025);
4674  G20he6->SetXTitle(" #eta \b");
4675  G20he6->SetYTitle(" #phi \b");
4676  G20he6->SetTitle("<Rj> for |1-<R>| > 0.20 \b");
4677  G20he6->SetStats(0);
4678  G20he6->Draw("COLZ");
4679  //================
4680  cRBX31->cd(2);
4681  G30he6->GetZaxis()->SetLabelSize(0.025);
4682  G30he6->SetXTitle(" #eta \b");
4683  G30he6->SetYTitle(" #phi \b");
4684  G30he6->SetTitle("<Rj> for |1-<R>| > 0.30 \b");
4685  G30he6->SetStats(0);
4686  G30he6->Draw("COLZ");
4687  //================
4688  cRBX31->cd(3);
4689  G40he6->GetZaxis()->SetLabelSize(0.025);
4690  G40he6->SetXTitle(" #eta \b");
4691  G40he6->SetYTitle(" #phi \b");
4692  G40he6->SetTitle("<Rj> for |1-<R>| > 0.40 \b");
4693  G40he6->SetStats(0);
4694  G40he6->Draw("COLZ");
4695  //================
4696 
4698  cRBX31->Update();
4699  cRBX31->Print("RBX-HE-3plotsmore.png");
4700  cRBX31->Clear();
4701 
4702  // clean-up
4703  if (G20he6)
4704  delete G20he6;
4705  if (G30he6)
4706  delete G30he6;
4707  if (G40he6)
4708  delete G40he6;
4709  gStyle->SetOptStat(0);
4711 
4712  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
4713  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
4714  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
4715  for (int jphi = 0; jphi < njphi; jphi++) {
4716  for (int jeta = 0; jeta < njeta; jeta++) {
4717  for (int i = 0; i < nx; i++) {
4718  alexall[jeta][jphi][i] = 0.;
4719  }
4720  }
4721  } // nulling
4722 
4724 
4726  //======================================================================
4727  //======================================================================
4728  //======================================================================
4729  cout << " RBX general for HO **************************" << endl;
4730  TH2F *Gho1KKK = (TH2F *)hfile->Get("h_2DsumADCAmplEtaPhiLs2");
4731  TH2F *Gho1LLL = (TH2F *)hfile->Get("h_2DsumADCAmplEtaPhiLs20");
4732  TH2F *Gho1 = (TH2F *)Gho1LLL->Clone("Gho1");
4733  Gho1->Divide(Gho1KKK, Gho1LLL, 1, 1, "B"); // average A
4734  // Gho1->Sumw2();
4735  // int nx = Gho1->GetXaxis()->GetNbins(); // # LS
4736  // nx = maxbinsRBX; // # LS
4737  ny = Gho1->GetYaxis()->GetNbins(); // # jetaphi indexes
4738  for (int j = 1; j <= ny; j++) {
4739  int jeta = (j - 1) / njphi; // jeta = 0-21
4740  if (jeta < 15 && jeta > 6) {
4741  int jphi = (j - 1) - njphi * jeta; // jphi=0-17
4742  // cout<<"HO 54 jeta= "<< jeta <<" jphi = "<<jphi <<endl;
4743  // over LS:
4744  for (int i = 1; i <= nx; i++) {
4745  double ccc1 = Gho1->GetBinContent(i, j);
4746  alexall[jeta][jphi][i - 1] = ccc1;
4747  // if( i == 1 ) cout<<"HO 54 for LS=1 ccc1= "<< ccc1 <<endl;
4748  } //i
4749  } //if
4750  } //j
4751  // clean-up
4752  if (Gho1KKK)
4753  delete Gho1KKK;
4754  if (Gho1LLL)
4755  delete Gho1LLL;
4756  // if (Gho1) delete Gho1;
4757 
4758  //====================================================================== alexho[k][i]
4759  for (int jphi = 0; jphi < njphi; jphi++) {
4760  for (int i = 0; i < nx; i++) {
4761  double sumccc1 = 0.;
4762  int isum = 0;
4763  for (int jeta = 0; jeta < njeta; jeta++) {
4764  double ccc1 = alexall[jeta][jphi][i];
4765  if (ccc1 > 0.) {
4766  sumccc1 += ccc1;
4767  isum++;
4768  }
4769  } // for jeta
4770  if (isum > 0.)
4771  sumccc1 /= isum;
4772  alexho[jphi][i] = sumccc1;
4773  }
4774  } //for for
4775  //====================================================================== blexho[k][i]
4776  for (int keta = 0; keta < njeta; keta++) {
4777  for (int i = 0; i < nx; i++) {
4778  double sumccc1 = 0.;
4779  int isum = 0;
4780  for (int kphi = 0; kphi < njphi; kphi++) {
4781  double ccc1 = alexall[keta][kphi][i];
4782  if (ccc1 > 0.) {
4783  sumccc1 += ccc1;
4784  isum++;
4785  }
4786  } // for kphi
4787  if (isum > 0.)
4788  sumccc1 /= isum;
4789  blexho[keta][i] = sumccc1;
4790  }
4791  } //for for
4792 
4794  //========================================================================================== 33 HO:: 2D jeta = 0 - 21 jphi =0 - 17
4795  //======================================================================
4796  //======================================================================
4797  //======================================================================
4798  //======================================================================
4799  cout << " RBX HO 2D plot *****" << endl;
4800  cRBX1->Clear();
4802  cRBX1->Divide(1, 1);
4803  cRBX1->cd(1);
4804  // int ietaphi = 0; ietaphi = ((k2+1)-1)*nphi + (k3+1) ; k2=0-neta-1; k3=0-nphi-1; neta=18; nphi=22;
4805  TH2F *Gho42D = new TH2F("Gho42D", "", 23, -11.5, 11.5, 18, 0., 18.);
4806  TH2F *Gho42D0 = new TH2F("Gho42D0", "", 23, -11.5, 11.5, 18, 0., 18.);
4807  // TH2F* Gho42D = new TH2F("Gho42D","", 22, -11., 11., 18, 0., 18. );
4808  // TH2F* Gho42D0 = new TH2F("Gho42D0","", 22, -11., 11., 18, 0., 18. );
4809  TH2F *Gho42DF = (TH2F *)Gho42D0->Clone("Gho42DF");
4810  for (int jphi = 0; jphi < njphi; jphi++) {
4811  for (int jeta = 0; jeta < njeta; jeta++) {
4812  for (int i = 0; i < nx; i++) {
4813  double ccc1 = alexall[jeta][jphi][i];
4814  int neweta = jeta - 11 - 0.5;
4815  if (jeta >= 11)
4816  neweta = jeta - 11 + 1.5;
4817  if (ccc1 > 0.) {
4818  Gho42D->Fill(neweta, jphi, ccc1);
4819  Gho42D0->Fill(neweta, jphi, 1.);
4820  }
4821  // if(ccc1>0.) {Gho42D ->Fill(jeta-11,jphi,ccc1); Gho42D0 ->Fill(jeta-11,jphi,1.); }
4822  }
4823  }
4824  }
4825  Gho42DF->Divide(Gho42D, Gho42D0, 1, 1, "B"); // average A
4826  // Gho1->Sumw2();
4827  gPad->SetGridy();
4828  gPad->SetGridx(); // gPad->SetLogz();
4829  Gho42DF->SetMarkerStyle(20);
4830  Gho42DF->SetMarkerSize(0.4);
4831  Gho42DF->GetZaxis()->SetLabelSize(0.04);
4832  Gho42DF->SetXTitle("<A>_RBX #eta \b");
4833  Gho42DF->SetYTitle(" #phi \b");
4834  Gho42DF->SetZTitle("<A>_RBX - All \b");
4835  Gho42DF->SetMarkerColor(2);
4836  Gho42DF->SetLineColor(2); // Gho42DF->SetMaximum(1.000); // Gho42DF->SetMinimum(1.0);
4837  Gho42DF->Draw("COLZ");
4838 
4840  cRBX1->Update();
4841  cRBX1->Print("RBX-HO-2Dplot.png");
4842  cRBX1->Clear();
4843  // clean-up
4844  if (Gho42D)
4845  delete Gho42D;
4846  if (Gho42D0)
4847  delete Gho42D0;
4848  if (Gho42DF)
4849  delete Gho42DF;
4850 
4851  //========================================================================================== 61 HO:: 1D j = 7,8,9,10 ; 11,12,13,14 jphi =0 - 17
4852  //======================================================================
4853  //======================================================================
4854  //======================================================================
4855  //======================================================================
4856  cout << " RBX HO 1D plot *****" << endl;
4857  cRBX1->Clear();
4859  cRBX1->Divide(1, 1);
4860  cRBX1->cd(1);
4861  TH1F *GphiHO1D = new TH1F("GphiHO1D", "", 18, 0., 18.);
4862  TH1F *GphiHO1D0 = new TH1F("GphiHO1D0", "", 18, 0., 18.);
4863  TH1F *GphiHO1DF = (TH1F *)GphiHO1D0->Clone("GphiHO1DF");
4864  for (int jphi = 0; jphi < 18; jphi++) {
4865  for (int jeta = 0; jeta < 22; jeta++) {
4866  for (int i = 0; i < nx; i++) {
4867  double ccc1 = alexall[jeta][jphi][i];
4868  if (ccc1 > 0.) {
4869  GphiHO1D->Fill(jphi, ccc1);
4870  GphiHO1D0->Fill(jphi, 1.);
4871  }
4872  }
4873  }
4874  }
4875  // GphiHO1D->Sumw2();GphiHO1D0->Sumw2();
4876  GphiHO1DF->Divide(GphiHO1D, GphiHO1D0, 1, 1, "B"); // average A
4877  // GphiHO1DF->Sumw2();
4878  for (int jphi = 1; jphi < 19; jphi++) {
4879  GphiHO1DF->SetBinError(jphi, 0.01);
4880  }
4881  gPad->SetGridy();
4882  gPad->SetGridx(); // gPad->SetLogz();
4883  GphiHO1DF->SetMarkerStyle(20);
4884  GphiHO1DF->SetMarkerSize(1.4);
4885  GphiHO1DF->GetZaxis()->SetLabelSize(0.08);
4886  GphiHO1DF->SetXTitle("PHI of RBX\b");
4887  GphiHO1DF->SetYTitle(" <Amplitude> \b");
4888  GphiHO1DF->SetZTitle("<A>_PHI - All \b");
4889  GphiHO1DF->SetMarkerColor(4);
4890  GphiHO1DF->SetLineColor(4);
4891  GphiHO1DF->SetMinimum(0.8); // GphiHO1DF->SetMaximum(1.000);
4892  GphiHO1DF->Draw("Error");
4894  cRBX1->Update();
4895  cRBX1->Print("RBX-HO-1Dplot.png");
4896  cRBX1->Clear();
4897  // clean-up
4898  if (GphiHO1D)
4899  delete GphiHO1D;
4900  if (GphiHO1D0)
4901  delete GphiHO1D0;
4902  if (GphiHO1DF)
4903  delete GphiHO1DF;
4904 
4905  //========================================================================================== 62 HO:: 1D j = 7,8,9,10 ; 11,12,13,14 jphi =0 - 17
4906  //======================================================================
4907  //======================================================================
4908  //======================================================================
4909  //======================================================================
4910  cout << " RBX HO 11D plot *eta*" << endl;
4911  cRBX1->Clear();
4913  cRBX1->Divide(1, 1);
4914  cRBX1->cd(1);
4915  TH1F *GetaHO11D = new TH1F("GetaHO11D", "", 23, -11.5, 11.5);
4916  TH1F *GetaHO11D0 = new TH1F("GetaHO11D0", "", 23, -11.5, 11.5);
4917  TH1F *GetaHO11DF = (TH1F *)GetaHO11D0->Clone("GetaHO11DF");
4918 
4919  for (int jeta = 0; jeta < 22; jeta++) {
4920  for (int jphi = 0; jphi < 18; jphi++) {
4921  for (int i = 0; i < nx; i++) {
4922  double ccc1 = alexall[jeta][jphi][i];
4923  int neweta = jeta - 11 - 0.5;
4924  if (jeta >= 11)
4925  neweta = jeta - 11 + 1.5;
4926  if (ccc1 > 0.) {
4927  GetaHO11D->Fill(neweta, ccc1);
4928  GetaHO11D0->Fill(neweta, 1.);
4929  // if( i == 0 ) cout<<"62 HO: ibin= "<< i <<" jphi= "<< jphi <<" jeta= "<< jeta <<" A= "<< ccc1 <<endl;
4930  }
4931  }
4932  }
4933  }
4934  // GetaHO11D->Sumw2();GetaHO11D0->Sumw2();
4935  GetaHO11DF->Divide(GetaHO11D, GetaHO11D0, 1, 1, "B"); // average A
4936  // GetaHO11DF->Sumw2();
4937  for (int jeta = 1; jeta < 24; jeta++) {
4938  GetaHO11DF->SetBinError(jeta, 0.01);
4939  }
4940  gPad->SetGridy();
4941  gPad->SetGridx(); // gPad->SetLogz();
4942  GetaHO11DF->SetMarkerStyle(20);
4943  GetaHO11DF->SetMarkerSize(1.4);
4944  GetaHO11DF->GetZaxis()->SetLabelSize(0.08);
4945  GetaHO11DF->SetXTitle("#eta \b");
4946  GetaHO11DF->SetYTitle(" <A> \b");
4947  GetaHO11DF->SetZTitle("<A>_ETA - All \b");
4948  GetaHO11DF->SetMarkerColor(4);
4949  GetaHO11DF->SetLineColor(4);
4950  GetaHO11DF->SetMinimum(0.8); // GetaHO11DF->SetMaximum(1.000);
4951  GetaHO11DF->Draw("Error");
4952 
4954  cRBX1->Update();
4955  cRBX1->Print("RBX-HO-11Dplot.png");
4956  cRBX1->Clear();
4957  // clean-up
4958  if (GetaHO11D)
4959  delete GetaHO11D;
4960  if (GetaHO11D0)
4961  delete GetaHO11D0;
4962  if (GetaHO11DF)
4963  delete GetaHO11DF;
4964 
4965  //========================================================================================== 22 HO:: Ratio plots jeta = 0 - 21 jphi =0 - 17
4966  //======================================================================
4967  //======================================================================22.11.2018
4968  //======================================================================
4969  //======================================================================
4970 
4971  gStyle->SetOptStat(1110000);
4972  cout << " RBX HO Ratio plots *****" << endl;
4973  cRBX31->Clear();
4975  // gain stabilitY:
4976  // Rij = Aij / A1j , where i-over LSs, j-channels
4977  //
4978  // nx = maxbinsRBX; // # LS
4979  //
4980  double ccc0HO = 0.;
4981  cRBX31->Divide(3, 1);
4982  //================
4983  cRBX31->cd(1);
4984  // TH1F* Gho5 = new TH1F("Gho5","", nx, 1., nx+1.);
4985  TH1F *Gho51 = new TH1F("Gho51", "", nx, 1., nx + 1.);
4986  TH1F *Gho50 = new TH1F("Gho50", "", nx, 1., nx + 1.);
4987  TH1F *Gho5 = (TH1F *)Gho50->Clone("Gho5");
4988  // j - etaphi index:
4989  for (int j = 1; j <= ny; j++) {
4990  ccc0HO = Gho1->GetBinContent(1, j);
4991  // 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;} }
4992  if (ccc0HO <= 0.)
4993  for (int i = 1; i <= nx; i++) {
4994  double ccc2 = Gho1->GetBinContent(i, j);
4995  if (ccc2 > 0.) {
4996  ccc0HO = ccc2;
4997  break;
4998  }
4999  }
5000  if (ccc0HO > 0.) {
5001  // i - # LSs:
5002  for (int i = 1; i <= nx; i++) {
5003  double ccc1 = Gho1->GetBinContent(i, j);
5004  if (ccc1 > 0.) {
5005  double Rij = ccc1 / ccc0HO;
5006  // Gho5 ->Fill( float(i), Rij);
5007  Gho51->Fill(float(i), Rij);
5008  Gho50->Fill(float(i), 1.);
5009  }
5010  }
5011  }
5012  }
5013  Gho5->Divide(Gho51, Gho50, 1, 1, "B"); // average A
5014  for (int i = 1; i <= nx; i++) {
5015  Gho5->SetBinError(i, 0.0001);
5016  }
5017  Gho5->SetMarkerStyle(20);
5018  Gho5->SetMarkerSize(0.4);
5019  Gho5->GetYaxis()->SetLabelSize(0.04);
5020  Gho5->SetMarkerColor(2);
5021  Gho5->SetLineColor(0);
5022  Gho5->SetXTitle(" iLS \b");
5023  Gho5->SetYTitle(" <R> \b");
5024  Gho5->SetTitle("<Ri> vs iLS \b");
5025  Gho5->SetMinimum(0.); //Gho5->SetMaximum(2.5);
5026  // gPad->SetLogy();
5027  gPad->SetGridy();
5028  gPad->SetGridx();
5029  Gho5->SetStats(0);
5030  Gho5->GetYaxis()->SetLabelSize(0.025);
5031  Gho5->Draw("Error");
5032  //================
5033  cRBX31->cd(2);
5034  TH2F *Gho60 = new TH2F("Gho60", "", 22, -11., 11., 18, 0., 18.);
5035  TH2F *Gho61 = new TH2F("Gho61", "", 22, -11., 11., 18, 0., 18.);
5036  TH2F *Gho6 = new TH2F("Gho6", "", 22, -11., 11., 18, 0., 18.);
5037 
5038  TH2F *G20ho60 = new TH2F("G20ho60", "", 22, -11., 11., 18, 0., 18.);
5039  TH2F *G20ho61 = new TH2F("G20ho61", "", 22, -11., 11., 18, 0., 18.);
5040  TH2F *G20ho6 = new TH2F("G20ho6", "", 22, -11., 11., 18, 0., 18.);
5041  TH2F *G30ho60 = new TH2F("G30ho60", "", 22, -11., 11., 18, 0., 18.);
5042  TH2F *G30ho61 = new TH2F("G30ho61", "", 22, -11., 11., 18, 0., 18.);
5043  TH2F *G30ho6 = new TH2F("G30ho6", "", 22, -11., 11., 18, 0., 18.);
5044  TH2F *G40ho60 = new TH2F("G40ho60", "", 22, -11., 11., 18, 0., 18.);
5045  TH2F *G40ho61 = new TH2F("G40ho61", "", 22, -11., 11., 18, 0., 18.);
5046  TH2F *G40ho6 = new TH2F("G40ho6", "", 22, -11., 11., 18, 0., 18.);
5047 
5048  // j - etaphi index; i - # LSs;
5049  //
5050  // define mean and RMS:
5051  double sumjHO = 0.;
5052  int njHO = 0;
5053  double meanjHO = 0.;
5054  for (int j = 1; j <= ny; j++) {
5055  ccc0HO = Gho1->GetBinContent(1, j);
5056  if (ccc0HO <= 0.)
5057  for (int i = 1; i <= nx; i++) {
5058  double ccc2 = Gho1->GetBinContent(i, j);
5059  if (ccc2 > 0.) {
5060  ccc0HO = ccc2;
5061  break;
5062  }
5063  }
5064  if (ccc0HO > 0.) {
5065  for (int i = 1; i <= nx; i++) {
5066  double ccc1 = Gho1->GetBinContent(i, j) / ccc0HO;
5067  if (ccc1 > 0.) {
5068  sumjHO += ccc1;
5069  njHO++;
5070  }
5071  }
5072  meanjHO = sumjHO / njHO;
5073  }
5074  } // j
5075 
5076  double ssumjHO = 0.;
5077  njHO = 0;
5078  double sigmajHO = 0.;
5079  for (int j = 1; j <= ny; j++) {
5080  ccc0HO = Gho1->GetBinContent(1, j);
5081  if (ccc0HO <= 0.)
5082  for (int i = 1; i <= nx; i++) {
5083  double ccc2 = Gho1->GetBinContent(i, j);
5084  if (ccc2 > 0.) {
5085  ccc0HO = ccc2;
5086  break;
5087  }
5088  }
5089  if (ccc0HO > 0.) {
5090  for (int i = 1; i <= nx; i++) {
5091  double ccc1 = Gho1->GetBinContent(i, j) / ccc0HO;
5092  if (ccc1 > 0.) {
5093  ssumjHO += (ccc1 - meanjHO) * (ccc1 - meanjHO);
5094  njHO++;
5095  }
5096  }
5097  sigmajHO = sqrt(ssumjHO / njHO);
5098  }
5099  } // j
5100 
5101  double dif3rmsHOMIN = meanjHO - 3 * sigmajHO;
5102  if (dif3rmsHOMIN < 0.)
5103  dif3rmsHOMIN = 0.;
5104  double dif3rmsHOMAX = meanjHO + 3 * sigmajHO;
5105  cout << "22HO-2 meanjHO= " << meanjHO << " sigmajHO= " << sigmajHO << " dif3rmsHOMIN= " << dif3rmsHOMIN
5106  << " dif3rmsHOMAX= " << dif3rmsHOMAX << endl;
5107 
5108  double MAXdif3rmsHOMIN = dif3rmsHOMIN;
5109  double MINdif3rmsHOMAX = dif3rmsHOMAX;
5110  if (MAXdif3rmsHOMIN < 0.95)
5111  MAXdif3rmsHOMIN = 0.95;
5112  if (MINdif3rmsHOMAX > 1.05)
5113  MINdif3rmsHOMAX = 1.05;
5114  cout << "22HO-2 MAXdif3rmsHOMIN= " << MAXdif3rmsHOMIN << " MINdif3rmsHOMAX= " << MINdif3rmsHOMAX << endl;
5115  //
5116  for (int j = 1; j <= ny; j++) {
5117  ccc0HO = Gho1->GetBinContent(1, j);
5118  if (ccc0HO <= 0.)
5119  for (int i = 1; i <= nx; i++) {
5120  double ccc2 = Gho1->GetBinContent(i, j);
5121  if (ccc2 > 0.) {
5122  ccc0HO = ccc2;
5123  break;
5124  }
5125  }
5126  if (ccc0HO > 0.) {
5127  int jeta = (j - 1) / 18; // jeta = 0-21
5128  int jphi = (j - 1) - 18 * jeta; // jphi=0-17
5129  // i - # LSs:
5130  for (int i = 1; i <= nx; i++) {
5131  double ccc1 = Gho1->GetBinContent(i, j);
5132  if (ccc1 > 0.) {
5133  double Rij = ccc1 / ccc0HO;
5134  if (Rij < MAXdif3rmsHOMIN || Rij > MINdif3rmsHOMAX) {
5135  Gho61->Fill(jeta - 11, jphi, Rij);
5136  Gho60->Fill(jeta - 11, jphi, 1.);
5137  }
5138  if (Rij < 0.8 || Rij > 1.2) {
5139  G20ho61->Fill(jeta - 11, jphi, Rij);
5140  G20ho60->Fill(jeta - 11, jphi, 1.);
5141  }
5142  if (Rij < 0.7 || Rij > 1.3) {
5143  G30ho61->Fill(jeta - 11, jphi, Rij);
5144  G30ho60->Fill(jeta - 11, jphi, 1.);
5145  }
5146  if (Rij < 0.6 || Rij > 1.4) {
5147  G40ho61->Fill(jeta - 11, jphi, Rij);
5148  G40ho60->Fill(jeta - 11, jphi, 1.);
5149  }
5150  } //if(ccc1>0.
5151  } // i
5152  } //if(ccc0HO>0
5153  } // j
5154  Gho6->Divide(Gho61, Gho60, 1, 1, "B"); // average R
5155  G20ho6->Divide(G20ho61, G20ho60, 1, 1, "B"); // average R
5156  G30ho6->Divide(G30ho61, G30ho60, 1, 1, "B"); // average R
5157  G40ho6->Divide(G40ho61, G40ho60, 1, 1, "B"); // average R
5158  // Gho6->SetLabelOffset (Float_t offset=0.005, Option_t *axis="X")//Set offset between axis and axis' labels
5159  // Gho6->GetZaxis()->SetLabelOffset(-0.05);
5160  Gho6->GetZaxis()->SetLabelSize(0.025);
5161 
5162  Gho6->SetXTitle(" #eta \b");
5163  Gho6->SetYTitle(" #phi \b");
5164  Gho6->SetTitle(
5165  "<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);
5166  //gStyle->SetOptStat(kFALSE);
5167  Gho6->SetStats(0);
5168  Gho6->Draw("COLZ");
5169  //================
5170  cRBX31->cd(3);
5171  TH1F *Gho7 = new TH1F("Gho7", "", 120, 0.4, 1.6);
5172  // j - etaphi index:
5173  for (int j = 1; j <= ny; j++) {
5174  ccc0HO = Gho1->GetBinContent(1, j);
5175  if (ccc0HO <= 0.)
5176  for (int i = 1; i <= nx; i++) {
5177  double ccc2 = Gho1->GetBinContent(i, j);
5178  if (ccc2 > 0.) {
5179  ccc0HO = ccc2;
5180  break;
5181  }
5182  }
5183  if (ccc0HO > 0.) {
5184  // i - # LSs:
5185  for (int i = 1; i <= nx; i++) {
5186  double ccc1 = Gho1->GetBinContent(i, j);
5187  if (ccc1 > 0.) {
5188  double Rij = ccc1 / ccc0HO;
5189  Gho7->Fill(Rij);
5190  }
5191  }
5192  }
5193  }
5194  Gho7->SetMarkerStyle(20);
5195  Gho7->SetMarkerSize(0.4);
5196  Gho7->GetYaxis()->SetLabelSize(0.04);
5197  Gho7->SetMarkerColor(2);
5198  Gho7->SetLineColor(0);
5199  Gho7->SetYTitle(" N \b");
5200  Gho7->SetXTitle(" Rij \b");
5201  Gho7->SetTitle(" Rij \b");
5202  //Gho7->SetMinimum(0.8);Gho7->SetMaximum(500.);
5203  gPad->SetGridy();
5204  gPad->SetGridx(); // gPad->SetLogy();
5205  // Gho7->SetStats(1110000);
5206  Gho7->GetYaxis()->SetLabelSize(0.025);
5207  Gho7->Draw("Error");
5208  Float_t ymaxHO = Gho7->GetMaximum();
5209  cout << "22HO-3 ymaxHO= " << ymaxHO << " MAXdif3rmsHOMIN= " << MAXdif3rmsHOMIN
5210  << " MINdif3rmsHOMAX= " << MINdif3rmsHOMAX << endl;
5211  TLine *lineHO = new TLine(MAXdif3rmsHOMIN, 0., MAXdif3rmsHOMIN, ymaxHO);
5212  lineHO->SetLineColor(kBlue);
5213  lineHO->Draw();
5214  TLine *line1HO = new TLine(MINdif3rmsHOMAX, 0., MINdif3rmsHOMAX, ymaxHO);
5215  line1HO->SetLineColor(kBlue);
5216  line1HO->Draw();
5217  //================
5219  cRBX31->Update();
5220  cRBX31->Print("RBX-HO-3plots.png");
5221  cRBX31->Clear();
5222  // clean-up
5223  if (Gho5)
5224  delete Gho5;
5225  if (Gho60)
5226  delete Gho60;
5227  if (Gho61)
5228  delete Gho61;
5229  if (Gho6)
5230  delete Gho6;
5231  if (Gho7)
5232  delete Gho7;
5233 
5234  if (G20ho60)
5235  delete G20ho60;
5236  if (G20ho61)
5237  delete G20ho61;
5238  if (G30ho60)
5239  delete G30ho60;
5240  if (G30ho61)
5241  delete G30ho61;
5242  if (G40ho60)
5243  delete G40ho60;
5244  if (G40ho61)
5245  delete G40ho61;
5246 
5247  if (Gho1)
5248  delete Gho1;
5249  //========================================================================================== 22-1 HO:: Ratio plots jeta = 0 - 21 jphi =0 - 17
5250  //======================================================================
5251  //======================================================================28.11.2018
5252  //======================================================================
5253  //======================================================================
5254 
5255  gStyle->SetOptStat(1110000);
5256  cout << " RBX HO Ratio plotsmore *****" << endl;
5257  cRBX31->Clear();
5259  cRBX31->Divide(3, 1);
5260  //================
5261  cRBX31->cd(1);
5262  G20ho6->GetZaxis()->SetLabelSize(0.025);
5263  G20ho6->SetXTitle(" #eta \b");
5264  G20ho6->SetYTitle(" #phi \b");
5265  G20ho6->SetTitle("<Rj> for |1-<R>| > 0.20 \b");
5266  G20ho6->SetStats(0);
5267  G20ho6->Draw("COLZ");
5268  //================
5269  cRBX31->cd(2);
5270  G30ho6->GetZaxis()->SetLabelSize(0.025);
5271  G30ho6->SetXTitle(" #eta \b");
5272  G30ho6->SetYTitle(" #phi \b");
5273  G30ho6->SetTitle("<Rj> for |1-<R>| > 0.30 \b");
5274  G30ho6->SetStats(0);
5275  G30ho6->Draw("COLZ");
5276  //================
5277  cRBX31->cd(3);
5278  G40ho6->GetZaxis()->SetLabelSize(0.025);
5279  G40ho6->SetXTitle(" #eta \b");
5280  G40ho6->SetYTitle(" #phi \b");
5281  G40ho6->SetTitle("<Rj> for |1-<R>| > 0.40 \b");
5282  G40ho6->SetStats(0);
5283  G40ho6->Draw("COLZ");
5284  //================
5285 
5287  cRBX31->Update();
5288  cRBX31->Print("RBX-HO-3plotsmore.png");
5289  cRBX31->Clear();
5290 
5291  // clean-up
5292  if (G20ho6)
5293  delete G20ho6;
5294  if (G30ho6)
5295  delete G30ho6;
5296  if (G40ho6)
5297  delete G40ho6;
5298  gStyle->SetOptStat(0);
5300 
5301  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
5302  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
5303  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
5304  for (int jphi = 0; jphi < njphi; jphi++) {
5305  for (int jeta = 0; jeta < njeta; jeta++) {
5306  for (int i = 0; i < nx; i++) {
5307  alexall[jeta][jphi][i] = 0.;
5308  }
5309  }
5310  } // nulling
5311 
5313 
5315  //======================================================================
5316  //======================================================================
5317  //======================================================================
5318  cout << " RBX general for HF **************************" << endl;
5319  TH2F *Ghf1KKK = (TH2F *)hfile->Get("h_2DsumADCAmplEtaPhiLs3");
5320  TH2F *Ghf1LLL = (TH2F *)hfile->Get("h_2DsumADCAmplEtaPhiLs30");
5321  TH2F *Ghf1 = (TH2F *)Ghf1LLL->Clone("Ghf1");
5322  Ghf1->Divide(Ghf1KKK, Ghf1LLL, 1, 1, "B"); // average A
5323  // Ghf1->Sumw2();
5324  // int nx = Ghf1->GetXaxis()->GetNbins(); // # LS
5325  // nx = maxbinsRBX; // # LS
5326  ny = Ghf1->GetYaxis()->GetNbins(); // # jetaphi indexes
5327  for (int j = 1; j <= ny; j++) {
5328  int jeta = (j - 1) / njphi; // jeta = 0-21
5329  if (jeta < 4 || jeta > 17) {
5330  int jphi = (j - 1) - njphi * jeta; // jphi=0-17
5331  // cout<<"HF 54 jeta= "<< jeta <<" jphi = "<<jphi <<endl;
5332  // over LS:
5333  for (int i = 1; i <= nx; i++) {
5334  double ccc1 = Ghf1->GetBinContent(i, j);
5335  alexall[jeta][jphi][i - 1] = ccc1;
5336  // if( i == 1 ) cout<<"HF 54 for LS=1 ccc1= "<< ccc1 <<endl;
5337  } //i
5338  } //if
5339  } //j
5340  // clean-up
5341  if (Ghf1KKK)
5342  delete Ghf1KKK;
5343  if (Ghf1LLL)
5344  delete Ghf1LLL;
5345  // if (Ghf1) delete Ghf1;
5346 
5347  //====================================================================== alexhf[k][i]
5348  for (int jphi = 0; jphi < njphi; jphi++) {
5349  for (int i = 0; i < nx; i++) {
5350  double sumccc1 = 0.;
5351  int isum = 0;
5352  for (int jeta = 0; jeta < njeta; jeta++) {
5353  double ccc1 = alexall[jeta][jphi][i];
5354  if (ccc1 > 0.) {
5355  sumccc1 += ccc1;
5356  isum++;
5357  }
5358  } // for jeta
5359  if (isum > 0.)
5360  sumccc1 /= isum;
5361  alexhf[jphi][i] = sumccc1;
5362  }
5363  } //for for
5364  //====================================================================== blexhf[k][i]
5365  for (int keta = 0; keta < njeta; keta++) {
5366  for (int i = 0; i < nx; i++) {
5367  double sumccc1 = 0.;
5368  int isum = 0;
5369  for (int kphi = 0; kphi < njphi; kphi++) {
5370  double ccc1 = alexall[keta][kphi][i];
5371  if (ccc1 > 0.) {
5372  sumccc1 += ccc1;
5373  isum++;
5374  }
5375  } // for kphi
5376  if (isum > 0.)
5377  sumccc1 /= isum;
5378  blexhf[keta][i] = sumccc1;
5379  }
5380  } //for for
5382  //========================================================================================== 60 HF:: 2D jeta = 0 - 21 jphi =0 - 17
5383  //======================================================================
5384  //======================================================================
5385  //======================================================================
5386  //======================================================================
5387  cout << " RBX HF 2D plot *****" << endl;
5388  cRBX1->Clear();
5390  cRBX1->Divide(1, 1);
5391  cRBX1->cd(1);
5392  // int ietaphi = 0; ietaphi = ((k2+1)-1)*nphi + (k3+1) ; k2=0-neta-1; k3=0-nphi-1; neta=18; nphi=22;
5393  TH2F *Ghf42D = new TH2F("Ghf42D", "", 23, -11.5, 11.5, 18, 0., 18.);
5394  TH2F *Ghf42D0 = new TH2F("Ghf42D0", "", 23, -11.5, 11.5, 18, 0., 18.);
5395  // TH2F* Ghf42D = new TH2F("Ghf42D","", 22, -11., 11., 18, 0., 18. );
5396  // TH2F* Ghf42D0 = new TH2F("Ghf42D0","", 22, -11., 11., 18, 0., 18. );
5397  TH2F *Ghf42DF = (TH2F *)Ghf42D0->Clone("Ghf42DF");
5398  for (int jphi = 0; jphi < njphi; jphi++) {
5399  for (int jeta = 0; jeta < njeta; jeta++) {
5400  for (int i = 0; i < nx; i++) {
5401  double ccc1 = alexall[jeta][jphi][i];
5402  int neweta = jeta - 11 - 0.5;
5403  if (jeta >= 11)
5404  neweta = jeta - 11 + 1.5;
5405  if (ccc1 > 0.) {
5406  Ghf42D->Fill(neweta, jphi, ccc1);
5407  Ghf42D0->Fill(neweta, jphi, 1.);
5408  }
5409  // if(ccc1>0.) {Ghf42D ->Fill(jeta-11,jphi,ccc1); Ghf42D0 ->Fill(jeta-11,jphi,1.); }
5410  }
5411  }
5412  }
5413  Ghf42DF->Divide(Ghf42D, Ghf42D0, 1, 1, "B"); // average A
5414  // Ghf1->Sumw2();
5415  gPad->SetGridy();
5416  gPad->SetGridx(); // gPad->SetLogz();
5417  Ghf42DF->SetMarkerStyle(20);
5418  Ghf42DF->SetMarkerSize(0.4);
5419  Ghf42DF->GetZaxis()->SetLabelSize(0.04);
5420  Ghf42DF->SetXTitle("<A>_RBX #eta \b");
5421  Ghf42DF->SetYTitle(" #phi \b");
5422  Ghf42DF->SetZTitle("<A>_RBX - All \b");
5423  Ghf42DF->SetMarkerColor(2);
5424  Ghf42DF->SetLineColor(2); // Ghf42DF->SetMaximum(1.000); // Ghf42DF->SetMinimum(1.0);
5425  Ghf42DF->Draw("COLZ");
5426 
5428  cRBX1->Update();
5429  cRBX1->Print("RBX-HF-2Dplot.png");
5430  cRBX1->Clear();
5431  // clean-up
5432  if (Ghf42D)
5433  delete Ghf42D;
5434  if (Ghf42D0)
5435  delete Ghf42D0;
5436  if (Ghf42DF)
5437  delete Ghf42DF;
5438 
5439  //========================================================================================== 61 HF:: 1D j = 7,8,9,10 ; 11,12,13,14 jphi =0 - 17
5440  //======================================================================
5441  //======================================================================
5442  //======================================================================
5443  //======================================================================
5444  cout << " RBX HF 1D plot *****" << endl;
5445  cRBX1->Clear();
5447  cRBX1->Divide(1, 1);
5448  cRBX1->cd(1);
5449  TH1F *GphiHF1D = new TH1F("GphiHF1D", "", 18, 0., 18.);
5450  TH1F *GphiHF1D0 = new TH1F("GphiHF1D0", "", 18, 0., 18.);
5451  TH1F *GphiHF1DF = (TH1F *)GphiHF1D0->Clone("GphiHF1DF");
5452  for (int jphi = 0; jphi < 18; jphi++) {
5453  for (int jeta = 0; jeta < 22; jeta++) {
5454  for (int i = 0; i < nx; i++) {
5455  double ccc1 = alexall[jeta][jphi][i];
5456  if (ccc1 > 0.) {
5457  GphiHF1D->Fill(jphi, ccc1);
5458  GphiHF1D0->Fill(jphi, 1.);
5459  }
5460  }
5461  }
5462  }
5463  // GphiHF1D->Sumw2();GphiHF1D0->Sumw2();
5464  GphiHF1DF->Divide(GphiHF1D, GphiHF1D0, 1, 1, "B"); // average A
5465  // GphiHF1DF->Sumw2();
5466  for (int jphi = 1; jphi < 19; jphi++) {
5467  GphiHF1DF->SetBinError(jphi, 0.01);
5468  }
5469  gPad->SetGridy();
5470  gPad->SetGridx(); // gPad->SetLogz();
5471  GphiHF1DF->SetMarkerStyle(20);
5472  GphiHF1DF->SetMarkerSize(1.4);
5473  GphiHF1DF->GetZaxis()->SetLabelSize(0.08);
5474  GphiHF1DF->SetXTitle("PHI of RBX\b");
5475  GphiHF1DF->SetYTitle(" <Amplitude> \b");
5476  GphiHF1DF->SetZTitle("<A>_PHI - All \b");
5477  GphiHF1DF->SetMarkerColor(4);
5478  GphiHF1DF->SetLineColor(4);
5479  GphiHF1DF->SetMinimum(0.8); // GphiHF1DF->SetMaximum(1.000);
5480  GphiHF1DF->Draw("Error");
5482  cRBX1->Update();
5483  cRBX1->Print("RBX-HF-1Dplot.png");
5484  cRBX1->Clear();
5485  // clean-up
5486  if (GphiHF1D)
5487  delete GphiHF1D;
5488  if (GphiHF1D0)
5489  delete GphiHF1D0;
5490  if (GphiHF1DF)
5491  delete GphiHF1DF;
5492 
5493  //========================================================================================== 62 HF:: 1D j = 7,8,9,10 ; 11,12,13,14 jphi =0 - 17
5494  //======================================================================
5495  //======================================================================
5496  //======================================================================
5497  //======================================================================
5498  cout << " RBX HF 11D plot *eta*" << endl;
5499  cRBX1->Clear();
5501  cRBX1->Divide(1, 1);
5502  cRBX1->cd(1);
5503  TH1F *GetaHF11D = new TH1F("GetaHF11D", "", 23, -11.5, 11.5);
5504  TH1F *GetaHF11D0 = new TH1F("GetaHF11D0", "", 23, -11.5, 11.5);
5505  TH1F *GetaHF11DF = (TH1F *)GetaHF11D0->Clone("GetaHF11DF");
5506 
5507  for (int jeta = 0; jeta < 22; jeta++) {
5508  for (int jphi = 0; jphi < 18; jphi++) {
5509  for (int i = 0; i < nx; i++) {
5510  double ccc1 = alexall[jeta][jphi][i];
5511  int neweta = jeta - 11 - 0.5;
5512  if (jeta >= 11)
5513  neweta = jeta - 11 + 1.5;
5514  if (ccc1 > 0.) {
5515  GetaHF11D->Fill(neweta, ccc1);
5516  GetaHF11D0->Fill(neweta, 1.);
5517  // if( i == 0 ) cout<<"62 HF: ibin= "<< i <<" jphi= "<< jphi <<" jeta= "<< jeta <<" A= "<< ccc1 <<endl;
5518  }
5519  }
5520  }
5521  }
5522  // GetaHF11D->Sumw2();GetaHF11D0->Sumw2();
5523  GetaHF11DF->Divide(GetaHF11D, GetaHF11D0, 1, 1, "B"); // average A
5524  // GetaHF11DF->Sumw2();
5525  for (int jeta = 1; jeta < 24; jeta++) {
5526  GetaHF11DF->SetBinError(jeta, 0.01);
5527  }
5528  gPad->SetGridy();
5529  gPad->SetGridx(); // gPad->SetLogz();
5530  GetaHF11DF->SetMarkerStyle(20);
5531  GetaHF11DF->SetMarkerSize(1.4);
5532  GetaHF11DF->GetZaxis()->SetLabelSize(0.08);
5533  GetaHF11DF->SetXTitle("#eta \b");
5534  GetaHF11DF->SetYTitle(" <A> \b");
5535  GetaHF11DF->SetZTitle("<A>_ETA - All \b");
5536  GetaHF11DF->SetMarkerColor(4);
5537  GetaHF11DF->SetLineColor(4);
5538  GetaHF11DF->SetMinimum(0.8); // GetaHF11DF->SetMaximum(1.000);
5539  GetaHF11DF->Draw("Error");
5540 
5542  cRBX1->Update();
5543  cRBX1->Print("RBX-HF-11Dplot.png");
5544  cRBX1->Clear();
5545  // clean-up
5546  if (GetaHF11D)
5547  delete GetaHF11D;
5548  if (GetaHF11D0)
5549  delete GetaHF11D0;
5550  if (GetaHF11DF)
5551  delete GetaHF11DF;
5552 
5553  //========================================================================================== 22 HF:: Ratio plots jeta = 0 - 21 jphi =0 - 17
5554  //======================================================================
5555  //======================================================================22.11.2018
5556  //======================================================================
5557  //======================================================================
5558 
5559  gStyle->SetOptStat(1110000);
5560  cout << " RBX HF Ratio plots *****" << endl;
5561  cRBX31->Clear();
5563  // gain stabilitY:
5564  // Rij = Aij / A1j , where i-over LSs, j-channels
5565  //
5566  // nx = maxbinsRBX; // # LS
5567  //
5568  double ccc0HF = 0.;
5569  cRBX31->Divide(3, 1);
5570  //================
5571  cRBX31->cd(1);
5572  // TH1F* Ghf5 = new TH1F("Ghf5","", nx, 1., nx+1.);
5573  TH1F *Ghf51 = new TH1F("Ghf51", "", nx, 1., nx + 1.);
5574  TH1F *Ghf50 = new TH1F("Ghf50", "", nx, 1., nx + 1.);
5575  TH1F *Ghf5 = (TH1F *)Ghf50->Clone("Ghf5");
5576  // j - etaphi index:
5577  for (int j = 1; j <= ny; j++) {
5578  ccc0HF = Ghf1->GetBinContent(1, j);
5579  // 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;} }
5580  if (ccc0HF <= 0.)
5581  for (int i = 1; i <= nx; i++) {
5582  double ccc2 = Ghf1->GetBinContent(i, j);
5583  if (ccc2 > 0.) {
5584  ccc0HF = ccc2;
5585  break;
5586  }
5587  }
5588  if (ccc0HF > 0.) {
5589  // i - # LSs:
5590  for (int i = 1; i <= nx; i++) {
5591  double ccc1 = Ghf1->GetBinContent(i, j);
5592  if (ccc1 > 0.) {
5593  double Rij = ccc1 / ccc0HF;
5594  // Ghf5 ->Fill( float(i), Rij);
5595  Ghf51->Fill(float(i), Rij);
5596  Ghf50->Fill(float(i), 1.);
5597  }
5598  }
5599  }
5600  }
5601  Ghf5->Divide(Ghf51, Ghf50, 1, 1, "B"); // average A
5602  for (int i = 1; i <= nx; i++) {
5603  Ghf5->SetBinError(i, 0.0001);
5604  }
5605  Ghf5->SetMarkerStyle(20);
5606  Ghf5->SetMarkerSize(0.4);
5607  Ghf5->GetYaxis()->SetLabelSize(0.04);
5608  Ghf5->SetMarkerColor(2);
5609  Ghf5->SetLineColor(0);
5610  Ghf5->SetXTitle(" iLS \b");
5611  Ghf5->SetYTitle(" <R> \b");
5612  Ghf5->SetTitle("<Ri> vs iLS \b");
5613  Ghf5->SetMinimum(0.); //Ghf5->SetMaximum(2.5);
5614  // gPad->SetLogy();
5615  gPad->SetGridy();
5616  gPad->SetGridx();
5617  Ghf5->SetStats(0);
5618  Ghf5->GetYaxis()->SetLabelSize(0.025);
5619  Ghf5->Draw("Error");
5620  //================
5621  cRBX31->cd(2);
5622  TH2F *Ghf60 = new TH2F("Ghf60", "", 22, -11., 11., 18, 0., 18.);
5623  TH2F *Ghf61 = new TH2F("Ghf61", "", 22, -11., 11., 18, 0., 18.);
5624  TH2F *Ghf6 = new TH2F("Ghf6", "", 22, -11., 11., 18, 0., 18.);
5625 
5626  TH2F *G20hf60 = new TH2F("G20hf60", "", 22, -11., 11., 18, 0., 18.);
5627  TH2F *G20hf61 = new TH2F("G20hf61", "", 22, -11., 11., 18, 0., 18.);
5628  TH2F *G20hf6 = new TH2F("G20hf6", "", 22, -11., 11., 18, 0., 18.);
5629  TH2F *G30hf60 = new TH2F("G30hf60", "", 22, -11., 11., 18, 0., 18.);
5630  TH2F *G30hf61 = new TH2F("G30hf61", "", 22, -11., 11., 18, 0., 18.);
5631  TH2F *G30hf6 = new TH2F("G30hf6", "", 22, -11., 11., 18, 0., 18.);
5632  TH2F *G40hf60 = new TH2F("G40hf60", "", 22, -11., 11., 18, 0., 18.);
5633  TH2F *G40hf61 = new TH2F("G40hf61", "", 22, -11., 11., 18, 0., 18.);
5634  TH2F *G40hf6 = new TH2F("G40hf6", "", 22, -11., 11., 18, 0., 18.);
5635  // j - etaphi index; i - # LSs;
5636  //
5637  // define mean and RMS:
5638  double sumjHF = 0.;
5639  int njHF = 0;
5640  double meanjHF = 0.;
5641  for (int j = 1; j <= ny; j++) {
5642  ccc0HF = Ghf1->GetBinContent(1, j);
5643  if (ccc0HF <= 0.)
5644  for (int i = 1; i <= nx; i++) {
5645  double ccc2 = Ghf1->GetBinContent(i, j);
5646  if (ccc2 > 0.) {
5647  ccc0HF = ccc2;
5648  break;
5649  }
5650  }
5651  if (ccc0HF > 0.) {
5652  for (int i = 1; i <= nx; i++) {
5653  double ccc1 = Ghf1->GetBinContent(i, j) / ccc0HF;
5654  if (ccc1 > 0.) {
5655  sumjHF += ccc1;
5656  njHF++;
5657  }
5658  }
5659  meanjHF = sumjHF / njHF;
5660  }
5661  } // j
5662 
5663  double ssumjHF = 0.;
5664  njHF = 0;
5665  double sigmajHF = 0.;
5666  for (int j = 1; j <= ny; j++) {
5667  ccc0HF = Ghf1->GetBinContent(1, j);
5668  if (ccc0HF <= 0.)
5669  for (int i = 1; i <= nx; i++) {
5670  double ccc2 = Ghf1->GetBinContent(i, j);
5671  if (ccc2 > 0.) {
5672  ccc0HF = ccc2;
5673  break;
5674  }
5675  }
5676  if (ccc0HF > 0.) {
5677  for (int i = 1; i <= nx; i++) {
5678  double ccc1 = Ghf1->GetBinContent(i, j) / ccc0HF;
5679  if (ccc1 > 0.) {
5680  ssumjHF += (ccc1 - meanjHF) * (ccc1 - meanjHF);
5681  njHF++;
5682  }
5683  }
5684  sigmajHF = sqrt(ssumjHF / njHF);
5685  }
5686  } // j
5687 
5688  double dif3rmsHFMIN = meanjHF - 3 * sigmajHF;
5689  if (dif3rmsHFMIN < 0.)
5690  dif3rmsHFMIN = 0.;
5691  double dif3rmsHFMAX = meanjHF + 3 * sigmajHF;
5692  cout << "22HF-2 meanjHF= " << meanjHF << " sigmajHF= " << sigmajHF << " dif3rmsHFMIN= " << dif3rmsHFMIN
5693  << " dif3rmsHFMAX= " << dif3rmsHFMAX << endl;
5694 
5695  double MAXdif3rmsHFMIN = dif3rmsHFMIN;
5696  double MINdif3rmsHFMAX = dif3rmsHFMAX;
5697  if (MAXdif3rmsHFMIN < 0.95)
5698  MAXdif3rmsHFMIN = 0.95;
5699  if (MINdif3rmsHFMAX > 1.05)
5700  MINdif3rmsHFMAX = 1.05;
5701  cout << "22HF-2 MAXdif3rmsHFMIN= " << MAXdif3rmsHFMIN << " MINdif3rmsHFMAX= " << MINdif3rmsHFMAX << endl;
5702  //
5703  for (int j = 1; j <= ny; j++) {
5704  ccc0HF = Ghf1->GetBinContent(1, j);
5705  if (ccc0HF <= 0.)
5706  for (int i = 1; i <= nx; i++) {
5707  double ccc2 = Ghf1->GetBinContent(i, j);
5708  if (ccc2 > 0.) {
5709  ccc0HF = ccc2;
5710  break;
5711  }
5712  }
5713  if (ccc0HF > 0.) {
5714  int jeta = (j - 1) / 18; // jeta = 0-21
5715  int jphi = (j - 1) - 18 * jeta; // jphi=0-17
5716  // i - # LSs:
5717  for (int i = 1; i <= nx; i++) {
5718  double ccc1 = Ghf1->GetBinContent(i, j);
5719  if (ccc1 > 0.) {
5720  double Rij = ccc1 / ccc0HF;
5721  if (Rij < MAXdif3rmsHFMIN || Rij > MINdif3rmsHFMAX) {
5722  Ghf61->Fill(jeta - 11, jphi, Rij);
5723  Ghf60->Fill(jeta - 11, jphi, 1.);
5724  }
5725  if (Rij < 0.8 || Rij > 1.2) {
5726  G20hf61->Fill(jeta - 11, jphi, Rij);
5727  G20hf60->Fill(jeta - 11, jphi, 1.);
5728  }
5729  if (Rij < 0.7 || Rij > 1.3) {
5730  G30hf61->Fill(jeta - 11, jphi, Rij);
5731  G30hf60->Fill(jeta - 11, jphi, 1.);
5732  }
5733  if (Rij < 0.6 || Rij > 1.4) {
5734  G40hf61->Fill(jeta - 11, jphi, Rij);
5735  G40hf60->Fill(jeta - 11, jphi, 1.);
5736  }
5737  } //if(ccc1>0.
5738  } // i
5739  } //if(ccc0HF>0
5740  } // j
5741  Ghf6->Divide(Ghf61, Ghf60, 1, 1, "B"); // average R
5742  G20hf6->Divide(G20hf61, G20hf60, 1, 1, "B"); // average R
5743  G30hf6->Divide(G30hf61, G30hf60, 1, 1, "B"); // average R
5744  G40hf6->Divide(G40hf61, G40hf60, 1, 1, "B"); // average R
5745  // Ghf6->SetLabelOffset (Float_t offset=0.005, Option_t *axis="X")//Set offset between axis and axis' labels
5746  // Ghf6->GetZaxis()->SetLabelOffset(-0.05);
5747  Ghf6->GetZaxis()->SetLabelSize(0.025);
5748 
5749  Ghf6->SetXTitle(" #eta \b");
5750  Ghf6->SetYTitle(" #phi \b");
5751  Ghf6->SetTitle(
5752  "<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);
5753  //gStyle->SetOptStat(kFALSE);
5754  Ghf6->SetStats(0);
5755  Ghf6->Draw("COLZ");
5756  //================
5757  cRBX31->cd(3);
5758  TH1F *Ghf7 = new TH1F("Ghf7", "", 120, 0.4, 1.6);
5759  // j - etaphi index:
5760  for (int j = 1; j <= ny; j++) {
5761  ccc0HF = Ghf1->GetBinContent(1, j);
5762  if (ccc0HF <= 0.)
5763  for (int i = 1; i <= nx; i++) {
5764  double ccc2 = Ghf1->GetBinContent(i, j);
5765  if (ccc2 > 0.) {
5766  ccc0HF = ccc2;
5767  break;
5768  }
5769  }
5770  if (ccc0HF > 0.) {
5771  // i - # LSs:
5772  for (int i = 1; i <= nx; i++) {
5773  double ccc1 = Ghf1->GetBinContent(i, j);
5774  if (ccc1 > 0.) {
5775  double Rij = ccc1 / ccc0HF;
5776  Ghf7->Fill(Rij);
5777  }
5778  }
5779  }
5780  }
5781  Ghf7->SetMarkerStyle(20);
5782  Ghf7->SetMarkerSize(0.4);
5783  Ghf7->GetYaxis()->SetLabelSize(0.04);
5784  Ghf7->SetMarkerColor(2);
5785  Ghf7->SetLineColor(0);
5786  Ghf7->SetYTitle(" N \b");
5787  Ghf7->SetXTitle(" Rij \b");
5788  Ghf7->SetTitle(" Rij \b");
5789  //Ghf7->SetMinimum(0.8);Ghf7->SetMaximum(500.);
5790  gPad->SetGridy();
5791  gPad->SetGridx(); // gPad->SetLogy();
5792  // Ghf7->SetStats(1110000);
5793  Ghf7->GetYaxis()->SetLabelSize(0.025);
5794  Ghf7->Draw("Error");
5795  Float_t ymaxHF = Ghf7->GetMaximum();
5796  cout << "22HF-3 ymaxHF= " << ymaxHF << " MAXdif3rmsHFMIN= " << MAXdif3rmsHFMIN
5797  << " MINdif3rmsHFMAX= " << MINdif3rmsHFMAX << endl;
5798  TLine *lineHF = new TLine(MAXdif3rmsHFMIN, 0., MAXdif3rmsHFMIN, ymaxHF);
5799  lineHF->SetLineColor(kBlue);
5800  lineHF->Draw();
5801  TLine *line1HF = new TLine(MINdif3rmsHFMAX, 0., MINdif3rmsHFMAX, ymaxHF);
5802  line1HF->SetLineColor(kBlue);
5803  line1HF->Draw();
5804  //================
5806  cRBX31->Update();
5807  cRBX31->Print("RBX-HF-3plots.png");
5808  cRBX31->Clear();
5809  // clean-up
5810  if (Ghf5)
5811  delete Ghf5;
5812  if (Ghf60)
5813  delete Ghf60;
5814  if (Ghf61)
5815  delete Ghf61;
5816  if (Ghf6)
5817  delete Ghf6;
5818  if (Ghf7)
5819  delete Ghf7;
5820 
5821  if (G20hf60)
5822  delete G20hf60;
5823  if (G20hf61)
5824  delete G20hf61;
5825  if (G30hf60)
5826  delete G30hf60;
5827  if (G30hf61)
5828  delete G30hf61;
5829  if (G40hf60)
5830  delete G40hf60;
5831  if (G40hf61)
5832  delete G40hf61;
5833 
5834  if (Ghf1)
5835  delete Ghf1;
5836  //========================================================================================== 22-1 HF:: Ratio plots jeta = 0 - 21 jphi =0 - 17
5837  //======================================================================
5838  //======================================================================28.11.2018
5839  //======================================================================
5840  //======================================================================
5841 
5842  gStyle->SetOptStat(1110000);
5843  cout << " RBX HF Ratio plotsmore *****" << endl;
5844  cRBX31->Clear();
5846  cRBX31->Divide(3, 1);
5847  //================
5848  cRBX31->cd(1);
5849  G20hf6->GetZaxis()->SetLabelSize(0.025);
5850  G20hf6->SetXTitle(" #eta \b");
5851  G20hf6->SetYTitle(" #phi \b");
5852  G20hf6->SetTitle("<Rj> for |1-<R>| > 0.20 \b");
5853  G20hf6->SetStats(0);
5854  G20hf6->Draw("COLZ");
5855  //================
5856  cRBX31->cd(2);
5857  G30hf6->GetZaxis()->SetLabelSize(0.025);
5858  G30hf6->SetXTitle(" #eta \b");
5859  G30hf6->SetYTitle(" #phi \b");
5860  G30hf6->SetTitle("<Rj> for |1-<R>| > 0.30 \b");
5861  G30hf6->SetStats(0);
5862  G30hf6->Draw("COLZ");
5863  //================
5864  cRBX31->cd(3);
5865  G40hf6->GetZaxis()->SetLabelSize(0.025);
5866  G40hf6->SetXTitle(" #eta \b");
5867  G40hf6->SetYTitle(" #phi \b");
5868  G40hf6->SetTitle("<Rj> for |1-<R>| > 0.40 \b");
5869  G40hf6->SetStats(0);
5870  G40hf6->Draw("COLZ");
5871  //================
5872 
5874  cRBX31->Update();
5875  cRBX31->Print("RBX-HF-3plotsmore.png");
5876  cRBX31->Clear();
5877 
5878  // clean-up
5879  if (G20hf6)
5880  delete G20hf6;
5881  if (G30hf6)
5882  delete G30hf6;
5883  if (G40hf6)
5884  delete G40hf6;
5885  gStyle->SetOptStat(0);
5887  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
5888  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
5889  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
5891 
5893 
5895  //=============================================================================== occupancyHB
5896  // For occupancy plots. Produces OccPlots_HBx.png (x=1)
5897  int mymaxbins = MaxLum;
5898  {
5899  cHB->Clear();
5900  cHB->Divide(2, 1);
5902  cHB->cd(1);
5903  TH2F *occhbm = (TH2F *)hfile->Get("h_RatioOccupancy_HBM");
5904  TH1F *uyhbm = new TH1F("uyhbm", "", mymaxbins, 1., mymaxbins + 1.);
5905  for (int i = 1; i <= occhbm->GetXaxis()->GetNbins(); i++) {
5906  double ccc1 = occhbm->GetBinContent(i);
5907  // if(ccc1>0.) cout<<" depth1_HB iLS = "<<i<<" <As> per LS= "<<ccc1<<endl;
5908  if (ccc1 > 0.)
5909  uyhbm->Fill(float(i), ccc1);
5910  }
5911  // gPad->SetLogy();
5912  uyhbm->SetMarkerStyle(20);
5913  uyhbm->SetMarkerSize(0.6);
5914  uyhbm->GetYaxis()->SetLabelSize(0.04);
5915  uyhbm->SetXTitle("min/av occupancy - HBM \b");
5916  uyhbm->SetMarkerColor(2);
5917  uyhbm->SetLineColor(0);
5918  uyhbm->SetMaximum(1.0);
5919  uyhbm->SetMinimum(0.2);
5920  gPad->SetGridy();
5921  uyhbm->Draw("Error");
5923  cHB->cd(2);
5924  TH2F *occhbp = (TH2F *)hfile->Get("h_RatioOccupancy_HBP");
5925  TH1F *uyhbp = new TH1F("uyhbp", "", mymaxbins, 1., mymaxbins + 1.);
5926  for (int i = 1; i <= occhbp->GetXaxis()->GetNbins(); i++) {
5927  double ccc1 = occhbp->GetBinContent(i);
5928  // if(ccc1>0.) cout<<" depth1_HB iLS = "<<i<<" <As> per LS= "<<ccc1<<endl;
5929  if (ccc1 > 0.)
5930  uyhbp->Fill(float(i), ccc1);
5931  }
5932  // gPad->SetLogy();
5933  uyhbp->SetMarkerStyle(20);
5934  uyhbp->SetMarkerSize(0.6);
5935  uyhbp->GetYaxis()->SetLabelSize(0.04);
5936  uyhbp->SetXTitle("min/av occupancy - HBP \b");
5937  uyhbp->SetMarkerColor(2);
5938  uyhbp->SetLineColor(0);
5939  uyhbp->SetMaximum(1.0);
5940  uyhbp->SetMinimum(0.2);
5941  gPad->SetGridy();
5942  uyhbp->Draw("Error");
5944 
5946  cHB->Update();
5947  cHB->Print(Form("OccPlots_HB.png"));
5948  cHB->Clear();
5949 
5950  // clean-up
5951  if (occhbm)
5952  delete occhbm;
5953  if (uyhbm)
5954  delete uyhbm;
5955  if (occhbp)
5956  delete occhbp;
5957  if (uyhbp)
5958  delete uyhbp;
5959  }
5960  //=============================================================================== occupancyHE
5961  // For occupancy plots. Produces OccPlots_HEx.png (x=1)
5962  {
5963  cHB->Clear();
5964  cHB->Divide(2, 1);
5966  cHB->cd(1);
5967  TH2F *occhem = (TH2F *)hfile->Get("h_RatioOccupancy_HEM");
5968  TH1F *uyhem = new TH1F("uyhem", "", mymaxbins, 1., mymaxbins + 1.);
5969  for (int i = 1; i <= occhem->GetXaxis()->GetNbins(); i++) {
5970  double ccc1 = occhem->GetBinContent(i);
5971  // if(ccc1>0.) cout<<" depth1_HE iLS = "<<i<<" <As> per LS= "<<ccc1<<endl;
5972  if (ccc1 > 0.)
5973  uyhem->Fill(float(i), ccc1);
5974  }
5975  // gPad->SetLogy();
5976  uyhem->SetMarkerStyle(20);
5977  uyhem->SetMarkerSize(0.6);
5978  uyhem->GetYaxis()->SetLabelSize(0.04);
5979  uyhem->SetXTitle("min/av occupancy - HEM \b");
5980  uyhem->SetMarkerColor(2);
5981  uyhem->SetLineColor(0);
5982  uyhem->SetMaximum(1.0);
5983  uyhem->SetMinimum(0.2);
5984  gPad->SetGridy();
5985  uyhem->Draw("Error");
5987  cHB->cd(2);
5988  TH2F *occhep = (TH2F *)hfile->Get("h_RatioOccupancy_HEP");
5989  TH1F *uyhep = new TH1F("uyhep", "", mymaxbins, 1., mymaxbins + 1.);
5990  for (int i = 1; i <= occhep->GetXaxis()->GetNbins(); i++) {
5991  double ccc1 = occhep->GetBinContent(i);
5992  // if(ccc1>0.) cout<<" depth1_HE iLS = "<<i<<" <As> per LS= "<<ccc1<<endl;
5993  if (ccc1 > 0.)
5994  uyhep->Fill(float(i), ccc1);
5995  }
5996  // gPad->SetLogy();
5997  uyhep->SetMarkerStyle(20);
5998  uyhep->SetMarkerSize(0.6);
5999  uyhep->GetYaxis()->SetLabelSize(0.04);
6000  uyhep->SetXTitle("min/av occupancy - HEP \b");
6001  uyhep->SetMarkerColor(2);
6002  uyhep->SetLineColor(0);
6003  uyhep->SetMaximum(1.0);
6004  uyhep->SetMinimum(0.2);
6005  gPad->SetGridy();
6006  uyhep->Draw("Error");
6008 
6010  cHB->Update();
6011  cHB->Print(Form("OccPlots_HE.png"));
6012  cHB->Clear();
6013 
6014  // clean-up
6015  if (occhem)
6016  delete occhem;
6017  if (uyhem)
6018  delete uyhem;
6019  if (occhep)
6020  delete occhep;
6021  if (uyhep)
6022  delete uyhep;
6023  }
6024  //=============================================================================== occupancyHO
6025  // For occupancy plots. Produces OccPlots_HOx.png (x=1)
6026  {
6027  cHB->Clear();
6028  cHB->Divide(2, 1);
6030  cHB->cd(1);
6031  TH2F *occhom = (TH2F *)hfile->Get("h_RatioOccupancy_HOM");
6032  TH1F *uyhom = new TH1F("uyhom", "", mymaxbins, 1., mymaxbins + 1.);
6033  for (int i = 1; i <= occhom->GetXaxis()->GetNbins(); i++) {
6034  double ccc1 = occhom->GetBinContent(i);
6035  // if(ccc1>0.) cout<<" depth1_HO iLS = "<<i<<" <As> per LS= "<<ccc1<<endl;
6036  if (ccc1 > 0.)
6037  uyhom->Fill(float(i), ccc1);
6038  }
6039  // gPad->SetLogy();
6040  uyhom->SetMarkerStyle(20);
6041  uyhom->SetMarkerSize(0.6);
6042  uyhom->GetYaxis()->SetLabelSize(0.04);
6043  uyhom->SetXTitle("min/av occupancy - HOM \b");
6044  uyhom->SetMarkerColor(2);
6045  uyhom->SetLineColor(0);
6046  uyhom->SetMaximum(1.0);
6047  uyhom->SetMinimum(0.2);
6048  gPad->SetGridy();
6049  uyhom->Draw("Error");
6051  cHB->cd(2);
6052  TH2F *occhop = (TH2F *)hfile->Get("h_RatioOccupancy_HOP");
6053  TH1F *uyhop = new TH1F("uyhop", "", mymaxbins, 1., mymaxbins + 1.);
6054  for (int i = 1; i <= occhop->GetXaxis()->GetNbins(); i++) {
6055  double ccc1 = occhop->GetBinContent(i);
6056  // if(ccc1>0.) cout<<" depth1_HO iLS = "<<i<<" <As> per LS= "<<ccc1<<endl;
6057  if (ccc1 > 0.)
6058  uyhop->Fill(float(i), ccc1);
6059  }
6060  // gPad->SetLogy();
6061  uyhop->SetMarkerStyle(20);
6062  uyhop->SetMarkerSize(0.6);
6063  uyhop->GetYaxis()->SetLabelSize(0.04);
6064  uyhop->SetXTitle("min/av occupancy - HOP \b");
6065  uyhop->SetMarkerColor(2);
6066  uyhop->SetLineColor(0);
6067  uyhop->SetMaximum(1.0);
6068  uyhop->SetMinimum(0.2);
6069  gPad->SetGridy();
6070  uyhop->Draw("Error");
6072 
6074  cHB->Update();
6075  cHB->Print(Form("OccPlots_HO.png"));
6076  cHB->Clear();
6077 
6078  // clean-up
6079  if (occhom)
6080  delete occhom;
6081  if (uyhom)
6082  delete uyhom;
6083  if (occhop)
6084  delete occhop;
6085  if (uyhop)
6086  delete uyhop;
6087  }
6088  //=============================================================================== occupancyHF
6089  // For occupancy plots. Produces OccPlots_HFx.png (x=1)
6090  {
6091  cHB->Clear();
6092  cHB->Divide(2, 1);
6094  cHB->cd(1);
6095  TH2F *occhfm = (TH2F *)hfile->Get("h_RatioOccupancy_HFM");
6096  TH1F *uyhfm = new TH1F("uyhfm", "", mymaxbins, 1., mymaxbins + 1.);
6097  for (int i = 1; i <= occhfm->GetXaxis()->GetNbins(); i++) {
6098  double ccc1 = occhfm->GetBinContent(i);
6099  // if(ccc1>0.) cout<<" depth1_HF iLS = "<<i<<" <As> per LS= "<<ccc1<<endl;
6100  if (ccc1 > 0.)
6101  uyhfm->Fill(float(i), ccc1);
6102  }
6103  // gPad->SetLogy();
6104  uyhfm->SetMarkerStyle(20);
6105  uyhfm->SetMarkerSize(0.6);
6106  uyhfm->GetYaxis()->SetLabelSize(0.04);
6107  uyhfm->SetXTitle("min/av occupancy - HFM \b");
6108  uyhfm->SetMarkerColor(2);
6109  uyhfm->SetLineColor(0);
6110  uyhfm->SetMaximum(1.0);
6111  uyhfm->SetMinimum(0.2);
6112  gPad->SetGridy();
6113  uyhfm->Draw("Error");
6115  cHB->cd(2);
6116  TH2F *occhfp = (TH2F *)hfile->Get("h_RatioOccupancy_HFP");
6117  TH1F *uyhfp = new TH1F("uyhfp", "", mymaxbins, 1., mymaxbins + 1.);
6118  for (int i = 1; i <= occhfp->GetXaxis()->GetNbins(); i++) {
6119  double ccc1 = occhfp->GetBinContent(i);
6120  // if(ccc1>0.) cout<<" depth1_HF iLS = "<<i<<" <As> per LS= "<<ccc1<<endl;
6121  if (ccc1 > 0.)
6122  uyhfp->Fill(float(i), ccc1);
6123  }
6124  // gPad->SetLogy();
6125  uyhfp->SetMarkerStyle(20);
6126  uyhfp->SetMarkerSize(0.6);
6127  uyhfp->GetYaxis()->SetLabelSize(0.04);
6128  uyhfp->SetXTitle("min/av occupancy - HFP \b");
6129  uyhfp->SetMarkerColor(2);
6130  uyhfp->SetLineColor(0);
6131  uyhfp->SetMaximum(1.0);
6132  uyhfp->SetMinimum(0.2);
6133  gPad->SetGridy();
6134  uyhfp->Draw("Error");
6136 
6138  cHB->Update();
6139  cHB->Print(Form("OccPlots_HF.png"));
6140  cHB->Clear();
6141 
6142  // clean-up
6143  if (occhfm)
6144  delete occhfm;
6145  if (uyhfm)
6146  delete uyhfm;
6147  if (occhfp)
6148  delete occhfp;
6149  if (uyhfp)
6150  delete uyhfp;
6151  }
6152  std::cout << "************>>> occupancy plots done" << std::endl;
6153 
6158  //************************* ***** Signal *****
6159  cout << ">>>>>>>>>>>>>>>>>>>>>>>>start Summed Amplitude Plots " << endl;
6160  int maxbins = MaxLum;
6161  cout << ">>>> maxbins = " << maxbins << endl;
6162  TH1F *SummedAmplitudeHisto[4]; // 1d histogramm for subdet
6163  SummedAmplitudeHisto[0] = (TH1F *)hfile->Get("h_averSIGNALsumamplitude_HB");
6164  SummedAmplitudeHisto[1] = (TH1F *)hfile->Get("h_averSIGNALsumamplitude_HE");
6165  SummedAmplitudeHisto[2] = (TH1F *)hfile->Get("h_averSIGNALsumamplitude_HO");
6166  SummedAmplitudeHisto[3] = (TH1F *)hfile->Get("h_averSIGNALsumamplitude_HF");
6167  TH1F *SummedAmplitudeOccupancyHisto[4]; // 1d histogramm for subdet
6168  SummedAmplitudeOccupancyHisto[0] = (TH1F *)hfile->Get("h_averSIGNALoccupancy_HB");
6169  SummedAmplitudeOccupancyHisto[1] = (TH1F *)hfile->Get("h_averSIGNALoccupancy_HE");
6170  SummedAmplitudeOccupancyHisto[2] = (TH1F *)hfile->Get("h_averSIGNALoccupancy_HO");
6171  SummedAmplitudeOccupancyHisto[3] = (TH1F *)hfile->Get("h_averSIGNALoccupancy_HF");
6172  for (int sub = 0; sub < 4; sub++) {
6173  cHE->Clear();
6174  cHE->Divide(2, 1);
6175  cHE->cd(1);
6176  TH1F *kslpq = new TH1F("kslpq", "", maxbins, 1., maxbins + 1.);
6177  // cout<<">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> sub = "<< sub <<endl;
6178  for (int i = 1; i <= kslpq->GetXaxis()->GetNbins(); i++) {
6179  double ccc1 = 0.;
6180  if (SummedAmplitudeHisto[sub])
6181  ccc1 = SummedAmplitudeHisto[sub]->GetBinContent(i);
6182  // if(ccc1>0.) cout<<" iLS = "<<i<<" LS= "<<ccc1<<endl;
6183  if (ccc1 > 0.)
6184  kslpq->Fill(float(i), ccc1);
6185  }
6186  // gPad->SetLogy();
6187  kslpq->SetMarkerStyle(20);
6188  kslpq->SetMarkerSize(0.8);
6189  kslpq->GetYaxis()->SetLabelSize(0.04);
6190  kslpq->SetXTitle("SumA of channels w/ signal per LS \b");
6191  kslpq->SetMarkerColor(2);
6192  kslpq->SetLineColor(0);
6193  // kslpq->SetMinimum(0.8);
6194  gPad->SetGridx();
6195  kslpq->Draw("Error");
6197  cHE->cd(2);
6198  TH1F *pqmks = new TH1F("pqmks", "", maxbins, 1., maxbins + 1.);
6199  for (int i = 1; i <= pqmks->GetXaxis()->GetNbins(); i++) {
6200  double ccc1 = 0.;
6201  if (SummedAmplitudeOccupancyHisto[sub])
6202  ccc1 = SummedAmplitudeOccupancyHisto[sub]->GetBinContent(i);
6203  // if(ccc1>0.) cout<<" iLS = "<<i<<" LS= "<<ccc1<<endl;
6204  if (ccc1 > 0.)
6205  pqmks->Fill(float(i), ccc1);
6206  }
6207  // gPad->SetLogy();
6208  pqmks->SetMarkerStyle(20);
6209  pqmks->SetMarkerSize(0.8);
6210  pqmks->GetYaxis()->SetLabelSize(0.04);
6211  pqmks->SetXTitle("Occupancy of channels w/ signal per LS \b");
6212  pqmks->SetMarkerColor(4);
6213  pqmks->SetLineColor(0);
6214  // pqmks->SetMinimum(0.8);
6215  gPad->SetGridx();
6216  pqmks->Draw("Error");
6217  cHE->Update();
6218  if (sub == 0)
6219  cHE->Print("SummedAmplitudesSignal_HB.png");
6220  if (sub == 1)
6221  cHE->Print("SummedAmplitudesSignal_HE.png");
6222  if (sub == 2)
6223  cHE->Print("SummedAmplitudesSignal_HO.png");
6224  if (sub == 3)
6225  cHE->Print("SummedAmplitudesSignal_HF.png");
6226  cHE->Clear();
6227  if (kslpq)
6228  delete kslpq;
6229  if (pqmks)
6230  delete pqmks;
6231  } //for
6232  // clean-up
6233  //for (unsigned int i=0; i<4; i++) {delete SummedAmplitudeHisto[i];delete SummedAmplitudeOccupancyHisto[i];}
6234 
6237  //************************* ***** NoSignal *****
6238  cout << ">>>>>>>>>>>>>>>>>>>>>>>>start Summed Amplitude Plots NoSignal " << endl;
6239  TH1F *NoSignalSummedAmplitudeHisto[4]; // 1d histogramm for subdet
6240  NoSignalSummedAmplitudeHisto[0] = (TH1F *)hfile->Get("h_averNOSIGNALsumamplitude_HB");
6241  NoSignalSummedAmplitudeHisto[1] = (TH1F *)hfile->Get("h_averNOSIGNALsumamplitude_HE");
6242  NoSignalSummedAmplitudeHisto[2] = (TH1F *)hfile->Get("h_averNOSIGNALsumamplitude_HO");
6243  NoSignalSummedAmplitudeHisto[3] = (TH1F *)hfile->Get("h_averNOSIGNALsumamplitude_HF");
6244  TH1F *NoSignalSummedAmplitudeOccupancyHisto[4]; // 1d histogramm for subdet
6245  NoSignalSummedAmplitudeOccupancyHisto[0] = (TH1F *)hfile->Get("h_averNOSIGNALoccupancy_HB");
6246  NoSignalSummedAmplitudeOccupancyHisto[1] = (TH1F *)hfile->Get("h_averNOSIGNALoccupancy_HE");
6247  NoSignalSummedAmplitudeOccupancyHisto[2] = (TH1F *)hfile->Get("h_averNOSIGNALoccupancy_HO");
6248  NoSignalSummedAmplitudeOccupancyHisto[3] = (TH1F *)hfile->Get("h_averNOSIGNALoccupancy_HF");
6249  for (int sub = 0; sub < 4; sub++) {
6250  cHE->Clear();
6251  cHE->Divide(2, 1);
6252 
6253  cHE->cd(1);
6254  TH1F *kslpq = new TH1F("kslpq", "", maxbins, 1., maxbins + 1.);
6255  for (int i = 1; i <= kslpq->GetXaxis()->GetNbins(); i++) {
6256  double ccc1 = 0.;
6257  if (NoSignalSummedAmplitudeHisto[sub])
6258  ccc1 = NoSignalSummedAmplitudeHisto[sub]->GetBinContent(i);
6259  // if(ccc1>0.) cout<<" iLS = "<<i<<" LS= "<<ccc1<<endl;
6260  if (ccc1 > 0.)
6261  kslpq->Fill(float(i), ccc1);
6262  }
6263  // gPad->SetLogy();
6264  kslpq->SetMarkerStyle(20);
6265  kslpq->SetMarkerSize(0.8);
6266  kslpq->GetYaxis()->SetLabelSize(0.04);
6267  kslpq->SetXTitle("SumA of channels w/o signal per LS \b");
6268  kslpq->SetMarkerColor(2);
6269  kslpq->SetLineColor(0);
6270  if (sub == 0) {
6271  kslpq->SetMaximum(20000.);
6272  kslpq->SetMinimum(5000.);
6273  } else if (sub == 1) {
6274  kslpq->SetMaximum(40000.);
6275  kslpq->SetMinimum(0.);
6276  } else if (sub == 2) {
6277  kslpq->SetMaximum(10000.);
6278  kslpq->SetMinimum(15000.);
6279  } else if (sub == 3) {
6280  kslpq->SetMaximum(100000.);
6281  kslpq->SetMinimum(0.);
6282  }
6283  gPad->SetGridx();
6284  kslpq->Draw("Error");
6286  cHE->cd(2);
6287  TH1F *pqmks = new TH1F("pqmks", "", maxbins, 1., maxbins + 1.);
6288  for (int i = 1; i <= pqmks->GetXaxis()->GetNbins(); i++) {
6289  double ccc1 = 0.;
6290  if (NoSignalSummedAmplitudeOccupancyHisto[sub])
6291  ccc1 = NoSignalSummedAmplitudeOccupancyHisto[sub]->GetBinContent(i);
6292  // if(ccc1>0.) cout<<" iLS = "<<i<<" LS= "<<ccc1<<endl;
6293  if (ccc1 > 0.)
6294  pqmks->Fill(float(i), ccc1);
6295  }
6296  // gPad->SetLogy();
6297  pqmks->SetMarkerStyle(20);
6298  pqmks->SetMarkerSize(0.8);
6299  pqmks->GetYaxis()->SetLabelSize(0.04);
6300  pqmks->SetXTitle("Occupancy of channels w/o signal per LS \b");
6301  pqmks->SetMarkerColor(4);
6302  pqmks->SetLineColor(0);
6303  if (sub == 0) {
6304  pqmks->SetMaximum(600.);
6305  pqmks->SetMinimum(200.);
6306  } else if (sub == 1) {
6307  pqmks->SetMaximum(910.);
6308  pqmks->SetMinimum(10.);
6309  } else if (sub == 2) {
6310  pqmks->SetMaximum(200.);
6311  pqmks->SetMinimum(50.);
6312  } else if (sub == 3) {
6313  pqmks->SetMaximum(866.);
6314  pqmks->SetMinimum(856.);
6315  }
6316  gPad->SetGridx();
6317  pqmks->Draw("Error");
6318  cHE->Update();
6319  if (sub == 0)
6320  cHE->Print("NoSignalSummedAmplitudes_HB.png");
6321  if (sub == 1)
6322  cHE->Print("NoSignalSummedAmplitudes_HE.png");
6323  if (sub == 2)
6324  cHE->Print("NoSignalSummedAmplitudes_HO.png");
6325  if (sub == 3)
6326  cHE->Print("NoSignalSummedAmplitudes_HF.png");
6327  cHE->Clear();
6328  if (kslpq)
6329  delete kslpq;
6330  if (pqmks)
6331  delete pqmks;
6332  } //for
6333  // clean-up
6334  //for (unsigned int i=0; i<4; i++) {delete NoSignalSummedAmplitudeHisto[i];delete NoSignalSummedAmplitudeOccupancyHisto[i];}
6336 
6339  //************************* ***** MaxxValues *****
6340  cout << ">>>>>>>>>>>>>>>>>>>>>>>>start Summed Amplitude Plots Maxx " << endl;
6341  TH1F *MaxxSummedAmplitudeHisto[4]; // 1d histogramm for subdet
6342  MaxxSummedAmplitudeHisto[0] = (TH1F *)hfile->Get("h_maxxSUMAmpl_HB");
6343  MaxxSummedAmplitudeHisto[1] = (TH1F *)hfile->Get("h_maxxSUMAmpl_HE");
6344  MaxxSummedAmplitudeHisto[2] = (TH1F *)hfile->Get("h_maxxSUMAmpl_HO");
6345  MaxxSummedAmplitudeHisto[3] = (TH1F *)hfile->Get("h_maxxSUMAmpl_HF");
6346  TH1F *MaxxSummedAmplitudeOccupancyHisto[4]; // 1d histogramm for subdet
6347  MaxxSummedAmplitudeOccupancyHisto[0] = (TH1F *)hfile->Get("h_maxxOCCUP_HB");
6348  MaxxSummedAmplitudeOccupancyHisto[1] = (TH1F *)hfile->Get("h_maxxOCCUP_HE");
6349  MaxxSummedAmplitudeOccupancyHisto[2] = (TH1F *)hfile->Get("h_maxxOCCUP_HO");
6350  MaxxSummedAmplitudeOccupancyHisto[3] = (TH1F *)hfile->Get("h_maxxOCCUP_HF");
6351  TH1F *SAmplitudeHisto[4]; // 1d histogramm for subdet
6352  SAmplitudeHisto[0] = (TH1F *)hfile->Get("h_eventamplitude_HB");
6353  SAmplitudeHisto[1] = (TH1F *)hfile->Get("h_eventamplitude_HE");
6354  SAmplitudeHisto[2] = (TH1F *)hfile->Get("h_eventamplitude_HO");
6355  SAmplitudeHisto[3] = (TH1F *)hfile->Get("h_eventamplitude_HF");
6356  TH1F *OccupancyHisto[4]; // 1d histogramm for subdet
6357  OccupancyHisto[0] = (TH1F *)hfile->Get("h_eventoccupancy_HB");
6358  OccupancyHisto[1] = (TH1F *)hfile->Get("h_eventoccupancy_HE");
6359  OccupancyHisto[2] = (TH1F *)hfile->Get("h_eventoccupancy_HO");
6360  OccupancyHisto[3] = (TH1F *)hfile->Get("h_eventoccupancy_HF");
6361 
6362  int countamplmaxHB = 0;
6363  int countamplmaxHE = 0;
6364  int countamplmaxHO = 0;
6365  int countamplmaxHF = 0;
6366  int countoccumaxHB = 0;
6367  int countoccumaxHE = 0;
6368  int countoccumaxHO = 0;
6369  int countoccumaxHF = 0;
6370  unsigned long int countamplHB = 0;
6371  unsigned long int countamplHE = 0;
6372  unsigned long int countamplHO = 0;
6373  unsigned long int countamplHF = 0;
6374  unsigned long int countoccuHB = 0;
6375  unsigned long int countoccuHE = 0;
6376  unsigned long int countoccuHO = 0;
6377  unsigned long int countoccuHF = 0;
6378  gStyle->SetOptStat(110000);
6379  for (int sub = 0; sub < 4; sub++) {
6380  cFour->Clear();
6381  cFour->Divide(2, 2);
6382 
6383  cFour->cd(1);
6384  TH1F *lpqxc = new TH1F("lpqxc", "", maxbins, 1., maxbins + 1.);
6385  for (int i = 1; i <= lpqxc->GetXaxis()->GetNbins(); i++) {
6386  double ccc1 = 0.;
6387  if (MaxxSummedAmplitudeHisto[sub])
6388  ccc1 = MaxxSummedAmplitudeHisto[sub]->GetBinContent(i);
6389  // if(ccc1>0.) cout<<"111111111111111111111111111 iLS = "<<i<<" LS= "<<ccc1<<endl;
6390  if (ccc1 > 0.)
6391  lpqxc->Fill(float(i), ccc1);
6392  if (sub == 0 && ccc1 > 60000.)
6393  countamplmaxHB++;
6394  if (sub == 1 && ccc1 > 60000.)
6395  countamplmaxHE++;
6396  if (sub == 2 && ccc1 > 150000.)
6397  countamplmaxHO++;
6398  if (sub == 3 && ccc1 > 22000.)
6399  countamplmaxHF++;
6400  }
6401  // gPad->SetLogy();
6402  lpqxc->SetMarkerStyle(20);
6403  lpqxc->SetMarkerSize(0.8);
6404  // lpqxc->GetYaxis()->SetLabelSize(0.08);
6405  if (sub == 0)
6406  lpqxc->SetXTitle("HB: max SA over LS-events per LS \b");
6407  if (sub == 1)
6408  lpqxc->SetXTitle("HE: max SA over LS-events per LS \b");
6409  if (sub == 2)
6410  lpqxc->SetXTitle("HO: max SA over LS-events per LS \b");
6411  if (sub == 3)
6412  lpqxc->SetXTitle("HF: max SA over LS-events per LS \b");
6413  lpqxc->SetMarkerColor(2);
6414  lpqxc->SetLineColor(0);
6415  gPad->SetGridx();
6416  lpqxc->Draw("Error");
6417 
6419  cFour->cd(2);
6420  TH1F *hpzlm = new TH1F("hpzlm", "", maxbins, 1., maxbins + 1.);
6421  for (int i = 1; i <= hpzlm->GetXaxis()->GetNbins(); i++) {
6422  double ccc1 = 0.;
6423  if (MaxxSummedAmplitudeOccupancyHisto[sub])
6424  ccc1 = MaxxSummedAmplitudeOccupancyHisto[sub]->GetBinContent(i);
6425  // if(ccc1>0.) cout<<"2222222222222222222222222 iLS = "<<i<<" LS= "<<ccc1<<endl;
6426  if (ccc1 > 0.)
6427  hpzlm->Fill(float(i), ccc1);
6428  if (sub == 0 && ccc1 > 2000.)
6429  countoccumaxHB++;
6430  if (sub == 1 && ccc1 > 1200.)
6431  countoccumaxHE++;
6432  if (sub == 2 && ccc1 > 2000.)
6433  countoccumaxHO++;
6434  if (sub == 3 && ccc1 > 860.)
6435  countoccumaxHF++;
6436  }
6437  // gPad->SetLogy();
6438  hpzlm->SetMarkerStyle(20);
6439  hpzlm->SetMarkerSize(0.8);
6440  // hpzlm->GetYaxis()->SetLabelSize(0.08);
6441  if (sub == 0)
6442  hpzlm->SetXTitle("HB: max Occupancy over LS-events per LS \b");
6443  if (sub == 1)
6444  hpzlm->SetXTitle("HE: max Occupancy over LS-events per LS \b");
6445  if (sub == 2)
6446  hpzlm->SetXTitle("HO: max Occupancy over LS-events per LS \b");
6447  if (sub == 3)
6448  hpzlm->SetXTitle("HF: max Occupancy over LS-events per LS \b");
6449  hpzlm->SetMarkerColor(4);
6450  hpzlm->SetLineColor(0);
6451  gPad->SetGridx();
6452  if (sub == 3) {
6453  hpzlm->SetMaximum(866.);
6454  hpzlm->SetMinimum(856.);
6455  }
6456  hpzlm->Draw("Error");
6457 
6459  cFour->cd(3);
6460  gPad->SetLogy();
6461  if (SAmplitudeHisto[sub]) {
6462  for (int i = 1; i <= SAmplitudeHisto[sub]->GetXaxis()->GetNbins(); i++) {
6463  // if(sub==0 && i * 800> 60000.) {
6464  // cout<<">=>=>>=> countamplHB= "<<countamplHB<<" content = "<<SAmplitudeHisto[sub]->GetBinContent(i)<<" sub= "<<sub<<" i= "<<i<< endl;
6465  // countamplHB+=SAmplitudeHisto[sub]->GetBinContent(i);
6466  // }
6467  if (sub == 0 && i * 800 > 60000.)
6468  countamplHB += SAmplitudeHisto[sub]->GetBinContent(i);
6469  if (sub == 1 && i * 1000 > 60000.)
6470  countamplHE += SAmplitudeHisto[sub]->GetBinContent(i);
6471  if (sub == 2 && i * 2500 > 150000.)
6472  countamplHO += SAmplitudeHisto[sub]->GetBinContent(i);
6473  if (sub == 3 && i * 1400 > 22000.)
6474  countamplHF += SAmplitudeHisto[sub]->GetBinContent(i);
6475  }
6476  SAmplitudeHisto[sub]->SetMarkerStyle(20);
6477  SAmplitudeHisto[sub]->SetMarkerSize(0.8);
6478  if (sub == 0)
6479  SAmplitudeHisto[sub]->SetTitle("HB event Amplitude\b");
6480  if (sub == 1)
6481  SAmplitudeHisto[sub]->SetTitle("HE event Amplitude\b");
6482  if (sub == 2)
6483  SAmplitudeHisto[sub]->SetTitle("HO event Amplitude\b");
6484  if (sub == 3)
6485  SAmplitudeHisto[sub]->SetTitle("HF event Amplitude\b");
6486  // SAmplitudeHisto[sub]->GetYaxis()->SetLabelSize(0.08);
6487  SAmplitudeHisto[sub]->SetXTitle("event amplitude \b");
6488  SAmplitudeHisto[sub]->SetMarkerColor(2);
6489  SAmplitudeHisto[sub]->SetLineColor(2);
6490  SAmplitudeHisto[sub]->Draw("");
6491  }
6493  cFour->cd(4);
6494  gPad->SetLogy();
6495  if (OccupancyHisto[sub]) {
6496  for (int i = 1; i <= OccupancyHisto[sub]->GetXaxis()->GetNbins(); i++) {
6497  if (sub == 0 && i * 30 > 2000.)
6498  countoccuHB += OccupancyHisto[sub]->GetBinContent(i);
6499  if (sub == 1 && i * 20 > 1200.)
6500  countoccuHE += OccupancyHisto[sub]->GetBinContent(i);
6501  if (sub == 2 && i * 25 > 2000.)
6502  countoccuHO += OccupancyHisto[sub]->GetBinContent(i);
6503  if (sub == 3 && i * 10 > 860.)
6504  countoccuHF += OccupancyHisto[sub]->GetBinContent(i);
6505  }
6506  OccupancyHisto[sub]->SetMarkerStyle(20);
6507  OccupancyHisto[sub]->SetMarkerSize(0.8);
6508  if (sub == 0)
6509  OccupancyHisto[sub]->SetTitle("HB event Occupancy\b");
6510  if (sub == 1)
6511  OccupancyHisto[sub]->SetTitle("HE event Occupancy\b");
6512  if (sub == 2)
6513  OccupancyHisto[sub]->SetTitle("HO event Occupancy\b");
6514  if (sub == 3)
6515  OccupancyHisto[sub]->SetTitle("HF event Occupancy\b");
6516  // OccupancyHisto[sub]->GetYaxis()->SetLabelSize(0.08);
6517  OccupancyHisto[sub]->SetXTitle("event occupancy \b");
6518  OccupancyHisto[sub]->SetMarkerColor(4);
6519  OccupancyHisto[sub]->SetLineColor(4);
6520  OccupancyHisto[sub]->Draw("");
6521  }
6522 
6523  cFour->Update();
6524  if (sub == 0)
6525  cFour->Print("MaxxSummedAmplitudes_HB.png");
6526  if (sub == 1)
6527  cFour->Print("MaxxSummedAmplitudes_HE.png");
6528  if (sub == 2)
6529  cFour->Print("MaxxSummedAmplitudes_HO.png");
6530  if (sub == 3)
6531  cFour->Print("MaxxSummedAmplitudes_HF.png");
6532  cFour->Clear();
6533  if (lpqxc)
6534  delete lpqxc;
6535  if (hpzlm)
6536  delete hpzlm;
6537  } //for
6538  gStyle->SetOptStat(0);
6540  cout << ">=>=>>=> countamplmaxHB= " << countamplmaxHB << " countamplmaxHE= " << countamplmaxHE
6541  << " countamplmaxHO= " << countamplmaxHO << " countamplmaxHF= " << countamplmaxHF << endl;
6542  cout << ">=>=>>=> countoccumaxHB= " << countoccumaxHB << " countoccumaxHE= " << countoccumaxHE
6543  << " countoccumaxHO= " << countoccumaxHO << " countoccumaxHF= " << countoccumaxHF << endl;
6544  cout << ">=>=>>=> countamplHB= " << countamplHB << " countamplHE= " << countamplHE << " countamplHO= " << countamplHO
6545  << " countamplHF= " << countamplHF << endl;
6546  cout << ">=>=>>=> countoccuHB= " << countoccuHB << " countoccuHE= " << countoccuHE << " countoccuHO= " << countoccuHO
6547  << " countoccuHF= " << countoccuHF << endl;
6548 
6551  //************************* ***** channelsummedA over depths *****
6552  cout << ">>>>>>>>>>>>>>>>>>>>>>>>channelsummedA over depths " << endl;
6553  TH1F *ChannelDepthsummedAmplitudesPlots[4]; // 1d histogramm for subdet
6554  ChannelDepthsummedAmplitudesPlots[0] = (TH1F *)hfile->Get("h_sumamplitudechannel_HB");
6555  ChannelDepthsummedAmplitudesPlots[1] = (TH1F *)hfile->Get("h_sumamplitudechannel_HE");
6556  ChannelDepthsummedAmplitudesPlots[2] = (TH1F *)hfile->Get("h_sumamplitudechannel_HO");
6557  ChannelDepthsummedAmplitudesPlots[3] = (TH1F *)hfile->Get("h_sumamplitudechannel_HF");
6558  TLine *litebdt[4];
6559  if (ChannelDepthsummedAmplitudesPlots[0])
6560  litebdt[0] = new TLine(80., 0.8, 80., ChannelDepthsummedAmplitudesPlots[0]->GetBinContent(4) + 100.);
6561  if (ChannelDepthsummedAmplitudesPlots[1])
6562  litebdt[1] = new TLine(200., 0.8, 200., ChannelDepthsummedAmplitudesPlots[1]->GetBinContent(7) + 100.);
6563  if (ChannelDepthsummedAmplitudesPlots[2])
6564  litebdt[2] = new TLine(1200., 0.8, 1200., ChannelDepthsummedAmplitudesPlots[2]->GetBinContent(17) + 100.);
6565  if (ChannelDepthsummedAmplitudesPlots[3])
6566  litebdt[3] = new TLine(600., 0.8, 600., ChannelDepthsummedAmplitudesPlots[3]->GetBinContent(6) + 100.);
6567 
6568  gStyle->SetOptStat(110000);
6569  cFour1->Clear();
6570  cFour1->Divide(2, 2);
6571  for (int sub = 0; sub < 4; sub++) {
6572  if (sub == 0)
6573  cFour1->cd(1);
6574  if (sub == 1)
6575  cFour1->cd(2);
6576  if (sub == 2)
6577  cFour1->cd(3);
6578  if (sub == 3)
6579  cFour1->cd(4);
6580  gPad->SetLogy();
6581  ChannelDepthsummedAmplitudesPlots[sub]->SetMarkerStyle(20);
6582  ChannelDepthsummedAmplitudesPlots[sub]->SetMarkerSize(0.8);
6583  if (sub == 0)
6584  ChannelDepthsummedAmplitudesPlots[sub]->SetTitle("HB channel Amplitudes\b");
6585  if (sub == 1)
6586  ChannelDepthsummedAmplitudesPlots[sub]->SetTitle("HE channel Amplitudes\b");
6587  if (sub == 2)
6588  ChannelDepthsummedAmplitudesPlots[sub]->SetTitle("HO channel Amplitudes\b");
6589  if (sub == 3)
6590  ChannelDepthsummedAmplitudesPlots[sub]->SetTitle("HF channel Amplitudes\b");
6591  if (sub == 0)
6592  ChannelDepthsummedAmplitudesPlots[sub]->SetXTitle("HB channel depths summed Amplitudes \b");
6593  if (sub == 1)
6594  ChannelDepthsummedAmplitudesPlots[sub]->SetXTitle("HE channel depths summed Amplitudes \b");
6595  if (sub == 2)
6596  ChannelDepthsummedAmplitudesPlots[sub]->SetXTitle("HO channel depths summed Amplitudes \b");
6597  if (sub == 3)
6598  ChannelDepthsummedAmplitudesPlots[sub]->SetXTitle("HF channel depths summed Amplitudes \b");
6599  ChannelDepthsummedAmplitudesPlots[sub]->SetMarkerColor(2);
6600  ChannelDepthsummedAmplitudesPlots[sub]->SetLineColor(2);
6601  ChannelDepthsummedAmplitudesPlots[sub]->Draw("");
6602  litebdt[sub]->SetLineColor(kBlue);
6603  litebdt[sub]->Draw("s");
6604  } //for
6605  cFour1->Update();
6606  cFour1->Print("ChannelDepthsummedAmplitudes.png");
6607  cFour1->Clear();
6608  gStyle->SetOptStat(0);
6609 
6612  //************************* ***** Ataildepth1_HB *****
6613  cout << ">>>>>>>>>>>>>>>>>>>>>>>>2DAtaildepth " << endl;
6615  cHB->Clear();
6616  cHB->Divide(2, 1);
6617 
6618  TH2F *DAtaildepth1[2]; // 1d histogramm for subdet
6619  DAtaildepth1[0] = (TH2F *)hfile->Get("h_2DAtaildepth1_HB");
6620  DAtaildepth1[1] = (TH2F *)hfile->Get("h_2D0Ataildepth1_HB");
6621  cHB->cd(1);
6622  if (!DAtaildepth1[0] || !DAtaildepth1[1]) {
6623  cout << ">>>>>>>>>>>>>>>>>>>>>>>>Ataildepth1_HB EMPTY histoes for 2DAtaildepth 1" << endl;
6624  } else {
6625  TH2F *tail1 = (TH2F *)DAtaildepth1[0]->Clone("tail1");
6626  tail1->Divide(DAtaildepth1[0], DAtaildepth1[1], 1, 1, "B");
6627  // tail1->Sumw2();
6628  gPad->SetGridy();
6629  gPad->SetGridx();
6630  gPad->SetLogz();
6631  tail1->SetMarkerStyle(20);
6632  tail1->SetMarkerSize(0.4);
6633  tail1->SetTitle("Amplitudes for tail-events (HBdepth1) \b");
6634  tail1->SetXTitle("#eta \b");
6635  tail1->SetYTitle("#phi \b");
6636  tail1->SetZTitle("2D <A> in the tail - HB Depth1 \b");
6637  tail1->SetMarkerColor(2);
6638  tail1->SetLineColor(2);
6639  tail1->Draw("COLZ");
6640  }
6641  TH2F *DAtaildepth2[2]; // 1d histogramm for subdet
6642  DAtaildepth2[0] = (TH2F *)hfile->Get("h_2DAtaildepth2_HB");
6643  DAtaildepth2[1] = (TH2F *)hfile->Get("h_2D0Ataildepth2_HB");
6644  cHB->cd(2);
6645  if (!DAtaildepth2[0] || !DAtaildepth2[1]) {
6646  cout << ">>>>>>>>>>>>>>>>>>>>>>>>Ataildepth1_HB EMPTY histoes for 2DAtaildepth 2" << endl;
6647  } else {
6648  TH2F *tail2 = (TH2F *)DAtaildepth2[0]->Clone("tail2");
6649  tail2->Divide(DAtaildepth2[0], DAtaildepth2[1], 1, 1, "B");
6650  // tail2->Sumw2();
6651  gPad->SetGridy();
6652  gPad->SetGridx();
6653  gPad->SetLogz();
6654  tail2->SetMarkerStyle(20);
6655  tail2->SetMarkerSize(0.4);
6656  tail2->SetTitle("Amplitudes for tail-events (HBdepth2) \b");
6657  tail2->SetXTitle("#eta \b");
6658  tail2->SetYTitle("#phi \b");
6659  tail2->SetZTitle("2D <A> in the tail - HB Depth2 \b");
6660  tail2->SetMarkerColor(2);
6661  tail2->SetLineColor(2);
6662  tail2->Draw("COLZ");
6663  }
6664 
6665  cHB->Update();
6666  cHB->Print("AtaildepthHB.png");
6667  cHB->Clear();
6668 
6671  //************************* ***** sum(Signal+NoSignal) occupancy for HF *****
6672  cout << ">>>>>>>>>>>>>>>>>>>>>>>>sumOccupancyHF " << endl;
6674  cHB->Clear();
6675  cHB->Divide(1, 1);
6676  cHB->cd(1);
6677  if (SummedAmplitudeOccupancyHisto[3]) {
6678  TH1F *ufrew1 = (TH1F *)SummedAmplitudeOccupancyHisto[3]->Clone("ufrew1");
6679  if (SummedAmplitudeOccupancyHisto[3] && NoSignalSummedAmplitudeOccupancyHisto[3])
6680  ufrew1->Add(SummedAmplitudeOccupancyHisto[3], NoSignalSummedAmplitudeOccupancyHisto[3], 1, 1);
6681  ufrew1->GetXaxis()->SetRangeUser(1., maxbins + 1.);
6682  gPad->SetGridx();
6683  ufrew1->SetMarkerStyle(20);
6684  ufrew1->SetMarkerSize(0.8);
6685  ufrew1->GetYaxis()->SetLabelSize(0.04);
6686  ufrew1->SetTitle("HF Occupancy vs LS\b");
6687  ufrew1->SetXTitle("average occupancy per LS HF\b");
6688  ufrew1->SetMarkerColor(4);
6689  ufrew1->SetLineColor(0);
6690  ufrew1->SetMaximum(866.);
6691  ufrew1->SetMinimum(856.);
6692  ufrew1->Draw("Error");
6693  cHB->Update();
6694  cHB->Print("sumOccupancyHF.png");
6695  cHB->Clear();
6696  if (ufrew1)
6697  delete ufrew1;
6698  }
6699 
6707  //====================================================================================================================
6708  cout << ">>>>>>>>>>>>>>>>>>>>>>>> =====================================================================" << endl;
6709 
6710  //=====================================================================================================
6711  cout << ">>>>>>>>>>>>>>>>>>>>>>>> ==================================================" << endl;
6712 
6713  //=====================================================================================
6714  cout << ">>>>>>>>>>>>>>>>>>>>>>>> =================================" << endl;
6715  cout << ">>>>>>>>>>>>>>>>>>>>>>>> =================================" << endl;
6716  cout << ">>>>>>>>>>>>>>>>>>>>>>>> =================================" << endl;
6717  cout << ">>>>>>>>>>>>>>>>>>>>>>>> =================================" << endl;
6718 
6719  cout << ">>>>>>> START NOW CREATING OF HTML PAGES <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << endl;
6720  //======================================================================
6721  // Creating each test kind for each subdet html pages:
6722  std::string raw_class;
6723  int ind = 0;
6724  ofstream htmlFile;
6725  for (int test = 0; test <= 5; test++) { //Test: 0,
6726  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
6727 
6728  // cout<<"Creating each test kind for each subdet html pages: test= "<< test << " sub= " << sub << endl;
6729  if (test == 0) {
6730  if (sub == 1) {
6731  htmlFile.open("HB_CapID.html");
6732  }
6733  if (sub == 2) {
6734  htmlFile.open("HE_CapID.html");
6735  }
6736  if (sub == 3) {
6737  htmlFile.open("HO_CapID.html");
6738  }
6739  if (sub == 4) {
6740  htmlFile.open("HF_CapID.html");
6741  }
6742  }
6743  if (test == 1) {
6744  if (sub == 1) {
6745  htmlFile.open("HB_ADCampl.html");
6746  }
6747  if (sub == 2) {
6748  htmlFile.open("HE_ADCampl.html");
6749  }
6750  if (sub == 3) {
6751  htmlFile.open("HO_ADCampl.html");
6752  }
6753  if (sub == 4) {
6754  htmlFile.open("HF_ADCampl.html");
6755  }
6756  }
6757  if (test == 2) {
6758  if (sub == 1) {
6759  htmlFile.open("HB_Width.html");
6760  }
6761  if (sub == 2) {
6762  htmlFile.open("HE_Width.html");
6763  }
6764  if (sub == 3) {
6765  htmlFile.open("HO_Width.html");
6766  }
6767  if (sub == 4) {
6768  htmlFile.open("HF_Width.html");
6769  }
6770  }
6771  if (test == 3) {
6772  if (sub == 1) {
6773  htmlFile.open("HB_Ratio.html");
6774  }
6775  if (sub == 2) {
6776  htmlFile.open("HE_Ratio.html");
6777  }
6778  if (sub == 3) {
6779  htmlFile.open("HO_Ratio.html");
6780  }
6781  if (sub == 4) {
6782  htmlFile.open("HF_Ratio.html");
6783  }
6784  }
6785  if (test == 4) {
6786  if (sub == 1) {
6787  htmlFile.open("HB_Tmean.html");
6788  }
6789  if (sub == 2) {
6790  htmlFile.open("HE_Tmean.html");
6791  }
6792  if (sub == 3) {
6793  htmlFile.open("HO_Tmean.html");
6794  }
6795  if (sub == 4) {
6796  htmlFile.open("HF_Tmean.html");
6797  }
6798  }
6799  if (test == 5) {
6800  if (sub == 1) {
6801  htmlFile.open("HB_Tmax.html");
6802  }
6803  if (sub == 2) {
6804  htmlFile.open("HE_Tmax.html");
6805  }
6806  if (sub == 3) {
6807  htmlFile.open("HO_Tmax.html");
6808  }
6809  if (sub == 4) {
6810  htmlFile.open("HF_Tmax.html");
6811  }
6812  }
6813 
6814  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
6815  htmlFile << "<head>" << std::endl;
6816  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
6817  htmlFile << "<title> Certification Monitoring Tool </title>" << std::endl;
6818  htmlFile << "<style type=\"text/css\">" << std::endl;
6819  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
6820  << std::endl;
6821  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
6822  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
6823  "text-align: center;}"
6824  << std::endl;
6825  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
6826  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
6827  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
6828  htmlFile << " td.s5 { font-family: arial, arial ce, helvetica; background-color: #00FF00; }" << std::endl;
6829  htmlFile << " td.s6 { font-family: arial, arial ce, helvetica; background-color: #FF0000; }" << std::endl;
6830  htmlFile << "</style>" << std::endl;
6831  htmlFile << "<body>" << std::endl;
6832 
6833  if (test == 0) {
6834  if (sub == 1)
6835  htmlFile << "<h1> Cap ID estimator for HB, RUN = " << runnumber << " </h1>" << std::endl;
6836  if (sub == 2)
6837  htmlFile << "<h1> Cap ID estimator for HE, RUN = " << runnumber << " </h1>" << std::endl;
6838  if (sub == 3)
6839  htmlFile << "<h1> Cap ID estimator for HO, RUN = " << runnumber << " </h1>" << std::endl;
6840  if (sub == 4)
6841  htmlFile << "<h1> Cap ID estimator for HF, RUN = " << runnumber << " </h1>" << std::endl;
6842  }
6843  if (test == 1) {
6844  if (sub == 1)
6845  htmlFile << "<h1> Mean ADC Amplitude estimator for HB, RUN = " << runnumber << " </h1>" << std::endl;
6846  if (sub == 2)
6847  htmlFile << "<h1> Mean ADC Amplitude estimator for HE, RUN = " << runnumber << " </h1>" << std::endl;
6848  if (sub == 3)
6849  htmlFile << "<h1> Mean ADC Amplitude estimator for HO, RUN = " << runnumber << " </h1>" << std::endl;
6850  if (sub == 4)
6851  htmlFile << "<h1> Mean ADC Amplitude estimator for HF, RUN = " << runnumber << " </h1>" << std::endl;
6852  }
6853  if (test == 2) {
6854  if (sub == 1)
6855  htmlFile << "<h1> Width estimator for HB, RUN = " << runnumber << " </h1>" << std::endl;
6856  if (sub == 2)
6857  htmlFile << "<h1> Width estimator for HE, RUN = " << runnumber << " </h1>" << std::endl;
6858  if (sub == 3)
6859  htmlFile << "<h1> Width estimator for HO, RUN = " << runnumber << " </h1>" << std::endl;
6860  if (sub == 4)
6861  htmlFile << "<h1> Width estimator for HF, RUN = " << runnumber << " </h1>" << std::endl;
6862  }
6863  if (test == 3) {
6864  if (sub == 1)
6865  htmlFile << "<h1> Ratio estimator for HB, RUN = " << runnumber << " </h1>" << std::endl;
6866  if (sub == 2)
6867  htmlFile << "<h1> Ratio estimator for HE, RUN = " << runnumber << " </h1>" << std::endl;
6868  if (sub == 3)
6869  htmlFile << "<h1> Ratio estimator for HO, RUN = " << runnumber << " </h1>" << std::endl;
6870  if (sub == 4)
6871  htmlFile << "<h1> Ratio estimator for HF, RUN = " << runnumber << " </h1>" << std::endl;
6872  }
6873  if (test == 4) {
6874  if (sub == 1)
6875  htmlFile << "<h1> Mean bin timing estimator for HB, RUN = " << runnumber << " </h1>" << std::endl;
6876  if (sub == 2)
6877  htmlFile << "<h1> Mean bin timing estimator for HE, RUN = " << runnumber << " </h1>" << std::endl;
6878  if (sub == 3)
6879  htmlFile << "<h1> Mean bin timing estimator for HO, RUN = " << runnumber << " </h1>" << std::endl;
6880  if (sub == 4)
6881  htmlFile << "<h1> Mean bin timing estimator for HF, RUN = " << runnumber << " </h1>" << std::endl;
6882  }
6883  if (test == 5) {
6884  if (sub == 1)
6885  htmlFile << "<h1> Maximum bin timing estimator for HB, RUN = " << runnumber << " </h1>" << std::endl;
6886  if (sub == 2)
6887  htmlFile << "<h1> Maximum bin timing estimator for HE, RUN = " << runnumber << " </h1>" << std::endl;
6888  if (sub == 3)
6889  htmlFile << "<h1> Maximum bin timing estimator for HO, RUN = " << runnumber << " </h1>" << std::endl;
6890  if (sub == 4)
6891  htmlFile << "<h1> Maximum bin timing estimator for HF, RUN = " << runnumber << " </h1>" << std::endl;
6892  }
6893 
6894  if (test == 1) {
6895  htmlFile << "<a name=\"Top\"></a>\n";
6896  htmlFile << "<b>Contents:<br>\n";
6897  htmlFile << "1. <a href=\"#Aij\">A_ij_LS (averaged over events in LS) </a><br>\n";
6898  htmlFile << "2. <a href=\"#OverflowAij\">A_ij_LS in overflow & underflow</a><br>\n";
6899  htmlFile << "3. <a href=\"#MainEstimator\">Main Estimator !!! </a><br>\n";
6900  htmlFile << "4. <a href=\"#ErrorA\">Error type A </a><br>\n";
6901  htmlFile << "5. <a href=\"#ErrorAaverage\">ErrorA cross check</a><br>\n";
6902  htmlFile << "6. <a href=\"#ErrorAoccupancy\">ErrorA occupancy plots</a><br>\n";
6903  htmlFile << "7. <a href=\"#ErrorB\">Error type B</a><br>\n";
6904  htmlFile << "8. <a href=\"#LSstatus\">Table of Average channel-Amplitude in Depthes over LSs </a><br>\n";
6905  htmlFile << "9. <a href=\"#RBXstatus\">RBX Status </a><br>\n";
6906  htmlFile << "10. <a href=\"#RBXPHItable\">Table of Average RBX-Amplitude in Phi over LSs </a><br>\n";
6907  htmlFile << "11. <a href=\"#RBXETAtable\">Table of Average RBX-Amplitude in Eta over LSs </a><br>\n";
6908  htmlFile << "12. <a href=\"#RBX3plots\">RBX A-Ratio to 1st LS: 3 plots </a><br>\n";
6910  }
6911 
6912  // htmlFile << "<a href=\"#Top\">to top</a><br>\n";
6913 
6914  htmlFile << "<br>" << std::endl;
6915  if (test == 0) {
6916  htmlFile << "<h2> 0. Rate of CapID failures over all events of Run </h2>" << std::endl;
6917  htmlFile << "<h3> Channel legend: green - good, other colour - suspicious </h3>" << std::endl;
6918  if (sub == 1)
6919  htmlFile << " <img src=\"MapCapIdErrorHB.png\" />" << std::endl;
6920  if (sub == 2)
6921  htmlFile << " <img src=\"MapCapIdErrorHE.png\" />" << std::endl;
6922  if (sub == 3)
6923  htmlFile << " <img src=\"MapCapIdErrorHO.png\" />" << std::endl;
6924  if (sub == 4)
6925  htmlFile << " <img src=\"MapCapIdErrorHF.png\" />" << std::endl;
6926  }
6927  if (test == 1)
6928  htmlFile << "<a name=\"Aij\"></a>\n";
6929  if (test != 0)
6930  htmlFile << "<h2> 1. Distribution of estimator averaged over events in LS, histogramed over all channels and "
6931  "all LSs </h2>"
6932  << std::endl;
6933  if (test == 0) {
6934  if (sub == 1)
6935  htmlFile << "<h2> 1. Average Nbcs for only LS containing events with abnormal number of Bad channels >"
6936  << CutAb[sub][1] << " (Depth1), " << CutAb[sub][2] << " (Depth2).</h2>" << std::endl;
6937  if (sub == 2)
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), " << CutAb[sub][3]
6940  << " (Depth3).</h2>" << std::endl;
6941  if (sub == 3)
6942  htmlFile << "<h2> 1. Average Nbcs for only LS containing events with abnormal number of Bad channels >"
6943  << CutAb[sub][1] << " (Depth4).</h2>" << std::endl;
6944  if (sub == 4)
6945  htmlFile << "<h2> 1. Average Nbcs for only LS containing events with abnormal number of Bad channels >"
6946  << CutAb[sub][1] << " (Depth1), " << CutAb[sub][2] << " (Depth2).</h2>" << std::endl;
6947  }
6948 
6949  if (test != 0)
6950  htmlFile << "<h3> see Overflow and Underflow </h3>" << std::endl;
6951  if (test == 0)
6952  htmlFile << "<h3> Legend: dots correspond to BAD LS candidates.</h3>" << std::endl;
6953 
6954  if (test == 0) {
6955  if (sub == 1)
6956  htmlFile << " <img src=\"Hist_CAPID_Abnorm_HB.png\" />" << std::endl;
6957  if (sub == 2)
6958  htmlFile << " <img src=\"Hist_CAPID_Abnorm_HE.png\" />" << std::endl;
6959  if (sub == 3)
6960  htmlFile << " <img src=\"Hist_CAPID_Abnorm_HO.png\" />" << std::endl;
6961  if (sub == 4)
6962  htmlFile << " <img src=\"Hist_CAPID_Abnorm_HF.png\" />" << std::endl;
6963  }
6964  if (test == 1) {
6965  if (sub == 1)
6966  htmlFile << " <img src=\"H_ADCamplHB.png\" />" << std::endl;
6967  if (sub == 2)
6968  htmlFile << " <img src=\"H_ADCamplHE.png\" />" << std::endl;
6969  if (sub == 3)
6970  htmlFile << " <img src=\"H_ADCamplHO.png\" />" << std::endl;
6971  if (sub == 4)
6972  htmlFile << " <img src=\"H_ADCamplHF.png\" />" << std::endl;
6973  }
6974  if (test == 2) {
6975  if (sub == 1)
6976  htmlFile << " <img src=\"H_WidthHB.png\" />" << std::endl;
6977  if (sub == 2)
6978  htmlFile << " <img src=\"H_WidthHE.png\" />" << std::endl;
6979  if (sub == 3)
6980  htmlFile << " <img src=\"H_WidthHO.png\" />" << std::endl;
6981  if (sub == 4)
6982  htmlFile << " <img src=\"H_WidthHF.png\" />" << std::endl;
6983  }
6984  if (test == 3) {
6985  if (sub == 1)
6986  htmlFile << " <img src=\"H_RatioHB.png\" />" << std::endl;
6987  if (sub == 2)
6988  htmlFile << " <img src=\"H_RatioHE.png\" />" << std::endl;
6989  if (sub == 3)
6990  htmlFile << " <img src=\"H_RatioHO.png\" />" << std::endl;
6991  if (sub == 4)
6992  htmlFile << " <img src=\"H_RatioHF.png\" />" << std::endl;
6993  }
6994  if (test == 4) {
6995  if (sub == 1)
6996  htmlFile << " <img src=\"H_TmeanHB.png\" />" << std::endl;
6997  if (sub == 2)
6998  htmlFile << " <img src=\"H_TmeanHE.png\" />" << std::endl;
6999  if (sub == 3)
7000  htmlFile << " <img src=\"H_TmeanHO.png\" />" << std::endl;
7001  if (sub == 4)
7002  htmlFile << " <img src=\"H_TmeanHF.png\" />" << std::endl;
7003  }
7004  if (test == 5) {
7005  if (sub == 1)
7006  htmlFile << " <img src=\"H_TmaxHB.png\" />" << std::endl;
7007  if (sub == 2)
7008  htmlFile << " <img src=\"H_TmaxHE.png\" />" << std::endl;
7009  if (sub == 3)
7010  htmlFile << " <img src=\"H_TmaxHO.png\" />" << std::endl;
7011  if (sub == 4)
7012  htmlFile << " <img src=\"H_TmaxHF.png\" />" << std::endl;
7013  }
7014  htmlFile << "<br>" << std::endl;
7015  if (test == 1)
7016  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7017 
7018  if (test == 0)
7019  htmlFile << "<h2> 2a. Number of bad channels per event distribution in Run</h2>" << std::endl;
7020  if (test == 0)
7021  htmlFile << "<h3> Legends: dots correspond to BAD LS candidates. </h3>" << std::endl;
7022  if (test == 0) {
7023  if (sub == 1)
7024  htmlFile << " <img src=\"HistNBadChsHB.png\" />" << std::endl;
7025  if (sub == 2)
7026  htmlFile << " <img src=\"HistNBadChsHE.png\" />" << std::endl;
7027  if (sub == 3)
7028  htmlFile << " <img src=\"HistNBadChsHO.png\" />" << std::endl;
7029  if (sub == 4)
7030  htmlFile << " <img src=\"HistNBadChsHF.png\" />" << std::endl;
7031  }
7032 
7033  if (test == 1)
7034  htmlFile << "<a name=\"OverflowAij\"></a>\n";
7035  if (test != 0)
7036  htmlFile << "<h2> 2. Estimator averaged over all events in the RUN for entries in overflow and underflow of "
7037  "corresponding histogram above </h2>"
7038  << std::endl;
7039  // if (test !=0) htmlFile << "<h2> 2. Estimator averaged over all events in the RUN </h2>"<< std::endl;
7040  if (test == 0)
7041  htmlFile << "<h2> 2b. Averaged number of bad channels for each LS </h2>" << std::endl;
7042  // if (test !=0) htmlFile << "<h3> Channel legend: white - good, other colour - bad. </h3>"<< std::endl;
7043  if (test == 0) {
7044  if (sub == 1)
7045  htmlFile << "<h3> Legends: dots selected with following cuts: <td class=\"s6\" align=\"center\">"
7046  << Cut0[test][sub][1] << " (Depth1), " << Cut0[test][sub][2]
7047  << " (Depth2) correspond BAD LS.</td></h3>" << std::endl;
7048  if (sub == 2)
7049  htmlFile << "<h3> Legends: dots selected with following cuts: " << Cut0[test][sub][1] << " (Depth1), "
7050  << Cut0[test][sub][2] << " (Depth2), " << Cut0[test][sub][3] << " (Depth3) correspond BAD LS.</h3>"
7051  << std::endl;
7052  if (sub == 3)
7053  htmlFile << "<h3> Legends: dots selected with following cuts: " << Cut0[test][sub][4]
7054  << " (Depth4) correspond BAD LS.</h3>" << std::endl;
7055  if (sub == 4)
7056  htmlFile << "<h3> Legends: dots selected with following cuts: " << Cut0[test][sub][1] << " (Depth1), "
7057  << Cut0[test][sub][2] << " (Depth2) correspond BAD LS.</h3>" << std::endl;
7058  }
7059  if (test == 0) {
7060  if (sub == 1)
7061  htmlFile << " <img src=\"HistNBCMNHB.png\" />" << std::endl;
7062  if (sub == 2)
7063  htmlFile << " <img src=\"HistNBCMNHE.png\" />" << std::endl;
7064  if (sub == 3)
7065  htmlFile << " <img src=\"HistNBCMNHO.png\" />" << std::endl;
7066  if (sub == 4)
7067  htmlFile << " <img src=\"HistNBCMNHF.png\" />" << std::endl;
7068  }
7069  if (test == 1) {
7070  if (sub == 1)
7071  htmlFile << " <img src=\"MapADCamplHB.png\" />" << std::endl;
7072  if (sub == 2)
7073  htmlFile << " <img src=\"MapADCamplHE.png\" />" << std::endl;
7074  if (sub == 3)
7075  htmlFile << " <img src=\"MapADCamplHO.png\" />" << std::endl;
7076  if (sub == 4)
7077  htmlFile << " <img src=\"MapADCamplHF.png\" />" << std::endl;
7078  }
7079  if (test == 2) {
7080  if (sub == 1)
7081  htmlFile << " <img src=\"MapWidthHB.png\" />" << std::endl;
7082  if (sub == 2)
7083  htmlFile << " <img src=\"MapWidthHE.png\" />" << std::endl;
7084  if (sub == 3)
7085  htmlFile << " <img src=\"MapWidthHO.png\" />" << std::endl;
7086  if (sub == 4)
7087  htmlFile << " <img src=\"MapWidthHF.png\" />" << std::endl;
7088  }
7089  if (test == 3) {
7090  if (sub == 1)
7091  htmlFile << " <img src=\"MapRatioHB.png\" />" << std::endl;
7092  if (sub == 2)
7093  htmlFile << " <img src=\"MapRatioHE.png\" />" << std::endl;
7094  if (sub == 3)
7095  htmlFile << " <img src=\"MapRatioHO.png\" />" << std::endl;
7096  if (sub == 4)
7097  htmlFile << " <img src=\"MapRatioHF.png\" />" << std::endl;
7098  }
7099  if (test == 4) {
7100  if (sub == 1)
7101  htmlFile << " <img src=\"MapTmeanHB.png\" />" << std::endl;
7102  if (sub == 2)
7103  htmlFile << " <img src=\"MapTmeanHE.png\" />" << std::endl;
7104  if (sub == 3)
7105  htmlFile << " <img src=\"MapTmeanHO.png\" />" << std::endl;
7106  if (sub == 4)
7107  htmlFile << " <img src=\"MapTmeanHF.png\" />" << std::endl;
7108  }
7109  if (test == 5) {
7110  if (sub == 1)
7111  htmlFile << " <img src=\"MapTmaxHB.png\" />" << std::endl;
7112  if (sub == 2)
7113  htmlFile << " <img src=\"MapTmaxHE.png\" />" << std::endl;
7114  if (sub == 3)
7115  htmlFile << " <img src=\"MapTmaxHO.png\" />" << std::endl;
7116  if (sub == 4)
7117  htmlFile << " <img src=\"MapTmaxHF.png\" />" << std::endl;
7118  }
7119  htmlFile << "<br>" << std::endl;
7120  if (test == 1)
7121  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7122 
7123  if (test == 1)
7124  htmlFile << "<a name=\"MainEstimator\"></a>\n";
7125  if (test != 0)
7126  htmlFile
7127  << "<h2> 3. Distribution of estimator averaged over events in LS and over all channels for each LS </h2>"
7128  << std::endl;
7129  if (test == 0) {
7130  if (sub == 1)
7131  htmlFile << "<h2> 3. Portion of events with Nbcs>" << CutPo[sub][1] << " (Depth1), " << CutPo[sub][2]
7132  << " (Depth2) in each LS.</h2>" << std::endl;
7133  if (sub == 2)
7134  htmlFile << "<h2> 3. Portion of events with Nbcs>" << CutPo[sub][1] << " (Depth1), " << CutPo[sub][2]
7135  << " (Depth2), " << CutPo[sub][3] << " (Depth3) in each LS.</h2>" << std::endl;
7136  if (sub == 3)
7137  htmlFile << "<h2> 3. Portion of events with Nbcs>" << CutPo[sub][4] << " (Depth4) in each LS.</h2>"
7138  << std::endl;
7139  if (sub == 4)
7140  htmlFile << "<h2> 3. Portion of events with Nbcs>" << CutPo[sub][1] << " (Depth1), " << CutPo[sub][2]
7141  << " (Depth2) in each LS.</h2>" << std::endl;
7142  htmlFile << "<h3> Legend: dots correspond to BAD LS candidates.</h3>" << std::endl;
7143  }
7144  if (test != 0) {
7145  if (sub == 1)
7146  htmlFile << "<h3> Legends: dots selected with following cuts: <td class=\"s6\" align=\"center\">"
7147  << Cut0[test][sub][1] << " (Depth1), " << Cut0[test][sub][2]
7148  << " (Depth2) correspond BAD LS.</td></h3>" << std::endl;
7149  if (sub == 2)
7150  htmlFile << "<h3> Legends: dots selected with following cuts: " << Cut0[test][sub][1] << " (Depth1), "
7151  << Cut0[test][sub][2] << " (Depth2), " << Cut0[test][sub][3] << " (Depth3), " << Cut0[test][sub][4]
7152  << " (Depth4), " << Cut0[test][sub][5] << " (Depth5), " << Cut0[test][sub][6] << " (Depth6), "
7153  << Cut0[test][sub][7] << " (Depth7) correspond BAD LS. </h3>" << std::endl;
7154  if (sub == 3)
7155  htmlFile << "<h3> Legends: dots selected with following cuts: " << Cut0[test][sub][4]
7156  << " (Depth4) correspond BAD LS. </h3>" << std::endl;
7157  if (sub == 4)
7158  htmlFile << "<h3> Legends: dots selected with following cuts: " << Cut0[test][sub][1] << " (Depth1), "
7159  << Cut0[test][sub][2] << " (Depth2), " << Cut0[test][sub][3] << " (Depth3), " << Cut0[test][sub][4]
7160  << " (Depth4) correspond BAD LS. </h3>" << std::endl;
7161  }
7162  if (test == 0) {
7163  if (sub == 1)
7164  htmlFile << " <img src=\"HistPortHB.png\" />" << std::endl;
7165  if (sub == 2)
7166  htmlFile << " <img src=\"HistPortHE.png\" />" << std::endl;
7167  if (sub == 3)
7168  htmlFile << " <img src=\"HistPortHO.png\" />" << std::endl;
7169  if (sub == 4)
7170  htmlFile << " <img src=\"HistPortHF.png\" />" << std::endl;
7171  }
7172  if (test == 1) {
7173  if (sub == 1)
7174  htmlFile << " <img src=\"HistADCamplHB.png\" />" << std::endl;
7175  if (sub == 2)
7176  htmlFile << " <img src=\"HistADCamplHE.png\" />" << std::endl;
7177  if (sub == 3)
7178  htmlFile << " <img src=\"HistADCamplHO.png\" />" << std::endl;
7179  if (sub == 4)
7180  htmlFile << " <img src=\"HistADCamplHF.png\" />" << std::endl;
7181  }
7182  if (test == 2) {
7183  if (sub == 1)
7184  htmlFile << " <img src=\"HistWidthHB.png\" />" << std::endl;
7185  if (sub == 2)
7186  htmlFile << " <img src=\"HistWidthHE.png\" />" << std::endl;
7187  if (sub == 3)
7188  htmlFile << " <img src=\"HistWidthHO.png\" />" << std::endl;
7189  if (sub == 4)
7190  htmlFile << " <img src=\"HistWidthHF.png\" />" << std::endl;
7191  }
7192  if (test == 3) {
7193  if (sub == 1)
7194  htmlFile << " <img src=\"HistRatioHB.png\" />" << std::endl;
7195  if (sub == 2)
7196  htmlFile << " <img src=\"HistRatioHE.png\" />" << std::endl;
7197  if (sub == 3)
7198  htmlFile << " <img src=\"HistRatioHO.png\" />" << std::endl;
7199  if (sub == 4)
7200  htmlFile << " <img src=\"HistRatioHF.png\" />" << std::endl;
7201  }
7202  if (test == 4) {
7203  if (sub == 1)
7204  htmlFile << " <img src=\"HistTmeanHB.png\" />" << std::endl;
7205  if (sub == 2)
7206  htmlFile << " <img src=\"HistTmeanHE.png\" />" << std::endl;
7207  if (sub == 3)
7208  htmlFile << " <img src=\"HistTmeanHO.png\" />" << std::endl;
7209  if (sub == 4)
7210  htmlFile << " <img src=\"HistTmeanHF.png\" />" << std::endl;
7211  }
7212  if (test == 5) {
7213  if (sub == 1)
7214  htmlFile << " <img src=\"HistTmaxHB.png\" />" << std::endl;
7215  if (sub == 2)
7216  htmlFile << " <img src=\"HistTmaxHE.png\" />" << std::endl;
7217  if (sub == 3)
7218  htmlFile << " <img src=\"HistTmaxHO.png\" />" << std::endl;
7219  if (sub == 4)
7220  htmlFile << " <img src=\"HistTmaxHF.png\" />" << std::endl;
7221  }
7222  htmlFile << "<br>" << std::endl;
7223 
7224  if (test == 1) {
7225  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7226  htmlFile << "<a name=\"ErrorA\"></a>\n";
7227  htmlFile << "<h2> 4. Error type A</h2>\n";
7228  htmlFile << "<h3> note: no sence to see plots of this item if max difference is too large(due to very high A "
7229  "of some channels)</h3>\n";
7230  htmlFile << "<br>\n";
7231 
7232  //HB:
7233  if (sub == 1) {
7234  htmlFile << "<h3>Mean of max difference between dependencies to be within: 0.1-1.6 (p-p collisions) </h3>\n";
7235  htmlFile << " <img src=\"HistErrA_HB.png\" />\n";
7236  htmlFile << "<br>\n";
7237  if (flagErrAB_HB[0] == -1)
7238  htmlFile << "<h3>test was not possible</h3>\n";
7239  else if (flagErrAB_HB[0] == 0)
7240  htmlFile << "<h3> Fine:NoErrorA_HB (Mean of max difference " << avedelta_HB
7241  << " is within 0.1-1.6) </h3>\n";
7242  else if (flagErrAB_HB[0] == 1)
7243  htmlFile << "<<h3> ErrorA_HB is available once Mean of max difference " << avedelta_HB
7244  << " is out 0.1-1.6 (p-p collisions)</font></h3>\n";
7245  else
7246  htmlFile << "<h3>auto-interpretation is not available</h3>\n";
7247  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7248 
7249  htmlFile << "<a name=\"ErrorAaverage\"></a>\n";
7250 
7251  htmlFile << "<h2> 5. Error type A cross check: see 2D pattern of channels </h2>\n";
7252  htmlFile << "<h2> 1) with average channel Amplitudes(No cut), 2) with average channel Amplitudes(<A> >25), "
7253  "3) with channel Amplitude (A<35); </h2>\n";
7254  htmlFile << " <img src=\"ChkErrA_HB1.png\" /><br><br>\n";
7255  htmlFile << " <img src=\"ChkErrA_HB2.png\" /><br>\n";
7256  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7257 
7258  htmlFile << "<a name=\"ErrorAoccupancy\"></a>\n";
7259  htmlFile << "<h2> 6. Error type A: min/ave ratio for occupancy distributions with Amplitude bigger 25 "
7260  "(HBM:neg.eta;HBP:pos.eta) </h2>\n";
7261  htmlFile << "<h2> FOR CROSS-CHECK OLNY !!!</h2>\n";
7262  htmlFile << "<h2> TO IDENTIFY A-type errors: for most of LSs the ratio to be lower 0.6 at least for HF- or "
7263  "HF+ </h2>\n";
7264  htmlFile << "<h2> For runs without A-type errors: for most of LSs the ratio is higher 0.6 and is the same "
7265  "for HF- and HF+ </h2>\n";
7266  htmlFile << " <img src=\"OccPlots_HB.png\" /><br><br>\n";
7267  htmlFile << "<br>\n";
7268  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7269 
7270  htmlFile << "<a name=\"ErrorB\"></a>\n";
7271  htmlFile << "<h2> 7. Error type B\n";
7272  htmlFile << "<h3> ErrorB identification: digi-collection size != 10.</h3>\n";
7273  htmlFile << " <img src=\"HistErrB_HB_1.png\" />\n<br>\n";
7274  htmlFile << " <img src=\"HistErrB_HB_2.png\" />\n<br>\n";
7275  htmlFile << "<br>\n";
7276  htmlFile << "<h3> if Error type B is available, it start from: " << LSofFirstErrB_HB << " LS </h3>\n";
7277  htmlFile << "<br>\n";
7278  }
7279 
7280  //HE:
7281  if (sub == 2) {
7282  htmlFile << "<h3>Mean of max difference between dependencies to be within: 0.2-1.8 (p-p collisions) </h3>\n";
7283  htmlFile << " <img src=\"HistErrA_HE.png\" />\n";
7284  htmlFile << "<br>\n";
7285  if (flagErrAB_HE[0] == -1)
7286  htmlFile << "<h3>test was not possible</h3>\n";
7287  else if (flagErrAB_HE[0] == 0)
7288  htmlFile << "<h3> Fine:NoErrorA_HE (Mean of max difference " << avedelta_HE
7289  << " is within 0.2-1.8) </h3>\n";
7290  else if (flagErrAB_HE[0] == 1)
7291  htmlFile << "<<h3> ErrorA_HE is available once Mean of max difference " << avedelta_HE
7292  << " is out 0.2-1.8 (p-p collisions)</font></h3>\n";
7293  else
7294  htmlFile << "<h3>auto-interpretation is not available</h3>\n";
7295  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7296 
7297  htmlFile << "<a name=\"ErrorAaverage\"></a>\n";
7298 
7299  htmlFile << "<h2> 5. Error type A cross check: see 2D pattern of channels </h2>\n";
7300  htmlFile << "<h2> 1) with average channel Amplitudes(No cut), 2) with average channel Amplitudes(<A> "
7301  ">1000.fC), 3) with channel Amplitude (A<500fC); </h2>\n";
7302  htmlFile << " <img src=\"ChkErrA_HE1.png\" /><br><br>\n";
7303  htmlFile << " <img src=\"ChkErrA_HE2.png\" /><br>\n";
7304  htmlFile << " <img src=\"ChkErrA_HE3.png\" /><br>\n";
7305  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7306 
7307  htmlFile << "<a name=\"ErrorAoccupancy\"></a>\n";
7308  htmlFile << "<h2> 6. Error type A: min/ave ratio for occupancy distributions with Amplitude bigger 35 "
7309  "(HEM:neg.eta;HEP:pos.eta) </h2>\n";
7310  htmlFile << "<h2> FOR CROSS-CHECK OLNY !!!</h2>\n";
7311  htmlFile << "<h2> TO IDENTIFY A-type errors: for most of LSs the ratio to be lower 0.3 at least for HF- or "
7312  "HF+ </h2>\n";
7313  htmlFile << "<h2> For runs without A-type errors: for most of LSs the ratio is higher 0.3 and is the same "
7314  "for HF- and HF+ </h2>\n";
7315  htmlFile << " <img src=\"OccPlots_HE.png\" /><br><br>\n";
7316  htmlFile << "<br>\n";
7317  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7318 
7319  htmlFile << "<a name=\"ErrorB\"></a>\n";
7320  htmlFile << "<h2> 7. Error type B\n";
7321  htmlFile << "<h3> ErrorB identification: digi-collection size != 8.</h3>\n";
7322  htmlFile << " <img src=\"HistErrB_HE_1.png\" />\n<br>\n";
7323  htmlFile << " <img src=\"HistErrB_HE_2.png\" />\n<br>\n";
7324  htmlFile << " <img src=\"HistErrB_HE_3.png\" />\n<br>\n";
7325  htmlFile << "<br>\n";
7326  htmlFile << "<h3> if Error type B is available, it start from: " << LSofFirstErrB_HE << " LS </h3>\n";
7327  htmlFile << "<br>\n";
7328  }
7329 
7330  //HO:
7331  if (sub == 3) {
7332  htmlFile << "<h3>Mean of max difference between dependencies to be within: 0.1-1.5 (p-p collisions) </h3>\n";
7333  htmlFile << " <img src=\"HistErrA_HO.png\" />\n";
7334  htmlFile << "<br>\n";
7335  if (flagErrAB_HO[0] == -1)
7336  htmlFile << "<h3>test was not possible</h3>\n";
7337  else if (flagErrAB_HO[0] == 0)
7338  htmlFile << "<h3> Fine:NoErrorA_HO (Mean of max difference " << avedelta_HO
7339  << " is within 0.1-1.5) </h3>\n";
7340  else if (flagErrAB_HO[0] == 1)
7341  htmlFile << "<<h3> ErrorA_HO is available once Mean of max difference " << avedelta_HO
7342  << " is out 0.1-1.5 (p-p collisions)</font></h3>\n";
7343  else
7344  htmlFile << "<h3>auto-interpretation is not available</h3>\n";
7345  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7346 
7347  htmlFile << "<a name=\"ErrorAaverage\"></a>\n";
7348 
7349  htmlFile << "<h2> 5. Error type A cross check: see 2D pattern of channels </h2>\n";
7350  htmlFile << "<h2> 1) with average channel Amplitudes(No cut), 2) with average channel Amplitudes(<A> >80), "
7351  "3) with channel Amplitude (A<100); </h2>\n";
7352  // htmlFile << "<h2> 2D. Cross check for error A</h2>\n";
7353  htmlFile << " <img src=\"ChkErrA_HO4.png\" /><br><br>\n";
7354  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7355 
7356  htmlFile << "<a name=\"ErrorAoccupancy\"></a>\n";
7357  htmlFile << "<h2> 6. Error type A: min/ave ratio for occupancy distributions with Amplitude bigger 80 "
7358  "(HOM:neg.eta;HOP:pos.eta) </h2>\n";
7359  htmlFile << "<h2> FOR CROSS-CHECK OLNY !!!</h2>\n";
7360  htmlFile << "<h2> TO IDENTIFY A-type errors: for most of LSs the ratio to be lower 0.8 at least for HF- or "
7361  "HF+ </h2>\n";
7362  htmlFile << "<h2> For runs without A-type errors: for most of LSs the ratio is higher 0.8 and is the same "
7363  "for HF- and HF+ </h2>\n";
7364  htmlFile << " <img src=\"OccPlots_HO.png\" /><br><br>\n";
7365  htmlFile << "<br>\n";
7366  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7367 
7368  htmlFile << "<a name=\"ErrorB\"></a>\n";
7369  htmlFile << "<h2> 7. Error type B\n";
7370  htmlFile << "<h3> ErrorB identification: digi-collection size != 10. </h3>\n";
7371  htmlFile << " <img src=\"HistErrB_HO_4.png\" />\n<br>\n";
7372  htmlFile << "<br>\n";
7373  htmlFile << "<h3> if Error type B is available, it start from: " << LSofFirstErrB_HO << " LS </h3>\n";
7374  htmlFile << "<br>\n";
7375  }
7376 
7377  //HF:
7378  if (sub == 4) {
7379  // flagSpecHF+=1;
7380  htmlFile << "<h3>Mean of max difference between dependencies to be within: 0.8-2.4 (p-p collisions) </h3>\n";
7381  htmlFile << " <img src=\"HistErrA_HF.png\" />\n";
7382  htmlFile << "<br>\n";
7383  if (flagErrAB_HF[0] == -1)
7384  htmlFile << "<h3>test was not possible</h3>\n";
7385  else if (flagErrAB_HF[0] == 0)
7386  htmlFile << "<h3> Fine:NoErrorA_HF (Mean of max difference " << avedelta_HF
7387  << " is within 0.8-2.4) </h3>\n";
7388  else if (flagErrAB_HF[0] == 1)
7389  htmlFile << "<<h3> ErrorA_HF is available once Mean of max difference " << avedelta_HF
7390  << " is out 0.8-2.4 (p-p collisions)</font></h3>\n";
7391  else
7392  htmlFile << "<h3>auto-interpretation is not available</h3>\n";
7393  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7394 
7395  htmlFile << "<a name=\"ErrorAaverage\"></a>\n";
7396 
7397  htmlFile << "<h2> 5. Error type A cross check: see 2D pattern of channels </h2>\n";
7398  htmlFile << "<h2> 1) with average channel Amplitudes(No cut), 2) with average channel Amplitudes(<A> >20), "
7399  "3) with channel Amplitude (A<20); </h2>\n";
7400  // htmlFile << "<h2> 2D. Cross check for error A</h2>\n";
7401  htmlFile << " <img src=\"ChkErrA_HF1.png\" /><br><br>\n";
7402  htmlFile << " <img src=\"ChkErrA_HF2.png\" /><br>\n";
7403  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7404 
7405  htmlFile << "<a name=\"ErrorAoccupancy\"></a>\n";
7406  htmlFile << "<h2> 6. Error type A: min/ave ratio for occupancy distributions with Amplitude bigger 20 "
7407  "(HFM:neg.eta;HFP:pos.eta) </h2>\n";
7408  htmlFile << "<h2> FOR CROSS-CHECK OLNY !!!</h2>\n";
7409  htmlFile << "<h2> TO IDENTIFY A-type errors: for most of LSs the ratio to be lower 0.8 at least for HF- or "
7410  "HF+ </h2>\n";
7411  htmlFile << "<h2> For runs without A-type errors: for most of LSs the ratio is higher 0.8 and is the same "
7412  "for HF- and HF+ </h2>\n";
7413  htmlFile << " <img src=\"OccPlots_HF.png\" /><br><br>\n";
7414  htmlFile << "<br>\n";
7415  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7416 
7417  htmlFile << "<a name=\"ErrorB\"></a>\n";
7418  htmlFile << "<h2> 7. Error type B\n";
7419  htmlFile << "<h3> ErrorB identification: digi-collection size != 4. </h3>\n";
7420  htmlFile << " <img src=\"HistErrB_HF_1.png\" />\n<br>\n";
7421  htmlFile << " <img src=\"HistErrB_HF_2.png\" />\n<br>\n";
7422  htmlFile << "<br>\n";
7423  htmlFile << "<h3> if Error type B is available, it start from: " << LSofFirstErrB_HF << " LS </h3>\n";
7424  htmlFile << "<br>\n";
7425  }
7426  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7427 
7428  } //test=1 Amplitude
7429 
7430  if (test == 1)
7431  htmlFile << "<a name=\"LSstatus\"></a>\n";
7432  // Continue with common sections
7433  if (sub == 1) {
7434  htmlFile << "<h2> 8.Lumisection Status for HB: </h2>" << std::endl;
7435  // 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;
7436  htmlFile << "<h3> Legends: Red boxes correspond BAD LS selected with following cuts: " << Cut0[test][sub][1]
7437  << " (Depth1), " << Cut0[test][sub][2] << " (Depth2), " << Cut0[test][sub][3] << " (Depth3), "
7438  << Cut0[test][sub][4] << " (Depth4), </h3>" << std::endl;
7439  }
7440  if (sub == 2) {
7441  htmlFile << "<h2> 8.Lumisection Status for HE: </h2>" << std::endl;
7442  htmlFile << "<h3> Legends: Red boxes correspond BAD LS selected with following cuts: " << Cut0[test][sub][1]
7443  << " (Depth1), " << Cut0[test][sub][2] << " (Depth2), " << Cut0[test][sub][3] << " (Depth3),"
7444  << Cut0[test][sub][4] << " (Depth4)," << Cut0[test][sub][5] << " (Depth5)," << Cut0[test][sub][6]
7445  << " (Depth6)," << Cut0[test][sub][7] << " (Depth7). </h3>" << std::endl;
7446  }
7447  if (sub == 3) {
7448  // htmlFile << Form("<h2> %d.Lumisection Status for HO </h2>",4+flagSpecHF)<< std::endl;
7449  htmlFile << "<h2> 8.Lumisection Status for HO: </h2>" << std::endl;
7450  htmlFile << "<h3> Legends: Red boxes correspond BAD LS selected with following cuts: " << Cut0[test][sub][4]
7451  << " (Depth4). </h3>" << std::endl;
7452  }
7453  if (sub == 4) {
7454  htmlFile << "<h2> 8.Lumisection Status for HF: </h2>" << std::endl;
7455  htmlFile << "<h3> Legends: Red boxes correspond BAD LS selected with following cuts: " << Cut0[test][sub][1]
7456  << " (Depth1), " << Cut0[test][sub][2] << " (Depth2), " << Cut0[test][sub][3] << " (Depth3), "
7457  << Cut0[test][sub][4] << " (Depth4), </h3>" << std::endl;
7458  }
7459  htmlFile << "<br>" << std::endl;
7460  htmlFile << "<table>" << std::endl;
7461  htmlFile << "<tr>";
7462  htmlFile << "<td class=\"s4\" align=\"center\">LS</td>" << std::endl;
7463  // htmlFile << "<td class=\"s1\" align=\"center\">LS</td>" << std::endl;
7464  htmlFile << "<td class=\"s1\" align=\"center\">Number of events</td>" << std::endl;
7466 
7467  int kkkkkkmax = k_max[sub];
7468  if ((sub == 4 || sub == 2 || sub == 1) && test == 1)
7469  kkkkkkmax = k_maxupgrade[sub];
7470  // if ( (sub==4 || sub==2) && test==1) kkkkkkmax = k_maxupgrade[sub];
7471  // if (test==1 && sub==4) kkkkkkmax = k_maxupgrade[sub];
7472 
7473  if (test == 0)
7474  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
7475  htmlFile << "<td class=\"s1\" align=\"center\">< Nbcs > Depth " << k << " </td>" << std::endl;
7476  if (test == 1)
7477  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
7478  htmlFile << "<td class=\"s1\" align=\"center\">< A > Depth " << k << " </td>" << std::endl;
7479  if (test == 2)
7480  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
7481  htmlFile << "<td class=\"s1\" align=\"center\">< W > Depth " << k << " </td>" << std::endl;
7482  if (test == 3)
7483  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
7484  htmlFile << "<td class=\"s1\" align=\"center\">< R > Depth " << k << " </td>" << std::endl;
7485  if (test == 4)
7486  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
7487  htmlFile << "<td class=\"s1\" align=\"center\">< TSn > Depth " << k << " </td>" << std::endl;
7488  if (test == 5)
7489  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
7490  htmlFile << "<td class=\"s1\" align=\"center\">< TSx > Depth " << k << " </td>" << std::endl;
7491  htmlFile << "</tr>" << std::endl;
7492 
7493  ind = 0;
7494  for (int i = 1; i <= MaxLum; i++) {
7495  if ((ind % 2) == 1)
7496  raw_class = "<td class=\"s2\" align=\"center\">";
7497  else
7498  raw_class = "<td class=\"s3\" align=\"center\">";
7499  htmlFile << "<tr>" << std::endl;
7500  htmlFile << "<td class=\"s4\" align=\"center\">" << i << "</td>" << std::endl;
7501  // htmlFile << raw_class<< LumLum->GetBinContent(i)<<"</td>"<< std::endl;
7502  htmlFile << raw_class << LumiEv->GetBinContent(i) << "</td>" << std::endl;
7503  for (int k = k_min[sub]; k <= kkkkkkmax; k++) {
7504  if (HistNumBadChanDepth[test][sub][k]->GetBinContent(i) > Cut0[test][sub][k]) {
7505  if (test == 1)
7506  htmlFile << "<td class=\"s6\" align=\"center\">"
7507  << int(HistNumBadChanDepth[test][sub][k]->GetBinContent(i)) << "</td>" << std::endl;
7508  else
7509  htmlFile << "<td class=\"s6\" align=\"center\">" << (HistNumBadChanDepth[test][sub][k]->GetBinContent(i))
7510  << "</td>" << std::endl;
7511  } else {
7512  if (test == 1)
7513  htmlFile << raw_class << int(HistNumBadChanDepth[test][sub][k]->GetBinContent(i)) << "</td>" << std::endl;
7514  else
7515  htmlFile << raw_class << (HistNumBadChanDepth[test][sub][k]->GetBinContent(i)) << "</td>" << std::endl;
7516  }
7517  }
7518  htmlFile << "</tr>" << std::endl;
7519  ind += 1;
7520  }
7521  htmlFile << "</table>" << std::endl;
7522 
7523  htmlFile << "<br>" << std::endl;
7524  if (test == 1)
7525  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7526  htmlFile << "<br>" << std::endl;
7527 
7528  // Only for Amplitudes (test=1):
7530  if (test == 1) {
7533  htmlFile << "<a name=\"RBXstatus\"></a>\n";
7534 
7535  //HB j = 7,8,9,10 11,12,13,14
7536  if (sub == 1) {
7537  htmlFile << "<h2> 9. Average Amplitudes of RBX for HB: </h2>" << std::endl;
7538  htmlFile << "<h3> where </h3>" << std::endl;
7539  htmlFile << "<h3> jeta = 7,8,9,10 (Negative direction); ............&& ............ jeta = 11,12,13,14 "
7540  "(Positive direction); </h3>"
7541  << std::endl;
7542  htmlFile << "<h3> jphi = 0, 1,..... 16, 17 </h3>" << std::endl;
7543  // 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;
7544  htmlFile << " <img src=\"RBX-HB-2Dplot.png\" />\n";
7545  htmlFile << "<br>\n";
7546 
7547  htmlFile << "<h2> Average Amplitudes of RBX-PHI for HB: </h2>" << std::endl;
7548  htmlFile << " <img src=\"RBX-HB-1Dplot.png\" />\n";
7549  htmlFile << "<br>\n";
7550 
7551  htmlFile << "<h2> Average Amplitudes of RBX-ETA for HB: </h2>" << std::endl;
7552  htmlFile << " <img src=\"RBX-HB-11Dplot.png\" />\n";
7553  htmlFile << "<br>\n";
7554 
7555  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7556  }
7557  // HE: j = 3,4,5, 6, 7 14,15,16,17,18
7558  if (sub == 2) {
7559  htmlFile << "<h2> 9. Averaged Amplitudes of RBX for HE: </h2>" << std::endl;
7560  htmlFile << "<h3> where </h3>" << std::endl;
7561  htmlFile << "<h3> jeta = 3,4,5, 6, 7 (Negative direction); ............&& ............ jeta = "
7562  "14,15,16,17,18 (Positive direction); </h3>"
7563  << std::endl;
7564  htmlFile << "<h3> jphi = 0, 1,..... 16, 17 </h3>" << std::endl;
7565  // 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;
7566  htmlFile << " <img src=\"RBX-HE-2Dplot.png\" />\n";
7567  htmlFile << "<br>\n";
7568 
7569  htmlFile << "<h2> Average Amplitudes of RBX-PHI for HE: </h2>" << std::endl;
7570  htmlFile << " <img src=\"RBX-HE-1Dplot.png\" />\n";
7571  htmlFile << "<br>\n";
7572 
7573  htmlFile << "<h2> Average Amplitudes of RBX-ETA for HE: </h2>" << std::endl;
7574  htmlFile << " <img src=\"RBX-HE-11Dplot.png\" />\n";
7575  htmlFile << "<br>\n";
7576 
7577  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7578  }
7579  // HO: j = 7,8,9,10 11,12,13,14
7580  if (sub == 3) {
7581  htmlFile << "<h2> 9. Averaged Amplitudes of RBX for HO: </h2>" << std::endl;
7582  htmlFile << "<h3> where </h3>" << std::endl;
7583  htmlFile << "<h3> jeta = 7,8,9,10 (Negative direction); ............&& ............ jeta = 11,12,13,14 "
7584  "(Positive direction); </h3>"
7585  << std::endl;
7586  htmlFile << "<h3> jphi = 0, 1,..... 16, 17 </h3>" << std::endl;
7587  // 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;
7588  htmlFile << " <img src=\"RBX-HO-2Dplot.png\" />\n";
7589  htmlFile << "<br>\n";
7590 
7591  htmlFile << "<h2> Average Amplitudes of RBX-PHI for HO: </h2>" << std::endl;
7592  htmlFile << " <img src=\"RBX-HO-1Dplot.png\" />\n";
7593  htmlFile << "<br>\n";
7594 
7595  htmlFile << "<h2> Average Amplitudes of RBX-ETA for HO: </h2>" << std::endl;
7596  htmlFile << " <img src=\"RBX-HO-11Dplot.png\" />\n";
7597  htmlFile << "<br>\n";
7598 
7599  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7600  }
7601  //HF:j = 0,1,2, 3 18,19,20,21
7602  if (sub == 4) {
7603  htmlFile << "<h2> 9. Averaged Amplitudes of RBX for HF: </h2>" << std::endl;
7604  htmlFile << "<h3> where </h3>" << std::endl;
7605  htmlFile << "<h3> jeta = 0,1,2, 3 (Negative direction); ............&& ............ jeta = 18,19,20,21 "
7606  "(Positive direction); </h3>"
7607  << std::endl;
7608  htmlFile << "<h3> jphi = 0, 1,..... 16, 17 </h3>" << std::endl;
7609  // 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;
7610  htmlFile << " <img src=\"RBX-HF-2Dplot.png\" />\n";
7611  htmlFile << "<br>\n";
7612 
7613  htmlFile << "<h2> Average Amplitudes of RBX-PHI for HF: </h2>" << std::endl;
7614  htmlFile << " <img src=\"RBX-HF-1Dplot.png\" />\n";
7615  htmlFile << "<br>\n";
7616 
7617  htmlFile << "<h2> Average Amplitudes of RBX-ETA for HF: </h2>" << std::endl;
7618  htmlFile << " <img src=\"RBX-HF-11Dplot.png\" />\n";
7619  htmlFile << "<br>\n";
7620 
7621  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7622  }
7623  htmlFile << "<br>" << std::endl;
7624 
7627 
7628  htmlFile << "<a name=\"RBXPHItable\"></a>\n";
7629  int cutA_ALL = 0;
7630  // float cutA_HB = 100.;float cutA_HE = 1000000.;float cutA_HO = 150.;float cutA_HF = 500.;
7631  if (sub == 1) {
7632  htmlFile << "<h2> 10. Average RBX-Amplitude in Phi over LSs for HB: </h2>" << std::endl;
7633  htmlFile
7634  << "<h3> Legends: Red boxes correspond BAD LS selected with cut = <td class=\"s6\" align=\"center\">"
7635  << cutA_HB << std::endl;
7636  cutA_ALL = cutA_HB;
7637  }
7638  if (sub == 2) {
7639  htmlFile << "<h2> 10. Average RBX-Amplitude in Phi over LSs for HE: </h2>" << std::endl;
7640  htmlFile
7641  << "<h3> Legends: Red boxes correspond BAD LS selected with cut = <td class=\"s6\" align=\"center\">"
7642  << cutA_HE << std::endl;
7643  cutA_ALL = cutA_HE;
7644  }
7645  if (sub == 3) {
7646  htmlFile << "<h2> 10. Average RBX-Amplitude in Phi over LSs for HO: </h2>" << std::endl;
7647  htmlFile
7648  << "<h3> Legends: Red boxes correspond BAD LS selected with cut = <td class=\"s6\" align=\"center\">"
7649  << cutA_HO << std::endl;
7650  cutA_ALL = cutA_HO;
7651  }
7652  if (sub == 4) {
7653  htmlFile << "<h2> 10. Average RBX-Amplitude in Phi over LSs for HF: </h2>" << std::endl;
7654  htmlFile
7655  << "<h3> Legends: Red boxes correspond BAD LS selected with cut = <td class=\"s6\" align=\"center\">"
7656  << cutA_HF << std::endl;
7657  cutA_ALL = cutA_HF;
7658  }
7659 
7660  htmlFile << "<br>" << std::endl;
7661  htmlFile << "<table>" << std::endl;
7662  htmlFile << "<tr>";
7663  htmlFile << "<td class=\"s4\" align=\"center\">LS</td>" << std::endl;
7664  // htmlFile << "<td class=\"s1\" align=\"center\">LS</td>" << std::endl;
7665  htmlFile << "<td class=\"s1\" align=\"center\">Number of events</td>" << std::endl;
7667 
7668  // k is jphi
7669  for (int k = 0; k < njphi; k++)
7670  htmlFile << "<td class=\"s1\" align=\"center\"> iPHI " << k << " </td>" << std::endl;
7671  htmlFile << "</tr>" << std::endl;
7673 
7674  ind = 0;
7675  // i is LS
7676  for (int i = 1; i <= MaxLum; i++) {
7677  if ((ind % 2) == 1)
7678  raw_class = "<td class=\"s2\" align=\"center\">";
7679  else
7680  raw_class = "<td class=\"s3\" align=\"center\">";
7681  htmlFile << "<tr>" << std::endl;
7682  htmlFile << "<td class=\"s4\" align=\"center\">" << i << "</td>" << std::endl;
7683  // htmlFile << raw_class<< LumLum->GetBinContent(i)<<"</td>"<< std::endl;
7684  htmlFile << raw_class << LumiEv->GetBinContent(i) << "</td>" << std::endl;
7685 
7686  // k is jphi
7687  for (int k = 0; k < njphi; k++) {
7688  if (sub == 1) {
7689  if (int(alexhb[k][i - 1]) > cutA_ALL) {
7690  htmlFile << "<td class=\"s6\" align=\"center\">" << int(alexhb[k][i - 1]) << "</td>" << std::endl;
7691  } else {
7692  htmlFile << raw_class << int(alexhb[k][i - 1]) << "</td>" << std::endl;
7693  }
7694  } // HB end
7695  if (sub == 2) {
7696  if (int(alexhe[k][i - 1]) > cutA_ALL) {
7697  htmlFile << "<td class=\"s6\" align=\"center\">" << int(alexhe[k][i - 1]) << "</td>" << std::endl;
7698  } else {
7699  htmlFile << raw_class << int(alexhe[k][i - 1]) << "</td>" << std::endl;
7700  }
7701  } // HE end
7702  if (sub == 3) {
7703  if (int(alexho[k][i - 1]) > cutA_ALL) {
7704  htmlFile << "<td class=\"s6\" align=\"center\">" << int(alexho[k][i - 1]) << "</td>" << std::endl;
7705  } else {
7706  htmlFile << raw_class << int(alexho[k][i - 1]) << "</td>" << std::endl;
7707  }
7708  } // HO end
7709  if (sub == 4) {
7710  if (int(alexhf[k][i - 1]) > cutA_ALL) {
7711  htmlFile << "<td class=\"s6\" align=\"center\">" << int(alexhf[k][i - 1]) << "</td>" << std::endl;
7712  } else {
7713  htmlFile << raw_class << int(alexhf[k][i - 1]) << "</td>" << std::endl;
7714  }
7715  } // HF end
7717  } // k over PHI-RBX
7718  htmlFile << "</tr>" << std::endl;
7719  ind += 1;
7720  } // i over LSs
7721  htmlFile << "</table>" << std::endl;
7722  htmlFile << "<br>" << std::endl;
7723  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7724  htmlFile << "<br>" << std::endl;
7726 
7727  htmlFile << "<a name=\"RBXETAtable\"></a>\n";
7728  int cutB_ALL = 0;
7729  // float cutB_HB = 100.;float cutB_HE = 1000000.;float cutB_HO = 150.;float cutB_HF = 500.;
7730  if (sub == 1) {
7731  htmlFile << "<h2> 11. Average RBX-Amplitude in Eta over LSs for HB: </h2>" << std::endl;
7732  htmlFile
7733  << "<h3> Legends: Red boxes correspond BAD LS selected with cut = <td class=\"s6\" align=\"center\">"
7734  << cutB_HB << std::endl;
7735  cutB_ALL = cutB_HB;
7736  }
7737  if (sub == 2) {
7738  htmlFile << "<h2> 11. Average RBX-Amplitude in Eta over LSs for HE: </h2>" << std::endl;
7739  htmlFile
7740  << "<h3> Legends: Red boxes correspond BAD LS selected with cut = <td class=\"s6\" align=\"center\">"
7741  << cutB_HE << std::endl;
7742  cutB_ALL = cutB_HE;
7743  }
7744  if (sub == 3) {
7745  htmlFile << "<h2> 11. Average RBX-Amplitude in Eta over LSs for HO: </h2>" << std::endl;
7746  htmlFile
7747  << "<h3> Legends: Red boxes correspond BAD LS selected with cut = <td class=\"s6\" align=\"center\">"
7748  << cutB_HO << std::endl;
7749  cutB_ALL = cutB_HO;
7750  }
7751  if (sub == 4) {
7752  htmlFile << "<h2> 11. Average RBX-Amplitude in Eta over LSs for HF: </h2>" << std::endl;
7753  htmlFile
7754  << "<h3> Legends: Red boxes correspond BAD LS selected with cut = <td class=\"s6\" align=\"center\">"
7755  << cutB_HF << std::endl;
7756  cutB_ALL = cutB_HF;
7757  }
7758 
7759  htmlFile << "<br>" << std::endl;
7760  htmlFile << "<table>" << std::endl;
7761  htmlFile << "<tr>";
7762  htmlFile << "<td class=\"s4\" align=\"center\">LS</td>" << std::endl;
7763  // htmlFile << "<td class=\"s1\" align=\"center\">LS</td>" << std::endl;
7764  htmlFile << "<td class=\"s1\" align=\"center\">Number of events</td>" << std::endl;
7766 
7767  // k is jeta
7768  for (int k = 0; k < njeta; k++)
7769  htmlFile << "<td class=\"s1\" align=\"center\"> iETA " << k << " </td>" << std::endl;
7770  htmlFile << "</tr>" << std::endl;
7772 
7773  ind = 0;
7774  // i is LS
7775  for (int i = 1; i <= MaxLum; i++) {
7776  if ((ind % 2) == 1)
7777  raw_class = "<td class=\"s2\" align=\"center\">";
7778  else
7779  raw_class = "<td class=\"s3\" align=\"center\">";
7780  htmlFile << "<tr>" << std::endl;
7781  htmlFile << "<td class=\"s4\" align=\"center\">" << i << "</td>" << std::endl;
7782  // htmlFile << raw_class<< LumLum->GetBinContent(i)<<"</td>"<< std::endl;
7783  htmlFile << raw_class << LumiEv->GetBinContent(i) << "</td>" << std::endl;
7784 
7785  // k is jeta
7786  for (int k = 0; k < njeta; k++) {
7787  if (sub == 1) {
7788  if (int(blexhb[k][i - 1]) > cutB_ALL) {
7789  htmlFile << "<td class=\"s6\" align=\"center\">" << int(blexhb[k][i - 1]) << "</td>" << std::endl;
7790  } else {
7791  htmlFile << raw_class << int(blexhb[k][i - 1]) << "</td>" << std::endl;
7792  }
7793  } // HB end
7794  if (sub == 2) {
7795  if (int(blexhe[k][i - 1]) > cutB_ALL) {
7796  htmlFile << "<td class=\"s6\" align=\"center\">" << int(blexhe[k][i - 1]) << "</td>" << std::endl;
7797  } else {
7798  htmlFile << raw_class << int(blexhe[k][i - 1]) << "</td>" << std::endl;
7799  }
7800  } // HE end
7801  if (sub == 3) {
7802  if (int(blexho[k][i - 1]) > cutB_ALL) {
7803  htmlFile << "<td class=\"s6\" align=\"center\">" << int(blexho[k][i - 1]) << "</td>" << std::endl;
7804  } else {
7805  htmlFile << raw_class << int(blexho[k][i - 1]) << "</td>" << std::endl;
7806  }
7807  } // HO end
7808  if (sub == 4) {
7809  if (int(blexhf[k][i - 1]) > cutB_ALL) {
7810  htmlFile << "<td class=\"s6\" align=\"center\">" << int(blexhf[k][i - 1]) << "</td>" << std::endl;
7811  } else {
7812  htmlFile << raw_class << int(blexhf[k][i - 1]) << "</td>" << std::endl;
7813  }
7814  } // HF end
7816  } // k over ETA-RBX
7817  htmlFile << "</tr>" << std::endl;
7818  ind += 1;
7819  } // i over LSs
7820  htmlFile << "</table>" << std::endl;
7821  htmlFile << "<br>" << std::endl;
7822  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7823  htmlFile << "<br>" << std::endl;
7825 
7828  htmlFile << "<a name=\"RBX3plots\"></a>\n";
7829  htmlFile << "<br>\n";
7830  htmlFile << "<h2> 12. (Rij) - RBX-amplitudes normilized on reference LS (~=1st) </h2>" << std::endl;
7831  htmlFile << "<h3> ( Rji . . is ratio of . . . . A_j_i . . to . . A_j_ref . . . . for . . j-RBX . . and . . "
7832  "i-LS . ) </h3>"
7833  << std::endl;
7834 
7835  htmlFile << "<br>\n";
7836  htmlFile << "<h2> . . . . . . . . . . . . . . 1) . average Ri vs iLS:. . . . . . . . . . . . . . . . . . . . . "
7837  ". . 2) . average Rj shown for Rij outside meanValue range either 0.95-1.05 or 3RMS: . . . . . . . "
7838  ". . . . . . . . . . . . . . . . . . 3) . Rij: </h2>"
7839  << std::endl;
7840  htmlFile << "<br>\n";
7841  if (sub == 1) {
7842  htmlFile << " <img src=\"RBX-HB-3plots.png\" />\n";
7843  }
7844  if (sub == 2) {
7845  htmlFile << " <img src=\"RBX-HE-3plots.png\" />\n";
7846  }
7847  if (sub == 3) {
7848  htmlFile << " <img src=\"RBX-HO-3plots.png\" />\n";
7849  }
7850  if (sub == 4) {
7851  htmlFile << " <img src=\"RBX-HF-3plots.png\" />\n";
7852  }
7853  htmlFile << "<br>\n";
7854 
7855  htmlFile << "<br>\n";
7856  htmlFile << "<h2> . 4). average Rj shown for Rij outside meanValue range 0.80-1.20: . . . . . . . .5) . "
7857  "average Rj shown for Rij outside meanValue range 0.70-1.30: . . . . . . . .6). average Rj shown "
7858  "for Rij outside meanValue range 0.60-1.40: </h2>"
7859  << std::endl;
7860  htmlFile << "<br>\n";
7861  if (sub == 1) {
7862  htmlFile << " <img src=\"RBX-HB-3plotsmore.png\" />\n";
7863  }
7864  if (sub == 2) {
7865  htmlFile << " <img src=\"RBX-HE-3plotsmore.png\" />\n";
7866  }
7867  if (sub == 3) {
7868  htmlFile << " <img src=\"RBX-HO-3plotsmore.png\" />\n";
7869  }
7870  if (sub == 4) {
7871  htmlFile << " <img src=\"RBX-HF-3plotsmore.png\" />\n";
7872  }
7873  htmlFile << "<br>\n";
7874 
7875  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7876 
7877  //=========================================================
7878 
7879  } // test=1
7880 
7881  //===============================================================================
7882 
7883  htmlFile.close();
7884  } // sub main loop
7885  } //test main loop
7886  //===============================================================================
7887  //===============================================================================
7888  //===============================================================================
7889  //===============================================================================
7890  //===============================================================================
7891 
7892  //======================================================================
7893  // Creating tests html pages:
7894 
7895  for (int test = 0; test <= 5; test++) { //Test: 0,
7896  if (test == 0)
7897  htmlFile.open("CapID_GL.html");
7898  if (test == 1)
7899  htmlFile.open("ADCampl_GL.html");
7900  if (test == 2)
7901  htmlFile.open("Width_GL.html");
7902  if (test == 3)
7903  htmlFile.open("Ratio_GL.html");
7904  if (test == 4)
7905  htmlFile.open("Tmean_GL.html");
7906  if (test == 5)
7907  htmlFile.open("Tmax_GL.html");
7908 
7909  // cout<<"Creating tests html pages: test= "<< test << endl;
7910 
7911  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
7912  htmlFile << "<head>" << std::endl;
7913  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
7914  htmlFile << "<title> Certification Monitoring Tool </title>" << std::endl;
7915  htmlFile << "<style type=\"text/css\">" << std::endl;
7916  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
7917  << std::endl;
7918  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
7919  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
7920  "text-align: center;}"
7921  << std::endl;
7922  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
7923  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
7924  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
7925  htmlFile << " td.s5 { font-family: arial, arial ce, helvetica; background-color: #00FF00; }" << std::endl;
7926  htmlFile << " td.s6 { font-family: arial, arial ce, helvetica; background-color: #FF0000; }" << std::endl;
7927  htmlFile << "</style>" << std::endl;
7928  htmlFile << "<body>" << std::endl;
7929  if (test == 0)
7930  htmlFile << "<h1> CAP ID ERRORS, GLOBAL RUN = " << runnumber << " </h1>" << std::endl;
7931  if (test == 1)
7932  htmlFile << "<h1> ADC AMPLITIDE, GLOBAL RUN = " << runnumber << " </h1>" << std::endl;
7933  if (test == 2)
7934  htmlFile << "<h1> WIDTH, GLOBAL RUN = " << runnumber << " </h1>" << std::endl;
7935  if (test == 3)
7936  htmlFile << "<h1> RATIO, GLOBAL RUN = " << runnumber << " </h1>" << std::endl;
7937  if (test == 4)
7938  htmlFile << "<h1> TIMING MEAN, GLOBAL RUN = " << runnumber << " </h1>" << std::endl;
7939  if (test == 5)
7940  htmlFile << "<h1> TIMING MAX, GLOBAL RUN = " << runnumber << " </h1>" << std::endl;
7941  htmlFile << "<br>" << std::endl;
7942  htmlFile << "<h2> 1. Map of suspicious channels with this criterion for whole HCAL </h2>" << std::endl;
7943  htmlFile << "<h3> Channel legend: green - good, other colour - suspicious </h3>" << std::endl;
7944  htmlFile << "<br>" << std::endl;
7945  if (test == 0)
7946  htmlFile << " <img src=\"MapCapIdError.png\" />" << std::endl;
7947  if (test == 1)
7948  htmlFile << " <img src=\"MapADCAmpl.png\" />" << std::endl;
7949  if (test == 2)
7950  htmlFile << " <img src=\"MapWidth.png\" />" << std::endl;
7951  if (test == 3)
7952  htmlFile << " <img src=\"MapRatio.png\" />" << std::endl;
7953  if (test == 4)
7954  htmlFile << " <img src=\"MapTmean.png\" />" << std::endl;
7955  if (test == 5)
7956  htmlFile << " <img src=\"MapTmax.png\" />" << std::endl;
7957  htmlFile << "<br>" << std::endl;
7958  htmlFile << "<h2> 2. For whole HCAL: </h2>" << std::endl;
7959  htmlFile << "<br>" << std::endl;
7960  if (test == 0)
7961  htmlFile << " <img src=\"HistCapID.png\" />" << std::endl;
7962  if (test == 1)
7963  htmlFile << " <img src=\"HistADCAmpl.png\" />" << std::endl;
7964  if (test == 2)
7965  htmlFile << " <img src=\"HistWidth.png\" />" << std::endl;
7966  if (test == 3)
7967  htmlFile << " <img src=\"HistRatio.png\" />" << std::endl;
7968  if (test == 4)
7969  htmlFile << " <img src=\"HistTmean.png\" />" << std::endl;
7970  if (test == 5)
7971  htmlFile << " <img src=\"HistTmax.png\" />" << std::endl;
7972  htmlFile << "<br>" << std::endl;
7973  htmlFile << "<h2> 3. Status of subdetectors </h2>" << std::endl;
7974  htmlFile << "<table width=\"400\">" << std::endl;
7975  htmlFile << "<tr>" << std::endl;
7976  if (test == 0) {
7977  htmlFile << " <td><a "
7978  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
7979  "HcalRemoteMonitoring/CMT/GLOBAL_"
7980  << runnumber << "/HB_CapID.html\">HB</a></td>" << std::endl;
7981  htmlFile << " <td><a "
7982  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
7983  "HcalRemoteMonitoring/CMT/GLOBAL_"
7984  << runnumber << "/HE_CapID.html\">HE</a></td>" << std::endl;
7985  htmlFile << " <td><a "
7986  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
7987  "HcalRemoteMonitoring/CMT/GLOBAL_"
7988  << runnumber << "/HO_CapID.html\">HO</a></td>" << std::endl;
7989  htmlFile << " <td><a "
7990  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
7991  "HcalRemoteMonitoring/CMT/GLOBAL_"
7992  << runnumber << "/HF_CapID.html\">HF</a></td>" << std::endl;
7993  }
7994  if (test == 1) {
7995  // AZ 07.11.2018
7996  htmlFile << " <td><a href=\"HB_ADCampl.html\">HB</a></td>" << std::endl;
7997  htmlFile << " <td><a href=\"HE_ADCampl.html\">HE</a></td>" << std::endl;
7998  htmlFile << " <td><a href=\"HO_ADCampl.html\">HO</a></td>" << std::endl;
7999  htmlFile << " <td><a href=\"HF_ADCampl.html\">HF</a></td>" << std::endl;
8000  /*
8001  htmlFile << " <td><a href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/CMT/GLOBAL_"<<runnumber<<"/HB_ADCampl.html\">HB</a></td>"<< std::endl;
8002  htmlFile << " <td><a href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/CMT/GLOBAL_"<<runnumber<<"/HE_ADCampl.html\">HE</a></td>"<< std::endl;
8003  htmlFile << " <td><a href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/CMT/GLOBAL_"<<runnumber<<"/HO_ADCampl.html\">HO</a></td>"<< std::endl;
8004  htmlFile << " <td><a href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/CMT/GLOBAL_"<<runnumber<<"/HF_ADCampl.html\">HF</a></td>"<< std::endl;
8005 */
8006  }
8007  if (test == 2) {
8008  htmlFile << " <td><a "
8009  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
8010  "HcalRemoteMonitoring/CMT/GLOBAL_"
8011  << runnumber << "/HB_Width.html\">HB</a></td>" << std::endl;
8012  htmlFile << " <td><a "
8013  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
8014  "HcalRemoteMonitoring/CMT/GLOBAL_"
8015  << runnumber << "/HE_Width.html\">HE</a></td>" << std::endl;
8016  htmlFile << " <td><a "
8017  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
8018  "HcalRemoteMonitoring/CMT/GLOBAL_"
8019  << runnumber << "/HO_Width.html\">HO</a></td>" << std::endl;
8020  htmlFile << " <td><a "
8021  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
8022  "HcalRemoteMonitoring/CMT/GLOBAL_"
8023  << runnumber << "/HF_Width.html\">HF</a></td>" << std::endl;
8024  }
8025  if (test == 3) {
8026  htmlFile << " <td><a "
8027  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
8028  "HcalRemoteMonitoring/CMT/GLOBAL_"
8029  << runnumber << "/HB_Ratio.html\">HB</a></td>" << std::endl;
8030  htmlFile << " <td><a "
8031  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
8032  "HcalRemoteMonitoring/CMT/GLOBAL_"
8033  << runnumber << "/HE_Ratio.html\">HE</a></td>" << std::endl;
8034  htmlFile << " <td><a "
8035  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
8036  "HcalRemoteMonitoring/CMT/GLOBAL_"
8037  << runnumber << "/HO_Ratio.html\">HO</a></td>" << std::endl;
8038  htmlFile << " <td><a "
8039  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
8040  "HcalRemoteMonitoring/CMT/GLOBAL_"
8041  << runnumber << "/HF_Ratio.html\">HF</a></td>" << std::endl;
8042  }
8043  if (test == 4) {
8044  htmlFile << " <td><a "
8045  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
8046  "HcalRemoteMonitoring/CMT/GLOBAL_"
8047  << runnumber << "/HB_Tmean.html\">HB</a></td>" << std::endl;
8048  htmlFile << " <td><a "
8049  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
8050  "HcalRemoteMonitoring/CMT/GLOBAL_"
8051  << runnumber << "/HE_Tmean.html\">HE</a></td>" << std::endl;
8052  htmlFile << " <td><a "
8053  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
8054  "HcalRemoteMonitoring/CMT/GLOBAL_"
8055  << runnumber << "/HO_Tmean.html\">HO</a></td>" << std::endl;
8056  htmlFile << " <td><a "
8057  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
8058  "HcalRemoteMonitoring/CMT/GLOBAL_"
8059  << runnumber << "/HF_Tmean.html\">HF</a></td>" << std::endl;
8060  }
8061  if (test == 5) {
8062  htmlFile << " <td><a "
8063  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
8064  "HcalRemoteMonitoring/CMT/GLOBAL_"
8065  << runnumber << "/HB_Tmax.html\">HB</a></td>" << std::endl;
8066  htmlFile << " <td><a "
8067  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
8068  "HcalRemoteMonitoring/CMT/GLOBAL_"
8069  << runnumber << "/HE_Tmax.html\">HE</a></td>" << std::endl;
8070  htmlFile << " <td><a "
8071  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
8072  "HcalRemoteMonitoring/CMT/GLOBAL_"
8073  << runnumber << "/HO_Tmax.html\">HO</a></td>" << std::endl;
8074  htmlFile << " <td><a "
8075  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
8076  "HcalRemoteMonitoring/CMT/GLOBAL_"
8077  << runnumber << "/HF_Tmax.html\">HF</a></td>" << std::endl;
8078  }
8079 
8080  htmlFile << "</tr>" << std::endl;
8081  htmlFile << "</table>" << std::endl;
8082  htmlFile << "<br>" << std::endl;
8083  // cout<<"Creating tests html pages: 111111" << endl;
8084 
8085  if (test != 0)
8086  htmlFile << "<h2> 4. Table of estimator-values in sub-detectors for ONLY suspicious LSs </h3>" << std::endl;
8087  if (test == 0)
8088  htmlFile << "<h2> 4. Table of average Nbcs in sub-detectors for ONLY suspicious LSs </h3>" << std::endl;
8089  htmlFile << "<table>" << std::endl;
8090  htmlFile << "<tr>";
8091  htmlFile << "<td class=\"s4\" align=\"center\">LS</td>" << std::endl;
8092  // htmlFile << "<td class=\"s1\" align=\"center\">LS</td>" << std::endl;
8093  htmlFile << "<td class=\"s1\" align=\"center\">Number of events</td>" << std::endl;
8095  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
8096 
8097  // cout<<"Creating each test kind for each subdet html pages: test= "<< test << " sub= " << sub << endl;
8098  int kkkkkkmax = k_max[sub];
8099  if ((sub == 4 || sub == 2 || sub == 1) && test == 1)
8100  kkkkkkmax = k_maxupgrade[sub];
8101  // if ( (sub==4 || sub==2) && test==1) kkkkkkmax = k_maxupgrade[sub];
8102  // if (test==1 && sub==4) kkkkkkmax = k_maxupgrade[sub];
8103  if (sub == 1) {
8104  if (test == 0)
8105  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8106  htmlFile << "<td class=\"s1\" align=\"center\">< Nbcs > HBdep " << k << " </td>" << std::endl;
8107  if (test == 1)
8108  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8109  htmlFile << "<td class=\"s1\" align=\"center\">< A > HBdepth " << k << " </td>" << std::endl;
8110  if (test == 2)
8111  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8112  htmlFile << "<td class=\"s1\" align=\"center\">< W > HBdepth " << k << " </td>" << std::endl;
8113  if (test == 3)
8114  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8115  htmlFile << "<td class=\"s1\" align=\"center\">< R > HBdepth " << k << " </td>" << std::endl;
8116  if (test == 4)
8117  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8118  htmlFile << "<td class=\"s1\" align=\"center\">< TSn > HBdep " << k << " </td>" << std::endl;
8119  if (test == 5)
8120  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8121  htmlFile << "<td class=\"s1\" align=\"center\">< TSx > HBdep " << k << " </td>" << std::endl;
8122  } //
8123  if (sub == 2) {
8124  if (test == 0)
8125  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8126  htmlFile << "<td class=\"s1\" align=\"center\">< Nbcs > HEdep " << k << " </td>" << std::endl;
8127  if (test == 1)
8128  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8129  htmlFile << "<td class=\"s1\" align=\"center\">< A > HEdepth " << k << " </td>" << std::endl;
8130  if (test == 2)
8131  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8132  htmlFile << "<td class=\"s1\" align=\"center\">< W > HEdepth " << k << " </td>" << std::endl;
8133  if (test == 3)
8134  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8135  htmlFile << "<td class=\"s1\" align=\"center\">< R > HEdepth " << k << " </td>" << std::endl;
8136  if (test == 4)
8137  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8138  htmlFile << "<td class=\"s1\" align=\"center\">< TSn > HEdep " << k << " </td>" << std::endl;
8139  if (test == 5)
8140  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8141  htmlFile << "<td class=\"s1\" align=\"center\">< TSx > HEdep " << k << " </td>" << std::endl;
8142  } //
8143  if (sub == 3) {
8144  if (test == 0)
8145  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8146  htmlFile << "<td class=\"s1\" align=\"center\">< Nbcs > HOdep " << k << " </td>" << std::endl;
8147  if (test == 1)
8148  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8149  htmlFile << "<td class=\"s1\" align=\"center\">< A > HOdepth " << k << " </td>" << std::endl;
8150  if (test == 2)
8151  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8152  htmlFile << "<td class=\"s1\" align=\"center\">< W > HOdepth " << k << " </td>" << std::endl;
8153  if (test == 3)
8154  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8155  htmlFile << "<td class=\"s1\" align=\"center\">< R > HOdepth " << k << " </td>" << std::endl;
8156  if (test == 4)
8157  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8158  htmlFile << "<td class=\"s1\" align=\"center\">< TSn > HOdep " << k << " </td>" << std::endl;
8159  if (test == 5)
8160  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8161  htmlFile << "<td class=\"s1\" align=\"center\">< TSx > HOdep " << k << " </td>" << std::endl;
8162  } //
8163  if (sub == 4) {
8164  if (test == 0)
8165  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8166  htmlFile << "<td class=\"s1\" align=\"center\">< Nbcs > HFdep " << k << " </td>" << std::endl;
8167  if (test == 1)
8168  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8169  htmlFile << "<td class=\"s1\" align=\"center\">< A > HFdepth " << k << " </td>" << std::endl;
8170  if (test == 2)
8171  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8172  htmlFile << "<td class=\"s1\" align=\"center\">< W > HFdepth " << k << " </td>" << std::endl;
8173  if (test == 3)
8174  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8175  htmlFile << "<td class=\"s1\" align=\"center\">< R > HFdepth " << k << " </td>" << std::endl;
8176  if (test == 4)
8177  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8178  htmlFile << "<td class=\"s1\" align=\"center\">< TSn > HFdep " << k << " </td>" << std::endl;
8179  if (test == 5)
8180  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8181  htmlFile << "<td class=\"s1\" align=\"center\">< TSx > HFdep " << k << " </td>" << std::endl;
8182  } //
8183  } // sub
8184  htmlFile << "</tr>" << std::endl;
8185 
8186  // htmlFile << "<td class=\"s1\" align=\"center\">HB Depth 1</td>"<< std::endl;
8187  // htmlFile << "<td class=\"s1\" align=\"center\">HB Depth 2</td>" << std::endl;
8188  // htmlFile << "<td class=\"s1\" align=\"center\">HE Depth 1</td>" << std::endl;
8189  // htmlFile << "<td class=\"s1\" align=\"center\">HE Depth 2</td>" << std::endl;
8190  // htmlFile << "<td class=\"s1\" align=\"center\">HE Depth 3</td>" << std::endl;
8191  // htmlFile << "<td class=\"s1\" align=\"center\">HE Depth 4</td>" << std::endl;
8192  // htmlFile << "<td class=\"s1\" align=\"center\">HE Depth 5</td>" << std::endl;
8193  // htmlFile << "<td class=\"s1\" align=\"center\">HE Depth 6</td>" << std::endl;
8194  // htmlFile << "<td class=\"s1\" align=\"center\">HE Depth 7</td>" << std::endl;
8195  // htmlFile << "<td class=\"s1\" align=\"center\">HO Depth 4</td>" << std::endl;
8196  // htmlFile << "<td class=\"s1\" align=\"center\">HF Depth 1</td>" << std::endl;
8197  // htmlFile << "<td class=\"s1\" align=\"center\">HF Depth 2</td>" << std::endl;
8198  // htmlFile << "<td class=\"s1\" align=\"center\">HF Depth 3</td>" << std::endl;
8199  // htmlFile << "<td class=\"s1\" align=\"center\">HF Depth 4</td>" << std::endl;
8200  // htmlFile << "</tr>" << std::endl;
8201 
8202  ind = 0;
8203  // cout<<"Creating tests html pages: 222222" << endl;
8204  for (int i = 1; i <= MaxLum; i++) {
8205  // define al least one exceed in any sub-detector
8206  int met = 0;
8207  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
8208  int kkkkkkmax = k_max[sub];
8209  if ((sub == 4 || sub == 2 || sub == 1) && test == 1)
8210  kkkkkkmax = k_maxupgrade[sub];
8211  // if ( (sub==4 || sub==2) && test==1) kkkkkkmax = k_maxupgrade[sub];
8212  for (int k = k_min[sub]; k <= kkkkkkmax; k++) {
8213  // 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
8214  if (sub == 2 && k > 3) {
8215  } else {
8216  if (HistNumBadChanDepth[test][sub][k]->GetBinContent(i) > Cut0[test][sub][k])
8217  met = 1;
8218  }
8219  } //depth
8220  } //sub
8221  // if exceed then plot the line for all sub-detectors
8222  if (met == 1) {
8223  if ((ind % 2) == 1)
8224  raw_class = "<td class=\"s2\" align=\"center\">";
8225  else
8226  raw_class = "<td class=\"s3\" align=\"center\">";
8227  htmlFile << "<tr>" << std::endl;
8228  htmlFile << "<td class=\"s4\" align=\"center\">" << i << "</td>" << std::endl;
8229  // htmlFile << raw_class<< LumLum->GetBinContent(i)<<"</td>"<< std::endl;
8230  htmlFile << raw_class << LumiEv->GetBinContent(i) << "</td>" << std::endl;
8231  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
8232  int kkkkkkmax = k_max[sub];
8233  if ((sub == 4 || sub == 2 || sub == 1) && test == 1)
8234  kkkkkkmax = k_maxupgrade[sub];
8235  // if ( (sub==4 || sub==2) && test==1) kkkkkkmax = k_maxupgrade[sub];
8236  for (int k = k_min[sub]; k <= kkkkkkmax; k++) {
8237  if (HistNumBadChanDepth[test][sub][k]->GetBinContent(i) > Cut0[test][sub][k])
8238  htmlFile << "<td class=\"s6\" align=\"center\">" << HistNumBadChanDepth[test][sub][k]->GetBinContent(i)
8239  << "</td>" << std::endl;
8240  else
8241  htmlFile << raw_class << HistNumBadChanDepth[test][sub][k]->GetBinContent(i) << "</td>" << std::endl;
8242  // htmlFile << "</tr>" << std::endl;
8243  /*
8244  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;
8245  else htmlFile <<raw_class<<HistNumBadChanDepth[test][1][1]->GetBinContent(i)<<"</td>"<< std::endl;
8246  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;
8247  else htmlFile <<raw_class<<HistNumBadChanDepth[test][1][2]->GetBinContent(i)<<"</td>"<< std::endl;
8248  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;
8249  else htmlFile <<raw_class<<HistNumBadChanDepth[test][2][1]->GetBinContent(i)<<"</td>"<< std::endl;
8250  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;
8251  else htmlFile <<raw_class<<HistNumBadChanDepth[test][2][2]->GetBinContent(i)<<"</td>"<< std::endl;
8252  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;
8253  else htmlFile <<raw_class<<HistNumBadChanDepth[test][2][3]->GetBinContent(i)<<"</td>"<< std::endl;
8254  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;
8255  else htmlFile <<raw_class<<HistNumBadChanDepth[test][2][4]->GetBinContent(i)<<"</td>"<< std::endl;
8256  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;
8257  else htmlFile <<raw_class<<HistNumBadChanDepth[test][2][5]->GetBinContent(i)<<"</td>"<< std::endl;
8258  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;
8259  else htmlFile <<raw_class<<HistNumBadChanDepth[test][2][6]->GetBinContent(i)<<"</td>"<< std::endl;
8260  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;
8261  else htmlFile <<raw_class<<HistNumBadChanDepth[test][2][7]->GetBinContent(i)<<"</td>"<< std::endl;
8262  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;
8263  else htmlFile <<raw_class<<HistNumBadChanDepth[test][3][4]->GetBinContent(i)<<"</td>"<< std::endl;
8264  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;
8265  else htmlFile <<raw_class<<HistNumBadChanDepth[test][4][1]->GetBinContent(i)<<"</td>"<< std::endl;
8266  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;
8267  else htmlFile <<raw_class<<HistNumBadChanDepth[test][4][2]->GetBinContent(i)<<"</td>"<< std::endl;
8268  */
8269  } //k depthes
8270  } //sub
8271  htmlFile << "</tr>" << std::endl;
8272  ind += 1;
8273  } // met=1
8274  } //i bin lines
8275  // cout<<"Creating tests html pages: 333333" << endl;
8276  htmlFile << "</table>" << std::endl;
8277  htmlFile << "<br>" << std::endl;
8278  htmlFile << "</body> " << std::endl;
8279  htmlFile << "</html> " << std::endl;
8280  htmlFile.close();
8281  } //test
8282  //======================================================================
8283  // cout<<"for summed Amplitudes of each sub-detector" << endl;
8284 
8285  // for summed Amplitudes of each sub-detector
8286  htmlFile.open("SummedAmplitudes_GL.html");
8287  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
8288  htmlFile << "<head>" << std::endl;
8289  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
8290  htmlFile << "<title> for summed Amplitudes of each sub-detector </title>" << std::endl;
8291  htmlFile << "<style type=\"text/css\">" << std::endl;
8292  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
8293  << std::endl;
8294  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
8295  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
8296  "text-align: center;}"
8297  << std::endl;
8298  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
8299  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
8300  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
8301  htmlFile << " td.s5 { font-family: arial, arial ce, helvetica; background-color: #00FF00; }" << std::endl;
8302  htmlFile << " td.s6 { font-family: arial, arial ce, helvetica; background-color: #FF0000; }" << std::endl;
8303 
8304  htmlFile << "</style>" << std::endl;
8305  htmlFile << "<body>" << std::endl;
8306  htmlFile << "<h1> Averaged Summed Amplitudes & corresponding occupancy of each sub-detector in Global Run = "
8307  << runnumber << " </h1>" << std::endl;
8308  htmlFile << "<a name=\"Top\"></a>\n";
8309  htmlFile << "<b>Contents:<br>\n";
8310  htmlFile << "1. <a href=\"#SAhigh\">average SA&Occupancy for Signal </a><br>\n";
8311  htmlFile << "2. <a href=\"#SAlow\">average SA&Occupancy for NoSignal </a><br>\n";
8312  htmlFile << "3. <a href=\"#SAmax\"> maxSA & maxOccupancy; SA & Occupancy; </a><br>\n";
8313  htmlFile << "4. <a href=\"#FullTable\">Table(avA; avSA; avOccupancy; maxSA; maxOccupancy;) </a><br>\n";
8314 
8315  htmlFile << "<h2> Clarifying on averaged Summed Amplitude (avSA) : </h2>" << std::endl;
8316  htmlFile << "<h3> Summed Amplitudes (SA) are averaged over all events of each LS: avSA_LS = SUM (SA_eventsInLS) / "
8317  "N_eventsInLS ,</h3>"
8318  << std::endl;
8319  htmlFile << "<h3> where SA = SUM(A_i) ,and means that Amplitude is summed over all sub-detector channels, </h3>"
8320  << std::endl;
8321  htmlFile << "<h3> where A_i = SUM(A_depth) denotes channel amplitude summed over depths; </h3>" << std::endl;
8322  // htmlFile << " <td><a href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/CMT/GLOBAL_"<<runnumber<<"/HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
8323  htmlFile << " <td><a "
8324  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
8325  "HcalRemoteMonitoring/CMT/SAwriteup.html\"> see more details for SummedAmplitudes</a></td>"
8326  << std::endl;
8327  htmlFile << "<h2> Apply cuts on A_i to take into account channels with or/and without a'la Signal: </h2>"
8328  << std::endl;
8329  htmlFile << " <img src=\"ChannelDepthsummedAmplitudes.png\" />" << std::endl;
8330  htmlFile << "<br>" << std::endl;
8331  htmlFile << "<br>" << std::endl;
8332  htmlFile << "<a name=\"SAhigh\"></a>\n";
8333  htmlFile << "<h1> 1. for channels with signal </h1>" << std::endl;
8334  htmlFile << "<br>" << std::endl;
8335  htmlFile << "<h2> for HB: A_i> 80; </h2>" << std::endl;
8336  htmlFile << " <img src=\"SummedAmplitudesSignal_HB.png\" />" << std::endl;
8337  htmlFile << "<br>" << std::endl;
8338  htmlFile << "<h2> for HE: A_i> 200;</h2>" << std::endl;
8339  htmlFile << " <img src=\"SummedAmplitudesSignal_HE.png\" />" << std::endl;
8340  htmlFile << "<br>" << std::endl;
8341  htmlFile << "<h2> for HO: A_i> 1200;</h2>" << std::endl;
8342  htmlFile << " <img src=\"SummedAmplitudesSignal_HO.png\" />" << std::endl;
8343  htmlFile << "<br>" << std::endl;
8344  htmlFile << "<h2> for HF: A_i> 600;</h2>" << std::endl;
8345  htmlFile << " <img src=\"SummedAmplitudesSignal_HF.png\" />" << std::endl;
8346  htmlFile << "<br>" << std::endl;
8347  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
8348 
8349  htmlFile << "<a name=\"SAlow\"></a>\n";
8350  htmlFile << "<h1> 2. for channels w/o signal </h1>" << std::endl;
8351  htmlFile << "<br>" << std::endl;
8352  htmlFile << "<h2> for HB: A_i< 80;</h2>" << std::endl;
8353  htmlFile << " <img src=\"NoSignalSummedAmplitudes_HB.png\" />" << std::endl;
8354  htmlFile << "<br>" << std::endl;
8355  htmlFile << "<h2> for HE: A_i< 200;</h2>" << std::endl;
8356  htmlFile << " <img src=\"NoSignalSummedAmplitudes_HE.png\" />" << std::endl;
8357  htmlFile << "<br>" << std::endl;
8358  htmlFile << "<h2> for HO: A_i< 1200;</h2>" << std::endl;
8359  htmlFile << " <img src=\"NoSignalSummedAmplitudes_HO.png\" />" << std::endl;
8360  htmlFile << "<br>" << std::endl;
8361  htmlFile << "<h2> for HF: A_i< 600;</h2>" << std::endl;
8362  htmlFile << " <img src=\"NoSignalSummedAmplitudes_HF.png\" />" << std::endl;
8363  htmlFile << "<br>" << std::endl;
8364  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
8365 
8366  htmlFile << "<br>" << std::endl;
8367  htmlFile << "<br>" << std::endl;
8368  htmlFile << "<a name=\"SAmax\"></a>\n";
8369  htmlFile << "<h1> 3. four plots: ---1---> max SA ---2---> max Occupancy ---3---> SA ---4---> Occupancy over all "
8370  "events of LS </h1>"
8371  << std::endl;
8372  htmlFile << "<br>" << std::endl;
8373 
8374  htmlFile << "<h2> for HB: maxSA vs LS, masOccupancy vs LS, SA, Occupancy </h2>" << std::endl;
8375  htmlFile << " <img src=\"MaxxSummedAmplitudes_HB.png\" />" << std::endl;
8376  htmlFile << "<h2>"
8377  " ......(forCut:SAmax>60000) N= "
8378  << countamplmaxHB << " ...... (forCut:OCCUPmax>2000) N= " << countoccumaxHB << " </h2>" << std::endl;
8379  htmlFile << "<h2>"
8380  " ......(forCut:SA>60000) N= "
8381  << countamplHB << " ...... (forCut:OCCUP>2000) N= " << countoccuHB << " </h2>" << std::endl;
8382  htmlFile << "<br>" << std::endl;
8383  htmlFile << "<h3> ONLY for HB (cross-check): channel Amplitudes for events in the Tail (averaged): </h3>"
8384  << std::endl;
8385  htmlFile << " <img src=\"AtaildepthHB.png\" />" << std::endl;
8386  htmlFile << "<br>" << std::endl;
8387 
8388  htmlFile << "<h2> for HE: maxSA vs LS, masOccupancy vs LS, SA, Occupancy </h2>" << std::endl;
8389  htmlFile << " <img src=\"MaxxSummedAmplitudes_HE.png\" />" << std::endl;
8390  htmlFile << "<h2>"
8391  " ......(forCut:SAmax>60000) N= "
8392  << countamplmaxHE << " ...... (forCut:OCCUPmax>1200) N= " << countoccumaxHE << " </h2>" << std::endl;
8393  htmlFile << "<h2>"
8394  " ......(forCut:SA>60000) N= "
8395  << countamplHE << " ...... (forCut:OCCUP>1200) N= " << countoccuHE << " </h2>" << std::endl;
8396  htmlFile << "<br>" << std::endl;
8397 
8398  htmlFile << "<h2> for HO: maxSA vs LS, masOccupancy vs LS, SA, Occupancy </h2>" << std::endl;
8399  htmlFile << " <img src=\"MaxxSummedAmplitudes_HO.png\" />" << std::endl;
8400  htmlFile << "<h2>"
8401  " ......(forCut:SAmax>150000) N= "
8402  << countamplmaxHO << " ...... (forCut:OCCUPmax>2000) N= " << countoccumaxHO << " </h2>" << std::endl;
8403  htmlFile << "<h2>"
8404  " ......(forCut:SA>150000) N= "
8405  << countamplHO << " ...... (forCut:OCCUP>2000) N= " << countoccuHO << " </h2>" << std::endl;
8406  htmlFile << "<br>" << std::endl;
8407 
8408  htmlFile << "<h2> for HF: maxSA vs LS, masOccupancy vs LS, SA, Occupancy </h2>" << std::endl;
8409  htmlFile << " <img src=\"MaxxSummedAmplitudes_HF.png\" />" << std::endl;
8410  htmlFile << "<h2>"
8411  " ......(forCut:SAmax>22000) N= "
8412  << countamplmaxHF << " ...... (forCut:OCCUPmax>860) N= " << countoccumaxHF << " </h2>" << std::endl;
8413  htmlFile << "<h2>"
8414  " ......(forCut:SA>22000) N= "
8415  << countamplHF << " ...... (forCut:OCCUP>860) N= " << countoccuHF << " </h2>" << std::endl;
8416  htmlFile << "<br>" << std::endl;
8417  htmlFile << "<h2> Occupancy HF (ONLY) vs LS </h2>" << std::endl;
8418  htmlFile << " <img src=\"sumOccupancyHF.png\" />" << std::endl;
8419  htmlFile << "<br>" << std::endl;
8420  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
8421 
8422  htmlFile << "<a name=\"FullTable\"></a>\n";
8423  htmlFile << "<h2> 4.Lumisection Status: </h2>" << std::endl;
8424  htmlFile << "<h3> Legends: HBdepth1 red boxes correspond LSs selected with cut: <td class=\"s6\" align=\"center\">"
8425  << Cut0[1][1][1] << std::endl;
8426  htmlFile << "<h3> Legends: HEdepth1 red boxes correspond LSs selected with cut: <td class=\"s6\" align=\"center\">"
8427  << Cut0[1][2][1] << std::endl;
8428  htmlFile << "<h3> Legends: HOdepth4 red boxes correspond LSs selected with cut: <td class=\"s6\" align=\"center\">"
8429  << Cut0[1][3][4] << std::endl;
8430  htmlFile << "<h3> Legends: HFdepth1 red boxes correspond LSs selected with cut: <td class=\"s6\" align=\"center\">"
8431  << Cut0[1][4][1] << std::endl;
8432  htmlFile << "<br>" << std::endl;
8433  // SummedAmplitudeHisto[i] SummedAmplitudeOccupancyHisto[i] NoSignalSummedAmplitudeHisto[i] NoSignalSummedAmplitudeOccupancyHisto[i]; i=0-3;(HF:i=3)
8434  htmlFile << "<br>" << std::endl;
8435  htmlFile << "<table>" << std::endl;
8436  htmlFile << "<tr>";
8437  htmlFile << "<td class=\"s4\" align=\"center\">LS</td>" << std::endl;
8438  // htmlFile << "<td class=\"s1\" align=\"center\">LS</td>" << std::endl;
8439  htmlFile << "<td class=\"s1\" align=\"center\"> Num.of ev.</td>" << std::endl;
8440 
8441  // for (int k=k_min[sub];k<=k_max[sub]; k++) htmlFile << "<td class=\"s1\" align=\"center\">< A > Depth "<< k <<" </td>" << std::endl;
8442  // for (int sub=1;sub<=4;sub++) htmlFile << "<td class=\"s1\" align=\"center\">< A > Depth1, sub "<< sub <<" </td>" << std::endl;
8443 
8444  htmlFile << "<td class=\"s1\" align=\"center\">< A >HB Depth1</td>" << std::endl;
8445  htmlFile << "<td class=\"s1\" align=\"center\">< A >HE Depth1</td>" << std::endl;
8446  htmlFile << "<td class=\"s1\" align=\"center\">< A >HO Depth4</td>" << std::endl;
8447  htmlFile << "<td class=\"s1\" align=\"center\">< A >HF Depth1</td>" << std::endl;
8448 
8449  htmlFile << "<td class=\"s1\" align=\"center\">< SA >HB (Signal) </td>" << std::endl;
8450  htmlFile << "<td class=\"s1\" align=\"center\">< Occup. > HB (Signal) </td>" << std::endl;
8451  htmlFile << "<td class=\"s1\" align=\"center\">< SA >HF (Signal) </td>" << std::endl;
8452  htmlFile << "<td class=\"s1\" align=\"center\">< Occup. > HF (Signal) </td>" << std::endl;
8453 
8454  htmlFile << "<td class=\"s1\" align=\"center\">< SA >HB (NoSignal) </td>" << std::endl;
8455  htmlFile << "<td class=\"s1\" align=\"center\">< Occup. > HB (NoSignal) </td>" << std::endl;
8456  htmlFile << "<td class=\"s1\" align=\"center\">< SA >HF (NoSignal) </td>" << std::endl;
8457  htmlFile << "<td class=\"s1\" align=\"center\">< Occup. > HF (NoSignal) </td>" << std::endl;
8458 
8459  htmlFile << "<td class=\"s1\" align=\"center\"> maxSA HB </td>" << std::endl;
8460  htmlFile << "<td class=\"s1\" align=\"center\"> maxOccup. HB </td>" << std::endl;
8461  htmlFile << "<td class=\"s1\" align=\"center\"> maxSA HF </td>" << std::endl;
8462  htmlFile << "<td class=\"s1\" align=\"center\"> maxOccup. HF </td>" << std::endl;
8463 
8464  htmlFile << "</tr>" << std::endl;
8465 
8466  ind = 0;
8467  for (int i = 1; i <= MaxLum; i++) {
8468  if ((ind % 2) == 1)
8469  raw_class = "<td class=\"s2\" align=\"center\">";
8470  else
8471  raw_class = "<td class=\"s3\" align=\"center\">";
8472  htmlFile << "<tr>" << std::endl;
8473 
8474  htmlFile << "<td class=\"s4\" align=\"center\">" << i << "</td>" << std::endl;
8475 
8476  // htmlFile << raw_class<< LumLum->GetBinContent(i)<<"</td>"<< std::endl;
8477  htmlFile << raw_class << LumiEv->GetBinContent(i) << "</td>" << std::endl;
8478 
8479  // (test==1) <Amplitude>
8480  int test = 1;
8481  // for (int k=k_min[sub];k<=k_max[sub]; k++) {
8482  for (int sub = 1; sub <= 4; sub++) {
8483  for (int k = k_min[sub]; k <= k_min[sub]; k++) {
8484  if (HistNumBadChanDepth[test][sub][k]->GetBinContent(i) > Cut0[test][sub][k])
8485  htmlFile << "<td class=\"s6\" align=\"center\">" << HistNumBadChanDepth[test][sub][k]->GetBinContent(i)
8486  << "</td>" << std::endl;
8487 
8488  else
8489  htmlFile << raw_class << HistNumBadChanDepth[test][sub][k]->GetBinContent(i) << "</td>" << std::endl;
8490  }
8491  }
8492  if (SummedAmplitudeHisto[0]) {
8493  htmlFile << raw_class << SummedAmplitudeHisto[0]->GetBinContent(i) << "</td>" << std::endl;
8494  htmlFile << raw_class << SummedAmplitudeOccupancyHisto[0]->GetBinContent(i) << "</td>" << std::endl;
8495  htmlFile << raw_class << SummedAmplitudeHisto[3]->GetBinContent(i) << "</td>" << std::endl;
8496  htmlFile << raw_class << SummedAmplitudeOccupancyHisto[3]->GetBinContent(i) << "</td>" << std::endl;
8497 
8498  htmlFile << raw_class << NoSignalSummedAmplitudeHisto[0]->GetBinContent(i) << "</td>" << std::endl;
8499  htmlFile << raw_class << NoSignalSummedAmplitudeOccupancyHisto[0]->GetBinContent(i) << "</td>" << std::endl;
8500  htmlFile << raw_class << NoSignalSummedAmplitudeHisto[3]->GetBinContent(i) << "</td>" << std::endl;
8501  htmlFile << raw_class << NoSignalSummedAmplitudeOccupancyHisto[3]->GetBinContent(i) << "</td>" << std::endl;
8502 
8503  htmlFile << raw_class << MaxxSummedAmplitudeHisto[0]->GetBinContent(i) << "</td>" << std::endl;
8504  htmlFile << raw_class << MaxxSummedAmplitudeOccupancyHisto[0]->GetBinContent(i) << "</td>" << std::endl;
8505  htmlFile << raw_class << MaxxSummedAmplitudeHisto[3]->GetBinContent(i) << "</td>" << std::endl;
8506  htmlFile << raw_class << MaxxSummedAmplitudeOccupancyHisto[3]->GetBinContent(i) << "</td>" << std::endl;
8507  }
8508  htmlFile << "</tr>" << std::endl;
8509  ind += 1;
8510  }
8511  htmlFile << "</table>" << std::endl;
8512  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
8513 
8514  htmlFile << "<br>" << std::endl;
8515  htmlFile << "</body> " << std::endl;
8516  htmlFile << "</html> " << std::endl;
8517  htmlFile.close();
8518 
8519  //====================================================================== // Creating description of html-files
8520 
8521  /*
8522  //======================================================================
8523  // Creating description HELP.html file:
8524  htmlFile.open("HELP.html");
8525  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">"<< std::endl;
8526  htmlFile << "<head>"<< std::endl;
8527  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>"<< std::endl;
8528  htmlFile << "<title> Certification Monitoring Tool </title>"<< std::endl;
8529  htmlFile << "<style type=\"text/css\">"<< std::endl;
8530  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"<< std::endl;
8531  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }"<< std::endl;
8532  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; text-align: center;}"<< std::endl;
8533  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }"<< std::endl;
8534  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }"<< std::endl;
8535  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }"<< std::endl;
8536  htmlFile << "</style>"<< std::endl;
8537  htmlFile << "<body>"<< std::endl;
8538  htmlFile << "<h1> Description of Remote Monitoring Tool criteria for bad channel selection</h1>"<< std::endl;
8539  htmlFile << "<br>"<< std::endl;
8540  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;
8541  htmlFile << "<br>"<< std::endl;
8542  htmlFile << "<h3> - Amplitude is full amplitude collected over all time slices </h3> "<< std::endl;
8543  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;
8544  htmlFile << "<br>"<< std::endl;
8545  htmlFile << "<h3> - Width of shape distribution. Width is defined as square root from dispersion. </h3> "<< std::endl;
8546  htmlFile << "<br>"<< std::endl;
8547  htmlFile << "<h3> - Mean TS time slice position of adc signal. </h3> "<< std::endl;
8548  htmlFile << "<br>"<< std::endl;
8549  htmlFile << "<h3> - TS number of maximum signal </h3> "<< std::endl;
8550  htmlFile << "<br>"<< std::endl;
8551  htmlFile << "<h3> For more details see https://twiki.cern.ch/twiki/bin/viewauth/CMS/HcalRemoteCertificationMonitoring </h3> "<< std::endl;
8552  htmlFile << "</body> " << std::endl;
8553  htmlFile << "</html> " << std::endl;
8554  htmlFile.close();
8555 */
8556  //======================================================================
8557  // Creating description CMTresults.html file:
8558  htmlFile.open("CMTresults.html");
8559  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
8560  htmlFile << "<head>" << std::endl;
8561  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
8562  htmlFile << "<title> Certification Monitoring Tool </title>" << std::endl;
8563  htmlFile << "<style type=\"text/css\">" << std::endl;
8564  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
8565  << std::endl;
8566  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
8567  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
8568  "text-align: center;}"
8569  << std::endl;
8570  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
8571  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
8572  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
8573  htmlFile << "</style>" << std::endl;
8574  htmlFile << "<body>" << std::endl;
8575  htmlFile << "<h1> LS-certification (recommendation) from analysis of CMT-dependencies of THIS run </h1>"
8576  << std::endl;
8577  htmlFile << "<br>" << std::endl;
8578  htmlFile << "<br>" << std::endl;
8579  htmlFile << "<h2> - List of suspicious LSs: </h2> " << std::endl;
8580  htmlFile << "<br>" << std::endl;
8581  htmlFile << "<h3> to be added </h3> " << std::endl;
8582  htmlFile << "<br>" << std::endl;
8583  htmlFile << "<br>" << std::endl;
8584  htmlFile << "<br>" << std::endl;
8585  htmlFile << "<h2> - Comments: </h2> " << std::endl;
8586  htmlFile << "<br>" << std::endl;
8587  htmlFile << "<h3> to be added </h3> " << std::endl;
8588  htmlFile << "<br>" << std::endl;
8589  htmlFile << "<br>" << std::endl;
8590  htmlFile << "<br>" << std::endl;
8591  htmlFile << "</body> " << std::endl;
8592  htmlFile << "</html> " << std::endl;
8593  htmlFile.close();
8594 
8595  //======================================================================
8596  // Creating main html file:
8597 
8598  htmlFile.open("LumiList.html");
8599  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
8600  htmlFile << "<head>" << std::endl;
8601  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
8602  htmlFile << "<title> Certification Monitoring Tool </title>" << std::endl;
8603  htmlFile << "<style type=\"text/css\">" << std::endl;
8604  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
8605  << std::endl;
8606  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
8607  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
8608  "text-align: center;}"
8609  << std::endl;
8610  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
8611  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
8612  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
8613  htmlFile << " td.s5 { font-family: arial, arial ce, helvetica; background-color: #00FF00; }" << std::endl;
8614  htmlFile << " td.s6 { font-family: arial, arial ce, helvetica; background-color: #FF0000; }" << std::endl;
8615 
8616  htmlFile << "</style>" << std::endl;
8617  htmlFile << "<body>" << std::endl;
8618 
8619  htmlFile << "<h1> Certification Monitoring Tool, GLOBAL RUN = " << runnumber << ". </h1>" << std::endl;
8620  htmlFile << "<br>" << std::endl;
8621  htmlFile << " <td><a "
8622  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
8623  "HcalRemoteMonitoring/CMT/GLOBAL_"
8624  << runnumber << "/CMTresults.html\"> CMT-analysis RESULTS (for this run) </a></td>" << std::endl;
8625  htmlFile << "<br>" << std::endl;
8626  htmlFile << "<br>" << std::endl;
8627 
8628  // htmlFile << "<h2> 1. General information </h2>"<< std::endl;
8629  htmlFile << "<h2> 1. General information (Full number of LS = " << MaxLum << " ). </h2>" << std::endl;
8630  htmlFile << " <img src=\"LumiEvent.png\" />" << std::endl;
8631  htmlFile << "<br>" << std::endl;
8632 
8633  htmlFile << "<h2> 2. HCAL status for different criteria </h2>" << std::endl;
8634  // htmlFile << " <td><a href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/CMT/GLOBAL_"<<runnumber<<"/HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
8635  htmlFile << " <td><a "
8636  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
8637  "HcalRemoteMonitoring/CMT/HELP.html\"> Description of criteria for bad channel selection</a></td>"
8638  << std::endl;
8639  htmlFile << "<br>" << std::endl;
8640  htmlFile << "<table width=\"600\">" << std::endl;
8641  htmlFile << "<tr>" << std::endl;
8642  htmlFile << " <td><a "
8643  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
8644  "HcalRemoteMonitoring/CMT/GLOBAL_"
8645  << runnumber << "/CapID_GL.html\">Cap ID errors</a></td>" << std::endl;
8646  // AZ 18.03.2018
8647  // htmlFile << " <td><a href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/CMT/GLOBAL_"<<runnumber<<"/ADCampl_GL.html\">Amplitude</a></td>"<< std::endl;
8648  htmlFile << " <td><a href=\"ADCampl_GL.html\">Amplitude</a></td>" << std::endl;
8649  htmlFile << " <td><a "
8650  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
8651  "HcalRemoteMonitoring/CMT/GLOBAL_"
8652  << runnumber << "/Width_GL.html\">Width</a></td>" << std::endl;
8653  htmlFile << " <td><a "
8654  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
8655  "HcalRemoteMonitoring/CMT/GLOBAL_"
8656  << runnumber << "/Ratio_GL.html\">Ratio</a></td>" << std::endl;
8657  htmlFile << " <td><a "
8658  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
8659  "HcalRemoteMonitoring/CMT/GLOBAL_"
8660  << runnumber << "/Tmean_GL.html\">TS mean</a></td>" << std::endl;
8661  htmlFile << " <td><a "
8662  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
8663  "HcalRemoteMonitoring/CMT/GLOBAL_"
8664  << runnumber << "/Tmax_GL.html\">TS max</a></td>" << std::endl;
8665 
8666  htmlFile << " <td><a "
8667  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
8668  "HcalRemoteMonitoring/CMT/GLOBAL_"
8669  << runnumber << "/SummedAmplitudes_GL.html\">SummedAmplitudes</a></td>" << std::endl;
8670 
8671  htmlFile << "</tr>" << std::endl;
8672  htmlFile << "</table>" << std::endl;
8673  htmlFile << "<br>" << std::endl;
8674  htmlFile << "</body> " << std::endl;
8675  htmlFile << "</html> " << std::endl;
8676  htmlFile.close();
8677  //======================================================================
8678 
8679  //======================================================================
8680  // Close and delete all possible things:
8681  hfile->Close();
8682  // hfile->Delete();
8683  // Exit Root
8684  gSystem->Exit(0);
8685  //======================================================================
8686 }
#define NULL
Definition: scimark2.h:8
double isum
T sqrt(T t)
Definition: SSEVec.h:19
uint16_t const *__restrict__ x
Definition: gpuClustering.h:39
int copyContents(TH1F **hDest, TString hname, TString htitle, const TH1F *hSrc, int lastBin)
tuple argc
Definition: dir2webdir.py:39
string fname
main script
tuple cout
Definition: gather_cfg.py:144