CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
RemoteMonitoringGLOBAL.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 
)

Definition at line 8654 of file RemoteMonitoringGLOBAL.cc.

References gather_cfg::cout.

Referenced by main().

8654  {
8655  if (lastBin > hSrc->GetNbinsX()) {
8656  std::cout << "copyContents from " << hSrc->GetName() << ": histo has " << hSrc->GetNbinsX()
8657  << " bins, when lastBin=" << lastBin << " was requested\n";
8658  return 0;
8659  }
8660 
8661  (*hDest) = new TH1F(hname, htitle, lastBin, 0, lastBin);
8662  (*hDest)->SetDirectory(0);
8663  (*hDest)->SetStats(0);
8664 
8665  for (int ibin = 1; ibin <= lastBin; ibin++) {
8666  (*hDest)->SetBinContent(ibin, hSrc->GetBinContent(ibin));
8667  (*hDest)->SetBinError(ibin, hSrc->GetBinError(ibin));
8668  }
8669  return 1;
8670 }
tuple cout
Definition: gather_cfg.py:144
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 37 of file RemoteMonitoringGLOBAL.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.

37  {
38  gROOT->Reset();
39  gROOT->SetStyle("Plain");
40  gStyle->SetOptStat(0);
41  gStyle->SetOptTitle(1);
42 
43  if (argc < 1)
44  return 1;
45  char fname[300];
46  sprintf(fname, "%s", argv[1]);
47  std::cout << fname << std::endl;
48 
49  //======================================================================
50  // Connect the input files, parameters and get the 2-d histogram in memory
51  // TFile *hfile= new TFile("GlobalHist.root", "READ");
52  string promt = (string)fname;
53  string runnumber = "";
54  for (unsigned int i = promt.size() - 11; i < promt.size() - 5; i++)
55  runnumber += fname[i];
56 
57  TFile *hfile = new TFile(fname, "READ");
58  // Cut [test][sub][depth]
59  // Empty HB HE HO HF
60  double Cut0[7][5][8] = {
61  {{0., 0., 0., 0., 0., 0., 0., 0.},
62  {0., 1.0, 1.0, 0., 0., 0., 0., 0.},
63  {0., 1., 1., 1., 0., 0., 0., 0.},
64  {0., 0., 0., 0., 1., 0., 0., 0.},
65  {0., 1., 1., 0., 0., 0., 0., 0.}}, //CapID 0,HB,HE,HO,HF
66  // {{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
67  {{0., 0., 0., 0., 0., 0., 0., 0.},
68  {0., 3500., 3500., 3500., 3500., 0., 0., 0.},
69  {0., 12000., 4500., 3500., 3500., 4000., 4500., 5500.},
70  {0., 0., 0., 0., 200., 0., 0., 0.},
71  {0., 4500., 4500., 4500., 4500., 0., 0., 0.}}, //Amplitude 0,HB,HE,HO,HF
72  {{0., 0., 0., 0., 0., 0., 0., 0.},
73  {0., 3., 3., 0., 0., 0., 0., 0.},
74  {0., 3., 3., 3., 0., 0., 0., 0.},
75  {0., 0., 0., 0., 3., 0., 0., 0.},
76  {0., 2., 2., 0., 0., 0., 0., 0.}}, //Width 0,HB,HE,HO,HF
77  {{0., 0., 0., 0., 0., 0., 0., 0.},
78  {0., 0.4, 0.4, 0., 0., 0., 0., 0.},
79  {0., 0.4, 0.4, 0.4, 0., 0., 0., 0.},
80  {0., 0., 0., 0., 0.4, 0., 0., 0.},
81  {0., 0.8, 0.8, 0., 0., 0., 0., 0.}}, //Ratio 0,HB,HE,HO,HF
82  {{0., 0., 0., 0., 0., 0., 0., 0.},
83  {0., 4.7, 4.7, 0., 0., 0., 0., 0.},
84  {0., 4.8, 4.8, 5.0, 0., 0., 0., 0.},
85  {0., 0., 0., 0., 4.8, 0., 0., 0.},
86  {0., 4.0, 4.0, 0., 0., 0., 0., 0.}}, //TSn 0,HB,HE,HO,HF
87  {{0., 0., 0., 0., 0., 0., 0., 0.},
88  {0., 3.5, 3.5, 0., 0., 0., 0., 0.},
89  {0., 4.0, 4.0, 4.0, 0., 0., 0., 0.},
90  {0., 0., 0., 0., 3., 0., 0., 0.},
91  {0., 3.5, 3.5, 0., 0., 0., 0., 0.}}, //TSx 0,HB,HE,HO,HF
92  {{0., 0., 0., 0., 0., 0., 0., 0.},
93  {0., 0., 0., 0., 0., 0., 0., 0.},
94  {0., 0., 0., 0., 0., 0., 0., 0.},
95  {0., 0., 0., 0., 0., 0., 0., 0.},
96  {0., 0., 0., 0., 0., 0., 0., 0.}}}; //Empty
97 
98  double CutAb[5][8] = {{0., 0., 0., 0., 0., 0., 0., 0.},
99  {0., 20., 7., 0., 0., 0., 0., 0.},
100  {0., 16., 13., 4., 0., 0., 0., 0.},
101  {0., 0., 0., 0., 45., 0., 0., 0.},
102  {0., 10., 5., 0., 0., 0., 0., 0.}}; // cut 1 for CapIdErrors 0,HB,HE,HO,HF
103 
104  double CutPo[5][8] = {{0., 0., 0., 0., 0., 0., 0., 0.},
105  {0., 9., 3., 0., 0., 0., 0., 0.},
106  {0., 8., 6., 2., 0., 0., 0., 0.},
107  {0., 0., 0., 0., 20., 0., 0., 0.},
108  {0., 5., 3., 0., 0., 0., 0., 0.}}; //cut 3 for CapIdErrors (portions) 0,HB,HE,HO,HF
109 
110  //======================================================================
111 
112  // CUTs FOR IPHI RBX:
113  int cutA_HB = 100;
114  int cutA_HE = 6000;
115  int cutA_HO = 150;
116  int cutA_HF = 500;
117  // CUTs FOR IETA RBX:
118  int cutB_HB = 100;
119  int cutB_HE = 10000;
120  int cutB_HO = 150;
121  int cutB_HF = 500;
122 
123  //======================================================================
124  // Prepare histograms and plot them to .png files
125  TCanvas *c1 = new TCanvas("c1", "Hcal4test", 200, 10, 700, 900);
126 
127  TCanvas *cHB = new TCanvas("cHB", "cHB", 1000, 500);
128  TCanvas *cHE = new TCanvas("cHE", "cHE", 1500, 500);
129  TCanvas *cONE = new TCanvas("cONE", "cONE", 500, 500);
130  TCanvas *cFour = new TCanvas("cFour", "cFour", 1500, 1000);
131  TCanvas *cFour1 = new TCanvas("cFour1", "cFour1", 1200, 800);
132  TCanvas *cNine = new TCanvas("cNine", "cNine", 1500, 1500);
133 
134  // RBX:
135  // TCanvas *c4x6 = new TCanvas("c4x6","c4x6",1500,3000);
136  TCanvas *c4x6 = new TCanvas("c4x6", "c4x6", 1200, 2400);
137  //TCanvas *c5x6 = new TCanvas("c5x6","c5x6",2000,3000);
138  TCanvas *c5x6 = new TCanvas("c5x6", "c5x6", 1500, 2400);
139  // TCanvas *cRBX1 = new TCanvas("cRBX1","cRBX1",200,10,1300,1110);
140  TCanvas *cRBX1 = new TCanvas("cRBX1", "cRBX1", 1200, 1000);
141  //
142  // TCanvas *cRBX31 = new TCanvas("cRBX31","cRBX31",1800,600);
143  TCanvas *cRBX31 = new TCanvas("cRBX31", "cRBX31", 1860, 600);
144  // TCanvas *cRBX31 = new TCanvas("cRBX31","cRBX31",200,10,,1800,600);
145 
146  // char *str = (char*)alloca(10000);
147 
148  int k_min[5] = {0, 1, 1, 4, 1}; // minimum depth for each subdet HB HE HO HF
149 
150  int k_max[5] = {0, 2, 3, 4, 2}; // maximum depth for each subdet HB HE HO HF
151  // int k_maxupgrade[5]={0,2,3,4,4}; // maximum depth for each subdet HB HE HO HF
152  int k_maxupgrade[5] = {0, 4, 7, 4, 4}; // maximum depth for each subdet HB HE HO HF
153 
154  //+++++++++++++++++++++++++++++
155  // Lumi iLumi and number of events
156  //+++++++++++++++++++++++++++++
157  cHB->Divide(2, 1);
158  cHB->cd(1);
159  TH1F *LumLum = (TH1F *)hfile->Get("h_lsnumber_per_eachLS");
160  int MaxLumDanila = LumLum->GetBinContent(LumLum->GetMaximumBin()); // old variant of Danila
161  cout << " MaxLumDanila= " << MaxLumDanila << endl;
162  gPad->SetGridy();
163  gPad->SetGridx();
164  LumLum->SetMarkerStyle(10);
165  LumLum->SetMarkerSize(0.8);
166  LumLum->GetYaxis()->SetLabelSize(0.04);
167  LumLum->SetTitle("Cont. number per LS \b");
168  LumLum->SetXTitle("Cont.number \b");
169  LumLum->SetYTitle("Ls \b");
170  LumLum->SetMarkerColor(4);
171  LumLum->SetLineColor(0);
172  LumLum->SetMinimum(0.8);
173  LumLum->GetXaxis()->SetRangeUser(0, MaxLumDanila);
174  LumLum->Draw("Error");
175 
176  cHB->cd(2);
177  TH1F *LumiEv = (TH1F *)hfile->Get("h_nevents_per_eachRealLS");
178  int MaxLum0 = LumiEv->GetBinContent(LumiEv->GetMaximumBin());
179  int MaxLum = 0;
180  for (int i = 1; i <= LumiEv->GetXaxis()->GetNbins(); i++) {
181  if (LumiEv->GetBinContent(i)) {
182  MaxLum = i;
183  }
184  }
185  cout << " MaxLum0= " << MaxLum0 << " MaxLum= " << MaxLum << endl;
186 
187  gPad->SetGridy();
188  gPad->SetGridx();
189  gPad->SetLogy();
190  // gPad->SetLogx();
191  LumiEv->GetYaxis()->SetLabelSize(0.04);
192  LumiEv->SetTitle("Number of events per LS");
193  LumiEv->SetXTitle("LS");
194  LumiEv->SetYTitle("Number of events ");
195  LumiEv->SetMarkerStyle(10);
196  LumiEv->SetMarkerSize(0.8);
197  LumiEv->SetMarkerColor(4);
198  LumiEv->SetLineColor(0);
199  // LumiEv->SetMinimum(0.8);
200  LumiEv->GetXaxis()->SetRangeUser(0, MaxLum);
201  LumiEv->Draw("Error");
202 
203  cHB->Print("LumiEvent.png");
204  cHB->Clear();
205 
206  //=======================================================================================================
207  // Shape criteria: 1d histogram first definition
208  //=======================================================================================================
209  TH1F *H_NumBadChanDepth[7][5][5]; // 1d histogramm for test,subdet, depth
210 
211  //+++++++++++++++++++++++++++++
212  // ADC Amplitude
213  //+++++++++++++++++++++++++++++
214 
215  H_NumBadChanDepth[1][1][1] = (TH1F *)hfile->Get("h_sumADCAmplLS1");
216  H_NumBadChanDepth[1][1][2] = (TH1F *)hfile->Get("h_sumADCAmplLS2");
217 
218  H_NumBadChanDepth[1][2][1] = (TH1F *)hfile->Get("h_sumADCAmplLS3");
219  H_NumBadChanDepth[1][2][2] = (TH1F *)hfile->Get("h_sumADCAmplLS4");
220  H_NumBadChanDepth[1][2][3] = (TH1F *)hfile->Get("h_sumADCAmplLS5");
221 
222  H_NumBadChanDepth[1][3][4] = (TH1F *)hfile->Get("h_sumADCAmplLS8");
223 
224  H_NumBadChanDepth[1][4][1] = (TH1F *)hfile->Get("h_sumADCAmplLS6");
225  H_NumBadChanDepth[1][4][2] = (TH1F *)hfile->Get("h_sumADCAmplLS7");
226 
227  //+++++++++++++++++++++++++++++
228  // Width
229  //+++++++++++++++++++++++++++++
230 
231  H_NumBadChanDepth[2][1][1] = (TH1F *)hfile->Get("h_sumAmplitudeLS1");
232  H_NumBadChanDepth[2][1][2] = (TH1F *)hfile->Get("h_sumAmplitudeLS2");
233 
234  H_NumBadChanDepth[2][2][1] = (TH1F *)hfile->Get("h_sumAmplitudeLS3");
235  H_NumBadChanDepth[2][2][2] = (TH1F *)hfile->Get("h_sumAmplitudeLS4");
236  H_NumBadChanDepth[2][2][3] = (TH1F *)hfile->Get("h_sumAmplitudeLS5");
237 
238  H_NumBadChanDepth[2][3][4] = (TH1F *)hfile->Get("h_sumAmplitudeLS8");
239 
240  H_NumBadChanDepth[2][4][1] = (TH1F *)hfile->Get("h_sumAmplitudeLS6");
241  H_NumBadChanDepth[2][4][2] = (TH1F *)hfile->Get("h_sumAmplitudeLS7");
242 
243  //+++++++++++++++++++++++++++++
244  // Ratio
245  //+++++++++++++++++++++++++++++
246 
247  H_NumBadChanDepth[3][1][1] = (TH1F *)hfile->Get("h_sumAmplLS1");
248  H_NumBadChanDepth[3][1][2] = (TH1F *)hfile->Get("h_sumAmplLS2");
249 
250  H_NumBadChanDepth[3][2][1] = (TH1F *)hfile->Get("h_sumAmplLS3");
251  H_NumBadChanDepth[3][2][2] = (TH1F *)hfile->Get("h_sumAmplLS4");
252  H_NumBadChanDepth[3][2][3] = (TH1F *)hfile->Get("h_sumAmplLS5");
253 
254  H_NumBadChanDepth[3][3][4] = (TH1F *)hfile->Get("h_sumAmplLS8");
255 
256  H_NumBadChanDepth[3][4][1] = (TH1F *)hfile->Get("h_sumAmplLS6");
257  H_NumBadChanDepth[3][4][2] = (TH1F *)hfile->Get("h_sumAmplLS7");
258 
259  //+++++++++++++++++++++++++++++
260  // Tmean
261  //+++++++++++++++++++++++++++++
262 
263  H_NumBadChanDepth[4][1][1] = (TH1F *)hfile->Get("h_sumTSmeanALS1");
264  H_NumBadChanDepth[4][1][2] = (TH1F *)hfile->Get("h_sumTSmeanALS2");
265 
266  H_NumBadChanDepth[4][2][1] = (TH1F *)hfile->Get("h_sumTSmeanALS3");
267  H_NumBadChanDepth[4][2][2] = (TH1F *)hfile->Get("h_sumTSmeanALS4");
268  H_NumBadChanDepth[4][2][3] = (TH1F *)hfile->Get("h_sumTSmeanALS5");
269 
270  H_NumBadChanDepth[4][3][4] = (TH1F *)hfile->Get("h_sumTSmeanALS8");
271 
272  H_NumBadChanDepth[4][4][1] = (TH1F *)hfile->Get("h_sumTSmeanALS6");
273  H_NumBadChanDepth[4][4][2] = (TH1F *)hfile->Get("h_sumTSmeanALS7");
274 
275  //+++++++++++++++++++++++++++++
276  // Tmax
277  //+++++++++++++++++++++++++++++
278 
279  H_NumBadChanDepth[5][1][1] = (TH1F *)hfile->Get("h_sumTSmaxALS1");
280  H_NumBadChanDepth[5][1][2] = (TH1F *)hfile->Get("h_sumTSmaxALS2");
281 
282  H_NumBadChanDepth[5][2][1] = (TH1F *)hfile->Get("h_sumTSmaxALS3");
283  H_NumBadChanDepth[5][2][2] = (TH1F *)hfile->Get("h_sumTSmaxALS4");
284  H_NumBadChanDepth[5][2][3] = (TH1F *)hfile->Get("h_sumTSmaxALS5");
285 
286  H_NumBadChanDepth[5][3][4] = (TH1F *)hfile->Get("h_sumTSmaxALS8");
287 
288  H_NumBadChanDepth[5][4][1] = (TH1F *)hfile->Get("h_sumTSmaxALS6");
289  H_NumBadChanDepth[5][4][2] = (TH1F *)hfile->Get("h_sumTSmaxALS7");
290 
291  gStyle->SetOptStat(110000);
292 
293  for (int test = 1; test <= 5; test++) { //Test: 0,
294  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
295  if (sub == 1)
296  cHB->Divide(2, 1);
297  if (sub == 2)
298  cHE->Divide(3, 1);
299  if (sub == 3)
300  cONE->Divide(1, 1);
301  if (sub == 4)
302  cHB->Divide(2, 1);
303  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
304  if (sub == 1)
305  cHB->cd(k);
306  if (sub == 2)
307  cHE->cd(k);
308  if (sub == 3)
309  cONE->cd(k - 3);
310  if (sub == 4)
311  cHB->cd(k);
312  gPad->SetGridy();
313  gPad->SetGridx();
314  gPad->SetLogy();
315  H_NumBadChanDepth[test][sub][k]->SetMarkerStyle(20);
316  H_NumBadChanDepth[test][sub][k]->SetMarkerSize(0.8);
317  if (k == 1)
318  H_NumBadChanDepth[test][sub][k]->SetTitle("Depth 1\b");
319  if (k == 2)
320  H_NumBadChanDepth[test][sub][k]->SetTitle("Depth 2\b");
321  if (k == 3)
322  H_NumBadChanDepth[test][sub][k]->SetTitle("Depth 3\b");
323  if (k == 4)
324  H_NumBadChanDepth[test][sub][k]->SetTitle("Depth 4\b");
325  if (test == 1)
326  H_NumBadChanDepth[test][sub][k]->SetXTitle(" <Amplitude> \b");
327  if (test == 2)
328  H_NumBadChanDepth[test][sub][k]->SetXTitle(" <Width> \b");
329  if (test == 3)
330  H_NumBadChanDepth[test][sub][k]->SetXTitle(" <Ratio> \b");
331  if (test == 4)
332  H_NumBadChanDepth[test][sub][k]->SetXTitle(" <TS mean> \b");
333  if (test == 5)
334  H_NumBadChanDepth[test][sub][k]->SetXTitle(" <TS max> \b");
335  H_NumBadChanDepth[test][sub][k]->SetYTitle("Number of channel-LSs\b");
336  H_NumBadChanDepth[test][sub][k]->SetMarkerColor(4);
337  H_NumBadChanDepth[test][sub][k]->SetLineColor(0);
338  // H_NumBadChanDepth[test][sub][k]->GetXaxis()->SetRangeUser(0, MaxLum);
339  H_NumBadChanDepth[test][sub][k]->SetMinimum(0.8);
340  H_NumBadChanDepth[test][sub][k]->Draw("Error");
341  }
342  if (test == 0) {
343  if (sub == 1) {
344  cHB->Print("H_NBCMNHB.png");
345  cHB->Clear();
346  }
347  if (sub == 2) {
348  cHE->Print("H_NBCMNHE.png");
349  cHE->Clear();
350  }
351  if (sub == 3) {
352  cONE->Print("H_NBCMNHO.png");
353  cONE->Clear();
354  }
355  if (sub == 4) {
356  cHB->Print("H_NBCMNHF.png");
357  cHB->Clear();
358  }
359  }
360 
361  if (test == 1) {
362  if (sub == 1) {
363  cHB->Print("H_ADCamplHB.png");
364  cHB->Clear();
365  }
366  if (sub == 2) {
367  cHE->Print("H_ADCamplHE.png");
368  cHE->Clear();
369  }
370  if (sub == 3) {
371  cONE->Print("H_ADCamplHO.png");
372  cONE->Clear();
373  }
374  if (sub == 4) {
375  cHB->Print("H_ADCamplHF.png");
376  cHB->Clear();
377  }
378  }
379  if (test == 2) {
380  if (sub == 1) {
381  cHB->Print("H_WidthHB.png");
382  cHB->Clear();
383  }
384  if (sub == 2) {
385  cHE->Print("H_WidthHE.png");
386  cHE->Clear();
387  }
388  if (sub == 3) {
389  cONE->Print("H_WidthHO.png");
390  cONE->Clear();
391  }
392  if (sub == 4) {
393  cHB->Print("H_WidthHF.png");
394  cHB->Clear();
395  }
396  }
397  if (test == 3) {
398  if (sub == 1) {
399  cHB->Print("H_RatioHB.png");
400  cHB->Clear();
401  }
402  if (sub == 2) {
403  cHE->Print("H_RatioHE.png");
404  cHE->Clear();
405  }
406  if (sub == 3) {
407  cONE->Print("H_RatioHO.png");
408  cONE->Clear();
409  }
410  if (sub == 4) {
411  cHB->Print("H_RatioHF.png");
412  cHB->Clear();
413  }
414  }
415  if (test == 4) {
416  if (sub == 1) {
417  cHB->Print("H_TmeanHB.png");
418  cHB->Clear();
419  }
420  if (sub == 2) {
421  cHE->Print("H_TmeanHE.png");
422  cHE->Clear();
423  }
424  if (sub == 3) {
425  cONE->Print("H_TmeanHO.png");
426  cONE->Clear();
427  }
428  if (sub == 4) {
429  cHB->Print("H_TmeanHF.png");
430  cHB->Clear();
431  }
432  }
433  if (test == 5) {
434  if (sub == 1) {
435  cHB->Print("H_TmaxHB.png");
436  cHB->Clear();
437  }
438  if (sub == 2) {
439  cHE->Print("H_TmaxHE.png");
440  cHE->Clear();
441  }
442  if (sub == 3) {
443  cONE->Print("H_TmaxHO.png");
444  cONE->Clear();
445  }
446  if (sub == 4) {
447  cHB->Print("H_TmaxHF.png");
448  cHB->Clear();
449  }
450  }
451  } // end sub
452  } //end test
453 
454  gStyle->SetOptStat(0);
455  //================================================================================================================================
456 
457  //=======================================================================================================
458  // 2-d histograms second definition
459  //=========================================================
460  TH2F *MapNumBadChanDepth[7][5][5]; // 1d Mapogramm for test,subdet, depth
461  TH2F *MapNumChanDepth[7][5][5]; // 1d Mapogramm for test,subdet, depth
462  TH2F *MapNumBadChanFull[7]; // 1d Mapogramm for test
463  TH2F *MapNumChanFull[7]; // 1d Mapogramm for test
464 
465  //+++++++++++++++++++++++++++++
466  // CapID
467  //+++++++++++++++++++++++++++++
468 
469  MapNumBadChanDepth[0][1][1] = (TH2F *)hfile->Get("h_mapDepth1Error_HB");
470  MapNumBadChanDepth[0][1][2] = (TH2F *)hfile->Get("h_mapDepth2Error_HB");
471 
472  MapNumBadChanDepth[0][2][1] = (TH2F *)hfile->Get("h_mapDepth1Error_HE");
473  MapNumBadChanDepth[0][2][2] = (TH2F *)hfile->Get("h_mapDepth2Error_HE");
474  MapNumBadChanDepth[0][2][3] = (TH2F *)hfile->Get("h_mapDepth3Error_HE");
475 
476  MapNumBadChanDepth[0][3][4] = (TH2F *)hfile->Get("h_mapDepth4Error_HO");
477 
478  MapNumBadChanDepth[0][4][1] = (TH2F *)hfile->Get("h_mapDepth1Error_HF");
479  MapNumBadChanDepth[0][4][2] = (TH2F *)hfile->Get("h_mapDepth2Error_HF");
480 
481  MapNumBadChanFull[0] = (TH2F *)MapNumBadChanDepth[0][1][1]->Clone();
482 
483  MapNumChanDepth[0][1][1] = (TH2F *)hfile->Get("h_mapDepth1_HB");
484  MapNumChanDepth[0][1][2] = (TH2F *)hfile->Get("h_mapDepth2_HB");
485 
486  MapNumChanDepth[0][2][1] = (TH2F *)hfile->Get("h_mapDepth1_HE");
487  MapNumChanDepth[0][2][2] = (TH2F *)hfile->Get("h_mapDepth2_HE");
488  MapNumChanDepth[0][2][3] = (TH2F *)hfile->Get("h_mapDepth3_HE");
489 
490  MapNumChanDepth[0][3][4] = (TH2F *)hfile->Get("h_mapDepth4_HO");
491 
492  MapNumChanDepth[0][4][1] = (TH2F *)hfile->Get("h_mapDepth1_HF");
493  MapNumChanDepth[0][4][2] = (TH2F *)hfile->Get("h_mapDepth2_HF");
494 
495  MapNumChanFull[0] = (TH2F *)MapNumChanDepth[0][1][1]->Clone();
496 
497  //+++++++++++++++++++++++++++++
498  // ADC Amplitude
499  //+++++++++++++++++++++++++++++
500 
501  MapNumBadChanDepth[1][1][1] = (TH2F *)hfile->Get("h_2DsumADCAmplLS1");
502  MapNumBadChanDepth[1][1][2] = (TH2F *)hfile->Get("h_2DsumADCAmplLS2");
503 
504  MapNumBadChanDepth[1][2][1] = (TH2F *)hfile->Get("h_2DsumADCAmplLS3");
505  MapNumBadChanDepth[1][2][2] = (TH2F *)hfile->Get("h_2DsumADCAmplLS4");
506  MapNumBadChanDepth[1][2][3] = (TH2F *)hfile->Get("h_2DsumADCAmplLS5");
507 
508  MapNumBadChanDepth[1][3][4] = (TH2F *)hfile->Get("h_2DsumADCAmplLS8");
509 
510  MapNumBadChanDepth[1][4][1] = (TH2F *)hfile->Get("h_2DsumADCAmplLS6");
511  MapNumBadChanDepth[1][4][2] = (TH2F *)hfile->Get("h_2DsumADCAmplLS7");
512 
513  MapNumBadChanFull[1] = (TH2F *)MapNumBadChanDepth[1][1][1]->Clone();
514 
515  MapNumChanDepth[1][1][1] = (TH2F *)hfile->Get("h_2D0sumADCAmplLS1");
516  MapNumChanDepth[1][1][2] = (TH2F *)hfile->Get("h_2D0sumADCAmplLS2");
517 
518  MapNumChanDepth[1][2][1] = (TH2F *)hfile->Get("h_2D0sumADCAmplLS3");
519  MapNumChanDepth[1][2][2] = (TH2F *)hfile->Get("h_2D0sumADCAmplLS4");
520  MapNumChanDepth[1][2][3] = (TH2F *)hfile->Get("h_2D0sumADCAmplLS5");
521 
522  MapNumChanDepth[1][3][4] = (TH2F *)hfile->Get("h_2D0sumADCAmplLS8");
523 
524  MapNumChanDepth[1][4][1] = (TH2F *)hfile->Get("h_2D0sumADCAmplLS6");
525  MapNumChanDepth[1][4][2] = (TH2F *)hfile->Get("h_2D0sumADCAmplLS7");
526 
527  MapNumChanFull[1] = (TH2F *)MapNumChanDepth[1][1][1]->Clone();
528 
529  //+++++++++++++++++++++++++++++
530  // Width
531  //+++++++++++++++++++++++++++++
532 
533  MapNumBadChanDepth[2][1][1] = (TH2F *)hfile->Get("h_2DsumAmplitudeLS1");
534  MapNumBadChanDepth[2][1][2] = (TH2F *)hfile->Get("h_2DsumAmplitudeLS2");
535 
536  MapNumBadChanDepth[2][2][1] = (TH2F *)hfile->Get("h_2DsumAmplitudeLS3");
537  MapNumBadChanDepth[2][2][2] = (TH2F *)hfile->Get("h_2DsumAmplitudeLS4");
538  MapNumBadChanDepth[2][2][3] = (TH2F *)hfile->Get("h_2DsumAmplitudeLS5");
539 
540  MapNumBadChanDepth[2][3][4] = (TH2F *)hfile->Get("h_2DsumAmplitudeLS8");
541 
542  MapNumBadChanDepth[2][4][1] = (TH2F *)hfile->Get("h_2DsumAmplitudeLS6");
543  MapNumBadChanDepth[2][4][2] = (TH2F *)hfile->Get("h_2DsumAmplitudeLS7");
544 
545  MapNumBadChanFull[2] = (TH2F *)MapNumBadChanDepth[2][1][1]->Clone();
546 
547  MapNumChanDepth[2][1][1] = (TH2F *)hfile->Get("h_2D0sumAmplitudeLS1");
548  MapNumChanDepth[2][1][2] = (TH2F *)hfile->Get("h_2D0sumAmplitudeLS2");
549 
550  MapNumChanDepth[2][2][1] = (TH2F *)hfile->Get("h_2D0sumAmplitudeLS3");
551  MapNumChanDepth[2][2][2] = (TH2F *)hfile->Get("h_2D0sumAmplitudeLS4");
552  MapNumChanDepth[2][2][3] = (TH2F *)hfile->Get("h_2D0sumAmplitudeLS5");
553 
554  MapNumChanDepth[2][3][4] = (TH2F *)hfile->Get("h_2D0sumAmplitudeLS8");
555 
556  MapNumChanDepth[2][4][1] = (TH2F *)hfile->Get("h_2D0sumAmplitudeLS6");
557  MapNumChanDepth[2][4][2] = (TH2F *)hfile->Get("h_2D0sumAmplitudeLS7");
558 
559  MapNumChanFull[2] = (TH2F *)MapNumChanDepth[2][1][1]->Clone();
560 
561  //+++++++++++++++++++++++++++++
562  // Ratio
563  //+++++++++++++++++++++++++++++
564 
565  MapNumBadChanDepth[3][1][1] = (TH2F *)hfile->Get("h_2DsumAmplLS1");
566  MapNumBadChanDepth[3][1][2] = (TH2F *)hfile->Get("h_2DsumAmplLS2");
567 
568  MapNumBadChanDepth[3][2][1] = (TH2F *)hfile->Get("h_2DsumAmplLS3");
569  MapNumBadChanDepth[3][2][2] = (TH2F *)hfile->Get("h_2DsumAmplLS4");
570  MapNumBadChanDepth[3][2][3] = (TH2F *)hfile->Get("h_2DsumAmplLS5");
571 
572  MapNumBadChanDepth[3][3][4] = (TH2F *)hfile->Get("h_2DsumAmplLS8");
573 
574  MapNumBadChanDepth[3][4][1] = (TH2F *)hfile->Get("h_2DsumAmplLS6");
575  MapNumBadChanDepth[3][4][2] = (TH2F *)hfile->Get("h_2DsumAmplLS7");
576 
577  MapNumBadChanFull[3] = (TH2F *)MapNumBadChanDepth[3][1][1]->Clone();
578 
579  MapNumChanDepth[3][1][1] = (TH2F *)hfile->Get("h_2D0sumAmplLS1");
580  MapNumChanDepth[3][1][2] = (TH2F *)hfile->Get("h_2D0sumAmplLS2");
581 
582  MapNumChanDepth[3][2][1] = (TH2F *)hfile->Get("h_2D0sumAmplLS3");
583  MapNumChanDepth[3][2][2] = (TH2F *)hfile->Get("h_2D0sumAmplLS4");
584  MapNumChanDepth[3][2][3] = (TH2F *)hfile->Get("h_2D0sumAmplLS5");
585 
586  MapNumChanDepth[3][3][4] = (TH2F *)hfile->Get("h_2D0sumAmplLS8");
587 
588  MapNumChanDepth[3][4][1] = (TH2F *)hfile->Get("h_2D0sumAmplLS6");
589  MapNumChanDepth[3][4][2] = (TH2F *)hfile->Get("h_2D0sumAmplLS7");
590 
591  MapNumChanFull[3] = (TH2F *)MapNumChanDepth[3][1][1]->Clone();
592 
593  //+++++++++++++++++++++++++++++
594  // Tmean
595  //+++++++++++++++++++++++++++++
596 
597  MapNumBadChanDepth[4][1][1] = (TH2F *)hfile->Get("h_2DsumTSmeanALS1");
598  MapNumBadChanDepth[4][1][2] = (TH2F *)hfile->Get("h_2DsumTSmeanALS2");
599 
600  MapNumBadChanDepth[4][2][1] = (TH2F *)hfile->Get("h_2DsumTSmeanALS3");
601  MapNumBadChanDepth[4][2][2] = (TH2F *)hfile->Get("h_2DsumTSmeanALS4");
602  MapNumBadChanDepth[4][2][3] = (TH2F *)hfile->Get("h_2DsumTSmeanALS5");
603 
604  MapNumBadChanDepth[4][3][4] = (TH2F *)hfile->Get("h_2DsumTSmeanALS8");
605 
606  MapNumBadChanDepth[4][4][1] = (TH2F *)hfile->Get("h_2DsumTSmeanALS6");
607  MapNumBadChanDepth[4][4][2] = (TH2F *)hfile->Get("h_2DsumTSmeanALS7");
608 
609  MapNumBadChanFull[4] = (TH2F *)MapNumBadChanDepth[4][1][1]->Clone();
610 
611  MapNumChanDepth[4][1][1] = (TH2F *)hfile->Get("h_2D0sumTSmeanALS1");
612  MapNumChanDepth[4][1][2] = (TH2F *)hfile->Get("h_2D0sumTSmeanALS2");
613 
614  MapNumChanDepth[4][2][1] = (TH2F *)hfile->Get("h_2D0sumTSmeanALS3");
615  MapNumChanDepth[4][2][2] = (TH2F *)hfile->Get("h_2D0sumTSmeanALS4");
616  MapNumChanDepth[4][2][3] = (TH2F *)hfile->Get("h_2D0sumTSmeanALS5");
617 
618  MapNumChanDepth[4][3][4] = (TH2F *)hfile->Get("h_2D0sumTSmeanALS8");
619 
620  MapNumChanDepth[4][4][1] = (TH2F *)hfile->Get("h_2D0sumTSmeanALS6");
621  MapNumChanDepth[4][4][2] = (TH2F *)hfile->Get("h_2D0sumTSmeanALS7");
622 
623  MapNumChanFull[4] = (TH2F *)MapNumChanDepth[4][1][1]->Clone();
624 
625  //+++++++++++++++++++++++++++++
626  // Tmax
627  //+++++++++++++++++++++++++++++
628 
629  MapNumBadChanDepth[5][1][1] = (TH2F *)hfile->Get("h_2DsumTSmaxALS1");
630  MapNumBadChanDepth[5][1][2] = (TH2F *)hfile->Get("h_2DsumTSmaxALS2");
631 
632  MapNumBadChanDepth[5][2][1] = (TH2F *)hfile->Get("h_2DsumTSmaxALS3");
633  MapNumBadChanDepth[5][2][2] = (TH2F *)hfile->Get("h_2DsumTSmaxALS4");
634  MapNumBadChanDepth[5][2][3] = (TH2F *)hfile->Get("h_2DsumTSmaxALS5");
635 
636  MapNumBadChanDepth[5][3][4] = (TH2F *)hfile->Get("h_2DsumTSmaxALS8");
637 
638  MapNumBadChanDepth[5][4][1] = (TH2F *)hfile->Get("h_2DsumTSmaxALS6");
639  MapNumBadChanDepth[5][4][2] = (TH2F *)hfile->Get("h_2DsumTSmaxALS7");
640 
641  MapNumBadChanFull[5] = (TH2F *)MapNumBadChanDepth[5][1][1]->Clone();
642 
643  MapNumChanDepth[5][1][1] = (TH2F *)hfile->Get("h_2D0sumTSmaxALS1");
644  MapNumChanDepth[5][1][2] = (TH2F *)hfile->Get("h_2D0sumTSmaxALS2");
645 
646  MapNumChanDepth[5][2][1] = (TH2F *)hfile->Get("h_2D0sumTSmaxALS3");
647  MapNumChanDepth[5][2][2] = (TH2F *)hfile->Get("h_2D0sumTSmaxALS4");
648  MapNumChanDepth[5][2][3] = (TH2F *)hfile->Get("h_2D0sumTSmaxALS5");
649 
650  MapNumChanDepth[5][3][4] = (TH2F *)hfile->Get("h_2D0sumTSmaxALS8");
651 
652  MapNumChanDepth[5][4][1] = (TH2F *)hfile->Get("h_2D0sumTSmaxALS6");
653  MapNumChanDepth[5][4][2] = (TH2F *)hfile->Get("h_2D0sumTSmaxALS7");
654 
655  MapNumChanFull[5] = (TH2F *)MapNumChanDepth[5][1][1]->Clone();
656 
657  for (int test = 0; test <= 5; test++) { //Test: 0,
658  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
659  if (sub == 1)
660  cHB->Divide(2, 1);
661  if (sub == 2)
662  cHE->Divide(3, 1);
663  if (sub == 3)
664  cONE->Divide(1, 1);
665  if (sub == 4)
666  cHB->Divide(2, 1);
667  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
668  if (sub == 1)
669  cHB->cd(k);
670  if (sub == 2)
671  cHE->cd(k);
672  if (sub == 3)
673  cONE->cd(k - 3);
674  if (sub == 4)
675  cHB->cd(k);
676  MapNumBadChanDepth[test][sub][k]->Divide(
677  MapNumBadChanDepth[test][sub][k], MapNumChanDepth[test][sub][k], 1, 1, "B");
678 
679  for (int x = 1; x <= MapNumBadChanFull[test]->GetXaxis()->GetNbins(); x++) {
680  for (int y = 1; y <= MapNumBadChanFull[test]->GetYaxis()->GetNbins(); y++) {
681  double ccc1 = MapNumBadChanDepth[test][sub][k]->GetBinContent(x, y);
682  MapNumBadChanFull[test]->SetBinContent(x, y, MapNumBadChanFull[test]->GetBinContent(x, y) + ccc1);
683  } //end y
684  } //end x
685 
686  if (k == 1)
687  MapNumBadChanDepth[test][sub][k]->SetTitle("Depth 1\b");
688  if (k == 2)
689  MapNumBadChanDepth[test][sub][k]->SetTitle("Depth 2\b");
690  if (k == 3)
691  MapNumBadChanDepth[test][sub][k]->SetTitle("Depth 3\b");
692  if (k == 4)
693  MapNumBadChanDepth[test][sub][k]->SetTitle("Depth 4\b");
694  gPad->SetGridy();
695  gPad->SetGridx();
696  gPad->SetLogz();
697  //
698  // gPad->DrawFrame(0.0, 0.0001, 1.0, 1000);
699  // gPad->DrawFrame(0.2, 0.0002, 0.8, 10000);
700  MapNumBadChanDepth[test][sub][k]->SetXTitle("#eta \b");
701  MapNumBadChanDepth[test][sub][k]->SetYTitle("#phi \b");
702  MapNumBadChanDepth[test][sub][k]->SetZTitle("Average estimator \b");
704  // MapNumBadChanDepth[test][sub][k]->SetTitleOffset(0.75, "Z");
705  MapNumBadChanDepth[test][sub][k]->Draw("COLZ");
706  // MapNumBadChanDepth[test][sub][k]->Draw("same");
707  MapNumBadChanDepth[test][sub][k]->GetYaxis()->SetRangeUser(0, 72.);
708  MapNumBadChanDepth[test][sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
709  }
710  if (test == 0) {
711  if (sub == 1) {
712  cHB->Print("MapCapIdErrorHB.png");
713  cHB->Clear();
714  }
715  if (sub == 2) {
716  cHE->Print("MapCapIdErrorHE.png");
717  cHE->Clear();
718  }
719  if (sub == 3) {
720  cONE->Print("MapCapIdErrorHO.png");
721  cONE->Clear();
722  }
723  if (sub == 4) {
724  cHB->Print("MapCapIdErrorHF.png");
725  cHB->Clear();
726  }
727  }
728  if (test == 1) {
729  if (sub == 1) {
730  cHB->Print("MapADCamplHB.png");
731  cHB->Clear();
732  }
733  if (sub == 2) {
734  cHE->Print("MapADCamplHE.png");
735  cHE->Clear();
736  }
737  if (sub == 3) {
738  cONE->Print("MapADCamplHO.png");
739  cONE->Clear();
740  }
741  if (sub == 4) {
742  cHB->Print("MapADCamplHF.png");
743  cHB->Clear();
744  }
745  }
746  if (test == 2) {
747  if (sub == 1) {
748  cHB->Print("MapWidthHB.png");
749  cHB->Clear();
750  }
751  if (sub == 2) {
752  cHE->Print("MapWidthHE.png");
753  cHE->Clear();
754  }
755  if (sub == 3) {
756  cONE->Print("MapWidthHO.png");
757  cONE->Clear();
758  }
759  if (sub == 4) {
760  cHB->Print("MapWidthHF.png");
761  cHB->Clear();
762  }
763  }
764  if (test == 3) {
765  if (sub == 1) {
766  cHB->Print("MapRatioHB.png");
767  cHB->Clear();
768  }
769  if (sub == 2) {
770  cHE->Print("MapRatioHE.png");
771  cHE->Clear();
772  }
773  if (sub == 3) {
774  cONE->Print("MapRatioHO.png");
775  cONE->Clear();
776  }
777  if (sub == 4) {
778  cHB->Print("MapRatioHF.png");
779  cHB->Clear();
780  }
781  }
782  if (test == 4) {
783  if (sub == 1) {
784  cHB->Print("MapTmeanHB.png");
785  cHB->Clear();
786  }
787  if (sub == 2) {
788  cHE->Print("MapTmeanHE.png");
789  cHE->Clear();
790  }
791  if (sub == 3) {
792  cONE->Print("MapTmeanHO.png");
793  cONE->Clear();
794  }
795  if (sub == 4) {
796  cHB->Print("MapTmeanHF.png");
797  cHB->Clear();
798  }
799  }
800  if (test == 5) {
801  if (sub == 1) {
802  cHB->Print("MapTmaxHB.png");
803  cHB->Clear();
804  }
805  if (sub == 2) {
806  cHE->Print("MapTmaxHE.png");
807  cHE->Clear();
808  }
809  if (sub == 3) {
810  cONE->Print("MapTmaxHO.png");
811  cONE->Clear();
812  }
813  if (sub == 4) {
814  cHB->Print("MapTmaxHF.png");
815  cHB->Clear();
816  }
817  }
818  } // end sub
819  cONE->Divide(1, 1);
820  cONE->cd(1);
821  gPad->SetGridy();
822  gPad->SetGridx();
823  gPad->SetLogz();
824  MapNumBadChanFull[test]->SetTitle("All subdetectors\b");
825  MapNumBadChanFull[test]->SetXTitle("#eta \b");
826  MapNumBadChanFull[test]->SetYTitle("#phi \b");
827  if (test == 0)
828  MapNumBadChanFull[test]->SetZTitle("Average Nbcs \b");
829  if (test != 0)
830  MapNumBadChanFull[test]->SetZTitle("Average estimator \b");
831  // MapNumBadChanFull[test]->GetZaxis()->SetLabelSize(0.008);
832  MapNumBadChanFull[test]->SetTitleOffset(0.75, "Z");
833  MapNumBadChanFull[test]->Draw("COLZ");
834  MapNumBadChanFull[test]->GetYaxis()->SetRangeUser(0, 72.);
835  // MapNumBadChanFull[test]->GetZaxis()->SetRangeUser(0.0001, 1.);
836  if (test == 0) {
837  cONE->Print("MapCapIdError.png");
838  cONE->Clear();
839  }
840  if (test == 1) {
841  cONE->Print("MapADCAmpl.png");
842  cONE->Clear();
843  }
844  if (test == 2) {
845  cONE->Print("MapWidth.png");
846  cONE->Clear();
847  }
848  if (test == 3) {
849  cONE->Print("MapRatio.png");
850  cONE->Clear();
851  }
852  if (test == 4) {
853  cONE->Print("MapTmean.png");
854  cONE->Clear();
855  }
856  if (test == 5) {
857  cONE->Print("MapTmax.png");
858  cONE->Clear();
859  }
860  } //end test
861 
862  //================================================================================================================================
863 
864  //=======================================================================================================
865  // 1-d histograms third definition
866 
867  TH1F *HistNumBadChanDepth[7][5][8]; // 1d histogramm for test,subdet, depth
868  TH1F *HistCutNumBadChanDepth[7][5][8]; // 1d histogramm for test,subdet, depth
869  TH1F *HistNumChanDepth[7][5][8]; // 1d histogramm for test,subdet, depth
870 
871  // TH1F *HistNumBadChanDepth[7][5][5]; // 1d histogramm for test,subdet, depth
872  // TH1F *HistCutNumBadChanDepth[7][5][5]; // 1d histogramm for test,subdet, depth
873  // TH1F *HistNumChanDepth[7][5][5]; // 1d histogramm for test,subdet, depth
874 
875  TH1F *HistNumBadChanFull[7]; // 1d histogramm for test
876  TH1F *HistNumChanFull[7]; // 1d histogramm for test
877 
878  //+++++++++++++++++++++++++++++
879  // Rate of Cap ID errors
880  //+++++++++++++++++++++++++++++
881 
882  HistNumBadChanDepth[0][1][1] = (TH1F *)hfile->Get("h_runnbadchannels_depth1_HB");
883  HistNumBadChanDepth[0][1][2] = (TH1F *)hfile->Get("h_runnbadchannels_depth2_HB");
884 
885  HistNumBadChanDepth[0][2][1] = (TH1F *)hfile->Get("h_runnbadchannels_depth1_HE");
886  HistNumBadChanDepth[0][2][2] = (TH1F *)hfile->Get("h_runnbadchannels_depth2_HE");
887  HistNumBadChanDepth[0][2][3] = (TH1F *)hfile->Get("h_runnbadchannels_depth3_HE");
888 
889  HistNumBadChanDepth[0][3][4] = (TH1F *)hfile->Get("h_runnbadchannels_depth4_HO");
890 
891  HistNumBadChanDepth[0][4][1] = (TH1F *)hfile->Get("h_runnbadchannels_depth1_HF");
892  HistNumBadChanDepth[0][4][2] = (TH1F *)hfile->Get("h_runnbadchannels_depth2_HF");
893 
894  HistNumBadChanFull[0] = (TH1F *)HistNumBadChanDepth[0][1][1]->Clone();
895 
896  HistCutNumBadChanDepth[0][1][1] = (TH1F *)hfile->Get("h_runnbadchannels_depth1_HB");
897  HistCutNumBadChanDepth[0][1][2] = (TH1F *)hfile->Get("h_runnbadchannels_depth2_HB");
898 
899  HistCutNumBadChanDepth[0][2][1] = (TH1F *)hfile->Get("h_runnbadchannels_depth1_HE");
900  HistCutNumBadChanDepth[0][2][2] = (TH1F *)hfile->Get("h_runnbadchannels_depth2_HE");
901  HistCutNumBadChanDepth[0][2][3] = (TH1F *)hfile->Get("h_runnbadchannels_depth3_HE");
902 
903  HistCutNumBadChanDepth[0][3][4] = (TH1F *)hfile->Get("h_runnbadchannels_depth4_HO");
904 
905  HistCutNumBadChanDepth[0][4][1] = (TH1F *)hfile->Get("h_runnbadchannels_depth1_HF");
906  HistCutNumBadChanDepth[0][4][2] = (TH1F *)hfile->Get("h_runnbadchannels_depth2_HF");
907 
908  HistNumChanDepth[0][1][1] = (TH1F *)hfile->Get("h_runbadrate0_depth1_HB");
909  HistNumChanDepth[0][1][2] = (TH1F *)hfile->Get("h_runbadrate0_depth2_HB");
910 
911  HistNumChanDepth[0][2][1] = (TH1F *)hfile->Get("h_runbadrate0_depth1_HE");
912  HistNumChanDepth[0][2][2] = (TH1F *)hfile->Get("h_runbadrate0_depth2_HE");
913  HistNumChanDepth[0][2][3] = (TH1F *)hfile->Get("h_runbadrate0_depth3_HE");
914 
915  HistNumChanDepth[0][3][4] = (TH1F *)hfile->Get("h_runbadrate0_depth4_HO");
916 
917  HistNumChanDepth[0][4][1] = (TH1F *)hfile->Get("h_runbadrate0_depth1_HF");
918  HistNumChanDepth[0][4][2] = (TH1F *)hfile->Get("h_runbadrate0_depth2_HF");
919 
920  HistNumChanFull[0] = (TH1F *)HistNumChanDepth[0][1][1]->Clone();
921 
922  //+++++++++++++++++++++++++++++
923  // ADC Amplitude
924  //+++++++++++++++++++++++++++++
925 
927  // HB:
928  HistNumBadChanDepth[1][1][1] = (TH1F *)hfile->Get("h_sumADCAmplperLS1");
929  HistNumBadChanDepth[1][1][2] = (TH1F *)hfile->Get("h_sumADCAmplperLS2");
930  // HB upgrade:
931  HistNumBadChanDepth[1][1][3] = (TH1F *)hfile->Get("h_sumADCAmplperLSdepth3HBu");
932  HistNumBadChanDepth[1][1][4] = (TH1F *)hfile->Get("h_sumADCAmplperLSdepth4HBu");
933 
934  // HE:
935  HistNumBadChanDepth[1][2][1] = (TH1F *)hfile->Get("h_sumADCAmplperLS3");
936  HistNumBadChanDepth[1][2][2] = (TH1F *)hfile->Get("h_sumADCAmplperLS4");
937  HistNumBadChanDepth[1][2][3] = (TH1F *)hfile->Get("h_sumADCAmplperLS5");
938  // HE upgrade:
939  HistNumBadChanDepth[1][2][4] = (TH1F *)hfile->Get("h_sumADCAmplperLSdepth4HEu");
940  HistNumBadChanDepth[1][2][5] = (TH1F *)hfile->Get("h_sumADCAmplperLSdepth5HEu");
941  HistNumBadChanDepth[1][2][6] = (TH1F *)hfile->Get("h_sumADCAmplperLSdepth6HEu");
942  HistNumBadChanDepth[1][2][7] = (TH1F *)hfile->Get("h_sumADCAmplperLSdepth7HEu");
943 
944  // HO:
945  HistNumBadChanDepth[1][3][4] = (TH1F *)hfile->Get("h_sumADCAmplperLS8");
946 
947  // HF:
948  HistNumBadChanDepth[1][4][1] = (TH1F *)hfile->Get("h_sumADCAmplperLS6");
949  HistNumBadChanDepth[1][4][2] = (TH1F *)hfile->Get("h_sumADCAmplperLS7");
950  // HF upgrade:
951  HistNumBadChanDepth[1][4][3] = (TH1F *)hfile->Get("h_sumADCAmplperLS6u");
952  HistNumBadChanDepth[1][4][4] = (TH1F *)hfile->Get("h_sumADCAmplperLS7u");
953 
954  // other cases:
955  HistNumBadChanFull[1] = (TH1F *)HistNumBadChanDepth[1][1][1]->Clone();
956 
958  // HB:
959  HistCutNumBadChanDepth[1][1][1] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS1");
960  HistCutNumBadChanDepth[1][1][2] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS2");
961  // HB upgrade:
962  HistCutNumBadChanDepth[1][1][3] = (TH1F *)hfile->Get("h_sumCutADCAmplperLSdepth3HBu");
963  HistCutNumBadChanDepth[1][1][4] = (TH1F *)hfile->Get("h_sumCutADCAmplperLSdepth4HBu");
964 
965  // HE:
966  HistCutNumBadChanDepth[1][2][1] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS3");
967  HistCutNumBadChanDepth[1][2][2] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS4");
968  HistCutNumBadChanDepth[1][2][3] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS5");
969  // HE upgrade:
970  HistCutNumBadChanDepth[1][2][4] = (TH1F *)hfile->Get("h_sumCutADCAmplperLSdepth4HEu");
971  HistCutNumBadChanDepth[1][2][5] = (TH1F *)hfile->Get("h_sumCutADCAmplperLSdepth5HEu");
972  HistCutNumBadChanDepth[1][2][6] = (TH1F *)hfile->Get("h_sumCutADCAmplperLSdepth6HEu");
973  HistCutNumBadChanDepth[1][2][7] = (TH1F *)hfile->Get("h_sumCutADCAmplperLSdepth7HEu");
974 
975  // HO:
976  HistCutNumBadChanDepth[1][3][4] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS8");
977 
978  // HF:
979  HistCutNumBadChanDepth[1][4][1] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS6");
980  HistCutNumBadChanDepth[1][4][2] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS7");
981  // HF upgrade:
982  HistCutNumBadChanDepth[1][4][3] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS6u");
983  HistCutNumBadChanDepth[1][4][4] = (TH1F *)hfile->Get("h_sumCutADCAmplperLS7u");
984 
986  // HB:
987  HistNumChanDepth[1][1][1] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS1");
988  HistNumChanDepth[1][1][2] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS2");
989  // HB upgrade:
990  HistNumChanDepth[1][1][3] = (TH1F *)hfile->Get("h_sum0ADCAmplperLSdepth3HBu");
991  HistNumChanDepth[1][1][4] = (TH1F *)hfile->Get("h_sum0ADCAmplperLSdepth4HBu");
992 
993  // HE:
994  HistNumChanDepth[1][2][1] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS3");
995  HistNumChanDepth[1][2][2] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS4");
996  HistNumChanDepth[1][2][3] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS5");
997  // HE upgrade:
998  HistNumChanDepth[1][2][4] = (TH1F *)hfile->Get("h_sum0ADCAmplperLSdepth4HEu");
999  HistNumChanDepth[1][2][5] = (TH1F *)hfile->Get("h_sum0ADCAmplperLSdepth5HEu");
1000  HistNumChanDepth[1][2][6] = (TH1F *)hfile->Get("h_sum0ADCAmplperLSdepth6HEu");
1001  HistNumChanDepth[1][2][7] = (TH1F *)hfile->Get("h_sum0ADCAmplperLSdepth7HEu");
1002 
1003  // HO:
1004  HistNumChanDepth[1][3][4] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS8");
1005 
1006  // HF:
1007  HistNumChanDepth[1][4][1] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS6");
1008  HistNumChanDepth[1][4][2] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS7");
1009  // HF upgrade:
1010  HistNumChanDepth[1][4][3] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS6u");
1011  HistNumChanDepth[1][4][4] = (TH1F *)hfile->Get("h_sum0ADCAmplperLS7u");
1012 
1013  // other cases:
1014  HistNumChanFull[1] = (TH1F *)HistNumChanDepth[1][1][1]->Clone();
1015  // just initialization of [6] massive for alternative <A> calculation
1016  HistNumChanFull[6] = (TH1F *)HistNumChanDepth[1][1][1]->Clone();
1017 
1018  //+++++++++++++++++++++++++++++
1019  // Width
1020  //+++++++++++++++++++++++++++++
1021 
1022  HistNumBadChanDepth[2][1][1] = (TH1F *)hfile->Get("h_sumAmplitudeperLS1");
1023  HistNumBadChanDepth[2][1][2] = (TH1F *)hfile->Get("h_sumAmplitudeperLS2");
1024 
1025  HistNumBadChanDepth[2][2][1] = (TH1F *)hfile->Get("h_sumAmplitudeperLS3");
1026  HistNumBadChanDepth[2][2][2] = (TH1F *)hfile->Get("h_sumAmplitudeperLS4");
1027  HistNumBadChanDepth[2][2][3] = (TH1F *)hfile->Get("h_sumAmplitudeperLS5");
1028 
1029  HistNumBadChanDepth[2][3][4] = (TH1F *)hfile->Get("h_sumAmplitudeperLS8");
1030 
1031  HistNumBadChanDepth[2][4][1] = (TH1F *)hfile->Get("h_sumAmplitudeperLS6");
1032  HistNumBadChanDepth[2][4][2] = (TH1F *)hfile->Get("h_sumAmplitudeperLS7");
1033 
1034  HistNumBadChanFull[2] = (TH1F *)HistNumBadChanDepth[2][1][1]->Clone();
1035 
1036  HistCutNumBadChanDepth[2][1][1] = (TH1F *)hfile->Get("h_sumCutAmplitudeperLS1");
1037  HistCutNumBadChanDepth[2][1][2] = (TH1F *)hfile->Get("h_sumCutAmplitudeperLS2");
1038 
1039  HistCutNumBadChanDepth[2][2][1] = (TH1F *)hfile->Get("h_sumCutAmplitudeperLS3");
1040  HistCutNumBadChanDepth[2][2][2] = (TH1F *)hfile->Get("h_sumCutAmplitudeperLS4");
1041  HistCutNumBadChanDepth[2][2][3] = (TH1F *)hfile->Get("h_sumCutAmplitudeperLS5");
1042 
1043  HistCutNumBadChanDepth[2][3][4] = (TH1F *)hfile->Get("h_sumCutAmplitudeperLS8");
1044 
1045  HistCutNumBadChanDepth[2][4][1] = (TH1F *)hfile->Get("h_sumCutAmplitudeperLS6");
1046  HistCutNumBadChanDepth[2][4][2] = (TH1F *)hfile->Get("h_sumCutAmplitudeperLS7");
1047 
1048  HistNumChanDepth[2][1][1] = (TH1F *)hfile->Get("h_sum0AmplitudeperLS1");
1049  HistNumChanDepth[2][1][2] = (TH1F *)hfile->Get("h_sum0AmplitudeperLS2");
1050 
1051  HistNumChanDepth[2][2][1] = (TH1F *)hfile->Get("h_sum0AmplitudeperLS3");
1052  HistNumChanDepth[2][2][2] = (TH1F *)hfile->Get("h_sum0AmplitudeperLS4");
1053  HistNumChanDepth[2][2][3] = (TH1F *)hfile->Get("h_sum0AmplitudeperLS5");
1054 
1055  HistNumChanDepth[2][3][4] = (TH1F *)hfile->Get("h_sum0AmplitudeperLS8");
1056 
1057  HistNumChanDepth[2][4][1] = (TH1F *)hfile->Get("h_sum0AmplitudeperLS6");
1058  HistNumChanDepth[2][4][2] = (TH1F *)hfile->Get("h_sum0AmplitudeperLS7");
1059 
1060  HistNumChanFull[2] = (TH1F *)HistNumChanDepth[2][1][1]->Clone();
1061  //+++++++++++++++++++++++++++++
1062  // Ratio
1063  //+++++++++++++++++++++++++++++
1064 
1065  HistNumBadChanDepth[3][1][1] = (TH1F *)hfile->Get("h_sumAmplperLS1");
1066  HistNumBadChanDepth[3][1][2] = (TH1F *)hfile->Get("h_sumAmplperLS2");
1067 
1068  HistNumBadChanDepth[3][2][1] = (TH1F *)hfile->Get("h_sumAmplperLS3");
1069  HistNumBadChanDepth[3][2][2] = (TH1F *)hfile->Get("h_sumAmplperLS4");
1070  HistNumBadChanDepth[3][2][3] = (TH1F *)hfile->Get("h_sumAmplperLS5");
1071 
1072  HistNumBadChanDepth[3][3][4] = (TH1F *)hfile->Get("h_sumAmplperLS8");
1073 
1074  HistNumBadChanDepth[3][4][1] = (TH1F *)hfile->Get("h_sumAmplperLS6");
1075  HistNumBadChanDepth[3][4][2] = (TH1F *)hfile->Get("h_sumAmplperLS7");
1076 
1077  HistNumBadChanFull[3] = (TH1F *)HistNumBadChanDepth[3][1][1]->Clone();
1078 
1079  HistCutNumBadChanDepth[3][1][1] = (TH1F *)hfile->Get("h_sumCutAmplperLS1");
1080  HistCutNumBadChanDepth[3][1][2] = (TH1F *)hfile->Get("h_sumCutAmplperLS2");
1081 
1082  HistCutNumBadChanDepth[3][2][1] = (TH1F *)hfile->Get("h_sumCutAmplperLS3");
1083  HistCutNumBadChanDepth[3][2][2] = (TH1F *)hfile->Get("h_sumCutAmplperLS4");
1084  HistCutNumBadChanDepth[3][2][3] = (TH1F *)hfile->Get("h_sumCutAmplperLS5");
1085 
1086  HistCutNumBadChanDepth[3][3][4] = (TH1F *)hfile->Get("h_sumCutAmplperLS8");
1087 
1088  HistCutNumBadChanDepth[3][4][1] = (TH1F *)hfile->Get("h_sumCutAmplperLS6");
1089  HistCutNumBadChanDepth[3][4][2] = (TH1F *)hfile->Get("h_sumCutAmplperLS7");
1090 
1091  HistNumChanDepth[3][1][1] = (TH1F *)hfile->Get("h_sum0AmplperLS1");
1092  HistNumChanDepth[3][1][2] = (TH1F *)hfile->Get("h_sum0AmplperLS2");
1093 
1094  HistNumChanDepth[3][2][1] = (TH1F *)hfile->Get("h_sum0AmplperLS3");
1095  HistNumChanDepth[3][2][2] = (TH1F *)hfile->Get("h_sum0AmplperLS4");
1096  HistNumChanDepth[3][2][3] = (TH1F *)hfile->Get("h_sum0AmplperLS5");
1097 
1098  HistNumChanDepth[3][3][4] = (TH1F *)hfile->Get("h_sum0AmplperLS8");
1099 
1100  HistNumChanDepth[3][4][1] = (TH1F *)hfile->Get("h_sum0AmplperLS6");
1101  HistNumChanDepth[3][4][2] = (TH1F *)hfile->Get("h_sum0AmplperLS7");
1102 
1103  HistNumChanFull[3] = (TH1F *)HistNumChanDepth[3][1][1]->Clone();
1104  //+++++++++++++++++++++++++++++
1105  // Tmean
1106  //+++++++++++++++++++++++++++++
1107 
1108  HistNumBadChanDepth[4][1][1] = (TH1F *)hfile->Get("h_sumTSmeanAperLS1");
1109  HistNumBadChanDepth[4][1][2] = (TH1F *)hfile->Get("h_sumTSmeanAperLS2");
1110 
1111  HistNumBadChanDepth[4][2][1] = (TH1F *)hfile->Get("h_sumTSmeanAperLS3");
1112  HistNumBadChanDepth[4][2][2] = (TH1F *)hfile->Get("h_sumTSmeanAperLS4");
1113  HistNumBadChanDepth[4][2][3] = (TH1F *)hfile->Get("h_sumTSmeanAperLS5");
1114 
1115  HistNumBadChanDepth[4][3][4] = (TH1F *)hfile->Get("h_sumTSmeanAperLS8");
1116 
1117  HistNumBadChanDepth[4][4][1] = (TH1F *)hfile->Get("h_sumTSmeanAperLS6");
1118  HistNumBadChanDepth[4][4][2] = (TH1F *)hfile->Get("h_sumTSmeanAperLS7");
1119 
1120  HistNumBadChanFull[4] = (TH1F *)HistNumBadChanDepth[4][1][1]->Clone();
1121 
1122  HistCutNumBadChanDepth[4][1][1] = (TH1F *)hfile->Get("h_sumCutTSmeanAperLS1");
1123  HistCutNumBadChanDepth[4][1][2] = (TH1F *)hfile->Get("h_sumCutTSmeanAperLS2");
1124 
1125  HistCutNumBadChanDepth[4][2][1] = (TH1F *)hfile->Get("h_sumCutTSmeanAperLS3");
1126  HistCutNumBadChanDepth[4][2][2] = (TH1F *)hfile->Get("h_sumCutTSmeanAperLS4");
1127  HistCutNumBadChanDepth[4][2][3] = (TH1F *)hfile->Get("h_sumCutTSmeanAperLS5");
1128 
1129  HistCutNumBadChanDepth[4][3][4] = (TH1F *)hfile->Get("h_sumCutTSmeanAperLS8");
1130 
1131  HistCutNumBadChanDepth[4][4][1] = (TH1F *)hfile->Get("h_sumCutTSmeanAperLS6");
1132  HistCutNumBadChanDepth[4][4][2] = (TH1F *)hfile->Get("h_sumCutTSmeanAperLS7");
1133 
1134  HistNumChanDepth[4][1][1] = (TH1F *)hfile->Get("h_sum0TSmeanAperLS1");
1135  HistNumChanDepth[4][1][2] = (TH1F *)hfile->Get("h_sum0TSmeanAperLS2");
1136 
1137  HistNumChanDepth[4][2][1] = (TH1F *)hfile->Get("h_sum0TSmeanAperLS3");
1138  HistNumChanDepth[4][2][2] = (TH1F *)hfile->Get("h_sum0TSmeanAperLS4");
1139  HistNumChanDepth[4][2][3] = (TH1F *)hfile->Get("h_sum0TSmeanAperLS5");
1140 
1141  HistNumChanDepth[4][3][4] = (TH1F *)hfile->Get("h_sum0TSmeanAperLS8");
1142 
1143  HistNumChanDepth[4][4][1] = (TH1F *)hfile->Get("h_sum0TSmeanAperLS6");
1144  HistNumChanDepth[4][4][2] = (TH1F *)hfile->Get("h_sum0TSmeanAperLS7");
1145 
1146  HistNumChanFull[4] = (TH1F *)HistNumChanDepth[4][1][1]->Clone();
1147  //+++++++++++++++++++++++++++++
1148  // Tmax
1149  //+++++++++++++++++++++++++++++
1150 
1151  HistNumBadChanDepth[5][1][1] = (TH1F *)hfile->Get("h_sumTSmaxAperLS1");
1152  HistNumBadChanDepth[5][1][2] = (TH1F *)hfile->Get("h_sumTSmaxAperLS2");
1153 
1154  HistNumBadChanDepth[5][2][1] = (TH1F *)hfile->Get("h_sumTSmaxAperLS3");
1155  HistNumBadChanDepth[5][2][2] = (TH1F *)hfile->Get("h_sumTSmaxAperLS4");
1156  HistNumBadChanDepth[5][2][3] = (TH1F *)hfile->Get("h_sumTSmaxAperLS5");
1157 
1158  HistNumBadChanDepth[5][3][4] = (TH1F *)hfile->Get("h_sumTSmaxAperLS8");
1159 
1160  HistNumBadChanDepth[5][4][1] = (TH1F *)hfile->Get("h_sumTSmaxAperLS6");
1161  HistNumBadChanDepth[5][4][2] = (TH1F *)hfile->Get("h_sumTSmaxAperLS7");
1162 
1163  HistNumBadChanFull[5] = (TH1F *)HistNumBadChanDepth[5][1][1]->Clone();
1164 
1165  HistCutNumBadChanDepth[5][1][1] = (TH1F *)hfile->Get("h_sumCutTSmaxAperLS1");
1166  HistCutNumBadChanDepth[5][1][2] = (TH1F *)hfile->Get("h_sumCutTSmaxAperLS2");
1167 
1168  HistCutNumBadChanDepth[5][2][1] = (TH1F *)hfile->Get("h_sumCutTSmaxAperLS3");
1169  HistCutNumBadChanDepth[5][2][2] = (TH1F *)hfile->Get("h_sumCutTSmaxAperLS4");
1170  HistCutNumBadChanDepth[5][2][3] = (TH1F *)hfile->Get("h_sumCutTSmaxAperLS5");
1171 
1172  HistCutNumBadChanDepth[5][3][4] = (TH1F *)hfile->Get("h_sumCutTSmaxAperLS8");
1173 
1174  HistCutNumBadChanDepth[5][4][1] = (TH1F *)hfile->Get("h_sumCutTSmaxAperLS6");
1175  HistCutNumBadChanDepth[5][4][2] = (TH1F *)hfile->Get("h_sumCutTSmaxAperLS7");
1176 
1177  HistNumChanDepth[5][1][1] = (TH1F *)hfile->Get("h_sum0TSmaxAperLS1");
1178  HistNumChanDepth[5][1][2] = (TH1F *)hfile->Get("h_sum0TSmaxAperLS2");
1179 
1180  HistNumChanDepth[5][2][1] = (TH1F *)hfile->Get("h_sum0TSmaxAperLS3");
1181  HistNumChanDepth[5][2][2] = (TH1F *)hfile->Get("h_sum0TSmaxAperLS4");
1182  HistNumChanDepth[5][2][3] = (TH1F *)hfile->Get("h_sum0TSmaxAperLS5");
1183 
1184  HistNumChanDepth[5][3][4] = (TH1F *)hfile->Get("h_sum0TSmaxAperLS8");
1185 
1186  HistNumChanDepth[5][4][1] = (TH1F *)hfile->Get("h_sum0TSmaxAperLS6");
1187  HistNumChanDepth[5][4][2] = (TH1F *)hfile->Get("h_sum0TSmaxAperLS7");
1188 
1189  HistNumChanFull[5] = (TH1F *)HistNumChanDepth[5][1][1]->Clone();
1190 
1191  for (int test = 0; test <= 5; test++) { //Test: =0(CapIdErrors), =1(Amplitude), =2...
1192  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
1193  if (sub == 1 && test != 1)
1194  cHE->Divide(2, 1); //HB
1195  if (sub == 1 && test == 1) {
1196  cFour1->Clear();
1197  cFour1->Divide(2, 2);
1198  } //HB upgrade with new depthes 3,4 for Amplitude test only
1199  if (sub == 2 && test != 1)
1200  cHE->Divide(3, 1); //HE
1201  if (sub == 2 && test == 1) {
1202  cNine->Clear();
1203  cNine->Divide(3, 3);
1204  } //HE upgrade with new depthes 4,5,6,7 for Amplitude test only
1205  if (sub == 3)
1206  cHB->Divide(1, 1); //HO
1207  if (sub == 4 && test != 1)
1208  cHE->Divide(2, 1); //HF
1209  if (sub == 4 && test == 1) {
1210  cFour1->Clear();
1211  cFour1->Divide(2, 2);
1212  } // HF upgrade with new depthes 3 and 4 for Amplitude test only
1213 
1214  int kkkkkkmax = k_max[sub];
1215  // if ( (sub==4 || sub==2) && test==1) kkkkkkmax = k_maxupgrade[sub];
1216  if ((sub == 4 || sub == 2 || sub == 1) && test == 1)
1217  kkkkkkmax = k_maxupgrade[sub];
1218  for (int k = k_min[sub]; k <= kkkkkkmax; k++) { //Depth
1219  if (sub == 1 && test != 1)
1220  cHE->cd(k); //HB
1221  if (sub == 1 && test == 1)
1222  cFour1->cd(k); //HB
1223  if (sub == 2 && test != 1)
1224  cHE->cd(k); //HE
1225  if (sub == 2 && test == 1)
1226  cNine->cd(k); //HE upgrade with new depthes 4,5,6,7 for Amplitude test only
1227  if (sub == 3)
1228  cHB->cd(k - 3); //HO
1229  if (sub == 4 && test != 1)
1230  cHE->cd(k); //HF
1231  if (sub == 4 && test == 1)
1232  cFour1->cd(k); // HF upgrade with new depthes 3 and 4 for Amplitude test only
1233  gPad->SetGridy();
1234  gPad->SetGridx();
1235  // gPad->SetLogy();
1236 
1237  if (sub == 1 && k == 1) {
1238  } else {
1239  // use "else" because ...Full[test] are filled by estimastor for sub==1 && k== 1 at initialization of ...Full[test] variables
1240  for (int x = 1; x <= HistNumBadChanFull[test]->GetXaxis()->GetNbins(); x++) {
1241  double ccc1 = HistNumBadChanDepth[test][sub][k]->GetBinContent(x);
1242  HistNumBadChanFull[test]->SetBinContent(x, HistNumBadChanFull[test]->GetBinContent(x) + ccc1);
1243  double ccc2 = HistNumChanDepth[test][sub][k]->GetBinContent(x);
1244  HistNumChanFull[test]->SetBinContent(x, HistNumChanFull[test]->GetBinContent(x) + ccc2);
1245  }
1246  } //end x
1247 
1248  // !!!!!! change the sense of HistNumBadChanDepth: now it's averaged values(estimators)
1249  HistNumBadChanDepth[test][sub][k]->Divide(
1250  HistNumBadChanDepth[test][sub][k], HistNumChanDepth[test][sub][k], 1, 1, "B");
1251  // errors abnulling:
1252  for (int x = 1; x <= HistNumBadChanDepth[test][sub][k]->GetXaxis()->GetNbins(); x++) {
1253  HistNumBadChanDepth[test][sub][k]->SetBinError(float(x), 0.01);
1254  }
1255 
1256  // int myMaxLum= HistNumBadChanDepth[test][sub][k]->GetBinContent(HistNumBadChanDepth[test][sub][k]->GetMaximumBin());
1257  // cout<<"********************>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> myMaxLum = "<<myMaxLum<<" MaxLum = "<<MaxLum<<endl;
1258  HistNumBadChanDepth[test][sub][k]->GetXaxis()->SetRangeUser(0, MaxLum);
1259 
1260  // // // // // // // // // // // // // // // // // //
1261  HistNumBadChanDepth[test][sub][k]->SetMarkerStyle(20);
1262  HistNumBadChanDepth[test][sub][k]->SetMarkerSize(0.4);
1263  HistNumBadChanDepth[test][sub][k]->GetYaxis()->SetLabelSize(0.04);
1264  if (k == 1)
1265  HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 1\b");
1266  if (k == 2)
1267  HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 2\b");
1268  if (k == 3)
1269  HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 3\b");
1270  if (k == 4)
1271  HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 4\b");
1272  if (k == 5)
1273  HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 5\b");
1274  if (k == 6)
1275  HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 6\b");
1276  if (k == 7)
1277  HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 7\b");
1278  HistNumBadChanDepth[test][sub][k]->SetXTitle("LS \b");
1279  if (test == 0)
1280  HistNumBadChanDepth[test][sub][k]->SetYTitle("<Number of bad channels> \b");
1281  if (test != 0)
1282  HistNumBadChanDepth[test][sub][k]->SetYTitle("Averaged estimator \b");
1283  HistNumBadChanDepth[test][sub][k]->SetMarkerColor(2);
1284  HistNumBadChanDepth[test][sub][k]->SetLineColor(0);
1285  // gPad->SetGridx();
1286  gPad->SetLogy();
1287  gPad->SetGridy();
1288  gPad->SetGridx();
1289  // if (test == 1) HistNumBadChanDepth[test][sub][k]->SetMinimum(0.1);
1290  HistNumBadChanDepth[test][sub][k]->Draw("Error");
1291  /*
1292  if (k == 1) HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 1\b");
1293  if (k == 2) HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 2\b");
1294  if (k == 3) HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 3\b");
1295  if (k == 4) HistNumBadChanDepth[test][sub][k]->SetTitle("Depth 4\b");
1296  HistNumBadChanDepth[test][sub][k]->SetXTitle("LS \b");
1297  if (test == 0) HistNumBadChanDepth[test][sub][k]->SetYTitle("<Number of bad channels> \b");
1298  if (test != 0) HistNumBadChanDepth[test][sub][k]->SetYTitle("Averaged estimator \b");
1299 
1300  if (MaxLum<=1000){
1301  HistNumBadChanDepth[test][sub][k]->SetMarkerStyle(20);
1302  HistNumBadChanDepth[test][sub][k]->SetMarkerSize(0.5);
1303  HistNumBadChanDepth[test][sub][k]->SetMarkerColor(2);
1304  HistNumBadChanDepth[test][sub][k]->SetLineColor(0);
1305  HistNumBadChanDepth[test][sub][k]->GetXaxis()->SetRangeUser(0, MaxLum);
1306  HistNumBadChanDepth[test][sub][k]->Draw("P");
1307  }
1308  else{
1309  HistNumBadChanDepth[test][sub][k]->SetLineColor(2);
1310  HistNumBadChanDepth[test][sub][k]->GetXaxis()->SetRangeUser(0, MaxLum);
1311  HistNumBadChanDepth[test][sub][k]->Draw("L");
1312  }
1313  */
1314  /*
1315  float min_x[] = {0,10000};
1316  float min_y[] = {(float)(Cut0[test][sub][k]),(float)(Cut0[test][sub][k])};
1317  TGraph* MIN = new TGraph(2, min_x, min_y);
1318  MIN->SetLineStyle(2);
1319  MIN->SetLineColor(5);
1320  MIN->SetLineWidth(2 + 100*100);
1321  MIN->SetFillStyle(3005);
1322  MIN->SetFillColor(5);
1323  gPad->SetGridy();
1324  gPad->SetGridx();
1325  MIN->Draw("L");
1326 */
1327 
1328  if (sub == 1 && test != 1) {
1329  cHE->Modified();
1330  }
1331  if (sub == 1 && test == 1) {
1332  cFour1->Modified();
1333  } // HB upgrade
1334  if (sub == 2 && test != 1) {
1335  cHE->Modified();
1336  }
1337  if (sub == 2 && test == 1) {
1338  cNine->Modified();
1339  } // HE upgrade
1340  if (sub == 3) {
1341  cHB->Modified();
1342  }
1343  if (sub == 4 && test != 1) {
1344  cHE->Modified();
1345  }
1346  if (sub == 4 && test == 1) {
1347  cFour1->Modified();
1348  } // HF upgrade
1349 
1350  } // k loop
1351 
1352  if (test == 0) {
1353  if (sub == 1) {
1354  cHE->Print("HistNBCMNHB.png");
1355  cHE->Clear();
1356  }
1357  if (sub == 2) {
1358  cHE->Print("HistNBCMNHE.png");
1359  cHE->Clear();
1360  }
1361  if (sub == 3) {
1362  cHB->Print("HistNBCMNHO.png");
1363  cHB->Clear();
1364  }
1365  if (sub == 4) {
1366  cHE->Print("HistNBCMNHF.png");
1367  cHE->Clear();
1368  }
1369  }
1370  // Amplitude:
1371  if (test == 1) {
1372  if (sub == 1) {
1373  cFour1->Print("HistADCamplHB.png");
1374  cFour1->Clear();
1375  } // HB upgrade
1376  if (sub == 2) {
1377  cNine->Print("HistADCamplHE.png");
1378  cNine->Clear();
1379  } // HE upgrade
1380  if (sub == 3) {
1381  cHB->Print("HistADCamplHO.png");
1382  cHB->Clear();
1383  }
1384  if (sub == 4) {
1385  cFour1->Print("HistADCamplHF.png");
1386  cFour1->Clear();
1387  } // HF upgrade
1388  }
1389  if (test == 2) {
1390  if (sub == 1) {
1391  cHE->Print("HistWidthHB.png");
1392  cHE->Clear();
1393  }
1394  if (sub == 2) {
1395  cHE->Print("HistWidthHE.png");
1396  cHE->Clear();
1397  }
1398  if (sub == 3) {
1399  cHB->Print("HistWidthHO.png");
1400  cHB->Clear();
1401  }
1402  if (sub == 4) {
1403  cHE->Print("HistWidthHF.png");
1404  cHE->Clear();
1405  }
1406  }
1407  if (test == 3) {
1408  if (sub == 1) {
1409  cHE->Print("HistRatioHB.png");
1410  cHE->Clear();
1411  }
1412  if (sub == 2) {
1413  cHE->Print("HistRatioHE.png");
1414  cHE->Clear();
1415  }
1416  if (sub == 3) {
1417  cHB->Print("HistRatioHO.png");
1418  cHB->Clear();
1419  }
1420  if (sub == 4) {
1421  cHE->Print("HistRatioHF.png");
1422  cHE->Clear();
1423  }
1424  }
1425  if (test == 4) {
1426  if (sub == 1) {
1427  cHE->Print("HistTmeanHB.png");
1428  cHE->Clear();
1429  }
1430  if (sub == 2) {
1431  cHE->Print("HistTmeanHE.png");
1432  cHE->Clear();
1433  }
1434  if (sub == 3) {
1435  cHB->Print("HistTmeanHO.png");
1436  cHB->Clear();
1437  }
1438  if (sub == 4) {
1439  cHE->Print("HistTmeanHF.png");
1440  cHE->Clear();
1441  }
1442  }
1443  if (test == 5) {
1444  if (sub == 1) {
1445  cHE->Print("HistTmaxHB.png");
1446  cHE->Clear();
1447  }
1448  if (sub == 2) {
1449  cHE->Print("HistTmaxHE.png");
1450  cHE->Clear();
1451  }
1452  if (sub == 3) {
1453  cHB->Print("HistTmaxHO.png");
1454  cHB->Clear();
1455  }
1456  if (sub == 4) {
1457  cHE->Print("HistTmaxHF.png");
1458  cHE->Clear();
1459  }
1460  }
1461  } // end sub
1463  if (test == 1) {
1464  for (int x = 1; x <= HistNumChanFull[6]->GetXaxis()->GetNbins(); x++) {
1465  HistNumChanFull[6]->SetBinContent(x, 0.0);
1466  int depthsubcount = 0.;
1467  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
1468  int kkkkkkmax = k_max[sub];
1469  if (sub == 4 || sub == 2 || sub == 1)
1470  kkkkkkmax = k_maxupgrade[sub];
1471  // if ( sub==4 || sub==2) kkkkkkmax = k_maxupgrade[sub];
1472  for (int k = k_min[sub]; k <= kkkkkkmax; k++) { //Depth
1473  // 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
1474  // if(sub==2 && k>3 ) break;
1475  depthsubcount++;
1476  double ccc1 = HistNumBadChanDepth[test][sub][k]->GetBinContent(x);
1477  HistNumChanFull[6]->SetBinContent(x, HistNumChanFull[6]->GetBinContent(x) + ccc1);
1478  } //depth
1479  } //sub
1480  if (depthsubcount > 0.) {
1481  HistNumChanFull[6]->SetBinContent(x, (HistNumChanFull[6]->GetBinContent(x)) / depthsubcount);
1482  } else {
1483  HistNumChanFull[6]->SetBinContent(x, (HistNumChanFull[6]->GetBinContent(x)) / 8.);
1484  }
1485  } //x
1486  } //test=1
1488  if (test != 1) {
1489  cHB->Divide(1, 1);
1490  cHB->cd(1);
1491  } else {
1492  cHE->Divide(2, 1);
1493  cHE->cd(1);
1494  }
1495  HistNumBadChanFull[test]->Divide(HistNumBadChanFull[test], HistNumChanFull[test], 1, 1, "B");
1496  TH1F *kfitq = new TH1F("kfitq", "", MaxLum, 1., MaxLum + 1.);
1497  int nx = kfitq->GetXaxis()->GetNbins();
1498  for (int i = 1; i <= nx; i++) {
1499  double ccc1 = HistNumBadChanFull[test]->GetBinContent(i);
1500  if (ccc1 > 0.) {
1501  kfitq->Fill(float(i), ccc1);
1502  kfitq->SetBinError(float(i), 0.01);
1503  }
1504  }
1505  kfitq->SetMarkerStyle(20);
1506  kfitq->SetMarkerSize(0.4);
1507  kfitq->GetYaxis()->SetLabelSize(0.04);
1508  if (test == 0)
1509  kfitq->SetTitle("Average Nbch for whole Hcal \b");
1510  if (test != 0)
1511  kfitq->SetTitle("Averaged estimator for whole Hcal \b");
1512  kfitq->SetXTitle("LS \b");
1513  if (test == 0)
1514  kfitq->SetYTitle("<Number of bad channels> \b");
1515  if (test != 0)
1516  kfitq->SetYTitle("Averaged estimator \b");
1517  kfitq->SetMarkerColor(2);
1518  kfitq->SetLineColor(0);
1519  gPad->SetGridx();
1520  kfitq->Draw("Error");
1521  /*
1522  HistNumBadChanFull[test]->SetMarkerStyle(20);
1523  HistNumBadChanFull[test]->SetMarkerSize(0.8);
1524  HistNumBadChanFull[test]->SetTitle("Averaged estimator for whole Hcal \b");
1525  HistNumBadChanFull[test]->SetXTitle("LS \b");
1526  if (test == 0) HistNumBadChanFull[test]->SetYTitle("<Number of bad channels> \b");
1527  if (test != 0) HistNumBadChanFull[test]->SetYTitle("Averaged estimator \b");
1528  if (MaxLum<=1000){
1529  HistNumBadChanFull[test]->SetMarkerColor(1);
1530  HistNumBadChanFull[test]->SetLineColor(0);
1531  HistNumBadChanFull[test]->Draw("P");
1532  }
1533  else {
1534  HistNumBadChanFull[test]->SetLineColor(1);
1535  HistNumBadChanFull[test]->Draw("L");
1536  }
1537  */
1538  if (test == 1) {
1539  cHE->cd(2);
1540  TH1F *lpuio = new TH1F("lpuio", "", MaxLum, 1., MaxLum + 1.);
1541  int nx = lpuio->GetXaxis()->GetNbins();
1542  for (int i = 1; i <= nx; i++) {
1543  double ccc1 = HistNumChanFull[6]->GetBinContent(i);
1544  if (ccc1 > 0.) {
1545  lpuio->Fill(float(i), ccc1);
1546  lpuio->SetBinError(float(i), 0.01);
1547  }
1548  }
1549  lpuio->SetMarkerStyle(20);
1550  lpuio->SetMarkerSize(0.4);
1551  lpuio->GetYaxis()->SetLabelSize(0.04);
1552  lpuio->SetTitle("Mean of Averaged Amplitudes over all Hcal sub-detectors \b");
1553  lpuio->SetXTitle("LS \b");
1554  lpuio->SetYTitle("Mean of Averaged estimator \b");
1555  lpuio->SetMarkerColor(2);
1556  lpuio->SetLineColor(0);
1557  gPad->SetGridx();
1558  lpuio->Draw("Error");
1559  }
1560  if (test == 0) {
1561  cHB->Print("HistCapID.png");
1562  cHB->Clear();
1563  }
1564  if (test == 1) {
1565  cHE->Print("HistADCAmpl.png");
1566  cHE->Clear();
1567  }
1568  if (test == 2) {
1569  cHB->Print("HistWidth.png");
1570  cHB->Clear();
1571  }
1572  if (test == 3) {
1573  cHB->Print("HistRatio.png");
1574  cHB->Clear();
1575  }
1576  if (test == 4) {
1577  cHB->Print("HistTmean.png");
1578  cHB->Clear();
1579  }
1580  if (test == 5) {
1581  cHB->Print("HistTmax.png");
1582  cHB->Clear();
1583  }
1584 
1585  // clean-up
1586  if (kfitq)
1587  delete kfitq;
1588  } //end test
1589 
1590  //================================================================================================================================
1591 
1592  //=======================================================================================================333
1593  //CapID 1-d histograms
1594 
1595  TH1F *HistAbnormNumBadChanDepth[5][5]; // 1d histogramm for subdet, depth
1596 
1597  //+++++++++++++++++++++++++++++
1598  // Abnormal Bad Channels Rate of Cap ID errors first set of histograms
1599  //+++++++++++++++++++++++++++++
1600 
1601  HistAbnormNumBadChanDepth[1][1] = (TH1F *)hfile->Get("h_runnbadchannelsC_depth1_HB");
1602  HistAbnormNumBadChanDepth[1][2] = (TH1F *)hfile->Get("h_runnbadchannelsC_depth2_HB");
1603  HistAbnormNumBadChanDepth[2][1] = (TH1F *)hfile->Get("h_runnbadchannelsC_depth1_HE");
1604  HistAbnormNumBadChanDepth[2][2] = (TH1F *)hfile->Get("h_runnbadchannelsC_depth2_HE");
1605  HistAbnormNumBadChanDepth[2][3] = (TH1F *)hfile->Get("h_runnbadchannelsC_depth3_HE");
1606  HistAbnormNumBadChanDepth[3][4] = (TH1F *)hfile->Get("h_runnbadchannelsC_depth4_HO");
1607  HistAbnormNumBadChanDepth[4][1] = (TH1F *)hfile->Get("h_runnbadchannelsC_depth1_HF");
1608  HistAbnormNumBadChanDepth[4][2] = (TH1F *)hfile->Get("h_runnbadchannelsC_depth2_HF");
1609 
1610  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
1611  if (sub == 1)
1612  cHB->Divide(2, 1);
1613  if (sub == 2)
1614  cHE->Divide(3, 1);
1615  if (sub == 3)
1616  cONE->Divide(1, 1);
1617  if (sub == 4)
1618  cHB->Divide(2, 1);
1619  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
1620  if (sub == 1)
1621  cHB->cd(k);
1622  if (sub == 2)
1623  cHE->cd(k);
1624  if (sub == 3)
1625  cONE->cd(k - 3);
1626  if (sub == 4)
1627  cHB->cd(k);
1628  gPad->SetGridy();
1629  gPad->SetGridx();
1630  // gPad->SetLogy();
1631  HistAbnormNumBadChanDepth[sub][k]->Divide(
1632  HistAbnormNumBadChanDepth[sub][k], HistNumChanDepth[0][sub][k], 1, 1, "B");
1633  if (k == 1)
1634  HistAbnormNumBadChanDepth[sub][k]->SetTitle("Depth 1\b");
1635  if (k == 2)
1636  HistAbnormNumBadChanDepth[sub][k]->SetTitle("Depth 2\b");
1637  if (k == 3)
1638  HistAbnormNumBadChanDepth[sub][k]->SetTitle("Depth 3\b");
1639  if (k == 4)
1640  HistAbnormNumBadChanDepth[sub][k]->SetTitle("Depth 4\b");
1641  HistAbnormNumBadChanDepth[sub][k]->SetXTitle("LS \b");
1642  HistAbnormNumBadChanDepth[sub][k]->SetYTitle("< Number of bad channels > \b");
1643  if (MaxLum <= 1000) {
1644  HistAbnormNumBadChanDepth[sub][k]->SetMarkerStyle(20);
1645  HistAbnormNumBadChanDepth[sub][k]->SetMarkerSize(0.5);
1646  HistAbnormNumBadChanDepth[sub][k]->SetMarkerColor(1);
1647  HistAbnormNumBadChanDepth[sub][k]->SetLineColor(0);
1648  HistAbnormNumBadChanDepth[sub][k]->GetXaxis()->SetRangeUser(0, MaxLum);
1649  HistAbnormNumBadChanDepth[sub][k]->Draw("P");
1650  } else {
1651  HistAbnormNumBadChanDepth[sub][k]->SetLineColor(1);
1652  HistAbnormNumBadChanDepth[sub][k]->GetXaxis()->SetRangeUser(0, MaxLum);
1653  HistAbnormNumBadChanDepth[sub][k]->Draw("L");
1654  }
1655  }
1656  if (sub == 1) {
1657  cHB->Print("Hist_CAPID_Abnorm_HB.png");
1658  cHB->Clear();
1659  }
1660  if (sub == 2) {
1661  cHE->Print("Hist_CAPID_Abnorm_HE.png");
1662  cHE->Clear();
1663  }
1664  if (sub == 3) {
1665  cONE->Print("Hist_CAPID_Abnorm_HO.png");
1666  cONE->Clear();
1667  }
1668  if (sub == 4) {
1669  cHB->Print("Hist_CAPID_Abnorm_HF.png");
1670  cHB->Clear();
1671  }
1672  } // end sub
1673 
1674  //+++++++++++++++++++++++++++++
1675  // Portions of bad channels events identified by Cap ID errors third set of histograms
1676  //+++++++++++++++++++++++++++++
1677 
1678  TH1F *HistPortBadEventsDepth[5][5]; // 1d histogramm for subdet, depth
1679 
1680  HistPortBadEventsDepth[1][1] = (TH1F *)hfile->Get("h_runbadrateC_depth1_HB");
1681  HistPortBadEventsDepth[1][2] = (TH1F *)hfile->Get("h_runbadrateC_depth2_HB");
1682  HistPortBadEventsDepth[2][1] = (TH1F *)hfile->Get("h_runbadrateC_depth1_HE");
1683  HistPortBadEventsDepth[2][2] = (TH1F *)hfile->Get("h_runbadrateC_depth2_HE");
1684  HistPortBadEventsDepth[2][3] = (TH1F *)hfile->Get("h_runbadrateC_depth3_HE");
1685  HistPortBadEventsDepth[3][4] = (TH1F *)hfile->Get("h_runbadrateC_depth4_HO");
1686  HistPortBadEventsDepth[4][1] = (TH1F *)hfile->Get("h_runbadrateC_depth1_HF");
1687  HistPortBadEventsDepth[4][2] = (TH1F *)hfile->Get("h_runbadrateC_depth2_HF");
1688 
1689  TH1F *HistNumRateDepth[5][5];
1690  HistNumRateDepth[1][1] = (TH1F *)hfile->Get("h_runbadrate0_depth1_HB");
1691  HistNumRateDepth[1][2] = (TH1F *)hfile->Get("h_runbadrate0_depth2_HB");
1692  HistNumRateDepth[2][1] = (TH1F *)hfile->Get("h_runbadrate0_depth1_HE");
1693  HistNumRateDepth[2][2] = (TH1F *)hfile->Get("h_runbadrate0_depth2_HE");
1694  HistNumRateDepth[2][3] = (TH1F *)hfile->Get("h_runbadrate0_depth3_HE");
1695  HistNumRateDepth[3][4] = (TH1F *)hfile->Get("h_runbadrate0_depth4_HO");
1696  HistNumRateDepth[4][1] = (TH1F *)hfile->Get("h_runbadrate0_depth1_HF");
1697  HistNumRateDepth[4][2] = (TH1F *)hfile->Get("h_runbadrate0_depth2_HF");
1698 
1699  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
1700  if (sub == 1)
1701  cHB->Divide(2, 1);
1702  if (sub == 2)
1703  cHE->Divide(3, 1);
1704  if (sub == 3)
1705  cONE->Divide(1, 1);
1706  if (sub == 4)
1707  cHB->Divide(2, 1);
1708  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
1709  if (sub == 1)
1710  cHB->cd(k);
1711  if (sub == 2)
1712  cHE->cd(k);
1713  if (sub == 3)
1714  cONE->cd(k - 3);
1715  if (sub == 4)
1716  cHB->cd(k);
1717  gPad->SetGridy();
1718  gPad->SetGridx();
1719  // gPad->SetLogy();
1720  HistPortBadEventsDepth[sub][k]->Divide(HistPortBadEventsDepth[sub][k], HistNumRateDepth[sub][k], 1, 1, "B");
1721 
1722  if (k == 1)
1723  HistPortBadEventsDepth[sub][k]->SetTitle("Depth 1\b");
1724  if (k == 2)
1725  HistPortBadEventsDepth[sub][k]->SetTitle("Depth 2\b");
1726  if (k == 3)
1727  HistPortBadEventsDepth[sub][k]->SetTitle("Depth 3\b");
1728  if (k == 4)
1729  HistPortBadEventsDepth[sub][k]->SetTitle("Depth 4\b");
1730  HistPortBadEventsDepth[sub][k]->SetXTitle("LS \b");
1731  HistPortBadEventsDepth[sub][k]->SetYTitle("< Number of bad channels > \b");
1732  if (MaxLum <= 1000) {
1733  HistPortBadEventsDepth[sub][k]->SetMarkerStyle(20);
1734  HistPortBadEventsDepth[sub][k]->SetMarkerSize(0.5);
1735  HistPortBadEventsDepth[sub][k]->SetMarkerColor(1);
1736  HistPortBadEventsDepth[sub][k]->SetLineColor(0);
1737  HistPortBadEventsDepth[sub][k]->GetXaxis()->SetRangeUser(0, MaxLum);
1738  HistPortBadEventsDepth[sub][k]->Draw("P");
1739  } else {
1740  HistPortBadEventsDepth[sub][k]->SetLineColor(1);
1741  HistPortBadEventsDepth[sub][k]->GetXaxis()->SetRangeUser(0, MaxLum);
1742  HistPortBadEventsDepth[sub][k]->Draw("L");
1743  }
1744  }
1745  if (sub == 1) {
1746  cHB->Print("HistPortHB.png");
1747  cHB->Clear();
1748  }
1749  if (sub == 2) {
1750  cHE->Print("HistPortHE.png");
1751  cHE->Clear();
1752  }
1753  if (sub == 3) {
1754  cONE->Print("HistPortHO.png");
1755  cONE->Clear();
1756  }
1757  if (sub == 4) {
1758  cHB->Print("HistPortHF.png");
1759  cHB->Clear();
1760  }
1761  } // end sub
1762 
1763  //================================================================================================================================
1764 
1765  //+++++++++++++++++++++++++++++
1766  // Number of bad channels events identified by Cap ID errors third set of histograms
1767  //+++++++++++++++++++++++++++++
1768 
1769  TH1F *HistNBadChsDepth[5][5]; // 1d histogramm for subdet, depth
1770 
1771  HistNBadChsDepth[1][1] = (TH1F *)hfile->Get("h_nbadchannels_depth1_HB");
1772  HistNBadChsDepth[1][2] = (TH1F *)hfile->Get("h_nbadchannels_depth2_HB");
1773  HistNBadChsDepth[2][1] = (TH1F *)hfile->Get("h_nbadchannels_depth1_HE");
1774  HistNBadChsDepth[2][2] = (TH1F *)hfile->Get("h_nbadchannels_depth2_HE");
1775  HistNBadChsDepth[2][3] = (TH1F *)hfile->Get("h_nbadchannels_depth3_HE");
1776  HistNBadChsDepth[3][4] = (TH1F *)hfile->Get("h_nbadchannels_depth4_HO");
1777  HistNBadChsDepth[4][1] = (TH1F *)hfile->Get("h_nbadchannels_depth1_HF");
1778  HistNBadChsDepth[4][2] = (TH1F *)hfile->Get("h_nbadchannels_depth2_HF");
1779 
1780  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
1781  if (sub == 1)
1782  cHB->Divide(2, 1);
1783  if (sub == 2)
1784  cHE->Divide(3, 1);
1785  if (sub == 3)
1786  cONE->Divide(1, 1);
1787  if (sub == 4)
1788  cHB->Divide(2, 1);
1789  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
1790  if (sub == 1)
1791  cHB->cd(k);
1792  if (sub == 2)
1793  cHE->cd(k);
1794  if (sub == 3)
1795  cONE->cd(k - 3);
1796  if (sub == 4)
1797  cHB->cd(k);
1798  gPad->SetGridy();
1799  gPad->SetGridx();
1800  gPad->SetLogy();
1801 
1802  if (k == 1)
1803  HistNBadChsDepth[sub][k]->SetTitle("Depth 1\b");
1804  if (k == 2)
1805  HistNBadChsDepth[sub][k]->SetTitle("Depth 2\b");
1806  if (k == 3)
1807  HistNBadChsDepth[sub][k]->SetTitle("Depth 3\b");
1808  if (k == 4)
1809  HistNBadChsDepth[sub][k]->SetTitle("Depth 4\b");
1810  HistNBadChsDepth[sub][k]->SetXTitle("Number of bad channels\b");
1811  HistNBadChsDepth[sub][k]->SetYTitle("Number of events\b");
1812  // HistNBadChsDepth[sub][k]->SetMarkerStyle(20);
1813  // HistNBadChsDepth[sub][k]->SetMarkerSize(0.5);
1814  // HistNBadChsDepth[sub][k]->SetMarkerColor(1);
1815  // HistNBadChsDepth[sub][k]->SetLineColor(0);
1816  HistNBadChsDepth[sub][k]->Draw("");
1817  }
1818  if (sub == 1) {
1819  cHB->Print("HistNBadChsHB.png");
1820  cHB->Clear();
1821  }
1822  if (sub == 2) {
1823  cHE->Print("HistNBadChsHE.png");
1824  cHE->Clear();
1825  }
1826  if (sub == 3) {
1827  cONE->Print("HistNBadChsHO.png");
1828  cONE->Clear();
1829  }
1830  if (sub == 4) {
1831  cHB->Print("HistNBadChsHF.png");
1832  cHB->Clear();
1833  }
1834  } // end sub
1835 
1836  //====================================================================== HB :
1837  //====================================================================== HB :
1838  //====================================================================== HB :
1839  // Special test of errors type A and B in HB
1840  // AZ 08.02.2016
1841 
1842  int flagErrAB_HB[2];
1843  flagErrAB_HB[0] = -1;
1844  flagErrAB_HB[1] = -1;
1845  double avedelta_HB = 0.;
1846  int lastLumiBin_HB = -1;
1847  int LSofFirstErrB_HB = -1;
1848  {
1849  const int specCountA = 4;
1850  const int specColors[specCountA] = {1, 2, 3, 4};
1851  const TString hnames[specCountA][2] = {{"h_sumADCAmplperLS1_P1", "h_sum0ADCAmplperLS1_P1"},
1852  {"h_sumADCAmplperLS1_P2", "h_sum0ADCAmplperLS1_P2"},
1853  {"h_sumADCAmplperLS1_M1", "h_sum0ADCAmplperLS1_M1"},
1854  {"h_sumADCAmplperLS1_M2", "h_sum0ADCAmplperLS1_M2"}};
1855 
1856  std::vector<TH1F *> hV;
1857  THStack *hs = new THStack("hs", "ADCAmplerLS1");
1858  cHB->Clear();
1859  // cHB->cd();
1860  cHB->Divide(2, 1);
1861  cHB->cd(1);
1862 
1864  for (int i = 0; i < specCountA; i++) {
1865  if (1)
1866  std::cout << "debugger: errA_HB : get histos for i=" << i << " " << hnames[i][0] << " and " << hnames[i][1]
1867  << "\n";
1868  TH1F *h1 = (TH1F *)hfile->Get(hnames[i][0]);
1869  TH1F *h0 = (TH1F *)hfile->Get(hnames[i][1]);
1870  if (!h1 || !h0) {
1871  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
1872  ptext->AddText("Missing histo");
1873  if (!h1) {
1874  std::cout << "\tfailed to get " << hnames[i][0] << "\n";
1875  ptext->AddText(hnames[i][0]);
1876  }
1877  if (!h0) {
1878  std::cout << "\tfailed to get " << hnames[i][1] << "\n";
1879  ptext->AddText(hnames[i][1]);
1880  }
1881  ptext->Draw();
1882  continue;
1883  }
1884  TH1F *hERT1orig = (TH1F *)h1->Clone(Form("ERT1orig_%d", i));
1885  hERT1orig->Divide(h1, h0, 1, 1, "B");
1886 
1887  if ((lastLumiBin_HB < 0) && (i == 0)) {
1888  for (int ibin = hERT1orig->GetNbinsX(); ibin >= 1; ibin--) {
1889  if (hERT1orig->GetBinContent(ibin) == 0)
1890  lastLumiBin_HB = ibin;
1891  else
1892  break;
1893  }
1894  lastLumiBin_HB += 3; // show more bins
1895  if (lastLumiBin_HB >= hERT1orig->GetNbinsX())
1896  lastLumiBin_HB = -1;
1897  }
1898  TH1F *hERT1 = NULL;
1899  if (lastLumiBin_HB > 1) {
1900  if (!copyContents(&hERT1, Form("ERT1_%d", i), "", hERT1orig, lastLumiBin_HB)) {
1901  std::cout << "code failed" << std::endl;
1902  gSystem->Exit(1);
1903  }
1904  } else
1905  hERT1 = hERT1orig;
1906 
1907  hERT1->GetXaxis()->SetTitle("<ADCAmpl> per LS HB: black-P1, red-P2,green-M1,blue-M2");
1908  hV.push_back(hERT1);
1909  hERT1->SetMarkerStyle(20);
1910  hERT1->SetMarkerSize(0.4);
1911  hERT1->SetXTitle("<A>(ev.in LS & ch.) - HB P1 - iLS \b");
1912  hERT1->SetMarkerColor(specColors[i]);
1913  hERT1->SetLineColor(0);
1914  hs->Add(hERT1);
1915  delete h1;
1916  delete h0;
1917  if (hERT1 != hERT1orig)
1918  delete hERT1orig;
1919  }
1920  hs->Draw("LPE1 nostack");
1921  cHB->Update(); // activate the axes
1922  hs->GetXaxis()->SetTitle("<A> per LS: black-P1, red-P2,green-M1,blue-M2");
1923  hs->Draw("LPE1 nostack");
1924  gPad->SetGridy();
1926 
1927  // AZ corrections 08.02.2016
1928  cHB->cd(2);
1929  TH1F *diff = new TH1F("diff", "", 100, 0., 4.);
1930 
1931  if (int(hV.size()) == specCountA) {
1932  flagErrAB_HB[0] = 0; // If we have the expected number of histograms, set the flag
1933  double sumdelta = 0.;
1934  int nnndelta = 0;
1935  for (int ibin = 1; ibin <= hV[0]->GetNbinsX(); ibin++) {
1936  double delta = 0.;
1937  double maxdelta = 0.;
1938  for (unsigned int i = 0; i < hV.size(); i++) {
1939  const TH1F *hi = hV[i];
1940  for (unsigned int j = 1; j < hV.size(); j++) {
1941  const TH1F *hj = hV[j];
1942  delta = fabs(hi->GetBinContent(ibin) - hj->GetBinContent(ibin));
1943  if (delta > maxdelta)
1944  maxdelta = delta;
1945  } //for
1946  } //for
1947  if (maxdelta > 0.) {
1948  diff->Fill(maxdelta);
1949  sumdelta += maxdelta;
1950  nnndelta++;
1951  }
1952  } //for ibin
1953  // avedelta_HB = sumdelta/hV[0]->GetNbinsX();
1954  avedelta_HB = sumdelta / nnndelta;
1955  std::cout << "******************>>>>>> ErrA_HB: avedelta_HB = " << avedelta_HB << std::endl;
1956  if (avedelta_HB > 0.24 || (avedelta_HB < 0.14 && avedelta_HB > 0.)) {
1957  flagErrAB_HB[0] = 1;
1958  } //if
1959  } //hV.size
1960  diff->SetMarkerStyle(20);
1961  diff->SetMarkerSize(0.8);
1962  diff->SetXTitle("max difference \b");
1963  diff->SetMarkerColor(2);
1964  diff->SetLineColor(0);
1965  gPad->SetGridx();
1966  gPad->SetLogy();
1967  diff->Draw("Error");
1969  cHB->Update();
1970  cHB->Print("HistErrA_HB.png");
1971  cHB->Clear();
1973 
1974  // clean-up
1975  if (diff)
1976  delete diff;
1977  for (unsigned int i = 0; i < hV.size(); i++)
1978  delete hV[i];
1979  } // ErrorA in HB
1980 
1982 
1983  { // errors type B
1984  const int specCountB = 4;
1985  const TString hnames[specCountB][2] = {{"h_2DsumErrorBLS1", "h_2D0sumErrorBLS1"},
1986  {"h_sumErrorBperLS1", "h_sum0ErrorBperLS1"},
1987  {"h_2DsumErrorBLS2", "h_2D0sumErrorBLS2"},
1988  {"h_sumErrorBperLS2", "h_sum0ErrorBperLS2"}};
1989 
1990  for (int depth = 1; depth <= 2; depth++) {
1991  cHB->Clear();
1992  cHB->Divide(2, 1);
1993  cHB->cd(1);
1994 
1995  TH1F *hRate2orig = NULL;
1996  TH2F *h2Cefz6 = NULL;
1997  TString hname1 = hnames[2 * depth - 2][0];
1998  TString hname0 = hnames[2 * depth - 2][1];
1999  TH2F *twod1 = (TH2F *)hfile->Get(hname1);
2000  TH2F *twod0 = (TH2F *)hfile->Get(hname0);
2001  if (1)
2002  std::cout << "debugger: errB_HB depth=" << depth << ". get 2D histos " << hname1 << " and " << hname0 << "\n";
2003  if (!twod1 || !twod0) {
2004  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2005  ptext->AddText("Missing histos");
2006  if (!twod1) {
2007  std::cout << "\tfailed to get " << hname1 << "\n";
2008  ptext->AddText(hname1);
2009  }
2010  if (!twod0) {
2011  std::cout << "\tfailed to get " << hname0 << "\n";
2012  ptext->AddText(hname0);
2013  }
2014  ptext->Draw();
2015  } else {
2016  h2Cefz6 = (TH2F *)twod1->Clone(Form("Cefz6_%d", depth));
2017  h2Cefz6->SetTitle(Form("HB Depth %d \b", depth));
2018  h2Cefz6->Divide(twod1, twod0, 1, 1, "B");
2019 
2020  gPad->SetGridy();
2021  gPad->SetGridx();
2022  gPad->SetLogz();
2023  h2Cefz6->SetTitle(Form("Depth %d \b", depth));
2024  h2Cefz6->SetMarkerStyle(20);
2025  h2Cefz6->SetMarkerSize(0.4);
2026  // h2Cefz6->GetZaxis()->SetLabelSize(0.04);
2027  h2Cefz6->SetXTitle("#eta \b");
2028  h2Cefz6->SetYTitle("#phi \b");
2029  h2Cefz6->SetZTitle(Form("<ErrorB> - HB Depth%d \b", depth));
2030  h2Cefz6->SetMarkerColor(2);
2031  h2Cefz6->SetLineColor(2);
2032  h2Cefz6->Draw("COLZ");
2033 
2034  delete twod1;
2035  delete twod0;
2036  } // histos ok
2037 
2038  cHB->cd(2);
2039  hname1 = hnames[2 * depth - 1][0];
2040  hname0 = hnames[2 * depth - 1][1];
2041  TH1F *h1 = (TH1F *)hfile->Get(hname1);
2042  TH1F *h0 = (TH1F *)hfile->Get(hname0);
2043  if (1)
2044  std::cout << "errB_HB depth=" << depth << ". get 2D histos " << hname1 << " and " << hname0 << "\n";
2045  if (!h1 || !h0) {
2046  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2047  ptext->AddText("Missing histo");
2048  if (!h1) {
2049  std::cout << "\tfailed to get " << hname1 << "\n";
2050  ptext->AddText(hname1);
2051  }
2052  if (!h0) {
2053  std::cout << "\tfailed to get " << hname0 << "\n";
2054  ptext->AddText(hname0);
2055  }
2056  ptext->Draw();
2057  } else {
2058  gPad->SetGridx();
2059  gPad->SetGridy();
2060  // gPad->SetLogy();
2061  hRate2orig = (TH1F *)h1->Clone(Form("Rate2orig_%d", depth));
2062  hRate2orig->Divide(h1, h0, 1, 1, "B");
2063 
2064  TH1F *hRate2 = NULL;
2065  if (lastLumiBin_HB > 1) {
2066  if (!copyContents(&hRate2, Form("Rate2_%d", depth), "", hRate2orig, lastLumiBin_HB)) {
2067  std::cout << "code failed" << std::endl;
2068  gSystem->Exit(1);
2069  }
2070  } else
2071  hRate2 = hRate2orig;
2072 
2073  hRate2->SetTitle(Form("Depth %d \b", depth));
2074  hRate2->SetMarkerStyle(20);
2075  hRate2->SetMarkerSize(0.8);
2076  // hRate2->GetZaxis()->SetLabelSize(0.04);
2077  hRate2->SetXTitle(Form("<ErrorB>(ev.in LS & ch.) - HB depth%d - iLS \b", depth));
2078  hRate2->SetMarkerColor(2);
2079  hRate2->SetLineColor(0);
2080  hRate2->Draw("Error");
2081 
2082  if (LSofFirstErrB_HB == -1) {
2083  int nx = hRate2->GetXaxis()->GetNbins();
2084  for (int i = 1; i <= nx; i++) {
2085  double ccc1 = hRate2->GetBinContent(i);
2086  if (ccc1 > 0.) {
2087  cout << "****************>>>>>>>>>>> ErrB_HB bad LS start at iLS = " << i << " with rate = " << ccc1
2088  << endl;
2089  LSofFirstErrB_HB = i;
2090  break;
2091  }
2092  }
2093  }
2094 
2095  delete h1;
2096  delete h0;
2097  if (hRate2 != hRate2orig) {
2098  delete hRate2orig;
2099  hRate2orig = hRate2;
2100  }
2101  }
2102 
2103  cHB->Update();
2104  cHB->Print(Form("HistErrB_HB_%d.png", depth));
2105  cHB->Clear();
2106  if (h2Cefz6)
2107  delete h2Cefz6;
2108  if (hRate2orig)
2109  delete hRate2orig;
2110  }
2111  } // ErrorsB in HB
2112 
2113  //====================================================================== HE :
2114  //====================================================================== HE :
2115  //====================================================================== HE :
2116  // Special test of errors type A and B in HE
2117  // AZ 08.02.2016
2118 
2119  int flagErrAB_HE[2];
2120  flagErrAB_HE[0] = -1;
2121  flagErrAB_HE[1] = -1;
2122  double avedelta_HE = 0.;
2123  int lastLumiBin_HE = -1;
2124  int LSofFirstErrB_HE = -1;
2125  {
2126  const int specCountA = 4;
2127  const int specColors[specCountA] = {1, 2, 3, 4};
2128  const TString hnames[specCountA][2] = {{"h_sumADCAmplperLS3_P1", "h_sum0ADCAmplperLS3_P1"},
2129  {"h_sumADCAmplperLS3_P2", "h_sum0ADCAmplperLS3_P2"},
2130  {"h_sumADCAmplperLS3_M1", "h_sum0ADCAmplperLS3_M1"},
2131  {"h_sumADCAmplperLS3_M2", "h_sum0ADCAmplperLS3_M2"}};
2132 
2133  std::vector<TH1F *> hV;
2134  THStack *hs = new THStack("hs", "ADCAmplerLS1");
2135  cHB->Clear();
2136  // cHB->cd();
2137  cHB->Divide(2, 1);
2138  cHB->cd(1);
2139 
2141  for (int i = 0; i < specCountA; i++) {
2142  if (1)
2143  std::cout << "debugger: errA_HE : get histos for i=" << i << " " << hnames[i][0] << " and " << hnames[i][1]
2144  << "\n";
2145  TH1F *h1 = (TH1F *)hfile->Get(hnames[i][0]);
2146  TH1F *h0 = (TH1F *)hfile->Get(hnames[i][1]);
2147  if (!h1 || !h0) {
2148  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2149  ptext->AddText("Missing histo");
2150  if (!h1) {
2151  std::cout << "\tfailed to get " << hnames[i][0] << "\n";
2152  ptext->AddText(hnames[i][0]);
2153  }
2154  if (!h0) {
2155  std::cout << "\tfailed to get " << hnames[i][1] << "\n";
2156  ptext->AddText(hnames[i][1]);
2157  }
2158  ptext->Draw();
2159  continue;
2160  }
2161  TH1F *hERT1orig = (TH1F *)h1->Clone(Form("ERT1orig_%d", i));
2162  hERT1orig->Divide(h1, h0, 1, 1, "B");
2163 
2164  if ((lastLumiBin_HE < 0) && (i == 0)) {
2165  for (int ibin = hERT1orig->GetNbinsX(); ibin >= 1; ibin--) {
2166  if (hERT1orig->GetBinContent(ibin) == 0)
2167  lastLumiBin_HE = ibin;
2168  else
2169  break;
2170  }
2171  lastLumiBin_HE += 3; // show more bins
2172  if (lastLumiBin_HE >= hERT1orig->GetNbinsX())
2173  lastLumiBin_HE = -1;
2174  }
2175  TH1F *hERT1 = NULL;
2176  if (lastLumiBin_HE > 1) {
2177  if (!copyContents(&hERT1, Form("ERT1_%d", i), "", hERT1orig, lastLumiBin_HE)) {
2178  std::cout << "code failed" << std::endl;
2179  gSystem->Exit(1);
2180  }
2181  } else
2182  hERT1 = hERT1orig;
2183 
2184  hERT1->GetXaxis()->SetTitle("<ADCAmpl> per LS HE: black-P1, red-P2,green-M1,blue-M2");
2185  hV.push_back(hERT1);
2186  hERT1->SetMarkerStyle(20);
2187  hERT1->SetMarkerSize(0.4);
2188  hERT1->SetXTitle("<A>(ev.in LS & ch.) - HE P1 - iLS \b");
2189  hERT1->SetMarkerColor(specColors[i]);
2190  hERT1->SetLineColor(0);
2191  hs->Add(hERT1);
2192  delete h1;
2193  delete h0;
2194  if (hERT1 != hERT1orig)
2195  delete hERT1orig;
2196  }
2197  hs->Draw("LPE1 nostack");
2198  cHB->Update(); // activate the axes
2199  hs->GetXaxis()->SetTitle("<A> per LS: black-P1, red-P2,green-M1,blue-M2");
2200  hs->Draw("LPE1 nostack");
2201  gPad->SetGridy();
2203 
2204  // AZ corrections 08.02.2016
2205  cHB->cd(2);
2206  TH1F *diff = new TH1F("diff", "", 100, 0., 4.);
2207 
2208  if (int(hV.size()) == specCountA) {
2209  flagErrAB_HE[0] = 0; // If we have the expected number of histograms, set the flag
2210  double sumdelta = 0.;
2211  int nnndelta = 0;
2212  for (int ibin = 1; ibin <= hV[0]->GetNbinsX(); ibin++) {
2213  double delta = 0.;
2214  double maxdelta = 0.;
2215  for (unsigned int i = 0; i < hV.size(); i++) {
2216  const TH1F *hi = hV[i];
2217  for (unsigned int j = 1; j < hV.size(); j++) {
2218  const TH1F *hj = hV[j];
2219  delta = fabs(hi->GetBinContent(ibin) - hj->GetBinContent(ibin));
2220  if (delta > maxdelta)
2221  maxdelta = delta;
2222  } //for
2223  } //for
2224  if (maxdelta > 0.) {
2225  diff->Fill(maxdelta);
2226  sumdelta += maxdelta;
2227  nnndelta++;
2228  }
2229  } //for ibin
2230  // avedelta_HE = sumdelta/hV[0]->GetNbinsX();
2231  avedelta_HE = sumdelta / nnndelta;
2232  std::cout << "******************>>>>>> ErrA_HE: avedelta_HE = " << avedelta_HE << std::endl;
2233  if (avedelta_HE > 1.1 || (avedelta_HE < 0.5 && avedelta_HE > 0.)) {
2234  flagErrAB_HE[0] = 1;
2235  } //if
2236  } //hV.size
2237  diff->SetMarkerStyle(20);
2238  diff->SetMarkerSize(0.8);
2239  diff->SetXTitle("max difference \b");
2240  diff->SetMarkerColor(2);
2241  diff->SetLineColor(0);
2242  gPad->SetGridx();
2243  gPad->SetLogy();
2244  diff->Draw("Error");
2246  cHB->Update();
2247  cHB->Print("HistErrA_HE.png");
2248  cHB->Clear();
2250 
2251  // clean-up
2252  if (diff)
2253  delete diff;
2254  for (unsigned int i = 0; i < hV.size(); i++)
2255  delete hV[i];
2256  } // ErrorA in HE
2257 
2259 
2260  { // errors type B
2261  const int specCountB = 6;
2262  const TString hnames[specCountB][2] = {{"h_2DsumErrorBLS3", "h_2D0sumErrorBLS3"},
2263  {"h_sumErrorBperLS3", "h_sum0ErrorBperLS3"},
2264  {"h_2DsumErrorBLS4", "h_2D0sumErrorBLS4"},
2265  {"h_sumErrorBperLS4", "h_sum0ErrorBperLS4"},
2266  {"h_2DsumErrorBLS5", "h_2D0sumErrorBLS5"},
2267  {"h_sumErrorBperLS5", "h_sum0ErrorBperLS5"}};
2268 
2269  for (int depth = 1; depth <= 3; depth++) {
2270  cHB->Clear();
2271  cHB->Divide(2, 1);
2272  cHB->cd(1);
2273 
2274  TH1F *hRate2orig = NULL;
2275  TH2F *h2Cefz6 = NULL;
2276  TString hname1 = hnames[2 * depth - 2][0];
2277  TString hname0 = hnames[2 * depth - 2][1];
2278  TH2F *twod1 = (TH2F *)hfile->Get(hname1);
2279  TH2F *twod0 = (TH2F *)hfile->Get(hname0);
2280  if (1)
2281  std::cout << "debugger: errB_HE depth=" << depth << ". get 2D histos " << hname1 << " and " << hname0 << "\n";
2282  if (!twod1 || !twod0) {
2283  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2284  ptext->AddText("Missing histos");
2285  if (!twod1) {
2286  std::cout << "\tfailed to get " << hname1 << "\n";
2287  ptext->AddText(hname1);
2288  }
2289  if (!twod0) {
2290  std::cout << "\tfailed to get " << hname0 << "\n";
2291  ptext->AddText(hname0);
2292  }
2293  ptext->Draw();
2294  } else {
2295  h2Cefz6 = (TH2F *)twod1->Clone(Form("Cefz6_%d", depth));
2296  h2Cefz6->SetTitle(Form("HE Depth %d \b", depth));
2297  h2Cefz6->Divide(twod1, twod0, 1, 1, "B");
2298 
2299  gPad->SetGridy();
2300  gPad->SetGridx();
2301  gPad->SetLogz();
2302  h2Cefz6->SetTitle(Form("Depth %d \b", depth));
2303  h2Cefz6->SetMarkerStyle(20);
2304  h2Cefz6->SetMarkerSize(0.4);
2305  // h2Cefz6->GetZaxis()->SetLabelSize(0.04);
2306  h2Cefz6->SetXTitle("#eta \b");
2307  h2Cefz6->SetYTitle("#phi \b");
2308  h2Cefz6->SetZTitle(Form("<ErrorB> - HE Depth%d \b", depth));
2309  h2Cefz6->SetMarkerColor(2);
2310  h2Cefz6->SetLineColor(2);
2311  h2Cefz6->Draw("COLZ");
2312 
2313  delete twod1;
2314  delete twod0;
2315  } // histos ok
2316 
2317  cHB->cd(2);
2318  hname1 = hnames[2 * depth - 1][0];
2319  hname0 = hnames[2 * depth - 1][1];
2320  TH1F *h1 = (TH1F *)hfile->Get(hname1);
2321  TH1F *h0 = (TH1F *)hfile->Get(hname0);
2322  if (1)
2323  std::cout << "errB_HE depth=" << depth << ". get 2D histos " << hname1 << " and " << hname0 << "\n";
2324  if (!h1 || !h0) {
2325  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2326  ptext->AddText("Missing histo");
2327  if (!h1) {
2328  std::cout << "\tfailed to get " << hname1 << "\n";
2329  ptext->AddText(hname1);
2330  }
2331  if (!h0) {
2332  std::cout << "\tfailed to get " << hname0 << "\n";
2333  ptext->AddText(hname0);
2334  }
2335  ptext->Draw();
2336  } else {
2337  gPad->SetGridx();
2338  gPad->SetGridy();
2339  // gPad->SetLogy();
2340  hRate2orig = (TH1F *)h1->Clone(Form("Rate2orig_%d", depth));
2341  hRate2orig->Divide(h1, h0, 1, 1, "B");
2342 
2343  TH1F *hRate2 = NULL;
2344  if (lastLumiBin_HE > 1) {
2345  if (!copyContents(&hRate2, Form("Rate2_%d", depth), "", hRate2orig, lastLumiBin_HE)) {
2346  std::cout << "code failed" << std::endl;
2347  gSystem->Exit(1);
2348  }
2349  } else
2350  hRate2 = hRate2orig;
2351 
2352  hRate2->SetTitle(Form("Depth %d \b", depth));
2353  hRate2->SetMarkerStyle(20);
2354  hRate2->SetMarkerSize(0.8);
2355  // hRate2->GetZaxis()->SetLabelSize(0.04);
2356  hRate2->SetXTitle(Form("<ErrorB>(ev.in LS & ch.) - HE depth%d - iLS \b", depth));
2357  hRate2->SetMarkerColor(2);
2358  hRate2->SetLineColor(0);
2359  hRate2->Draw("Error");
2360 
2361  if (LSofFirstErrB_HE == -1) {
2362  int nx = hRate2->GetXaxis()->GetNbins();
2363  for (int i = 1; i <= nx; i++) {
2364  double ccc1 = hRate2->GetBinContent(i);
2365  if (ccc1 > 0.) {
2366  cout << "****************>>>>>>>>>>> ErrB_HE bad LS start at iLS = " << i << " with rate = " << ccc1
2367  << endl;
2368  LSofFirstErrB_HE = i;
2369  break;
2370  }
2371  }
2372  }
2373 
2374  delete h1;
2375  delete h0;
2376  if (hRate2 != hRate2orig) {
2377  delete hRate2orig;
2378  hRate2orig = hRate2;
2379  }
2380  }
2381 
2382  cHB->Update();
2383  cHB->Print(Form("HistErrB_HE_%d.png", depth));
2384  cHB->Clear();
2385  if (h2Cefz6)
2386  delete h2Cefz6;
2387  if (hRate2orig)
2388  delete hRate2orig;
2389  }
2390  } // ErrorsB in HE
2391 
2392  //====================================================================== HO :
2393  //====================================================================== HO :
2394  //====================================================================== HO :
2395  // Special test of errors type A and B in HO
2396  // AZ 08.02.2016
2397 
2398  int flagErrAB_HO[2];
2399  flagErrAB_HO[0] = -1;
2400  flagErrAB_HO[1] = -1;
2401  double avedelta_HO = 0.;
2402  int lastLumiBin_HO = -1;
2403  int LSofFirstErrB_HO = -1;
2404  {
2405  const int specCountA = 4;
2406  const int specColors[specCountA] = {1, 2, 3, 4};
2407  const TString hnames[specCountA][2] = {{"h_sumADCAmplperLS8_P1", "h_sum0ADCAmplperLS8_P1"},
2408  {"h_sumADCAmplperLS8_P2", "h_sum0ADCAmplperLS8_P2"},
2409  {"h_sumADCAmplperLS8_M1", "h_sum0ADCAmplperLS8_M1"},
2410  {"h_sumADCAmplperLS8_M2", "h_sum0ADCAmplperLS8_M2"}};
2411 
2412  std::vector<TH1F *> hV;
2413  THStack *hs = new THStack("hs", "ADCAmplerLS1");
2414  cHB->Clear();
2415  // cHB->cd();
2416  cHB->Divide(2, 1);
2417  cHB->cd(1);
2418 
2420  for (int i = 0; i < specCountA; i++) {
2421  if (1)
2422  std::cout << "debugger: errA_HO : get histos for i=" << i << " " << hnames[i][0] << " and " << hnames[i][1]
2423  << "\n";
2424  TH1F *h1 = (TH1F *)hfile->Get(hnames[i][0]);
2425  TH1F *h0 = (TH1F *)hfile->Get(hnames[i][1]);
2426  if (!h1 || !h0) {
2427  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2428  ptext->AddText("Missing histo");
2429  if (!h1) {
2430  std::cout << "\tfailed to get " << hnames[i][0] << "\n";
2431  ptext->AddText(hnames[i][0]);
2432  }
2433  if (!h0) {
2434  std::cout << "\tfailed to get " << hnames[i][1] << "\n";
2435  ptext->AddText(hnames[i][1]);
2436  }
2437  ptext->Draw();
2438  continue;
2439  }
2440  TH1F *hoRT1orig = (TH1F *)h1->Clone(Form("ERT1orig_%d", i));
2441  hoRT1orig->Divide(h1, h0, 1, 1, "B");
2442 
2443  if ((lastLumiBin_HO < 0) && (i == 0)) {
2444  for (int ibin = hoRT1orig->GetNbinsX(); ibin >= 1; ibin--) {
2445  if (hoRT1orig->GetBinContent(ibin) == 0)
2446  lastLumiBin_HO = ibin;
2447  else
2448  break;
2449  }
2450  lastLumiBin_HO += 3; // show more bins
2451  if (lastLumiBin_HO >= hoRT1orig->GetNbinsX())
2452  lastLumiBin_HO = -1;
2453  }
2454  TH1F *hoRT1 = NULL;
2455  if (lastLumiBin_HO > 1) {
2456  if (!copyContents(&hoRT1, Form("ERT1_%d", i), "", hoRT1orig, lastLumiBin_HO)) {
2457  std::cout << "code failed" << std::endl;
2458  gSystem->Exit(1);
2459  }
2460  } else
2461  hoRT1 = hoRT1orig;
2462 
2463  hoRT1->GetXaxis()->SetTitle("<ADCAmpl> per LS HO: black-P1, red-P2,green-M1,blue-M2");
2464  hV.push_back(hoRT1);
2465  hoRT1->SetMarkerStyle(20);
2466  hoRT1->SetMarkerSize(0.4);
2467  hoRT1->SetXTitle("<A>(ev.in LS & ch.) - HO P1 - iLS \b");
2468  hoRT1->SetMarkerColor(specColors[i]);
2469  hoRT1->SetLineColor(0);
2470  hs->Add(hoRT1);
2471  delete h1;
2472  delete h0;
2473  if (hoRT1 != hoRT1orig)
2474  delete hoRT1orig;
2475  }
2476  hs->Draw("LPE1 nostack");
2477  cHB->Update(); // activate tho axes
2478  hs->GetXaxis()->SetTitle("<A> per LS: black-P1, red-P2,green-M1,blue-M2");
2479  hs->Draw("LPE1 nostack");
2480  gPad->SetGridy();
2482 
2483  // AZ corrections 08.02.2016
2484  cHB->cd(2);
2485  TH1F *diff = new TH1F("diff", "", 100, 0., 4.);
2486 
2487  if (int(hV.size()) == specCountA) {
2488  flagErrAB_HO[0] = 0; // If we have tho expected number of histograms, set tho flag
2489  double sumdelta = 0.;
2490  int nnndelta = 0;
2491  for (int ibin = 1; ibin <= hV[0]->GetNbinsX(); ibin++) {
2492  double delta = 0.;
2493  double maxdelta = 0.;
2494  for (unsigned int i = 0; i < hV.size(); i++) {
2495  const TH1F *hi = hV[i];
2496  for (unsigned int j = 1; j < hV.size(); j++) {
2497  const TH1F *hj = hV[j];
2498  delta = fabs(hi->GetBinContent(ibin) - hj->GetBinContent(ibin));
2499  if (delta > maxdelta)
2500  maxdelta = delta;
2501  } //for
2502  } //for
2503  if (maxdelta > 0.) {
2504  diff->Fill(maxdelta);
2505  sumdelta += maxdelta;
2506  nnndelta++;
2507  }
2508  } //for ibin
2509  // avedelta_HO = sumdelta/hV[0]->GetNbinsX();
2510  avedelta_HO = sumdelta / nnndelta;
2511  std::cout << "******************>>>>>> ErrA_HO: avedelta_HO = " << avedelta_HO << std::endl;
2512  if (avedelta_HO > 0.8 || (avedelta_HO < 0.2 && avedelta_HO > 0.)) {
2513  flagErrAB_HO[0] = 1;
2514  } //if
2515  } //hV.size
2516  diff->SetMarkerStyle(20);
2517  diff->SetMarkerSize(0.8);
2518  diff->SetXTitle("max difference \b");
2519  diff->SetMarkerColor(2);
2520  diff->SetLineColor(0);
2521  gPad->SetGridx();
2522  gPad->SetLogy();
2523  diff->Draw("Error");
2525  cHB->Update();
2526  cHB->Print("HistErrA_HO.png");
2527  cHB->Clear();
2529 
2530  // clean-up
2531  if (diff)
2532  delete diff;
2533  for (unsigned int i = 0; i < hV.size(); i++)
2534  delete hV[i];
2535  } // ErrorA in HO
2536 
2538 
2539  { // errors type B
2540  const int specCountB = 2;
2541  const TString hnames[specCountB][2] = {{"h_2DsumErrorBLS8", "h_2D0sumErrorBLS8"},
2542  {"h_sumErrorBperLS8", "h_sum0ErrorBperLS8"}};
2543 
2544  for (int depth = 4; depth <= 4; depth++) {
2545  cHB->Clear();
2546  cHB->Divide(2, 1);
2547  cHB->cd(1);
2548 
2549  TH1F *hRate2orig = NULL;
2550  TH2F *h2Cefz6 = NULL;
2551  TString hname1 = hnames[2 * depth - 8][0];
2552  TString hname0 = hnames[2 * depth - 8][1];
2553  TH2F *twod1 = (TH2F *)hfile->Get(hname1);
2554  TH2F *twod0 = (TH2F *)hfile->Get(hname0);
2555  if (1)
2556  std::cout << "debugger: errB_HO depth=" << depth << ". get 2D histos " << hname1 << " and " << hname0 << "\n";
2557  if (!twod1 || !twod0) {
2558  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2559  ptext->AddText("Missing histos");
2560  if (!twod1) {
2561  std::cout << "\tfailed to get " << hname1 << "\n";
2562  ptext->AddText(hname1);
2563  }
2564  if (!twod0) {
2565  std::cout << "\tfailed to get " << hname0 << "\n";
2566  ptext->AddText(hname0);
2567  }
2568  ptext->Draw();
2569  } else {
2570  h2Cefz6 = (TH2F *)twod1->Clone(Form("Cefz6_%d", depth));
2571  h2Cefz6->SetTitle(Form("HO Depth %d \b", depth));
2572  h2Cefz6->Divide(twod1, twod0, 1, 1, "B");
2573 
2574  gPad->SetGridy();
2575  gPad->SetGridx();
2576  gPad->SetLogz();
2577  h2Cefz6->SetTitle(Form("Depth %d \b", depth));
2578  h2Cefz6->SetMarkerStyle(20);
2579  h2Cefz6->SetMarkerSize(0.4);
2580  // h2Cefz6->GetZaxis()->SetLabelSize(0.04);
2581  h2Cefz6->SetXTitle("#eta \b");
2582  h2Cefz6->SetYTitle("#phi \b");
2583  h2Cefz6->SetZTitle(Form("<ErrorB> - HO Depth%d \b", depth));
2584  h2Cefz6->SetMarkerColor(2);
2585  h2Cefz6->SetLineColor(2);
2586  h2Cefz6->Draw("COLZ");
2587 
2588  delete twod1;
2589  delete twod0;
2590  } // histos ok
2591 
2592  cHB->cd(2);
2593  hname1 = hnames[2 * depth - 7][0];
2594  hname0 = hnames[2 * depth - 7][1];
2595  TH1F *h1 = (TH1F *)hfile->Get(hname1);
2596  TH1F *h0 = (TH1F *)hfile->Get(hname0);
2597  if (1)
2598  std::cout << "errB_HO depth=" << depth << ". get 2D histos " << hname1 << " and " << hname0 << "\n";
2599  if (!h1 || !h0) {
2600  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2601  ptext->AddText("Missing histo");
2602  if (!h1) {
2603  std::cout << "\tfailed to get " << hname1 << "\n";
2604  ptext->AddText(hname1);
2605  }
2606  if (!h0) {
2607  std::cout << "\tfailed to get " << hname0 << "\n";
2608  ptext->AddText(hname0);
2609  }
2610  ptext->Draw();
2611  } else {
2612  gPad->SetGridx();
2613  gPad->SetGridy();
2614  // gPad->SetLogy();
2615  hRate2orig = (TH1F *)h1->Clone(Form("Rate2orig_%d", depth));
2616  hRate2orig->Divide(h1, h0, 1, 1, "B");
2617 
2618  TH1F *hRate2 = NULL;
2619  if (lastLumiBin_HO > 1) {
2620  if (!copyContents(&hRate2, Form("Rate2_%d", depth), "", hRate2orig, lastLumiBin_HO)) {
2621  std::cout << "code failed" << std::endl;
2622  gSystem->Exit(1);
2623  }
2624  } else
2625  hRate2 = hRate2orig;
2626 
2627  hRate2->SetTitle(Form("Depth %d \b", depth));
2628  hRate2->SetMarkerStyle(20);
2629  hRate2->SetMarkerSize(0.8);
2630  // hRate2->GetZaxis()->SetLabelSize(0.04);
2631  hRate2->SetXTitle(Form("<ErrorB>(ev.in LS & ch.) - HO depth%d - iLS \b", depth));
2632  hRate2->SetMarkerColor(2);
2633  hRate2->SetLineColor(0);
2634  hRate2->Draw("Error");
2635 
2636  if (LSofFirstErrB_HO == -1) {
2637  int nx = hRate2->GetXaxis()->GetNbins();
2638  for (int i = 1; i <= nx; i++) {
2639  double ccc1 = hRate2->GetBinContent(i);
2640  if (ccc1 > 0.) {
2641  cout << "****************>>>>>>>>>>> ErrB_HO bad LS start at iLS = " << i << " with rate = " << ccc1
2642  << endl;
2643  LSofFirstErrB_HO = i;
2644  break;
2645  }
2646  }
2647  }
2648 
2649  delete h1;
2650  delete h0;
2651  if (hRate2 != hRate2orig) {
2652  delete hRate2orig;
2653  hRate2orig = hRate2;
2654  }
2655  }
2656 
2657  cHB->Update();
2658  cHB->Print(Form("HistErrB_HO_%d.png", depth));
2659  cHB->Clear();
2660  if (h2Cefz6)
2661  delete h2Cefz6;
2662  if (hRate2orig)
2663  delete hRate2orig;
2664  }
2665  } // ErrorsB in HO
2666 
2667  //====================================================================== done by Andrius for HF:
2668  //====================================================================== done by Andrius for HF:
2669  //====================================================================== done by Andrius for HF:
2670  // Special test of errors type A and B in HF
2671 
2672  int flagErrAB_HF[2];
2673  flagErrAB_HF[0] = -1;
2674  flagErrAB_HF[1] = -1;
2675  double avedelta_HF = 0.;
2676  int lastLumiBin_HF = -1;
2677  int LSofFirstErrB_HF = -1;
2678  {
2679  const int specCountA = 4;
2680  const int specColors[specCountA] = {1, 2, 3, 4};
2681  const TString hnames[specCountA][2] = {{"h_sumADCAmplperLS6_P1", "h_sum0ADCAmplperLS6_P1"},
2682  {"h_sumADCAmplperLS6_P2", "h_sum0ADCAmplperLS6_P2"},
2683  {"h_sumADCAmplperLS6_M1", "h_sum0ADCAmplperLS6_M1"},
2684  {"h_sumADCAmplperLS6_M2", "h_sum0ADCAmplperLS6_M2"}};
2685 
2686  std::vector<TH1F *> hV;
2687  THStack *hs = new THStack("hs", "ADCAmplerLS6");
2688  cHB->Clear();
2689  // cHB->cd();
2690  cHB->Divide(2, 1);
2691  cHB->cd(1);
2692 
2694  for (int i = 0; i < specCountA; i++) {
2695  if (1)
2696  std::cout << "debugger: errA_HF : get histos for i=" << i << " " << hnames[i][0] << " and " << hnames[i][1]
2697  << "\n";
2698  TH1F *h1 = (TH1F *)hfile->Get(hnames[i][0]);
2699  TH1F *h0 = (TH1F *)hfile->Get(hnames[i][1]);
2700  if (!h1 || !h0) {
2701  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2702  ptext->AddText("Missing histo");
2703  if (!h1) {
2704  std::cout << "\tfailed to get " << hnames[i][0] << "\n";
2705  ptext->AddText(hnames[i][0]);
2706  }
2707  if (!h0) {
2708  std::cout << "\tfailed to get " << hnames[i][1] << "\n";
2709  ptext->AddText(hnames[i][1]);
2710  }
2711  ptext->Draw();
2712  continue;
2713  }
2714  TH1F *hERT1orig = (TH1F *)h1->Clone(Form("ERT1orig_%d", i));
2715  hERT1orig->Divide(h1, h0, 1, 1, "B");
2716 
2717  if ((lastLumiBin_HF < 0) && (i == 0)) {
2718  for (int ibin = hERT1orig->GetNbinsX(); ibin >= 1; ibin--) {
2719  if (hERT1orig->GetBinContent(ibin) == 0)
2720  lastLumiBin_HF = ibin;
2721  else
2722  break;
2723  }
2724  lastLumiBin_HF += 3; // show more bins
2725  if (lastLumiBin_HF >= hERT1orig->GetNbinsX())
2726  lastLumiBin_HF = -1;
2727  }
2728  TH1F *hERT1 = NULL;
2729  if (lastLumiBin_HF > 1) {
2730  if (!copyContents(&hERT1, Form("ERT1_%d", i), "", hERT1orig, lastLumiBin_HF)) {
2731  std::cout << "code failed" << std::endl;
2732  gSystem->Exit(1);
2733  }
2734  } else
2735  hERT1 = hERT1orig;
2736 
2737  hERT1->GetXaxis()->SetTitle("<ADCAmpl> per LS HF: black-P1, red-P2,green-M1,blue-M2");
2738  hV.push_back(hERT1);
2739  hERT1->SetMarkerStyle(20);
2740  hERT1->SetMarkerSize(0.4);
2741  hERT1->SetXTitle("<A>(ev.in LS & ch.) - HF P1 - iLS \b");
2742  hERT1->SetMarkerColor(specColors[i]);
2743  hERT1->SetLineColor(0);
2744  hs->Add(hERT1);
2745  delete h1;
2746  delete h0;
2747  if (hERT1 != hERT1orig)
2748  delete hERT1orig;
2749  }
2750  hs->Draw("LPE1 nostack");
2751  cHB->Update(); // activate the axes
2752  hs->GetXaxis()->SetTitle("<A> per LS: black-P1, red-P2,green-M1,blue-M2");
2753  hs->Draw("LPE1 nostack");
2754  gPad->SetGridy();
2756 
2757  // AZ corrections 04.02.2016
2758  cHB->cd(2);
2759  TH1F *diff = new TH1F("diff", "", 100, 0., 4.);
2760 
2761  if (int(hV.size()) == specCountA) {
2762  flagErrAB_HF[0] = 0; // If we have the expected number of histograms, set the flag
2763  double sumdelta = 0.;
2764  int nnndelta = 0;
2765  std::cout << "******** GetNbinsX = " << hV[0]->GetNbinsX() << std::endl;
2766  for (int ibin = 1; ibin <= hV[0]->GetNbinsX(); ibin++) {
2767  double delta = 0.;
2768  double maxdelta = 0.;
2769  for (unsigned int i = 0; i < hV.size(); i++) {
2770  const TH1F *hi = hV[i];
2771  for (unsigned int j = 1; j < hV.size(); j++) {
2772  const TH1F *hj = hV[j];
2773  delta = fabs(hi->GetBinContent(ibin) - hj->GetBinContent(ibin));
2774  if (delta > maxdelta)
2775  maxdelta = delta;
2776  } //for
2777  } //for
2778  // std::cout << "***** ibin = " << ibin << " nnndelta= " << nnndelta << " maxdelta= " << maxdelta <<std::endl;
2779  if (maxdelta > 0.) {
2780  diff->Fill(maxdelta);
2781  sumdelta += maxdelta;
2782  nnndelta++;
2783  }
2784  } //for ibin
2785  // avedelta_HF = sumdelta/hV[0]->GetNbinsX();
2786  avedelta_HF = sumdelta / nnndelta;
2787  // std::cout << "******************>>>>>> ErrA_HF: avedelta_HF = " << avedelta_HF << " Npoints for comparison= " << nnndelta <<std::endl;
2788  if (avedelta_HF > 2.4 || (avedelta_HF < 0.8 && avedelta_HF > 0.)) {
2789  flagErrAB_HF[0] = 1;
2790  } //if
2791  } //hV.size
2792  diff->SetMarkerStyle(20);
2793  diff->SetMarkerSize(0.8);
2794  diff->SetXTitle("max difference \b");
2795  diff->SetMarkerColor(2);
2796  diff->SetLineColor(0);
2797  gPad->SetGridx();
2798  gPad->SetLogy();
2799  diff->Draw("Error");
2801  cHB->Update();
2802  cHB->Print("HistErrA_HF.png");
2803  cHB->Clear();
2805  // clean-up
2806  if (diff)
2807  delete diff;
2808  for (unsigned int i = 0; i < hV.size(); i++)
2809  delete hV[i];
2810  } // ErrorA in HF
2813  { // errors type B
2814  const int specCountB = 4;
2815  const TString hnames[specCountB][2] = {{"h_2DsumErrorBLS6", "h_2D0sumErrorBLS6"},
2816  {"h_sumErrorBperLS6", "h_sum0ErrorBperLS6"},
2817  {"h_2DsumErrorBLS7", "h_2D0sumErrorBLS7"},
2818  {"h_sumErrorBperLS7", "h_sum0ErrorBperLS7"}};
2819 
2820  for (int depth = 1; depth <= 2; depth++) {
2821  cHB->Clear();
2822  cHB->Divide(2, 1);
2823  cHB->cd(1);
2824  TH1F *hRate2orig = NULL;
2825  TH2F *h2Cefz6 = NULL;
2826  TString hname1 = hnames[2 * depth - 2][0];
2827  TString hname0 = hnames[2 * depth - 2][1];
2828  TH2F *twod1 = (TH2F *)hfile->Get(hname1);
2829  TH2F *twod0 = (TH2F *)hfile->Get(hname0);
2830  if (1)
2831  std::cout << "debugger: errB_HF depth=" << depth << ". get 2D histos " << hname1 << " and " << hname0 << "\n";
2832  if (!twod1 || !twod0) {
2833  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2834  ptext->AddText("Missing histos");
2835  if (!twod1) {
2836  std::cout << "\tfailed to get " << hname1 << "\n";
2837  ptext->AddText(hname1);
2838  }
2839  if (!twod0) {
2840  std::cout << "\tfailed to get " << hname0 << "\n";
2841  ptext->AddText(hname0);
2842  }
2843  ptext->Draw();
2844  } else {
2845  h2Cefz6 = (TH2F *)twod1->Clone(Form("Cefz6_%d", depth));
2846  h2Cefz6->SetTitle(Form("HF Depth %d \b", depth));
2847  h2Cefz6->Divide(twod1, twod0, 1, 1, "B");
2848 
2849  gPad->SetGridy();
2850  gPad->SetGridx();
2851  gPad->SetLogz();
2852  h2Cefz6->SetTitle(Form("Depth %d \b", depth));
2853  h2Cefz6->SetMarkerStyle(20);
2854  h2Cefz6->SetMarkerSize(0.4);
2855  // h2Cefz6->GetZaxis()->SetLabelSize(0.04);
2856  h2Cefz6->SetXTitle("#eta \b");
2857  h2Cefz6->SetYTitle("#phi \b");
2858  h2Cefz6->SetZTitle(Form("<ErrorB> - HF Depth%d \b", depth));
2859  h2Cefz6->SetMarkerColor(2);
2860  h2Cefz6->SetLineColor(2);
2861  h2Cefz6->Draw("COLZ");
2862  delete twod1;
2863  delete twod0;
2864  } // histos ok
2865  cHB->cd(2);
2866  hname1 = hnames[2 * depth - 1][0];
2867  hname0 = hnames[2 * depth - 1][1];
2868  TH1F *h1 = (TH1F *)hfile->Get(hname1);
2869  TH1F *h0 = (TH1F *)hfile->Get(hname0);
2870  if (1)
2871  std::cout << "errB_HF depth=" << depth << ". get 2D histos " << hname1 << " and " << hname0 << "\n";
2872  if (!h1 || !h0) {
2873  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2874  ptext->AddText("Missing histo");
2875  if (!h1) {
2876  std::cout << "\tfailed to get " << hname1 << "\n";
2877  ptext->AddText(hname1);
2878  }
2879  if (!h0) {
2880  std::cout << "\tfailed to get " << hname0 << "\n";
2881  ptext->AddText(hname0);
2882  }
2883  ptext->Draw();
2884  } else {
2885  gPad->SetGridx();
2886  gPad->SetGridy();
2887  // gPad->SetLogy();
2888  hRate2orig = (TH1F *)h1->Clone(Form("Rate2orig_%d", depth));
2889  hRate2orig->Divide(h1, h0, 1, 1, "B");
2890 
2891  TH1F *hRate2 = NULL;
2892  if (lastLumiBin_HF > 1) {
2893  if (!copyContents(&hRate2, Form("Rate2_%d", depth), "", hRate2orig, lastLumiBin_HF)) {
2894  std::cout << "code failed" << std::endl;
2895  gSystem->Exit(1);
2896  }
2897  } else
2898  hRate2 = hRate2orig;
2899  hRate2->SetTitle(Form("Depth %d \b", depth));
2900  hRate2->SetMarkerStyle(20);
2901  hRate2->SetMarkerSize(0.8);
2902  // hRate2->GetZaxis()->SetLabelSize(0.04);
2903  hRate2->SetXTitle(Form("<ErrorB>(ev.in LS & ch.) - HF depth%d - iLS \b", depth));
2904  hRate2->SetMarkerColor(2);
2905  hRate2->SetLineColor(0);
2906  hRate2->Draw("Error");
2907  if (LSofFirstErrB_HF == -1) {
2908  int nx = hRate2->GetXaxis()->GetNbins();
2909  for (int i = 1; i <= nx; i++) {
2910  double ccc1 = hRate2->GetBinContent(i);
2911  if (ccc1 > 0.) {
2912  cout << "****************>>>>>>>>>>> ErrB_HF bad LS start at iLS = " << i << " with rate = " << ccc1
2913  << endl;
2914  LSofFirstErrB_HF = i;
2915  break;
2916  }
2917  }
2918  }
2919  delete h1;
2920  delete h0;
2921  if (hRate2 != hRate2orig) {
2922  delete hRate2orig;
2923  hRate2orig = hRate2;
2924  }
2925  }
2926  cHB->Update();
2927  cHB->Print(Form("HistErrB_HF_%d.png", depth));
2928  cHB->Clear();
2929  if (h2Cefz6)
2930  delete h2Cefz6;
2931  if (hRate2orig)
2932  delete hRate2orig;
2933  }
2934  } // ErrorsB in HF
2935 
2937 
2938  //=============================================================================== err A HB
2940  // For 2D and 1D plots with Amplitude. Produces ChkErrA_HBx.png
2941 
2942  for (int depth = 1; depth <= 2; depth++) {
2943  TH2F *h2Ceff = NULL;
2944  TH2F *h2Diffe = NULL;
2945  // TH1F* h1diffADCAmpl= NULL;
2946  TH2F *h3Ceff = NULL;
2947 
2948  cHE->Clear();
2949  cHE->Divide(3, 1);
2950 
2951  cHE->cd(1);
2952  // h_mapDepth1ADCAmpl_HB div h_mapDepth1_HB
2953  TString hname1 = Form("h_mapDepth%dADCAmpl_HB", depth);
2954  TString hname0 = Form("h_mapDepth%d_HB", depth);
2955  TH2F *twod1 = (TH2F *)hfile->Get(hname1);
2956  TH2F *twod0 = (TH2F *)hfile->Get(hname0);
2957  if (!twod1 || !twod0) {
2958  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
2959  ptext->AddText("Missing histo");
2960  std::cout << "specHB test: failed to load " << hname1 << " and/or " << hname0 << "\n";
2961  if (!twod1)
2962  ptext->AddText(hname1);
2963  if (!twod0)
2964  ptext->AddText(hname0);
2965  ptext->Draw();
2966  continue;
2967  } else {
2968  // To IDENTIFY: see color different bins in eta-phi space
2969  h2Ceff = (TH2F *)twod1->Clone(Form("Ceff_HB%d", depth));
2970  h2Ceff->SetTitle(Form("HB Depth %d. (No cut) \b", depth));
2971  h2Ceff->Divide(twod1, twod0, 1, 1, "B");
2972 
2973  gPad->SetGridy();
2974  gPad->SetGridx();
2975  gPad->SetLogz();
2976  h2Ceff->SetMarkerStyle(20);
2977  h2Ceff->SetMarkerSize(0.4);
2978  //h2Ceff->GetZaxis()->SetLabelSize(0.08);
2979  h2Ceff->SetXTitle("#eta \b");
2980  h2Ceff->SetYTitle("#phi \b");
2981  h2Ceff->SetZTitle("h_mapDepth1ADCAmpl_HB \b");
2982  h2Ceff->SetMarkerColor(2);
2983  h2Ceff->SetLineColor(2);
2984  h2Ceff->Draw("COLZ");
2985  }
2986 
2987  cHE->cd(2);
2989  if (h2Ceff) {
2990  // TO IDENTIFY: see red bins in eta-phi space
2991  h2Diffe = (TH2F *)h2Ceff->Clone(Form("Diffe_Depth%d_HB", depth));
2992  h2Diffe->SetTitle(Form("HB Depth %d. Cut avg(ADCAmpl) > 25 \b", depth));
2993  int nx = h2Ceff->GetXaxis()->GetNbins();
2994  int ny = h2Ceff->GetYaxis()->GetNbins();
2995  for (int i = 1; i <= nx; i++) {
2996  for (int j = 1; j <= ny; j++) {
2997  double ccc1 = h2Ceff->GetBinContent(i, j);
2998  h2Diffe->SetBinContent(i, j, 0.);
2999  if (ccc1 > 25.)
3000  h2Diffe->SetBinContent(i, j, ccc1);
3001  }
3002  }
3003  gPad->SetGridy();
3004  gPad->SetGridx();
3005  gPad->SetLogz();
3006  h2Diffe->SetMarkerStyle(20);
3007  h2Diffe->SetMarkerSize(0.4);
3008  //h2Diffe->GetZaxis()->SetLabelSize(0.08);
3009  h2Diffe->SetXTitle("#eta \b");
3010  h2Diffe->SetYTitle("#phi \b");
3011  h2Diffe->SetZTitle("<ADCAmpl> bigger 25.- HB Depth1 \b");
3012  h2Diffe->SetMarkerColor(2);
3013  h2Diffe->SetLineColor(2);
3014  h2Diffe->Draw("COLZ");
3015  }
3016 
3017  cHE->cd(3);
3018  TString hname3 = Form("h_mapDepth%dADCAmpl225Copy_HB", depth);
3019  TH2F *twod3 = (TH2F *)hfile->Get(hname3);
3020  if (!twod3 || !twod0) {
3021  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
3022  ptext->AddText("Missing histo");
3023  std::cout << "specHB test: failed to load " << hname3 << " and/or " << hname0 << "\n";
3024  if (!twod3)
3025  ptext->AddText(hname3);
3026  if (!twod0)
3027  ptext->AddText(hname0);
3028  ptext->Draw();
3029  continue;
3030  } else {
3031  // To IDENTIFY: see color different bins in eta-phi space
3032  h3Ceff = (TH2F *)twod3->Clone(Form("CeffA_HB%d", depth));
3033  h3Ceff->SetTitle(Form("HB Depth %d. \b", depth));
3034  h3Ceff->Divide(twod3, twod0, 1, 1, "B");
3035  gPad->SetGridy();
3036  gPad->SetGridx();
3037  gPad->SetLogz();
3038  h3Ceff->SetMarkerStyle(20);
3039  h3Ceff->SetMarkerSize(0.4);
3040  // h3Ceff->GetZaxis()->SetLabelSize(0.08);
3041  h3Ceff->SetXTitle("#eta \b");
3042  h3Ceff->SetYTitle("#phi \b");
3043  h3Ceff->SetZTitle("rate for channels of HB \b");
3044  h3Ceff->SetMarkerColor(2);
3045  h3Ceff->SetLineColor(2);
3046  h3Ceff->Draw("COLZ");
3047  }
3048 
3049  cHE->Update();
3050  cHE->Print(Form("ChkErrA_HB%d.png", depth));
3051  cHE->Clear();
3052 
3053  if (h2Ceff)
3054  delete h2Ceff;
3055  if (h2Diffe)
3056  delete h2Diffe;
3057  // if (h1diffADCAmpl) delete h1diffADCAmpl;
3058  // if (twod0) delete twod0;// do not delete - sometimes causes trouble later
3059  if (twod1)
3060  delete twod1;
3061  if (twod3)
3062  delete twod3;
3063  if (h3Ceff)
3064  delete h3Ceff;
3065  } // depth
3066 
3067  //=============================================================================== err A HE
3069  // For 2D and 1D plots with Amplitude. Produces ChkErrA_HEx.png
3070 
3071  for (int depth = 1; depth <= 3; depth++) {
3072  TH2F *h2Ceff = NULL;
3073  TH2F *h2Diffe = NULL;
3074  // TH1F* h1diffADCAmpl= NULL;
3075  TH2F *h3Ceff = NULL;
3076 
3077  cHE->Clear();
3078  cHE->Divide(3, 1);
3079 
3080  cHE->cd(1);
3081  // h_mapDepth1ADCAmpl_HE div h_mapDepth1_HE
3082  TString hname1 = Form("h_mapDepth%dADCAmpl_HE", depth);
3083  TString hname0 = Form("h_mapDepth%d_HE", depth);
3084  TH2F *twod1 = (TH2F *)hfile->Get(hname1);
3085  TH2F *twod0 = (TH2F *)hfile->Get(hname0);
3086  if (!twod1 || !twod0) {
3087  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
3088  ptext->AddText("Missing histo");
3089  std::cout << "specHE test: failed to load " << hname1 << " and/or " << hname0 << "\n";
3090  if (!twod1)
3091  ptext->AddText(hname1);
3092  if (!twod0)
3093  ptext->AddText(hname0);
3094  ptext->Draw();
3095  continue;
3096  } else {
3097  // To IDENTIFY: see color different bins in eta-phi space
3098  h2Ceff = (TH2F *)twod1->Clone(Form("Ceff_HE%d", depth));
3099  h2Ceff->SetTitle(Form("HE Depth %d. (No cut) \b", depth));
3100  h2Ceff->Divide(twod1, twod0, 1, 1, "B");
3101 
3102  gPad->SetGridy();
3103  gPad->SetGridx();
3104  gPad->SetLogz();
3105  h2Ceff->SetTitleOffset(0.75, "Z");
3106  h2Ceff->SetMarkerStyle(20);
3107  h2Ceff->SetMarkerSize(0.4);
3108  //h2Ceff->GetZaxis()->SetLabelSize(0.08);
3109  h2Ceff->SetXTitle("#eta \b");
3110  h2Ceff->SetYTitle("#phi \b");
3111  h2Ceff->SetZTitle("h_mapDepth1ADCAmpl_HE \b");
3112  h2Ceff->SetMarkerColor(2);
3113  h2Ceff->SetLineColor(2);
3114  h2Ceff->Draw("COLZ");
3115  }
3116 
3117  cHE->cd(2);
3119  if (h2Ceff) {
3120  // TO IDENTIFY: see red bins in eta-phi space
3121  h2Diffe = (TH2F *)h2Ceff->Clone(Form("Diffe_Depth%d_HE", depth));
3122  h2Diffe->SetTitle(Form("HE Depth %d. Cut avg(ADCAmpl) > 1000 fC \b", depth));
3123  int nx = h2Ceff->GetXaxis()->GetNbins();
3124  int ny = h2Ceff->GetYaxis()->GetNbins();
3125  for (int i = 1; i <= nx; i++) {
3126  for (int j = 1; j <= ny; j++) {
3127  double ccc1 = h2Ceff->GetBinContent(i, j);
3128  h2Diffe->SetBinContent(i, j, 0.);
3129  if (ccc1 > 1000.)
3130  h2Diffe->SetBinContent(i, j, ccc1);
3131  }
3132  }
3133  gPad->SetGridy();
3134  gPad->SetGridx();
3135  gPad->SetLogz();
3136  h2Diffe->SetMarkerStyle(20);
3137  h2Diffe->SetMarkerSize(0.4);
3138  //h2Diffe->GetZaxis()->SetLabelSize(0.08);
3139  h2Diffe->SetXTitle("#eta \b");
3140  h2Diffe->SetYTitle("#phi \b");
3141  h2Diffe->SetZTitle("<ADCAmpl> bigger 1000.fC - HE Depth1 \b");
3142  h2Diffe->SetMarkerColor(2);
3143  h2Diffe->SetLineColor(2);
3144  h2Diffe->Draw("COLZ");
3145  }
3146 
3147  cHE->cd(3);
3148  TString hname3 = Form("h_mapDepth%dADCAmpl225Copy_HE", depth);
3149  TH2F *twod3 = (TH2F *)hfile->Get(hname3);
3150  if (!twod3 || !twod0) {
3151  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
3152  ptext->AddText("Missing histo");
3153  std::cout << "specHE test: failed to load " << hname3 << " and/or " << hname0 << "\n";
3154  if (!twod3)
3155  ptext->AddText(hname3);
3156  if (!twod0)
3157  ptext->AddText(hname0);
3158  ptext->Draw();
3159  continue;
3160  } else {
3161  // To IDENTIFY: see color different bins in eta-phi space
3162  h3Ceff = (TH2F *)twod3->Clone(Form("CeffA_HE%d", depth));
3163  h3Ceff->SetTitle(Form("HE Depth %d. \b", depth));
3164  h3Ceff->Divide(twod3, twod0, 1, 1, "B");
3165  gPad->SetGridy();
3166  gPad->SetGridx();
3167  gPad->SetLogz();
3168  h3Ceff->SetMarkerStyle(20);
3169  h3Ceff->SetMarkerSize(0.4);
3170  // h3Ceff->GetZaxis()->SetLabelSize(0.08);
3171  h3Ceff->SetXTitle("#eta \b");
3172  h3Ceff->SetYTitle("#phi \b");
3173  h3Ceff->SetZTitle("rate for channels of HE \b");
3174  h3Ceff->SetMarkerColor(2);
3175  h3Ceff->SetLineColor(2);
3176  h3Ceff->Draw("COLZ");
3177  }
3178 
3179  cHE->Update();
3180  cHE->Print(Form("ChkErrA_HE%d.png", depth));
3181  cHE->Clear();
3182 
3183  if (h2Ceff)
3184  delete h2Ceff;
3185  if (h2Diffe)
3186  delete h2Diffe;
3187  // if (h1diffADCAmpl) delete h1diffADCAmpl;
3188  // if (twod0) delete twod0;// do not delete - sometimes causes trouble later
3189  if (twod1)
3190  delete twod1;
3191  if (twod3)
3192  delete twod3;
3193  if (h3Ceff)
3194  delete h3Ceff;
3195  } // depth
3196 
3197  //=============================================================================== err A HO
3199  // For 2D and 1D plots with Amplitude. Produces ChkErrA_HOx.png
3200 
3201  for (int depth = 4; depth <= 4; depth++) {
3202  TH2F *h2Ceff = NULL;
3203  TH2F *h2Diffe = NULL;
3204  // TH1F* h1diffADCAmpl= NULL;
3205  TH2F *h3Ceff = NULL;
3206 
3207  cHE->Clear();
3208  cHE->Divide(3, 1);
3209 
3210  cHE->cd(1);
3211  // h_mapDepth1ADCAmpl_HO div h_mapDepth1_HO
3212  TString hname1 = Form("h_mapDepth%dADCAmpl_HO", depth);
3213  TString hname0 = Form("h_mapDepth%d_HO", depth);
3214  TH2F *twod1 = (TH2F *)hfile->Get(hname1);
3215  TH2F *twod0 = (TH2F *)hfile->Get(hname0);
3216  if (!twod1 || !twod0) {
3217  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
3218  ptext->AddText("Missing histo");
3219  std::cout << "specHO test: failed to load " << hname1 << " and/or " << hname0 << "\n";
3220  if (!twod1)
3221  ptext->AddText(hname1);
3222  if (!twod0)
3223  ptext->AddText(hname0);
3224  ptext->Draw();
3225  continue;
3226  } else {
3227  // To IDENTIFY: see color different bins in eta-phi space
3228  h2Ceff = (TH2F *)twod1->Clone(Form("Ceff_HO%d", depth));
3229  h2Ceff->SetTitle(Form("HO Depth %d. (No cut) \b", depth));
3230  h2Ceff->Divide(twod1, twod0, 1, 1, "B");
3231 
3232  gPad->SetGridy();
3233  gPad->SetGridx();
3234  gPad->SetLogz();
3235  h2Ceff->SetMarkerStyle(20);
3236  h2Ceff->SetMarkerSize(0.4);
3237  //h2Ceff->GetZaxis()->SetLabelSize(0.08);
3238  h2Ceff->SetXTitle("#eta \b");
3239  h2Ceff->SetYTitle("#phi \b");
3240  h2Ceff->SetZTitle("h_mapDepth1ADCAmpl_HO \b");
3241  h2Ceff->SetMarkerColor(2);
3242  h2Ceff->SetLineColor(2);
3243  h2Ceff->Draw("COLZ");
3244  }
3245 
3246  cHE->cd(2);
3248  if (h2Ceff) {
3249  // TO IDENTIFY: see red bins in eta-phi space (applied cut on Aij: <20 || >3000
3250  h2Diffe = (TH2F *)h2Ceff->Clone(Form("Diffe_Depth%d_HO", depth));
3251  h2Diffe->SetTitle(Form("HO Depth %d. Cut avg(ADCAmpl) > 80 \b", depth));
3252  int nx = h2Ceff->GetXaxis()->GetNbins();
3253  int ny = h2Ceff->GetYaxis()->GetNbins();
3254  for (int i = 1; i <= nx; i++) {
3255  for (int j = 1; j <= ny; j++) {
3256  double ccc1 = h2Ceff->GetBinContent(i, j);
3257  h2Diffe->SetBinContent(i, j, 0.);
3258  if (ccc1 > 20.)
3259  h2Diffe->SetBinContent(i, j, ccc1);
3260  }
3261  }
3262  gPad->SetGridy();
3263  gPad->SetGridx();
3264  gPad->SetLogz();
3265  h2Diffe->SetMarkerStyle(20);
3266  h2Diffe->SetMarkerSize(0.4);
3267  //h2Diffe->GetZaxis()->SetLabelSize(0.08);
3268  h2Diffe->SetXTitle("#eta \b");
3269  h2Diffe->SetYTitle("#phi \b");
3270  h2Diffe->SetZTitle("<ADCAmpl> bigger 80.- HO Depth1 \b");
3271  h2Diffe->SetMarkerColor(2);
3272  h2Diffe->SetLineColor(2);
3273  h2Diffe->Draw("COLZ");
3274  }
3275 
3276  cHE->cd(3);
3277  TString hname3 = Form("h_mapDepth%dADCAmpl225Copy_HO", depth);
3278  TH2F *twod3 = (TH2F *)hfile->Get(hname3);
3279  if (!twod3 || !twod0) {
3280  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
3281  ptext->AddText("Missing histo");
3282  std::cout << "specHO test: failed to load " << hname3 << " and/or " << hname0 << "\n";
3283  if (!twod3)
3284  ptext->AddText(hname3);
3285  if (!twod0)
3286  ptext->AddText(hname0);
3287  ptext->Draw();
3288  continue;
3289  } else {
3290  // To IDENTIFY: see color different bins in eta-phi space
3291  h3Ceff = (TH2F *)twod3->Clone(Form("CeffA_HO%d", depth));
3292  h3Ceff->SetTitle(Form("HO Depth %d. \b", depth));
3293  h3Ceff->Divide(twod3, twod0, 1, 1, "B");
3294  gPad->SetGridy();
3295  gPad->SetGridx();
3296  gPad->SetLogz();
3297  h3Ceff->SetMarkerStyle(20);
3298  h3Ceff->SetMarkerSize(0.4);
3299  // h3Ceff->GetZaxis()->SetLabelSize(0.08);
3300  h3Ceff->SetXTitle("#eta \b");
3301  h3Ceff->SetYTitle("#phi \b");
3302  h3Ceff->SetZTitle("rate for channels of HO \b");
3303  h3Ceff->SetMarkerColor(2);
3304  h3Ceff->SetLineColor(2);
3305  h3Ceff->Draw("COLZ");
3306  }
3307 
3308  cHE->Update();
3309  cHE->Print(Form("ChkErrA_HO%d.png", depth));
3310  cHE->Clear();
3311 
3312  if (h2Ceff)
3313  delete h2Ceff;
3314  if (h2Diffe)
3315  delete h2Diffe;
3316  // if (h1diffADCAmpl) delete h1diffADCAmpl;
3317  // if (twod0) delete twod0;// do not delete - sometimes causes trouble later
3318  if (twod1)
3319  delete twod1;
3320  if (twod3)
3321  delete twod3;
3322  if (h3Ceff)
3323  delete h3Ceff;
3324  } // depth
3325 
3326  //=============================================================================== err A HF
3328  // For 2D and 1D plots with Amplitude. Produces ChkErrA_HFx.png
3329 
3330  for (int depth = 1; depth <= 2; depth++) {
3331  TH2F *h2Ceff = NULL;
3332  TH2F *h2Diffe = NULL;
3333  // TH1F* h1diffADCAmpl= NULL;
3334  TH2F *h3Ceff = NULL;
3335 
3336  cHE->Clear();
3337  cHE->Divide(3, 1);
3338 
3339  cHE->cd(1);
3340  // h_mapDepth1ADCAmpl_HF div h_mapDepth1_HF
3341  TString hname1 = Form("h_mapDepth%dADCAmpl_HF", depth);
3342  TString hname0 = Form("h_mapDepth%d_HF", depth);
3343  TH2F *twod1 = (TH2F *)hfile->Get(hname1);
3344  TH2F *twod0 = (TH2F *)hfile->Get(hname0);
3345  if (!twod1 || !twod0) {
3346  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
3347  ptext->AddText("Missing histo");
3348  std::cout << "specHF test: failed to load " << hname1 << " and/or " << hname0 << "\n";
3349  if (!twod1)
3350  ptext->AddText(hname1);
3351  if (!twod0)
3352  ptext->AddText(hname0);
3353  ptext->Draw();
3354  continue;
3355  } else {
3356  // To IDENTIFY: see color different bins in eta-phi space
3357  h2Ceff = (TH2F *)twod1->Clone(Form("Ceff_HF%d", depth));
3358  h2Ceff->SetTitle(Form("HF Depth %d. (No cut) \b", depth));
3359  h2Ceff->Divide(twod1, twod0, 1, 1, "B");
3360 
3361  gPad->SetGridy();
3362  gPad->SetGridx();
3363  gPad->SetLogz();
3364  h2Ceff->SetMarkerStyle(20);
3365  h2Ceff->SetMarkerSize(0.4);
3366  //h2Ceff->GetZaxis()->SetLabelSize(0.08);
3367  h2Ceff->SetXTitle("#eta \b");
3368  h2Ceff->SetYTitle("#phi \b");
3369  h2Ceff->SetZTitle("h_mapDepth1ADCAmpl_HF \b");
3370  h2Ceff->SetMarkerColor(2);
3371  h2Ceff->SetLineColor(2);
3372  h2Ceff->Draw("COLZ");
3373  }
3374 
3375  cHE->cd(2);
3377  if (h2Ceff) {
3378  // TO IDENTIFY: see red bins in eta-phi space (applied cut on Aij: <20 || >3000
3379  h2Diffe = (TH2F *)h2Ceff->Clone(Form("Diffe_Depth%d_HF", depth));
3380  h2Diffe->SetTitle(Form("HF Depth %d. Cut avg(ADCAmpl) > 20 \b", depth));
3381  int nx = h2Ceff->GetXaxis()->GetNbins();
3382  int ny = h2Ceff->GetYaxis()->GetNbins();
3383  for (int i = 1; i <= nx; i++) {
3384  for (int j = 1; j <= ny; j++) {
3385  double ccc1 = h2Ceff->GetBinContent(i, j);
3386  h2Diffe->SetBinContent(i, j, 0.);
3387  if (ccc1 > 20.)
3388  h2Diffe->SetBinContent(i, j, ccc1);
3389  }
3390  }
3391  gPad->SetGridy();
3392  gPad->SetGridx();
3393  gPad->SetLogz();
3394  h2Diffe->SetMarkerStyle(20);
3395  h2Diffe->SetMarkerSize(0.4);
3396  //h2Diffe->GetZaxis()->SetLabelSize(0.08);
3397  h2Diffe->SetXTitle("#eta \b");
3398  h2Diffe->SetYTitle("#phi \b");
3399  h2Diffe->SetZTitle("<ADCAmpl> bigger 20.- HF Depth1 \b");
3400  h2Diffe->SetMarkerColor(2);
3401  h2Diffe->SetLineColor(2);
3402  h2Diffe->Draw("COLZ");
3403  }
3404 
3405  cHE->cd(3);
3406  /*
3407  if (h2Ceff) {
3408  h1diffADCAmpl = new TH1F(Form("diffADCAmpl_Depth%d_HF",depth),"",
3409  100, -20.,200.);
3410  h1diffADCAmpl->SetTitle(Form("HF Depth %d \b",depth));
3411  int nx = h2Ceff->GetXaxis()->GetNbins();
3412  int ny = h2Ceff->GetYaxis()->GetNbins();
3413  for (int i=1;i<=nx;i++) {
3414  for (int j=1;j<=ny;j++) {
3415  if(h2Ceff->GetBinContent(i,j) !=0 ) {
3416  double ccc1 = h2Ceff->GetBinContent(i,j) ;
3417  h1diffADCAmpl->Fill(ccc1);
3418  }
3419  }
3420  }
3421  gPad->SetLogy();
3422  h1diffADCAmpl->SetMarkerStyle(20);
3423  h1diffADCAmpl->SetMarkerSize(0.4);
3424  h1diffADCAmpl->GetYaxis()->SetLabelSize(0.04);
3425  h1diffADCAmpl->SetXTitle("<ADCAmpl> in each cell \b");
3426  h1diffADCAmpl->SetMarkerColor(2);
3427  h1diffADCAmpl->SetLineColor(2);
3428  h1diffADCAmpl->Draw("");
3429  }
3430  */
3431  TString hname3 = Form("h_mapDepth%dADCAmpl225Copy_HF", depth);
3432  TH2F *twod3 = (TH2F *)hfile->Get(hname3);
3433  if (!twod3 || !twod0) {
3434  TPaveText *ptext = new TPaveText(0.05, 0.85, 0.95, 0.95);
3435  ptext->AddText("Missing histo");
3436  std::cout << "specHF test: failed to load " << hname3 << " and/or " << hname0 << "\n";
3437  if (!twod3)
3438  ptext->AddText(hname3);
3439  if (!twod0)
3440  ptext->AddText(hname0);
3441  ptext->Draw();
3442  continue;
3443  } else {
3444  // To IDENTIFY: see color different bins in eta-phi space
3445  h3Ceff = (TH2F *)twod3->Clone(Form("CeffA_HF%d", depth));
3446  h3Ceff->SetTitle(Form("HF Depth %d. \b", depth));
3447  h3Ceff->Divide(twod3, twod0, 1, 1, "B");
3448  gPad->SetGridy();
3449  gPad->SetGridx();
3450  gPad->SetLogz();
3451  h3Ceff->SetMarkerStyle(20);
3452  h3Ceff->SetMarkerSize(0.4);
3453  // h3Ceff->GetZaxis()->SetLabelSize(0.08);
3454  h3Ceff->SetXTitle("#eta \b");
3455  h3Ceff->SetYTitle("#phi \b");
3456  h3Ceff->SetZTitle("rate for channels of HF \b");
3457  h3Ceff->SetMarkerColor(2);
3458  h3Ceff->SetLineColor(2);
3459  h3Ceff->Draw("COLZ");
3460  }
3461 
3462  cHE->Update();
3463  cHE->Print(Form("ChkErrA_HF%d.png", depth));
3464  cHE->Clear();
3465 
3466  if (h2Ceff)
3467  delete h2Ceff;
3468  if (h2Diffe)
3469  delete h2Diffe;
3470  // if (h1diffADCAmpl) delete h1diffADCAmpl;
3471  // if (twod0) delete twod0;// do not delete - sometimes causes trouble later
3472  if (twod1)
3473  delete twod1;
3474  if (twod3)
3475  delete twod3;
3476  if (h3Ceff)
3477  delete h3Ceff;
3478  } // depth
3479 
3480  std::cout << "************>>> average Amplitudes done" << std::endl;
3481 
3482  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
3483  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
3484  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
3485  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
3486  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
3487 
3492 
3493  cout << " RBX analysis START for **************************" << endl;
3494  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
3495  // int njeta = 22; int njphi = 18; int lsmax=2600;
3496  int njeta = 22;
3497  int njphi = 18;
3498  int lsmax = 1800;
3499  cout << ">>>>>>>>>>>>>>>>>>>>>>>> int njeta = 22; int njphi = 18; int lsmax=1800; "
3500  << endl;
3501 
3502  double alexall[njeta][njphi][lsmax];
3503 
3504  // for phi tables(!):
3505  double alexhb[njphi][lsmax];
3506  double alexhe[njphi][lsmax];
3507  double alexho[njphi][lsmax];
3508  double alexhf[njphi][lsmax];
3509 
3510  // for eta tables(!):
3511  double blexhb[njeta][lsmax];
3512  double blexhe[njeta][lsmax];
3513  double blexho[njeta][lsmax];
3514  double blexhf[njeta][lsmax];
3515 
3516  cout << ">>>>>>>>>>>>>>>>>>>>>>>> alexall [njeta][njphi][lsmax]; " << endl;
3517  int maxbinsRBX = MaxLum;
3518  int nx = maxbinsRBX; // # LS
3519  cout << ">>>>>>>>>>>>>>>>>>>>>>>> maxbinsRBX = MaxLum; " << endl;
3520  if (MaxLum > lsmax)
3521  cout << "*********************************** ERROR ERROR ERROR ERROR: MaxLum > 1800 " << endl;
3522  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
3523 
3524  for (int i = 0; i < nx; i++) {
3525  for (int jphi = 0; jphi < njphi; jphi++) {
3526  alexhb[jphi][i] = 0.;
3527  alexhe[jphi][i] = 0.;
3528  alexho[jphi][i] = 0.;
3529  alexhf[jphi][i] = 0.;
3530 
3531  for (int jeta = 0; jeta < njeta; jeta++) {
3532  if (jphi == 0) {
3533  blexhb[jeta][i] = 0.;
3534  blexhe[jeta][i] = 0.;
3535  blexho[jeta][i] = 0.;
3536  blexhf[jeta][i] = 0.;
3537  }
3538 
3539  alexall[jeta][jphi][i] = 0.;
3540  }
3541  }
3542  }
3543 
3545  /*
3546  // j = ietaphi = 1- 396
3547  int ietaphimax = 396;
3548  int ny = ietaphimax + 1 ;
3549  for (int j=1;j<ny;j++) {
3550  int jeta = (j-1)/znphi;
3551  int jphi = (j-1)-znphi*jeta+1;// jphi=1-18
3552  jeta += 1;// jeta = 1-22 }
3553 // Outout is jeta = 1-22 jphi=1-18
3554 HB: j = 7,8,9,10 11,12,13,14
3555 HE: j = 3,4,5, 6, 7 14,15,16,17,18
3556 HO: j = 7,8,9,10 11,12,13,14
3557 HF: j = 0,1,2, 3 18,19,20,21
3558 */
3559 
3561  //======================================================================
3562  //======================================================================
3563  //======================================================================
3564  cout << " RBX general for HB **************************" << endl;
3565  TH2F *Ghb1KKK = (TH2F *)hfile->Get("h_2DsumADCAmplEtaPhiLs0");
3566  TH2F *Ghb1LLL = (TH2F *)hfile->Get("h_2DsumADCAmplEtaPhiLs00");
3567  TH2F *Ghb1 = (TH2F *)Ghb1LLL->Clone("Ghb1");
3568  Ghb1->Divide(Ghb1KKK, Ghb1LLL, 1, 1, "B"); // average A
3569  // Ghb1->Sumw2();
3570  // int nx = Ghb1->GetXaxis()->GetNbins(); // # LS
3571  int ny = Ghb1->GetYaxis()->GetNbins(); // # jetaphi indexes = 396 = 18*22
3572  // cout<<"***************************************** HB 54 ny= "<< ny <<endl;
3573  for (int j = 1; j <= ny; j++) {
3574  int jeta = (j - 1) / njphi; // jeta = 0-21
3575  if (jeta > 6 && jeta < 15) {
3576  int jphi = (j - 1) - njphi * jeta; // jphi=0-17
3577  // cout<<"HB 54 jeta= "<< jeta <<" jphi = "<<jphi <<endl;
3578  // over LS:
3579  for (int i = 1; i <= nx; i++) {
3580  double ccc1 = Ghb1->GetBinContent(i, j);
3581  alexall[jeta][jphi][i - 1] = ccc1;
3582  // if( i == 1 ) cout<<"HB 54 for LS=1 ccc1= "<< ccc1 <<endl;
3583  // if( ccc1 <= 0 ) cout<<"HB 54 ccc1= "<< ccc1 <<" iLS= "<< i <<" eta= "<< jeta <<" phi= "<< jphi <<endl;
3584  // cout<<"HB 54 ccc1= "<< ccc1 <<" j= "<< j <<" iLS= "<< i <<" eta= "<< jeta <<" phi= "<< jphi <<endl;
3585  } //i
3586  } //if
3587  } //j
3588  // clean-up
3589  if (Ghb1KKK)
3590  delete Ghb1KKK;
3591  if (Ghb1LLL)
3592  delete Ghb1LLL;
3593  // if (Ghb1) delete Ghb1;
3594 
3595  //====================================================================== alexhb[k][i]
3596  for (int jphi = 0; jphi < njphi; jphi++) {
3597  for (int i = 0; i < nx; i++) {
3598  double sumccc1 = 0.;
3599  int isum = 0;
3600  for (int jeta = 0; jeta < njeta; jeta++) {
3601  double ccc1 = alexall[jeta][jphi][i];
3602  if (ccc1 > 0.) {
3603  sumccc1 += ccc1;
3604  isum++;
3605  }
3606  } // for jeta
3607  if (isum > 0.)
3608  sumccc1 /= isum;
3609  alexhb[jphi][i] = sumccc1;
3610  }
3611  } //for for
3612 
3613  //====================================================================== blexhb[k][i]
3614  for (int keta = 0; keta < njeta; keta++) {
3615  for (int i = 0; i < nx; i++) {
3616  double sumccc1 = 0.;
3617  int isum = 0;
3618  for (int kphi = 0; kphi < njphi; kphi++) {
3619  double ccc1 = alexall[keta][kphi][i];
3620  if (ccc1 > 0.) {
3621  sumccc1 += ccc1;
3622  isum++;
3623  }
3624  } // for kphi
3625  if (isum > 0.)
3626  sumccc1 /= isum;
3627  blexhb[keta][i] = sumccc1;
3628  }
3629  } //for for
3630 
3632  //========================================================================================== 11 HB:: 2D jeta = 0 - 21 jphi =0 - 17
3633  //======================================================================
3634  //======================================================================
3635  //======================================================================
3636  //======================================================================
3637  cout << " RBX HB 2D plot *****" << endl;
3638  cRBX1->Clear();
3640  cRBX1->Divide(1, 1);
3641  cRBX1->cd(1);
3642  // int ietaphi = 0; ietaphi = ((k2+1)-1)*nphi + (k3+1) ; k2=0-neta-1; k3=0-nphi-1; neta=18; nphi=22;
3643  // TH2F* Ghb42D = new TH2F("Ghb42D","", 22, -11., 11., 18, 0., 18. );
3644  // TH2F* Ghb42D0 = new TH2F("Ghb42D0","", 22, -11., 11., 18, 0., 18. );
3645  TH2F *Ghb42D = new TH2F("Ghb42D", "", 23, -11.5, 11.5, 18, 0., 18.);
3646  TH2F *Ghb42D0 = new TH2F("Ghb42D0", "", 23, -11.5, 11.5, 18, 0., 18.);
3647  TH2F *Ghb42DF = (TH2F *)Ghb42D0->Clone("Ghb42DF");
3648  for (int jphi = 0; jphi < njphi; jphi++) {
3649  for (int jeta = 0; jeta < njeta; jeta++) {
3650  for (int i = 0; i < nx; i++) {
3651  double ccc1 = alexall[jeta][jphi][i];
3652  int neweta = jeta - 11 - 0.5;
3653  if (jeta >= 11)
3654  neweta = jeta - 11 + 1.5;
3655  if (ccc1 > 0.) {
3656  Ghb42D->Fill(neweta, jphi, ccc1);
3657  Ghb42D0->Fill(neweta, jphi, 1.);
3658  }
3659  // if(ccc1>0.) {Ghb42D ->Fill(jeta-11,jphi,ccc1); Ghb42D0 ->Fill(jeta-11,jphi,1.); }
3660  }
3661  }
3662  }
3663  Ghb42DF->Divide(Ghb42D, Ghb42D0, 1, 1, "B"); // average A
3664  // Ghb1->Sumw2();
3665  gPad->SetGridy();
3666  gPad->SetGridx(); // gPad->SetLogz();
3667  Ghb42DF->SetMarkerStyle(20);
3668  Ghb42DF->SetMarkerSize(0.4);
3669  Ghb42DF->GetZaxis()->SetLabelSize(0.04);
3670  Ghb42DF->SetXTitle("<A>_RBX #eta \b");
3671  Ghb42DF->SetYTitle(" #phi \b");
3672  Ghb42DF->SetZTitle("<A>_RBX - All \b");
3673  Ghb42DF->SetMarkerColor(2);
3674  Ghb42DF->SetLineColor(2); // Ghb42DF->SetMaximum(1.000); // Ghb42DF->SetMinimum(1.0);
3675  Ghb42DF->Draw("COLZ");
3676 
3678  cRBX1->Update();
3679  cRBX1->Print("RBX-HB-2Dplot.png");
3680  cRBX1->Clear();
3681  // clean-up
3682  if (Ghb42D)
3683  delete Ghb42D;
3684  if (Ghb42D0)
3685  delete Ghb42D0;
3686  if (Ghb42DF)
3687  delete Ghb42DF;
3688 
3689  //========================================================================================== 61 HB:: 1D j = 7,8,9,10 ; 11,12,13,14 jphi =0 - 17
3690  //======================================================================
3691  //======================================================================
3692  //======================================================================
3693  //======================================================================
3694  cout << " RBX HB 1D plot *****" << endl;
3695  cRBX1->Clear();
3697  cRBX1->Divide(1, 1);
3698  cRBX1->cd(1);
3699  TH1F *GphiHB1D = new TH1F("GphiHB1D", "", 18, 0., 18.);
3700  TH1F *GphiHB1D0 = new TH1F("GphiHB1D0", "", 18, 0., 18.);
3701  TH1F *GphiHB1DF = (TH1F *)GphiHB1D0->Clone("GphiHB1DF");
3702  for (int jphi = 0; jphi < 18; jphi++) {
3703  for (int jeta = 0; jeta < 22; jeta++) {
3704  for (int i = 0; i < nx; i++) {
3705  double ccc1 = alexall[jeta][jphi][i];
3706  if (ccc1 > 0.) {
3707  GphiHB1D->Fill(jphi, ccc1);
3708  GphiHB1D0->Fill(jphi, 1.);
3709  }
3710  }
3711  }
3712  }
3713  // GphiHB1D->Sumw2();GphiHB1D0->Sumw2();
3714  GphiHB1DF->Divide(GphiHB1D, GphiHB1D0, 1, 1, "B"); // average A
3715  // GphiHB1DF->Sumw2();
3716  for (int jphi = 1; jphi < 19; jphi++) {
3717  GphiHB1DF->SetBinError(jphi, 0.01);
3718  }
3719  gPad->SetGridy();
3720  gPad->SetGridx(); // gPad->SetLogz();
3721  GphiHB1DF->SetMarkerStyle(20);
3722  GphiHB1DF->SetMarkerSize(1.4);
3723  GphiHB1DF->GetZaxis()->SetLabelSize(0.08);
3724  GphiHB1DF->SetXTitle("PHI of RBX\b");
3725  GphiHB1DF->SetYTitle(" <Amplitude> \b");
3726  GphiHB1DF->SetZTitle("<A>_PHI - All \b");
3727  GphiHB1DF->SetMarkerColor(4);
3728  GphiHB1DF->SetLineColor(4);
3729  GphiHB1DF->SetMinimum(0.8); // GphiHB1DF->SetMaximum(1.000);
3730  GphiHB1DF->Draw("Error");
3732  cRBX1->Update();
3733  cRBX1->Print("RBX-HB-1Dplot.png");
3734  cRBX1->Clear();
3735  // clean-up
3736  if (GphiHB1D)
3737  delete GphiHB1D;
3738  if (GphiHB1D0)
3739  delete GphiHB1D0;
3740  if (GphiHB1DF)
3741  delete GphiHB1DF;
3742 
3743  //========================================================================================== 62 HB:: 1D j = 7,8,9,10 ; 11,12,13,14 jphi =0 - 17
3744  //======================================================================
3745  //======================================================================
3746  //======================================================================
3747  //======================================================================
3748  cout << " RBX HB 11D plot *eta*" << endl;
3749  cRBX1->Clear();
3751  cRBX1->Divide(1, 1);
3752  cRBX1->cd(1);
3753  TH1F *GetaHB11D = new TH1F("GetaHB11D", "", 23, -11.5, 11.5);
3754  TH1F *GetaHB11D0 = new TH1F("GetaHB11D0", "", 23, -11.5, 11.5);
3755  TH1F *GetaHB11DF = (TH1F *)GetaHB11D0->Clone("GetaHB11DF");
3756 
3757  for (int jeta = 0; jeta < 22; jeta++) {
3758  for (int jphi = 0; jphi < 18; jphi++) {
3759  for (int i = 0; i < nx; i++) {
3760  double ccc1 = alexall[jeta][jphi][i];
3761  int neweta = jeta - 11 - 0.5;
3762  if (jeta >= 11)
3763  neweta = jeta - 11 + 1.5;
3764  if (ccc1 > 0.) {
3765  GetaHB11D->Fill(neweta, ccc1);
3766  GetaHB11D0->Fill(neweta, 1.);
3767  // if( i == 0 ) cout<<"62 HB: ibin= "<< i <<" jphi= "<< jphi <<" jeta= "<< jeta <<" A= "<< ccc1 <<endl;
3768  }
3769  }
3770  }
3771  }
3772  // GetaHB11D->Sumw2();GetaHB11D0->Sumw2();
3773  GetaHB11DF->Divide(GetaHB11D, GetaHB11D0, 1, 1, "B"); // average A
3774  // GetaHB11DF->Sumw2();
3775  for (int jeta = 1; jeta < 24; jeta++) {
3776  GetaHB11DF->SetBinError(jeta, 0.01);
3777  }
3778  gPad->SetGridy();
3779  gPad->SetGridx(); // gPad->SetLogz();
3780  GetaHB11DF->SetMarkerStyle(20);
3781  GetaHB11DF->SetMarkerSize(1.4);
3782  GetaHB11DF->GetZaxis()->SetLabelSize(0.08);
3783  GetaHB11DF->SetXTitle("#eta \b");
3784  GetaHB11DF->SetYTitle(" <A> \b");
3785  GetaHB11DF->SetZTitle("<A>_ETA - All \b");
3786  GetaHB11DF->SetMarkerColor(4);
3787  GetaHB11DF->SetLineColor(4);
3788  GetaHB11DF->SetMinimum(0.8); // GetaHB11DF->SetMaximum(1.000);
3789  GetaHB11DF->Draw("Error");
3790 
3792  cRBX1->Update();
3793  cRBX1->Print("RBX-HB-11Dplot.png");
3794  cRBX1->Clear();
3795  // clean-up
3796  if (GetaHB11D)
3797  delete GetaHB11D;
3798  if (GetaHB11D0)
3799  delete GetaHB11D0;
3800  if (GetaHB11DF)
3801  delete GetaHB11DF;
3802 
3803  //========================================================================================== 22 HB:: Ratio plots jeta = 0 - 21 jphi =0 - 17
3804  //======================================================================
3805  //======================================================================22.11.2018
3806  //======================================================================
3807  //======================================================================
3808 
3809  gStyle->SetOptStat(1110000);
3810  cout << " RBX HB Ratio plots *****" << endl;
3811  cRBX31->Clear();
3813  // gain stabilitY:
3814  // Rij = Aij / A1j , where i-over LSs, j-channels
3815  //
3816  // nx = maxbinsRBX; // # LS
3817  //
3818  double ccc0HB = 0.;
3819  cRBX31->Divide(3, 1);
3820  //================
3821  cRBX31->cd(1);
3822  // TH1F* Ghb5 = new TH1F("Ghb5","", nx, 1., nx+1.);
3823  TH1F *Ghb51 = new TH1F("Ghb51", "", nx, 1., nx + 1.);
3824  TH1F *Ghb50 = new TH1F("Ghb50", "", nx, 1., nx + 1.);
3825  TH1F *Ghb5 = (TH1F *)Ghb50->Clone("Ghb5");
3826  // j - etaphi index:
3827  for (int j = 1; j <= ny; j++) {
3828  ccc0HB = Ghb1->GetBinContent(1, j);
3829  // 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;} }
3830  if (ccc0HB <= 0.)
3831  for (int i = 1; i <= nx; i++) {
3832  double ccc2 = Ghb1->GetBinContent(i, j);
3833  if (ccc2 > 0.) {
3834  ccc0HB = ccc2;
3835  break;
3836  }
3837  }
3838  if (ccc0HB > 0.) {
3839  // i - # LSs:
3840  for (int i = 1; i <= nx; i++) {
3841  double ccc1 = Ghb1->GetBinContent(i, j);
3842  if (ccc1 > 0.) {
3843  double Rij = ccc1 / ccc0HB;
3844  // Ghb5 ->Fill( float(i), Rij);
3845  Ghb51->Fill(float(i), Rij);
3846  Ghb50->Fill(float(i), 1.);
3847  }
3848  }
3849  }
3850  }
3851  Ghb5->Divide(Ghb51, Ghb50, 1, 1, "B"); // average A
3852  for (int i = 1; i <= nx; i++) {
3853  Ghb5->SetBinError(i, 0.0001);
3854  }
3855  Ghb5->SetMarkerStyle(20);
3856  Ghb5->SetMarkerSize(0.4);
3857  Ghb5->GetYaxis()->SetLabelSize(0.04);
3858  Ghb5->SetMarkerColor(2);
3859  Ghb5->SetLineColor(0);
3860  Ghb5->SetXTitle(" iLS \b");
3861  Ghb5->SetYTitle(" <R> \b");
3862  Ghb5->SetTitle("<Ri> vs iLS \b");
3863  Ghb5->SetMinimum(0.); //Ghb5->SetMaximum(2.5);
3864  // gPad->SetLogy();
3865  gPad->SetGridy();
3866  gPad->SetGridx();
3867  Ghb5->SetStats(0);
3868  Ghb5->GetYaxis()->SetLabelSize(0.025);
3869  Ghb5->Draw("Error");
3870  //================
3871  cRBX31->cd(2);
3872  TH2F *Ghb60 = new TH2F("Ghb60", "", 22, -11., 11., 18, 0., 18.);
3873  TH2F *Ghb61 = new TH2F("Ghb61", "", 22, -11., 11., 18, 0., 18.);
3874  TH2F *Ghb6 = new TH2F("Ghb6", "", 22, -11., 11., 18, 0., 18.);
3875 
3876  TH2F *G20hb60 = new TH2F("G20hb60", "", 22, -11., 11., 18, 0., 18.);
3877  TH2F *G20hb61 = new TH2F("G20hb61", "", 22, -11., 11., 18, 0., 18.);
3878  TH2F *G20hb6 = new TH2F("G20hb6", "", 22, -11., 11., 18, 0., 18.);
3879  TH2F *G30hb60 = new TH2F("G30hb60", "", 22, -11., 11., 18, 0., 18.);
3880  TH2F *G30hb61 = new TH2F("G30hb61", "", 22, -11., 11., 18, 0., 18.);
3881  TH2F *G30hb6 = new TH2F("G30hb6", "", 22, -11., 11., 18, 0., 18.);
3882  TH2F *G40hb60 = new TH2F("G40hb60", "", 22, -11., 11., 18, 0., 18.);
3883  TH2F *G40hb61 = new TH2F("G40hb61", "", 22, -11., 11., 18, 0., 18.);
3884  TH2F *G40hb6 = new TH2F("G40hb6", "", 22, -11., 11., 18, 0., 18.);
3885  // j - etaphi index; i - # LSs;
3886  //
3887  // define mean and RMS:
3888  double sumjHB = 0.;
3889  int njHB = 0;
3890  double meanjHB = 0.;
3891  for (int j = 1; j <= ny; j++) {
3892  ccc0HB = Ghb1->GetBinContent(1, j);
3893  if (ccc0HB <= 0.)
3894  for (int i = 1; i <= nx; i++) {
3895  double ccc2 = Ghb1->GetBinContent(i, j);
3896  if (ccc2 > 0.) {
3897  ccc0HB = ccc2;
3898  break;
3899  }
3900  }
3901  if (ccc0HB > 0.) {
3902  for (int i = 1; i <= nx; i++) {
3903  double ccc1 = Ghb1->GetBinContent(i, j) / ccc0HB;
3904  if (ccc1 > 0.) {
3905  sumjHB += ccc1;
3906  njHB++;
3907  }
3908  }
3909  meanjHB = sumjHB / njHB;
3910  }
3911  } // j
3912 
3913  double ssumjHB = 0.;
3914  njHB = 0;
3915  double sigmajHB = 0.;
3916  for (int j = 1; j <= ny; j++) {
3917  ccc0HB = Ghb1->GetBinContent(1, j);
3918  if (ccc0HB <= 0.)
3919  for (int i = 1; i <= nx; i++) {
3920  double ccc2 = Ghb1->GetBinContent(i, j);
3921  if (ccc2 > 0.) {
3922  ccc0HB = ccc2;
3923  break;
3924  }
3925  }
3926  if (ccc0HB > 0.) {
3927  for (int i = 1; i <= nx; i++) {
3928  double ccc1 = Ghb1->GetBinContent(i, j) / ccc0HB;
3929  if (ccc1 > 0.) {
3930  ssumjHB += (ccc1 - meanjHB) * (ccc1 - meanjHB);
3931  njHB++;
3932  }
3933  }
3934  sigmajHB = sqrt(ssumjHB / njHB);
3935  }
3936  } // j
3937 
3938  double dif3rmsHBMIN = meanjHB - 3 * sigmajHB;
3939  if (dif3rmsHBMIN < 0.)
3940  dif3rmsHBMIN = 0.;
3941  double dif3rmsHBMAX = meanjHB + 3 * sigmajHB;
3942  cout << "22HB-2 meanjHB= " << meanjHB << " sigmajHB= " << sigmajHB << " dif3rmsHBMIN= " << dif3rmsHBMIN
3943  << " dif3rmsHBMAX= " << dif3rmsHBMAX << endl;
3944 
3945  double MAXdif3rmsHBMIN = dif3rmsHBMIN;
3946  double MINdif3rmsHBMAX = dif3rmsHBMAX;
3947  if (MAXdif3rmsHBMIN < 0.95)
3948  MAXdif3rmsHBMIN = 0.95;
3949  if (MINdif3rmsHBMAX > 1.05)
3950  MINdif3rmsHBMAX = 1.05;
3951  cout << "22HB-2 MAXdif3rmsHBMIN= " << MAXdif3rmsHBMIN << " MINdif3rmsHBMAX= " << MINdif3rmsHBMAX << endl;
3952  //
3953  for (int j = 1; j <= ny; j++) {
3954  ccc0HB = Ghb1->GetBinContent(1, j);
3955  if (ccc0HB <= 0.)
3956  for (int i = 1; i <= nx; i++) {
3957  double ccc2 = Ghb1->GetBinContent(i, j);
3958  if (ccc2 > 0.) {
3959  ccc0HB = ccc2;
3960  break;
3961  }
3962  }
3963  if (ccc0HB > 0.) {
3964  int jeta = (j - 1) / 18; // jeta = 0-21
3965  int jphi = (j - 1) - 18 * jeta; // jphi=0-17
3966  // i - # LSs:
3967  for (int i = 1; i <= nx; i++) {
3968  double ccc1 = Ghb1->GetBinContent(i, j);
3969  if (ccc1 > 0.) {
3970  double Rij = ccc1 / ccc0HB;
3971  if (Rij < MAXdif3rmsHBMIN || Rij > MINdif3rmsHBMAX) {
3972  Ghb61->Fill(jeta - 11, jphi, Rij);
3973  Ghb60->Fill(jeta - 11, jphi, 1.);
3974  }
3975  if (Rij < 0.8 || Rij > 1.2) {
3976  G20hb61->Fill(jeta - 11, jphi, Rij);
3977  G20hb60->Fill(jeta - 11, jphi, 1.);
3978  }
3979  if (Rij < 0.7 || Rij > 1.3) {
3980  G30hb61->Fill(jeta - 11, jphi, Rij);
3981  G30hb60->Fill(jeta - 11, jphi, 1.);
3982  }
3983  if (Rij < 0.6 || Rij > 1.4) {
3984  G40hb61->Fill(jeta - 11, jphi, Rij);
3985  G40hb60->Fill(jeta - 11, jphi, 1.);
3986  }
3987  } //if(ccc1>0.
3988  } // i
3989  } //if(ccc0HB>0
3990  } // j
3991  Ghb6->Divide(Ghb61, Ghb60, 1, 1, "B"); // average R
3992  G20hb6->Divide(G20hb61, G20hb60, 1, 1, "B"); // average R
3993  G30hb6->Divide(G30hb61, G30hb60, 1, 1, "B"); // average R
3994  G40hb6->Divide(G40hb61, G40hb60, 1, 1, "B"); // average R
3995 
3996  Ghb6->GetZaxis()->SetLabelSize(0.025);
3997  Ghb6->SetXTitle(" #eta \b");
3998  Ghb6->SetYTitle(" #phi \b");
3999  Ghb6->SetTitle("<Rj> for |1-<R>| > 0.05 \b");
4000  Ghb6->SetStats(0);
4001  Ghb6->Draw("COLZ");
4002  //================
4003  cRBX31->cd(3);
4004  TH1F *Ghb7 = new TH1F("Ghb7", "", 120, 0.4, 1.6);
4005  // j - etaphi index:
4006  for (int j = 1; j <= ny; j++) {
4007  ccc0HB = Ghb1->GetBinContent(1, j);
4008  if (ccc0HB <= 0.)
4009  for (int i = 1; i <= nx; i++) {
4010  double ccc2 = Ghb1->GetBinContent(i, j);
4011  if (ccc2 > 0.) {
4012  ccc0HB = ccc2;
4013  break;
4014  }
4015  }
4016  if (ccc0HB > 0.) {
4017  // i - # LSs:
4018  for (int i = 1; i <= nx; i++) {
4019  double ccc1 = Ghb1->GetBinContent(i, j);
4020  if (ccc1 > 0.) {
4021  double Rij = ccc1 / ccc0HB;
4022  Ghb7->Fill(Rij);
4023  }
4024  }
4025  }
4026  }
4027  Ghb7->SetMarkerStyle(20);
4028  Ghb7->SetMarkerSize(0.4);
4029  Ghb7->GetYaxis()->SetLabelSize(0.04);
4030  Ghb7->SetMarkerColor(2);
4031  Ghb7->SetLineColor(0);
4032  Ghb7->SetYTitle(" N \b");
4033  Ghb7->SetXTitle(" Rij \b");
4034  Ghb7->SetTitle(" Rij \b");
4035  //Ghb7->SetMinimum(0.8);Ghb7->SetMaximum(500.);
4036  gPad->SetGridy();
4037  gPad->SetGridx(); // gPad->SetLogy();
4038  // Ghb7->SetStats(1110000);
4039  Ghb7->GetYaxis()->SetLabelSize(0.025);
4040  Ghb7->Draw("Error");
4041  Float_t ymaxHB = Ghb7->GetMaximum();
4042  cout << "22HB-3 ymaxHB= " << ymaxHB << " MAXdif3rmsHBMIN= " << MAXdif3rmsHBMIN
4043  << " MINdif3rmsHBMAX= " << MINdif3rmsHBMAX << endl;
4044  TLine *lineHB = new TLine(MAXdif3rmsHBMIN, 0., MAXdif3rmsHBMIN, ymaxHB);
4045  lineHB->SetLineColor(kBlue);
4046  lineHB->Draw();
4047  TLine *line1HB = new TLine(MINdif3rmsHBMAX, 0., MINdif3rmsHBMAX, ymaxHB);
4048  line1HB->SetLineColor(kBlue);
4049  line1HB->Draw();
4050  //================
4052  cRBX31->Update();
4053  cRBX31->Print("RBX-HB-3plots.png");
4054  cRBX31->Clear();
4055  // clean-up
4056  if (Ghb5)
4057  delete Ghb5;
4058  if (Ghb60)
4059  delete Ghb60;
4060  if (Ghb61)
4061  delete Ghb61;
4062  if (Ghb6)
4063  delete Ghb6;
4064  if (Ghb7)
4065  delete Ghb7;
4066 
4067  if (G20hb60)
4068  delete G20hb60;
4069  if (G20hb61)
4070  delete G20hb61;
4071  if (G30hb60)
4072  delete G30hb60;
4073  if (G30hb61)
4074  delete G30hb61;
4075  if (G40hb60)
4076  delete G40hb60;
4077  if (G40hb61)
4078  delete G40hb61;
4079 
4080  if (Ghb1)
4081  delete Ghb1;
4082  //========================================================================================== 22-1 HB:: Ratio plots jeta = 0 - 21 jphi =0 - 17
4083  //======================================================================
4084  //======================================================================28.11.2018
4085  //======================================================================
4086  //======================================================================
4087 
4088  gStyle->SetOptStat(1110000);
4089  cout << " RBX HB Ratio plotsmore *****" << endl;
4090  cRBX31->Clear();
4092  cRBX31->Divide(3, 1);
4093  //================
4094  cRBX31->cd(1);
4095  G20hb6->GetZaxis()->SetLabelSize(0.025);
4096  G20hb6->SetXTitle(" #eta \b");
4097  G20hb6->SetYTitle(" #phi \b");
4098  G20hb6->SetTitle("<Rj> for |1-<R>| > 0.20 \b");
4099  G20hb6->SetStats(0);
4100  G20hb6->Draw("COLZ");
4101  //================
4102  cRBX31->cd(2);
4103  G30hb6->GetZaxis()->SetLabelSize(0.025);
4104  G30hb6->SetXTitle(" #eta \b");
4105  G30hb6->SetYTitle(" #phi \b");
4106  G30hb6->SetTitle("<Rj> for |1-<R>| > 0.30 \b");
4107  G30hb6->SetStats(0);
4108  G30hb6->Draw("COLZ");
4109  //================
4110  cRBX31->cd(3);
4111  G40hb6->GetZaxis()->SetLabelSize(0.025);
4112  G40hb6->SetXTitle(" #eta \b");
4113  G40hb6->SetYTitle(" #phi \b");
4114  G40hb6->SetTitle("<Rj> for |1-<R>| > 0.40 \b");
4115  G40hb6->SetStats(0);
4116  G40hb6->Draw("COLZ");
4117  //================
4118 
4120  cRBX31->Update();
4121  cRBX31->Print("RBX-HB-3plotsmore.png");
4122  cRBX31->Clear();
4123 
4124  // clean-up
4125  if (G20hb6)
4126  delete G20hb6;
4127  if (G30hb6)
4128  delete G30hb6;
4129  if (G40hb6)
4130  delete G40hb6;
4131  gStyle->SetOptStat(0);
4132 
4134 
4135  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
4136  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
4137  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
4138  for (int jphi = 0; jphi < njphi; jphi++) {
4139  for (int jeta = 0; jeta < njeta; jeta++) {
4140  for (int i = 0; i < nx; i++) {
4141  alexall[jeta][jphi][i] = 0.;
4142  }
4143  }
4144  } // nulling
4145 
4147 
4149  //======================================================================
4150  //======================================================================
4151  //======================================================================
4152  cout << " RBX general for HE **************************" << endl;
4153  TH2F *Ghe1KKK = (TH2F *)hfile->Get("h_2DsumADCAmplEtaPhiLs1");
4154  TH2F *Ghe1LLL = (TH2F *)hfile->Get("h_2DsumADCAmplEtaPhiLs10");
4155  TH2F *Ghe1 = (TH2F *)Ghe1LLL->Clone("Ghe1");
4156  Ghe1->Divide(Ghe1KKK, Ghe1LLL, 1, 1, "B"); // average A
4157  // Ghe1->Sumw2();
4158  // int nx = Ghe1->GetXaxis()->GetNbins(); // # LS
4159  // nx = maxbinsRBX; // # LS
4160  ny = Ghe1->GetYaxis()->GetNbins(); // # jetaphi indexes
4161  for (int j = 1; j <= ny; j++) {
4162  int jeta = (j - 1) / njphi; // jeta = 0-21
4163  if ((jeta < 8 && jeta > 2) || (jeta < 19 && jeta > 13)) {
4164  int jphi = (j - 1) - njphi * jeta; // jphi=0-17
4165  // cout<<"HE 54 jeta= "<< jeta <<" jphi = "<<jphi <<endl;
4166  // over LS:
4167  for (int i = 1; i <= nx; i++) {
4168  double ccc1 = Ghe1->GetBinContent(i, j);
4169  alexall[jeta][jphi][i - 1] = ccc1;
4170  // if( i == 1 ) cout<<"HE 54 for LS=1 ccc1= "<< ccc1 <<endl;
4171  } //i
4172  } //if
4173  } //j
4174  // clean-up
4175  if (Ghe1KKK)
4176  delete Ghe1KKK;
4177  if (Ghe1LLL)
4178  delete Ghe1LLL;
4179  // if (Ghe1) delete Ghe1;
4180 
4181  //====================================================================== alexhe[k][i]
4182  for (int jphi = 0; jphi < njphi; jphi++) {
4183  for (int i = 0; i < nx; i++) {
4184  double sumccc1 = 0.;
4185  int isum = 0;
4186  for (int jeta = 0; jeta < njeta; jeta++) {
4187  double ccc1 = alexall[jeta][jphi][i];
4188  if (ccc1 > 0.) {
4189  sumccc1 += ccc1;
4190  isum++;
4191  }
4192  } // for jeta
4193  if (isum > 0.)
4194  sumccc1 /= isum;
4195  alexhe[jphi][i] = sumccc1;
4196  }
4197  } //for for
4198  //====================================================================== blexhe[k][i]
4199  for (int keta = 0; keta < njeta; keta++) {
4200  for (int i = 0; i < nx; i++) {
4201  double sumccc1 = 0.;
4202  int isum = 0;
4203  for (int kphi = 0; kphi < njphi; kphi++) {
4204  double ccc1 = alexall[keta][kphi][i];
4205  if (ccc1 > 0.) {
4206  sumccc1 += ccc1;
4207  isum++;
4208  }
4209  } // for kphi
4210  if (isum > 0.)
4211  sumccc1 /= isum;
4212  blexhe[keta][i] = sumccc1;
4213  }
4214  } //for for
4216  //========================================================================================== 21 HE:: 2D jeta = 0 - 21 jphi =0 - 17
4217  //======================================================================
4218  //======================================================================
4219  //======================================================================
4220  //======================================================================
4221  cout << " RBX HE 2D plot *****" << endl;
4222  cRBX1->Clear();
4224  cRBX1->Divide(1, 1);
4225  cRBX1->cd(1);
4226  // int ietaphi = 0; ietaphi = ((k2+1)-1)*nphi + (k3+1) ; k2=0-neta-1; k3=0-nphi-1; neta=18; nphi=22;
4227  TH2F *Ghe42D = new TH2F("Ghe42D", "", 23, -11.5, 11.5, 18, 0., 18.);
4228  TH2F *Ghe42D0 = new TH2F("Ghe42D0", "", 23, -11.5, 11.5, 18, 0., 18.);
4229  // TH2F* Ghe42D = new TH2F("Ghe42D","", 22, -11., 11., 18, 0., 18. );
4230  // TH2F* Ghe42D0 = new TH2F("Ghe42D0","", 22, -11., 11., 18, 0., 18. );
4231  TH2F *Ghe42DF = (TH2F *)Ghe42D0->Clone("Ghe42DF");
4232  for (int jphi = 0; jphi < njphi; jphi++) {
4233  for (int jeta = 0; jeta < njeta; jeta++) {
4234  for (int i = 0; i < nx; i++) {
4235  double ccc1 = alexall[jeta][jphi][i];
4236  int neweta = jeta - 11 - 0.5;
4237  if (jeta >= 11)
4238  neweta = jeta - 11 + 1.5;
4239  if (ccc1 > 0.) {
4240  Ghe42D->Fill(neweta, jphi, ccc1);
4241  Ghe42D0->Fill(neweta, jphi, 1.);
4242  }
4243  // if(ccc1>0.) {Ghe42D ->Fill(jeta-11,jphi,ccc1); Ghe42D0 ->Fill(jeta-11,jphi,1.); }
4244  }
4245  }
4246  }
4247  Ghe42DF->Divide(Ghe42D, Ghe42D0, 1, 1, "B"); // average A
4248  // Ghe1->Sumw2();
4249  gPad->SetGridy();
4250  gPad->SetGridx(); // gPad->SetLogz();
4251  Ghe42DF->SetMarkerStyle(20);
4252  Ghe42DF->SetMarkerSize(0.4);
4253  Ghe42DF->GetZaxis()->SetLabelSize(0.04);
4254  Ghe42DF->SetXTitle("<A>_RBX #eta \b");
4255  Ghe42DF->SetYTitle(" #phi \b");
4256  Ghe42DF->SetZTitle("<A>_RBX - All \b");
4257  Ghe42DF->SetMarkerColor(2);
4258  Ghe42DF->SetLineColor(2); // Ghe42DF->SetMaximum(1.000); // Ghe42DF->SetMinimum(1.0);
4259  Ghe42DF->Draw("COLZ");
4260 
4262  cRBX1->Update();
4263  cRBX1->Print("RBX-HE-2Dplot.png");
4264  cRBX1->Clear();
4265  // clean-up
4266  if (Ghe42D)
4267  delete Ghe42D;
4268  if (Ghe42D0)
4269  delete Ghe42D0;
4270  if (Ghe42DF)
4271  delete Ghe42DF;
4272 
4273  //========================================================================================== 61 HE:: 1D j = 3,4,5, 6, 7 14,15,16,17,18 jphi =0 - 17
4274  //======================================================================
4275  //======================================================================
4276  //======================================================================
4277  //======================================================================
4278  cout << " RBX HE 1D plot *****" << endl;
4279  cRBX1->Clear();
4281  cRBX1->Divide(1, 1);
4282  cRBX1->cd(1);
4283  TH1F *GphiHE1D = new TH1F("GphiHE1D", "", 18, 0., 18.);
4284  TH1F *GphiHE1D0 = new TH1F("GphiHE1D0", "", 18, 0., 18.);
4285  TH1F *GphiHE1DF = (TH1F *)GphiHE1D0->Clone("GphiHE1DF");
4286  for (int jphi = 0; jphi < 18; jphi++) {
4287  for (int jeta = 0; jeta < 22; jeta++) {
4288  for (int i = 0; i < nx; i++) {
4289  double ccc1 = alexall[jeta][jphi][i];
4290  if (ccc1 > 0.) {
4291  GphiHE1D->Fill(jphi, ccc1);
4292  GphiHE1D0->Fill(jphi, 1.);
4293  }
4294  }
4295  }
4296  }
4297  // GphiHE1D->Sumw2();GphiHE1D0->Sumw2();
4298  GphiHE1DF->Divide(GphiHE1D, GphiHE1D0, 1, 1, "B"); // average A
4299  // GphiHE1DF->Sumw2();
4300  for (int jphi = 1; jphi < 19; jphi++) {
4301  GphiHE1DF->SetBinError(jphi, 0.01);
4302  }
4303  gPad->SetGridy();
4304  gPad->SetGridx(); // gPad->SetLogz();
4305  GphiHE1DF->SetMarkerStyle(20);
4306  GphiHE1DF->SetMarkerSize(1.4);
4307  GphiHE1DF->GetZaxis()->SetLabelSize(0.08);
4308  GphiHE1DF->SetXTitle("PHI of RBX\b");
4309  GphiHE1DF->SetYTitle(" <Amplitude> \b");
4310  GphiHE1DF->SetZTitle("<A>_PHI - All \b");
4311  GphiHE1DF->SetMarkerColor(4);
4312  GphiHE1DF->SetLineColor(4);
4313  GphiHE1DF->SetMinimum(0.8); // GphiHE1DF->SetMaximum(1.000);
4314  GphiHE1DF->Draw("Error");
4316  cRBX1->Update();
4317  cRBX1->Print("RBX-HE-1Dplot.png");
4318  cRBX1->Clear();
4319  // clean-up
4320  if (GphiHE1D)
4321  delete GphiHE1D;
4322  if (GphiHE1D0)
4323  delete GphiHE1D0;
4324  if (GphiHE1DF)
4325  delete GphiHE1DF;
4326 
4327  //========================================================================================== 62 HE:: 1D j = 3,4,5, 6, 7 14,15,16,17,18 jphi =0 - 17
4328  //======================================================================
4329  //======================================================================
4330  //======================================================================
4331  //======================================================================
4332  cout << " RBX HE 11D plot *eta*" << endl;
4333  cRBX1->Clear();
4335  cRBX1->Divide(1, 1);
4336  cRBX1->cd(1);
4337  TH1F *GetaHE11D = new TH1F("GetaHE11D", "", 23, -11.5, 11.5);
4338  TH1F *GetaHE11D0 = new TH1F("GetaHE11D0", "", 23, -11.5, 11.5);
4339  TH1F *GetaHE11DF = (TH1F *)GetaHE11D0->Clone("GetaHE11DF");
4340 
4341  for (int jeta = 0; jeta < 22; jeta++) {
4342  for (int jphi = 0; jphi < 18; jphi++) {
4343  for (int i = 0; i < nx; i++) {
4344  double ccc1 = alexall[jeta][jphi][i];
4345  int neweta = jeta - 11 - 0.5;
4346  if (jeta >= 11)
4347  neweta = jeta - 11 + 1.5;
4348  if (ccc1 > 0.) {
4349  GetaHE11D->Fill(neweta, ccc1);
4350  GetaHE11D0->Fill(neweta, 1.);
4351  // if( i == 0 ) cout<<"62 HE: ibin= "<< i <<" jphi= "<< jphi <<" jeta= "<< jeta <<" A= "<< ccc1 <<endl;
4352  }
4353  }
4354  }
4355  }
4356  // GetaHE11D->Sumw2();GetaHE11D0->Sumw2();
4357  GetaHE11DF->Divide(GetaHE11D, GetaHE11D0, 1, 1, "B"); // average A
4358  // GetaHE11DF->Sumw2();
4359  for (int jeta = 1; jeta < 24; jeta++) {
4360  GetaHE11DF->SetBinError(jeta, 0.01);
4361  }
4362  gPad->SetGridy();
4363  gPad->SetGridx(); // gPad->SetLogz();
4364  GetaHE11DF->SetMarkerStyle(20);
4365  GetaHE11DF->SetMarkerSize(1.4);
4366  GetaHE11DF->GetZaxis()->SetLabelSize(0.08);
4367  GetaHE11DF->SetXTitle("#eta \b");
4368  GetaHE11DF->SetYTitle(" <A> \b");
4369  GetaHE11DF->SetZTitle("<A>_ETA - All \b");
4370  GetaHE11DF->SetMarkerColor(4);
4371  GetaHE11DF->SetLineColor(4);
4372  GetaHE11DF->SetMinimum(0.8); // GetaHE11DF->SetMaximum(1.000);
4373  GetaHE11DF->Draw("Error");
4374 
4376  cRBX1->Update();
4377  cRBX1->Print("RBX-HE-11Dplot.png");
4378  cRBX1->Clear();
4379  // clean-up
4380  if (GetaHE11D)
4381  delete GetaHE11D;
4382  if (GetaHE11D0)
4383  delete GetaHE11D0;
4384  if (GetaHE11DF)
4385  delete GetaHE11DF;
4386 
4387  //========================================================================================== 22 HE:: Ratio plots jeta = 0 - 21 jphi =0 - 17
4388  //======================================================================
4389  //======================================================================22.11.2018
4390  //======================================================================
4391  //======================================================================
4392 
4393  gStyle->SetOptStat(1110000);
4394  cout << " RBX HE Ratio plots *****" << endl;
4395  cRBX31->Clear();
4397  // gain stabilitY:
4398  // Rij = Aij / A1j , where i-over LSs, j-channels
4399  //
4400  // nx = maxbinsRBX; // # LS
4401  //
4402  double ccc0HE = 0.;
4403  cRBX31->Divide(3, 1);
4404  //================
4405  cRBX31->cd(1);
4406  // TH1F* Ghe5 = new TH1F("Ghe5","", nx, 1., nx+1.);
4407  TH1F *Ghe51 = new TH1F("Ghe51", "", nx, 1., nx + 1.);
4408  TH1F *Ghe50 = new TH1F("Ghe50", "", nx, 1., nx + 1.);
4409  TH1F *Ghe5 = (TH1F *)Ghe50->Clone("Ghe5");
4410  // j - etaphi index:
4411  for (int j = 1; j <= ny; j++) {
4412  ccc0HE = Ghe1->GetBinContent(1, j);
4413  // 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;} }
4414  if (ccc0HE <= 0.)
4415  for (int i = 1; i <= nx; i++) {
4416  double ccc2 = Ghe1->GetBinContent(i, j);
4417  if (ccc2 > 0.) {
4418  ccc0HE = ccc2;
4419  break;
4420  }
4421  }
4422  if (ccc0HE > 0.) {
4423  // i - # LSs:
4424  for (int i = 1; i <= nx; i++) {
4425  double ccc1 = Ghe1->GetBinContent(i, j);
4426  if (ccc1 > 0.) {
4427  double Rij = ccc1 / ccc0HE;
4428  // Ghe5 ->Fill( float(i), Rij);
4429  Ghe51->Fill(float(i), Rij);
4430  Ghe50->Fill(float(i), 1.);
4431  }
4432  }
4433  }
4434  }
4435  Ghe5->Divide(Ghe51, Ghe50, 1, 1, "B"); // average A
4436  for (int i = 1; i <= nx; i++) {
4437  Ghe5->SetBinError(i, 0.0001);
4438  }
4439  Ghe5->SetMarkerStyle(20);
4440  Ghe5->SetMarkerSize(0.4);
4441  Ghe5->GetYaxis()->SetLabelSize(0.04);
4442  Ghe5->SetMarkerColor(2);
4443  Ghe5->SetLineColor(0);
4444  Ghe5->SetXTitle(" iLS \b");
4445  Ghe5->SetYTitle(" <R> \b");
4446  Ghe5->SetTitle("<Ri> vs iLS \b");
4447  Ghe5->SetMinimum(0.); //Ghe5->SetMaximum(2.5);
4448  // gPad->SetLogy();
4449  gPad->SetGridy();
4450  gPad->SetGridx();
4451  Ghe5->SetStats(0);
4452  Ghe5->GetYaxis()->SetLabelSize(0.025);
4453  Ghe5->Draw("Error");
4454  //================
4455  cRBX31->cd(2);
4456  TH2F *Ghe60 = new TH2F("Ghe60", "", 22, -11., 11., 18, 0., 18.);
4457  TH2F *Ghe61 = new TH2F("Ghe61", "", 22, -11., 11., 18, 0., 18.);
4458  TH2F *Ghe6 = new TH2F("Ghe6", "", 22, -11., 11., 18, 0., 18.);
4459 
4460  TH2F *G20he60 = new TH2F("G20he60", "", 22, -11., 11., 18, 0., 18.);
4461  TH2F *G20he61 = new TH2F("G20he61", "", 22, -11., 11., 18, 0., 18.);
4462  TH2F *G20he6 = new TH2F("G20he6", "", 22, -11., 11., 18, 0., 18.);
4463  TH2F *G30he60 = new TH2F("G30he60", "", 22, -11., 11., 18, 0., 18.);
4464  TH2F *G30he61 = new TH2F("G30he61", "", 22, -11., 11., 18, 0., 18.);
4465  TH2F *G30he6 = new TH2F("G30he6", "", 22, -11., 11., 18, 0., 18.);
4466  TH2F *G40he60 = new TH2F("G40he60", "", 22, -11., 11., 18, 0., 18.);
4467  TH2F *G40he61 = new TH2F("G40he61", "", 22, -11., 11., 18, 0., 18.);
4468  TH2F *G40he6 = new TH2F("G40he6", "", 22, -11., 11., 18, 0., 18.);
4469  // j - etaphi index; i - # LSs;
4470  //
4471  // define mean and RMS:
4472  double sumjHE = 0.;
4473  int njHE = 0;
4474  double meanjHE = 0.;
4475  for (int j = 1; j <= ny; j++) {
4476  ccc0HE = Ghe1->GetBinContent(1, j);
4477  if (ccc0HE <= 0.)
4478  for (int i = 1; i <= nx; i++) {
4479  double ccc2 = Ghe1->GetBinContent(i, j);
4480  if (ccc2 > 0.) {
4481  ccc0HE = ccc2;
4482  break;
4483  }
4484  }
4485  if (ccc0HE > 0.) {
4486  for (int i = 1; i <= nx; i++) {
4487  double ccc1 = Ghe1->GetBinContent(i, j) / ccc0HE;
4488  if (ccc1 > 0.) {
4489  sumjHE += ccc1;
4490  njHE++;
4491  }
4492  }
4493  meanjHE = sumjHE / njHE;
4494  }
4495  } // j
4496 
4497  double ssumjHE = 0.;
4498  njHE = 0;
4499  double sigmajHE = 0.;
4500  for (int j = 1; j <= ny; j++) {
4501  ccc0HE = Ghe1->GetBinContent(1, j);
4502  if (ccc0HE <= 0.)
4503  for (int i = 1; i <= nx; i++) {
4504  double ccc2 = Ghe1->GetBinContent(i, j);
4505  if (ccc2 > 0.) {
4506  ccc0HE = ccc2;
4507  break;
4508  }
4509  }
4510  if (ccc0HE > 0.) {
4511  for (int i = 1; i <= nx; i++) {
4512  double ccc1 = Ghe1->GetBinContent(i, j) / ccc0HE;
4513  if (ccc1 > 0.) {
4514  ssumjHE += (ccc1 - meanjHE) * (ccc1 - meanjHE);
4515  njHE++;
4516  }
4517  }
4518  sigmajHE = sqrt(ssumjHE / njHE);
4519  }
4520  } // j
4521 
4522  double dif3rmsHEMIN = meanjHE - 3 * sigmajHE;
4523  if (dif3rmsHEMIN < 0.)
4524  dif3rmsHEMIN = 0.;
4525  double dif3rmsHEMAX = meanjHE + 3 * sigmajHE;
4526  cout << "22HE-2 meanjHE= " << meanjHE << " sigmajHE= " << sigmajHE << " dif3rmsHEMIN= " << dif3rmsHEMIN
4527  << " dif3rmsHEMAX= " << dif3rmsHEMAX << endl;
4528 
4529  double MAXdif3rmsHEMIN = dif3rmsHEMIN;
4530  double MINdif3rmsHEMAX = dif3rmsHEMAX;
4531  if (MAXdif3rmsHEMIN < 0.95)
4532  MAXdif3rmsHEMIN = 0.95;
4533  if (MINdif3rmsHEMAX > 1.05)
4534  MINdif3rmsHEMAX = 1.05;
4535  cout << "22HE-2 MAXdif3rmsHEMIN= " << MAXdif3rmsHEMIN << " MINdif3rmsHEMAX= " << MINdif3rmsHEMAX << endl;
4536  //
4537  for (int j = 1; j <= ny; j++) {
4538  ccc0HE = Ghe1->GetBinContent(1, j);
4539  if (ccc0HE <= 0.)
4540  for (int i = 1; i <= nx; i++) {
4541  double ccc2 = Ghe1->GetBinContent(i, j);
4542  if (ccc2 > 0.) {
4543  ccc0HE = ccc2;
4544  break;
4545  }
4546  }
4547  if (ccc0HE > 0.) {
4548  int jeta = (j - 1) / 18; // jeta = 0-21
4549  int jphi = (j - 1) - 18 * jeta; // jphi=0-17
4550  // i - # LSs:
4551  for (int i = 1; i <= nx; i++) {
4552  double ccc1 = Ghe1->GetBinContent(i, j);
4553  if (ccc1 > 0.) {
4554  double Rij = ccc1 / ccc0HE;
4555  if (Rij < MAXdif3rmsHEMIN || Rij > MINdif3rmsHEMAX) {
4556  Ghe61->Fill(jeta - 11, jphi, Rij);
4557  Ghe60->Fill(jeta - 11, jphi, 1.);
4558  }
4559  if (Rij < 0.8 || Rij > 1.2) {
4560  G20he61->Fill(jeta - 11, jphi, Rij);
4561  G20he60->Fill(jeta - 11, jphi, 1.);
4562  }
4563  if (Rij < 0.7 || Rij > 1.3) {
4564  G30he61->Fill(jeta - 11, jphi, Rij);
4565  G30he60->Fill(jeta - 11, jphi, 1.);
4566  }
4567  if (Rij < 0.6 || Rij > 1.4) {
4568  G40he61->Fill(jeta - 11, jphi, Rij);
4569  G40he60->Fill(jeta - 11, jphi, 1.);
4570  }
4571  } //if(ccc1>0.
4572  } // i
4573  } //if(ccc0HE>0
4574  } // j
4575  Ghe6->Divide(Ghe61, Ghe60, 1, 1, "B"); // average R
4576  G20he6->Divide(G20he61, G20he60, 1, 1, "B"); // average R
4577  G30he6->Divide(G30he61, G30he60, 1, 1, "B"); // average R
4578  G40he6->Divide(G40he61, G40he60, 1, 1, "B"); // average R
4579 
4580  // Ghe6->SetLabelOffset (Float_t offset=0.005, Option_t *axis="X")//Set offset between axis and axis' labels
4581  // Ghe6->GetZaxis()->SetLabelOffset(-0.05);
4582  Ghe6->GetZaxis()->SetLabelSize(0.025);
4583 
4584  Ghe6->SetXTitle(" #eta \b");
4585  Ghe6->SetYTitle(" #phi \b");
4586  Ghe6->SetTitle(
4587  "<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);
4588  //gStyle->SetOptStat(kFALSE);
4589  Ghe6->SetStats(0);
4590  Ghe6->Draw("COLZ");
4591  //================
4592  cRBX31->cd(3);
4593  TH1F *Ghe7 = new TH1F("Ghe7", "", 120, 0.4, 1.6);
4594  // j - etaphi index:
4595  for (int j = 1; j <= ny; j++) {
4596  ccc0HE = Ghe1->GetBinContent(1, j);
4597  if (ccc0HE <= 0.)
4598  for (int i = 1; i <= nx; i++) {
4599  double ccc2 = Ghe1->GetBinContent(i, j);
4600  if (ccc2 > 0.) {
4601  ccc0HE = ccc2;
4602  break;
4603  }
4604  }
4605  if (ccc0HE > 0.) {
4606  // i - # LSs:
4607  for (int i = 1; i <= nx; i++) {
4608  double ccc1 = Ghe1->GetBinContent(i, j);
4609  if (ccc1 > 0.) {
4610  double Rij = ccc1 / ccc0HE;
4611  Ghe7->Fill(Rij);
4612  }
4613  }
4614  }
4615  }
4616  Ghe7->SetMarkerStyle(20);
4617  Ghe7->SetMarkerSize(0.4);
4618  Ghe7->GetYaxis()->SetLabelSize(0.04);
4619  Ghe7->SetMarkerColor(2);
4620  Ghe7->SetLineColor(0);
4621  Ghe7->SetYTitle(" N \b");
4622  Ghe7->SetXTitle(" Rij \b");
4623  Ghe7->SetTitle(" Rij \b");
4624  //Ghe7->SetMinimum(0.8);Ghe7->SetMaximum(500.);
4625  gPad->SetGridy();
4626  gPad->SetGridx(); // gPad->SetLogy();
4627  // Ghe7->SetStats(1110000);
4628  Ghe7->GetYaxis()->SetLabelSize(0.025);
4629  Ghe7->Draw("Error");
4630  Float_t ymaxHE = Ghe7->GetMaximum();
4631  cout << "22HE-3 ymaxHE= " << ymaxHE << " MAXdif3rmsHEMIN= " << MAXdif3rmsHEMIN
4632  << " MINdif3rmsHEMAX= " << MINdif3rmsHEMAX << endl;
4633  TLine *lineHE = new TLine(MAXdif3rmsHEMIN, 0., MAXdif3rmsHEMIN, ymaxHE);
4634  lineHE->SetLineColor(kBlue);
4635  lineHE->Draw();
4636  TLine *line1HE = new TLine(MINdif3rmsHEMAX, 0., MINdif3rmsHEMAX, ymaxHE);
4637  line1HE->SetLineColor(kBlue);
4638  line1HE->Draw();
4639  //================
4641  cRBX31->Update();
4642  cRBX31->Print("RBX-HE-3plots.png");
4643  cRBX31->Clear();
4644  // clean-up
4645  if (Ghe5)
4646  delete Ghe5;
4647  if (Ghe60)
4648  delete Ghe60;
4649  if (Ghe61)
4650  delete Ghe61;
4651  if (Ghe6)
4652  delete Ghe6;
4653  if (Ghe7)
4654  delete Ghe7;
4655 
4656  if (G20he60)
4657  delete G20he60;
4658  if (G20he61)
4659  delete G20he61;
4660  if (G30he60)
4661  delete G30he60;
4662  if (G30he61)
4663  delete G30he61;
4664  if (G40he60)
4665  delete G40he60;
4666  if (G40he61)
4667  delete G40he61;
4668 
4669  if (Ghe1)
4670  delete Ghe1;
4671  //========================================================================================== 22-1 HE:: Ratio plots jeta = 0 - 21 jphi =0 - 17
4672  //======================================================================
4673  //======================================================================28.11.2018
4674  //======================================================================
4675  //======================================================================
4676 
4677  gStyle->SetOptStat(1110000);
4678  cout << " RBX HE Ratio plotsmore *****" << endl;
4679  cRBX31->Clear();
4681  cRBX31->Divide(3, 1);
4682  //================
4683  cRBX31->cd(1);
4684  G20he6->GetZaxis()->SetLabelSize(0.025);
4685  G20he6->SetXTitle(" #eta \b");
4686  G20he6->SetYTitle(" #phi \b");
4687  G20he6->SetTitle("<Rj> for |1-<R>| > 0.20 \b");
4688  G20he6->SetStats(0);
4689  G20he6->Draw("COLZ");
4690  //================
4691  cRBX31->cd(2);
4692  G30he6->GetZaxis()->SetLabelSize(0.025);
4693  G30he6->SetXTitle(" #eta \b");
4694  G30he6->SetYTitle(" #phi \b");
4695  G30he6->SetTitle("<Rj> for |1-<R>| > 0.30 \b");
4696  G30he6->SetStats(0);
4697  G30he6->Draw("COLZ");
4698  //================
4699  cRBX31->cd(3);
4700  G40he6->GetZaxis()->SetLabelSize(0.025);
4701  G40he6->SetXTitle(" #eta \b");
4702  G40he6->SetYTitle(" #phi \b");
4703  G40he6->SetTitle("<Rj> for |1-<R>| > 0.40 \b");
4704  G40he6->SetStats(0);
4705  G40he6->Draw("COLZ");
4706  //================
4707 
4709  cRBX31->Update();
4710  cRBX31->Print("RBX-HE-3plotsmore.png");
4711  cRBX31->Clear();
4712 
4713  // clean-up
4714  if (G20he6)
4715  delete G20he6;
4716  if (G30he6)
4717  delete G30he6;
4718  if (G40he6)
4719  delete G40he6;
4720  gStyle->SetOptStat(0);
4722 
4723  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
4724  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
4725  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
4726  for (int jphi = 0; jphi < njphi; jphi++) {
4727  for (int jeta = 0; jeta < njeta; jeta++) {
4728  for (int i = 0; i < nx; i++) {
4729  alexall[jeta][jphi][i] = 0.;
4730  }
4731  }
4732  } // nulling
4733 
4735 
4737  //======================================================================
4738  //======================================================================
4739  //======================================================================
4740  cout << " RBX general for HO **************************" << endl;
4741  TH2F *Gho1KKK = (TH2F *)hfile->Get("h_2DsumADCAmplEtaPhiLs2");
4742  TH2F *Gho1LLL = (TH2F *)hfile->Get("h_2DsumADCAmplEtaPhiLs20");
4743  TH2F *Gho1 = (TH2F *)Gho1LLL->Clone("Gho1");
4744  Gho1->Divide(Gho1KKK, Gho1LLL, 1, 1, "B"); // average A
4745  // Gho1->Sumw2();
4746  // int nx = Gho1->GetXaxis()->GetNbins(); // # LS
4747  // nx = maxbinsRBX; // # LS
4748  ny = Gho1->GetYaxis()->GetNbins(); // # jetaphi indexes
4749  for (int j = 1; j <= ny; j++) {
4750  int jeta = (j - 1) / njphi; // jeta = 0-21
4751  if (jeta < 15 && jeta > 6) {
4752  int jphi = (j - 1) - njphi * jeta; // jphi=0-17
4753  // cout<<"HO 54 jeta= "<< jeta <<" jphi = "<<jphi <<endl;
4754  // over LS:
4755  for (int i = 1; i <= nx; i++) {
4756  double ccc1 = Gho1->GetBinContent(i, j);
4757  alexall[jeta][jphi][i - 1] = ccc1;
4758  // if( i == 1 ) cout<<"HO 54 for LS=1 ccc1= "<< ccc1 <<endl;
4759  } //i
4760  } //if
4761  } //j
4762  // clean-up
4763  if (Gho1KKK)
4764  delete Gho1KKK;
4765  if (Gho1LLL)
4766  delete Gho1LLL;
4767  // if (Gho1) delete Gho1;
4768 
4769  //====================================================================== alexho[k][i]
4770  for (int jphi = 0; jphi < njphi; jphi++) {
4771  for (int i = 0; i < nx; i++) {
4772  double sumccc1 = 0.;
4773  int isum = 0;
4774  for (int jeta = 0; jeta < njeta; jeta++) {
4775  double ccc1 = alexall[jeta][jphi][i];
4776  if (ccc1 > 0.) {
4777  sumccc1 += ccc1;
4778  isum++;
4779  }
4780  } // for jeta
4781  if (isum > 0.)
4782  sumccc1 /= isum;
4783  alexho[jphi][i] = sumccc1;
4784  }
4785  } //for for
4786  //====================================================================== blexho[k][i]
4787  for (int keta = 0; keta < njeta; keta++) {
4788  for (int i = 0; i < nx; i++) {
4789  double sumccc1 = 0.;
4790  int isum = 0;
4791  for (int kphi = 0; kphi < njphi; kphi++) {
4792  double ccc1 = alexall[keta][kphi][i];
4793  if (ccc1 > 0.) {
4794  sumccc1 += ccc1;
4795  isum++;
4796  }
4797  } // for kphi
4798  if (isum > 0.)
4799  sumccc1 /= isum;
4800  blexho[keta][i] = sumccc1;
4801  }
4802  } //for for
4803 
4805  //========================================================================================== 33 HO:: 2D jeta = 0 - 21 jphi =0 - 17
4806  //======================================================================
4807  //======================================================================
4808  //======================================================================
4809  //======================================================================
4810  cout << " RBX HO 2D plot *****" << endl;
4811  cRBX1->Clear();
4813  cRBX1->Divide(1, 1);
4814  cRBX1->cd(1);
4815  // int ietaphi = 0; ietaphi = ((k2+1)-1)*nphi + (k3+1) ; k2=0-neta-1; k3=0-nphi-1; neta=18; nphi=22;
4816  TH2F *Gho42D = new TH2F("Gho42D", "", 23, -11.5, 11.5, 18, 0., 18.);
4817  TH2F *Gho42D0 = new TH2F("Gho42D0", "", 23, -11.5, 11.5, 18, 0., 18.);
4818  // TH2F* Gho42D = new TH2F("Gho42D","", 22, -11., 11., 18, 0., 18. );
4819  // TH2F* Gho42D0 = new TH2F("Gho42D0","", 22, -11., 11., 18, 0., 18. );
4820  TH2F *Gho42DF = (TH2F *)Gho42D0->Clone("Gho42DF");
4821  for (int jphi = 0; jphi < njphi; jphi++) {
4822  for (int jeta = 0; jeta < njeta; jeta++) {
4823  for (int i = 0; i < nx; i++) {
4824  double ccc1 = alexall[jeta][jphi][i];
4825  int neweta = jeta - 11 - 0.5;
4826  if (jeta >= 11)
4827  neweta = jeta - 11 + 1.5;
4828  if (ccc1 > 0.) {
4829  Gho42D->Fill(neweta, jphi, ccc1);
4830  Gho42D0->Fill(neweta, jphi, 1.);
4831  }
4832  // if(ccc1>0.) {Gho42D ->Fill(jeta-11,jphi,ccc1); Gho42D0 ->Fill(jeta-11,jphi,1.); }
4833  }
4834  }
4835  }
4836  Gho42DF->Divide(Gho42D, Gho42D0, 1, 1, "B"); // average A
4837  // Gho1->Sumw2();
4838  gPad->SetGridy();
4839  gPad->SetGridx(); // gPad->SetLogz();
4840  Gho42DF->SetMarkerStyle(20);
4841  Gho42DF->SetMarkerSize(0.4);
4842  Gho42DF->GetZaxis()->SetLabelSize(0.04);
4843  Gho42DF->SetXTitle("<A>_RBX #eta \b");
4844  Gho42DF->SetYTitle(" #phi \b");
4845  Gho42DF->SetZTitle("<A>_RBX - All \b");
4846  Gho42DF->SetMarkerColor(2);
4847  Gho42DF->SetLineColor(2); // Gho42DF->SetMaximum(1.000); // Gho42DF->SetMinimum(1.0);
4848  Gho42DF->Draw("COLZ");
4849 
4851  cRBX1->Update();
4852  cRBX1->Print("RBX-HO-2Dplot.png");
4853  cRBX1->Clear();
4854  // clean-up
4855  if (Gho42D)
4856  delete Gho42D;
4857  if (Gho42D0)
4858  delete Gho42D0;
4859  if (Gho42DF)
4860  delete Gho42DF;
4861 
4862  //========================================================================================== 61 HO:: 1D j = 7,8,9,10 ; 11,12,13,14 jphi =0 - 17
4863  //======================================================================
4864  //======================================================================
4865  //======================================================================
4866  //======================================================================
4867  cout << " RBX HO 1D plot *****" << endl;
4868  cRBX1->Clear();
4870  cRBX1->Divide(1, 1);
4871  cRBX1->cd(1);
4872  TH1F *GphiHO1D = new TH1F("GphiHO1D", "", 18, 0., 18.);
4873  TH1F *GphiHO1D0 = new TH1F("GphiHO1D0", "", 18, 0., 18.);
4874  TH1F *GphiHO1DF = (TH1F *)GphiHO1D0->Clone("GphiHO1DF");
4875  for (int jphi = 0; jphi < 18; jphi++) {
4876  for (int jeta = 0; jeta < 22; jeta++) {
4877  for (int i = 0; i < nx; i++) {
4878  double ccc1 = alexall[jeta][jphi][i];
4879  if (ccc1 > 0.) {
4880  GphiHO1D->Fill(jphi, ccc1);
4881  GphiHO1D0->Fill(jphi, 1.);
4882  }
4883  }
4884  }
4885  }
4886  // GphiHO1D->Sumw2();GphiHO1D0->Sumw2();
4887  GphiHO1DF->Divide(GphiHO1D, GphiHO1D0, 1, 1, "B"); // average A
4888  // GphiHO1DF->Sumw2();
4889  for (int jphi = 1; jphi < 19; jphi++) {
4890  GphiHO1DF->SetBinError(jphi, 0.01);
4891  }
4892  gPad->SetGridy();
4893  gPad->SetGridx(); // gPad->SetLogz();
4894  GphiHO1DF->SetMarkerStyle(20);
4895  GphiHO1DF->SetMarkerSize(1.4);
4896  GphiHO1DF->GetZaxis()->SetLabelSize(0.08);
4897  GphiHO1DF->SetXTitle("PHI of RBX\b");
4898  GphiHO1DF->SetYTitle(" <Amplitude> \b");
4899  GphiHO1DF->SetZTitle("<A>_PHI - All \b");
4900  GphiHO1DF->SetMarkerColor(4);
4901  GphiHO1DF->SetLineColor(4);
4902  GphiHO1DF->SetMinimum(0.8); // GphiHO1DF->SetMaximum(1.000);
4903  GphiHO1DF->Draw("Error");
4905  cRBX1->Update();
4906  cRBX1->Print("RBX-HO-1Dplot.png");
4907  cRBX1->Clear();
4908  // clean-up
4909  if (GphiHO1D)
4910  delete GphiHO1D;
4911  if (GphiHO1D0)
4912  delete GphiHO1D0;
4913  if (GphiHO1DF)
4914  delete GphiHO1DF;
4915 
4916  //========================================================================================== 62 HO:: 1D j = 7,8,9,10 ; 11,12,13,14 jphi =0 - 17
4917  //======================================================================
4918  //======================================================================
4919  //======================================================================
4920  //======================================================================
4921  cout << " RBX HO 11D plot *eta*" << endl;
4922  cRBX1->Clear();
4924  cRBX1->Divide(1, 1);
4925  cRBX1->cd(1);
4926  TH1F *GetaHO11D = new TH1F("GetaHO11D", "", 23, -11.5, 11.5);
4927  TH1F *GetaHO11D0 = new TH1F("GetaHO11D0", "", 23, -11.5, 11.5);
4928  TH1F *GetaHO11DF = (TH1F *)GetaHO11D0->Clone("GetaHO11DF");
4929 
4930  for (int jeta = 0; jeta < 22; jeta++) {
4931  for (int jphi = 0; jphi < 18; jphi++) {
4932  for (int i = 0; i < nx; i++) {
4933  double ccc1 = alexall[jeta][jphi][i];
4934  int neweta = jeta - 11 - 0.5;
4935  if (jeta >= 11)
4936  neweta = jeta - 11 + 1.5;
4937  if (ccc1 > 0.) {
4938  GetaHO11D->Fill(neweta, ccc1);
4939  GetaHO11D0->Fill(neweta, 1.);
4940  // if( i == 0 ) cout<<"62 HO: ibin= "<< i <<" jphi= "<< jphi <<" jeta= "<< jeta <<" A= "<< ccc1 <<endl;
4941  }
4942  }
4943  }
4944  }
4945  // GetaHO11D->Sumw2();GetaHO11D0->Sumw2();
4946  GetaHO11DF->Divide(GetaHO11D, GetaHO11D0, 1, 1, "B"); // average A
4947  // GetaHO11DF->Sumw2();
4948  for (int jeta = 1; jeta < 24; jeta++) {
4949  GetaHO11DF->SetBinError(jeta, 0.01);
4950  }
4951  gPad->SetGridy();
4952  gPad->SetGridx(); // gPad->SetLogz();
4953  GetaHO11DF->SetMarkerStyle(20);
4954  GetaHO11DF->SetMarkerSize(1.4);
4955  GetaHO11DF->GetZaxis()->SetLabelSize(0.08);
4956  GetaHO11DF->SetXTitle("#eta \b");
4957  GetaHO11DF->SetYTitle(" <A> \b");
4958  GetaHO11DF->SetZTitle("<A>_ETA - All \b");
4959  GetaHO11DF->SetMarkerColor(4);
4960  GetaHO11DF->SetLineColor(4);
4961  GetaHO11DF->SetMinimum(0.8); // GetaHO11DF->SetMaximum(1.000);
4962  GetaHO11DF->Draw("Error");
4963 
4965  cRBX1->Update();
4966  cRBX1->Print("RBX-HO-11Dplot.png");
4967  cRBX1->Clear();
4968  // clean-up
4969  if (GetaHO11D)
4970  delete GetaHO11D;
4971  if (GetaHO11D0)
4972  delete GetaHO11D0;
4973  if (GetaHO11DF)
4974  delete GetaHO11DF;
4975 
4976  //========================================================================================== 22 HO:: Ratio plots jeta = 0 - 21 jphi =0 - 17
4977  //======================================================================
4978  //======================================================================22.11.2018
4979  //======================================================================
4980  //======================================================================
4981 
4982  gStyle->SetOptStat(1110000);
4983  cout << " RBX HO Ratio plots *****" << endl;
4984  cRBX31->Clear();
4986  // gain stabilitY:
4987  // Rij = Aij / A1j , where i-over LSs, j-channels
4988  //
4989  // nx = maxbinsRBX; // # LS
4990  //
4991  double ccc0HO = 0.;
4992  cRBX31->Divide(3, 1);
4993  //================
4994  cRBX31->cd(1);
4995  // TH1F* Gho5 = new TH1F("Gho5","", nx, 1., nx+1.);
4996  TH1F *Gho51 = new TH1F("Gho51", "", nx, 1., nx + 1.);
4997  TH1F *Gho50 = new TH1F("Gho50", "", nx, 1., nx + 1.);
4998  TH1F *Gho5 = (TH1F *)Gho50->Clone("Gho5");
4999  // j - etaphi index:
5000  for (int j = 1; j <= ny; j++) {
5001  ccc0HO = Gho1->GetBinContent(1, j);
5002  // 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;} }
5003  if (ccc0HO <= 0.)
5004  for (int i = 1; i <= nx; i++) {
5005  double ccc2 = Gho1->GetBinContent(i, j);
5006  if (ccc2 > 0.) {
5007  ccc0HO = ccc2;
5008  break;
5009  }
5010  }
5011  if (ccc0HO > 0.) {
5012  // i - # LSs:
5013  for (int i = 1; i <= nx; i++) {
5014  double ccc1 = Gho1->GetBinContent(i, j);
5015  if (ccc1 > 0.) {
5016  double Rij = ccc1 / ccc0HO;
5017  // Gho5 ->Fill( float(i), Rij);
5018  Gho51->Fill(float(i), Rij);
5019  Gho50->Fill(float(i), 1.);
5020  }
5021  }
5022  }
5023  }
5024  Gho5->Divide(Gho51, Gho50, 1, 1, "B"); // average A
5025  for (int i = 1; i <= nx; i++) {
5026  Gho5->SetBinError(i, 0.0001);
5027  }
5028  Gho5->SetMarkerStyle(20);
5029  Gho5->SetMarkerSize(0.4);
5030  Gho5->GetYaxis()->SetLabelSize(0.04);
5031  Gho5->SetMarkerColor(2);
5032  Gho5->SetLineColor(0);
5033  Gho5->SetXTitle(" iLS \b");
5034  Gho5->SetYTitle(" <R> \b");
5035  Gho5->SetTitle("<Ri> vs iLS \b");
5036  Gho5->SetMinimum(0.); //Gho5->SetMaximum(2.5);
5037  // gPad->SetLogy();
5038  gPad->SetGridy();
5039  gPad->SetGridx();
5040  Gho5->SetStats(0);
5041  Gho5->GetYaxis()->SetLabelSize(0.025);
5042  Gho5->Draw("Error");
5043  //================
5044  cRBX31->cd(2);
5045  TH2F *Gho60 = new TH2F("Gho60", "", 22, -11., 11., 18, 0., 18.);
5046  TH2F *Gho61 = new TH2F("Gho61", "", 22, -11., 11., 18, 0., 18.);
5047  TH2F *Gho6 = new TH2F("Gho6", "", 22, -11., 11., 18, 0., 18.);
5048 
5049  TH2F *G20ho60 = new TH2F("G20ho60", "", 22, -11., 11., 18, 0., 18.);
5050  TH2F *G20ho61 = new TH2F("G20ho61", "", 22, -11., 11., 18, 0., 18.);
5051  TH2F *G20ho6 = new TH2F("G20ho6", "", 22, -11., 11., 18, 0., 18.);
5052  TH2F *G30ho60 = new TH2F("G30ho60", "", 22, -11., 11., 18, 0., 18.);
5053  TH2F *G30ho61 = new TH2F("G30ho61", "", 22, -11., 11., 18, 0., 18.);
5054  TH2F *G30ho6 = new TH2F("G30ho6", "", 22, -11., 11., 18, 0., 18.);
5055  TH2F *G40ho60 = new TH2F("G40ho60", "", 22, -11., 11., 18, 0., 18.);
5056  TH2F *G40ho61 = new TH2F("G40ho61", "", 22, -11., 11., 18, 0., 18.);
5057  TH2F *G40ho6 = new TH2F("G40ho6", "", 22, -11., 11., 18, 0., 18.);
5058 
5059  // j - etaphi index; i - # LSs;
5060  //
5061  // define mean and RMS:
5062  double sumjHO = 0.;
5063  int njHO = 0;
5064  double meanjHO = 0.;
5065  for (int j = 1; j <= ny; j++) {
5066  ccc0HO = Gho1->GetBinContent(1, j);
5067  if (ccc0HO <= 0.)
5068  for (int i = 1; i <= nx; i++) {
5069  double ccc2 = Gho1->GetBinContent(i, j);
5070  if (ccc2 > 0.) {
5071  ccc0HO = ccc2;
5072  break;
5073  }
5074  }
5075  if (ccc0HO > 0.) {
5076  for (int i = 1; i <= nx; i++) {
5077  double ccc1 = Gho1->GetBinContent(i, j) / ccc0HO;
5078  if (ccc1 > 0.) {
5079  sumjHO += ccc1;
5080  njHO++;
5081  }
5082  }
5083  meanjHO = sumjHO / njHO;
5084  }
5085  } // j
5086 
5087  double ssumjHO = 0.;
5088  njHO = 0;
5089  double sigmajHO = 0.;
5090  for (int j = 1; j <= ny; j++) {
5091  ccc0HO = Gho1->GetBinContent(1, j);
5092  if (ccc0HO <= 0.)
5093  for (int i = 1; i <= nx; i++) {
5094  double ccc2 = Gho1->GetBinContent(i, j);
5095  if (ccc2 > 0.) {
5096  ccc0HO = ccc2;
5097  break;
5098  }
5099  }
5100  if (ccc0HO > 0.) {
5101  for (int i = 1; i <= nx; i++) {
5102  double ccc1 = Gho1->GetBinContent(i, j) / ccc0HO;
5103  if (ccc1 > 0.) {
5104  ssumjHO += (ccc1 - meanjHO) * (ccc1 - meanjHO);
5105  njHO++;
5106  }
5107  }
5108  sigmajHO = sqrt(ssumjHO / njHO);
5109  }
5110  } // j
5111 
5112  double dif3rmsHOMIN = meanjHO - 3 * sigmajHO;
5113  if (dif3rmsHOMIN < 0.)
5114  dif3rmsHOMIN = 0.;
5115  double dif3rmsHOMAX = meanjHO + 3 * sigmajHO;
5116  cout << "22HO-2 meanjHO= " << meanjHO << " sigmajHO= " << sigmajHO << " dif3rmsHOMIN= " << dif3rmsHOMIN
5117  << " dif3rmsHOMAX= " << dif3rmsHOMAX << endl;
5118 
5119  double MAXdif3rmsHOMIN = dif3rmsHOMIN;
5120  double MINdif3rmsHOMAX = dif3rmsHOMAX;
5121  if (MAXdif3rmsHOMIN < 0.95)
5122  MAXdif3rmsHOMIN = 0.95;
5123  if (MINdif3rmsHOMAX > 1.05)
5124  MINdif3rmsHOMAX = 1.05;
5125  cout << "22HO-2 MAXdif3rmsHOMIN= " << MAXdif3rmsHOMIN << " MINdif3rmsHOMAX= " << MINdif3rmsHOMAX << endl;
5126  //
5127  for (int j = 1; j <= ny; j++) {
5128  ccc0HO = Gho1->GetBinContent(1, j);
5129  if (ccc0HO <= 0.)
5130  for (int i = 1; i <= nx; i++) {
5131  double ccc2 = Gho1->GetBinContent(i, j);
5132  if (ccc2 > 0.) {
5133  ccc0HO = ccc2;
5134  break;
5135  }
5136  }
5137  if (ccc0HO > 0.) {
5138  int jeta = (j - 1) / 18; // jeta = 0-21
5139  int jphi = (j - 1) - 18 * jeta; // jphi=0-17
5140  // i - # LSs:
5141  for (int i = 1; i <= nx; i++) {
5142  double ccc1 = Gho1->GetBinContent(i, j);
5143  if (ccc1 > 0.) {
5144  double Rij = ccc1 / ccc0HO;
5145  if (Rij < MAXdif3rmsHOMIN || Rij > MINdif3rmsHOMAX) {
5146  Gho61->Fill(jeta - 11, jphi, Rij);
5147  Gho60->Fill(jeta - 11, jphi, 1.);
5148  }
5149  if (Rij < 0.8 || Rij > 1.2) {
5150  G20ho61->Fill(jeta - 11, jphi, Rij);
5151  G20ho60->Fill(jeta - 11, jphi, 1.);
5152  }
5153  if (Rij < 0.7 || Rij > 1.3) {
5154  G30ho61->Fill(jeta - 11, jphi, Rij);
5155  G30ho60->Fill(jeta - 11, jphi, 1.);
5156  }
5157  if (Rij < 0.6 || Rij > 1.4) {
5158  G40ho61->Fill(jeta - 11, jphi, Rij);
5159  G40ho60->Fill(jeta - 11, jphi, 1.);
5160  }
5161  } //if(ccc1>0.
5162  } // i
5163  } //if(ccc0HO>0
5164  } // j
5165  Gho6->Divide(Gho61, Gho60, 1, 1, "B"); // average R
5166  G20ho6->Divide(G20ho61, G20ho60, 1, 1, "B"); // average R
5167  G30ho6->Divide(G30ho61, G30ho60, 1, 1, "B"); // average R
5168  G40ho6->Divide(G40ho61, G40ho60, 1, 1, "B"); // average R
5169  // Gho6->SetLabelOffset (Float_t offset=0.005, Option_t *axis="X")//Set offset between axis and axis' labels
5170  // Gho6->GetZaxis()->SetLabelOffset(-0.05);
5171  Gho6->GetZaxis()->SetLabelSize(0.025);
5172 
5173  Gho6->SetXTitle(" #eta \b");
5174  Gho6->SetYTitle(" #phi \b");
5175  Gho6->SetTitle(
5176  "<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);
5177  //gStyle->SetOptStat(kFALSE);
5178  Gho6->SetStats(0);
5179  Gho6->Draw("COLZ");
5180  //================
5181  cRBX31->cd(3);
5182  TH1F *Gho7 = new TH1F("Gho7", "", 120, 0.4, 1.6);
5183  // j - etaphi index:
5184  for (int j = 1; j <= ny; j++) {
5185  ccc0HO = Gho1->GetBinContent(1, j);
5186  if (ccc0HO <= 0.)
5187  for (int i = 1; i <= nx; i++) {
5188  double ccc2 = Gho1->GetBinContent(i, j);
5189  if (ccc2 > 0.) {
5190  ccc0HO = ccc2;
5191  break;
5192  }
5193  }
5194  if (ccc0HO > 0.) {
5195  // i - # LSs:
5196  for (int i = 1; i <= nx; i++) {
5197  double ccc1 = Gho1->GetBinContent(i, j);
5198  if (ccc1 > 0.) {
5199  double Rij = ccc1 / ccc0HO;
5200  Gho7->Fill(Rij);
5201  }
5202  }
5203  }
5204  }
5205  Gho7->SetMarkerStyle(20);
5206  Gho7->SetMarkerSize(0.4);
5207  Gho7->GetYaxis()->SetLabelSize(0.04);
5208  Gho7->SetMarkerColor(2);
5209  Gho7->SetLineColor(0);
5210  Gho7->SetYTitle(" N \b");
5211  Gho7->SetXTitle(" Rij \b");
5212  Gho7->SetTitle(" Rij \b");
5213  //Gho7->SetMinimum(0.8);Gho7->SetMaximum(500.);
5214  gPad->SetGridy();
5215  gPad->SetGridx(); // gPad->SetLogy();
5216  // Gho7->SetStats(1110000);
5217  Gho7->GetYaxis()->SetLabelSize(0.025);
5218  Gho7->Draw("Error");
5219  Float_t ymaxHO = Gho7->GetMaximum();
5220  cout << "22HO-3 ymaxHO= " << ymaxHO << " MAXdif3rmsHOMIN= " << MAXdif3rmsHOMIN
5221  << " MINdif3rmsHOMAX= " << MINdif3rmsHOMAX << endl;
5222  TLine *lineHO = new TLine(MAXdif3rmsHOMIN, 0., MAXdif3rmsHOMIN, ymaxHO);
5223  lineHO->SetLineColor(kBlue);
5224  lineHO->Draw();
5225  TLine *line1HO = new TLine(MINdif3rmsHOMAX, 0., MINdif3rmsHOMAX, ymaxHO);
5226  line1HO->SetLineColor(kBlue);
5227  line1HO->Draw();
5228  //================
5230  cRBX31->Update();
5231  cRBX31->Print("RBX-HO-3plots.png");
5232  cRBX31->Clear();
5233  // clean-up
5234  if (Gho5)
5235  delete Gho5;
5236  if (Gho60)
5237  delete Gho60;
5238  if (Gho61)
5239  delete Gho61;
5240  if (Gho6)
5241  delete Gho6;
5242  if (Gho7)
5243  delete Gho7;
5244 
5245  if (G20ho60)
5246  delete G20ho60;
5247  if (G20ho61)
5248  delete G20ho61;
5249  if (G30ho60)
5250  delete G30ho60;
5251  if (G30ho61)
5252  delete G30ho61;
5253  if (G40ho60)
5254  delete G40ho60;
5255  if (G40ho61)
5256  delete G40ho61;
5257 
5258  if (Gho1)
5259  delete Gho1;
5260  //========================================================================================== 22-1 HO:: Ratio plots jeta = 0 - 21 jphi =0 - 17
5261  //======================================================================
5262  //======================================================================28.11.2018
5263  //======================================================================
5264  //======================================================================
5265 
5266  gStyle->SetOptStat(1110000);
5267  cout << " RBX HO Ratio plotsmore *****" << endl;
5268  cRBX31->Clear();
5270  cRBX31->Divide(3, 1);
5271  //================
5272  cRBX31->cd(1);
5273  G20ho6->GetZaxis()->SetLabelSize(0.025);
5274  G20ho6->SetXTitle(" #eta \b");
5275  G20ho6->SetYTitle(" #phi \b");
5276  G20ho6->SetTitle("<Rj> for |1-<R>| > 0.20 \b");
5277  G20ho6->SetStats(0);
5278  G20ho6->Draw("COLZ");
5279  //================
5280  cRBX31->cd(2);
5281  G30ho6->GetZaxis()->SetLabelSize(0.025);
5282  G30ho6->SetXTitle(" #eta \b");
5283  G30ho6->SetYTitle(" #phi \b");
5284  G30ho6->SetTitle("<Rj> for |1-<R>| > 0.30 \b");
5285  G30ho6->SetStats(0);
5286  G30ho6->Draw("COLZ");
5287  //================
5288  cRBX31->cd(3);
5289  G40ho6->GetZaxis()->SetLabelSize(0.025);
5290  G40ho6->SetXTitle(" #eta \b");
5291  G40ho6->SetYTitle(" #phi \b");
5292  G40ho6->SetTitle("<Rj> for |1-<R>| > 0.40 \b");
5293  G40ho6->SetStats(0);
5294  G40ho6->Draw("COLZ");
5295  //================
5296 
5298  cRBX31->Update();
5299  cRBX31->Print("RBX-HO-3plotsmore.png");
5300  cRBX31->Clear();
5301 
5302  // clean-up
5303  if (G20ho6)
5304  delete G20ho6;
5305  if (G30ho6)
5306  delete G30ho6;
5307  if (G40ho6)
5308  delete G40ho6;
5309  gStyle->SetOptStat(0);
5311 
5312  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
5313  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
5314  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
5315  for (int jphi = 0; jphi < njphi; jphi++) {
5316  for (int jeta = 0; jeta < njeta; jeta++) {
5317  for (int i = 0; i < nx; i++) {
5318  alexall[jeta][jphi][i] = 0.;
5319  }
5320  }
5321  } // nulling
5322 
5324 
5326  //======================================================================
5327  //======================================================================
5328  //======================================================================
5329  cout << " RBX general for HF **************************" << endl;
5330  TH2F *Ghf1KKK = (TH2F *)hfile->Get("h_2DsumADCAmplEtaPhiLs3");
5331  TH2F *Ghf1LLL = (TH2F *)hfile->Get("h_2DsumADCAmplEtaPhiLs30");
5332  TH2F *Ghf1 = (TH2F *)Ghf1LLL->Clone("Ghf1");
5333  Ghf1->Divide(Ghf1KKK, Ghf1LLL, 1, 1, "B"); // average A
5334  // Ghf1->Sumw2();
5335  // int nx = Ghf1->GetXaxis()->GetNbins(); // # LS
5336  // nx = maxbinsRBX; // # LS
5337  ny = Ghf1->GetYaxis()->GetNbins(); // # jetaphi indexes
5338  for (int j = 1; j <= ny; j++) {
5339  int jeta = (j - 1) / njphi; // jeta = 0-21
5340  if (jeta < 4 || jeta > 17) {
5341  int jphi = (j - 1) - njphi * jeta; // jphi=0-17
5342  // cout<<"HF 54 jeta= "<< jeta <<" jphi = "<<jphi <<endl;
5343  // over LS:
5344  for (int i = 1; i <= nx; i++) {
5345  double ccc1 = Ghf1->GetBinContent(i, j);
5346  alexall[jeta][jphi][i - 1] = ccc1;
5347  // if( i == 1 ) cout<<"HF 54 for LS=1 ccc1= "<< ccc1 <<endl;
5348  } //i
5349  } //if
5350  } //j
5351  // clean-up
5352  if (Ghf1KKK)
5353  delete Ghf1KKK;
5354  if (Ghf1LLL)
5355  delete Ghf1LLL;
5356  // if (Ghf1) delete Ghf1;
5357 
5358  //====================================================================== alexhf[k][i]
5359  for (int jphi = 0; jphi < njphi; jphi++) {
5360  for (int i = 0; i < nx; i++) {
5361  double sumccc1 = 0.;
5362  int isum = 0;
5363  for (int jeta = 0; jeta < njeta; jeta++) {
5364  double ccc1 = alexall[jeta][jphi][i];
5365  if (ccc1 > 0.) {
5366  sumccc1 += ccc1;
5367  isum++;
5368  }
5369  } // for jeta
5370  if (isum > 0.)
5371  sumccc1 /= isum;
5372  alexhf[jphi][i] = sumccc1;
5373  }
5374  } //for for
5375  //====================================================================== blexhf[k][i]
5376  for (int keta = 0; keta < njeta; keta++) {
5377  for (int i = 0; i < nx; i++) {
5378  double sumccc1 = 0.;
5379  int isum = 0;
5380  for (int kphi = 0; kphi < njphi; kphi++) {
5381  double ccc1 = alexall[keta][kphi][i];
5382  if (ccc1 > 0.) {
5383  sumccc1 += ccc1;
5384  isum++;
5385  }
5386  } // for kphi
5387  if (isum > 0.)
5388  sumccc1 /= isum;
5389  blexhf[keta][i] = sumccc1;
5390  }
5391  } //for for
5393  //========================================================================================== 60 HF:: 2D jeta = 0 - 21 jphi =0 - 17
5394  //======================================================================
5395  //======================================================================
5396  //======================================================================
5397  //======================================================================
5398  cout << " RBX HF 2D plot *****" << endl;
5399  cRBX1->Clear();
5401  cRBX1->Divide(1, 1);
5402  cRBX1->cd(1);
5403  // int ietaphi = 0; ietaphi = ((k2+1)-1)*nphi + (k3+1) ; k2=0-neta-1; k3=0-nphi-1; neta=18; nphi=22;
5404  TH2F *Ghf42D = new TH2F("Ghf42D", "", 23, -11.5, 11.5, 18, 0., 18.);
5405  TH2F *Ghf42D0 = new TH2F("Ghf42D0", "", 23, -11.5, 11.5, 18, 0., 18.);
5406  // TH2F* Ghf42D = new TH2F("Ghf42D","", 22, -11., 11., 18, 0., 18. );
5407  // TH2F* Ghf42D0 = new TH2F("Ghf42D0","", 22, -11., 11., 18, 0., 18. );
5408  TH2F *Ghf42DF = (TH2F *)Ghf42D0->Clone("Ghf42DF");
5409  for (int jphi = 0; jphi < njphi; jphi++) {
5410  for (int jeta = 0; jeta < njeta; jeta++) {
5411  for (int i = 0; i < nx; i++) {
5412  double ccc1 = alexall[jeta][jphi][i];
5413  int neweta = jeta - 11 - 0.5;
5414  if (jeta >= 11)
5415  neweta = jeta - 11 + 1.5;
5416  if (ccc1 > 0.) {
5417  Ghf42D->Fill(neweta, jphi, ccc1);
5418  Ghf42D0->Fill(neweta, jphi, 1.);
5419  }
5420  // if(ccc1>0.) {Ghf42D ->Fill(jeta-11,jphi,ccc1); Ghf42D0 ->Fill(jeta-11,jphi,1.); }
5421  }
5422  }
5423  }
5424  Ghf42DF->Divide(Ghf42D, Ghf42D0, 1, 1, "B"); // average A
5425  // Ghf1->Sumw2();
5426  gPad->SetGridy();
5427  gPad->SetGridx(); // gPad->SetLogz();
5428  Ghf42DF->SetMarkerStyle(20);
5429  Ghf42DF->SetMarkerSize(0.4);
5430  Ghf42DF->GetZaxis()->SetLabelSize(0.04);
5431  Ghf42DF->SetXTitle("<A>_RBX #eta \b");
5432  Ghf42DF->SetYTitle(" #phi \b");
5433  Ghf42DF->SetZTitle("<A>_RBX - All \b");
5434  Ghf42DF->SetMarkerColor(2);
5435  Ghf42DF->SetLineColor(2); // Ghf42DF->SetMaximum(1.000); // Ghf42DF->SetMinimum(1.0);
5436  Ghf42DF->Draw("COLZ");
5437 
5439  cRBX1->Update();
5440  cRBX1->Print("RBX-HF-2Dplot.png");
5441  cRBX1->Clear();
5442  // clean-up
5443  if (Ghf42D)
5444  delete Ghf42D;
5445  if (Ghf42D0)
5446  delete Ghf42D0;
5447  if (Ghf42DF)
5448  delete Ghf42DF;
5449 
5450  //========================================================================================== 61 HF:: 1D j = 7,8,9,10 ; 11,12,13,14 jphi =0 - 17
5451  //======================================================================
5452  //======================================================================
5453  //======================================================================
5454  //======================================================================
5455  cout << " RBX HF 1D plot *****" << endl;
5456  cRBX1->Clear();
5458  cRBX1->Divide(1, 1);
5459  cRBX1->cd(1);
5460  TH1F *GphiHF1D = new TH1F("GphiHF1D", "", 18, 0., 18.);
5461  TH1F *GphiHF1D0 = new TH1F("GphiHF1D0", "", 18, 0., 18.);
5462  TH1F *GphiHF1DF = (TH1F *)GphiHF1D0->Clone("GphiHF1DF");
5463  for (int jphi = 0; jphi < 18; jphi++) {
5464  for (int jeta = 0; jeta < 22; jeta++) {
5465  for (int i = 0; i < nx; i++) {
5466  double ccc1 = alexall[jeta][jphi][i];
5467  if (ccc1 > 0.) {
5468  GphiHF1D->Fill(jphi, ccc1);
5469  GphiHF1D0->Fill(jphi, 1.);
5470  }
5471  }
5472  }
5473  }
5474  // GphiHF1D->Sumw2();GphiHF1D0->Sumw2();
5475  GphiHF1DF->Divide(GphiHF1D, GphiHF1D0, 1, 1, "B"); // average A
5476  // GphiHF1DF->Sumw2();
5477  for (int jphi = 1; jphi < 19; jphi++) {
5478  GphiHF1DF->SetBinError(jphi, 0.01);
5479  }
5480  gPad->SetGridy();
5481  gPad->SetGridx(); // gPad->SetLogz();
5482  GphiHF1DF->SetMarkerStyle(20);
5483  GphiHF1DF->SetMarkerSize(1.4);
5484  GphiHF1DF->GetZaxis()->SetLabelSize(0.08);
5485  GphiHF1DF->SetXTitle("PHI of RBX\b");
5486  GphiHF1DF->SetYTitle(" <Amplitude> \b");
5487  GphiHF1DF->SetZTitle("<A>_PHI - All \b");
5488  GphiHF1DF->SetMarkerColor(4);
5489  GphiHF1DF->SetLineColor(4);
5490  GphiHF1DF->SetMinimum(0.8); // GphiHF1DF->SetMaximum(1.000);
5491  GphiHF1DF->Draw("Error");
5493  cRBX1->Update();
5494  cRBX1->Print("RBX-HF-1Dplot.png");
5495  cRBX1->Clear();
5496  // clean-up
5497  if (GphiHF1D)
5498  delete GphiHF1D;
5499  if (GphiHF1D0)
5500  delete GphiHF1D0;
5501  if (GphiHF1DF)
5502  delete GphiHF1DF;
5503 
5504  //========================================================================================== 62 HF:: 1D j = 7,8,9,10 ; 11,12,13,14 jphi =0 - 17
5505  //======================================================================
5506  //======================================================================
5507  //======================================================================
5508  //======================================================================
5509  cout << " RBX HF 11D plot *eta*" << endl;
5510  cRBX1->Clear();
5512  cRBX1->Divide(1, 1);
5513  cRBX1->cd(1);
5514  TH1F *GetaHF11D = new TH1F("GetaHF11D", "", 23, -11.5, 11.5);
5515  TH1F *GetaHF11D0 = new TH1F("GetaHF11D0", "", 23, -11.5, 11.5);
5516  TH1F *GetaHF11DF = (TH1F *)GetaHF11D0->Clone("GetaHF11DF");
5517 
5518  for (int jeta = 0; jeta < 22; jeta++) {
5519  for (int jphi = 0; jphi < 18; jphi++) {
5520  for (int i = 0; i < nx; i++) {
5521  double ccc1 = alexall[jeta][jphi][i];
5522  int neweta = jeta - 11 - 0.5;
5523  if (jeta >= 11)
5524  neweta = jeta - 11 + 1.5;
5525  if (ccc1 > 0.) {
5526  GetaHF11D->Fill(neweta, ccc1);
5527  GetaHF11D0->Fill(neweta, 1.);
5528  // if( i == 0 ) cout<<"62 HF: ibin= "<< i <<" jphi= "<< jphi <<" jeta= "<< jeta <<" A= "<< ccc1 <<endl;
5529  }
5530  }
5531  }
5532  }
5533  // GetaHF11D->Sumw2();GetaHF11D0->Sumw2();
5534  GetaHF11DF->Divide(GetaHF11D, GetaHF11D0, 1, 1, "B"); // average A
5535  // GetaHF11DF->Sumw2();
5536  for (int jeta = 1; jeta < 24; jeta++) {
5537  GetaHF11DF->SetBinError(jeta, 0.01);
5538  }
5539  gPad->SetGridy();
5540  gPad->SetGridx(); // gPad->SetLogz();
5541  GetaHF11DF->SetMarkerStyle(20);
5542  GetaHF11DF->SetMarkerSize(1.4);
5543  GetaHF11DF->GetZaxis()->SetLabelSize(0.08);
5544  GetaHF11DF->SetXTitle("#eta \b");
5545  GetaHF11DF->SetYTitle(" <A> \b");
5546  GetaHF11DF->SetZTitle("<A>_ETA - All \b");
5547  GetaHF11DF->SetMarkerColor(4);
5548  GetaHF11DF->SetLineColor(4);
5549  GetaHF11DF->SetMinimum(0.8); // GetaHF11DF->SetMaximum(1.000);
5550  GetaHF11DF->Draw("Error");
5551 
5553  cRBX1->Update();
5554  cRBX1->Print("RBX-HF-11Dplot.png");
5555  cRBX1->Clear();
5556  // clean-up
5557  if (GetaHF11D)
5558  delete GetaHF11D;
5559  if (GetaHF11D0)
5560  delete GetaHF11D0;
5561  if (GetaHF11DF)
5562  delete GetaHF11DF;
5563 
5564  //========================================================================================== 22 HF:: Ratio plots jeta = 0 - 21 jphi =0 - 17
5565  //======================================================================
5566  //======================================================================22.11.2018
5567  //======================================================================
5568  //======================================================================
5569 
5570  gStyle->SetOptStat(1110000);
5571  cout << " RBX HF Ratio plots *****" << endl;
5572  cRBX31->Clear();
5574  // gain stabilitY:
5575  // Rij = Aij / A1j , where i-over LSs, j-channels
5576  //
5577  // nx = maxbinsRBX; // # LS
5578  //
5579  double ccc0HF = 0.;
5580  cRBX31->Divide(3, 1);
5581  //================
5582  cRBX31->cd(1);
5583  // TH1F* Ghf5 = new TH1F("Ghf5","", nx, 1., nx+1.);
5584  TH1F *Ghf51 = new TH1F("Ghf51", "", nx, 1., nx + 1.);
5585  TH1F *Ghf50 = new TH1F("Ghf50", "", nx, 1., nx + 1.);
5586  TH1F *Ghf5 = (TH1F *)Ghf50->Clone("Ghf5");
5587  // j - etaphi index:
5588  for (int j = 1; j <= ny; j++) {
5589  ccc0HF = Ghf1->GetBinContent(1, j);
5590  // 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;} }
5591  if (ccc0HF <= 0.)
5592  for (int i = 1; i <= nx; i++) {
5593  double ccc2 = Ghf1->GetBinContent(i, j);
5594  if (ccc2 > 0.) {
5595  ccc0HF = ccc2;
5596  break;
5597  }
5598  }
5599  if (ccc0HF > 0.) {
5600  // i - # LSs:
5601  for (int i = 1; i <= nx; i++) {
5602  double ccc1 = Ghf1->GetBinContent(i, j);
5603  if (ccc1 > 0.) {
5604  double Rij = ccc1 / ccc0HF;
5605  // Ghf5 ->Fill( float(i), Rij);
5606  Ghf51->Fill(float(i), Rij);
5607  Ghf50->Fill(float(i), 1.);
5608  }
5609  }
5610  }
5611  }
5612  Ghf5->Divide(Ghf51, Ghf50, 1, 1, "B"); // average A
5613  for (int i = 1; i <= nx; i++) {
5614  Ghf5->SetBinError(i, 0.0001);
5615  }
5616  Ghf5->SetMarkerStyle(20);
5617  Ghf5->SetMarkerSize(0.4);
5618  Ghf5->GetYaxis()->SetLabelSize(0.04);
5619  Ghf5->SetMarkerColor(2);
5620  Ghf5->SetLineColor(0);
5621  Ghf5->SetXTitle(" iLS \b");
5622  Ghf5->SetYTitle(" <R> \b");
5623  Ghf5->SetTitle("<Ri> vs iLS \b");
5624  Ghf5->SetMinimum(0.); //Ghf5->SetMaximum(2.5);
5625  // gPad->SetLogy();
5626  gPad->SetGridy();
5627  gPad->SetGridx();
5628  Ghf5->SetStats(0);
5629  Ghf5->GetYaxis()->SetLabelSize(0.025);
5630  Ghf5->Draw("Error");
5631  //================
5632  cRBX31->cd(2);
5633  TH2F *Ghf60 = new TH2F("Ghf60", "", 22, -11., 11., 18, 0., 18.);
5634  TH2F *Ghf61 = new TH2F("Ghf61", "", 22, -11., 11., 18, 0., 18.);
5635  TH2F *Ghf6 = new TH2F("Ghf6", "", 22, -11., 11., 18, 0., 18.);
5636 
5637  TH2F *G20hf60 = new TH2F("G20hf60", "", 22, -11., 11., 18, 0., 18.);
5638  TH2F *G20hf61 = new TH2F("G20hf61", "", 22, -11., 11., 18, 0., 18.);
5639  TH2F *G20hf6 = new TH2F("G20hf6", "", 22, -11., 11., 18, 0., 18.);
5640  TH2F *G30hf60 = new TH2F("G30hf60", "", 22, -11., 11., 18, 0., 18.);
5641  TH2F *G30hf61 = new TH2F("G30hf61", "", 22, -11., 11., 18, 0., 18.);
5642  TH2F *G30hf6 = new TH2F("G30hf6", "", 22, -11., 11., 18, 0., 18.);
5643  TH2F *G40hf60 = new TH2F("G40hf60", "", 22, -11., 11., 18, 0., 18.);
5644  TH2F *G40hf61 = new TH2F("G40hf61", "", 22, -11., 11., 18, 0., 18.);
5645  TH2F *G40hf6 = new TH2F("G40hf6", "", 22, -11., 11., 18, 0., 18.);
5646  // j - etaphi index; i - # LSs;
5647  //
5648  // define mean and RMS:
5649  double sumjHF = 0.;
5650  int njHF = 0;
5651  double meanjHF = 0.;
5652  for (int j = 1; j <= ny; j++) {
5653  ccc0HF = Ghf1->GetBinContent(1, j);
5654  if (ccc0HF <= 0.)
5655  for (int i = 1; i <= nx; i++) {
5656  double ccc2 = Ghf1->GetBinContent(i, j);
5657  if (ccc2 > 0.) {
5658  ccc0HF = ccc2;
5659  break;
5660  }
5661  }
5662  if (ccc0HF > 0.) {
5663  for (int i = 1; i <= nx; i++) {
5664  double ccc1 = Ghf1->GetBinContent(i, j) / ccc0HF;
5665  if (ccc1 > 0.) {
5666  sumjHF += ccc1;
5667  njHF++;
5668  }
5669  }
5670  meanjHF = sumjHF / njHF;
5671  }
5672  } // j
5673 
5674  double ssumjHF = 0.;
5675  njHF = 0;
5676  double sigmajHF = 0.;
5677  for (int j = 1; j <= ny; j++) {
5678  ccc0HF = Ghf1->GetBinContent(1, j);
5679  if (ccc0HF <= 0.)
5680  for (int i = 1; i <= nx; i++) {
5681  double ccc2 = Ghf1->GetBinContent(i, j);
5682  if (ccc2 > 0.) {
5683  ccc0HF = ccc2;
5684  break;
5685  }
5686  }
5687  if (ccc0HF > 0.) {
5688  for (int i = 1; i <= nx; i++) {
5689  double ccc1 = Ghf1->GetBinContent(i, j) / ccc0HF;
5690  if (ccc1 > 0.) {
5691  ssumjHF += (ccc1 - meanjHF) * (ccc1 - meanjHF);
5692  njHF++;
5693  }
5694  }
5695  sigmajHF = sqrt(ssumjHF / njHF);
5696  }
5697  } // j
5698 
5699  double dif3rmsHFMIN = meanjHF - 3 * sigmajHF;
5700  if (dif3rmsHFMIN < 0.)
5701  dif3rmsHFMIN = 0.;
5702  double dif3rmsHFMAX = meanjHF + 3 * sigmajHF;
5703  cout << "22HF-2 meanjHF= " << meanjHF << " sigmajHF= " << sigmajHF << " dif3rmsHFMIN= " << dif3rmsHFMIN
5704  << " dif3rmsHFMAX= " << dif3rmsHFMAX << endl;
5705 
5706  double MAXdif3rmsHFMIN = dif3rmsHFMIN;
5707  double MINdif3rmsHFMAX = dif3rmsHFMAX;
5708  if (MAXdif3rmsHFMIN < 0.95)
5709  MAXdif3rmsHFMIN = 0.95;
5710  if (MINdif3rmsHFMAX > 1.05)
5711  MINdif3rmsHFMAX = 1.05;
5712  cout << "22HF-2 MAXdif3rmsHFMIN= " << MAXdif3rmsHFMIN << " MINdif3rmsHFMAX= " << MINdif3rmsHFMAX << endl;
5713  //
5714  for (int j = 1; j <= ny; j++) {
5715  ccc0HF = Ghf1->GetBinContent(1, j);
5716  if (ccc0HF <= 0.)
5717  for (int i = 1; i <= nx; i++) {
5718  double ccc2 = Ghf1->GetBinContent(i, j);
5719  if (ccc2 > 0.) {
5720  ccc0HF = ccc2;
5721  break;
5722  }
5723  }
5724  if (ccc0HF > 0.) {
5725  int jeta = (j - 1) / 18; // jeta = 0-21
5726  int jphi = (j - 1) - 18 * jeta; // jphi=0-17
5727  // i - # LSs:
5728  for (int i = 1; i <= nx; i++) {
5729  double ccc1 = Ghf1->GetBinContent(i, j);
5730  if (ccc1 > 0.) {
5731  double Rij = ccc1 / ccc0HF;
5732  if (Rij < MAXdif3rmsHFMIN || Rij > MINdif3rmsHFMAX) {
5733  Ghf61->Fill(jeta - 11, jphi, Rij);
5734  Ghf60->Fill(jeta - 11, jphi, 1.);
5735  }
5736  if (Rij < 0.8 || Rij > 1.2) {
5737  G20hf61->Fill(jeta - 11, jphi, Rij);
5738  G20hf60->Fill(jeta - 11, jphi, 1.);
5739  }
5740  if (Rij < 0.7 || Rij > 1.3) {
5741  G30hf61->Fill(jeta - 11, jphi, Rij);
5742  G30hf60->Fill(jeta - 11, jphi, 1.);
5743  }
5744  if (Rij < 0.6 || Rij > 1.4) {
5745  G40hf61->Fill(jeta - 11, jphi, Rij);
5746  G40hf60->Fill(jeta - 11, jphi, 1.);
5747  }
5748  } //if(ccc1>0.
5749  } // i
5750  } //if(ccc0HF>0
5751  } // j
5752  Ghf6->Divide(Ghf61, Ghf60, 1, 1, "B"); // average R
5753  G20hf6->Divide(G20hf61, G20hf60, 1, 1, "B"); // average R
5754  G30hf6->Divide(G30hf61, G30hf60, 1, 1, "B"); // average R
5755  G40hf6->Divide(G40hf61, G40hf60, 1, 1, "B"); // average R
5756  // Ghf6->SetLabelOffset (Float_t offset=0.005, Option_t *axis="X")//Set offset between axis and axis' labels
5757  // Ghf6->GetZaxis()->SetLabelOffset(-0.05);
5758  Ghf6->GetZaxis()->SetLabelSize(0.025);
5759 
5760  Ghf6->SetXTitle(" #eta \b");
5761  Ghf6->SetYTitle(" #phi \b");
5762  Ghf6->SetTitle(
5763  "<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);
5764  //gStyle->SetOptStat(kFALSE);
5765  Ghf6->SetStats(0);
5766  Ghf6->Draw("COLZ");
5767  //================
5768  cRBX31->cd(3);
5769  TH1F *Ghf7 = new TH1F("Ghf7", "", 120, 0.4, 1.6);
5770  // j - etaphi index:
5771  for (int j = 1; j <= ny; j++) {
5772  ccc0HF = Ghf1->GetBinContent(1, j);
5773  if (ccc0HF <= 0.)
5774  for (int i = 1; i <= nx; i++) {
5775  double ccc2 = Ghf1->GetBinContent(i, j);
5776  if (ccc2 > 0.) {
5777  ccc0HF = ccc2;
5778  break;
5779  }
5780  }
5781  if (ccc0HF > 0.) {
5782  // i - # LSs:
5783  for (int i = 1; i <= nx; i++) {
5784  double ccc1 = Ghf1->GetBinContent(i, j);
5785  if (ccc1 > 0.) {
5786  double Rij = ccc1 / ccc0HF;
5787  Ghf7->Fill(Rij);
5788  }
5789  }
5790  }
5791  }
5792  Ghf7->SetMarkerStyle(20);
5793  Ghf7->SetMarkerSize(0.4);
5794  Ghf7->GetYaxis()->SetLabelSize(0.04);
5795  Ghf7->SetMarkerColor(2);
5796  Ghf7->SetLineColor(0);
5797  Ghf7->SetYTitle(" N \b");
5798  Ghf7->SetXTitle(" Rij \b");
5799  Ghf7->SetTitle(" Rij \b");
5800  //Ghf7->SetMinimum(0.8);Ghf7->SetMaximum(500.);
5801  gPad->SetGridy();
5802  gPad->SetGridx(); // gPad->SetLogy();
5803  // Ghf7->SetStats(1110000);
5804  Ghf7->GetYaxis()->SetLabelSize(0.025);
5805  Ghf7->Draw("Error");
5806  Float_t ymaxHF = Ghf7->GetMaximum();
5807  cout << "22HF-3 ymaxHF= " << ymaxHF << " MAXdif3rmsHFMIN= " << MAXdif3rmsHFMIN
5808  << " MINdif3rmsHFMAX= " << MINdif3rmsHFMAX << endl;
5809  TLine *lineHF = new TLine(MAXdif3rmsHFMIN, 0., MAXdif3rmsHFMIN, ymaxHF);
5810  lineHF->SetLineColor(kBlue);
5811  lineHF->Draw();
5812  TLine *line1HF = new TLine(MINdif3rmsHFMAX, 0., MINdif3rmsHFMAX, ymaxHF);
5813  line1HF->SetLineColor(kBlue);
5814  line1HF->Draw();
5815  //================
5817  cRBX31->Update();
5818  cRBX31->Print("RBX-HF-3plots.png");
5819  cRBX31->Clear();
5820  // clean-up
5821  if (Ghf5)
5822  delete Ghf5;
5823  if (Ghf60)
5824  delete Ghf60;
5825  if (Ghf61)
5826  delete Ghf61;
5827  if (Ghf6)
5828  delete Ghf6;
5829  if (Ghf7)
5830  delete Ghf7;
5831 
5832  if (G20hf60)
5833  delete G20hf60;
5834  if (G20hf61)
5835  delete G20hf61;
5836  if (G30hf60)
5837  delete G30hf60;
5838  if (G30hf61)
5839  delete G30hf61;
5840  if (G40hf60)
5841  delete G40hf60;
5842  if (G40hf61)
5843  delete G40hf61;
5844 
5845  if (Ghf1)
5846  delete Ghf1;
5847  //========================================================================================== 22-1 HF:: Ratio plots jeta = 0 - 21 jphi =0 - 17
5848  //======================================================================
5849  //======================================================================28.11.2018
5850  //======================================================================
5851  //======================================================================
5852 
5853  gStyle->SetOptStat(1110000);
5854  cout << " RBX HF Ratio plotsmore *****" << endl;
5855  cRBX31->Clear();
5857  cRBX31->Divide(3, 1);
5858  //================
5859  cRBX31->cd(1);
5860  G20hf6->GetZaxis()->SetLabelSize(0.025);
5861  G20hf6->SetXTitle(" #eta \b");
5862  G20hf6->SetYTitle(" #phi \b");
5863  G20hf6->SetTitle("<Rj> for |1-<R>| > 0.20 \b");
5864  G20hf6->SetStats(0);
5865  G20hf6->Draw("COLZ");
5866  //================
5867  cRBX31->cd(2);
5868  G30hf6->GetZaxis()->SetLabelSize(0.025);
5869  G30hf6->SetXTitle(" #eta \b");
5870  G30hf6->SetYTitle(" #phi \b");
5871  G30hf6->SetTitle("<Rj> for |1-<R>| > 0.30 \b");
5872  G30hf6->SetStats(0);
5873  G30hf6->Draw("COLZ");
5874  //================
5875  cRBX31->cd(3);
5876  G40hf6->GetZaxis()->SetLabelSize(0.025);
5877  G40hf6->SetXTitle(" #eta \b");
5878  G40hf6->SetYTitle(" #phi \b");
5879  G40hf6->SetTitle("<Rj> for |1-<R>| > 0.40 \b");
5880  G40hf6->SetStats(0);
5881  G40hf6->Draw("COLZ");
5882  //================
5883 
5885  cRBX31->Update();
5886  cRBX31->Print("RBX-HF-3plotsmore.png");
5887  cRBX31->Clear();
5888 
5889  // clean-up
5890  if (G20hf6)
5891  delete G20hf6;
5892  if (G30hf6)
5893  delete G30hf6;
5894  if (G40hf6)
5895  delete G40hf6;
5896  gStyle->SetOptStat(0);
5898  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
5899  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
5900  cout << ">>>>>>>>>>>>>>>>>>>>>>>> " << endl;
5902 
5904 
5906  //=============================================================================== occupancyHB
5907  // For occupancy plots. Produces OccPlots_HBx.png (x=1)
5908  int mymaxbins = MaxLum;
5909  {
5910  cHB->Clear();
5911  cHB->Divide(2, 1);
5913  cHB->cd(1);
5914  TH2F *occhbm = (TH2F *)hfile->Get("h_RatioOccupancy_HBM");
5915  TH1F *uyhbm = new TH1F("uyhbm", "", mymaxbins, 1., mymaxbins + 1.);
5916  for (int i = 1; i <= occhbm->GetXaxis()->GetNbins(); i++) {
5917  double ccc1 = occhbm->GetBinContent(i);
5918  // if(ccc1>0.) cout<<" depth1_HB iLS = "<<i<<" <As> per LS= "<<ccc1<<endl;
5919  if (ccc1 > 0.)
5920  uyhbm->Fill(float(i), ccc1);
5921  }
5922  // gPad->SetLogy();
5923  uyhbm->SetMarkerStyle(20);
5924  uyhbm->SetMarkerSize(0.6);
5925  uyhbm->GetYaxis()->SetLabelSize(0.04);
5926  uyhbm->SetXTitle("min/av occupancy - HBM \b");
5927  uyhbm->SetMarkerColor(2);
5928  uyhbm->SetLineColor(0);
5929  uyhbm->SetMaximum(1.0);
5930  uyhbm->SetMinimum(0.2);
5931  gPad->SetGridy();
5932  uyhbm->Draw("Error");
5934  cHB->cd(2);
5935  TH2F *occhbp = (TH2F *)hfile->Get("h_RatioOccupancy_HBP");
5936  TH1F *uyhbp = new TH1F("uyhbp", "", mymaxbins, 1., mymaxbins + 1.);
5937  for (int i = 1; i <= occhbp->GetXaxis()->GetNbins(); i++) {
5938  double ccc1 = occhbp->GetBinContent(i);
5939  // if(ccc1>0.) cout<<" depth1_HB iLS = "<<i<<" <As> per LS= "<<ccc1<<endl;
5940  if (ccc1 > 0.)
5941  uyhbp->Fill(float(i), ccc1);
5942  }
5943  // gPad->SetLogy();
5944  uyhbp->SetMarkerStyle(20);
5945  uyhbp->SetMarkerSize(0.6);
5946  uyhbp->GetYaxis()->SetLabelSize(0.04);
5947  uyhbp->SetXTitle("min/av occupancy - HBP \b");
5948  uyhbp->SetMarkerColor(2);
5949  uyhbp->SetLineColor(0);
5950  uyhbp->SetMaximum(1.0);
5951  uyhbp->SetMinimum(0.2);
5952  gPad->SetGridy();
5953  uyhbp->Draw("Error");
5955 
5957  cHB->Update();
5958  cHB->Print(Form("OccPlots_HB.png"));
5959  cHB->Clear();
5960 
5961  // clean-up
5962  if (occhbm)
5963  delete occhbm;
5964  if (uyhbm)
5965  delete uyhbm;
5966  if (occhbp)
5967  delete occhbp;
5968  if (uyhbp)
5969  delete uyhbp;
5970  }
5971  //=============================================================================== occupancyHE
5972  // For occupancy plots. Produces OccPlots_HEx.png (x=1)
5973  {
5974  cHB->Clear();
5975  cHB->Divide(2, 1);
5977  cHB->cd(1);
5978  TH2F *occhem = (TH2F *)hfile->Get("h_RatioOccupancy_HEM");
5979  TH1F *uyhem = new TH1F("uyhem", "", mymaxbins, 1., mymaxbins + 1.);
5980  for (int i = 1; i <= occhem->GetXaxis()->GetNbins(); i++) {
5981  double ccc1 = occhem->GetBinContent(i);
5982  // if(ccc1>0.) cout<<" depth1_HE iLS = "<<i<<" <As> per LS= "<<ccc1<<endl;
5983  if (ccc1 > 0.)
5984  uyhem->Fill(float(i), ccc1);
5985  }
5986  // gPad->SetLogy();
5987  uyhem->SetMarkerStyle(20);
5988  uyhem->SetMarkerSize(0.6);
5989  uyhem->GetYaxis()->SetLabelSize(0.04);
5990  uyhem->SetXTitle("min/av occupancy - HEM \b");
5991  uyhem->SetMarkerColor(2);
5992  uyhem->SetLineColor(0);
5993  uyhem->SetMaximum(1.0);
5994  uyhem->SetMinimum(0.2);
5995  gPad->SetGridy();
5996  uyhem->Draw("Error");
5998  cHB->cd(2);
5999  TH2F *occhep = (TH2F *)hfile->Get("h_RatioOccupancy_HEP");
6000  TH1F *uyhep = new TH1F("uyhep", "", mymaxbins, 1., mymaxbins + 1.);
6001  for (int i = 1; i <= occhep->GetXaxis()->GetNbins(); i++) {
6002  double ccc1 = occhep->GetBinContent(i);
6003  // if(ccc1>0.) cout<<" depth1_HE iLS = "<<i<<" <As> per LS= "<<ccc1<<endl;
6004  if (ccc1 > 0.)
6005  uyhep->Fill(float(i), ccc1);
6006  }
6007  // gPad->SetLogy();
6008  uyhep->SetMarkerStyle(20);
6009  uyhep->SetMarkerSize(0.6);
6010  uyhep->GetYaxis()->SetLabelSize(0.04);
6011  uyhep->SetXTitle("min/av occupancy - HEP \b");
6012  uyhep->SetMarkerColor(2);
6013  uyhep->SetLineColor(0);
6014  uyhep->SetMaximum(1.0);
6015  uyhep->SetMinimum(0.2);
6016  gPad->SetGridy();
6017  uyhep->Draw("Error");
6019 
6021  cHB->Update();
6022  cHB->Print(Form("OccPlots_HE.png"));
6023  cHB->Clear();
6024 
6025  // clean-up
6026  if (occhem)
6027  delete occhem;
6028  if (uyhem)
6029  delete uyhem;
6030  if (occhep)
6031  delete occhep;
6032  if (uyhep)
6033  delete uyhep;
6034  }
6035  //=============================================================================== occupancyHO
6036  // For occupancy plots. Produces OccPlots_HOx.png (x=1)
6037  {
6038  cHB->Clear();
6039  cHB->Divide(2, 1);
6041  cHB->cd(1);
6042  TH2F *occhom = (TH2F *)hfile->Get("h_RatioOccupancy_HOM");
6043  TH1F *uyhom = new TH1F("uyhom", "", mymaxbins, 1., mymaxbins + 1.);
6044  for (int i = 1; i <= occhom->GetXaxis()->GetNbins(); i++) {
6045  double ccc1 = occhom->GetBinContent(i);
6046  // if(ccc1>0.) cout<<" depth1_HO iLS = "<<i<<" <As> per LS= "<<ccc1<<endl;
6047  if (ccc1 > 0.)
6048  uyhom->Fill(float(i), ccc1);
6049  }
6050  // gPad->SetLogy();
6051  uyhom->SetMarkerStyle(20);
6052  uyhom->SetMarkerSize(0.6);
6053  uyhom->GetYaxis()->SetLabelSize(0.04);
6054  uyhom->SetXTitle("min/av occupancy - HOM \b");
6055  uyhom->SetMarkerColor(2);
6056  uyhom->SetLineColor(0);
6057  uyhom->SetMaximum(1.0);
6058  uyhom->SetMinimum(0.2);
6059  gPad->SetGridy();
6060  uyhom->Draw("Error");
6062  cHB->cd(2);
6063  TH2F *occhop = (TH2F *)hfile->Get("h_RatioOccupancy_HOP");
6064  TH1F *uyhop = new TH1F("uyhop", "", mymaxbins, 1., mymaxbins + 1.);
6065  for (int i = 1; i <= occhop->GetXaxis()->GetNbins(); i++) {
6066  double ccc1 = occhop->GetBinContent(i);
6067  // if(ccc1>0.) cout<<" depth1_HO iLS = "<<i<<" <As> per LS= "<<ccc1<<endl;
6068  if (ccc1 > 0.)
6069  uyhop->Fill(float(i), ccc1);
6070  }
6071  // gPad->SetLogy();
6072  uyhop->SetMarkerStyle(20);
6073  uyhop->SetMarkerSize(0.6);
6074  uyhop->GetYaxis()->SetLabelSize(0.04);
6075  uyhop->SetXTitle("min/av occupancy - HOP \b");
6076  uyhop->SetMarkerColor(2);
6077  uyhop->SetLineColor(0);
6078  uyhop->SetMaximum(1.0);
6079  uyhop->SetMinimum(0.2);
6080  gPad->SetGridy();
6081  uyhop->Draw("Error");
6083 
6085  cHB->Update();
6086  cHB->Print(Form("OccPlots_HO.png"));
6087  cHB->Clear();
6088 
6089  // clean-up
6090  if (occhom)
6091  delete occhom;
6092  if (uyhom)
6093  delete uyhom;
6094  if (occhop)
6095  delete occhop;
6096  if (uyhop)
6097  delete uyhop;
6098  }
6099  //=============================================================================== occupancyHF
6100  // For occupancy plots. Produces OccPlots_HFx.png (x=1)
6101  {
6102  cHB->Clear();
6103  cHB->Divide(2, 1);
6105  cHB->cd(1);
6106  TH2F *occhfm = (TH2F *)hfile->Get("h_RatioOccupancy_HFM");
6107  TH1F *uyhfm = new TH1F("uyhfm", "", mymaxbins, 1., mymaxbins + 1.);
6108  for (int i = 1; i <= occhfm->GetXaxis()->GetNbins(); i++) {
6109  double ccc1 = occhfm->GetBinContent(i);
6110  // if(ccc1>0.) cout<<" depth1_HF iLS = "<<i<<" <As> per LS= "<<ccc1<<endl;
6111  if (ccc1 > 0.)
6112  uyhfm->Fill(float(i), ccc1);
6113  }
6114  // gPad->SetLogy();
6115  uyhfm->SetMarkerStyle(20);
6116  uyhfm->SetMarkerSize(0.6);
6117  uyhfm->GetYaxis()->SetLabelSize(0.04);
6118  uyhfm->SetXTitle("min/av occupancy - HFM \b");
6119  uyhfm->SetMarkerColor(2);
6120  uyhfm->SetLineColor(0);
6121  uyhfm->SetMaximum(1.0);
6122  uyhfm->SetMinimum(0.2);
6123  gPad->SetGridy();
6124  uyhfm->Draw("Error");
6126  cHB->cd(2);
6127  TH2F *occhfp = (TH2F *)hfile->Get("h_RatioOccupancy_HFP");
6128  TH1F *uyhfp = new TH1F("uyhfp", "", mymaxbins, 1., mymaxbins + 1.);
6129  for (int i = 1; i <= occhfp->GetXaxis()->GetNbins(); i++) {
6130  double ccc1 = occhfp->GetBinContent(i);
6131  // if(ccc1>0.) cout<<" depth1_HF iLS = "<<i<<" <As> per LS= "<<ccc1<<endl;
6132  if (ccc1 > 0.)
6133  uyhfp->Fill(float(i), ccc1);
6134  }
6135  // gPad->SetLogy();
6136  uyhfp->SetMarkerStyle(20);
6137  uyhfp->SetMarkerSize(0.6);
6138  uyhfp->GetYaxis()->SetLabelSize(0.04);
6139  uyhfp->SetXTitle("min/av occupancy - HFP \b");
6140  uyhfp->SetMarkerColor(2);
6141  uyhfp->SetLineColor(0);
6142  uyhfp->SetMaximum(1.0);
6143  uyhfp->SetMinimum(0.2);
6144  gPad->SetGridy();
6145  uyhfp->Draw("Error");
6147 
6149  cHB->Update();
6150  cHB->Print(Form("OccPlots_HF.png"));
6151  cHB->Clear();
6152 
6153  // clean-up
6154  if (occhfm)
6155  delete occhfm;
6156  if (uyhfm)
6157  delete uyhfm;
6158  if (occhfp)
6159  delete occhfp;
6160  if (uyhfp)
6161  delete uyhfp;
6162  }
6163  std::cout << "************>>> occupancy plots done" << std::endl;
6164 
6169  //************************* ***** Signal *****
6170  cout << ">>>>>>>>>>>>>>>>>>>>>>>>start Summed Amplitude Plots " << endl;
6171  int maxbins = MaxLum;
6172  cout << ">>>> maxbins = " << maxbins << endl;
6173  TH1F *SummedAmplitudeHisto[4]; // 1d histogramm for subdet
6174  SummedAmplitudeHisto[0] = (TH1F *)hfile->Get("h_averSIGNALsumamplitude_HB");
6175  SummedAmplitudeHisto[1] = (TH1F *)hfile->Get("h_averSIGNALsumamplitude_HE");
6176  SummedAmplitudeHisto[2] = (TH1F *)hfile->Get("h_averSIGNALsumamplitude_HO");
6177  SummedAmplitudeHisto[3] = (TH1F *)hfile->Get("h_averSIGNALsumamplitude_HF");
6178  TH1F *SummedAmplitudeOccupancyHisto[4]; // 1d histogramm for subdet
6179  SummedAmplitudeOccupancyHisto[0] = (TH1F *)hfile->Get("h_averSIGNALoccupancy_HB");
6180  SummedAmplitudeOccupancyHisto[1] = (TH1F *)hfile->Get("h_averSIGNALoccupancy_HE");
6181  SummedAmplitudeOccupancyHisto[2] = (TH1F *)hfile->Get("h_averSIGNALoccupancy_HO");
6182  SummedAmplitudeOccupancyHisto[3] = (TH1F *)hfile->Get("h_averSIGNALoccupancy_HF");
6183  for (int sub = 0; sub < 4; sub++) {
6184  cHE->Clear();
6185  cHE->Divide(2, 1);
6186  cHE->cd(1);
6187  TH1F *kslpq = new TH1F("kslpq", "", maxbins, 1., maxbins + 1.);
6188  // cout<<">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> sub = "<< sub <<endl;
6189  for (int i = 1; i <= kslpq->GetXaxis()->GetNbins(); i++) {
6190  double ccc1 = 0.;
6191  if (SummedAmplitudeHisto[sub])
6192  ccc1 = SummedAmplitudeHisto[sub]->GetBinContent(i);
6193  // if(ccc1>0.) cout<<" iLS = "<<i<<" LS= "<<ccc1<<endl;
6194  if (ccc1 > 0.)
6195  kslpq->Fill(float(i), ccc1);
6196  }
6197  // gPad->SetLogy();
6198  kslpq->SetMarkerStyle(20);
6199  kslpq->SetMarkerSize(0.8);
6200  kslpq->GetYaxis()->SetLabelSize(0.04);
6201  kslpq->SetXTitle("SumA of channels w/ signal per LS \b");
6202  kslpq->SetMarkerColor(2);
6203  kslpq->SetLineColor(0);
6204  // kslpq->SetMinimum(0.8);
6205  gPad->SetGridx();
6206  kslpq->Draw("Error");
6208  cHE->cd(2);
6209  TH1F *pqmks = new TH1F("pqmks", "", maxbins, 1., maxbins + 1.);
6210  for (int i = 1; i <= pqmks->GetXaxis()->GetNbins(); i++) {
6211  double ccc1 = 0.;
6212  if (SummedAmplitudeOccupancyHisto[sub])
6213  ccc1 = SummedAmplitudeOccupancyHisto[sub]->GetBinContent(i);
6214  // if(ccc1>0.) cout<<" iLS = "<<i<<" LS= "<<ccc1<<endl;
6215  if (ccc1 > 0.)
6216  pqmks->Fill(float(i), ccc1);
6217  }
6218  // gPad->SetLogy();
6219  pqmks->SetMarkerStyle(20);
6220  pqmks->SetMarkerSize(0.8);
6221  pqmks->GetYaxis()->SetLabelSize(0.04);
6222  pqmks->SetXTitle("Occupancy of channels w/ signal per LS \b");
6223  pqmks->SetMarkerColor(4);
6224  pqmks->SetLineColor(0);
6225  // pqmks->SetMinimum(0.8);
6226  gPad->SetGridx();
6227  pqmks->Draw("Error");
6228  cHE->Update();
6229  if (sub == 0)
6230  cHE->Print("SummedAmplitudesSignal_HB.png");
6231  if (sub == 1)
6232  cHE->Print("SummedAmplitudesSignal_HE.png");
6233  if (sub == 2)
6234  cHE->Print("SummedAmplitudesSignal_HO.png");
6235  if (sub == 3)
6236  cHE->Print("SummedAmplitudesSignal_HF.png");
6237  cHE->Clear();
6238  if (kslpq)
6239  delete kslpq;
6240  if (pqmks)
6241  delete pqmks;
6242  } //for
6243  // clean-up
6244  //for (unsigned int i=0; i<4; i++) {delete SummedAmplitudeHisto[i];delete SummedAmplitudeOccupancyHisto[i];}
6245 
6248  //************************* ***** NoSignal *****
6249  cout << ">>>>>>>>>>>>>>>>>>>>>>>>start Summed Amplitude Plots NoSignal " << endl;
6250  TH1F *NoSignalSummedAmplitudeHisto[4]; // 1d histogramm for subdet
6251  NoSignalSummedAmplitudeHisto[0] = (TH1F *)hfile->Get("h_averNOSIGNALsumamplitude_HB");
6252  NoSignalSummedAmplitudeHisto[1] = (TH1F *)hfile->Get("h_averNOSIGNALsumamplitude_HE");
6253  NoSignalSummedAmplitudeHisto[2] = (TH1F *)hfile->Get("h_averNOSIGNALsumamplitude_HO");
6254  NoSignalSummedAmplitudeHisto[3] = (TH1F *)hfile->Get("h_averNOSIGNALsumamplitude_HF");
6255  TH1F *NoSignalSummedAmplitudeOccupancyHisto[4]; // 1d histogramm for subdet
6256  NoSignalSummedAmplitudeOccupancyHisto[0] = (TH1F *)hfile->Get("h_averNOSIGNALoccupancy_HB");
6257  NoSignalSummedAmplitudeOccupancyHisto[1] = (TH1F *)hfile->Get("h_averNOSIGNALoccupancy_HE");
6258  NoSignalSummedAmplitudeOccupancyHisto[2] = (TH1F *)hfile->Get("h_averNOSIGNALoccupancy_HO");
6259  NoSignalSummedAmplitudeOccupancyHisto[3] = (TH1F *)hfile->Get("h_averNOSIGNALoccupancy_HF");
6260  for (int sub = 0; sub < 4; sub++) {
6261  cHE->Clear();
6262  cHE->Divide(2, 1);
6263 
6264  cHE->cd(1);
6265  TH1F *kslpq = new TH1F("kslpq", "", maxbins, 1., maxbins + 1.);
6266  for (int i = 1; i <= kslpq->GetXaxis()->GetNbins(); i++) {
6267  double ccc1 = 0.;
6268  if (NoSignalSummedAmplitudeHisto[sub])
6269  ccc1 = NoSignalSummedAmplitudeHisto[sub]->GetBinContent(i);
6270  // if(ccc1>0.) cout<<" iLS = "<<i<<" LS= "<<ccc1<<endl;
6271  if (ccc1 > 0.)
6272  kslpq->Fill(float(i), ccc1);
6273  }
6274  // gPad->SetLogy();
6275  kslpq->SetMarkerStyle(20);
6276  kslpq->SetMarkerSize(0.8);
6277  kslpq->GetYaxis()->SetLabelSize(0.04);
6278  kslpq->SetXTitle("SumA of channels w/o signal per LS \b");
6279  kslpq->SetMarkerColor(2);
6280  kslpq->SetLineColor(0);
6281  if (sub == 0) {
6282  kslpq->SetMaximum(20000.);
6283  kslpq->SetMinimum(5000.);
6284  } else if (sub == 1) {
6285  kslpq->SetMaximum(40000.);
6286  kslpq->SetMinimum(0.);
6287  } else if (sub == 2) {
6288  kslpq->SetMaximum(10000.);
6289  kslpq->SetMinimum(15000.);
6290  } else if (sub == 3) {
6291  kslpq->SetMaximum(100000.);
6292  kslpq->SetMinimum(0.);
6293  }
6294  gPad->SetGridx();
6295  kslpq->Draw("Error");
6297  cHE->cd(2);
6298  TH1F *pqmks = new TH1F("pqmks", "", maxbins, 1., maxbins + 1.);
6299  for (int i = 1; i <= pqmks->GetXaxis()->GetNbins(); i++) {
6300  double ccc1 = 0.;
6301  if (NoSignalSummedAmplitudeOccupancyHisto[sub])
6302  ccc1 = NoSignalSummedAmplitudeOccupancyHisto[sub]->GetBinContent(i);
6303  // if(ccc1>0.) cout<<" iLS = "<<i<<" LS= "<<ccc1<<endl;
6304  if (ccc1 > 0.)
6305  pqmks->Fill(float(i), ccc1);
6306  }
6307  // gPad->SetLogy();
6308  pqmks->SetMarkerStyle(20);
6309  pqmks->SetMarkerSize(0.8);
6310  pqmks->GetYaxis()->SetLabelSize(0.04);
6311  pqmks->SetXTitle("Occupancy of channels w/o signal per LS \b");
6312  pqmks->SetMarkerColor(4);
6313  pqmks->SetLineColor(0);
6314  if (sub == 0) {
6315  pqmks->SetMaximum(600.);
6316  pqmks->SetMinimum(200.);
6317  } else if (sub == 1) {
6318  pqmks->SetMaximum(910.);
6319  pqmks->SetMinimum(10.);
6320  } else if (sub == 2) {
6321  pqmks->SetMaximum(200.);
6322  pqmks->SetMinimum(50.);
6323  } else if (sub == 3) {
6324  pqmks->SetMaximum(866.);
6325  pqmks->SetMinimum(856.);
6326  }
6327  gPad->SetGridx();
6328  pqmks->Draw("Error");
6329  cHE->Update();
6330  if (sub == 0)
6331  cHE->Print("NoSignalSummedAmplitudes_HB.png");
6332  if (sub == 1)
6333  cHE->Print("NoSignalSummedAmplitudes_HE.png");
6334  if (sub == 2)
6335  cHE->Print("NoSignalSummedAmplitudes_HO.png");
6336  if (sub == 3)
6337  cHE->Print("NoSignalSummedAmplitudes_HF.png");
6338  cHE->Clear();
6339  if (kslpq)
6340  delete kslpq;
6341  if (pqmks)
6342  delete pqmks;
6343  } //for
6344  // clean-up
6345  //for (unsigned int i=0; i<4; i++) {delete NoSignalSummedAmplitudeHisto[i];delete NoSignalSummedAmplitudeOccupancyHisto[i];}
6347 
6350  //************************* ***** MaxxValues *****
6351  cout << ">>>>>>>>>>>>>>>>>>>>>>>>start Summed Amplitude Plots Maxx " << endl;
6352  TH1F *MaxxSummedAmplitudeHisto[4]; // 1d histogramm for subdet
6353  MaxxSummedAmplitudeHisto[0] = (TH1F *)hfile->Get("h_maxxSUMAmpl_HB");
6354  MaxxSummedAmplitudeHisto[1] = (TH1F *)hfile->Get("h_maxxSUMAmpl_HE");
6355  MaxxSummedAmplitudeHisto[2] = (TH1F *)hfile->Get("h_maxxSUMAmpl_HO");
6356  MaxxSummedAmplitudeHisto[3] = (TH1F *)hfile->Get("h_maxxSUMAmpl_HF");
6357  TH1F *MaxxSummedAmplitudeOccupancyHisto[4]; // 1d histogramm for subdet
6358  MaxxSummedAmplitudeOccupancyHisto[0] = (TH1F *)hfile->Get("h_maxxOCCUP_HB");
6359  MaxxSummedAmplitudeOccupancyHisto[1] = (TH1F *)hfile->Get("h_maxxOCCUP_HE");
6360  MaxxSummedAmplitudeOccupancyHisto[2] = (TH1F *)hfile->Get("h_maxxOCCUP_HO");
6361  MaxxSummedAmplitudeOccupancyHisto[3] = (TH1F *)hfile->Get("h_maxxOCCUP_HF");
6362  TH1F *SAmplitudeHisto[4]; // 1d histogramm for subdet
6363  SAmplitudeHisto[0] = (TH1F *)hfile->Get("h_eventamplitude_HB");
6364  SAmplitudeHisto[1] = (TH1F *)hfile->Get("h_eventamplitude_HE");
6365  SAmplitudeHisto[2] = (TH1F *)hfile->Get("h_eventamplitude_HO");
6366  SAmplitudeHisto[3] = (TH1F *)hfile->Get("h_eventamplitude_HF");
6367  TH1F *OccupancyHisto[4]; // 1d histogramm for subdet
6368  OccupancyHisto[0] = (TH1F *)hfile->Get("h_eventoccupancy_HB");
6369  OccupancyHisto[1] = (TH1F *)hfile->Get("h_eventoccupancy_HE");
6370  OccupancyHisto[2] = (TH1F *)hfile->Get("h_eventoccupancy_HO");
6371  OccupancyHisto[3] = (TH1F *)hfile->Get("h_eventoccupancy_HF");
6372 
6373  int countamplmaxHB = 0;
6374  int countamplmaxHE = 0;
6375  int countamplmaxHO = 0;
6376  int countamplmaxHF = 0;
6377  int countoccumaxHB = 0;
6378  int countoccumaxHE = 0;
6379  int countoccumaxHO = 0;
6380  int countoccumaxHF = 0;
6381  unsigned long int countamplHB = 0;
6382  unsigned long int countamplHE = 0;
6383  unsigned long int countamplHO = 0;
6384  unsigned long int countamplHF = 0;
6385  unsigned long int countoccuHB = 0;
6386  unsigned long int countoccuHE = 0;
6387  unsigned long int countoccuHO = 0;
6388  unsigned long int countoccuHF = 0;
6389  gStyle->SetOptStat(110000);
6390  for (int sub = 0; sub < 4; sub++) {
6391  cFour->Clear();
6392  cFour->Divide(2, 2);
6393 
6394  cFour->cd(1);
6395  TH1F *lpqxc = new TH1F("lpqxc", "", maxbins, 1., maxbins + 1.);
6396  for (int i = 1; i <= lpqxc->GetXaxis()->GetNbins(); i++) {
6397  double ccc1 = 0.;
6398  if (MaxxSummedAmplitudeHisto[sub])
6399  ccc1 = MaxxSummedAmplitudeHisto[sub]->GetBinContent(i);
6400  // if(ccc1>0.) cout<<"111111111111111111111111111 iLS = "<<i<<" LS= "<<ccc1<<endl;
6401  if (ccc1 > 0.)
6402  lpqxc->Fill(float(i), ccc1);
6403  if (sub == 0 && ccc1 > 60000.)
6404  countamplmaxHB++;
6405  if (sub == 1 && ccc1 > 60000.)
6406  countamplmaxHE++;
6407  if (sub == 2 && ccc1 > 150000.)
6408  countamplmaxHO++;
6409  if (sub == 3 && ccc1 > 22000.)
6410  countamplmaxHF++;
6411  }
6412  // gPad->SetLogy();
6413  lpqxc->SetMarkerStyle(20);
6414  lpqxc->SetMarkerSize(0.8);
6415  // lpqxc->GetYaxis()->SetLabelSize(0.08);
6416  if (sub == 0)
6417  lpqxc->SetXTitle("HB: max SA over LS-events per LS \b");
6418  if (sub == 1)
6419  lpqxc->SetXTitle("HE: max SA over LS-events per LS \b");
6420  if (sub == 2)
6421  lpqxc->SetXTitle("HO: max SA over LS-events per LS \b");
6422  if (sub == 3)
6423  lpqxc->SetXTitle("HF: max SA over LS-events per LS \b");
6424  lpqxc->SetMarkerColor(2);
6425  lpqxc->SetLineColor(0);
6426  gPad->SetGridx();
6427  lpqxc->Draw("Error");
6428 
6430  cFour->cd(2);
6431  TH1F *hpzlm = new TH1F("hpzlm", "", maxbins, 1., maxbins + 1.);
6432  for (int i = 1; i <= hpzlm->GetXaxis()->GetNbins(); i++) {
6433  double ccc1 = 0.;
6434  if (MaxxSummedAmplitudeOccupancyHisto[sub])
6435  ccc1 = MaxxSummedAmplitudeOccupancyHisto[sub]->GetBinContent(i);
6436  // if(ccc1>0.) cout<<"2222222222222222222222222 iLS = "<<i<<" LS= "<<ccc1<<endl;
6437  if (ccc1 > 0.)
6438  hpzlm->Fill(float(i), ccc1);
6439  if (sub == 0 && ccc1 > 2000.)
6440  countoccumaxHB++;
6441  if (sub == 1 && ccc1 > 1200.)
6442  countoccumaxHE++;
6443  if (sub == 2 && ccc1 > 2000.)
6444  countoccumaxHO++;
6445  if (sub == 3 && ccc1 > 860.)
6446  countoccumaxHF++;
6447  }
6448  // gPad->SetLogy();
6449  hpzlm->SetMarkerStyle(20);
6450  hpzlm->SetMarkerSize(0.8);
6451  // hpzlm->GetYaxis()->SetLabelSize(0.08);
6452  if (sub == 0)
6453  hpzlm->SetXTitle("HB: max Occupancy over LS-events per LS \b");
6454  if (sub == 1)
6455  hpzlm->SetXTitle("HE: max Occupancy over LS-events per LS \b");
6456  if (sub == 2)
6457  hpzlm->SetXTitle("HO: max Occupancy over LS-events per LS \b");
6458  if (sub == 3)
6459  hpzlm->SetXTitle("HF: max Occupancy over LS-events per LS \b");
6460  hpzlm->SetMarkerColor(4);
6461  hpzlm->SetLineColor(0);
6462  gPad->SetGridx();
6463  if (sub == 3) {
6464  hpzlm->SetMaximum(866.);
6465  hpzlm->SetMinimum(856.);
6466  }
6467  hpzlm->Draw("Error");
6468 
6470  cFour->cd(3);
6471  gPad->SetLogy();
6472  if (SAmplitudeHisto[sub]) {
6473  for (int i = 1; i <= SAmplitudeHisto[sub]->GetXaxis()->GetNbins(); i++) {
6474  // if(sub==0 && i * 800> 60000.) {
6475  // cout<<">=>=>>=> countamplHB= "<<countamplHB<<" content = "<<SAmplitudeHisto[sub]->GetBinContent(i)<<" sub= "<<sub<<" i= "<<i<< endl;
6476  // countamplHB+=SAmplitudeHisto[sub]->GetBinContent(i);
6477  // }
6478  if (sub == 0 && i * 800 > 60000.)
6479  countamplHB += SAmplitudeHisto[sub]->GetBinContent(i);
6480  if (sub == 1 && i * 1000 > 60000.)
6481  countamplHE += SAmplitudeHisto[sub]->GetBinContent(i);
6482  if (sub == 2 && i * 2500 > 150000.)
6483  countamplHO += SAmplitudeHisto[sub]->GetBinContent(i);
6484  if (sub == 3 && i * 1400 > 22000.)
6485  countamplHF += SAmplitudeHisto[sub]->GetBinContent(i);
6486  }
6487  SAmplitudeHisto[sub]->SetMarkerStyle(20);
6488  SAmplitudeHisto[sub]->SetMarkerSize(0.8);
6489  if (sub == 0)
6490  SAmplitudeHisto[sub]->SetTitle("HB event Amplitude\b");
6491  if (sub == 1)
6492  SAmplitudeHisto[sub]->SetTitle("HE event Amplitude\b");
6493  if (sub == 2)
6494  SAmplitudeHisto[sub]->SetTitle("HO event Amplitude\b");
6495  if (sub == 3)
6496  SAmplitudeHisto[sub]->SetTitle("HF event Amplitude\b");
6497  // SAmplitudeHisto[sub]->GetYaxis()->SetLabelSize(0.08);
6498  SAmplitudeHisto[sub]->SetXTitle("event amplitude \b");
6499  SAmplitudeHisto[sub]->SetMarkerColor(2);
6500  SAmplitudeHisto[sub]->SetLineColor(2);
6501  SAmplitudeHisto[sub]->Draw("");
6502  }
6504  cFour->cd(4);
6505  gPad->SetLogy();
6506  if (OccupancyHisto[sub]) {
6507  for (int i = 1; i <= OccupancyHisto[sub]->GetXaxis()->GetNbins(); i++) {
6508  if (sub == 0 && i * 30 > 2000.)
6509  countoccuHB += OccupancyHisto[sub]->GetBinContent(i);
6510  if (sub == 1 && i * 20 > 1200.)
6511  countoccuHE += OccupancyHisto[sub]->GetBinContent(i);
6512  if (sub == 2 && i * 25 > 2000.)
6513  countoccuHO += OccupancyHisto[sub]->GetBinContent(i);
6514  if (sub == 3 && i * 10 > 860.)
6515  countoccuHF += OccupancyHisto[sub]->GetBinContent(i);
6516  }
6517  OccupancyHisto[sub]->SetMarkerStyle(20);
6518  OccupancyHisto[sub]->SetMarkerSize(0.8);
6519  if (sub == 0)
6520  OccupancyHisto[sub]->SetTitle("HB event Occupancy\b");
6521  if (sub == 1)
6522  OccupancyHisto[sub]->SetTitle("HE event Occupancy\b");
6523  if (sub == 2)
6524  OccupancyHisto[sub]->SetTitle("HO event Occupancy\b");
6525  if (sub == 3)
6526  OccupancyHisto[sub]->SetTitle("HF event Occupancy\b");
6527  // OccupancyHisto[sub]->GetYaxis()->SetLabelSize(0.08);
6528  OccupancyHisto[sub]->SetXTitle("event occupancy \b");
6529  OccupancyHisto[sub]->SetMarkerColor(4);
6530  OccupancyHisto[sub]->SetLineColor(4);
6531  OccupancyHisto[sub]->Draw("");
6532  }
6533 
6534  cFour->Update();
6535  if (sub == 0)
6536  cFour->Print("MaxxSummedAmplitudes_HB.png");
6537  if (sub == 1)
6538  cFour->Print("MaxxSummedAmplitudes_HE.png");
6539  if (sub == 2)
6540  cFour->Print("MaxxSummedAmplitudes_HO.png");
6541  if (sub == 3)
6542  cFour->Print("MaxxSummedAmplitudes_HF.png");
6543  cFour->Clear();
6544  if (lpqxc)
6545  delete lpqxc;
6546  if (hpzlm)
6547  delete hpzlm;
6548  } //for
6549  gStyle->SetOptStat(0);
6551  cout << ">=>=>>=> countamplmaxHB= " << countamplmaxHB << " countamplmaxHE= " << countamplmaxHE
6552  << " countamplmaxHO= " << countamplmaxHO << " countamplmaxHF= " << countamplmaxHF << endl;
6553  cout << ">=>=>>=> countoccumaxHB= " << countoccumaxHB << " countoccumaxHE= " << countoccumaxHE
6554  << " countoccumaxHO= " << countoccumaxHO << " countoccumaxHF= " << countoccumaxHF << endl;
6555  cout << ">=>=>>=> countamplHB= " << countamplHB << " countamplHE= " << countamplHE << " countamplHO= " << countamplHO
6556  << " countamplHF= " << countamplHF << endl;
6557  cout << ">=>=>>=> countoccuHB= " << countoccuHB << " countoccuHE= " << countoccuHE << " countoccuHO= " << countoccuHO
6558  << " countoccuHF= " << countoccuHF << endl;
6559 
6562  //************************* ***** channelsummedA over depths *****
6563  cout << ">>>>>>>>>>>>>>>>>>>>>>>>channelsummedA over depths " << endl;
6564  TH1F *ChannelDepthsummedAmplitudesPlots[4]; // 1d histogramm for subdet
6565  ChannelDepthsummedAmplitudesPlots[0] = (TH1F *)hfile->Get("h_sumamplitudechannel_HB");
6566  ChannelDepthsummedAmplitudesPlots[1] = (TH1F *)hfile->Get("h_sumamplitudechannel_HE");
6567  ChannelDepthsummedAmplitudesPlots[2] = (TH1F *)hfile->Get("h_sumamplitudechannel_HO");
6568  ChannelDepthsummedAmplitudesPlots[3] = (TH1F *)hfile->Get("h_sumamplitudechannel_HF");
6569  TLine *litebdt[4];
6570  if (ChannelDepthsummedAmplitudesPlots[0])
6571  litebdt[0] = new TLine(80., 0.8, 80., ChannelDepthsummedAmplitudesPlots[0]->GetBinContent(4) + 100.);
6572  if (ChannelDepthsummedAmplitudesPlots[1])
6573  litebdt[1] = new TLine(200., 0.8, 200., ChannelDepthsummedAmplitudesPlots[1]->GetBinContent(7) + 100.);
6574  if (ChannelDepthsummedAmplitudesPlots[2])
6575  litebdt[2] = new TLine(1200., 0.8, 1200., ChannelDepthsummedAmplitudesPlots[2]->GetBinContent(17) + 100.);
6576  if (ChannelDepthsummedAmplitudesPlots[3])
6577  litebdt[3] = new TLine(600., 0.8, 600., ChannelDepthsummedAmplitudesPlots[3]->GetBinContent(6) + 100.);
6578 
6579  gStyle->SetOptStat(110000);
6580  cFour1->Clear();
6581  cFour1->Divide(2, 2);
6582  for (int sub = 0; sub < 4; sub++) {
6583  if (sub == 0)
6584  cFour1->cd(1);
6585  if (sub == 1)
6586  cFour1->cd(2);
6587  if (sub == 2)
6588  cFour1->cd(3);
6589  if (sub == 3)
6590  cFour1->cd(4);
6591  gPad->SetLogy();
6592  ChannelDepthsummedAmplitudesPlots[sub]->SetMarkerStyle(20);
6593  ChannelDepthsummedAmplitudesPlots[sub]->SetMarkerSize(0.8);
6594  if (sub == 0)
6595  ChannelDepthsummedAmplitudesPlots[sub]->SetTitle("HB channel Amplitudes\b");
6596  if (sub == 1)
6597  ChannelDepthsummedAmplitudesPlots[sub]->SetTitle("HE channel Amplitudes\b");
6598  if (sub == 2)
6599  ChannelDepthsummedAmplitudesPlots[sub]->SetTitle("HO channel Amplitudes\b");
6600  if (sub == 3)
6601  ChannelDepthsummedAmplitudesPlots[sub]->SetTitle("HF channel Amplitudes\b");
6602  if (sub == 0)
6603  ChannelDepthsummedAmplitudesPlots[sub]->SetXTitle("HB channel depths summed Amplitudes \b");
6604  if (sub == 1)
6605  ChannelDepthsummedAmplitudesPlots[sub]->SetXTitle("HE channel depths summed Amplitudes \b");
6606  if (sub == 2)
6607  ChannelDepthsummedAmplitudesPlots[sub]->SetXTitle("HO channel depths summed Amplitudes \b");
6608  if (sub == 3)
6609  ChannelDepthsummedAmplitudesPlots[sub]->SetXTitle("HF channel depths summed Amplitudes \b");
6610  ChannelDepthsummedAmplitudesPlots[sub]->SetMarkerColor(2);
6611  ChannelDepthsummedAmplitudesPlots[sub]->SetLineColor(2);
6612  ChannelDepthsummedAmplitudesPlots[sub]->Draw("");
6613  litebdt[sub]->SetLineColor(kBlue);
6614  litebdt[sub]->Draw("s");
6615  } //for
6616  cFour1->Update();
6617  cFour1->Print("ChannelDepthsummedAmplitudes.png");
6618  cFour1->Clear();
6619  gStyle->SetOptStat(0);
6620 
6623  //************************* ***** Ataildepth1_HB *****
6624  cout << ">>>>>>>>>>>>>>>>>>>>>>>>2DAtaildepth " << endl;
6626  cHB->Clear();
6627  cHB->Divide(2, 1);
6628 
6629  TH2F *DAtaildepth1[2]; // 1d histogramm for subdet
6630  DAtaildepth1[0] = (TH2F *)hfile->Get("h_2DAtaildepth1_HB");
6631  DAtaildepth1[1] = (TH2F *)hfile->Get("h_2D0Ataildepth1_HB");
6632  cHB->cd(1);
6633  if (!DAtaildepth1[0] || !DAtaildepth1[1]) {
6634  cout << ">>>>>>>>>>>>>>>>>>>>>>>>Ataildepth1_HB EMPTY histoes for 2DAtaildepth 1" << endl;
6635  } else {
6636  TH2F *tail1 = (TH2F *)DAtaildepth1[0]->Clone("tail1");
6637  tail1->Divide(DAtaildepth1[0], DAtaildepth1[1], 1, 1, "B");
6638  // tail1->Sumw2();
6639  gPad->SetGridy();
6640  gPad->SetGridx();
6641  gPad->SetLogz();
6642  tail1->SetMarkerStyle(20);
6643  tail1->SetMarkerSize(0.4);
6644  tail1->SetTitle("Amplitudes for tail-events (HBdepth1) \b");
6645  tail1->SetXTitle("#eta \b");
6646  tail1->SetYTitle("#phi \b");
6647  tail1->SetZTitle("2D <A> in the tail - HB Depth1 \b");
6648  tail1->SetMarkerColor(2);
6649  tail1->SetLineColor(2);
6650  tail1->Draw("COLZ");
6651  }
6652  TH2F *DAtaildepth2[2]; // 1d histogramm for subdet
6653  DAtaildepth2[0] = (TH2F *)hfile->Get("h_2DAtaildepth2_HB");
6654  DAtaildepth2[1] = (TH2F *)hfile->Get("h_2D0Ataildepth2_HB");
6655  cHB->cd(2);
6656  if (!DAtaildepth2[0] || !DAtaildepth2[1]) {
6657  cout << ">>>>>>>>>>>>>>>>>>>>>>>>Ataildepth1_HB EMPTY histoes for 2DAtaildepth 2" << endl;
6658  } else {
6659  TH2F *tail2 = (TH2F *)DAtaildepth2[0]->Clone("tail2");
6660  tail2->Divide(DAtaildepth2[0], DAtaildepth2[1], 1, 1, "B");
6661  // tail2->Sumw2();
6662  gPad->SetGridy();
6663  gPad->SetGridx();
6664  gPad->SetLogz();
6665  tail2->SetMarkerStyle(20);
6666  tail2->SetMarkerSize(0.4);
6667  tail2->SetTitle("Amplitudes for tail-events (HBdepth2) \b");
6668  tail2->SetXTitle("#eta \b");
6669  tail2->SetYTitle("#phi \b");
6670  tail2->SetZTitle("2D <A> in the tail - HB Depth2 \b");
6671  tail2->SetMarkerColor(2);
6672  tail2->SetLineColor(2);
6673  tail2->Draw("COLZ");
6674  }
6675 
6676  cHB->Update();
6677  cHB->Print("AtaildepthHB.png");
6678  cHB->Clear();
6679 
6682  //************************* ***** sum(Signal+NoSignal) occupancy for HF *****
6683  cout << ">>>>>>>>>>>>>>>>>>>>>>>>sumOccupancyHF " << endl;
6685  cHB->Clear();
6686  cHB->Divide(1, 1);
6687  cHB->cd(1);
6688  if (SummedAmplitudeOccupancyHisto[3]) {
6689  TH1F *ufrew1 = (TH1F *)SummedAmplitudeOccupancyHisto[3]->Clone("ufrew1");
6690  if (SummedAmplitudeOccupancyHisto[3] && NoSignalSummedAmplitudeOccupancyHisto[3])
6691  ufrew1->Add(SummedAmplitudeOccupancyHisto[3], NoSignalSummedAmplitudeOccupancyHisto[3], 1, 1);
6692  ufrew1->GetXaxis()->SetRangeUser(1., maxbins + 1.);
6693  gPad->SetGridx();
6694  ufrew1->SetMarkerStyle(20);
6695  ufrew1->SetMarkerSize(0.8);
6696  ufrew1->GetYaxis()->SetLabelSize(0.04);
6697  ufrew1->SetTitle("HF Occupancy vs LS\b");
6698  ufrew1->SetXTitle("average occupancy per LS HF\b");
6699  ufrew1->SetMarkerColor(4);
6700  ufrew1->SetLineColor(0);
6701  ufrew1->SetMaximum(866.);
6702  ufrew1->SetMinimum(856.);
6703  ufrew1->Draw("Error");
6704  cHB->Update();
6705  cHB->Print("sumOccupancyHF.png");
6706  cHB->Clear();
6707  if (ufrew1)
6708  delete ufrew1;
6709  }
6710 
6718  //====================================================================================================================
6719  cout << ">>>>>>>>>>>>>>>>>>>>>>>> =====================================================================" << endl;
6720 
6721  //=====================================================================================================
6722  cout << ">>>>>>>>>>>>>>>>>>>>>>>> ==================================================" << endl;
6723 
6724  //=====================================================================================
6725  cout << ">>>>>>>>>>>>>>>>>>>>>>>> =================================" << endl;
6726  cout << ">>>>>>>>>>>>>>>>>>>>>>>> =================================" << endl;
6727  cout << ">>>>>>>>>>>>>>>>>>>>>>>> =================================" << endl;
6728  cout << ">>>>>>>>>>>>>>>>>>>>>>>> =================================" << endl;
6729 
6730  cout << ">>>>>>> START NOW CREATING OF HTML PAGES <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << endl;
6731  //======================================================================
6732  // Creating each test kind for each subdet html pages:
6733  std::string raw_class;
6734  int ind = 0;
6735  ofstream htmlFile;
6736  for (int test = 0; test <= 5; test++) { //Test: 0,
6737  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
6738 
6739  // cout<<"Creating each test kind for each subdet html pages: test= "<< test << " sub= " << sub << endl;
6740  if (test == 0) {
6741  if (sub == 1) {
6742  htmlFile.open("HB_CapID.html");
6743  }
6744  if (sub == 2) {
6745  htmlFile.open("HE_CapID.html");
6746  }
6747  if (sub == 3) {
6748  htmlFile.open("HO_CapID.html");
6749  }
6750  if (sub == 4) {
6751  htmlFile.open("HF_CapID.html");
6752  }
6753  }
6754  if (test == 1) {
6755  if (sub == 1) {
6756  htmlFile.open("HB_ADCampl.html");
6757  }
6758  if (sub == 2) {
6759  htmlFile.open("HE_ADCampl.html");
6760  }
6761  if (sub == 3) {
6762  htmlFile.open("HO_ADCampl.html");
6763  }
6764  if (sub == 4) {
6765  htmlFile.open("HF_ADCampl.html");
6766  }
6767  }
6768  if (test == 2) {
6769  if (sub == 1) {
6770  htmlFile.open("HB_Width.html");
6771  }
6772  if (sub == 2) {
6773  htmlFile.open("HE_Width.html");
6774  }
6775  if (sub == 3) {
6776  htmlFile.open("HO_Width.html");
6777  }
6778  if (sub == 4) {
6779  htmlFile.open("HF_Width.html");
6780  }
6781  }
6782  if (test == 3) {
6783  if (sub == 1) {
6784  htmlFile.open("HB_Ratio.html");
6785  }
6786  if (sub == 2) {
6787  htmlFile.open("HE_Ratio.html");
6788  }
6789  if (sub == 3) {
6790  htmlFile.open("HO_Ratio.html");
6791  }
6792  if (sub == 4) {
6793  htmlFile.open("HF_Ratio.html");
6794  }
6795  }
6796  if (test == 4) {
6797  if (sub == 1) {
6798  htmlFile.open("HB_Tmean.html");
6799  }
6800  if (sub == 2) {
6801  htmlFile.open("HE_Tmean.html");
6802  }
6803  if (sub == 3) {
6804  htmlFile.open("HO_Tmean.html");
6805  }
6806  if (sub == 4) {
6807  htmlFile.open("HF_Tmean.html");
6808  }
6809  }
6810  if (test == 5) {
6811  if (sub == 1) {
6812  htmlFile.open("HB_Tmax.html");
6813  }
6814  if (sub == 2) {
6815  htmlFile.open("HE_Tmax.html");
6816  }
6817  if (sub == 3) {
6818  htmlFile.open("HO_Tmax.html");
6819  }
6820  if (sub == 4) {
6821  htmlFile.open("HF_Tmax.html");
6822  }
6823  }
6824 
6825  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
6826  htmlFile << "<head>" << std::endl;
6827  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
6828  htmlFile << "<title> Certification Monitoring Tool </title>" << std::endl;
6829  htmlFile << "<style type=\"text/css\">" << std::endl;
6830  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
6831  << std::endl;
6832  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
6833  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
6834  "text-align: center;}"
6835  << std::endl;
6836  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
6837  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
6838  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
6839  htmlFile << " td.s5 { font-family: arial, arial ce, helvetica; background-color: #00FF00; }" << std::endl;
6840  htmlFile << " td.s6 { font-family: arial, arial ce, helvetica; background-color: #FF0000; }" << std::endl;
6841  htmlFile << "</style>" << std::endl;
6842  htmlFile << "<body>" << std::endl;
6843 
6844  if (test == 0) {
6845  if (sub == 1)
6846  htmlFile << "<h1> Cap ID estimator for HB, RUN = " << runnumber << " </h1>" << std::endl;
6847  if (sub == 2)
6848  htmlFile << "<h1> Cap ID estimator for HE, RUN = " << runnumber << " </h1>" << std::endl;
6849  if (sub == 3)
6850  htmlFile << "<h1> Cap ID estimator for HO, RUN = " << runnumber << " </h1>" << std::endl;
6851  if (sub == 4)
6852  htmlFile << "<h1> Cap ID estimator for HF, RUN = " << runnumber << " </h1>" << std::endl;
6853  }
6854  if (test == 1) {
6855  if (sub == 1)
6856  htmlFile << "<h1> Mean ADC Amplitude estimator for HB, RUN = " << runnumber << " </h1>" << std::endl;
6857  if (sub == 2)
6858  htmlFile << "<h1> Mean ADC Amplitude estimator for HE, RUN = " << runnumber << " </h1>" << std::endl;
6859  if (sub == 3)
6860  htmlFile << "<h1> Mean ADC Amplitude estimator for HO, RUN = " << runnumber << " </h1>" << std::endl;
6861  if (sub == 4)
6862  htmlFile << "<h1> Mean ADC Amplitude estimator for HF, RUN = " << runnumber << " </h1>" << std::endl;
6863  }
6864  if (test == 2) {
6865  if (sub == 1)
6866  htmlFile << "<h1> Width estimator for HB, RUN = " << runnumber << " </h1>" << std::endl;
6867  if (sub == 2)
6868  htmlFile << "<h1> Width estimator for HE, RUN = " << runnumber << " </h1>" << std::endl;
6869  if (sub == 3)
6870  htmlFile << "<h1> Width estimator for HO, RUN = " << runnumber << " </h1>" << std::endl;
6871  if (sub == 4)
6872  htmlFile << "<h1> Width estimator for HF, RUN = " << runnumber << " </h1>" << std::endl;
6873  }
6874  if (test == 3) {
6875  if (sub == 1)
6876  htmlFile << "<h1> Ratio estimator for HB, RUN = " << runnumber << " </h1>" << std::endl;
6877  if (sub == 2)
6878  htmlFile << "<h1> Ratio estimator for HE, RUN = " << runnumber << " </h1>" << std::endl;
6879  if (sub == 3)
6880  htmlFile << "<h1> Ratio estimator for HO, RUN = " << runnumber << " </h1>" << std::endl;
6881  if (sub == 4)
6882  htmlFile << "<h1> Ratio estimator for HF, RUN = " << runnumber << " </h1>" << std::endl;
6883  }
6884  if (test == 4) {
6885  if (sub == 1)
6886  htmlFile << "<h1> Mean bin timing estimator for HB, RUN = " << runnumber << " </h1>" << std::endl;
6887  if (sub == 2)
6888  htmlFile << "<h1> Mean bin timing estimator for HE, RUN = " << runnumber << " </h1>" << std::endl;
6889  if (sub == 3)
6890  htmlFile << "<h1> Mean bin timing estimator for HO, RUN = " << runnumber << " </h1>" << std::endl;
6891  if (sub == 4)
6892  htmlFile << "<h1> Mean bin timing estimator for HF, RUN = " << runnumber << " </h1>" << std::endl;
6893  }
6894  if (test == 5) {
6895  if (sub == 1)
6896  htmlFile << "<h1> Maximum bin timing estimator for HB, RUN = " << runnumber << " </h1>" << std::endl;
6897  if (sub == 2)
6898  htmlFile << "<h1> Maximum bin timing estimator for HE, RUN = " << runnumber << " </h1>" << std::endl;
6899  if (sub == 3)
6900  htmlFile << "<h1> Maximum bin timing estimator for HO, RUN = " << runnumber << " </h1>" << std::endl;
6901  if (sub == 4)
6902  htmlFile << "<h1> Maximum bin timing estimator for HF, RUN = " << runnumber << " </h1>" << std::endl;
6903  }
6904 
6905  if (test == 1) {
6906  htmlFile << "<a name=\"Top\"></a>\n";
6907  htmlFile << "<b>Contents:<br>\n";
6908  htmlFile << "1. <a href=\"#Aij\">A_ij_LS (averaged over events in LS) </a><br>\n";
6909  htmlFile << "2. <a href=\"#OverflowAij\">A_ij_LS in overflow & underflow</a><br>\n";
6910  htmlFile << "3. <a href=\"#MainEstimator\">Main Estimator !!! </a><br>\n";
6911  htmlFile << "4. <a href=\"#ErrorA\">Error type A </a><br>\n";
6912  htmlFile << "5. <a href=\"#ErrorAaverage\">ErrorA cross check</a><br>\n";
6913  htmlFile << "6. <a href=\"#ErrorAoccupancy\">ErrorA occupancy plots</a><br>\n";
6914  htmlFile << "7. <a href=\"#ErrorB\">Error type B</a><br>\n";
6915  htmlFile << "8. <a href=\"#LSstatus\">Table of Average channel-Amplitude in Depthes over LSs </a><br>\n";
6916  htmlFile << "9. <a href=\"#RBXstatus\">RBX Status </a><br>\n";
6917  htmlFile << "10. <a href=\"#RBXPHItable\">Table of Average RBX-Amplitude in Phi over LSs </a><br>\n";
6918  htmlFile << "11. <a href=\"#RBXETAtable\">Table of Average RBX-Amplitude in Eta over LSs </a><br>\n";
6919  htmlFile << "12. <a href=\"#RBX3plots\">RBX A-Ratio to 1st LS: 3 plots </a><br>\n";
6921  }
6922 
6923  // htmlFile << "<a href=\"#Top\">to top</a><br>\n";
6924 
6925  htmlFile << "<br>" << std::endl;
6926  if (test == 0) {
6927  htmlFile << "<h2> 0. Rate of CapID failures over all events of Run </h2>" << std::endl;
6928  htmlFile << "<h3> Channel legend: green - good, other colour - suspicious </h3>" << std::endl;
6929  if (sub == 1)
6930  htmlFile << " <img src=\"MapCapIdErrorHB.png\" />" << std::endl;
6931  if (sub == 2)
6932  htmlFile << " <img src=\"MapCapIdErrorHE.png\" />" << std::endl;
6933  if (sub == 3)
6934  htmlFile << " <img src=\"MapCapIdErrorHO.png\" />" << std::endl;
6935  if (sub == 4)
6936  htmlFile << " <img src=\"MapCapIdErrorHF.png\" />" << std::endl;
6937  }
6938  if (test == 1)
6939  htmlFile << "<a name=\"Aij\"></a>\n";
6940  if (test != 0)
6941  htmlFile << "<h2> 1. Distribution of estimator averaged over events in LS, histogramed over all channels and "
6942  "all LSs (only few depthes shown as example) </h2>"
6943  << std::endl;
6944  if (test == 0) {
6945  if (sub == 1)
6946  htmlFile << "<h2> 1. Average Nbcs for only LS containing events with abnormal number of Bad channels >"
6947  << CutAb[sub][1] << " (Depth1), " << CutAb[sub][2] << " (Depth2).</h2>" << std::endl;
6948  if (sub == 2)
6949  htmlFile << "<h2> 1. Average Nbcs for only LS containing events with abnormal number of Bad channels >"
6950  << CutAb[sub][1] << " (Depth1), " << CutAb[sub][2] << " (Depth2), " << CutAb[sub][3]
6951  << " (Depth3).</h2>" << std::endl;
6952  if (sub == 3)
6953  htmlFile << "<h2> 1. Average Nbcs for only LS containing events with abnormal number of Bad channels >"
6954  << CutAb[sub][1] << " (Depth4).</h2>" << std::endl;
6955  if (sub == 4)
6956  htmlFile << "<h2> 1. Average Nbcs for only LS containing events with abnormal number of Bad channels >"
6957  << CutAb[sub][1] << " (Depth1), " << CutAb[sub][2] << " (Depth2).</h2>" << std::endl;
6958  }
6959 
6960  if (test != 0)
6961  htmlFile << "<h3> see Overflow and Underflow </h3>" << std::endl;
6962  if (test == 0)
6963  htmlFile << "<h3> Legend: dots correspond to BAD LS candidates.</h3>" << std::endl;
6964 
6965  if (test == 0) {
6966  if (sub == 1)
6967  htmlFile << " <img src=\"Hist_CAPID_Abnorm_HB.png\" />" << std::endl;
6968  if (sub == 2)
6969  htmlFile << " <img src=\"Hist_CAPID_Abnorm_HE.png\" />" << std::endl;
6970  if (sub == 3)
6971  htmlFile << " <img src=\"Hist_CAPID_Abnorm_HO.png\" />" << std::endl;
6972  if (sub == 4)
6973  htmlFile << " <img src=\"Hist_CAPID_Abnorm_HF.png\" />" << std::endl;
6974  }
6975  if (test == 1) {
6976  if (sub == 1)
6977  htmlFile << " <img src=\"H_ADCamplHB.png\" />" << std::endl;
6978  if (sub == 2)
6979  htmlFile << " <img src=\"H_ADCamplHE.png\" />" << std::endl;
6980  if (sub == 3)
6981  htmlFile << " <img src=\"H_ADCamplHO.png\" />" << std::endl;
6982  if (sub == 4)
6983  htmlFile << " <img src=\"H_ADCamplHF.png\" />" << std::endl;
6984  }
6985  if (test == 2) {
6986  if (sub == 1)
6987  htmlFile << " <img src=\"H_WidthHB.png\" />" << std::endl;
6988  if (sub == 2)
6989  htmlFile << " <img src=\"H_WidthHE.png\" />" << std::endl;
6990  if (sub == 3)
6991  htmlFile << " <img src=\"H_WidthHO.png\" />" << std::endl;
6992  if (sub == 4)
6993  htmlFile << " <img src=\"H_WidthHF.png\" />" << std::endl;
6994  }
6995  if (test == 3) {
6996  if (sub == 1)
6997  htmlFile << " <img src=\"H_RatioHB.png\" />" << std::endl;
6998  if (sub == 2)
6999  htmlFile << " <img src=\"H_RatioHE.png\" />" << std::endl;
7000  if (sub == 3)
7001  htmlFile << " <img src=\"H_RatioHO.png\" />" << std::endl;
7002  if (sub == 4)
7003  htmlFile << " <img src=\"H_RatioHF.png\" />" << std::endl;
7004  }
7005  if (test == 4) {
7006  if (sub == 1)
7007  htmlFile << " <img src=\"H_TmeanHB.png\" />" << std::endl;
7008  if (sub == 2)
7009  htmlFile << " <img src=\"H_TmeanHE.png\" />" << std::endl;
7010  if (sub == 3)
7011  htmlFile << " <img src=\"H_TmeanHO.png\" />" << std::endl;
7012  if (sub == 4)
7013  htmlFile << " <img src=\"H_TmeanHF.png\" />" << std::endl;
7014  }
7015  if (test == 5) {
7016  if (sub == 1)
7017  htmlFile << " <img src=\"H_TmaxHB.png\" />" << std::endl;
7018  if (sub == 2)
7019  htmlFile << " <img src=\"H_TmaxHE.png\" />" << std::endl;
7020  if (sub == 3)
7021  htmlFile << " <img src=\"H_TmaxHO.png\" />" << std::endl;
7022  if (sub == 4)
7023  htmlFile << " <img src=\"H_TmaxHF.png\" />" << std::endl;
7024  }
7025  htmlFile << "<br>" << std::endl;
7026  if (test == 1)
7027  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7028 
7029  if (test == 0)
7030  htmlFile << "<h2> 2a. Number of bad channels per event distribution in Run</h2>" << std::endl;
7031  if (test == 0)
7032  htmlFile << "<h3> Legends: dots correspond to BAD LS candidates. </h3>" << std::endl;
7033  if (test == 0) {
7034  if (sub == 1)
7035  htmlFile << " <img src=\"HistNBadChsHB.png\" />" << std::endl;
7036  if (sub == 2)
7037  htmlFile << " <img src=\"HistNBadChsHE.png\" />" << std::endl;
7038  if (sub == 3)
7039  htmlFile << " <img src=\"HistNBadChsHO.png\" />" << std::endl;
7040  if (sub == 4)
7041  htmlFile << " <img src=\"HistNBadChsHF.png\" />" << std::endl;
7042  }
7043 
7044  if (test == 1)
7045  htmlFile << "<a name=\"OverflowAij\"></a>\n";
7046  if (test != 0)
7047  htmlFile << "<h2> 2. Estimator averaged over all events in the RUN for entries in overflow and underflow of "
7048  "corresponding histogram above (only few depthes shown as example) </h2>"
7049  << std::endl;
7050  // if (test !=0) htmlFile << "<h2> 2. Estimator averaged over all events in the RUN </h2>"<< std::endl;
7051  if (test == 0)
7052  htmlFile << "<h2> 2b. Averaged number of bad channels for each LS </h2>" << std::endl;
7053  // if (test !=0) htmlFile << "<h3> Channel legend: white - good, other colour - bad. </h3>"<< std::endl;
7054  if (test == 0) {
7055  if (sub == 1)
7056  htmlFile << "<h3> Legends: dots selected with following cuts: <td class=\"s6\" align=\"center\">"
7057  << Cut0[test][sub][1] << " (Depth1), " << Cut0[test][sub][2]
7058  << " (Depth2) correspond BAD LS.</td></h3>" << std::endl;
7059  if (sub == 2)
7060  htmlFile << "<h3> Legends: dots selected with following cuts: " << Cut0[test][sub][1] << " (Depth1), "
7061  << Cut0[test][sub][2] << " (Depth2), " << Cut0[test][sub][3] << " (Depth3) correspond BAD LS.</h3>"
7062  << std::endl;
7063  if (sub == 3)
7064  htmlFile << "<h3> Legends: dots selected with following cuts: " << Cut0[test][sub][4]
7065  << " (Depth4) correspond BAD LS.</h3>" << std::endl;
7066  if (sub == 4)
7067  htmlFile << "<h3> Legends: dots selected with following cuts: " << Cut0[test][sub][1] << " (Depth1), "
7068  << Cut0[test][sub][2] << " (Depth2) correspond BAD LS.</h3>" << std::endl;
7069  }
7070  if (test == 0) {
7071  if (sub == 1)
7072  htmlFile << " <img src=\"HistNBCMNHB.png\" />" << std::endl;
7073  if (sub == 2)
7074  htmlFile << " <img src=\"HistNBCMNHE.png\" />" << std::endl;
7075  if (sub == 3)
7076  htmlFile << " <img src=\"HistNBCMNHO.png\" />" << std::endl;
7077  if (sub == 4)
7078  htmlFile << " <img src=\"HistNBCMNHF.png\" />" << std::endl;
7079  }
7080  if (test == 1) {
7081  if (sub == 1)
7082  htmlFile << " <img src=\"MapADCamplHB.png\" />" << std::endl;
7083  if (sub == 2)
7084  htmlFile << " <img src=\"MapADCamplHE.png\" />" << std::endl;
7085  if (sub == 3)
7086  htmlFile << " <img src=\"MapADCamplHO.png\" />" << std::endl;
7087  if (sub == 4)
7088  htmlFile << " <img src=\"MapADCamplHF.png\" />" << std::endl;
7089  }
7090  if (test == 2) {
7091  if (sub == 1)
7092  htmlFile << " <img src=\"MapWidthHB.png\" />" << std::endl;
7093  if (sub == 2)
7094  htmlFile << " <img src=\"MapWidthHE.png\" />" << std::endl;
7095  if (sub == 3)
7096  htmlFile << " <img src=\"MapWidthHO.png\" />" << std::endl;
7097  if (sub == 4)
7098  htmlFile << " <img src=\"MapWidthHF.png\" />" << std::endl;
7099  }
7100  if (test == 3) {
7101  if (sub == 1)
7102  htmlFile << " <img src=\"MapRatioHB.png\" />" << std::endl;
7103  if (sub == 2)
7104  htmlFile << " <img src=\"MapRatioHE.png\" />" << std::endl;
7105  if (sub == 3)
7106  htmlFile << " <img src=\"MapRatioHO.png\" />" << std::endl;
7107  if (sub == 4)
7108  htmlFile << " <img src=\"MapRatioHF.png\" />" << std::endl;
7109  }
7110  if (test == 4) {
7111  if (sub == 1)
7112  htmlFile << " <img src=\"MapTmeanHB.png\" />" << std::endl;
7113  if (sub == 2)
7114  htmlFile << " <img src=\"MapTmeanHE.png\" />" << std::endl;
7115  if (sub == 3)
7116  htmlFile << " <img src=\"MapTmeanHO.png\" />" << std::endl;
7117  if (sub == 4)
7118  htmlFile << " <img src=\"MapTmeanHF.png\" />" << std::endl;
7119  }
7120  if (test == 5) {
7121  if (sub == 1)
7122  htmlFile << " <img src=\"MapTmaxHB.png\" />" << std::endl;
7123  if (sub == 2)
7124  htmlFile << " <img src=\"MapTmaxHE.png\" />" << std::endl;
7125  if (sub == 3)
7126  htmlFile << " <img src=\"MapTmaxHO.png\" />" << std::endl;
7127  if (sub == 4)
7128  htmlFile << " <img src=\"MapTmaxHF.png\" />" << std::endl;
7129  }
7130  htmlFile << "<br>" << std::endl;
7131  if (test == 1)
7132  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7133 
7134  if (test == 1)
7135  htmlFile << "<a name=\"MainEstimator\"></a>\n";
7136  if (test != 0)
7137  htmlFile
7138  << "<h2> 3. Distribution of estimator averaged over events in LS and over all channels for each LS </h2>"
7139  << std::endl;
7140  if (test == 0) {
7141  if (sub == 1)
7142  htmlFile << "<h2> 3. Portion of events with Nbcs>" << CutPo[sub][1] << " (Depth1), " << CutPo[sub][2]
7143  << " (Depth2) in each LS.</h2>" << std::endl;
7144  if (sub == 2)
7145  htmlFile << "<h2> 3. Portion of events with Nbcs>" << CutPo[sub][1] << " (Depth1), " << CutPo[sub][2]
7146  << " (Depth2), " << CutPo[sub][3] << " (Depth3) in each LS.</h2>" << std::endl;
7147  if (sub == 3)
7148  htmlFile << "<h2> 3. Portion of events with Nbcs>" << CutPo[sub][4] << " (Depth4) in each LS.</h2>"
7149  << std::endl;
7150  if (sub == 4)
7151  htmlFile << "<h2> 3. Portion of events with Nbcs>" << CutPo[sub][1] << " (Depth1), " << CutPo[sub][2]
7152  << " (Depth2) in each LS.</h2>" << std::endl;
7153  htmlFile << "<h3> Legend: dots correspond to BAD LS candidates.</h3>" << std::endl;
7154  }
7155  if (test != 0) {
7156  if (sub == 1)
7157  htmlFile << "<h3> Legends: dots selected with following cuts: <td class=\"s6\" align=\"center\">"
7158  << Cut0[test][sub][1] << " (Depth1), " << Cut0[test][sub][2]
7159  << " (Depth2) correspond BAD LS.</td></h3>" << std::endl;
7160  if (sub == 2)
7161  htmlFile << "<h3> Legends: dots selected with following cuts: " << Cut0[test][sub][1] << " (Depth1), "
7162  << Cut0[test][sub][2] << " (Depth2), " << Cut0[test][sub][3] << " (Depth3), " << Cut0[test][sub][4]
7163  << " (Depth4), " << Cut0[test][sub][5] << " (Depth5), " << Cut0[test][sub][6] << " (Depth6), "
7164  << Cut0[test][sub][7] << " (Depth7) correspond BAD LS. </h3>" << std::endl;
7165  if (sub == 3)
7166  htmlFile << "<h3> Legends: dots selected with following cuts: " << Cut0[test][sub][4]
7167  << " (Depth4) correspond BAD LS. </h3>" << std::endl;
7168  if (sub == 4)
7169  htmlFile << "<h3> Legends: dots selected with following cuts: " << Cut0[test][sub][1] << " (Depth1), "
7170  << Cut0[test][sub][2] << " (Depth2), " << Cut0[test][sub][3] << " (Depth3), " << Cut0[test][sub][4]
7171  << " (Depth4) correspond BAD LS. </h3>" << std::endl;
7172  }
7173  if (test == 0) {
7174  if (sub == 1)
7175  htmlFile << " <img src=\"HistPortHB.png\" />" << std::endl;
7176  if (sub == 2)
7177  htmlFile << " <img src=\"HistPortHE.png\" />" << std::endl;
7178  if (sub == 3)
7179  htmlFile << " <img src=\"HistPortHO.png\" />" << std::endl;
7180  if (sub == 4)
7181  htmlFile << " <img src=\"HistPortHF.png\" />" << std::endl;
7182  }
7183  if (test == 1) {
7184  if (sub == 1)
7185  htmlFile << " <img src=\"HistADCamplHB.png\" />" << std::endl;
7186  if (sub == 2)
7187  htmlFile << " <img src=\"HistADCamplHE.png\" />" << std::endl;
7188  if (sub == 3)
7189  htmlFile << " <img src=\"HistADCamplHO.png\" />" << std::endl;
7190  if (sub == 4)
7191  htmlFile << " <img src=\"HistADCamplHF.png\" />" << std::endl;
7192  }
7193  if (test == 2) {
7194  if (sub == 1)
7195  htmlFile << " <img src=\"HistWidthHB.png\" />" << std::endl;
7196  if (sub == 2)
7197  htmlFile << " <img src=\"HistWidthHE.png\" />" << std::endl;
7198  if (sub == 3)
7199  htmlFile << " <img src=\"HistWidthHO.png\" />" << std::endl;
7200  if (sub == 4)
7201  htmlFile << " <img src=\"HistWidthHF.png\" />" << std::endl;
7202  }
7203  if (test == 3) {
7204  if (sub == 1)
7205  htmlFile << " <img src=\"HistRatioHB.png\" />" << std::endl;
7206  if (sub == 2)
7207  htmlFile << " <img src=\"HistRatioHE.png\" />" << std::endl;
7208  if (sub == 3)
7209  htmlFile << " <img src=\"HistRatioHO.png\" />" << std::endl;
7210  if (sub == 4)
7211  htmlFile << " <img src=\"HistRatioHF.png\" />" << std::endl;
7212  }
7213  if (test == 4) {
7214  if (sub == 1)
7215  htmlFile << " <img src=\"HistTmeanHB.png\" />" << std::endl;
7216  if (sub == 2)
7217  htmlFile << " <img src=\"HistTmeanHE.png\" />" << std::endl;
7218  if (sub == 3)
7219  htmlFile << " <img src=\"HistTmeanHO.png\" />" << std::endl;
7220  if (sub == 4)
7221  htmlFile << " <img src=\"HistTmeanHF.png\" />" << std::endl;
7222  }
7223  if (test == 5) {
7224  if (sub == 1)
7225  htmlFile << " <img src=\"HistTmaxHB.png\" />" << std::endl;
7226  if (sub == 2)
7227  htmlFile << " <img src=\"HistTmaxHE.png\" />" << std::endl;
7228  if (sub == 3)
7229  htmlFile << " <img src=\"HistTmaxHO.png\" />" << std::endl;
7230  if (sub == 4)
7231  htmlFile << " <img src=\"HistTmaxHF.png\" />" << std::endl;
7232  }
7233  htmlFile << "<br>" << std::endl;
7234 
7235  if (test == 1) {
7236  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7237  htmlFile << "<a name=\"ErrorA\"></a>\n";
7238  htmlFile << "<h2> 4. Error type A</h2>\n";
7239  htmlFile << "<h3> note: no sence to see plots of this item if max difference is too large(due to very high A "
7240  "of some channels)</h3>\n";
7241  htmlFile << "<br>\n";
7242 
7243  //HB:
7244  if (sub == 1) {
7245  htmlFile << "<h3>Mean of max difference between dependencies to be within: 0.1-1.6 (p-p collisions) </h3>\n";
7246  htmlFile << " <img src=\"HistErrA_HB.png\" />\n";
7247  htmlFile << "<br>\n";
7248  if (flagErrAB_HB[0] == -1)
7249  htmlFile << "<h3>test was not possible</h3>\n";
7250  else if (flagErrAB_HB[0] == 0)
7251  htmlFile << "<h3> Fine:NoErrorA_HB (Mean of max difference " << avedelta_HB
7252  << " is within 0.1-1.6) </h3>\n";
7253  else if (flagErrAB_HB[0] == 1)
7254  htmlFile << "<<h3> ErrorA_HB is available once Mean of max difference " << avedelta_HB
7255  << " is out 0.1-1.6 (p-p collisions)</font></h3>\n";
7256  else
7257  htmlFile << "<h3>auto-interpretation is not available</h3>\n";
7258  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7259 
7260  htmlFile << "<a name=\"ErrorAaverage\"></a>\n";
7261 
7262  htmlFile << "<h2> 5. Error type A cross check: see 2D pattern of channels (only 2 depthes shown as example) "
7263  "</h2>\n";
7264  htmlFile << "<h2> 1) with average channel Amplitudes(No cut), 2) with average channel Amplitudes(<A> >25), "
7265  "3) with channel Amplitude (A<35); </h2>\n";
7266  htmlFile << " <img src=\"ChkErrA_HB1.png\" /><br><br>\n";
7267  htmlFile << " <img src=\"ChkErrA_HB2.png\" /><br>\n";
7268  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7269 
7270  htmlFile << "<a name=\"ErrorAoccupancy\"></a>\n";
7271  htmlFile << "<h2> 6. Error type A: min/ave ratio for occupancy distributions with Amplitude bigger 25 "
7272  "(HBM:neg.eta;HBP:pos.eta) </h2>\n";
7273  htmlFile << "<h2> FOR CROSS-CHECK OLNY !!!</h2>\n";
7274  htmlFile << "<h2> TO IDENTIFY A-type errors: for most of LSs the ratio to be lower 0.6 at least for HF- or "
7275  "HF+ </h2>\n";
7276  htmlFile << "<h2> For runs without A-type errors: for most of LSs the ratio is higher 0.6 and is the same "
7277  "for HF- and HF+ </h2>\n";
7278  htmlFile << " <img src=\"OccPlots_HB.png\" /><br><br>\n";
7279  htmlFile << "<br>\n";
7280  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7281 
7282  htmlFile << "<a name=\"ErrorB\"></a>\n";
7283  htmlFile << "<h2> 7. Error type B (only 2 depthes shown as example) \n";
7284  htmlFile << "<h3> ErrorB identification: digi-collection size != 8.</h3>\n";
7285  htmlFile << " <img src=\"HistErrB_HB_1.png\" />\n<br>\n";
7286  htmlFile << " <img src=\"HistErrB_HB_2.png\" />\n<br>\n";
7287  htmlFile << "<br>\n";
7288  htmlFile << "<h3> if Error type B is available, it start from: " << LSofFirstErrB_HB << " LS </h3>\n";
7289  htmlFile << "<br>\n";
7290  }
7291 
7292  //HE:
7293  if (sub == 2) {
7294  htmlFile << "<h3>Mean of max difference between dependencies to be within: 0.2-1.8 (p-p collisions) </h3>\n";
7295  htmlFile << " <img src=\"HistErrA_HE.png\" />\n";
7296  htmlFile << "<br>\n";
7297  if (flagErrAB_HE[0] == -1)
7298  htmlFile << "<h3>test was not possible</h3>\n";
7299  else if (flagErrAB_HE[0] == 0)
7300  htmlFile << "<h3> Fine:NoErrorA_HE (Mean of max difference " << avedelta_HE
7301  << " is within 0.2-1.8) </h3>\n";
7302  else if (flagErrAB_HE[0] == 1)
7303  htmlFile << "<<h3> ErrorA_HE is available once Mean of max difference " << avedelta_HE
7304  << " is out 0.2-1.8 (p-p collisions)</font></h3>\n";
7305  else
7306  htmlFile << "<h3>auto-interpretation is not available</h3>\n";
7307  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7308 
7309  htmlFile << "<a name=\"ErrorAaverage\"></a>\n";
7310 
7311  htmlFile << "<h2> 5. Error type A cross check: see 2D pattern of channels (only 3 depthes shown as example) "
7312  " </h2>\n";
7313  htmlFile << "<h2> 1) with average channel Amplitudes(No cut), 2) with average channel Amplitudes(<A> "
7314  ">1000.fC), 3) with channel Amplitude (A<500fC); </h2>\n";
7315  htmlFile << " <img src=\"ChkErrA_HE1.png\" /><br><br>\n";
7316  htmlFile << " <img src=\"ChkErrA_HE2.png\" /><br>\n";
7317  htmlFile << " <img src=\"ChkErrA_HE3.png\" /><br>\n";
7318  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7319 
7320  htmlFile << "<a name=\"ErrorAoccupancy\"></a>\n";
7321  htmlFile << "<h2> 6. Error type A: min/ave ratio for occupancy distributions with Amplitude bigger 35 "
7322  "(HEM:neg.eta;HEP:pos.eta) </h2>\n";
7323  htmlFile << "<h2> FOR CROSS-CHECK OLNY !!!</h2>\n";
7324  htmlFile << "<h2> TO IDENTIFY A-type errors: for most of LSs the ratio to be lower 0.3 at least for HF- or "
7325  "HF+ </h2>\n";
7326  htmlFile << "<h2> For runs without A-type errors: for most of LSs the ratio is higher 0.3 and is the same "
7327  "for HF- and HF+ </h2>\n";
7328  htmlFile << " <img src=\"OccPlots_HE.png\" /><br><br>\n";
7329  htmlFile << "<br>\n";
7330  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7331 
7332  htmlFile << "<a name=\"ErrorB\"></a>\n";
7333  htmlFile << "<h2> 7. Error type B (only 3 depthes shown as example) \n";
7334  htmlFile << "<h3> ErrorB identification: digi-collection size != 8.</h3>\n";
7335  htmlFile << " <img src=\"HistErrB_HE_1.png\" />\n<br>\n";
7336  htmlFile << " <img src=\"HistErrB_HE_2.png\" />\n<br>\n";
7337  htmlFile << " <img src=\"HistErrB_HE_3.png\" />\n<br>\n";
7338  htmlFile << "<br>\n";
7339  htmlFile << "<h3> if Error type B is available, it start from: " << LSofFirstErrB_HE << " LS </h3>\n";
7340  htmlFile << "<br>\n";
7341  }
7342 
7343  //HO:
7344  if (sub == 3) {
7345  htmlFile << "<h3>Mean of max difference between dependencies to be within: 0.1-1.5 (p-p collisions) </h3>\n";
7346  htmlFile << " <img src=\"HistErrA_HO.png\" />\n";
7347  htmlFile << "<br>\n";
7348  if (flagErrAB_HO[0] == -1)
7349  htmlFile << "<h3>test was not possible</h3>\n";
7350  else if (flagErrAB_HO[0] == 0)
7351  htmlFile << "<h3> Fine:NoErrorA_HO (Mean of max difference " << avedelta_HO
7352  << " is within 0.1-1.5) </h3>\n";
7353  else if (flagErrAB_HO[0] == 1)
7354  htmlFile << "<<h3> ErrorA_HO is available once Mean of max difference " << avedelta_HO
7355  << " is out 0.1-1.5 (p-p collisions)</font></h3>\n";
7356  else
7357  htmlFile << "<h3>auto-interpretation is not available</h3>\n";
7358  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7359 
7360  htmlFile << "<a name=\"ErrorAaverage\"></a>\n";
7361 
7362  htmlFile << "<h2> 5. Error type A cross check: see 2D pattern of channels </h2>\n";
7363  htmlFile << "<h2> 1) with average channel Amplitudes(No cut), 2) with average channel Amplitudes(<A> >80), "
7364  "3) with channel Amplitude (A<100); </h2>\n";
7365  // htmlFile << "<h2> 2D. Cross check for error A</h2>\n";
7366  htmlFile << " <img src=\"ChkErrA_HO4.png\" /><br><br>\n";
7367  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7368 
7369  htmlFile << "<a name=\"ErrorAoccupancy\"></a>\n";
7370  htmlFile << "<h2> 6. Error type A: min/ave ratio for occupancy distributions with Amplitude bigger 80 "
7371  "(HOM:neg.eta;HOP:pos.eta) </h2>\n";
7372  htmlFile << "<h2> FOR CROSS-CHECK OLNY !!!</h2>\n";
7373  htmlFile << "<h2> TO IDENTIFY A-type errors: for most of LSs the ratio to be lower 0.8 at least for HF- or "
7374  "HF+ </h2>\n";
7375  htmlFile << "<h2> For runs without A-type errors: for most of LSs the ratio is higher 0.8 and is the same "
7376  "for HF- and HF+ </h2>\n";
7377  htmlFile << " <img src=\"OccPlots_HO.png\" /><br><br>\n";
7378  htmlFile << "<br>\n";
7379  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7380 
7381  htmlFile << "<a name=\"ErrorB\"></a>\n";
7382  htmlFile << "<h2> 7. Error type B\n";
7383  htmlFile << "<h3> ErrorB identification: digi-collection size != 10. </h3>\n";
7384  htmlFile << " <img src=\"HistErrB_HO_4.png\" />\n<br>\n";
7385  htmlFile << "<br>\n";
7386  htmlFile << "<h3> if Error type B is available, it start from: " << LSofFirstErrB_HO << " LS </h3>\n";
7387  htmlFile << "<br>\n";
7388  }
7389 
7390  //HF:
7391  if (sub == 4) {
7392  // flagSpecHF+=1;
7393  htmlFile << "<h3>Mean of max difference between dependencies to be within: 0.8-2.4 (p-p collisions) </h3>\n";
7394  htmlFile << " <img src=\"HistErrA_HF.png\" />\n";
7395  htmlFile << "<br>\n";
7396  if (flagErrAB_HF[0] == -1)
7397  htmlFile << "<h3>test was not possible</h3>\n";
7398  else if (flagErrAB_HF[0] == 0)
7399  htmlFile << "<h3> Fine:NoErrorA_HF (Mean of max difference " << avedelta_HF
7400  << " is within 0.8-2.4) </h3>\n";
7401  else if (flagErrAB_HF[0] == 1)
7402  htmlFile << "<<h3> ErrorA_HF is available once Mean of max difference " << avedelta_HF
7403  << " is out 0.8-2.4 (p-p collisions)</font></h3>\n";
7404  else
7405  htmlFile << "<h3>auto-interpretation is not available</h3>\n";
7406  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7407 
7408  htmlFile << "<a name=\"ErrorAaverage\"></a>\n";
7409 
7410  htmlFile << "<h2> 5. Error type A cross check: see 2D pattern of channels (only 2 depthes shown as example) "
7411  "</h2>\n";
7412  htmlFile << "<h2> 1) with average channel Amplitudes(No cut), 2) with average channel Amplitudes(<A> >20), "
7413  "3) with channel Amplitude (A<20); </h2>\n";
7414  // htmlFile << "<h2> 2D. Cross check for error A</h2>\n";
7415  htmlFile << " <img src=\"ChkErrA_HF1.png\" /><br><br>\n";
7416  htmlFile << " <img src=\"ChkErrA_HF2.png\" /><br>\n";
7417  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7418 
7419  htmlFile << "<a name=\"ErrorAoccupancy\"></a>\n";
7420  htmlFile << "<h2> 6. Error type A: min/ave ratio for occupancy distributions with Amplitude bigger 20 "
7421  "(HFM:neg.eta;HFP:pos.eta) </h2>\n";
7422  htmlFile << "<h2> FOR CROSS-CHECK OLNY !!!</h2>\n";
7423  htmlFile << "<h2> TO IDENTIFY A-type errors: for most of LSs the ratio to be lower 0.8 at least for HF- or "
7424  "HF+ </h2>\n";
7425  htmlFile << "<h2> For runs without A-type errors: for most of LSs the ratio is higher 0.8 and is the same "
7426  "for HF- and HF+ </h2>\n";
7427  htmlFile << " <img src=\"OccPlots_HF.png\" /><br><br>\n";
7428  htmlFile << "<br>\n";
7429  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7430 
7431  htmlFile << "<a name=\"ErrorB\"></a>\n";
7432  htmlFile << "<h2> 7. Error type B (only 2 depthes shown as example) \n";
7433  htmlFile << "<h3> ErrorB identification: digi-collection size != 4. </h3>\n";
7434  htmlFile << " <img src=\"HistErrB_HF_1.png\" />\n<br>\n";
7435  htmlFile << " <img src=\"HistErrB_HF_2.png\" />\n<br>\n";
7436  htmlFile << "<br>\n";
7437  htmlFile << "<h3> if Error type B is available, it start from: " << LSofFirstErrB_HF << " LS </h3>\n";
7438  htmlFile << "<br>\n";
7439  }
7440  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7441 
7442  } //test=1 Amplitude
7443 
7444  if (test == 1)
7445  htmlFile << "<a name=\"LSstatus\"></a>\n";
7446  // Continue with common sections
7447  if (sub == 1) {
7448  htmlFile << "<h2> 8.Lumisection Status for HB: </h2>" << std::endl;
7449  // 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;
7450  htmlFile << "<h3> Legends: Red boxes correspond BAD LS selected with following cuts: " << Cut0[test][sub][1]
7451  << " (Depth1), " << Cut0[test][sub][2] << " (Depth2), " << Cut0[test][sub][3] << " (Depth3), "
7452  << Cut0[test][sub][4] << " (Depth4), </h3>" << std::endl;
7453  }
7454  if (sub == 2) {
7455  htmlFile << "<h2> 8.Lumisection Status for HE: </h2>" << std::endl;
7456  htmlFile << "<h3> Legends: Red boxes correspond BAD LS selected with following cuts: " << Cut0[test][sub][1]
7457  << " (Depth1), " << Cut0[test][sub][2] << " (Depth2), " << Cut0[test][sub][3] << " (Depth3),"
7458  << Cut0[test][sub][4] << " (Depth4)," << Cut0[test][sub][5] << " (Depth5)," << Cut0[test][sub][6]
7459  << " (Depth6)," << Cut0[test][sub][7] << " (Depth7). </h3>" << std::endl;
7460  }
7461  if (sub == 3) {
7462  // htmlFile << Form("<h2> %d.Lumisection Status for HO </h2>",4+flagSpecHF)<< std::endl;
7463  htmlFile << "<h2> 8.Lumisection Status for HO: </h2>" << std::endl;
7464  htmlFile << "<h3> Legends: Red boxes correspond BAD LS selected with following cuts: " << Cut0[test][sub][4]
7465  << " (Depth4). </h3>" << std::endl;
7466  }
7467  if (sub == 4) {
7468  htmlFile << "<h2> 8.Lumisection Status for HF: </h2>" << std::endl;
7469  htmlFile << "<h3> Legends: Red boxes correspond BAD LS selected with following cuts: " << Cut0[test][sub][1]
7470  << " (Depth1), " << Cut0[test][sub][2] << " (Depth2), " << Cut0[test][sub][3] << " (Depth3), "
7471  << Cut0[test][sub][4] << " (Depth4), </h3>" << std::endl;
7472  }
7473  htmlFile << "<br>" << std::endl;
7474  htmlFile << "<table>" << std::endl;
7475  htmlFile << "<tr>";
7476  htmlFile << "<td class=\"s4\" align=\"center\">LS</td>" << std::endl;
7477  // htmlFile << "<td class=\"s1\" align=\"center\">LS</td>" << std::endl;
7478  htmlFile << "<td class=\"s1\" align=\"center\">Number of events</td>" << std::endl;
7480 
7481  int kkkkkkmax = k_max[sub];
7482  if ((sub == 4 || sub == 2 || sub == 1) && test == 1)
7483  kkkkkkmax = k_maxupgrade[sub];
7484  // if ( (sub==4 || sub==2) && test==1) kkkkkkmax = k_maxupgrade[sub];
7485  // if (test==1 && sub==4) kkkkkkmax = k_maxupgrade[sub];
7486 
7487  if (test == 0)
7488  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
7489  htmlFile << "<td class=\"s1\" align=\"center\">< Nbcs > Depth " << k << " </td>" << std::endl;
7490  if (test == 1)
7491  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
7492  htmlFile << "<td class=\"s1\" align=\"center\">< A > Depth " << k << " </td>" << std::endl;
7493  if (test == 2)
7494  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
7495  htmlFile << "<td class=\"s1\" align=\"center\">< W > Depth " << k << " </td>" << std::endl;
7496  if (test == 3)
7497  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
7498  htmlFile << "<td class=\"s1\" align=\"center\">< R > Depth " << k << " </td>" << std::endl;
7499  if (test == 4)
7500  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
7501  htmlFile << "<td class=\"s1\" align=\"center\">< TSn > Depth " << k << " </td>" << std::endl;
7502  if (test == 5)
7503  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
7504  htmlFile << "<td class=\"s1\" align=\"center\">< TSx > Depth " << k << " </td>" << std::endl;
7505  htmlFile << "</tr>" << std::endl;
7506 
7507  ind = 0;
7508  for (int i = 1; i <= MaxLum; i++) {
7509  if ((ind % 2) == 1)
7510  raw_class = "<td class=\"s2\" align=\"center\">";
7511  else
7512  raw_class = "<td class=\"s3\" align=\"center\">";
7513  htmlFile << "<tr>" << std::endl;
7514  htmlFile << "<td class=\"s4\" align=\"center\">" << i << "</td>" << std::endl;
7515  // htmlFile << raw_class<< LumLum->GetBinContent(i)<<"</td>"<< std::endl;
7516  htmlFile << raw_class << LumiEv->GetBinContent(i) << "</td>" << std::endl;
7517  for (int k = k_min[sub]; k <= kkkkkkmax; k++) {
7518  if (HistNumBadChanDepth[test][sub][k]->GetBinContent(i) > Cut0[test][sub][k]) {
7519  if (test == 1)
7520  htmlFile << "<td class=\"s6\" align=\"center\">"
7521  << int(HistNumBadChanDepth[test][sub][k]->GetBinContent(i)) << "</td>" << std::endl;
7522  else
7523  htmlFile << "<td class=\"s6\" align=\"center\">" << (HistNumBadChanDepth[test][sub][k]->GetBinContent(i))
7524  << "</td>" << std::endl;
7525  } else {
7526  if (test == 1)
7527  htmlFile << raw_class << int(HistNumBadChanDepth[test][sub][k]->GetBinContent(i)) << "</td>" << std::endl;
7528  else
7529  htmlFile << raw_class << (HistNumBadChanDepth[test][sub][k]->GetBinContent(i)) << "</td>" << std::endl;
7530  }
7531  }
7532  htmlFile << "</tr>" << std::endl;
7533  ind += 1;
7534  }
7535  htmlFile << "</table>" << std::endl;
7536 
7537  htmlFile << "<br>" << std::endl;
7538  if (test == 1)
7539  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7540  htmlFile << "<br>" << std::endl;
7541 
7542  // Only for Amplitudes (test=1):
7544  if (test == 1) {
7547  htmlFile << "<a name=\"RBXstatus\"></a>\n";
7548 
7549  //HB j = 7,8,9,10 11,12,13,14
7550  if (sub == 1) {
7551  htmlFile << "<h2> 9. Average Amplitudes of RBX for HB: </h2>" << std::endl;
7552  htmlFile << "<h3> where </h3>" << std::endl;
7553  htmlFile << "<h3> jeta = 7,8,9,10 (Negative direction); ............&& ............ jeta = 11,12,13,14 "
7554  "(Positive direction); </h3>"
7555  << std::endl;
7556  htmlFile << "<h3> jphi = 0, 1,..... 16, 17 </h3>" << std::endl;
7557  // 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;
7558  htmlFile << " <img src=\"RBX-HB-2Dplot.png\" />\n";
7559  htmlFile << "<br>\n";
7560 
7561  htmlFile << "<h2> Average Amplitudes of RBX-PHI for HB: </h2>" << std::endl;
7562  htmlFile << " <img src=\"RBX-HB-1Dplot.png\" />\n";
7563  htmlFile << "<br>\n";
7564 
7565  htmlFile << "<h2> Average Amplitudes of RBX-ETA for HB: </h2>" << std::endl;
7566  htmlFile << " <img src=\"RBX-HB-11Dplot.png\" />\n";
7567  htmlFile << "<br>\n";
7568 
7569  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7570  }
7571  // HE: j = 3,4,5, 6, 7 14,15,16,17,18
7572  if (sub == 2) {
7573  htmlFile << "<h2> 9. Averaged Amplitudes of RBX for HE: </h2>" << std::endl;
7574  htmlFile << "<h3> where </h3>" << std::endl;
7575  htmlFile << "<h3> jeta = 3,4,5, 6, 7 (Negative direction); ............&& ............ jeta = "
7576  "14,15,16,17,18 (Positive direction); </h3>"
7577  << std::endl;
7578  htmlFile << "<h3> jphi = 0, 1,..... 16, 17 </h3>" << std::endl;
7579  // 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;
7580  htmlFile << " <img src=\"RBX-HE-2Dplot.png\" />\n";
7581  htmlFile << "<br>\n";
7582 
7583  htmlFile << "<h2> Average Amplitudes of RBX-PHI for HE: </h2>" << std::endl;
7584  htmlFile << " <img src=\"RBX-HE-1Dplot.png\" />\n";
7585  htmlFile << "<br>\n";
7586 
7587  htmlFile << "<h2> Average Amplitudes of RBX-ETA for HE: </h2>" << std::endl;
7588  htmlFile << " <img src=\"RBX-HE-11Dplot.png\" />\n";
7589  htmlFile << "<br>\n";
7590 
7591  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7592  }
7593  // HO: j = 7,8,9,10 11,12,13,14
7594  if (sub == 3) {
7595  htmlFile << "<h2> 9. Averaged Amplitudes of RBX for HO: </h2>" << std::endl;
7596  htmlFile << "<h3> where </h3>" << std::endl;
7597  htmlFile << "<h3> jeta = 7,8,9,10 (Negative direction); ............&& ............ jeta = 11,12,13,14 "
7598  "(Positive direction); </h3>"
7599  << std::endl;
7600  htmlFile << "<h3> jphi = 0, 1,..... 16, 17 </h3>" << std::endl;
7601  // 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;
7602  htmlFile << " <img src=\"RBX-HO-2Dplot.png\" />\n";
7603  htmlFile << "<br>\n";
7604 
7605  htmlFile << "<h2> Average Amplitudes of RBX-PHI for HO: </h2>" << std::endl;
7606  htmlFile << " <img src=\"RBX-HO-1Dplot.png\" />\n";
7607  htmlFile << "<br>\n";
7608 
7609  htmlFile << "<h2> Average Amplitudes of RBX-ETA for HO: </h2>" << std::endl;
7610  htmlFile << " <img src=\"RBX-HO-11Dplot.png\" />\n";
7611  htmlFile << "<br>\n";
7612 
7613  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7614  }
7615  //HF:j = 0,1,2, 3 18,19,20,21
7616  if (sub == 4) {
7617  htmlFile << "<h2> 9. Averaged Amplitudes of RBX for HF: </h2>" << std::endl;
7618  htmlFile << "<h3> where </h3>" << std::endl;
7619  htmlFile << "<h3> jeta = 0,1,2, 3 (Negative direction); ............&& ............ jeta = 18,19,20,21 "
7620  "(Positive direction); </h3>"
7621  << std::endl;
7622  htmlFile << "<h3> jphi = 0, 1,..... 16, 17 </h3>" << std::endl;
7623  // 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;
7624  htmlFile << " <img src=\"RBX-HF-2Dplot.png\" />\n";
7625  htmlFile << "<br>\n";
7626 
7627  htmlFile << "<h2> Average Amplitudes of RBX-PHI for HF: </h2>" << std::endl;
7628  htmlFile << " <img src=\"RBX-HF-1Dplot.png\" />\n";
7629  htmlFile << "<br>\n";
7630 
7631  htmlFile << "<h2> Average Amplitudes of RBX-ETA for HF: </h2>" << std::endl;
7632  htmlFile << " <img src=\"RBX-HF-11Dplot.png\" />\n";
7633  htmlFile << "<br>\n";
7634 
7635  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7636  }
7637  htmlFile << "<br>" << std::endl;
7638 
7641 
7642  htmlFile << "<a name=\"RBXPHItable\"></a>\n";
7643  int cutA_ALL = 0;
7644  // float cutA_HB = 100.;float cutA_HE = 1000000.;float cutA_HO = 150.;float cutA_HF = 500.;
7645  if (sub == 1) {
7646  htmlFile << "<h2> 10. Average RBX-Amplitude in Phi over LSs for HB: </h2>" << std::endl;
7647  htmlFile
7648  << "<h3> Legends: Red boxes correspond BAD LS selected with cut = <td class=\"s6\" align=\"center\">"
7649  << cutA_HB << std::endl;
7650  cutA_ALL = cutA_HB;
7651  }
7652  if (sub == 2) {
7653  htmlFile << "<h2> 10. Average RBX-Amplitude in Phi over LSs for HE: </h2>" << std::endl;
7654  htmlFile
7655  << "<h3> Legends: Red boxes correspond BAD LS selected with cut = <td class=\"s6\" align=\"center\">"
7656  << cutA_HE << std::endl;
7657  cutA_ALL = cutA_HE;
7658  }
7659  if (sub == 3) {
7660  htmlFile << "<h2> 10. Average RBX-Amplitude in Phi over LSs for HO: </h2>" << std::endl;
7661  htmlFile
7662  << "<h3> Legends: Red boxes correspond BAD LS selected with cut = <td class=\"s6\" align=\"center\">"
7663  << cutA_HO << std::endl;
7664  cutA_ALL = cutA_HO;
7665  }
7666  if (sub == 4) {
7667  htmlFile << "<h2> 10. Average RBX-Amplitude in Phi over LSs for HF: </h2>" << std::endl;
7668  htmlFile
7669  << "<h3> Legends: Red boxes correspond BAD LS selected with cut = <td class=\"s6\" align=\"center\">"
7670  << cutA_HF << std::endl;
7671  cutA_ALL = cutA_HF;
7672  }
7673 
7674  htmlFile << "<br>" << std::endl;
7675  htmlFile << "<table>" << std::endl;
7676  htmlFile << "<tr>";
7677  htmlFile << "<td class=\"s4\" align=\"center\">LS</td>" << std::endl;
7678  // htmlFile << "<td class=\"s1\" align=\"center\">LS</td>" << std::endl;
7679  htmlFile << "<td class=\"s1\" align=\"center\">Number of events</td>" << std::endl;
7681 
7682  // k is jphi
7683  for (int k = 0; k < njphi; k++)
7684  htmlFile << "<td class=\"s1\" align=\"center\"> iPHI " << k << " </td>" << std::endl;
7685  htmlFile << "</tr>" << std::endl;
7687 
7688  ind = 0;
7689  // i is LS
7690  for (int i = 1; i <= MaxLum; i++) {
7691  if ((ind % 2) == 1)
7692  raw_class = "<td class=\"s2\" align=\"center\">";
7693  else
7694  raw_class = "<td class=\"s3\" align=\"center\">";
7695  htmlFile << "<tr>" << std::endl;
7696  htmlFile << "<td class=\"s4\" align=\"center\">" << i << "</td>" << std::endl;
7697  // htmlFile << raw_class<< LumLum->GetBinContent(i)<<"</td>"<< std::endl;
7698  htmlFile << raw_class << LumiEv->GetBinContent(i) << "</td>" << std::endl;
7699 
7700  // k is jphi
7701  for (int k = 0; k < njphi; k++) {
7702  if (sub == 1) {
7703  if (int(alexhb[k][i - 1]) > cutA_ALL) {
7704  htmlFile << "<td class=\"s6\" align=\"center\">" << int(alexhb[k][i - 1]) << "</td>" << std::endl;
7705  } else {
7706  htmlFile << raw_class << int(alexhb[k][i - 1]) << "</td>" << std::endl;
7707  }
7708  } // HB end
7709  if (sub == 2) {
7710  if (int(alexhe[k][i - 1]) > cutA_ALL) {
7711  htmlFile << "<td class=\"s6\" align=\"center\">" << int(alexhe[k][i - 1]) << "</td>" << std::endl;
7712  } else {
7713  htmlFile << raw_class << int(alexhe[k][i - 1]) << "</td>" << std::endl;
7714  }
7715  } // HE end
7716  if (sub == 3) {
7717  if (int(alexho[k][i - 1]) > cutA_ALL) {
7718  htmlFile << "<td class=\"s6\" align=\"center\">" << int(alexho[k][i - 1]) << "</td>" << std::endl;
7719  } else {
7720  htmlFile << raw_class << int(alexho[k][i - 1]) << "</td>" << std::endl;
7721  }
7722  } // HO end
7723  if (sub == 4) {
7724  if (int(alexhf[k][i - 1]) > cutA_ALL) {
7725  htmlFile << "<td class=\"s6\" align=\"center\">" << int(alexhf[k][i - 1]) << "</td>" << std::endl;
7726  } else {
7727  htmlFile << raw_class << int(alexhf[k][i - 1]) << "</td>" << std::endl;
7728  }
7729  } // HF end
7731  } // k over PHI-RBX
7732  htmlFile << "</tr>" << std::endl;
7733  ind += 1;
7734  } // i over LSs
7735  htmlFile << "</table>" << std::endl;
7736  htmlFile << "<br>" << std::endl;
7737  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7738  htmlFile << "<br>" << std::endl;
7740 
7741  htmlFile << "<a name=\"RBXETAtable\"></a>\n";
7742  int cutB_ALL = 0;
7743  // float cutB_HB = 100.;float cutB_HE = 1000000.;float cutB_HO = 150.;float cutB_HF = 500.;
7744  if (sub == 1) {
7745  htmlFile << "<h2> 11. Average RBX-Amplitude in Eta over LSs for HB: </h2>" << std::endl;
7746  htmlFile
7747  << "<h3> Legends: Red boxes correspond BAD LS selected with cut = <td class=\"s6\" align=\"center\">"
7748  << cutB_HB << std::endl;
7749  cutB_ALL = cutB_HB;
7750  }
7751  if (sub == 2) {
7752  htmlFile << "<h2> 11. Average RBX-Amplitude in Eta over LSs for HE: </h2>" << std::endl;
7753  htmlFile
7754  << "<h3> Legends: Red boxes correspond BAD LS selected with cut = <td class=\"s6\" align=\"center\">"
7755  << cutB_HE << std::endl;
7756  cutB_ALL = cutB_HE;
7757  }
7758  if (sub == 3) {
7759  htmlFile << "<h2> 11. Average RBX-Amplitude in Eta over LSs for HO: </h2>" << std::endl;
7760  htmlFile
7761  << "<h3> Legends: Red boxes correspond BAD LS selected with cut = <td class=\"s6\" align=\"center\">"
7762  << cutB_HO << std::endl;
7763  cutB_ALL = cutB_HO;
7764  }
7765  if (sub == 4) {
7766  htmlFile << "<h2> 11. Average RBX-Amplitude in Eta over LSs for HF: </h2>" << std::endl;
7767  htmlFile
7768  << "<h3> Legends: Red boxes correspond BAD LS selected with cut = <td class=\"s6\" align=\"center\">"
7769  << cutB_HF << std::endl;
7770  cutB_ALL = cutB_HF;
7771  }
7772 
7773  htmlFile << "<br>" << std::endl;
7774  htmlFile << "<table>" << std::endl;
7775  htmlFile << "<tr>";
7776  htmlFile << "<td class=\"s4\" align=\"center\">LS</td>" << std::endl;
7777  // htmlFile << "<td class=\"s1\" align=\"center\">LS</td>" << std::endl;
7778  htmlFile << "<td class=\"s1\" align=\"center\">Number of events</td>" << std::endl;
7780 
7781  // k is jeta
7782  for (int k = 0; k < njeta; k++)
7783  htmlFile << "<td class=\"s1\" align=\"center\"> iETA " << k << " </td>" << std::endl;
7784  htmlFile << "</tr>" << std::endl;
7786 
7787  ind = 0;
7788  // i is LS
7789  for (int i = 1; i <= MaxLum; i++) {
7790  if ((ind % 2) == 1)
7791  raw_class = "<td class=\"s2\" align=\"center\">";
7792  else
7793  raw_class = "<td class=\"s3\" align=\"center\">";
7794  htmlFile << "<tr>" << std::endl;
7795  htmlFile << "<td class=\"s4\" align=\"center\">" << i << "</td>" << std::endl;
7796  // htmlFile << raw_class<< LumLum->GetBinContent(i)<<"</td>"<< std::endl;
7797  htmlFile << raw_class << LumiEv->GetBinContent(i) << "</td>" << std::endl;
7798 
7799  // k is jeta
7800  for (int k = 0; k < njeta; k++) {
7801  if (sub == 1) {
7802  if (int(blexhb[k][i - 1]) > cutB_ALL) {
7803  htmlFile << "<td class=\"s6\" align=\"center\">" << int(blexhb[k][i - 1]) << "</td>" << std::endl;
7804  } else {
7805  htmlFile << raw_class << int(blexhb[k][i - 1]) << "</td>" << std::endl;
7806  }
7807  } // HB end
7808  if (sub == 2) {
7809  if (int(blexhe[k][i - 1]) > cutB_ALL) {
7810  htmlFile << "<td class=\"s6\" align=\"center\">" << int(blexhe[k][i - 1]) << "</td>" << std::endl;
7811  } else {
7812  htmlFile << raw_class << int(blexhe[k][i - 1]) << "</td>" << std::endl;
7813  }
7814  } // HE end
7815  if (sub == 3) {
7816  if (int(blexho[k][i - 1]) > cutB_ALL) {
7817  htmlFile << "<td class=\"s6\" align=\"center\">" << int(blexho[k][i - 1]) << "</td>" << std::endl;
7818  } else {
7819  htmlFile << raw_class << int(blexho[k][i - 1]) << "</td>" << std::endl;
7820  }
7821  } // HO end
7822  if (sub == 4) {
7823  if (int(blexhf[k][i - 1]) > cutB_ALL) {
7824  htmlFile << "<td class=\"s6\" align=\"center\">" << int(blexhf[k][i - 1]) << "</td>" << std::endl;
7825  } else {
7826  htmlFile << raw_class << int(blexhf[k][i - 1]) << "</td>" << std::endl;
7827  }
7828  } // HF end
7830  } // k over ETA-RBX
7831  htmlFile << "</tr>" << std::endl;
7832  ind += 1;
7833  } // i over LSs
7834  htmlFile << "</table>" << std::endl;
7835  htmlFile << "<br>" << std::endl;
7836  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7837  htmlFile << "<br>" << std::endl;
7839 
7842  htmlFile << "<a name=\"RBX3plots\"></a>\n";
7843  htmlFile << "<br>\n";
7844  htmlFile << "<h2> 12. (Rij) - RBX-amplitudes normilized on reference LS (~=1st) </h2>" << std::endl;
7845  htmlFile << "<h3> ( Rji . . is ratio of . . . . A_j_i . . to . . A_j_ref . . . . for . . j-RBX . . and . . "
7846  "i-LS . ) </h3>"
7847  << std::endl;
7848 
7849  htmlFile << "<br>\n";
7850  htmlFile << "<h2> . . . . . . . . . . . . . . 1) . average Ri vs iLS:. . . . . . . . . . . . . . . . . . . . . "
7851  ". . 2) . average Rj shown for Rij outside meanValue range either 0.95-1.05 or 3RMS: . . . . . . . "
7852  ". . . . . . . . . . . . . . . . . . 3) . Rij: </h2>"
7853  << std::endl;
7854  htmlFile << "<br>\n";
7855  if (sub == 1) {
7856  htmlFile << " <img src=\"RBX-HB-3plots.png\" />\n";
7857  }
7858  if (sub == 2) {
7859  htmlFile << " <img src=\"RBX-HE-3plots.png\" />\n";
7860  }
7861  if (sub == 3) {
7862  htmlFile << " <img src=\"RBX-HO-3plots.png\" />\n";
7863  }
7864  if (sub == 4) {
7865  htmlFile << " <img src=\"RBX-HF-3plots.png\" />\n";
7866  }
7867  htmlFile << "<br>\n";
7868 
7869  htmlFile << "<br>\n";
7870  htmlFile << "<h2> . 4). average Rj shown for Rij outside meanValue range 0.80-1.20: . . . . . . . .5) . "
7871  "average Rj shown for Rij outside meanValue range 0.70-1.30: . . . . . . . .6). average Rj shown "
7872  "for Rij outside meanValue range 0.60-1.40: </h2>"
7873  << std::endl;
7874  htmlFile << "<br>\n";
7875  if (sub == 1) {
7876  htmlFile << " <img src=\"RBX-HB-3plotsmore.png\" />\n";
7877  }
7878  if (sub == 2) {
7879  htmlFile << " <img src=\"RBX-HE-3plotsmore.png\" />\n";
7880  }
7881  if (sub == 3) {
7882  htmlFile << " <img src=\"RBX-HO-3plotsmore.png\" />\n";
7883  }
7884  if (sub == 4) {
7885  htmlFile << " <img src=\"RBX-HF-3plotsmore.png\" />\n";
7886  }
7887  htmlFile << "<br>\n";
7888 
7889  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
7890 
7891  //=========================================================
7892 
7893  } // test=1
7894 
7895  //===============================================================================
7896 
7897  htmlFile.close();
7898  } // sub main loop
7899  } //test main loop
7900  //===============================================================================
7901  //===============================================================================
7902  //===============================================================================
7903  //===============================================================================
7904  //===============================================================================
7905 
7906  //======================================================================
7907  // Creating tests html pages:
7908 
7909  for (int test = 0; test <= 5; test++) { //Test: 0,
7910  if (test == 0)
7911  htmlFile.open("CapID_GL.html");
7912  if (test == 1)
7913  htmlFile.open("ADCampl_GL.html");
7914  if (test == 2)
7915  htmlFile.open("Width_GL.html");
7916  if (test == 3)
7917  htmlFile.open("Ratio_GL.html");
7918  if (test == 4)
7919  htmlFile.open("Tmean_GL.html");
7920  if (test == 5)
7921  htmlFile.open("Tmax_GL.html");
7922 
7923  // cout<<"Creating tests html pages: test= "<< test << endl;
7924 
7925  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
7926  htmlFile << "<head>" << std::endl;
7927  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
7928  htmlFile << "<title> Certification Monitoring Tool </title>" << std::endl;
7929  htmlFile << "<style type=\"text/css\">" << std::endl;
7930  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
7931  << std::endl;
7932  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
7933  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
7934  "text-align: center;}"
7935  << std::endl;
7936  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
7937  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
7938  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
7939  htmlFile << " td.s5 { font-family: arial, arial ce, helvetica; background-color: #00FF00; }" << std::endl;
7940  htmlFile << " td.s6 { font-family: arial, arial ce, helvetica; background-color: #FF0000; }" << std::endl;
7941  htmlFile << "</style>" << std::endl;
7942  htmlFile << "<body>" << std::endl;
7943  if (test == 0)
7944  htmlFile << "<h1> CAP ID ERRORS, GLOBAL RUN = " << runnumber << " </h1>" << std::endl;
7945  if (test == 1)
7946  htmlFile << "<h1> ADC AMPLITIDE, GLOBAL RUN = " << runnumber << " </h1>" << std::endl;
7947  if (test == 2)
7948  htmlFile << "<h1> WIDTH, GLOBAL RUN = " << runnumber << " </h1>" << std::endl;
7949  if (test == 3)
7950  htmlFile << "<h1> RATIO, GLOBAL RUN = " << runnumber << " </h1>" << std::endl;
7951  if (test == 4)
7952  htmlFile << "<h1> TIMING MEAN, GLOBAL RUN = " << runnumber << " </h1>" << std::endl;
7953  if (test == 5)
7954  htmlFile << "<h1> TIMING MAX, GLOBAL RUN = " << runnumber << " </h1>" << std::endl;
7955  htmlFile << "<br>" << std::endl;
7956  htmlFile << "<h2> 1. Map of suspicious channels with this criterion for whole HCAL </h2>" << std::endl;
7957  htmlFile << "<h3> Channel legend: green - good, other colour - suspicious </h3>" << std::endl;
7958  htmlFile << "<br>" << std::endl;
7959  if (test == 0)
7960  htmlFile << " <img src=\"MapCapIdError.png\" />" << std::endl;
7961  if (test == 1)
7962  htmlFile << " <img src=\"MapADCAmpl.png\" />" << std::endl;
7963  if (test == 2)
7964  htmlFile << " <img src=\"MapWidth.png\" />" << std::endl;
7965  if (test == 3)
7966  htmlFile << " <img src=\"MapRatio.png\" />" << std::endl;
7967  if (test == 4)
7968  htmlFile << " <img src=\"MapTmean.png\" />" << std::endl;
7969  if (test == 5)
7970  htmlFile << " <img src=\"MapTmax.png\" />" << std::endl;
7971  htmlFile << "<br>" << std::endl;
7972  htmlFile << "<h2> 2. For whole HCAL: </h2>" << std::endl;
7973  htmlFile << "<br>" << std::endl;
7974  if (test == 0)
7975  htmlFile << " <img src=\"HistCapID.png\" />" << std::endl;
7976  if (test == 1)
7977  htmlFile << " <img src=\"HistADCAmpl.png\" />" << std::endl;
7978  if (test == 2)
7979  htmlFile << " <img src=\"HistWidth.png\" />" << std::endl;
7980  if (test == 3)
7981  htmlFile << " <img src=\"HistRatio.png\" />" << std::endl;
7982  if (test == 4)
7983  htmlFile << " <img src=\"HistTmean.png\" />" << std::endl;
7984  if (test == 5)
7985  htmlFile << " <img src=\"HistTmax.png\" />" << std::endl;
7986  htmlFile << "<br>" << std::endl;
7987  htmlFile << "<h2> 3. Status of subdetectors </h2>" << std::endl;
7988  htmlFile << "<table width=\"400\">" << std::endl;
7989  htmlFile << "<tr>" << std::endl;
7990  if (test == 0) {
7991  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
7992  << "/HB_CapID.html\">HB</a></td>" << std::endl;
7993  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
7994  << "/HE_CapID.html\">HE</a></td>" << std::endl;
7995  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
7996  << "/HO_CapID.html\">HO</a></td>" << std::endl;
7997  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
7998  << "/HF_CapID.html\">HF</a></td>" << std::endl;
7999  }
8000  if (test == 1) {
8001  // AZ 11.03.2019
8002  /*
8003  htmlFile << " <td><a href=\"HB_ADCampl.html\">HB</a></td>"<< std::endl;
8004  htmlFile << " <td><a href=\"HE_ADCampl.html\">HE</a></td>"<< std::endl;
8005  htmlFile << " <td><a href=\"HO_ADCampl.html\">HO</a></td>"<< std::endl;
8006  htmlFile << " <td><a href=\"HF_ADCampl.html\">HF</a></td>"<< std::endl;
8007 */
8008 
8009  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8010  << "/HB_ADCampl.html\">HB</a></td>" << std::endl;
8011  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8012  << "/HE_ADCampl.html\">HE</a></td>" << std::endl;
8013  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8014  << "/HO_ADCampl.html\">HO</a></td>" << std::endl;
8015  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8016  << "/HF_ADCampl.html\">HF</a></td>" << std::endl;
8017  }
8018  if (test == 2) {
8019  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8020  << "/HB_Width.html\">HB</a></td>" << std::endl;
8021  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8022  << "/HE_Width.html\">HE</a></td>" << std::endl;
8023  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8024  << "/HO_Width.html\">HO</a></td>" << std::endl;
8025  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8026  << "/HF_Width.html\">HF</a></td>" << std::endl;
8027  }
8028  if (test == 3) {
8029  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8030  << "/HB_Ratio.html\">HB</a></td>" << std::endl;
8031  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8032  << "/HE_Ratio.html\">HE</a></td>" << std::endl;
8033  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8034  << "/HO_Ratio.html\">HO</a></td>" << std::endl;
8035  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8036  << "/HF_Ratio.html\">HF</a></td>" << std::endl;
8037  }
8038  if (test == 4) {
8039  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8040  << "/HB_Tmean.html\">HB</a></td>" << std::endl;
8041  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8042  << "/HE_Tmean.html\">HE</a></td>" << std::endl;
8043  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8044  << "/HO_Tmean.html\">HO</a></td>" << std::endl;
8045  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8046  << "/HF_Tmean.html\">HF</a></td>" << std::endl;
8047  }
8048  if (test == 5) {
8049  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8050  << "/HB_Tmax.html\">HB</a></td>" << std::endl;
8051  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8052  << "/HE_Tmax.html\">HE</a></td>" << std::endl;
8053  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8054  << "/HO_Tmax.html\">HO</a></td>" << std::endl;
8055  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8056  << "/HF_Tmax.html\">HF</a></td>" << std::endl;
8057  }
8058 
8059  htmlFile << "</tr>" << std::endl;
8060  htmlFile << "</table>" << std::endl;
8061  htmlFile << "<br>" << std::endl;
8062  // cout<<"Creating tests html pages: 111111" << endl;
8063 
8064  if (test != 0)
8065  htmlFile << "<h2> 4. Table of estimator-values in sub-detectors for ONLY suspicious LSs </h3>" << std::endl;
8066  if (test == 0)
8067  htmlFile << "<h2> 4. Table of average Nbcs in sub-detectors for ONLY suspicious LSs </h3>" << std::endl;
8068  htmlFile << "<table>" << std::endl;
8069  htmlFile << "<tr>";
8070  htmlFile << "<td class=\"s4\" align=\"center\">LS</td>" << std::endl;
8071  // htmlFile << "<td class=\"s1\" align=\"center\">LS</td>" << std::endl;
8072  htmlFile << "<td class=\"s1\" align=\"center\">Number of events</td>" << std::endl;
8074  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
8075 
8076  // cout<<"Creating each test kind for each subdet html pages: test= "<< test << " sub= " << sub << endl;
8077  int kkkkkkmax = k_max[sub];
8078  if ((sub == 4 || sub == 2 || sub == 1) && test == 1)
8079  kkkkkkmax = k_maxupgrade[sub];
8080  // if ( (sub==4 || sub==2) && test==1) kkkkkkmax = k_maxupgrade[sub];
8081  // if (test==1 && sub==4) kkkkkkmax = k_maxupgrade[sub];
8082  if (sub == 1) {
8083  if (test == 0)
8084  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8085  htmlFile << "<td class=\"s1\" align=\"center\">< Nbcs > HBdep " << k << " </td>" << std::endl;
8086  if (test == 1)
8087  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8088  htmlFile << "<td class=\"s1\" align=\"center\">< A > HBdepth " << k << " </td>" << std::endl;
8089  if (test == 2)
8090  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8091  htmlFile << "<td class=\"s1\" align=\"center\">< W > HBdepth " << k << " </td>" << std::endl;
8092  if (test == 3)
8093  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8094  htmlFile << "<td class=\"s1\" align=\"center\">< R > HBdepth " << k << " </td>" << std::endl;
8095  if (test == 4)
8096  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8097  htmlFile << "<td class=\"s1\" align=\"center\">< TSn > HBdep " << k << " </td>" << std::endl;
8098  if (test == 5)
8099  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8100  htmlFile << "<td class=\"s1\" align=\"center\">< TSx > HBdep " << k << " </td>" << std::endl;
8101  } //
8102  if (sub == 2) {
8103  if (test == 0)
8104  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8105  htmlFile << "<td class=\"s1\" align=\"center\">< Nbcs > HEdep " << k << " </td>" << std::endl;
8106  if (test == 1)
8107  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8108  htmlFile << "<td class=\"s1\" align=\"center\">< A > HEdepth " << k << " </td>" << std::endl;
8109  if (test == 2)
8110  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8111  htmlFile << "<td class=\"s1\" align=\"center\">< W > HEdepth " << k << " </td>" << std::endl;
8112  if (test == 3)
8113  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8114  htmlFile << "<td class=\"s1\" align=\"center\">< R > HEdepth " << k << " </td>" << std::endl;
8115  if (test == 4)
8116  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8117  htmlFile << "<td class=\"s1\" align=\"center\">< TSn > HEdep " << k << " </td>" << std::endl;
8118  if (test == 5)
8119  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8120  htmlFile << "<td class=\"s1\" align=\"center\">< TSx > HEdep " << k << " </td>" << std::endl;
8121  } //
8122  if (sub == 3) {
8123  if (test == 0)
8124  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8125  htmlFile << "<td class=\"s1\" align=\"center\">< Nbcs > HOdep " << k << " </td>" << std::endl;
8126  if (test == 1)
8127  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8128  htmlFile << "<td class=\"s1\" align=\"center\">< A > HOdepth " << k << " </td>" << std::endl;
8129  if (test == 2)
8130  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8131  htmlFile << "<td class=\"s1\" align=\"center\">< W > HOdepth " << k << " </td>" << std::endl;
8132  if (test == 3)
8133  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8134  htmlFile << "<td class=\"s1\" align=\"center\">< R > HOdepth " << k << " </td>" << std::endl;
8135  if (test == 4)
8136  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8137  htmlFile << "<td class=\"s1\" align=\"center\">< TSn > HOdep " << k << " </td>" << std::endl;
8138  if (test == 5)
8139  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8140  htmlFile << "<td class=\"s1\" align=\"center\">< TSx > HOdep " << k << " </td>" << std::endl;
8141  } //
8142  if (sub == 4) {
8143  if (test == 0)
8144  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8145  htmlFile << "<td class=\"s1\" align=\"center\">< Nbcs > HFdep " << k << " </td>" << std::endl;
8146  if (test == 1)
8147  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8148  htmlFile << "<td class=\"s1\" align=\"center\">< A > HFdepth " << k << " </td>" << std::endl;
8149  if (test == 2)
8150  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8151  htmlFile << "<td class=\"s1\" align=\"center\">< W > HFdepth " << k << " </td>" << std::endl;
8152  if (test == 3)
8153  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8154  htmlFile << "<td class=\"s1\" align=\"center\">< R > HFdepth " << k << " </td>" << std::endl;
8155  if (test == 4)
8156  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8157  htmlFile << "<td class=\"s1\" align=\"center\">< TSn > HFdep " << k << " </td>" << std::endl;
8158  if (test == 5)
8159  for (int k = k_min[sub]; k <= kkkkkkmax; k++)
8160  htmlFile << "<td class=\"s1\" align=\"center\">< TSx > HFdep " << k << " </td>" << std::endl;
8161  } //
8162  } // sub
8163  htmlFile << "</tr>" << std::endl;
8164 
8165  // htmlFile << "<td class=\"s1\" align=\"center\">HB Depth 1</td>"<< std::endl;
8166  // htmlFile << "<td class=\"s1\" align=\"center\">HB Depth 2</td>" << std::endl;
8167  // htmlFile << "<td class=\"s1\" align=\"center\">HE Depth 1</td>" << std::endl;
8168  // htmlFile << "<td class=\"s1\" align=\"center\">HE Depth 2</td>" << std::endl;
8169  // htmlFile << "<td class=\"s1\" align=\"center\">HE Depth 3</td>" << std::endl;
8170  // htmlFile << "<td class=\"s1\" align=\"center\">HE Depth 4</td>" << std::endl;
8171  // htmlFile << "<td class=\"s1\" align=\"center\">HE Depth 5</td>" << std::endl;
8172  // htmlFile << "<td class=\"s1\" align=\"center\">HE Depth 6</td>" << std::endl;
8173  // htmlFile << "<td class=\"s1\" align=\"center\">HE Depth 7</td>" << std::endl;
8174  // htmlFile << "<td class=\"s1\" align=\"center\">HO Depth 4</td>" << std::endl;
8175  // htmlFile << "<td class=\"s1\" align=\"center\">HF Depth 1</td>" << std::endl;
8176  // htmlFile << "<td class=\"s1\" align=\"center\">HF Depth 2</td>" << std::endl;
8177  // htmlFile << "<td class=\"s1\" align=\"center\">HF Depth 3</td>" << std::endl;
8178  // htmlFile << "<td class=\"s1\" align=\"center\">HF Depth 4</td>" << std::endl;
8179  // htmlFile << "</tr>" << std::endl;
8180 
8181  ind = 0;
8182  // cout<<"Creating tests html pages: 222222" << endl;
8183  for (int i = 1; i <= MaxLum; i++) {
8184  // define al least one exceed in any sub-detector
8185  int met = 0;
8186  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
8187  int kkkkkkmax = k_max[sub];
8188  if ((sub == 4 || sub == 2 || sub == 1) && test == 1)
8189  kkkkkkmax = k_maxupgrade[sub];
8190  // if ( (sub==4 || sub==2) && test==1) kkkkkkmax = k_maxupgrade[sub];
8191  for (int k = k_min[sub]; k <= kkkkkkmax; k++) {
8192  // 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
8193  // if (sub == 2 && k > 3) {
8194  // } else {
8195  if (HistNumBadChanDepth[test][sub][k]->GetBinContent(i) > Cut0[test][sub][k])
8196  met = 1;
8197  // }
8198  } //depth
8199  } //sub
8200  // if exceed then plot the line for all sub-detectors
8201  if (met == 1) {
8202  if ((ind % 2) == 1)
8203  raw_class = "<td class=\"s2\" align=\"center\">";
8204  else
8205  raw_class = "<td class=\"s3\" align=\"center\">";
8206  htmlFile << "<tr>" << std::endl;
8207  htmlFile << "<td class=\"s4\" align=\"center\">" << i << "</td>" << std::endl;
8208  // htmlFile << raw_class<< LumLum->GetBinContent(i)<<"</td>"<< std::endl;
8209  htmlFile << raw_class << LumiEv->GetBinContent(i) << "</td>" << std::endl;
8210  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
8211  int kkkkkkmax = k_max[sub];
8212  if ((sub == 4 || sub == 2 || sub == 1) && test == 1)
8213  kkkkkkmax = k_maxupgrade[sub];
8214  // if ( (sub==4 || sub==2) && test==1) kkkkkkmax = k_maxupgrade[sub];
8215  for (int k = k_min[sub]; k <= kkkkkkmax; k++) {
8216  if (HistNumBadChanDepth[test][sub][k]->GetBinContent(i) > Cut0[test][sub][k])
8217  htmlFile << "<td class=\"s6\" align=\"center\">" << HistNumBadChanDepth[test][sub][k]->GetBinContent(i)
8218  << "</td>" << std::endl;
8219  else
8220  htmlFile << raw_class << HistNumBadChanDepth[test][sub][k]->GetBinContent(i) << "</td>" << std::endl;
8221  // htmlFile << "</tr>" << std::endl;
8222  /*
8223  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;
8224  else htmlFile <<raw_class<<HistNumBadChanDepth[test][1][1]->GetBinContent(i)<<"</td>"<< std::endl;
8225  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;
8226  else htmlFile <<raw_class<<HistNumBadChanDepth[test][1][2]->GetBinContent(i)<<"</td>"<< std::endl;
8227  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;
8228  else htmlFile <<raw_class<<HistNumBadChanDepth[test][2][1]->GetBinContent(i)<<"</td>"<< std::endl;
8229  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;
8230  else htmlFile <<raw_class<<HistNumBadChanDepth[test][2][2]->GetBinContent(i)<<"</td>"<< std::endl;
8231  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;
8232  else htmlFile <<raw_class<<HistNumBadChanDepth[test][2][3]->GetBinContent(i)<<"</td>"<< std::endl;
8233  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;
8234  else htmlFile <<raw_class<<HistNumBadChanDepth[test][2][4]->GetBinContent(i)<<"</td>"<< std::endl;
8235  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;
8236  else htmlFile <<raw_class<<HistNumBadChanDepth[test][2][5]->GetBinContent(i)<<"</td>"<< std::endl;
8237  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;
8238  else htmlFile <<raw_class<<HistNumBadChanDepth[test][2][6]->GetBinContent(i)<<"</td>"<< std::endl;
8239  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;
8240  else htmlFile <<raw_class<<HistNumBadChanDepth[test][2][7]->GetBinContent(i)<<"</td>"<< std::endl;
8241  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;
8242  else htmlFile <<raw_class<<HistNumBadChanDepth[test][3][4]->GetBinContent(i)<<"</td>"<< std::endl;
8243  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;
8244  else htmlFile <<raw_class<<HistNumBadChanDepth[test][4][1]->GetBinContent(i)<<"</td>"<< std::endl;
8245  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;
8246  else htmlFile <<raw_class<<HistNumBadChanDepth[test][4][2]->GetBinContent(i)<<"</td>"<< std::endl;
8247  */
8248  } //k depthes
8249  } //sub
8250  htmlFile << "</tr>" << std::endl;
8251  ind += 1;
8252  } // met=1
8253  } //i bin lines
8254  // cout<<"Creating tests html pages: 333333" << endl;
8255  htmlFile << "</table>" << std::endl;
8256  htmlFile << "<br>" << std::endl;
8257  htmlFile << "</body> " << std::endl;
8258  htmlFile << "</html> " << std::endl;
8259  htmlFile.close();
8260  } //test
8261  //======================================================================
8262  // cout<<"for summed Amplitudes of each sub-detector" << endl;
8263 
8264  // for summed Amplitudes of each sub-detector
8265  htmlFile.open("SummedAmplitudes_GL.html");
8266  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
8267  htmlFile << "<head>" << std::endl;
8268  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
8269  htmlFile << "<title> for summed Amplitudes of each sub-detector </title>" << std::endl;
8270  htmlFile << "<style type=\"text/css\">" << std::endl;
8271  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
8272  << std::endl;
8273  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
8274  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
8275  "text-align: center;}"
8276  << std::endl;
8277  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
8278  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
8279  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
8280  htmlFile << " td.s5 { font-family: arial, arial ce, helvetica; background-color: #00FF00; }" << std::endl;
8281  htmlFile << " td.s6 { font-family: arial, arial ce, helvetica; background-color: #FF0000; }" << std::endl;
8282 
8283  htmlFile << "</style>" << std::endl;
8284  htmlFile << "<body>" << std::endl;
8285  htmlFile << "<h1> Averaged Summed Amplitudes & corresponding occupancy of each sub-detector in Global Run = "
8286  << runnumber << " </h1>" << std::endl;
8287  htmlFile << "<a name=\"Top\"></a>\n";
8288  htmlFile << "<b>Contents:<br>\n";
8289  htmlFile << "1. <a href=\"#SAhigh\">average SA&Occupancy for Signal </a><br>\n";
8290  htmlFile << "2. <a href=\"#SAlow\">average SA&Occupancy for NoSignal </a><br>\n";
8291  htmlFile << "3. <a href=\"#SAmax\"> maxSA & maxOccupancy; SA & Occupancy; </a><br>\n";
8292  htmlFile << "4. <a href=\"#FullTable\">Table(avA; avSA; avOccupancy; maxSA; maxOccupancy;) </a><br>\n";
8293 
8294  htmlFile << "<h2> Clarifying on averaged Summed Amplitude (avSA) : </h2>" << std::endl;
8295  htmlFile << "<h3> Summed Amplitudes (SA) are averaged over all events of each LS: avSA_LS = SUM (SA_eventsInLS) / "
8296  "N_eventsInLS ,</h3>"
8297  << std::endl;
8298  htmlFile << "<h3> where SA = SUM(A_i) ,and means that Amplitude is summed over all sub-detector channels, </h3>"
8299  << std::endl;
8300  htmlFile << "<h3> where A_i = SUM(A_depth) denotes channel amplitude summed over depths; </h3>" << std::endl;
8301  // htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_"<<runnumber<<"/HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
8302  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/SAwriteup.html\"> see "
8303  "more details for SummedAmplitudes</a></td>"
8304  << std::endl;
8305  htmlFile << "<h2> Apply cuts on A_i to take into account channels with or/and without a'la Signal: </h2>"
8306  << std::endl;
8307  htmlFile << " <img src=\"ChannelDepthsummedAmplitudes.png\" />" << std::endl;
8308  htmlFile << "<br>" << std::endl;
8309  htmlFile << "<br>" << std::endl;
8310  htmlFile << "<a name=\"SAhigh\"></a>\n";
8311  htmlFile << "<h1> 1. for channels with signal </h1>" << std::endl;
8312  htmlFile << "<br>" << std::endl;
8313  htmlFile << "<h2> for HB: A_i> 80; </h2>" << std::endl;
8314  htmlFile << " <img src=\"SummedAmplitudesSignal_HB.png\" />" << std::endl;
8315  htmlFile << "<br>" << std::endl;
8316  htmlFile << "<h2> for HE: A_i> 200;</h2>" << std::endl;
8317  htmlFile << " <img src=\"SummedAmplitudesSignal_HE.png\" />" << std::endl;
8318  htmlFile << "<br>" << std::endl;
8319  htmlFile << "<h2> for HO: A_i> 1200;</h2>" << std::endl;
8320  htmlFile << " <img src=\"SummedAmplitudesSignal_HO.png\" />" << std::endl;
8321  htmlFile << "<br>" << std::endl;
8322  htmlFile << "<h2> for HF: A_i> 600;</h2>" << std::endl;
8323  htmlFile << " <img src=\"SummedAmplitudesSignal_HF.png\" />" << std::endl;
8324  htmlFile << "<br>" << std::endl;
8325  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
8326 
8327  htmlFile << "<a name=\"SAlow\"></a>\n";
8328  htmlFile << "<h1> 2. for channels w/o signal </h1>" << std::endl;
8329  htmlFile << "<br>" << std::endl;
8330  htmlFile << "<h2> for HB: A_i< 80;</h2>" << std::endl;
8331  htmlFile << " <img src=\"NoSignalSummedAmplitudes_HB.png\" />" << std::endl;
8332  htmlFile << "<br>" << std::endl;
8333  htmlFile << "<h2> for HE: A_i< 200;</h2>" << std::endl;
8334  htmlFile << " <img src=\"NoSignalSummedAmplitudes_HE.png\" />" << std::endl;
8335  htmlFile << "<br>" << std::endl;
8336  htmlFile << "<h2> for HO: A_i< 1200;</h2>" << std::endl;
8337  htmlFile << " <img src=\"NoSignalSummedAmplitudes_HO.png\" />" << std::endl;
8338  htmlFile << "<br>" << std::endl;
8339  htmlFile << "<h2> for HF: A_i< 600;</h2>" << std::endl;
8340  htmlFile << " <img src=\"NoSignalSummedAmplitudes_HF.png\" />" << std::endl;
8341  htmlFile << "<br>" << std::endl;
8342  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
8343 
8344  htmlFile << "<br>" << std::endl;
8345  htmlFile << "<br>" << std::endl;
8346  htmlFile << "<a name=\"SAmax\"></a>\n";
8347  htmlFile << "<h1> 3. four plots: ---1---> max SA ---2---> max Occupancy ---3---> SA ---4---> Occupancy over all "
8348  "events of LS </h1>"
8349  << std::endl;
8350  htmlFile << "<br>" << std::endl;
8351 
8352  htmlFile << "<h2> for HB: maxSA vs LS, masOccupancy vs LS, SA, Occupancy </h2>" << std::endl;
8353  htmlFile << " <img src=\"MaxxSummedAmplitudes_HB.png\" />" << std::endl;
8354  htmlFile << "<h2>"
8355  " ......(forCut:SAmax>60000) N= "
8356  << countamplmaxHB << " ...... (forCut:OCCUPmax>2000) N= " << countoccumaxHB << " </h2>" << std::endl;
8357  htmlFile << "<h2>"
8358  " ......(forCut:SA>60000) N= "
8359  << countamplHB << " ...... (forCut:OCCUP>2000) N= " << countoccuHB << " </h2>" << std::endl;
8360  htmlFile << "<br>" << std::endl;
8361  htmlFile << "<h3> ONLY for HB (cross-check): channel Amplitudes for events in the Tail (averaged): </h3>"
8362  << std::endl;
8363  htmlFile << " <img src=\"AtaildepthHB.png\" />" << std::endl;
8364  htmlFile << "<br>" << std::endl;
8365 
8366  htmlFile << "<h2> for HE: maxSA vs LS, masOccupancy vs LS, SA, Occupancy </h2>" << std::endl;
8367  htmlFile << " <img src=\"MaxxSummedAmplitudes_HE.png\" />" << std::endl;
8368  htmlFile << "<h2>"
8369  " ......(forCut:SAmax>60000) N= "
8370  << countamplmaxHE << " ...... (forCut:OCCUPmax>1200) N= " << countoccumaxHE << " </h2>" << std::endl;
8371  htmlFile << "<h2>"
8372  " ......(forCut:SA>60000) N= "
8373  << countamplHE << " ...... (forCut:OCCUP>1200) N= " << countoccuHE << " </h2>" << std::endl;
8374  htmlFile << "<br>" << std::endl;
8375 
8376  htmlFile << "<h2> for HO: maxSA vs LS, masOccupancy vs LS, SA, Occupancy </h2>" << std::endl;
8377  htmlFile << " <img src=\"MaxxSummedAmplitudes_HO.png\" />" << std::endl;
8378  htmlFile << "<h2>"
8379  " ......(forCut:SAmax>150000) N= "
8380  << countamplmaxHO << " ...... (forCut:OCCUPmax>2000) N= " << countoccumaxHO << " </h2>" << std::endl;
8381  htmlFile << "<h2>"
8382  " ......(forCut:SA>150000) N= "
8383  << countamplHO << " ...... (forCut:OCCUP>2000) N= " << countoccuHO << " </h2>" << std::endl;
8384  htmlFile << "<br>" << std::endl;
8385 
8386  htmlFile << "<h2> for HF: maxSA vs LS, masOccupancy vs LS, SA, Occupancy </h2>" << std::endl;
8387  htmlFile << " <img src=\"MaxxSummedAmplitudes_HF.png\" />" << std::endl;
8388  htmlFile << "<h2>"
8389  " ......(forCut:SAmax>22000) N= "
8390  << countamplmaxHF << " ...... (forCut:OCCUPmax>860) N= " << countoccumaxHF << " </h2>" << std::endl;
8391  htmlFile << "<h2>"
8392  " ......(forCut:SA>22000) N= "
8393  << countamplHF << " ...... (forCut:OCCUP>860) N= " << countoccuHF << " </h2>" << std::endl;
8394  htmlFile << "<br>" << std::endl;
8395  htmlFile << "<h2> Occupancy HF (ONLY) vs LS </h2>" << std::endl;
8396  htmlFile << " <img src=\"sumOccupancyHF.png\" />" << std::endl;
8397  htmlFile << "<br>" << std::endl;
8398  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
8399 
8400  htmlFile << "<a name=\"FullTable\"></a>\n";
8401  htmlFile << "<h2> 4.Lumisection Status: </h2>" << std::endl;
8402  htmlFile << "<h3> Legends: HBdepth1 red boxes correspond LSs selected with cut: <td class=\"s6\" align=\"center\">"
8403  << Cut0[1][1][1] << std::endl;
8404  htmlFile << "<h3> Legends: HEdepth1 red boxes correspond LSs selected with cut: <td class=\"s6\" align=\"center\">"
8405  << Cut0[1][2][1] << std::endl;
8406  htmlFile << "<h3> Legends: HOdepth4 red boxes correspond LSs selected with cut: <td class=\"s6\" align=\"center\">"
8407  << Cut0[1][3][4] << std::endl;
8408  htmlFile << "<h3> Legends: HFdepth1 red boxes correspond LSs selected with cut: <td class=\"s6\" align=\"center\">"
8409  << Cut0[1][4][1] << std::endl;
8410  htmlFile << "<br>" << std::endl;
8411  // SummedAmplitudeHisto[i] SummedAmplitudeOccupancyHisto[i] NoSignalSummedAmplitudeHisto[i] NoSignalSummedAmplitudeOccupancyHisto[i]; i=0-3;(HF:i=3)
8412  htmlFile << "<br>" << std::endl;
8413  htmlFile << "<table>" << std::endl;
8414  htmlFile << "<tr>";
8415  htmlFile << "<td class=\"s4\" align=\"center\">LS</td>" << std::endl;
8416  // htmlFile << "<td class=\"s1\" align=\"center\">LS</td>" << std::endl;
8417  htmlFile << "<td class=\"s1\" align=\"center\"> Num.of ev.</td>" << std::endl;
8418 
8419  // for (int k=k_min[sub];k<=k_max[sub]; k++) htmlFile << "<td class=\"s1\" align=\"center\">< A > Depth "<< k <<" </td>" << std::endl;
8420  // for (int sub=1;sub<=4;sub++) htmlFile << "<td class=\"s1\" align=\"center\">< A > Depth1, sub "<< sub <<" </td>" << std::endl;
8421 
8422  htmlFile << "<td class=\"s1\" align=\"center\">< A >HB Depth1</td>" << std::endl;
8423  htmlFile << "<td class=\"s1\" align=\"center\">< A >HE Depth1</td>" << std::endl;
8424  htmlFile << "<td class=\"s1\" align=\"center\">< A >HO Depth4</td>" << std::endl;
8425  htmlFile << "<td class=\"s1\" align=\"center\">< A >HF Depth1</td>" << std::endl;
8426 
8427  htmlFile << "<td class=\"s1\" align=\"center\">< SA >HB (Signal) </td>" << std::endl;
8428  htmlFile << "<td class=\"s1\" align=\"center\">< Occup. > HB (Signal) </td>" << std::endl;
8429  htmlFile << "<td class=\"s1\" align=\"center\">< SA >HF (Signal) </td>" << std::endl;
8430  htmlFile << "<td class=\"s1\" align=\"center\">< Occup. > HF (Signal) </td>" << std::endl;
8431 
8432  htmlFile << "<td class=\"s1\" align=\"center\">< SA >HB (NoSignal) </td>" << std::endl;
8433  htmlFile << "<td class=\"s1\" align=\"center\">< Occup. > HB (NoSignal) </td>" << std::endl;
8434  htmlFile << "<td class=\"s1\" align=\"center\">< SA >HF (NoSignal) </td>" << std::endl;
8435  htmlFile << "<td class=\"s1\" align=\"center\">< Occup. > HF (NoSignal) </td>" << std::endl;
8436 
8437  htmlFile << "<td class=\"s1\" align=\"center\"> maxSA HB </td>" << std::endl;
8438  htmlFile << "<td class=\"s1\" align=\"center\"> maxOccup. HB </td>" << std::endl;
8439  htmlFile << "<td class=\"s1\" align=\"center\"> maxSA HF </td>" << std::endl;
8440  htmlFile << "<td class=\"s1\" align=\"center\"> maxOccup. HF </td>" << std::endl;
8441 
8442  htmlFile << "</tr>" << std::endl;
8443 
8444  ind = 0;
8445  for (int i = 1; i <= MaxLum; i++) {
8446  if ((ind % 2) == 1)
8447  raw_class = "<td class=\"s2\" align=\"center\">";
8448  else
8449  raw_class = "<td class=\"s3\" align=\"center\">";
8450  htmlFile << "<tr>" << std::endl;
8451 
8452  htmlFile << "<td class=\"s4\" align=\"center\">" << i << "</td>" << std::endl;
8453 
8454  // htmlFile << raw_class<< LumLum->GetBinContent(i)<<"</td>"<< std::endl;
8455  htmlFile << raw_class << LumiEv->GetBinContent(i) << "</td>" << std::endl;
8456 
8457  // (test==1) <Amplitude>
8458  int test = 1;
8459  // for (int k=k_min[sub];k<=k_max[sub]; k++) {
8460  for (int sub = 1; sub <= 4; sub++) {
8461  for (int k = k_min[sub]; k <= k_min[sub]; k++) {
8462  if (HistNumBadChanDepth[test][sub][k]->GetBinContent(i) > Cut0[test][sub][k])
8463  htmlFile << "<td class=\"s6\" align=\"center\">" << HistNumBadChanDepth[test][sub][k]->GetBinContent(i)
8464  << "</td>" << std::endl;
8465 
8466  else
8467  htmlFile << raw_class << HistNumBadChanDepth[test][sub][k]->GetBinContent(i) << "</td>" << std::endl;
8468  }
8469  }
8470  if (SummedAmplitudeHisto[0]) {
8471  htmlFile << raw_class << SummedAmplitudeHisto[0]->GetBinContent(i) << "</td>" << std::endl;
8472  htmlFile << raw_class << SummedAmplitudeOccupancyHisto[0]->GetBinContent(i) << "</td>" << std::endl;
8473  htmlFile << raw_class << SummedAmplitudeHisto[3]->GetBinContent(i) << "</td>" << std::endl;
8474  htmlFile << raw_class << SummedAmplitudeOccupancyHisto[3]->GetBinContent(i) << "</td>" << std::endl;
8475 
8476  htmlFile << raw_class << NoSignalSummedAmplitudeHisto[0]->GetBinContent(i) << "</td>" << std::endl;
8477  htmlFile << raw_class << NoSignalSummedAmplitudeOccupancyHisto[0]->GetBinContent(i) << "</td>" << std::endl;
8478  htmlFile << raw_class << NoSignalSummedAmplitudeHisto[3]->GetBinContent(i) << "</td>" << std::endl;
8479  htmlFile << raw_class << NoSignalSummedAmplitudeOccupancyHisto[3]->GetBinContent(i) << "</td>" << std::endl;
8480 
8481  htmlFile << raw_class << MaxxSummedAmplitudeHisto[0]->GetBinContent(i) << "</td>" << std::endl;
8482  htmlFile << raw_class << MaxxSummedAmplitudeOccupancyHisto[0]->GetBinContent(i) << "</td>" << std::endl;
8483  htmlFile << raw_class << MaxxSummedAmplitudeHisto[3]->GetBinContent(i) << "</td>" << std::endl;
8484  htmlFile << raw_class << MaxxSummedAmplitudeOccupancyHisto[3]->GetBinContent(i) << "</td>" << std::endl;
8485  }
8486  htmlFile << "</tr>" << std::endl;
8487  ind += 1;
8488  }
8489  htmlFile << "</table>" << std::endl;
8490  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
8491 
8492  htmlFile << "<br>" << std::endl;
8493  htmlFile << "</body> " << std::endl;
8494  htmlFile << "</html> " << std::endl;
8495  htmlFile.close();
8496 
8497  //====================================================================== // Creating description of html-files
8498 
8499  /*
8500  //======================================================================
8501  // Creating description HELP.html file:
8502  htmlFile.open("HELP.html");
8503  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">"<< std::endl;
8504  htmlFile << "<head>"<< std::endl;
8505  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>"<< std::endl;
8506  htmlFile << "<title> Certification Monitoring Tool </title>"<< std::endl;
8507  htmlFile << "<style type=\"text/css\">"<< std::endl;
8508  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"<< std::endl;
8509  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }"<< std::endl;
8510  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; text-align: center;}"<< std::endl;
8511  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }"<< std::endl;
8512  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }"<< std::endl;
8513  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }"<< std::endl;
8514  htmlFile << "</style>"<< std::endl;
8515  htmlFile << "<body>"<< std::endl;
8516  htmlFile << "<h1> Description of Remote Monitoring Tool criteria for bad channel selection</h1>"<< std::endl;
8517  htmlFile << "<br>"<< std::endl;
8518  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;
8519  htmlFile << "<br>"<< std::endl;
8520  htmlFile << "<h3> - Amplitude is full amplitude collected over all time slices </h3> "<< std::endl;
8521  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;
8522  htmlFile << "<br>"<< std::endl;
8523  htmlFile << "<h3> - Width of shape distribution. Width is defined as square root from dispersion. </h3> "<< std::endl;
8524  htmlFile << "<br>"<< std::endl;
8525  htmlFile << "<h3> - Mean TS time slice position of adc signal. </h3> "<< std::endl;
8526  htmlFile << "<br>"<< std::endl;
8527  htmlFile << "<h3> - TS number of maximum signal </h3> "<< std::endl;
8528  htmlFile << "<br>"<< std::endl;
8529  htmlFile << "<h3> For more details see https://twiki.cern.ch/twiki/bin/viewauth/CMS/HcalRemoteCertificationMonitoring </h3> "<< std::endl;
8530  htmlFile << "</body> " << std::endl;
8531  htmlFile << "</html> " << std::endl;
8532  htmlFile.close();
8533 */
8534  //======================================================================
8535  // Creating description CMTresults.html file:
8536  htmlFile.open("CMTresults.html");
8537  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
8538  htmlFile << "<head>" << std::endl;
8539  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
8540  htmlFile << "<title> Certification Monitoring Tool </title>" << std::endl;
8541  htmlFile << "<style type=\"text/css\">" << std::endl;
8542  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
8543  << std::endl;
8544  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
8545  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
8546  "text-align: center;}"
8547  << std::endl;
8548  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
8549  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
8550  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
8551  htmlFile << "</style>" << std::endl;
8552  htmlFile << "<body>" << std::endl;
8553  htmlFile << "<h1> LS-certification (recommendation) from analysis of CMT-dependencies of THIS run </h1>"
8554  << std::endl;
8555  htmlFile << "<br>" << std::endl;
8556  htmlFile << "<br>" << std::endl;
8557  htmlFile << "<h2> - List of suspicious LSs: </h2> " << std::endl;
8558  htmlFile << "<br>" << std::endl;
8559  htmlFile << "<h3> to be added </h3> " << std::endl;
8560  htmlFile << "<br>" << std::endl;
8561  htmlFile << "<br>" << std::endl;
8562  htmlFile << "<br>" << std::endl;
8563  htmlFile << "<h2> - Comments: </h2> " << std::endl;
8564  htmlFile << "<br>" << std::endl;
8565  htmlFile << "<h3> to be added </h3> " << std::endl;
8566  htmlFile << "<br>" << std::endl;
8567  htmlFile << "<br>" << std::endl;
8568  htmlFile << "<br>" << std::endl;
8569  htmlFile << "</body> " << std::endl;
8570  htmlFile << "</html> " << std::endl;
8571  htmlFile.close();
8572 
8573  //======================================================================
8574  // Creating main html file:
8575 
8576  htmlFile.open("LumiList.html");
8577  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
8578  htmlFile << "<head>" << std::endl;
8579  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
8580  htmlFile << "<title> Certification Monitoring Tool </title>" << std::endl;
8581  htmlFile << "<style type=\"text/css\">" << std::endl;
8582  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
8583  << std::endl;
8584  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
8585  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
8586  "text-align: center;}"
8587  << std::endl;
8588  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
8589  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
8590  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
8591  htmlFile << " td.s5 { font-family: arial, arial ce, helvetica; background-color: #00FF00; }" << std::endl;
8592  htmlFile << " td.s6 { font-family: arial, arial ce, helvetica; background-color: #FF0000; }" << std::endl;
8593 
8594  htmlFile << "</style>" << std::endl;
8595  htmlFile << "<body>" << std::endl;
8596 
8597  htmlFile << "<h1> Certification Monitoring Tool, GLOBAL RUN = " << runnumber << ". </h1>" << std::endl;
8598  htmlFile << "<br>" << std::endl;
8599  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8600  << "/CMTresults.html\"> CMT-analysis RESULTS (for this run) </a></td>" << std::endl;
8601  htmlFile << "<br>" << std::endl;
8602  htmlFile << "<br>" << std::endl;
8603 
8604  // htmlFile << "<h2> 1. General information </h2>"<< std::endl;
8605  htmlFile << "<h2> 1. General information (Full number of LS = " << MaxLum << " ). </h2>" << std::endl;
8606  htmlFile << " <img src=\"LumiEvent.png\" />" << std::endl;
8607  htmlFile << "<br>" << std::endl;
8608 
8609  htmlFile << "<h2> 2. HCAL status for different criteria </h2>" << std::endl;
8610  // htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_"<<runnumber<<"/HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
8611  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/HELP.html\"> "
8612  "Description of criteria for bad channel selection</a></td>"
8613  << std::endl;
8614  htmlFile << "<br>" << std::endl;
8615  htmlFile << "<table width=\"600\">" << std::endl;
8616  htmlFile << "<tr>" << std::endl;
8617  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8618  << "/CapID_GL.html\">Cap ID errors</a></td>" << std::endl;
8619  // AZ 11.03.2019
8620  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8621  << "/ADCampl_GL.html\">Amplitude</a></td>" << std::endl;
8622  // htmlFile << " <td><a href=\"ADCampl_GL.html\">Amplitude</a></td>"<< std::endl;
8623  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8624  << "/Width_GL.html\">Width</a></td>" << std::endl;
8625  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8626  << "/Ratio_GL.html\">Ratio</a></td>" << std::endl;
8627  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8628  << "/Tmean_GL.html\">TS mean</a></td>" << std::endl;
8629  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8630  << "/Tmax_GL.html\">TS max</a></td>" << std::endl;
8631 
8632  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/CMT/GLOBAL_" << runnumber
8633  << "/SummedAmplitudes_GL.html\">SummedAmplitudes</a></td>" << std::endl;
8634 
8635  htmlFile << "</tr>" << std::endl;
8636  htmlFile << "</table>" << std::endl;
8637  htmlFile << "<br>" << std::endl;
8638  htmlFile << "</body> " << std::endl;
8639  htmlFile << "</html> " << std::endl;
8640  htmlFile.close();
8641  //======================================================================
8642 
8643  //======================================================================
8644  // Close and delete all possible things:
8645  hfile->Close();
8646  // hfile->Delete();
8647  // Exit Root
8648  gSystem->Exit(0);
8649  //======================================================================
8650 }
#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