CMS 3D CMS Logo

RemoteMonitoringMAP_Global.cc
Go to the documentation of this file.
1 // How to run:
2 //root -b -q -l RemoteMonitoringMAP.C+
3 //root -b -q -l 'RemoteMonitoringMAP.C+("/afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMweb/histos/LED_214513.root","/afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMweb/histos/LED_214512.root")'
4 //root -b -q -l 'RemoteMonitoringMAP.C+(" /afs/cern.ch/work/d/dtlisov/private/Monitoring/histos/LED_211659.root","/afs/cern.ch/cms/CAF/CMSALCA/ALCA_HCALCALIB/HCALMONITORING/RDMweb/histos/LED_214512.root")'
5 
6 #include "LogEleMapdb.h"
7 
8 #include <iostream>
9 #include <fstream>
10 
11 #include "TH1.h"
12 #include "TH2.h"
13 #include "TCanvas.h"
14 #include "TROOT.h"
15 #include <TMath.h>
16 #include "TStyle.h"
17 #include "TSystem.h"
18 #include "TLegend.h"
19 #include "TText.h"
20 #include "TAxis.h"
21 #include "TFile.h"
22 #include "TLine.h"
23 #include "TGraph.h"
24 #include <TPaveText.h>
25 
26 //
27 // https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT
28 // https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/GlobalRMT
29 
30 using namespace std;
31 //inline void HERE(const char *msg) { std::cout << msg << std::endl; }
32 
33 int main(int argc, char *argv[]) {
34  gROOT->Reset();
35  gROOT->SetStyle("Plain");
36  gStyle->SetOptStat(0);
37  gStyle->SetOptTitle(1);
38 
39  if (argc < 2)
40  return 1;
41  char fname[300];
42  char refname[300];
43  sprintf(fname, "%s", argv[1]);
44  sprintf(refname, "%s", argv[2]);
45 
46  cout << fname << " " << refname << std::endl;
47 
48  //
49 
50  //======================================================================
51  // Connect the input files, parameters and get the 2-d histogram in memory
52  // TFile *hfile= new TFile("GlobalHist.root", "READ");
53  string promt = (string)fname;
54  string runnumber = "";
55  for (unsigned int i = promt.size() - 11; i < promt.size() - 5; i++)
56  runnumber += fname[i];
57  string refrunnumber = "";
58  promt = (string)refname;
59  for (unsigned int i = promt.size() - 11; i < promt.size() - 5; i++)
60  refrunnumber += refname[i];
61 
62  TFile *hfile = new TFile(fname, "READ");
63  TFile *hreffile = new TFile(refname, "READ");
64  //megatile channels
65  //CUTS: [test][subdetector] ADC amplitude Am Width for Wm Ratio cut for Rm TS mean for TNm TS max for TXm
66  double MIN_M[7][5] = {{0., 0., 0., 0., 0.},
67  {0., 0., 0., 0., 0.},
68  {0, 0., 0., 0., 0.},
69  {0, 1.0, 1.0, 0.2, 0.1},
70  {0, 0.10, 0.10, 0.18, 0.30},
71  {0, 0.8, 0.8, 0.8, 0.1},
72  {0, -0.5, -0.5, -0.5, -0.5}};
73  double MAX_M[7][5] = {{0., 0., 0., 0., 0.},
74  {0., 0., 0., 0., 0.},
75  {0, 900, 900, 9000, 3000},
76  {0, 3.9, 3.9, 4.4, 2.0},
77  {0, 0.95, 0.98, 0.96, 1.04},
78  {0, 8.0, 8.0, 8.0, 2.8},
79  {0, 6.5, 6.5, 6.5, 3.5}};
80 
81  // calibration channels:
82  double MIN_C[7][5] = {{0., 0., 0., 0., 0.},
83  {0., 0., 0., 0., 0.},
84  {0, 120., 120., 120., 60.},
85  {0, 1.0, 1.0, 0.50, 0.2},
86  {0, 0.6, 0.64, 0.25, 0.25},
87  {0, 1.0, 1.0, 1.0, 1.0},
88  {0, 0.5, 0.5, 0.5, 0.5}};
89  double MAX_C[7][5] = {{0., 0., 0., 0., 0.},
90  {0., 0., 0., 0., 0.},
91  {0, 1E20, 1E20, 1E20, 1E20},
92  {0, 2.3, 2.3, 3.0, 2.3},
93  {0, 1., 1., 1., 1.00},
94  {0, 5.5, 5.5, 3.5, 5.2},
95  {0, 8.5, 8.5, 8.5, 9.5}};
96  double porog[5] = {0., 2., 2., 5., 1.}; // Cut for GS test in pro cents
97  // double porog[5] = {0., 200., 200., 100., 100.}; // Cut for GS test in pro cents
98  double Pedest[2][5] = {{0., 0.2, 0.9, 0.1, 0.2}, {0., 0.2, 0.2, 0.1, 0.16}}; //Cuts for Pedestal and pedestal Width
99  //======================================================================
100  //======================================================================
101  // Prepare histograms and plot them to .png files
102 
103  //TCanvas *cHB = new TCanvas("cHB","cHB",1000,500);
104  TCanvas *cHB = new TCanvas("cHB", "cHB", 1000, 1000);
105  //TCanvas *cHE = new TCanvas("cHE","cHE",1500,500);
106  TCanvas *cHE = new TCanvas("cHE", "cHE", 1500, 1500);
107  // TCanvas *cONE = new TCanvas("cONE","cONE",500,500);
108  TCanvas *cONE = new TCanvas("cONE", "cONE", 1500, 500);
109  TCanvas *cPED = new TCanvas("cPED", "cPED", 1000, 500);
110  //TCanvas *cHF = new TCanvas("cHF","cHF",1000,1000);
111  TCanvas *cHF = new TCanvas("cHF", "cHF", 1000, 1000);
112 
113  char *str = (char *)alloca(10000);
114 
115  // before upgrade 2017:
116  // depth: HB depth1,2; HE depth1,2,3; HO depth4; HF depth1,2
117  // 5 depthes: 0(empty), 1,2,3,4
118 
119  // upgrade 2017:
120  // depth: HB depth1,2; HE depth1,2,3,4,5,6,7; HO depth4; HF depth1,2,3,4
121  // 8 depthes: 0(empty), 1,2,3,4,5,6,7
122 
123  // upgrade 2019:
124  // depth: HB depth1,2,3,4; HE depth1,2,3,4,5,6,7; HO depth4; HF depth1,2,3,4
125  // 10 depthes: 0(empty), 1,2,3,4,5,6,7,8,9
126 
127  // Int_t ALLDEPTH = 5;
128  // Int_t ALLDEPTH = 8;
129  Int_t ALLDEPTH = 10;
130 
131  int k_min[5] = {0, 1, 1, 4, 1}; // minimum depth for each subdet
132 
133  //int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
134  //int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
135  int k_max[5] = {0, 4, 7, 4, 4}; // maximum depth for each subdet
136 
137  TH2F *Map_Ampl[33][5][ALLDEPTH]; // 2D histogramm for test,subdet,depth
138  TH2F *Map_SUB[5][ALLDEPTH]; // 2d histogramm for subdet, depth
139  TH1F *HistAmplDepth[22][5][ALLDEPTH]; // 1d histogramm for test,subdet, depth
140  TH1F *HistAmpl[22][5]; // 1d histogramm for test,subdet
141 
142  TH1F *HistPed[3][5][4]; // 1d histogramm for test,subdet, CapID
143  TH2F *Map_Ped[3][5]; // 2d histogramm for test,subdet -> test 33
144  TH1F *hist_GoodTSshape[5]; // 1d histogramm for TS shape subdet -> test 41
145  TH1F *hist_GoodTSshape0[5]; // 1d histogramm for TS shape subdet -> test 41
146  TH1F *hist_BadTSshape[5]; // 1d histogramm for TS shape subdet -> test 41
147  TH1F *hist_BadTSshape0[5]; // 1d histogramm for TS shape subdet -> test 41
148  TH1F *hist_ADC_All[5]; // 1d histogramm for TS shape subdet -> test 42
149  TH1F *hist_ADC_DS[5][ALLDEPTH]; // 1d histogramm for TS shape subdet, depth -> test 42
150  TH1F *hist_SumADC[5][ALLDEPTH]; // 1d histogramm for TS shape subdet, depth -> test 43
151  TH1F *hist_SumADC0[5][ALLDEPTH]; // 1d histogramm for TS shape subdet, depth -> test 43
152  TH1F *hist_SumADC1[5][ALLDEPTH]; // 1d histogramm for TS shape subdet, depth -> test 43
153 
154  Map_SUB[1][1] = (TH2F *)hfile->Get("h_mapDepth1_HB");
155  Map_SUB[1][2] = (TH2F *)hfile->Get("h_mapDepth2_HB");
156  Map_SUB[2][1] = (TH2F *)hfile->Get("h_mapDepth1_HE");
157  Map_SUB[2][2] = (TH2F *)hfile->Get("h_mapDepth2_HE");
158  Map_SUB[2][3] = (TH2F *)hfile->Get("h_mapDepth3_HE");
159  Map_SUB[3][4] = (TH2F *)hfile->Get("h_mapDepth4_HO");
160  Map_SUB[4][1] = (TH2F *)hfile->Get("h_mapDepth1_HF");
161  Map_SUB[4][2] = (TH2F *)hfile->Get("h_mapDepth2_HF");
162 
163  Map_SUB[2][4] = (TH2F *)hfile->Get("h_mapDepth4_HE");
164  Map_SUB[2][5] = (TH2F *)hfile->Get("h_mapDepth5_HE");
165  Map_SUB[2][6] = (TH2F *)hfile->Get("h_mapDepth6_HE");
166  Map_SUB[2][7] = (TH2F *)hfile->Get("h_mapDepth7_HE");
167  Map_SUB[4][3] = (TH2F *)hfile->Get("h_mapDepth3_HF");
168  Map_SUB[4][4] = (TH2F *)hfile->Get("h_mapDepth4_HF");
169 
170  Map_SUB[1][3] = (TH2F *)hfile->Get("h_mapDepth3_HB");
171  Map_SUB[1][4] = (TH2F *)hfile->Get("h_mapDepth4_HB");
172  //+++++++++++++++++++++++++++++
173  //Test 0 Entries
174  //+++++++++++++++++++++++++++++
175 
176  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
177  // if (sub==1) cHB->Divide(2,1);
178  if (sub == 1)
179  cHB->Divide(2, 2);
180  // if (sub==2) cHE->Divide(3,1);
181  if (sub == 2)
182  cHE->Divide(3, 3);
183  if (sub == 3)
184  cONE->Divide(1, 1);
185  // if (sub==4) cHF->Divide(2,1);
186  if (sub == 4)
187  cHF->Divide(2, 2);
188  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
189  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
190  // int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
191  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
192  if (sub == 1)
193  cHB->cd(k);
194  if (sub == 2)
195  cHE->cd(k);
196  if (sub == 3)
197  cONE->cd(k - 3);
198  if (sub == 4)
199  cHF->cd(k);
200  gPad->SetGridy();
201  gPad->SetGridx();
202  gPad->SetLogz();
203  if (sub == 1)
204  sprintf(str, "HB, Depth%d \b", k);
205  if (sub == 2)
206  sprintf(str, "HE, Depth%d \b", k);
207  if (sub == 3)
208  sprintf(str, "HO, Depth%d \b", k);
209  if (sub == 4)
210  sprintf(str, "HF, Depth%d \b", k);
211  Map_SUB[sub][k]->SetTitle(str);
212  Map_SUB[sub][k]->SetXTitle("#eta \b");
213  Map_SUB[sub][k]->SetYTitle("#phi \b");
214  Map_SUB[sub][k]->SetZTitle("Number of events \b");
215  if (sub == 3)
216  Map_SUB[sub][k]->SetTitleOffset(0.8, "Z");
217  Map_SUB[sub][k]->Draw("COLZ");
218  Map_SUB[sub][k]->GetYaxis()->SetRangeUser(0, 72.);
219  // Map_SUB[sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
220  if (sub == 1) {
221  cHB->Modified();
222  cHB->Update();
223  }
224  if (sub == 2) {
225  cHE->Modified();
226  cHE->Update();
227  }
228  if (sub == 3) {
229  cONE->Modified();
230  cONE->Update();
231  }
232  if (sub == 4) {
233  cHF->Modified();
234  cHF->Update();
235  }
236  } //end depth
237 
238  if (sub == 1) {
239  cHB->Print("MapRateEntryHB.png");
240  cHB->Clear();
241  }
242  if (sub == 2) {
243  cHE->Print("MapRateEntryHE.png");
244  cHE->Clear();
245  }
246  if (sub == 3) {
247  cONE->Print("MapRateEntryHO.png");
248  cONE->Clear();
249  }
250  if (sub == 4) {
251  cHF->Print("MapRateEntryHF.png");
252  cHF->Clear();
253  }
254  } // end sub
255 
256  //+++++++++++++++++++++++++++++
257  //Test 1 (Cm) Rate of Cap ID errors
258  //+++++++++++++++++++++++++++++
259 
260  Map_Ampl[1][1][1] = (TH2F *)hfile->Get("h_mapDepth1Error_HB");
261  Map_Ampl[1][1][2] = (TH2F *)hfile->Get("h_mapDepth2Error_HB");
262  Map_Ampl[1][2][1] = (TH2F *)hfile->Get("h_mapDepth1Error_HE");
263  Map_Ampl[1][2][2] = (TH2F *)hfile->Get("h_mapDepth2Error_HE");
264  Map_Ampl[1][2][3] = (TH2F *)hfile->Get("h_mapDepth3Error_HE");
265  Map_Ampl[1][3][4] = (TH2F *)hfile->Get("h_mapDepth4Error_HO");
266  Map_Ampl[1][4][1] = (TH2F *)hfile->Get("h_mapDepth1Error_HF");
267  Map_Ampl[1][4][2] = (TH2F *)hfile->Get("h_mapDepth2Error_HF");
268 
269  Map_Ampl[1][2][4] = (TH2F *)hfile->Get("h_mapDepth4Error_HE");
270  Map_Ampl[1][2][5] = (TH2F *)hfile->Get("h_mapDepth5Error_HE");
271  Map_Ampl[1][2][6] = (TH2F *)hfile->Get("h_mapDepth6Error_HE");
272  Map_Ampl[1][2][7] = (TH2F *)hfile->Get("h_mapDepth7Error_HE");
273  Map_Ampl[1][4][3] = (TH2F *)hfile->Get("h_mapDepth3Error_HF");
274  Map_Ampl[1][4][4] = (TH2F *)hfile->Get("h_mapDepth4Error_HF");
275 
276  Map_Ampl[1][1][3] = (TH2F *)hfile->Get("h_mapDepth3Error_HB");
277  Map_Ampl[1][1][4] = (TH2F *)hfile->Get("h_mapDepth4Error_HB");
278 
279  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
280  // if (sub==1) cHB->Divide(2,1);
281  if (sub == 1)
282  cHB->Divide(2, 2);
283  // if (sub==2) cHE->Divide(3,1);
284  if (sub == 2)
285  cHE->Divide(3, 3);
286  if (sub == 3)
287  cONE->Divide(1, 1);
288  // if (sub==4) cHF->Divide(2,1);
289  if (sub == 4)
290  cHF->Divide(2, 2);
291  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
292  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
293  // int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
294  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
295  if (sub == 1)
296  cHB->cd(k);
297  if (sub == 2)
298  cHE->cd(k);
299  if (sub == 3)
300  cONE->cd(k - 3);
301  if (sub == 4)
302  cHF->cd(k);
303  Map_Ampl[1][sub][k]->Divide(Map_Ampl[1][sub][k], Map_SUB[sub][k], 1, 1, "B");
304  gPad->SetGridy();
305  gPad->SetGridx();
306  gPad->SetLogz();
307  if (sub == 1)
308  sprintf(str, "HB, Depth%d \b", k);
309  if (sub == 2)
310  sprintf(str, "HE, Depth%d \b", k);
311  if (sub == 3)
312  sprintf(str, "HO, Depth%d \b", k);
313  if (sub == 4)
314  sprintf(str, "HF, Depth%d \b", k);
315  Map_Ampl[1][sub][k]->SetTitle(str);
316  Map_Ampl[1][sub][k]->SetXTitle("#eta \b");
317  Map_Ampl[1][sub][k]->SetYTitle("#phi \b");
318  Map_Ampl[1][sub][k]->SetZTitle("Rate \b");
319  if (sub == 3)
320  Map_Ampl[1][sub][k]->SetTitleOffset(0.8, "Z");
321  Map_Ampl[1][sub][k]->Draw("COLZ");
322  Map_Ampl[1][sub][k]->GetYaxis()->SetRangeUser(0, 72.);
323  Map_Ampl[1][sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
324  if (sub == 1) {
325  cHB->Modified();
326  cHB->Update();
327  }
328  if (sub == 2) {
329  cHE->Modified();
330  cHE->Update();
331  }
332  if (sub == 3) {
333  cONE->Modified();
334  cONE->Update();
335  }
336  if (sub == 4) {
337  cHF->Modified();
338  cHF->Update();
339  }
340  } //end depth
341 
342  if (sub == 1) {
343  cHB->Print("MapRateCapIDHB.png");
344  cHB->Clear();
345  }
346  if (sub == 2) {
347  cHE->Print("MapRateCapIDHE.png");
348  cHE->Clear();
349  }
350  if (sub == 3) {
351  cONE->Print("MapRateCapIDHO.png");
352  cONE->Clear();
353  }
354  if (sub == 4) {
355  cHF->Print("MapRateCapIDHF.png");
356  cHF->Clear();
357  }
358  } // end sub
359 
360  //+++++++++++++++++++++++++++++
361  //Test 2 (Am) ADC amplitude
362  //+++++++++++++++++++++++++++++
363 
364  Map_Ampl[2][1][1] = (TH2F *)hfile->Get("h_mapDepth1ADCAmpl225_HB");
365  Map_Ampl[2][1][2] = (TH2F *)hfile->Get("h_mapDepth2ADCAmpl225_HB");
366  Map_Ampl[2][2][1] = (TH2F *)hfile->Get("h_mapDepth1ADCAmpl225_HE");
367  Map_Ampl[2][2][2] = (TH2F *)hfile->Get("h_mapDepth2ADCAmpl225_HE");
368  Map_Ampl[2][2][3] = (TH2F *)hfile->Get("h_mapDepth3ADCAmpl225_HE");
369  Map_Ampl[2][3][4] = (TH2F *)hfile->Get("h_mapDepth4ADCAmpl225_HO");
370  Map_Ampl[2][4][1] = (TH2F *)hfile->Get("h_mapDepth1ADCAmpl225_HF");
371  Map_Ampl[2][4][2] = (TH2F *)hfile->Get("h_mapDepth2ADCAmpl225_HF");
372 
373  Map_Ampl[2][2][4] = (TH2F *)hfile->Get("h_mapDepth4ADCAmpl225_HE");
374  Map_Ampl[2][2][5] = (TH2F *)hfile->Get("h_mapDepth5ADCAmpl225_HE");
375  Map_Ampl[2][2][6] = (TH2F *)hfile->Get("h_mapDepth6ADCAmpl225_HE");
376  Map_Ampl[2][2][7] = (TH2F *)hfile->Get("h_mapDepth7ADCAmpl225_HE");
377  Map_Ampl[2][4][3] = (TH2F *)hfile->Get("h_mapDepth3ADCAmpl225_HF");
378  Map_Ampl[2][4][4] = (TH2F *)hfile->Get("h_mapDepth4ADCAmpl225_HF");
379 
380  Map_Ampl[2][1][3] = (TH2F *)hfile->Get("h_mapDepth3ADCAmpl225_HB");
381  Map_Ampl[2][1][4] = (TH2F *)hfile->Get("h_mapDepth4ADCAmpl225_HB");
382 
383  HistAmpl[2][1] = (TH1F *)hfile->Get("h_ADCAmpl_HB");
384  HistAmpl[2][2] = (TH1F *)hfile->Get("h_ADCAmpl_HE");
385  HistAmpl[2][3] = (TH1F *)hfile->Get("h_ADCAmpl_HO");
386  HistAmpl[2][4] = (TH1F *)hfile->Get("h_ADCAmpl_HF");
387 
388  //+++++++++++++++++++++++++++++
389  //Test 3 (Wm) Rate of RMS
390  //+++++++++++++++++++++++++++++
391 
392  Map_Ampl[3][1][1] = (TH2F *)hfile->Get("h_mapDepth1Amplitude225_HB");
393  Map_Ampl[3][1][2] = (TH2F *)hfile->Get("h_mapDepth2Amplitude225_HB");
394  Map_Ampl[3][2][1] = (TH2F *)hfile->Get("h_mapDepth1Amplitude225_HE");
395  Map_Ampl[3][2][2] = (TH2F *)hfile->Get("h_mapDepth2Amplitude225_HE");
396  Map_Ampl[3][2][3] = (TH2F *)hfile->Get("h_mapDepth3Amplitude225_HE");
397  Map_Ampl[3][3][4] = (TH2F *)hfile->Get("h_mapDepth4Amplitude225_HO");
398  Map_Ampl[3][4][1] = (TH2F *)hfile->Get("h_mapDepth1Amplitude225_HF");
399  Map_Ampl[3][4][2] = (TH2F *)hfile->Get("h_mapDepth2Amplitude225_HF");
400 
401  Map_Ampl[3][2][4] = (TH2F *)hfile->Get("h_mapDepth4Amplitude225_HE");
402  Map_Ampl[3][2][5] = (TH2F *)hfile->Get("h_mapDepth5Amplitude225_HE");
403  Map_Ampl[3][2][6] = (TH2F *)hfile->Get("h_mapDepth6Amplitude225_HE");
404  Map_Ampl[3][2][7] = (TH2F *)hfile->Get("h_mapDepth7Amplitude225_HE");
405  Map_Ampl[3][4][3] = (TH2F *)hfile->Get("h_mapDepth3Amplitude225_HF");
406  Map_Ampl[3][4][4] = (TH2F *)hfile->Get("h_mapDepth4Amplitude225_HF");
407 
408  Map_Ampl[3][1][3] = (TH2F *)hfile->Get("h_mapDepth3Amplitude225_HB");
409  Map_Ampl[3][1][4] = (TH2F *)hfile->Get("h_mapDepth4Amplitude225_HB");
410 
411  HistAmpl[3][1] = (TH1F *)hfile->Get("h_Amplitude_HB");
412  HistAmpl[3][2] = (TH1F *)hfile->Get("h_Amplitude_HE");
413  HistAmpl[3][3] = (TH1F *)hfile->Get("h_Amplitude_HO");
414  HistAmpl[3][4] = (TH1F *)hfile->Get("h_Amplitude_HF");
415 
416  //+++++++++++++++++++++++++++++
417  //Test 4 (Rm) Rate of ratio 4 near max TS/ All TS
418  //+++++++++++++++++++++++++++++
419 
420  Map_Ampl[4][1][1] = (TH2F *)hfile->Get("h_mapDepth1Ampl047_HB");
421  Map_Ampl[4][1][2] = (TH2F *)hfile->Get("h_mapDepth2Ampl047_HB");
422  Map_Ampl[4][2][1] = (TH2F *)hfile->Get("h_mapDepth1Ampl047_HE");
423  Map_Ampl[4][2][2] = (TH2F *)hfile->Get("h_mapDepth2Ampl047_HE");
424  Map_Ampl[4][2][3] = (TH2F *)hfile->Get("h_mapDepth3Ampl047_HE");
425  Map_Ampl[4][3][4] = (TH2F *)hfile->Get("h_mapDepth4Ampl047_HO");
426  Map_Ampl[4][4][1] = (TH2F *)hfile->Get("h_mapDepth1Ampl047_HF");
427  Map_Ampl[4][4][2] = (TH2F *)hfile->Get("h_mapDepth2Ampl047_HF");
428 
429  Map_Ampl[4][2][4] = (TH2F *)hfile->Get("h_mapDepth4Ampl047_HE");
430  Map_Ampl[4][2][5] = (TH2F *)hfile->Get("h_mapDepth5Ampl047_HE");
431  Map_Ampl[4][2][6] = (TH2F *)hfile->Get("h_mapDepth6Ampl047_HE");
432  Map_Ampl[4][2][7] = (TH2F *)hfile->Get("h_mapDepth7Ampl047_HE");
433  Map_Ampl[4][4][3] = (TH2F *)hfile->Get("h_mapDepth3Ampl047_HF");
434  Map_Ampl[4][4][4] = (TH2F *)hfile->Get("h_mapDepth4Ampl047_HF");
435 
436  Map_Ampl[4][1][3] = (TH2F *)hfile->Get("h_mapDepth3Ampl047_HB");
437  Map_Ampl[4][1][4] = (TH2F *)hfile->Get("h_mapDepth4Ampl047_HB");
438 
439  HistAmpl[4][1] = (TH1F *)hfile->Get("h_Ampl_HB");
440  HistAmpl[4][2] = (TH1F *)hfile->Get("h_Ampl_HE");
441  HistAmpl[4][3] = (TH1F *)hfile->Get("h_Ampl_HO");
442  HistAmpl[4][4] = (TH1F *)hfile->Get("h_Ampl_HF");
443 
444  //+++++++++++++++++++++++++++++
445  //Test 5 (TNm) Mean position in 1-8 TS range
446  //+++++++++++++++++++++++++++++
447 
448  Map_Ampl[5][1][1] = (TH2F *)hfile->Get("h_mapDepth1TSmeanA225_HB");
449  Map_Ampl[5][1][2] = (TH2F *)hfile->Get("h_mapDepth2TSmeanA225_HB");
450  Map_Ampl[5][2][1] = (TH2F *)hfile->Get("h_mapDepth1TSmeanA225_HE");
451  Map_Ampl[5][2][2] = (TH2F *)hfile->Get("h_mapDepth2TSmeanA225_HE");
452  Map_Ampl[5][2][3] = (TH2F *)hfile->Get("h_mapDepth3TSmeanA225_HE");
453  Map_Ampl[5][3][4] = (TH2F *)hfile->Get("h_mapDepth4TSmeanA225_HO");
454  Map_Ampl[5][4][1] = (TH2F *)hfile->Get("h_mapDepth1TSmeanA225_HF");
455  Map_Ampl[5][4][2] = (TH2F *)hfile->Get("h_mapDepth2TSmeanA225_HF");
456 
457  Map_Ampl[5][2][4] = (TH2F *)hfile->Get("h_mapDepth4TSmeanA225_HE");
458  Map_Ampl[5][2][5] = (TH2F *)hfile->Get("h_mapDepth5TSmeanA225_HE");
459  Map_Ampl[5][2][6] = (TH2F *)hfile->Get("h_mapDepth6TSmeanA225_HE");
460  Map_Ampl[5][2][7] = (TH2F *)hfile->Get("h_mapDepth7TSmeanA225_HE");
461  Map_Ampl[5][4][3] = (TH2F *)hfile->Get("h_mapDepth3TSmeanA225_HF");
462  Map_Ampl[5][4][4] = (TH2F *)hfile->Get("h_mapDepth4TSmeanA225_HF");
463 
464  Map_Ampl[5][1][3] = (TH2F *)hfile->Get("h_mapDepth3TSmeanA225_HB");
465  Map_Ampl[5][1][4] = (TH2F *)hfile->Get("h_mapDepth4TSmeanA225_HB");
466 
467  HistAmpl[5][1] = (TH1F *)hfile->Get("h_TSmeanA_HB");
468  HistAmpl[5][2] = (TH1F *)hfile->Get("h_TSmeanA_HE");
469  HistAmpl[5][3] = (TH1F *)hfile->Get("h_TSmeanA_HO");
470  HistAmpl[5][4] = (TH1F *)hfile->Get("h_TSmeanA_HF");
471 
472  //+++++++++++++++++++++++++++++
473  //Test 6 (TXm) Maximum position in 1-8 TS range
474  //+++++++++++++++++++++++++++++
475 
476  Map_Ampl[6][1][1] = (TH2F *)hfile->Get("h_mapDepth1TSmaxA225_HB");
477  Map_Ampl[6][1][2] = (TH2F *)hfile->Get("h_mapDepth2TSmaxA225_HB");
478  Map_Ampl[6][2][1] = (TH2F *)hfile->Get("h_mapDepth1TSmaxA225_HE");
479  Map_Ampl[6][2][2] = (TH2F *)hfile->Get("h_mapDepth2TSmaxA225_HE");
480  Map_Ampl[6][2][3] = (TH2F *)hfile->Get("h_mapDepth3TSmaxA225_HE");
481  Map_Ampl[6][3][4] = (TH2F *)hfile->Get("h_mapDepth4TSmaxA225_HO");
482  Map_Ampl[6][4][1] = (TH2F *)hfile->Get("h_mapDepth1TSmaxA225_HF");
483  Map_Ampl[6][4][2] = (TH2F *)hfile->Get("h_mapDepth2TSmaxA225_HF");
484 
485  Map_Ampl[6][2][4] = (TH2F *)hfile->Get("h_mapDepth4TSmaxA225_HE");
486  Map_Ampl[6][2][5] = (TH2F *)hfile->Get("h_mapDepth5TSmaxA225_HE");
487  Map_Ampl[6][2][6] = (TH2F *)hfile->Get("h_mapDepth6TSmaxA225_HE");
488  Map_Ampl[6][2][7] = (TH2F *)hfile->Get("h_mapDepth7TSmaxA225_HE");
489  Map_Ampl[6][4][3] = (TH2F *)hfile->Get("h_mapDepth3TSmaxA225_HF");
490  Map_Ampl[6][4][4] = (TH2F *)hfile->Get("h_mapDepth4TSmaxA225_HF");
491 
492  Map_Ampl[6][1][3] = (TH2F *)hfile->Get("h_mapDepth3TSmaxA225_HB");
493  Map_Ampl[6][1][4] = (TH2F *)hfile->Get("h_mapDepth4TSmaxA225_HB");
494 
495  HistAmpl[6][1] = (TH1F *)hfile->Get("h_TSmaxA_HB");
496  HistAmpl[6][2] = (TH1F *)hfile->Get("h_TSmaxA_HE");
497  HistAmpl[6][3] = (TH1F *)hfile->Get("h_TSmaxA_HO");
498  HistAmpl[6][4] = (TH1F *)hfile->Get("h_TSmaxA_HF");
499 
500  for (int test = 2; test <= 6; test++) { //Test: 2-Am, 3-Wm, 4-Rm, 5-TNm, 6-TXm,
501  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
502  // if (sub==1) cHB->Divide(2,1);
503  if (sub == 1)
504  cHB->Divide(2, 2);
505  // if (sub==2) cHE->Divide(3,1);
506  if (sub == 2)
507  cHE->Divide(3, 3);
508  if (sub == 3)
509  cONE->Divide(1, 1);
510  // if (sub==4) cHF->Divide(2,1);
511  if (sub == 4)
512  cHF->Divide(2, 2);
513  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
514  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
515  // int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
516  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
517  if (sub == 1)
518  cHB->cd(k);
519  if (sub == 2)
520  cHE->cd(k);
521  if (sub == 3)
522  cONE->cd(k - 3);
523  if (sub == 4)
524  cHF->cd(k);
525  Map_Ampl[test][sub][k]->Divide(Map_Ampl[test][sub][k], Map_SUB[sub][k], 1, 1, "B");
526  gPad->SetGridy();
527  gPad->SetGridx();
528  gPad->SetLogz();
529  if (sub == 1)
530  sprintf(str, "HB, Depth%d \b", k);
531  if (sub == 2)
532  sprintf(str, "HE, Depth%d \b", k);
533  if (sub == 3)
534  sprintf(str, "HO, Depth%d \b", k);
535  if (sub == 4)
536  sprintf(str, "HF, Depth%d \b", k);
537  Map_Ampl[test][sub][k]->SetTitle(str);
538  Map_Ampl[test][sub][k]->SetXTitle("#eta \b");
539  Map_Ampl[test][sub][k]->SetYTitle("#phi \b");
540  Map_Ampl[test][sub][k]->SetZTitle("Rate \b");
541  if (sub == 3)
542  Map_Ampl[test][sub][k]->SetTitleOffset(0.8, "Z");
543  Map_Ampl[test][sub][k]->Draw("COLZ");
544  Map_Ampl[test][sub][k]->GetYaxis()->SetRangeUser(0, 72.);
545  Map_Ampl[test][sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
546  if (sub == 1) {
547  cHB->Modified();
548  cHB->Update();
549  }
550  if (sub == 2) {
551  cHE->Modified();
552  cHE->Update();
553  }
554  if (sub == 3) {
555  cONE->Modified();
556  cONE->Update();
557  }
558  if (sub == 4) {
559  cHF->Modified();
560  cHF->Update();
561  }
562  } //end depth
563  if (test == 2) {
564  if (sub == 1) {
565  cHB->Print("MapRateAmplHB.png");
566  cHB->Clear();
567  }
568  if (sub == 2) {
569  cHE->Print("MapRateAmplHE.png");
570  cHE->Clear();
571  }
572  if (sub == 3) {
573  cONE->Print("MapRateAmplHO.png");
574  cONE->Clear();
575  }
576  if (sub == 4) {
577  cHF->Print("MapRateAmplHF.png");
578  cHF->Clear();
579  }
580  }
581  if (test == 3) {
582  if (sub == 1) {
583  cHB->Print("MapRateRMSHB.png");
584  cHB->Clear();
585  }
586  if (sub == 2) {
587  cHE->Print("MapRateRMSHE.png");
588  cHE->Clear();
589  }
590  if (sub == 3) {
591  cONE->Print("MapRateRMSHO.png");
592  cONE->Clear();
593  }
594  if (sub == 4) {
595  cHF->Print("MapRateRMSHF.png");
596  cHF->Clear();
597  }
598  }
599  if (test == 4) {
600  if (sub == 1) {
601  cHB->Print("MapRate43TStoAllTSHB.png");
602  cHB->Clear();
603  }
604  if (sub == 2) {
605  cHE->Print("MapRate43TStoAllTSHE.png");
606  cHE->Clear();
607  }
608  if (sub == 3) {
609  cONE->Print("MapRate43TStoAllTSHO.png");
610  cONE->Clear();
611  }
612  if (sub == 4) {
613  cHF->Print("MapRate43TStoAllTSHF.png");
614  cHF->Clear();
615  }
616  }
617  if (test == 5) {
618  if (sub == 1) {
619  cHB->Print("MapRateMeanPosHB.png");
620  cHB->Clear();
621  }
622  if (sub == 2) {
623  cHE->Print("MapRateMeanPosHE.png");
624  cHE->Clear();
625  }
626  if (sub == 3) {
627  cONE->Print("MapRateMeanPosHO.png");
628  cONE->Clear();
629  }
630  if (sub == 4) {
631  cHF->Print("MapRateMeanPosHF.png");
632  cHF->Clear();
633  }
634  }
635  if (test == 6) {
636  if (sub == 1) {
637  cHB->Print("MapRateMaxPosHB.png");
638  cHB->Clear();
639  }
640  if (sub == 2) {
641  cHE->Print("MapRateMaxPosHE.png");
642  cHE->Clear();
643  }
644  if (sub == 3) {
645  cONE->Print("MapRateMaxPosHO.png");
646  cONE->Clear();
647  }
648  if (sub == 4) {
649  cHF->Print("MapRateMaxPosHF.png");
650  cHF->Clear();
651  }
652  }
653 
654  // cONE->Divide(1,1);
655  /*
656  cONE->Divide(2,1);
657  if(test == 2 && sub == 2 ) {
658  cONE->cd(2);
659  TH1F *kjkjkhj2= (TH1F*)hfile->Get("h_ADCAmpl_HE");kjkjkhj2->Draw("");kjkjkhj2->SetTitle("HE, All Depth: shunt6");
660  }
661  if(test == 2 && sub == 1 ) {
662  cONE->cd(2);
663  TH1F *kjkjkhj1= (TH1F*)hfile->Get("h_ADCAmpl_HB");kjkjkhj1->Draw("");kjkjkhj1->SetTitle("HB, All Depth: shunt6");
664  }
665 */
666 
667  cONE->Divide(3, 1);
668  if (test == 2 && sub == 2) {
669  cONE->cd(2);
670  TH1F *kjkjkhj2 = (TH1F *)hfile->Get("h_AmplitudeHEtest1");
671  kjkjkhj2->Draw("");
672  kjkjkhj2->SetTitle("HE, All Depth: shunt1");
673  cONE->cd(3);
674  TH1F *kjkjkhj3 = (TH1F *)hfile->Get("h_AmplitudeHEtest6");
675  kjkjkhj3->Draw("");
676  kjkjkhj3->SetTitle("HE, All Depth: shunt6");
677  }
678  if (test == 2 && sub == 1) {
679  cONE->cd(2);
680  TH1F *kjkjkhb2 = (TH1F *)hfile->Get("h_AmplitudeHBtest1");
681  kjkjkhb2->Draw("");
682  kjkjkhb2->SetTitle("HB, All Depth: shunt1");
683  cONE->cd(3);
684  TH1F *kjkjkhb3 = (TH1F *)hfile->Get("h_AmplitudeHBtest6");
685  kjkjkhb3->Draw("");
686  kjkjkhb3->SetTitle("HB, All Depth: shunt6");
687  }
688 
689  cONE->cd(1);
690  gPad->SetGridy();
691  gPad->SetGridx();
692  gPad->SetLogy();
693  if (sub == 1)
694  HistAmpl[test][sub]->SetTitle("HB, All Depth: shunt6");
695  if (sub == 2)
696  HistAmpl[test][sub]->SetTitle("HE, All Depth: shunt6");
697  if (sub == 3)
698  HistAmpl[test][sub]->SetTitle("HO, All Depth");
699  if (sub == 4)
700  HistAmpl[test][sub]->SetTitle("HF, All Depth");
701  if (test == 2)
702  HistAmpl[test][sub]->SetXTitle("ADC Amlitude in each event & cell \b");
703  if (test == 3)
704  HistAmpl[test][sub]->SetXTitle("RMS in each event & cell \b");
705  if (test == 4)
706  HistAmpl[test][sub]->SetXTitle("Ratio in each event & cell \b");
707  if (test == 5)
708  HistAmpl[test][sub]->SetXTitle("Mean TS position in each event & cell \b");
709  if (test == 6)
710  HistAmpl[test][sub]->SetXTitle("Max TS position in each event & cell \b");
711  HistAmpl[test][sub]->SetYTitle("Number of cell-events \b");
712  HistAmpl[test][sub]->SetLineColor(4);
713  HistAmpl[test][sub]->SetLineWidth(2);
714  HistAmpl[test][sub]->SetTitleOffset(1.4, "Y");
715  HistAmpl[test][sub]->Draw("");
716  // // HistAmpl[test][sub]->GetYaxis()->SetRangeUser(1., 100.);
717  // if (test==2) {gPad->SetLogx(); HistAmpl[test][sub]->GetXaxis()->SetRangeUser(1., 10000.);}
718  if (test == 2) {
719  gPad->SetLogx();
720  }
721  if (test == 3)
722  HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 5.); // width
723  if (test == 4)
724  HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 1.); // R
725  if (test == 5)
726  HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 9.); // Tn
727  if (test == 6)
728  HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 9.); // Tx
729  cONE->Modified();
730  cONE->Update();
731  double min_x[] = {MIN_M[test][sub], MIN_M[test][sub]};
732  double min_y[] = {0., 100000000.};
733  TGraph *MIN = new TGraph(2, min_x, min_y);
734  MIN->SetLineStyle(2);
735  MIN->SetLineColor(2);
736  MIN->SetLineWidth(2 + 100 * 100);
737  MIN->SetFillStyle(3005);
738  MIN->SetFillColor(2);
739  MIN->Draw("L");
740  double max_x[] = {MAX_M[test][sub], MAX_M[test][sub]};
741  double max_y[] = {0., 100000000.};
742  TGraph *MAX = new TGraph(2, max_x, max_y);
743  MAX->SetLineStyle(2);
744  MAX->SetLineColor(2);
745  MAX->SetLineWidth(-2 - 100 * 100);
746  MAX->SetFillStyle(3004);
747  MAX->SetFillColor(2);
748  MAX->Draw("L");
749  if (test == 2) {
750  if (sub == 1) {
751  cONE->Print("HistAmplHB.png");
752  cONE->Clear();
753  }
754  if (sub == 2) {
755  cONE->Print("HistAmplHE.png");
756  cONE->Clear();
757  }
758  if (sub == 3) {
759  cONE->Print("HistAmplHO.png");
760  cONE->Clear();
761  }
762  if (sub == 4) {
763  cONE->Print("HistAmplHF.png");
764  cONE->Clear();
765  }
766  }
767  if (test == 3) {
768  if (sub == 1) {
769  cONE->Print("HistRMSHB.png");
770  cONE->Clear();
771  }
772  if (sub == 2) {
773  cONE->Print("HistRMSHE.png");
774  cONE->Clear();
775  }
776  if (sub == 3) {
777  cONE->Print("HistRMSHO.png");
778  cONE->Clear();
779  }
780  if (sub == 4) {
781  cONE->Print("HistRMSHF.png");
782  cONE->Clear();
783  }
784  }
785  if (test == 4) {
786  if (sub == 1) {
787  cONE->Print("Hist43TStoAllTSHB.png");
788  cONE->Clear();
789  }
790  if (sub == 2) {
791  cONE->Print("Hist43TStoAllTSHE.png");
792  cONE->Clear();
793  }
794  if (sub == 3) {
795  cONE->Print("Hist43TStoAllTSHO.png");
796  cONE->Clear();
797  }
798  if (sub == 4) {
799  cONE->Print("Hist43TStoAllTSHF.png");
800  cONE->Clear();
801  }
802  }
803  if (test == 5) {
804  if (sub == 1) {
805  cONE->Print("HistMeanPosHB.png");
806  cONE->Clear();
807  }
808  if (sub == 2) {
809  cONE->Print("HistMeanPosHE.png");
810  cONE->Clear();
811  }
812  if (sub == 3) {
813  cONE->Print("HistMeanPosHO.png");
814  cONE->Clear();
815  }
816  if (sub == 4) {
817  cONE->Print("HistMeanPosHF.png");
818  cONE->Clear();
819  }
820  }
821  if (test == 6) {
822  if (sub == 1) {
823  cONE->Print("HistMaxPosHB.png");
824  cONE->Clear();
825  }
826  if (sub == 2) {
827  cONE->Print("HistMaxPosHE.png");
828  cONE->Clear();
829  }
830  if (sub == 3) {
831  cONE->Print("HistMaxPosHO.png");
832  cONE->Clear();
833  }
834  if (sub == 4) {
835  cONE->Print("HistMaxPosHF.png");
836  cONE->Clear();
837  }
838  }
839  } // end sub
840  } //end test
841 
842  TH2F *Map_Calib[5][5]; // 2d histogramm for subdet, depth
843 
844  Map_Calib[1][1] = (TH2F *)hfile->Get("h_map_HB");
845  Map_Calib[1][2] = (TH2F *)hfile->Get("h_map_HB");
846  Map_Calib[2][1] = (TH2F *)hfile->Get("h_map_HE");
847  Map_Calib[2][2] = (TH2F *)hfile->Get("h_map_HE");
848  Map_Calib[2][3] = (TH2F *)hfile->Get("h_map_HE");
849  Map_Calib[3][4] = (TH2F *)hfile->Get("h_map_HO");
850  Map_Calib[4][1] = (TH2F *)hfile->Get("h_map_HF");
851  Map_Calib[4][2] = (TH2F *)hfile->Get("h_map_HF");
852 
853  //+++++++++++++++++++++++++++++
854  //Test 0 Entries
855  //+++++++++++++++++++++++++++++
856 
857  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
858  // if (sub==1) cHB->Divide(2,1);
859  // if (sub==2) cHE->Divide(3,1);
860  cONE->Divide(1, 1);
861  // if (sub==4) cHB->Divide(2,1);
862  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
863  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
864  // for (int k=k_min[sub];k<=k_max[sub];k++) { //Depth
865  int k = 1;
866  cONE->cd(k);
867  // if (sub==1) cHB->cd(k);
868  // if (sub==2) cHE->cd(k);
869  if (sub == 3)
870  k = 4;
871  // if (sub==4) cHB->cd(k);
872  gPad->SetGridy();
873  gPad->SetGridx();
874  gPad->SetLogz();
875  if (sub == 1)
876  sprintf(str, "HB");
877  if (sub == 2)
878  sprintf(str, "HE");
879  if (sub == 3)
880  sprintf(str, "HO");
881  if (sub == 4)
882  sprintf(str, "HF");
883  Map_Calib[sub][k]->SetTitle(str);
884  Map_Calib[sub][k]->SetXTitle("#eta \b");
885  Map_Calib[sub][k]->SetYTitle("#phi \b");
886  Map_Calib[sub][k]->SetZTitle("Number of events\b");
887  if (sub == 3)
888  Map_Calib[sub][k]->SetTitleOffset(0.8, "Z");
889  Map_Calib[sub][k]->Draw("COLZ");
890  Map_Calib[sub][k]->GetYaxis()->SetRangeUser(0, 72.);
891  // Map_Calib[sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
892  // if (sub==1) {cHB->Modified(); cHB->Update();}
893  // if (sub==2) {cHE->Modified(); cHE->Update();}
894  cONE->Modified();
895  cONE->Update();
896  // if (sub==4) {cHB->Modified(); cHB->Update();}
897  // }//end depth
898 
899  if (sub == 1) {
900  cONE->Print("MapRateCalibEntryHB.png");
901  cONE->Clear();
902  }
903  if (sub == 2) {
904  cONE->Print("MapRateCalibEntryHE.png");
905  cONE->Clear();
906  }
907  if (sub == 3) {
908  cONE->Print("MapRateCalibEntryHO.png");
909  cONE->Clear();
910  }
911  if (sub == 4) {
912  cONE->Print("MapRateCalibEntryHF.png");
913  cONE->Clear();
914  }
915  } // end sub
916 
917  //+++++++++++++++++++++++++++++
918  //Test 11 (Cc) Rate of Cap ID errors for calibration channels
919  //+++++++++++++++++++++++++++++
920 
921  Map_Ampl[11][1][1] = (TH2F *)hfile->Get("h_mapCapCalib047_HB");
922  Map_Ampl[11][1][2] = (TH2F *)hfile->Get("h_mapCapCalib047_HB");
923  Map_Ampl[11][2][1] = (TH2F *)hfile->Get("h_mapCapCalib047_HE");
924  Map_Ampl[11][2][2] = (TH2F *)hfile->Get("h_mapCapCalib047_HE");
925  Map_Ampl[11][2][3] = (TH2F *)hfile->Get("h_mapCapCalib047_HE");
926  Map_Ampl[11][3][4] = (TH2F *)hfile->Get("h_mapCapCalib047_HO");
927  Map_Ampl[11][4][1] = (TH2F *)hfile->Get("h_mapCapCalib047_HF");
928  Map_Ampl[11][4][2] = (TH2F *)hfile->Get("h_mapCapCalib047_HF");
929 
930  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
931  // if (sub==1) cHB->Divide(2,1);
932  // if (sub==2) cHE->Divide(3,1);
933  cONE->Divide(1, 1);
934  // if (sub==4) cHB->Divide(2,1);
935  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
936  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
937  // for (int k=k_min[sub];k<=k_max[sub];k++) { //Depth
938  int k = 1;
939  cONE->cd(k);
940  // if (sub==1) cHB->cd(k);
941  // if (sub==2) cHE->cd(k);
942  if (sub == 3)
943  k = 4;
944  // if (sub==4) cHB->cd(k);
945  Map_Ampl[11][sub][k]->Divide(Map_Ampl[11][sub][k], Map_Calib[sub][k], 1, 1, "B");
946  gPad->SetGridy();
947  gPad->SetGridx();
948  gPad->SetLogz();
949  if (sub == 1)
950  sprintf(str, "HB");
951  if (sub == 2)
952  sprintf(str, "HE");
953  if (sub == 3)
954  sprintf(str, "HO");
955  if (sub == 4)
956  sprintf(str, "HF");
957  Map_Ampl[11][sub][k]->SetTitle(str);
958  Map_Ampl[11][sub][k]->SetXTitle("#eta \b");
959  Map_Ampl[11][sub][k]->SetYTitle("#phi \b");
960  Map_Ampl[11][sub][k]->SetZTitle("Rate \b");
961  Map_Ampl[11][sub][k]->SetTitleOffset(0.75, "Z");
962  Map_Ampl[11][sub][k]->Draw("COLZ");
963  Map_Ampl[11][sub][k]->GetYaxis()->SetRangeUser(0, 72.);
964  Map_Ampl[11][sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
965  // if (sub==1) {cHB->Modified(); cHB->Update();}
966  // if (sub==2) {cHE->Modified(); cHE->Update();}
967  cONE->Modified();
968  cONE->Update();
969  // if (sub==4) {cHB->Modified(); cHB->Update();}
970  // }//end depth
971 
972  if (sub == 1) {
973  cONE->Print("MapRateCapCalibHB.png");
974  cONE->Clear();
975  }
976  if (sub == 2) {
977  cONE->Print("MapRateCapCalibHE.png");
978  cONE->Clear();
979  }
980  if (sub == 3) {
981  cONE->Print("MapRateCapCalibHO.png");
982  cONE->Clear();
983  }
984  if (sub == 4) {
985  cONE->Print("MapRateCapCalibHF.png");
986  cONE->Clear();
987  }
988  } // end sub
989 
990  //+++++++++++++++++++++++++++++
991  //Test 12 (Ac) ADC amplitude for calibration chanels
992  //+++++++++++++++++++++++++++++
993 
994  Map_Ampl[12][1][1] = (TH2F *)hfile->Get("h_mapADCCalib047_HB");
995  Map_Ampl[12][1][2] = (TH2F *)hfile->Get("h_mapADCCalib047_HB");
996  Map_Ampl[12][2][1] = (TH2F *)hfile->Get("h_mapADCCalib047_HE");
997  Map_Ampl[12][2][2] = (TH2F *)hfile->Get("h_mapADCCalib047_HE");
998  Map_Ampl[12][2][3] = (TH2F *)hfile->Get("h_mapADCCalib047_HE");
999  Map_Ampl[12][3][4] = (TH2F *)hfile->Get("h_mapADCCalib047_HO");
1000  Map_Ampl[12][4][1] = (TH2F *)hfile->Get("h_mapADCCalib047_HF");
1001  Map_Ampl[12][4][2] = (TH2F *)hfile->Get("h_mapADCCalib047_HF");
1002 
1003  HistAmpl[12][1] = (TH1F *)hfile->Get("h_ADCCalib_HB");
1004  HistAmpl[12][2] = (TH1F *)hfile->Get("h_ADCCalib_HE");
1005  HistAmpl[12][3] = (TH1F *)hfile->Get("h_ADCCalib_HO");
1006  HistAmpl[12][4] = (TH1F *)hfile->Get("h_ADCCalib_HF");
1007 
1008  //+++++++++++++++++++++++++++++
1009  //Test 13 (Wc) Rate of RMS
1010  //+++++++++++++++++++++++++++++
1011 
1012  Map_Ampl[13][1][1] = (TH2F *)hfile->Get("h_mapWidthCalib047_HB");
1013  Map_Ampl[13][1][2] = (TH2F *)hfile->Get("h_mapWidthCalib047_HB");
1014  Map_Ampl[13][2][1] = (TH2F *)hfile->Get("h_mapWidthCalib047_HE");
1015  Map_Ampl[13][2][2] = (TH2F *)hfile->Get("h_mapWidthCalib047_HE");
1016  Map_Ampl[13][2][3] = (TH2F *)hfile->Get("h_mapWidthCalib047_HE");
1017  Map_Ampl[13][3][4] = (TH2F *)hfile->Get("h_mapWidthCalib047_HO");
1018  Map_Ampl[13][4][1] = (TH2F *)hfile->Get("h_mapWidthCalib047_HF");
1019  Map_Ampl[13][4][2] = (TH2F *)hfile->Get("h_mapWidthCalib047_HF");
1020 
1021  HistAmpl[13][1] = (TH1F *)hfile->Get("h_WidthCalib_HB");
1022  HistAmpl[13][2] = (TH1F *)hfile->Get("h_WidthCalib_HE");
1023  HistAmpl[13][3] = (TH1F *)hfile->Get("h_WidthCalib_HO");
1024  HistAmpl[13][4] = (TH1F *)hfile->Get("h_WidthCalib_HF");
1025 
1026  //+++++++++++++++++++++++++++++
1027  //Test 14 (Rc) Rate of ratio 4 near max TS/ All TS
1028  //+++++++++++++++++++++++++++++
1029 
1030  Map_Ampl[14][1][1] = (TH2F *)hfile->Get("h_mapRatioCalib047_HB");
1031  Map_Ampl[14][1][2] = (TH2F *)hfile->Get("h_mapRatioCalib047_HB");
1032  Map_Ampl[14][2][1] = (TH2F *)hfile->Get("h_mapRatioCalib047_HE");
1033  Map_Ampl[14][2][2] = (TH2F *)hfile->Get("h_mapRatioCalib047_HE");
1034  Map_Ampl[14][2][3] = (TH2F *)hfile->Get("h_mapRatioCalib047_HE");
1035  Map_Ampl[14][3][4] = (TH2F *)hfile->Get("h_mapRatioCalib047_HO");
1036  Map_Ampl[14][4][1] = (TH2F *)hfile->Get("h_mapRatioCalib047_HF");
1037  Map_Ampl[14][4][2] = (TH2F *)hfile->Get("h_mapRatioCalib047_HF");
1038 
1039  HistAmpl[14][1] = (TH1F *)hfile->Get("h_RatioCalib_HB");
1040  HistAmpl[14][2] = (TH1F *)hfile->Get("h_RatioCalib_HE");
1041  HistAmpl[14][3] = (TH1F *)hfile->Get("h_RatioCalib_HO");
1042  HistAmpl[14][4] = (TH1F *)hfile->Get("h_RatioCalib_HF");
1043 
1044  //+++++++++++++++++++++++++++++
1045  //Test 15 (TNc) Mean position in 1-8 TS range
1046  //+++++++++++++++++++++++++++++
1047 
1048  Map_Ampl[15][1][1] = (TH2F *)hfile->Get("h_mapTSmeanCalib047_HB");
1049  Map_Ampl[15][1][2] = (TH2F *)hfile->Get("h_mapTSmeanCalib047_HB");
1050  Map_Ampl[15][2][1] = (TH2F *)hfile->Get("h_mapTSmeanCalib047_HE");
1051  Map_Ampl[15][2][2] = (TH2F *)hfile->Get("h_mapTSmeanCalib047_HE");
1052  Map_Ampl[15][2][3] = (TH2F *)hfile->Get("h_mapTSmeanCalib047_HE");
1053  Map_Ampl[15][3][4] = (TH2F *)hfile->Get("h_mapTSmeanCalib047_HO");
1054  Map_Ampl[15][4][1] = (TH2F *)hfile->Get("h_mapTSmeanCalib047_HF");
1055  Map_Ampl[15][4][2] = (TH2F *)hfile->Get("h_mapTSmeanCalib047_HF");
1056 
1057  HistAmpl[15][1] = (TH1F *)hfile->Get("h_TSmeanCalib_HB");
1058  HistAmpl[15][2] = (TH1F *)hfile->Get("h_TSmeanCalib_HE");
1059  HistAmpl[15][3] = (TH1F *)hfile->Get("h_TSmeanCalib_HO");
1060  HistAmpl[15][4] = (TH1F *)hfile->Get("h_TSmeanCalib_HF");
1061 
1062  //+++++++++++++++++++++++++++++
1063  //Test 16 (TXc) Maximum position in 1-8 TS range
1064  //+++++++++++++++++++++++++++++
1065 
1066  Map_Ampl[16][1][1] = (TH2F *)hfile->Get("h_mapTSmaxCalib047_HB");
1067  Map_Ampl[16][1][2] = (TH2F *)hfile->Get("h_mapTSmaxCalib047_HB");
1068  Map_Ampl[16][2][1] = (TH2F *)hfile->Get("h_mapTSmaxCalib047_HE");
1069  Map_Ampl[16][2][2] = (TH2F *)hfile->Get("h_mapTSmaxCalib047_HE");
1070  Map_Ampl[16][2][3] = (TH2F *)hfile->Get("h_mapTSmaxCalib047_HE");
1071  Map_Ampl[16][3][4] = (TH2F *)hfile->Get("h_mapTSmaxCalib047_HO");
1072  Map_Ampl[16][4][1] = (TH2F *)hfile->Get("h_mapTSmaxCalib047_HF");
1073  Map_Ampl[16][4][2] = (TH2F *)hfile->Get("h_mapTSmaxCalib047_HF");
1074 
1075  HistAmpl[16][1] = (TH1F *)hfile->Get("h_TSmaxCalib_HB");
1076  HistAmpl[16][2] = (TH1F *)hfile->Get("h_TSmaxCalib_HE");
1077  HistAmpl[16][3] = (TH1F *)hfile->Get("h_TSmaxCalib_HO");
1078  HistAmpl[16][4] = (TH1F *)hfile->Get("h_TSmaxCalib_HF");
1079 
1080  for (int test = 12; test <= 16; test++) { //Test: 2-Am, 3-Wm, 4-Rm, 5-TNm, 6-TXm,
1081  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
1082  if (sub == 1)
1083  cONE->Divide(1, 1); //cHB->Divide(2,1);
1084  if (sub == 2)
1085  cONE->Divide(1, 1); //cHE->Divide(3,1);
1086  if (sub == 3)
1087  cONE->Divide(1, 1);
1088  if (sub == 4)
1089  cONE->Divide(1, 1); //cHB->Divide(2,1);
1090  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
1091  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
1092  // for (int k=k_min[sub];k<=k_max[sub];k++) { //Depth
1093  int k = 1;
1094  if (sub == 1) {
1095  k = 1;
1096  cONE->cd(k);
1097  } //cHB->cd(k); }
1098  if (sub == 2) {
1099  k = 1;
1100  cONE->cd(k);
1101  } //cHE->cd(k); }
1102  if (sub == 3) {
1103  k = 4;
1104  cONE->cd(k - 3);
1105  }
1106  if (sub == 4) {
1107  k = 1;
1108  cONE->cd(k);
1109  } //cHB->cd(k); }
1110  Map_Ampl[test][sub][k]->Divide(Map_Ampl[test][sub][k], Map_Calib[sub][k], 1, 1, "B");
1111  gPad->SetGridy();
1112  gPad->SetGridx();
1113  gPad->SetLogz();
1114  if (sub == 1)
1115  sprintf(str, "HB");
1116  if (sub == 2)
1117  sprintf(str, "HE");
1118  if (sub == 3)
1119  sprintf(str, "HO");
1120  if (sub == 4)
1121  sprintf(str, "HF");
1122  Map_Ampl[test][sub][k]->SetTitle(str);
1123  Map_Ampl[test][sub][k]->SetXTitle("#eta \b");
1124  Map_Ampl[test][sub][k]->SetYTitle("#phi \b");
1125  Map_Ampl[test][sub][k]->SetZTitle("Rate \b");
1126  Map_Ampl[test][sub][k]->SetTitleOffset(0.8, "Z");
1127  Map_Ampl[test][sub][k]->Draw("COLZ");
1128  Map_Ampl[test][sub][k]->GetYaxis()->SetRangeUser(0, 72.);
1129  Map_Ampl[test][sub][k]->GetZaxis()->SetRangeUser(0.00001, 1.);
1130  // if (sub==1) {cHB->Modified(); cHB->Update();}
1131  // if (sub==2) {cHE->Modified(); cHE->Update();}
1132  cONE->Modified();
1133  cONE->Update();
1134  // if (sub==4) {cHB->Modified(); cHB->Update();}
1135  // }//end depth
1136  if (test == 12) {
1137  if (sub == 1) {
1138  cONE->Print("MapRateAmplCalibHB.png");
1139  cONE->Clear();
1140  }
1141  if (sub == 2) {
1142  cONE->Print("MapRateAmplCalibHE.png");
1143  cONE->Clear();
1144  }
1145  if (sub == 3) {
1146  cONE->Print("MapRateAmplCalibHO.png");
1147  cONE->Clear();
1148  }
1149  if (sub == 4) {
1150  cONE->Print("MapRateAmplCalibHF.png");
1151  cONE->Clear();
1152  }
1153  }
1154  if (test == 13) {
1155  if (sub == 1) {
1156  cONE->Print("MapRateRMSCalibHB.png");
1157  cONE->Clear();
1158  }
1159  if (sub == 2) {
1160  cONE->Print("MapRateRMSCalibHE.png");
1161  cONE->Clear();
1162  }
1163  if (sub == 3) {
1164  cONE->Print("MapRateRMSCalibHO.png");
1165  cONE->Clear();
1166  }
1167  if (sub == 4) {
1168  cONE->Print("MapRateRMSCalibHF.png");
1169  cONE->Clear();
1170  }
1171  }
1172  if (test == 14) {
1173  if (sub == 1) {
1174  cONE->Print("MapRate43TStoAllTSCalibHB.png");
1175  cONE->Clear();
1176  }
1177  if (sub == 2) {
1178  cONE->Print("MapRate43TStoAllTSCalibHE.png");
1179  cONE->Clear();
1180  }
1181  if (sub == 3) {
1182  cONE->Print("MapRate43TStoAllTSCalibHO.png");
1183  cONE->Clear();
1184  }
1185  if (sub == 4) {
1186  cONE->Print("MapRate43TStoAllTSCalibHF.png");
1187  cONE->Clear();
1188  }
1189  }
1190  if (test == 15) {
1191  if (sub == 1) {
1192  cONE->Print("MapRateMeanPosCalibHB.png");
1193  cONE->Clear();
1194  }
1195  if (sub == 2) {
1196  cONE->Print("MapRateMeanPosCalibHE.png");
1197  cONE->Clear();
1198  }
1199  if (sub == 3) {
1200  cONE->Print("MapRateMeanPosCalibHO.png");
1201  cONE->Clear();
1202  }
1203  if (sub == 4) {
1204  cONE->Print("MapRateMeanPosCalibHF.png");
1205  cONE->Clear();
1206  }
1207  }
1208  if (test == 16) {
1209  if (sub == 1) {
1210  cONE->Print("MapRateMaxPosCalibHB.png");
1211  cONE->Clear();
1212  }
1213  if (sub == 2) {
1214  cONE->Print("MapRateMaxPosCalibHE.png");
1215  cONE->Clear();
1216  }
1217  if (sub == 3) {
1218  cONE->Print("MapRateMaxPosCalibHO.png");
1219  cONE->Clear();
1220  }
1221  if (sub == 4) {
1222  cONE->Print("MapRateMaxPosCalibHF.png");
1223  cONE->Clear();
1224  }
1225  }
1226 
1227  cONE->Divide(1, 1);
1228  cONE->cd(1);
1229  gPad->SetGridy();
1230  gPad->SetGridx();
1231  gPad->SetLogy();
1232  if (sub == 1)
1233  HistAmpl[test][sub]->SetTitle("HB, All Depth");
1234  if (sub == 2)
1235  HistAmpl[test][sub]->SetTitle("HE, All Depth");
1236  if (sub == 3)
1237  HistAmpl[test][sub]->SetTitle("HO, All Depth");
1238  if (sub == 4)
1239  HistAmpl[test][sub]->SetTitle("HF, All Depth");
1240  if (test == 12)
1241  HistAmpl[test][sub]->SetXTitle("ADC Amlitude in each event & cell \b");
1242  if (test == 13)
1243  HistAmpl[test][sub]->SetXTitle("Amplitude RMS in each event & cell \b");
1244  if (test == 14)
1245  HistAmpl[test][sub]->SetXTitle("Ratio in each event & cell \b");
1246  if (test == 15)
1247  HistAmpl[test][sub]->SetXTitle("Mean TS position in each event & cell \b");
1248  if (test == 16)
1249  HistAmpl[test][sub]->SetXTitle("Max TS position in each event & cell \b");
1250  HistAmpl[test][sub]->SetYTitle("Number of cell-events \b");
1251  HistAmpl[test][sub]->SetLineColor(4);
1252  HistAmpl[test][sub]->SetLineWidth(2);
1253  HistAmpl[test][sub]->SetTitleOffset(1.4, "Y");
1254  HistAmpl[test][sub]->Draw("");
1255  // HistAmpl[test][sub]->GetYaxis()->SetRangeUser(1., 100.);
1256  if (test == 12) {
1257  gPad->SetLogx();
1258  HistAmpl[test][sub]->GetXaxis()->SetRangeUser(1., 10000.);
1259  }
1260  if (test == 13)
1261  HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 5.);
1262  if (test == 14)
1263  HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 1.);
1264  if (test == 15)
1265  HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 9.);
1266  if (test == 16)
1267  HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 9.);
1268  cONE->Modified();
1269  cONE->Update();
1270  double min_x[] = {MIN_C[test - 10][sub], MIN_C[test - 10][sub]};
1271  double min_y[] = {0., 100000000.};
1272  TGraph *MIN = new TGraph(2, min_x, min_y);
1273  MIN->SetLineStyle(2);
1274  MIN->SetLineColor(2);
1275  MIN->SetLineWidth(2 + 100 * 100);
1276  MIN->SetFillStyle(3005);
1277  MIN->SetFillColor(2);
1278  MIN->Draw("L");
1279  double max_x[] = {MAX_C[test - 10][sub], MAX_C[test - 10][sub]};
1280  double max_y[] = {0., 100000000.};
1281  TGraph *MAX = new TGraph(2, max_x, max_y);
1282  MAX->SetLineStyle(2);
1283  MAX->SetLineColor(2);
1284  MAX->SetLineWidth(-2 - 100 * 100);
1285  MAX->SetFillStyle(3004);
1286  MAX->SetFillColor(2);
1287  MAX->Draw("L");
1288  if (test == 12) {
1289  if (sub == 1) {
1290  cONE->Print("HistAmplCalibHB.png");
1291  cONE->Clear();
1292  }
1293  if (sub == 2) {
1294  cONE->Print("HistAmplCalibHE.png");
1295  cONE->Clear();
1296  }
1297  if (sub == 3) {
1298  cONE->Print("HistAmplCalibHO.png");
1299  cONE->Clear();
1300  }
1301  if (sub == 4) {
1302  cONE->Print("HistAmplCalibHF.png");
1303  cONE->Clear();
1304  }
1305  }
1306  if (test == 13) {
1307  if (sub == 1) {
1308  cONE->Print("HistRMSCalibHB.png");
1309  cONE->Clear();
1310  }
1311  if (sub == 2) {
1312  cONE->Print("HistRMSCalibHE.png");
1313  cONE->Clear();
1314  }
1315  if (sub == 3) {
1316  cONE->Print("HistRMSCalibHO.png");
1317  cONE->Clear();
1318  }
1319  if (sub == 4) {
1320  cONE->Print("HistRMSCalibHF.png");
1321  cONE->Clear();
1322  }
1323  }
1324  if (test == 14) {
1325  if (sub == 1) {
1326  cONE->Print("Hist43TStoAllTSCalibHB.png");
1327  cONE->Clear();
1328  }
1329  if (sub == 2) {
1330  cONE->Print("Hist43TStoAllTSCalibHE.png");
1331  cONE->Clear();
1332  }
1333  if (sub == 3) {
1334  cONE->Print("Hist43TStoAllTSCalibHO.png");
1335  cONE->Clear();
1336  }
1337  if (sub == 4) {
1338  cONE->Print("Hist43TStoAllTSCalibHF.png");
1339  cONE->Clear();
1340  }
1341  }
1342  if (test == 15) {
1343  if (sub == 1) {
1344  cONE->Print("HistMeanPosCalibHB.png");
1345  cONE->Clear();
1346  }
1347  if (sub == 2) {
1348  cONE->Print("HistMeanPosCalibHE.png");
1349  cONE->Clear();
1350  }
1351  if (sub == 3) {
1352  cONE->Print("HistMeanPosCalibHO.png");
1353  cONE->Clear();
1354  }
1355  if (sub == 4) {
1356  cONE->Print("HistMeanPosCalibHF.png");
1357  cONE->Clear();
1358  }
1359  }
1360  if (test == 16) {
1361  if (sub == 1) {
1362  cONE->Print("HistMaxPosCalibHB.png");
1363  cONE->Clear();
1364  }
1365  if (sub == 2) {
1366  cONE->Print("HistMaxPosCalibHE.png");
1367  cONE->Clear();
1368  }
1369  if (sub == 3) {
1370  cONE->Print("HistMaxPosCalibHO.png");
1371  cONE->Clear();
1372  }
1373  if (sub == 4) {
1374  cONE->Print("HistMaxPosCalibHF.png");
1375  cONE->Clear();
1376  }
1377  }
1378  } // end sub
1379  } //end test
1380 
1381  //+++++++++++++++++++++++++++++
1382  //Test 21 (GS) Amplitude drift
1383  //+++++++++++++++++++++++++++++
1384 
1385  Map_Ampl[21][1][1] = (TH2F *)hfile->Get("h_mapDepth1AmplE34_HB");
1386  Map_Ampl[21][1][2] = (TH2F *)hfile->Get("h_mapDepth2AmplE34_HB");
1387  Map_Ampl[21][1][3] = (TH2F *)hfile->Get("h_mapDepth3AmplE34_HB");
1388  Map_Ampl[21][1][4] = (TH2F *)hfile->Get("h_mapDepth4AmplE34_HB");
1389  Map_Ampl[21][2][1] = (TH2F *)hfile->Get("h_mapDepth1AmplE34_HE");
1390  Map_Ampl[21][2][2] = (TH2F *)hfile->Get("h_mapDepth2AmplE34_HE");
1391  Map_Ampl[21][2][3] = (TH2F *)hfile->Get("h_mapDepth3AmplE34_HE");
1392  Map_Ampl[21][2][4] = (TH2F *)hfile->Get("h_mapDepth4AmplE34_HE");
1393  Map_Ampl[21][2][5] = (TH2F *)hfile->Get("h_mapDepth5AmplE34_HE");
1394  Map_Ampl[21][2][6] = (TH2F *)hfile->Get("h_mapDepth6AmplE34_HE");
1395  Map_Ampl[21][2][7] = (TH2F *)hfile->Get("h_mapDepth7AmplE34_HE");
1396  Map_Ampl[21][3][4] = (TH2F *)hfile->Get("h_mapDepth4AmplE34_HO");
1397  Map_Ampl[21][4][1] = (TH2F *)hfile->Get("h_mapDepth1AmplE34_HF");
1398  Map_Ampl[21][4][2] = (TH2F *)hfile->Get("h_mapDepth2AmplE34_HF");
1399  Map_Ampl[21][4][3] = (TH2F *)hfile->Get("h_mapDepth3AmplE34_HF");
1400  Map_Ampl[21][4][4] = (TH2F *)hfile->Get("h_mapDepth4AmplE34_HF");
1401 
1402  TH2F *Map_RefAmpl[5][ALLDEPTH]; // 2D histogramm for subdet, depth
1403  TH2F *Map_RefSUB[5][ALLDEPTH]; // 2d histogramm for subdet, depth
1404 
1405  Map_RefAmpl[1][1] = (TH2F *)hreffile->Get("h_mapDepth1AmplE34_HB");
1406  Map_RefAmpl[1][2] = (TH2F *)hreffile->Get("h_mapDepth2AmplE34_HB");
1407  Map_RefAmpl[1][3] = (TH2F *)hreffile->Get("h_mapDepth3AmplE34_HB");
1408  Map_RefAmpl[1][4] = (TH2F *)hreffile->Get("h_mapDepth4AmplE34_HB");
1409  Map_RefAmpl[2][1] = (TH2F *)hreffile->Get("h_mapDepth1AmplE34_HE");
1410  Map_RefAmpl[2][2] = (TH2F *)hreffile->Get("h_mapDepth2AmplE34_HE");
1411  Map_RefAmpl[2][3] = (TH2F *)hreffile->Get("h_mapDepth3AmplE34_HE");
1412  Map_RefAmpl[2][4] = (TH2F *)hreffile->Get("h_mapDepth4AmplE34_HE");
1413  Map_RefAmpl[2][5] = (TH2F *)hreffile->Get("h_mapDepth5AmplE34_HE");
1414  Map_RefAmpl[2][6] = (TH2F *)hreffile->Get("h_mapDepth6AmplE34_HE");
1415  Map_RefAmpl[2][7] = (TH2F *)hreffile->Get("h_mapDepth7AmplE34_HE");
1416  Map_RefAmpl[3][4] = (TH2F *)hreffile->Get("h_mapDepth4AmplE34_HO");
1417  Map_RefAmpl[4][1] = (TH2F *)hreffile->Get("h_mapDepth1AmplE34_HF");
1418  Map_RefAmpl[4][2] = (TH2F *)hreffile->Get("h_mapDepth2AmplE34_HF");
1419  Map_RefAmpl[4][3] = (TH2F *)hreffile->Get("h_mapDepth3AmplE34_HF");
1420  Map_RefAmpl[4][4] = (TH2F *)hreffile->Get("h_mapDepth4AmplE34_HF");
1421 
1422  Map_RefSUB[1][1] = (TH2F *)hreffile->Get("h_mapDepth1_HB");
1423  Map_RefSUB[1][2] = (TH2F *)hreffile->Get("h_mapDepth2_HB");
1424  Map_RefSUB[1][3] = (TH2F *)hreffile->Get("h_mapDepth3_HB");
1425  Map_RefSUB[1][4] = (TH2F *)hreffile->Get("h_mapDepth4_HB");
1426  Map_RefSUB[2][1] = (TH2F *)hreffile->Get("h_mapDepth1_HE");
1427  Map_RefSUB[2][2] = (TH2F *)hreffile->Get("h_mapDepth2_HE");
1428  Map_RefSUB[2][3] = (TH2F *)hreffile->Get("h_mapDepth3_HE");
1429  Map_RefSUB[2][4] = (TH2F *)hreffile->Get("h_mapDepth4_HE");
1430  Map_RefSUB[2][5] = (TH2F *)hreffile->Get("h_mapDepth5_HE");
1431  Map_RefSUB[2][6] = (TH2F *)hreffile->Get("h_mapDepth6_HE");
1432  Map_RefSUB[2][7] = (TH2F *)hreffile->Get("h_mapDepth7_HE");
1433  Map_RefSUB[3][4] = (TH2F *)hreffile->Get("h_mapDepth4_HO");
1434  Map_RefSUB[4][1] = (TH2F *)hreffile->Get("h_mapDepth1_HF");
1435  Map_RefSUB[4][2] = (TH2F *)hreffile->Get("h_mapDepth2_HF");
1436  Map_RefSUB[4][3] = (TH2F *)hreffile->Get("h_mapDepth3_HF");
1437  Map_RefSUB[4][4] = (TH2F *)hreffile->Get("h_mapDepth4_HF");
1438 
1439  HistAmplDepth[21][1][1] = new TH1F("diffAmpl_Depth1_HB", "", 100, -10., 10.);
1440  HistAmplDepth[21][1][2] = new TH1F("diffAmpl_Depth2_HB", "", 100, -10., 10.);
1441  HistAmplDepth[21][1][3] = new TH1F("diffAmpl_Depth3_HB", "", 100, -10., 10.);
1442  HistAmplDepth[21][1][4] = new TH1F("diffAmpl_Depth4_HB", "", 100, -10., 10.);
1443  HistAmplDepth[21][2][1] = new TH1F("diffAmpl_Depth1_HE", "", 100, -10., 10.);
1444  HistAmplDepth[21][2][2] = new TH1F("diffAmpl_Depth2_HE", "", 100, -10., 10.);
1445  HistAmplDepth[21][2][3] = new TH1F("diffAmpl_Depth3_HE", "", 100, -10., 10.);
1446  HistAmplDepth[21][2][4] = new TH1F("diffAmpl_Depth4_HE", "", 100, -10., 10.);
1447  HistAmplDepth[21][2][5] = new TH1F("diffAmpl_Depth5_HE", "", 100, -10., 10.);
1448  HistAmplDepth[21][2][6] = new TH1F("diffAmpl_Depth6_HE", "", 100, -10., 10.);
1449  HistAmplDepth[21][2][7] = new TH1F("diffAmpl_Depth7_HE", "", 100, -10., 10.);
1450  HistAmplDepth[21][3][4] = new TH1F("diffAmpl_Depth4_HO", "", 100, -10., 10.);
1451  HistAmplDepth[21][4][1] = new TH1F("diffAmpl_Depth1_HF", "", 100, -10., 10.);
1452  HistAmplDepth[21][4][2] = new TH1F("diffAmpl_Depth2_HF", "", 100, -10., 10.);
1453  HistAmplDepth[21][4][3] = new TH1F("diffAmpl_Depth3_HF", "", 100, -10., 10.);
1454  HistAmplDepth[21][4][4] = new TH1F("diffAmpl_Depth4_HF", "", 100, -10., 10.);
1455 
1456  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
1457  // if (sub==1) cHB->Divide(2,1);
1458  if (sub == 1)
1459  cHB->Divide(2, 2);
1460  // if (sub==2) cHE->Divide(3,1);
1461  if (sub == 2)
1462  cHE->Divide(3, 3);
1463  if (sub == 3)
1464  cONE->Divide(1, 1);
1465  // if (sub==4) cHF->Divide(2,1);
1466  if (sub == 4)
1467  cHF->Divide(2, 2);
1468  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
1469  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
1470  // int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
1471  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
1472  if (sub == 1)
1473  cHB->cd(k);
1474  if (sub == 2)
1475  cHE->cd(k);
1476  if (sub == 3)
1477  cONE->cd(k - 3);
1478  if (sub == 4)
1479  cHF->cd(k);
1480  Map_Ampl[21][sub][k]->Divide(Map_Ampl[21][sub][k], Map_SUB[sub][k], 1, 1, "B");
1481  gPad->SetGridy();
1482  gPad->SetGridx();
1483  gPad->SetLogz();
1484  if (sub == 1)
1485  sprintf(str, "HB, Depth%d \b", k);
1486  if (sub == 2)
1487  sprintf(str, "HE, Depth%d \b", k);
1488  if (sub == 3)
1489  sprintf(str, "HO, Depth%d \b", k);
1490  if (sub == 4)
1491  sprintf(str, "HF, Depth%d \b", k);
1492  Map_Ampl[21][sub][k]->SetTitle(str);
1493  Map_Ampl[21][sub][k]->SetXTitle("#eta \b");
1494  Map_Ampl[21][sub][k]->SetYTitle("#phi \b");
1495  Map_Ampl[21][sub][k]->SetZTitle("Response \b");
1496  Map_Ampl[21][sub][k]->SetTitleOffset(1.1, "Z");
1497  Map_Ampl[21][sub][k]->Draw("COLZ");
1498  Map_Ampl[21][sub][k]->GetYaxis()->SetRangeUser(0, 71.);
1499  // Map_Ampl[21][sub][k]->GetZaxis()->SetRangeUser(1., 10.);
1500  if (sub == 1) {
1501  cHB->Modified();
1502  cHB->Update();
1503  }
1504  if (sub == 2) {
1505  cHE->Modified();
1506  cHE->Update();
1507  }
1508  if (sub == 3) {
1509  cONE->Modified();
1510  cONE->Update();
1511  }
1512  if (sub == 4) {
1513  cHF->Modified();
1514  cHF->Update();
1515  }
1516  } //end depth
1517  if (sub == 1) {
1518  cHB->Print("MapRateAmpl1HB.png");
1519  cHB->Clear();
1520  }
1521  if (sub == 2) {
1522  cHE->Print("MapRateAmpl1HE.png");
1523  cHE->Clear();
1524  }
1525  if (sub == 3) {
1526  cONE->Print("MapRateAmpl1HO.png");
1527  cONE->Clear();
1528  }
1529  if (sub == 4) {
1530  cHF->Print("MapRateAmpl1HF.png");
1531  cHF->Clear();
1532  }
1533 
1534  // if (sub==1) cHB->Divide(2,1);
1535  if (sub == 1)
1536  cHB->Divide(2, 2);
1537  // if (sub==2) cHE->Divide(3,1);
1538  if (sub == 2)
1539  cHE->Divide(3, 3);
1540  if (sub == 3)
1541  cONE->Divide(1, 1);
1542  // if (sub==4) cHF->Divide(2,1);
1543  if (sub == 4)
1544  cHF->Divide(2, 2);
1545 
1546  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
1547  if (sub == 1)
1548  cHB->cd(k);
1549  if (sub == 2)
1550  cHE->cd(k);
1551  if (sub == 3)
1552  cONE->cd(k - 3);
1553  if (sub == 4)
1554  cHF->cd(k);
1555  Map_RefAmpl[sub][k]->Divide(Map_RefAmpl[sub][k], Map_RefSUB[sub][k], 1, 1, "B");
1556  gPad->SetGridy();
1557  gPad->SetGridx();
1558  gPad->SetLogz();
1559  if (sub == 1)
1560  sprintf(str, "HB, Depth%d \b", k);
1561  if (sub == 2)
1562  sprintf(str, "HE, Depth%d \b", k);
1563  if (sub == 3)
1564  sprintf(str, "HO, Depth%d \b", k);
1565  if (sub == 4)
1566  sprintf(str, "HF, Depth%d \b", k);
1567  Map_RefAmpl[sub][k]->SetTitle(str);
1568  Map_RefAmpl[sub][k]->SetXTitle("#eta \b");
1569  Map_RefAmpl[sub][k]->SetYTitle("#phi \b");
1570  Map_RefAmpl[sub][k]->SetZTitle("Response\b");
1571  Map_RefAmpl[sub][k]->SetTitleOffset(1.1, "Z");
1572  Map_RefAmpl[sub][k]->Draw("COLZ");
1573  Map_RefAmpl[sub][k]->GetYaxis()->SetRangeUser(0, 71.);
1574  // Map_RefAmpl[21][sub][k]->GetZaxis()->SetRangeUser(1., 10.);
1575  if (sub == 1) {
1576  cHB->Modified();
1577  cHB->Update();
1578  }
1579  if (sub == 2) {
1580  cHE->Modified();
1581  cHE->Update();
1582  }
1583  if (sub == 3) {
1584  cONE->Modified();
1585  cONE->Update();
1586  }
1587  if (sub == 4) {
1588  cHF->Modified();
1589  cHF->Update();
1590  }
1591  } //end depth
1592  if (sub == 1) {
1593  cHB->Print("MapRateAmpl2HB.png");
1594  cHB->Clear();
1595  }
1596  if (sub == 2) {
1597  cHE->Print("MapRateAmpl2HE.png");
1598  cHE->Clear();
1599  }
1600  if (sub == 3) {
1601  cONE->Print("MapRateAmpl2HO.png");
1602  cONE->Clear();
1603  }
1604  if (sub == 4) {
1605  cHF->Print("MapRateAmpl2HF.png");
1606  cHF->Clear();
1607  }
1608 
1609  // if (sub==1) cHB->Divide(2,1);
1610  if (sub == 1)
1611  cHB->Divide(2, 2);
1612  // if (sub==2) cHE->Divide(3,1);
1613  if (sub == 2)
1614  cHE->Divide(3, 3);
1615  if (sub == 3)
1616  cONE->Divide(1, 1);
1617  // if (sub==4) cHF->Divide(2,1);
1618  if (sub == 4)
1619  cHF->Divide(2, 2);
1620 
1621  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
1622  if (sub == 1)
1623  cHB->cd(k);
1624  if (sub == 2)
1625  cHE->cd(k);
1626  if (sub == 3)
1627  cONE->cd(k - 3);
1628  if (sub == 4)
1629  cHF->cd(k);
1630  TH2F *TTT = new TH2F("Map", "Map", 82, -41, 40, 72, 0, 71);
1631  for (int x = 1; x <= Map_Ampl[21][sub][k]->GetXaxis()->GetNbins(); x++) {
1632  for (int y = 1; y <= Map_Ampl[21][sub][k]->GetYaxis()->GetNbins(); y++) {
1633  if (Map_Ampl[21][sub][k]->GetBinContent(x, y) != 0 && Map_RefAmpl[sub][k]->GetBinContent(x, y) != 0) {
1634  double ccc1 = Map_Ampl[21][sub][k]->GetBinContent(x, y) - Map_RefAmpl[sub][k]->GetBinContent(x, y);
1635  ccc1 = 100. * ccc1 / Map_Ampl[21][sub][k]->GetBinContent(x, y); // in %
1636  HistAmplDepth[21][sub][k]->Fill(ccc1);
1637  Map_Ampl[21][sub][k]->SetBinContent(x, y, fabs(ccc1));
1638  if (fabs(ccc1) > porog[sub])
1639  TTT->SetBinContent(x, y, fabs(ccc1));
1640  else
1641  TTT->SetBinContent(x, y, 0);
1642  }
1643  } //end y
1644  } //esnd x
1645  gPad->SetGridy();
1646  gPad->SetGridx();
1647  // gPad->SetLogz();
1648  if (sub == 1)
1649  sprintf(str, "HB, Depth%d \b", k);
1650  if (sub == 2)
1651  sprintf(str, "HE, Depth%d \b", k);
1652  if (sub == 3)
1653  sprintf(str, "HO, Depth%d \b", k);
1654  if (sub == 4)
1655  sprintf(str, "HF, Depth%d \b", k);
1656  TTT->SetTitle(str);
1657  TTT->SetXTitle("#eta \b");
1658  TTT->SetYTitle("#phi \b");
1659  TTT->SetZTitle("Relative difference, % \b");
1660  TTT->SetTitleOffset(0.9, "Z");
1661  TTT->Draw("COLZ");
1662  TTT->GetYaxis()->SetRangeUser(0, 71.);
1663  TTT->GetZaxis()->SetRangeUser(0, 10.);
1664  if (sub == 1) {
1665  cHB->Modified();
1666  cHB->Update();
1667  }
1668  if (sub == 2) {
1669  cHE->Modified();
1670  cHE->Update();
1671  }
1672  if (sub == 3) {
1673  cONE->Modified();
1674  cONE->Update();
1675  }
1676  if (sub == 4) {
1677  cHF->Modified();
1678  cHF->Update();
1679  }
1680  } //end depth
1681 
1682  if (sub == 1) {
1683  cHB->Print("MapRateAmplDriftHB.png");
1684  cHB->Clear();
1685  }
1686  if (sub == 2) {
1687  cHE->Print("MapRateAmplDriftHE.png");
1688  cHE->Clear();
1689  }
1690  if (sub == 3) {
1691  cONE->Print("MapRateAmplDriftHO.png");
1692  cONE->Clear();
1693  }
1694  if (sub == 4) {
1695  cHF->Print("MapRateAmplDriftHF.png");
1696  cHF->Clear();
1697  }
1699 
1700  // if (sub==1) cHB->Divide(2,1);
1701  if (sub == 1)
1702  cHB->Divide(2, 2);
1703  // if (sub==2) cHE->Divide(3,1);
1704  if (sub == 2)
1705  cHE->Divide(3, 3);
1706  if (sub == 3)
1707  cONE->Divide(1, 1);
1708  // if (sub==4) cHF->Divide(2,1);
1709  if (sub == 4)
1710  cHF->Divide(2, 2);
1711 
1712  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
1713  if (sub == 1)
1714  cHB->cd(k);
1715  if (sub == 2)
1716  cHE->cd(k);
1717  if (sub == 3)
1718  cONE->cd(k - 3);
1719  if (sub == 4)
1720  cHF->cd(k);
1721  gPad->SetGridy();
1722  gPad->SetGridx();
1723  gPad->SetLogy();
1724  if (sub == 1)
1725  sprintf(str, "HB, Depth%d \b", k);
1726  if (sub == 2)
1727  sprintf(str, "HE, Depth%d \b", k);
1728  if (sub == 3)
1729  sprintf(str, "HO, Depth%d \b", k);
1730  if (sub == 4)
1731  sprintf(str, "HF, Depth%d \b", k);
1732  HistAmplDepth[21][sub][k]->SetTitle(str);
1733  HistAmplDepth[21][sub][k]->SetYTitle("Number of cell-events \b");
1734  HistAmplDepth[21][sub][k]->SetXTitle("Per cent \b");
1735  HistAmplDepth[21][sub][k]->SetLineColor(4);
1736  HistAmplDepth[21][sub][k]->SetLineWidth(2);
1737  HistAmplDepth[21][sub][k]->SetTitleOffset(1.4, "Y");
1738  HistAmplDepth[21][sub][k]->Draw();
1739  // HistAmplDepth[21][sub][k]->GetYaxis()->SetRangeUser(0, 72.);
1740  HistAmplDepth[21][sub][k]->GetXaxis()->SetRangeUser(-10., 10.);
1741  if (sub == 1) {
1742  cHB->Modified();
1743  cHB->Update();
1744  }
1745  if (sub == 2) {
1746  cHE->Modified();
1747  cHE->Update();
1748  }
1749  if (sub == 3) {
1750  cONE->Modified();
1751  cONE->Update();
1752  }
1753  if (sub == 4) {
1754  cHF->Modified();
1755  cHF->Update();
1756  }
1757  double min_x[] = {-1 * porog[sub], -1 * porog[sub]};
1758  double min_y[] = {0., 100000000.};
1759  TGraph *MIN = new TGraph(2, min_x, min_y);
1760  MIN->SetLineStyle(2);
1761  MIN->SetLineColor(2);
1762  MIN->SetLineWidth(2 + 100 * 100);
1763  MIN->SetFillStyle(3005);
1764  MIN->SetFillColor(2);
1765  MIN->Draw("L");
1766  double max_x[] = {porog[sub], porog[sub]};
1767  double max_y[] = {0., 100000000.};
1768  TGraph *MAX = new TGraph(2, max_x, max_y);
1769  MAX->SetLineStyle(2);
1770  MAX->SetLineColor(2);
1771  MAX->SetLineWidth(-2 - 100 * 100);
1772  MAX->SetFillStyle(3004);
1773  MAX->SetFillColor(2);
1774  MAX->Draw("L");
1775  } // end depth
1776  if (sub == 1) {
1777  cHB->Print("HistAmplDriftDepthHB.png");
1778  cHB->Clear();
1779  }
1780  if (sub == 2) {
1781  cHE->Print("HistAmplDriftDepthHE.png");
1782  cHE->Clear();
1783  }
1784  if (sub == 3) {
1785  cONE->Print("HistAmplDriftDepthHO.png");
1786  cONE->Clear();
1787  }
1788  if (sub == 4) {
1789  cHF->Print("HistAmplDriftDepthHF.png");
1790  cHF->Clear();
1791  }
1792  } //end sub
1793 
1794  //+++++++++++++++++++++++++++++++++++
1795  //Test 31, 32 Pedestal, pedestalWidths
1796  //++++++++++++++++++++++++++++++++++++
1797 
1798  Map_Ampl[31][1][1] = (TH2F *)hfile->Get("h_mapDepth1pedestal_HB");
1799  Map_Ampl[31][1][2] = (TH2F *)hfile->Get("h_mapDepth2pedestal_HB");
1800  Map_Ampl[31][1][3] = (TH2F *)hfile->Get("h_mapDepth3pedestal_HB");
1801  Map_Ampl[31][1][4] = (TH2F *)hfile->Get("h_mapDepth4pedestal_HB");
1802  Map_Ampl[31][2][1] = (TH2F *)hfile->Get("h_mapDepth1pedestal_HE");
1803  Map_Ampl[31][2][2] = (TH2F *)hfile->Get("h_mapDepth2pedestal_HE");
1804  Map_Ampl[31][2][3] = (TH2F *)hfile->Get("h_mapDepth3pedestal_HE");
1805  Map_Ampl[31][2][4] = (TH2F *)hfile->Get("h_mapDepth4pedestal_HE");
1806  Map_Ampl[31][2][5] = (TH2F *)hfile->Get("h_mapDepth5pedestal_HE");
1807  Map_Ampl[31][2][6] = (TH2F *)hfile->Get("h_mapDepth6pedestal_HE");
1808  Map_Ampl[31][2][7] = (TH2F *)hfile->Get("h_mapDepth7pedestal_HE");
1809  Map_Ampl[31][3][4] = (TH2F *)hfile->Get("h_mapDepth4pedestal_HO");
1810  Map_Ampl[31][4][1] = (TH2F *)hfile->Get("h_mapDepth1pedestal_HF");
1811  Map_Ampl[31][4][2] = (TH2F *)hfile->Get("h_mapDepth2pedestal_HF");
1812  Map_Ampl[31][4][3] = (TH2F *)hfile->Get("h_mapDepth3pedestal_HF");
1813  Map_Ampl[31][4][4] = (TH2F *)hfile->Get("h_mapDepth4pedestal_HF");
1814 
1815  Map_Ampl[32][1][1] = (TH2F *)hfile->Get("h_mapDepth1pedestalw_HB");
1816  Map_Ampl[32][1][2] = (TH2F *)hfile->Get("h_mapDepth2pedestalw_HB");
1817  Map_Ampl[32][1][3] = (TH2F *)hfile->Get("h_mapDepth3pedestalw_HB");
1818  Map_Ampl[32][1][4] = (TH2F *)hfile->Get("h_mapDepth4pedestalw_HB");
1819  Map_Ampl[32][2][1] = (TH2F *)hfile->Get("h_mapDepth1pedestalw_HE");
1820  Map_Ampl[32][2][2] = (TH2F *)hfile->Get("h_mapDepth2pedestalw_HE");
1821  Map_Ampl[32][2][3] = (TH2F *)hfile->Get("h_mapDepth3pedestalw_HE");
1822  Map_Ampl[32][2][4] = (TH2F *)hfile->Get("h_mapDepth4pedestalw_HE");
1823  Map_Ampl[32][2][5] = (TH2F *)hfile->Get("h_mapDepth5pedestalw_HE");
1824  Map_Ampl[32][2][6] = (TH2F *)hfile->Get("h_mapDepth6pedestalw_HE");
1825  Map_Ampl[32][2][7] = (TH2F *)hfile->Get("h_mapDepth7pedestalw_HE");
1826  Map_Ampl[32][3][4] = (TH2F *)hfile->Get("h_mapDepth4pedestalw_HO");
1827  Map_Ampl[32][4][1] = (TH2F *)hfile->Get("h_mapDepth1pedestalw_HF");
1828  Map_Ampl[32][4][2] = (TH2F *)hfile->Get("h_mapDepth2pedestalw_HF");
1829  Map_Ampl[32][4][3] = (TH2F *)hfile->Get("h_mapDepth3pedestalw_HF");
1830  Map_Ampl[32][4][4] = (TH2F *)hfile->Get("h_mapDepth4pedestalw_HF");
1831 
1832  HistPed[1][1][0] = (TH1F *)hfile->Get("h_pedestal0_HB");
1833  HistPed[1][1][1] = (TH1F *)hfile->Get("h_pedestal1_HB");
1834  HistPed[1][1][2] = (TH1F *)hfile->Get("h_pedestal2_HB");
1835  HistPed[1][1][3] = (TH1F *)hfile->Get("h_pedestal3_HB");
1836  HistPed[2][1][0] = (TH1F *)hfile->Get("h_pedestalw0_HB");
1837  HistPed[2][1][1] = (TH1F *)hfile->Get("h_pedestalw1_HB");
1838  HistPed[2][1][2] = (TH1F *)hfile->Get("h_pedestalw2_HB");
1839  HistPed[2][1][3] = (TH1F *)hfile->Get("h_pedestalw3_HB");
1840 
1841  HistPed[1][2][0] = (TH1F *)hfile->Get("h_pedestal0_HE");
1842  HistPed[1][2][1] = (TH1F *)hfile->Get("h_pedestal1_HE");
1843  HistPed[1][2][2] = (TH1F *)hfile->Get("h_pedestal2_HE");
1844  HistPed[1][2][3] = (TH1F *)hfile->Get("h_pedestal3_HE");
1845  HistPed[2][2][0] = (TH1F *)hfile->Get("h_pedestalw0_HE");
1846  HistPed[2][2][1] = (TH1F *)hfile->Get("h_pedestalw1_HE");
1847  HistPed[2][2][2] = (TH1F *)hfile->Get("h_pedestalw2_HE");
1848  HistPed[2][2][3] = (TH1F *)hfile->Get("h_pedestalw3_HE");
1849 
1850  HistPed[1][3][0] = (TH1F *)hfile->Get("h_pedestal0_HO");
1851  HistPed[1][3][1] = (TH1F *)hfile->Get("h_pedestal1_HO");
1852  HistPed[1][3][2] = (TH1F *)hfile->Get("h_pedestal2_HO");
1853  HistPed[1][3][3] = (TH1F *)hfile->Get("h_pedestal3_HO");
1854  HistPed[2][3][0] = (TH1F *)hfile->Get("h_pedestalw0_HO");
1855  HistPed[2][3][1] = (TH1F *)hfile->Get("h_pedestalw1_HO");
1856  HistPed[2][3][2] = (TH1F *)hfile->Get("h_pedestalw2_HO");
1857  HistPed[2][3][3] = (TH1F *)hfile->Get("h_pedestalw3_HO");
1858 
1859  HistPed[1][4][0] = (TH1F *)hfile->Get("h_pedestal0_HF");
1860  HistPed[1][4][1] = (TH1F *)hfile->Get("h_pedestal1_HF");
1861  HistPed[1][4][2] = (TH1F *)hfile->Get("h_pedestal2_HF");
1862  HistPed[1][4][3] = (TH1F *)hfile->Get("h_pedestal3_HF");
1863  HistPed[2][4][0] = (TH1F *)hfile->Get("h_pedestalw0_HF");
1864  HistPed[2][4][1] = (TH1F *)hfile->Get("h_pedestalw1_HF");
1865  HistPed[2][4][2] = (TH1F *)hfile->Get("h_pedestalw2_HF");
1866  HistPed[2][4][3] = (TH1F *)hfile->Get("h_pedestalw3_HF");
1867 
1868  for (int test = 31; test <= 32; test++) { //Test: 31-Pedestals, 32-pedestal Widths,
1869  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
1870  // if (sub==1) cHB->Divide(2,1);
1871  if (sub == 1)
1872  cHB->Divide(2, 2);
1873  // if (sub==2) cHE->Divide(3,1);
1874  if (sub == 2)
1875  cHE->Divide(3, 3);
1876  if (sub == 3)
1877  cONE->Divide(1, 1);
1878  // if (sub==4) cHF->Divide(2,1);
1879  if (sub == 4)
1880  cHF->Divide(2, 2);
1881  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
1882  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
1883  // int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
1884  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depths
1885  if (sub == 1)
1886  cHB->cd(k);
1887  if (sub == 2)
1888  cHE->cd(k);
1889  if (sub == 3)
1890  cONE->cd(k - 3);
1891  if (sub == 4)
1892  cHF->cd(k);
1893  Map_Ampl[test][sub][k]->Divide(Map_Ampl[test][sub][k], Map_SUB[sub][k], 1, 1, "B");
1894  gPad->SetGridy();
1895  gPad->SetGridx();
1896  gPad->SetLogz();
1897  if (sub == 1)
1898  sprintf(str, "HB, Depth%d \b", k);
1899  if (sub == 2)
1900  sprintf(str, "HE, Depth%d \b", k);
1901  if (sub == 3)
1902  sprintf(str, "HO, Depth%d \b", k);
1903  if (sub == 4)
1904  sprintf(str, "HF, Depth%d \b", k);
1905  Map_Ampl[test][sub][k]->SetTitle(str);
1906  Map_Ampl[test][sub][k]->SetXTitle("#eta \b");
1907  Map_Ampl[test][sub][k]->SetYTitle("#phi \b");
1908  Map_Ampl[test][sub][k]->SetZTitle("Rate \b");
1909  if (sub == 3)
1910  Map_Ampl[test][sub][k]->SetTitleOffset(0.8, "Z");
1911  Map_Ampl[test][sub][k]->Draw("COLZ");
1912  Map_Ampl[test][sub][k]->GetYaxis()->SetRangeUser(0, 72.);
1913  Map_Ampl[test][sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
1914  if (sub == 1) {
1915  cHB->Modified();
1916  cHB->Update();
1917  }
1918  if (sub == 2) {
1919  cHE->Modified();
1920  cHE->Update();
1921  }
1922  if (sub == 3) {
1923  cONE->Modified();
1924  cONE->Update();
1925  }
1926  if (sub == 4) {
1927  cHF->Modified();
1928  cHF->Update();
1929  }
1930  } //end depth
1931  if (test == 31) {
1932  if (sub == 1) {
1933  cHB->Print("MapRatePedHB.png");
1934  cHB->Clear();
1935  }
1936  if (sub == 2) {
1937  cHE->Print("MapRatePedHE.png");
1938  cHE->Clear();
1939  }
1940  if (sub == 3) {
1941  cONE->Print("MapRatePedHO.png");
1942  cONE->Clear();
1943  }
1944  if (sub == 4) {
1945  cHF->Print("MapRatePedHF.png");
1946  cHF->Clear();
1947  }
1948  }
1949  if (test == 32) {
1950  if (sub == 1) {
1951  cHB->Print("MapRatePedWidthsHB.png");
1952  cHB->Clear();
1953  }
1954  if (sub == 2) {
1955  cHE->Print("MapRatePedWidthsHE.png");
1956  cHE->Clear();
1957  }
1958  if (sub == 3) {
1959  cONE->Print("MapRatePedWidthsHO.png");
1960  cONE->Clear();
1961  }
1962  if (sub == 4) {
1963  cHF->Print("MapRatePedWidthsHF.png");
1964  cHF->Clear();
1965  }
1966  }
1967 
1969 
1970  cPED->Divide(2, 2);
1971  for (int cap = 0; cap <= 3; cap++) {
1972  cPED->cd(cap + 1);
1973  gPad->SetGridy();
1974  gPad->SetGridx();
1975  gPad->SetLogy();
1976 
1977  if (sub == 1)
1978  sprintf(str, "HB, Cap%d, all depth\b", cap);
1979  if (sub == 2)
1980  sprintf(str, "HE, Cap%d, all depth\b", cap);
1981  if (sub == 3)
1982  sprintf(str, "HO, Cap%d, all depth\b", cap);
1983  if (sub == 4)
1984  sprintf(str, "HF, Cap%d, all depth\b", cap);
1985 
1986  HistPed[test - 30][sub][cap]->SetTitle(str);
1987 
1988  if (test == 31)
1989  HistPed[test - 30][sub][cap]->SetXTitle("Pedestals in each event & cell \b");
1990  if (test == 32)
1991  HistPed[test - 30][sub][cap]->SetXTitle("Pedestal Widths in each event & cell \b");
1992 
1993  HistPed[test - 30][sub][cap]->SetYTitle("Number of channel-events \b");
1994  HistPed[test - 30][sub][cap]->SetLineColor(4);
1995  HistPed[test - 30][sub][cap]->SetLineWidth(2);
1996  HistPed[test - 30][sub][cap]->SetTitleOffset(1.4, "Y");
1997  HistPed[test - 30][sub][cap]->Draw("");
1998  // HistPed[test-30][sub][cap]->GetYaxis()->SetRangeUser(1., 100.);
1999  // if (test==31) {gPad->SetLogx(); HistPed[test-30][sub][cap]->GetXaxis()->SetRangeUser(1., 10000.);}
2000  // if (test==32) HistPed[test-30][sub][cap]->GetXaxis()->SetRangeUser(0., 5.);
2001 
2002  cPED->Modified();
2003  cPED->Update();
2004  double min_x[] = {Pedest[test - 31][sub], Pedest[test - 31][sub]};
2005  double min_y[] = {0., 100000000.};
2006  TGraph *MIN = new TGraph(2, min_x, min_y);
2007  MIN->SetLineStyle(2);
2008  MIN->SetLineColor(2);
2009  MIN->SetLineWidth(2 + 100 * 100);
2010  MIN->SetFillStyle(3005);
2011  MIN->SetFillColor(2);
2012  MIN->Draw("L");
2013  }
2014  if (test == 31) {
2015  if (sub == 1) {
2016  cPED->Print("HistPedestalsHB.png");
2017  cPED->Clear();
2018  }
2019  if (sub == 2) {
2020  cPED->Print("HistPedestalsHE.png");
2021  cPED->Clear();
2022  }
2023  if (sub == 3) {
2024  cPED->Print("HistPedestalsHO.png");
2025  cPED->Clear();
2026  }
2027  if (sub == 4) {
2028  cPED->Print("HistPedestalsHF.png");
2029  cPED->Clear();
2030  }
2031  }
2032  if (test == 32) {
2033  if (sub == 1) {
2034  cPED->Print("HistPedestalWidthsHB.png");
2035  cPED->Clear();
2036  }
2037  if (sub == 2) {
2038  cPED->Print("HistPedestalWidthsHE.png");
2039  cPED->Clear();
2040  }
2041  if (sub == 3) {
2042  cPED->Print("HistPedestalWidthsHO.png");
2043  cPED->Clear();
2044  }
2045  if (sub == 4) {
2046  cPED->Print("HistPedestalWidthsHF.png");
2047  cPED->Clear();
2048  }
2049  }
2050  } // end sub
2051  } //end test 31,32
2052 
2053  //+++++++++++++++++++++++++++++++++++
2054  //Test 33 Correlation of Pedestal, pedestalWidths Vs fullAmplitude
2055  //++++++++++++++++++++++++++++++++++++
2056 
2057  cPED->Clear();
2058  Map_Ped[1][1] = (TH2F *)hfile->Get("h2_pedvsampl_HB");
2059  Map_Ped[1][2] = (TH2F *)hfile->Get("h2_pedvsampl_HE");
2060  Map_Ped[1][3] = (TH2F *)hfile->Get("h2_pedvsampl_HO");
2061  Map_Ped[1][4] = (TH2F *)hfile->Get("h2_pedvsampl_HF");
2062  Map_Ped[2][1] = (TH2F *)hfile->Get("h2_pedwvsampl_HB");
2063  Map_Ped[2][2] = (TH2F *)hfile->Get("h2_pedwvsampl_HE");
2064  Map_Ped[2][3] = (TH2F *)hfile->Get("h2_pedwvsampl_HO");
2065  Map_Ped[2][4] = (TH2F *)hfile->Get("h2_pedwvsampl_HF");
2066  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
2067  cPED->Divide(2, 1);
2068  for (int test = 1; test <= 2; test++) {
2069  cPED->cd(test);
2070  gPad->SetGridy();
2071  gPad->SetGridx();
2072  gPad->SetLogz();
2073  if (test == 1)
2074  Map_Ped[test][sub]->SetXTitle("Pedestal, fC \b");
2075  if (test == 2)
2076  Map_Ped[test][sub]->SetXTitle("pedestal Width, fC \b");
2077  Map_Ped[test][sub]->SetYTitle("Amplitude, fC \b");
2078  Map_Ped[test][sub]->SetZTitle("entries \b");
2079  if (test == 1)
2080  sprintf(str, "Cap0 Pedestal vs Amplitude \b");
2081  if (test == 2)
2082  sprintf(str, "Cap0 pedestalWidth vs Amplitude \b");
2083  Map_Ped[test][sub]->SetTitle(str);
2084  Map_Ped[test][sub]->Draw("COLZ");
2085  // Map_Ped[test][sub]->GetYaxis()->SetRangeUser(0, 72.);
2086  // Map_Ped[test][sub]->GetZaxis()->SetRangeUser(0.0001, 1.);
2087  cPED->Modified();
2088  cPED->Update();
2089  } // test 1,2
2090  if (sub == 1) {
2091  cPED->Print("CorrelationsMapPedestalVsfullAmplitudeHB.png");
2092  cPED->Clear();
2093  }
2094  if (sub == 2) {
2095  cPED->Print("CorrelationsMapPedestalVsfullAmplitudeHE.png");
2096  cPED->Clear();
2097  }
2098  if (sub == 3) {
2099  cPED->Print("CorrelationsMapPedestalVsfullAmplitudeHO.png");
2100  cPED->Clear();
2101  }
2102  if (sub == 4) {
2103  cPED->Print("CorrelationsMapPedestalVsfullAmplitudeHF.png");
2104  cPED->Clear();
2105  }
2106  } // end sub
2107 
2108  //+++++++++++++++++++++++++++++++++++
2109  //Test 41 Time Slices shape for good and bad channels
2110  //++++++++++++++++++++++++++++++++++++
2111 
2112  cONE->Clear();
2113  hist_GoodTSshape[1] = (TH1F *)hfile->Get("h_shape_good_channels_HB");
2114  hist_GoodTSshape[2] = (TH1F *)hfile->Get("h_shape_good_channels_HE");
2115  hist_GoodTSshape[3] = (TH1F *)hfile->Get("h_shape_good_channels_HO");
2116  hist_GoodTSshape[4] = (TH1F *)hfile->Get("h_shape_good_channels_HF");
2117 
2118  hist_GoodTSshape0[1] = (TH1F *)hfile->Get("h_shape0_good_channels_HB");
2119  hist_GoodTSshape0[2] = (TH1F *)hfile->Get("h_shape0_good_channels_HE");
2120  hist_GoodTSshape0[3] = (TH1F *)hfile->Get("h_shape0_good_channels_HO");
2121  hist_GoodTSshape0[4] = (TH1F *)hfile->Get("h_shape0_good_channels_HF");
2122 
2123  hist_BadTSshape[1] = (TH1F *)hfile->Get("h_shape_bad_channels_HB");
2124  hist_BadTSshape[2] = (TH1F *)hfile->Get("h_shape_bad_channels_HE");
2125  hist_BadTSshape[3] = (TH1F *)hfile->Get("h_shape_bad_channels_HO");
2126  hist_BadTSshape[4] = (TH1F *)hfile->Get("h_shape_bad_channels_HF");
2127 
2128  hist_BadTSshape0[1] = (TH1F *)hfile->Get("h_shape0_bad_channels_HB");
2129  hist_BadTSshape0[2] = (TH1F *)hfile->Get("h_shape0_bad_channels_HE");
2130  hist_BadTSshape0[3] = (TH1F *)hfile->Get("h_shape0_bad_channels_HO");
2131  hist_BadTSshape0[4] = (TH1F *)hfile->Get("h_shape0_bad_channels_HF");
2132 
2133  cONE->cd(1);
2134 
2135  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
2136 
2137  gPad->SetGridy();
2138  gPad->SetGridx();
2139  gPad->SetLogz();
2140  hist_GoodTSshape[sub]->Divide(hist_GoodTSshape[sub], hist_GoodTSshape0[sub], 1, 1, "B");
2141  hist_GoodTSshape[sub]->SetXTitle("Time slice \b");
2142  hist_GoodTSshape[sub]->SetYTitle("ADC counts \b");
2143  sprintf(str, "Mean ADC Shape \b");
2144  hist_GoodTSshape[sub]->SetTitle(str);
2145  hist_GoodTSshape[sub]->Draw("");
2146  // hist_GoodTSshape[sub]->GetYaxis()->SetRangeUser(0, 72.);
2147  // hist_GoodTSshape[sub]->GetZaxis()->SetRangeUser(0.0001, 1.);
2148  cONE->Modified();
2149  cONE->Update();
2150  if (sub == 1) {
2151  cONE->Print("HistGoodTSshapesHB.png");
2152  cONE->Clear();
2153  }
2154  if (sub == 2) {
2155  cONE->Print("HistGoodTSshapesHE.png");
2156  cONE->Clear();
2157  }
2158  if (sub == 3) {
2159  cONE->Print("HistGoodTSshapesHO.png");
2160  cONE->Clear();
2161  }
2162  if (sub == 4) {
2163  cONE->Print("HistGoodTSshapesHF.png");
2164  cONE->Clear();
2165  }
2166  } // end sub
2167 
2168  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
2169 
2170  gPad->SetGridy();
2171  gPad->SetGridx();
2172  gPad->SetLogz();
2173  hist_BadTSshape[sub]->Divide(hist_BadTSshape[sub], hist_BadTSshape0[sub], 1, 1, "B");
2174  hist_BadTSshape[sub]->SetXTitle("Time slice \b");
2175  hist_BadTSshape[sub]->SetYTitle("ADC counts \b");
2176  sprintf(str, "Mean ADC Shape \b");
2177  hist_BadTSshape[sub]->SetTitle(str);
2178  hist_BadTSshape[sub]->Draw("");
2179  // hist_BadTSshape[sub]->GetYaxis()->SetRangeUser(0, 72.);
2180  // hist_BadTSshape[sub]->GetZaxis()->SetRangeUser(0.0001, 1.);
2181  cONE->Modified();
2182  cONE->Update();
2183  if (sub == 1) {
2184  cONE->Print("HistBadTSshapesHB.png");
2185  cONE->Clear();
2186  }
2187  if (sub == 2) {
2188  cONE->Print("HistBadTSshapesHE.png");
2189  cONE->Clear();
2190  }
2191  if (sub == 3) {
2192  cONE->Print("HistBadTSshapesHO.png");
2193  cONE->Clear();
2194  }
2195  if (sub == 4) {
2196  cONE->Print("HistBadTSshapesHF.png");
2197  cONE->Clear();
2198  }
2199  } // end sub
2200 
2201  /*
2202  //+++++++++++++++++++++++++++++++++++
2203 //Test 42 ADC in TS distributions
2204 //++++++++++++++++++++++++++++++++++++
2205 
2206 std::cout<<" We are here to print ADC "<<std::endl;
2207 
2208  hist_ADC_All[1] = (TH1F*)hfile->Get("h_ADC_HB");
2209  hist_ADC_All[2] = (TH1F*)hfile->Get("h_ADC_HE");
2210  hist_ADC_All[3] = (TH1F*)hfile->Get("h_ADC_HO");
2211  hist_ADC_All[4] = (TH1F*)hfile->Get("h_ADC_HF");
2212 
2213 
2214  hist_ADC_DS[1][1] = (TH1F*)hfile->Get("h_ADC_HBdepth1");
2215  hist_ADC_DS[1][2] = (TH1F*)hfile->Get("h_ADC_HBdepth2");
2216  hist_ADC_DS[2][1] = (TH1F*)hfile->Get("h_ADC_HEdepth1");
2217  hist_ADC_DS[2][2] = (TH1F*)hfile->Get("h_ADC_HEdepth2");
2218  hist_ADC_DS[2][3] = (TH1F*)hfile->Get("h_ADC_HEdepth3");
2219  hist_ADC_DS[3][4] = (TH1F*)hfile->Get("h_ADC_HOdepth4");
2220  hist_ADC_DS[4][1] = (TH1F*)hfile->Get("h_ADC_HFdepth1");
2221  hist_ADC_DS[4][2] = (TH1F*)hfile->Get("h_ADC_HFdepth2");
2222 
2223 
2224  cONE->Clear();
2225  cONE->Divide(1,1);
2226  cONE->cd(1);
2227 
2228  for (int sub=1;sub<=4;sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
2229  gPad->SetGridy();
2230  gPad->SetGridx();
2231  gPad->SetLogy();
2232  hist_ADC_All[sub]->SetXTitle("ADC counts \b");
2233  hist_ADC_All[sub]->SetYTitle("Number of channels-events \b");
2234  if (sub==1) sprintf(str,"ADC counts Distribution HB\b");
2235  if (sub==2) sprintf(str,"ADC counts Distribution HE\b");
2236  if (sub==3) sprintf(str,"ADC counts Distribution HO\b");
2237  if (sub==4) sprintf(str,"ADC counts Distribution HF\b");
2238  hist_ADC_All[sub]->SetTitle(str);
2239  hist_ADC_All[sub]->Draw("");
2240  // hist_ADC_All[sub]->GetYaxis()->SetRangeUser(0, 72.);
2241  hist_ADC_All[sub]->GetXaxis()->SetRangeUser(0.000, 1000.);
2242  cONE->Modified(); cONE->Update();
2243  if (sub==1) {cONE->Print("Hist_ADC_HB_All.png"); cONE->Clear();}
2244  if (sub==2) {cONE->Print("Hist_ADC_HE_All.png"); cONE->Clear();}
2245  if (sub==3) {cONE->Print("Hist_ADC_HO_All.png"); cONE->Clear();}
2246  if (sub==4) {cONE->Print("Hist_ADC_HF_All.png"); cONE->Clear();}
2247  }// end sub
2248 
2249 
2250  for (int sub=1;sub<=4;sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
2251  if (sub==1) cHB->Divide(2,1);
2252  if (sub==2) cHE->Divide(3,1);
2253  if (sub==3) cONE->Divide(1,1);
2254  if (sub==4) cHB->Divide(2,1);
2255  int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
2256  int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
2257  for (int k=k_min[sub];k<=k_max[sub];k++) { //Depths
2258  if (sub==1) cHB->cd(k);
2259  if (sub==2) cHE->cd(k);
2260  if (sub==3) cONE->cd(k-3);
2261  if (sub==4) cHB->cd(k);
2262  gPad->SetGridy();
2263  gPad->SetGridx();
2264  gPad->SetLogy();
2265  hist_ADC_DS[sub][k]->SetXTitle("ADC counts \b");
2266  hist_ADC_DS[sub][k]->SetYTitle("Number of channels-events \b");
2267  if (sub==1) sprintf(str,"HB, Depth%d \b", k);
2268  if (sub==2) sprintf(str,"HE, Depth%d \b", k);
2269  if (sub==3) sprintf(str,"HO, Depth%d \b", k);
2270  if (sub==4) sprintf(str,"HF, Depth%d \b", k);
2271  hist_ADC_DS[sub][k]->SetTitle(str);
2272  hist_ADC_DS[sub][k]->Draw("");
2273  // hist_ADC_DS[sub][k]->GetYaxis()->SetRangeUser(0, 72.);
2274  hist_ADC_DS[sub][k]->GetXaxis()->SetRangeUser(0.000, 1000.);
2275  if (sub==1) {cHB->Modified(); cHB->Update();}
2276  if (sub==2) {cHE->Modified(); cHE->Update();}
2277  if (sub==3) {cONE->Modified();cONE->Update();}
2278  if (sub==4) {cHB->Modified(); cHB->Update();}
2279  }//end depth
2280  if (sub==1) {cHB->Print("Hist_ADC_HB_DS.png"); cHB->Clear();}
2281  if (sub==2) {cHE->Print("Hist_ADC_HE_DS.png"); cHE->Clear();}
2282  if (sub==3) {cONE->Print("Hist_ADC_HO_DS.png"); cONE->Clear();}
2283  if (sub==4) {cHB->Print("Hist_ADC_HF_DS.png"); cHB->Clear();}
2284  }// end sub
2285 
2286 
2287  //+++++++++++++++++++++++++++++++++++
2288 //Test 43 Sum ADC in TS distributions
2289 //++++++++++++++++++++++++++++++++++++
2290 
2291  hist_SumADC[1][1] = (TH1F*)hfile->Get("h_sumamplitude_depth1_HB");
2292  hist_SumADC[1][2] = (TH1F*)hfile->Get("h_sumamplitude_depth2_HB");
2293  hist_SumADC[2][1] = (TH1F*)hfile->Get("h_sumamplitude_depth1_HE");
2294  hist_SumADC[2][2] = (TH1F*)hfile->Get("h_sumamplitude_depth2_HE");
2295  hist_SumADC[2][3] = (TH1F*)hfile->Get("h_sumamplitude_depth3_HE");
2296  hist_SumADC[3][4] = (TH1F*)hfile->Get("h_sumamplitude_depth4_HO");
2297  hist_SumADC[4][1] = (TH1F*)hfile->Get("h_sumamplitude_depth1_HF");
2298  hist_SumADC[4][2] = (TH1F*)hfile->Get("h_sumamplitude_depth2_HF");
2299 
2300  hist_SumADC0[1][1] = (TH1F*)hfile->Get("h_sumamplitude_depth1_HB0");
2301  hist_SumADC0[1][2] = (TH1F*)hfile->Get("h_sumamplitude_depth2_HB0");
2302  hist_SumADC0[2][1] = (TH1F*)hfile->Get("h_sumamplitude_depth1_HE0");
2303  hist_SumADC0[2][2] = (TH1F*)hfile->Get("h_sumamplitude_depth2_HE0");
2304  hist_SumADC0[2][3] = (TH1F*)hfile->Get("h_sumamplitude_depth3_HE0");
2305  hist_SumADC0[3][4] = (TH1F*)hfile->Get("h_sumamplitude_depth4_HO0");
2306  hist_SumADC0[4][1] = (TH1F*)hfile->Get("h_sumamplitude_depth1_HF0");
2307  hist_SumADC0[4][2] = (TH1F*)hfile->Get("h_sumamplitude_depth2_HF0");
2308 
2309  hist_SumADC1[1][1] = (TH1F*)hfile->Get("h_sumamplitude_depth1_HB1");
2310  hist_SumADC1[1][2] = (TH1F*)hfile->Get("h_sumamplitude_depth2_HB1");
2311  hist_SumADC1[2][1] = (TH1F*)hfile->Get("h_sumamplitude_depth1_HE1");
2312  hist_SumADC1[2][2] = (TH1F*)hfile->Get("h_sumamplitude_depth2_HE1");
2313  hist_SumADC1[2][3] = (TH1F*)hfile->Get("h_sumamplitude_depth3_HE1");
2314  hist_SumADC1[3][4] = (TH1F*)hfile->Get("h_sumamplitude_depth4_HO1");
2315  hist_SumADC1[4][1] = (TH1F*)hfile->Get("h_sumamplitude_depth1_HF1");
2316  hist_SumADC1[4][2] = (TH1F*)hfile->Get("h_sumamplitude_depth2_HF1");
2317 
2318  for (int sub=1;sub<=4;sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
2319  if (sub==1) cHB->Divide(2,1);
2320  if (sub==2) cHE->Divide(3,1);
2321  if (sub==3) cONE->Divide(1,1);
2322  if (sub==4) cHB->Divide(2,1);
2323  int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
2324  int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
2325  for (int k=k_min[sub];k<=k_max[sub];k++) { //Depths
2326  if (sub==1) cHB->cd(k);
2327  if (sub==2) cHE->cd(k);
2328  if (sub==3) cONE->cd(k-3);
2329  if (sub==4) cHB->cd(k);
2330  gPad->SetGridy();
2331  gPad->SetGridx();
2332  gPad->SetLogy();
2333  hist_SumADC[sub][k]->SetXTitle("ADC sum \b");
2334  hist_SumADC[sub][k]->SetYTitle("Number of channels-events \b");
2335  if (sub==1) sprintf(str,"HB, Depth%d \b", k);
2336  if (sub==2) sprintf(str,"HE, Depth%d \b", k);
2337  if (sub==3) sprintf(str,"HO, Depth%d \b", k);
2338  if (sub==4) sprintf(str,"HF, Depth%d \b", k);
2339  hist_SumADC[sub][k]->SetTitle(str);
2340  hist_SumADC[sub][k]->Draw("");
2341  // hist_SumADC[sub][k]->GetYaxis()->SetRangeUser(0, 72.);
2342  // hist_SumADC[sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
2343  if (sub==1) {cHB->Modified(); cHB->Update();}
2344  if (sub==2) {cHE->Modified(); cHE->Update();}
2345  if (sub==3) {cONE->Modified();cONE->Update();}
2346  if (sub==4) {cHB->Modified(); cHB->Update();}
2347  }//end depth
2348  if (sub==1) {cHB->Print("Hist_SumADC_HB.png"); cHB->Clear();}
2349  if (sub==2) {cHE->Print("Hist_SumADC_HE.png"); cHE->Clear();}
2350  if (sub==3) {cONE->Print("Hist_SumADC_HO.png"); cONE->Clear();}
2351  if (sub==4) {cHB->Print("Hist_SumADC_HF.png"); cHB->Clear();}
2352  }// end sub
2353 
2354 
2355  for (int sub=1;sub<=4;sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
2356  if (sub==1) cHB->Divide(2,1);
2357  if (sub==2) cHE->Divide(3,1);
2358  if (sub==3) cONE->Divide(1,1);
2359  if (sub==4) cHB->Divide(2,1);
2360  int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
2361  int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
2362  for (int k=k_min[sub];k<=k_max[sub];k++) { //Depths
2363  if (sub==1) cHB->cd(k);
2364  if (sub==2) cHE->cd(k);
2365  if (sub==3) cONE->cd(k-3);
2366  if (sub==4) cHB->cd(k);
2367  gPad->SetGridy();
2368  gPad->SetGridx();
2369  gPad->SetLogy();
2370  hist_SumADC0[sub][k]->SetXTitle("ADC sum \b");
2371  hist_SumADC0[sub][k]->SetYTitle("Number of channels-events \b");
2372  if (sub==1) sprintf(str,"HB, Depth%d \b", k);
2373  if (sub==2) sprintf(str,"HE, Depth%d \b", k);
2374  if (sub==3) sprintf(str,"HO, Depth%d \b", k);
2375  if (sub==4) sprintf(str,"HF, Depth%d \b", k);
2376  hist_SumADC0[sub][k]->SetTitle(str);
2377  hist_SumADC0[sub][k]->Draw("");
2378  // hist_SumADC0[sub][k]->GetYaxis()->SetRangeUser(0, 72.);
2379  // hist_SumADC0[sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
2380  if (sub==1) {cHB->Modified(); cHB->Update();}
2381  if (sub==2) {cHE->Modified(); cHE->Update();}
2382  if (sub==3) {cONE->Modified();cONE->Update();}
2383  if (sub==4) {cHB->Modified(); cHB->Update();}
2384  }//end depth
2385  if (sub==1) {cHB->Print("Hist_SumADC_HB0.png"); cHB->Clear();}
2386  if (sub==2) {cHE->Print("Hist_SumADC_HE0.png"); cHE->Clear();}
2387  if (sub==3) {cONE->Print("Hist_SumADC_HO0.png"); cONE->Clear();}
2388  if (sub==4) {cHB->Print("Hist_SumADC_HF0.png"); cHB->Clear();}
2389  }// end sub
2390 
2391  for (int sub=1;sub<=4;sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
2392  if (sub==1) cHB->Divide(2,1);
2393  if (sub==2) cHE->Divide(3,1);
2394  if (sub==3) cONE->Divide(1,1);
2395  if (sub==4) cHB->Divide(2,1);
2396  int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
2397  int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
2398  for (int k=k_min[sub];k<=k_max[sub];k++) { //Depths
2399  if (sub==1) cHB->cd(k);
2400  if (sub==2) cHE->cd(k);
2401  if (sub==3) cONE->cd(k-3);
2402  if (sub==4) cHB->cd(k);
2403  gPad->SetGridy();
2404  gPad->SetGridx();
2405  gPad->SetLogy();
2406  hist_SumADC1[sub][k]->SetXTitle("ADC sum \b");
2407  hist_SumADC1[sub][k]->SetYTitle("Number of channels-events \b");
2408  if (sub==1) sprintf(str,"HB, Depth%d \b", k);
2409  if (sub==2) sprintf(str,"HE, Depth%d \b", k);
2410  if (sub==3) sprintf(str,"HO, Depth%d \b", k);
2411  if (sub==4) sprintf(str,"HF, Depth%d \b", k);
2412  hist_SumADC1[sub][k]->SetTitle(str);
2413  hist_SumADC1[sub][k]->Draw("");
2414  // hist_SumADC1[sub][k]->GetYaxis()->SetRangeUser(0, 72.);
2415  // hist_SumADC1[sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
2416  if (sub==1) {cHB->Modified(); cHB->Update();}
2417  if (sub==2) {cHE->Modified(); cHE->Update();}
2418  if (sub==3) {cONE->Modified();cONE->Update();}
2419  if (sub==4) {cHB->Modified(); cHB->Update();}
2420  }//end depth
2421  if (sub==1) {cHB->Print("Hist_SumADC_HB1.png"); cHB->Clear();}
2422  if (sub==2) {cHE->Print("Hist_SumADC_HE1.png"); cHE->Clear();}
2423  if (sub==3) {cONE->Print("Hist_SumADC_HO1.png"); cONE->Clear();}
2424  if (sub==4) {cHB->Print("Hist_SumADC_HF1.png"); cHB->Clear();}
2425  }// end sub
2426 
2427 */
2428 
2429  //======================================================================
2430  std::cout << " We are here to print 2017 MAPs " << std::endl;
2431 
2432  //======================================================================
2433 
2434  //======================================================================
2436 
2437  TH2F *Map_ALL = new TH2F("Map_All", "Map_all", 82, -41, 40, 72, 0, 71);
2438  int nx = Map_ALL->GetXaxis()->GetNbins();
2439  int ny = Map_ALL->GetYaxis()->GetNbins();
2440  int NBad = 0;
2441  int NWarn = 0;
2442  int NCalib = 0;
2443  int NPed = 0;
2444  // int Eta[3][10000]={0};
2445  int Eta[4][10000] = {0};
2446  int Phi[4][10000] = {0};
2447  int Sub[4][10000] = {0};
2448  int Depth[4][10000] = {0};
2449  string Comment[4][10000] = {""};
2450  string Text[33] = {"", "Cm", "Am", "Wm", "Rm", "TNm", "TXm", "", "", "", "", "Cc", "Ac", "Wc", "Rc", "TNc", "TXc",
2451  "", "", "", "", "GS", "", "", "", "", "", "", "", "", "", "Pm", "pWm"};
2452  int flag_W = 0;
2453  int flag_B = 0;
2454  int flag_P = 0;
2455 
2456  for (int i = 1; i <= nx; i++) { //Eta
2457  for (int j = 1; j <= ny; j++) { // Phi
2458  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
2459  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
2460  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
2461  // int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
2462  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
2463  if (Map_SUB[sub][k]->GetBinContent(i, j) != 0) {
2464  Map_SUB[sub][k]->SetBinContent(i, j, 0.5);
2465  Map_ALL->SetBinContent(i, j, 0.5);
2466  }
2467  }
2468  }
2469  }
2470  }
2471 
2472  for (int i = 1; i <= nx; i++) { //Eta
2473  for (int j = 1; j <= ny; j++) { // Phi
2474  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
2475  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
2476  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
2477  // int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
2478  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
2479  flag_W = 0;
2480  flag_B = 0;
2481  flag_P = 0;
2482  for (int test = 1; test <= 6; test++) { //Test: 1-Wm, 2-Rm, etc
2483  //Bad
2484  if (Map_Ampl[test][sub][k]->GetBinContent(i, j) >
2485  0.1) { //Rate 0.1 for displaying on whole detector map and subdetector map
2486  Map_ALL->SetBinContent(i, j, 1.);
2487  Map_SUB[sub][k]->SetBinContent(i, j, 1.);
2488  if (flag_B == 0) {
2489  NBad += 1;
2490  Eta[2][NBad] = i - 41;
2491  Phi[2][NBad] = j - 1;
2492  Sub[2][NBad] = sub;
2493  Depth[2][NBad] = k;
2494  Comment[2][NBad] = Text[test];
2495  } else
2496  Comment[2][NBad] += ", " + Text[test];
2497  flag_B = 1;
2498  // cout<<"Map_Ampl["<<test<<"]["<<sub<<"]["<<k<<"]->GetBinContent("<<i<<","<<j<<")= "<<Map_Ampl[test][sub][k]->GetBinContent(i,j)<<endl;
2499  }
2500  //Warning
2501  /*
2502  if ((Map_Ampl[test][sub][k]->GetBinContent(i,j) != 0.)&&(Map_Ampl[test][sub][k]->GetBinContent(i,j) < 0.001) ) {
2503  if (Map_SUB[sub][k]->GetBinContent(i,j)!=1.) Map_SUB[sub][k]->SetBinContent(i,j,0.75);
2504  if (Map_ALL->GetBinContent(i,j)!=1.) Map_ALL->SetBinContent(i,j,0.75);
2505  if (flag_W == 0) {
2506  NWarn +=1;
2507  Eta[1][NWarn]=i-41;
2508  Phi[1][NWarn]=j-1;
2509  Sub[1][NWarn]=sub;
2510  Depth[1][NWarn]=k;
2511  Comment[1][NWarn]=Text[test];
2512  }
2513  else Comment[1][NWarn]+=", "+Text[test];
2514  flag_W = 1;
2515 // cout<<"Map_Ampl["<<test<<"]["<<sub<<"]["<<k<<"]->GetBinContent("<<i<<","<<j<<")= "<<Map_Ampl[test][sub][k]->GetBinContent(i,j)<<endl;
2516  }
2517 */
2518 
2519  } //end test
2520 
2521  //Calib
2522  /*
2523  for (int test=11;test<=16;test++) { //Test: 1-2.E, 2-2.F, etc
2524  if (Map_Ampl[test][sub][k]->GetBinContent(i,j) != 0.) {
2525 // if (Map_SUB[sub][k]->GetBinContent(i,j)!=1.0) Map_SUB[sub][k]->SetBinContent(i,j,0.3);
2526 // if (Map_ALL->GetBinContent(i,j)!=1.) Map_ALL->SetBinContent(i,j,0.3);
2527  if (flag_W == 0) {
2528  NWarn +=1;
2529  Eta[1][NWarn]=i-41;
2530  Phi[1][NWarn]=j-1;
2531  Sub[1][NWarn]=sub;
2532  Depth[1][NWarn]=k;
2533  Comment[1][NWarn]=Text[test];
2534  }
2535  else Comment[1][NWarn]+=", "+Text[test];
2536  flag_W = 1;
2537 // cout<<"Map_Ampl["<<test<<"]["<<sub<<"]["<<k<<"]->GetBinContent("<<i<<","<<j<<")= "<<Map_Ampl[test][sub][k]->GetBinContent(i,j)<<endl;
2538  }
2539  } //end test
2540 */
2541  //Gain stabil
2542  /*
2543  for (int test=21;test<=21;test++) {
2544  if (abs(Map_Ampl[test][sub][k]->GetBinContent(i,j)) > porog[sub]) {
2545  if (Map_SUB[sub][k]->GetBinContent(i,j)!=1.0) Map_SUB[sub][k]->SetBinContent(i,j,0.75);
2546  if (Map_ALL->GetBinContent(i,j)!=1.) {
2547  Map_ALL->SetBinContent(i,j,0.75);
2548  if (flag_W == 0) {
2549  NWarn +=1;
2550  Eta[1][NWarn]=i-41;
2551  Phi[1][NWarn]=j-1;
2552  Sub[1][NWarn]=sub;
2553  Depth[1][NWarn]=k;
2554  Comment[1][NWarn]=Text[test];
2555  }
2556  else Comment[1][NWarn]+=", "+Text[test];
2557  flag_W = 1;
2558 
2559  cout<<"Map_Ampl["<<test<<"]["<<sub<<"]["<<k<<"]->GetBinContent("<<i<<","<<j<<")= "<<Map_Ampl[test][sub][k]->GetBinContent(i,j)<<endl;
2560  }
2561  }
2562  } //end test
2563 */
2564  //Pedestals
2565  for (int test = 31; test <= 32; test++) {
2566  if (Map_Ampl[test][sub][k]->GetBinContent(i, j) > 0.1) {
2567  // if (Map_SUB[sub][k]->GetBinContent(i,j)!=1.0) Map_SUB[sub][k]->SetBinContent(i,j,0.75);
2568  // if (Map_ALL->GetBinContent(i,j)!=1.) Map_ALL->SetBinContent(i,j,0.75);
2569  if (flag_P == 0) {
2570  NPed += 1;
2571  Eta[3][NPed] = i - 41;
2572  Phi[3][NPed] = j - 1;
2573  Sub[3][NPed] = sub;
2574  Depth[3][NPed] = k;
2575  Comment[3][NPed] = Text[test];
2576  } else
2577  Comment[3][NPed] += ", " + Text[test];
2578  flag_P = 1;
2579 
2580  // cout<<"Map_Ampl["<<test<<"]["<<sub<<"]["<<k<<"]->GetBinContent("<<i<<","<<j<<")= "<<Map_Ampl[test][sub][k]->GetBinContent(i,j)<<endl;
2581  }
2582  } //end test
2583 
2584  } //end Depth
2585  } //end Sub
2586  } //end Phi
2587  } //end Eta
2588 
2589  // subdet maps
2590  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
2591 
2592  std::cout << " 2017 MAPS_SUB " << sub << std::endl;
2593  // if (sub==1) cHB->Divide(2,1);
2594  if (sub == 1)
2595  cHB->Divide(2, 2);
2596  // if (sub==2) cHE->Divide(3,1);
2597  if (sub == 2)
2598  cHE->Divide(3, 3);
2599  if (sub == 3)
2600  cONE->Divide(1, 1);
2601  // if (sub==4) cHB->Divide(2,1);
2602  if (sub == 4)
2603  cHF->Divide(2, 2);
2604  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
2605  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
2606  // int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
2607  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
2608  if (sub == 1)
2609  cHB->cd(k);
2610  if (sub == 2)
2611  cHE->cd(k);
2612  if (sub == 3)
2613  cONE->cd(k - 3);
2614  if (sub == 4)
2615  cHF->cd(k);
2616  gPad->SetGridy();
2617  gPad->SetGridx();
2618  // gPad->SetLogz();
2619  // gStyle->SetTitleOffset(0.5, "Y");
2620  if (sub == 1)
2621  sprintf(str, "HB, Depth%d \b", k);
2622  if (sub == 2)
2623  sprintf(str, "HE, Depth%d \b", k);
2624  if (sub == 3)
2625  sprintf(str, "HO, Depth%d \b", k);
2626  if (sub == 4)
2627  sprintf(str, "HF, Depth%d \b", k);
2628  Map_SUB[sub][k]->SetTitle(str);
2629  Map_SUB[sub][k]->SetXTitle("#eta \b");
2630  Map_SUB[sub][k]->SetYTitle("#phi \b");
2631  Map_SUB[sub][k]->Draw("COL");
2632  Map_SUB[sub][k]->GetYaxis()->SetRangeUser(0, 72.);
2633  Map_SUB[sub][k]->GetZaxis()->SetRangeUser(0., 1.);
2634  if (sub == 1) {
2635  cHB->Modified();
2636  cHB->Update();
2637  }
2638  if (sub == 2) {
2639  cHE->Modified();
2640  cHE->Update();
2641  }
2642  if (sub == 3) {
2643  cONE->Modified();
2644  cONE->Update();
2645  }
2646  if (sub == 4) {
2647  cHF->Modified();
2648  cHF->Update();
2649  }
2650  } //end depth
2651  if (sub == 1) {
2652  cHB->Print("MAPHB.png");
2653  cHB->Clear();
2654  }
2655  if (sub == 2) {
2656  cHE->Print("MAPHE.png");
2657  cHE->Clear();
2658  }
2659  if (sub == 3) {
2660  cONE->Print("MAPHO.png");
2661  cONE->Clear();
2662  }
2663  if (sub == 4) {
2664  cHF->Print("MAPHF.png");
2665  cHF->Clear();
2666  }
2667  }
2669  TCanvas *cmain1 = new TCanvas("cmain1", "MAP", 200, 10, 1400, 1800);
2670  cmain1->Divide(2, 2);
2671 
2672  cmain1->cd(1);
2673  TH1F *JDBEYESJ0 = (TH1F *)hfile->Get("h_totalAmplitudeHBperEvent");
2674  JDBEYESJ0->SetStats(0);
2675  JDBEYESJ0->SetMarkerStyle(20);
2676  JDBEYESJ0->SetMarkerSize(0.8);
2677  JDBEYESJ0->GetYaxis()->SetLabelSize(0.04);
2678  JDBEYESJ0->SetXTitle("iEvent \b");
2679  JDBEYESJ0->SetYTitle("totalAmplitude perEvent \b");
2680  JDBEYESJ0->SetTitle("HB \b");
2681  JDBEYESJ0->SetMarkerColor(2);
2682  JDBEYESJ0->SetLineColor(1);
2683  JDBEYESJ0->SetMinimum(0.8);
2684  JDBEYESJ0->Draw("HIST same P0");
2685 
2686  cmain1->cd(2);
2687  TH1F *JDBEYESJ1 = (TH1F *)hfile->Get("h_totalAmplitudeHEperEvent");
2688  JDBEYESJ1->SetStats(0);
2689  JDBEYESJ1->SetMarkerStyle(20);
2690  JDBEYESJ1->SetMarkerSize(0.8);
2691  JDBEYESJ1->GetYaxis()->SetLabelSize(0.04);
2692  JDBEYESJ1->SetXTitle("iEvent \b");
2693  JDBEYESJ1->SetYTitle("totalAmplitude perEvent \b");
2694  JDBEYESJ1->SetTitle("HE \b");
2695  JDBEYESJ1->SetMarkerColor(2);
2696  JDBEYESJ1->SetLineColor(1);
2697  JDBEYESJ1->SetMinimum(0.8);
2698  JDBEYESJ1->Draw("HIST same P0");
2699 
2700  cmain1->cd(3);
2701  TH1F *JDBEYESJ2 = (TH1F *)hfile->Get("h_totalAmplitudeHFperEvent");
2702  JDBEYESJ2->SetStats(0);
2703  JDBEYESJ2->SetMarkerStyle(20);
2704  JDBEYESJ2->SetMarkerSize(0.8);
2705  JDBEYESJ2->GetYaxis()->SetLabelSize(0.04);
2706  JDBEYESJ2->SetXTitle("iEvent \b");
2707  JDBEYESJ2->SetYTitle("totalAmplitude perEvent \b");
2708  JDBEYESJ2->SetTitle("HF \b");
2709  JDBEYESJ2->SetMarkerColor(2);
2710  JDBEYESJ2->SetLineColor(1);
2711  JDBEYESJ2->SetMinimum(0.8);
2712  JDBEYESJ2->Draw("HIST same P0");
2713 
2714  cmain1->cd(4);
2715  TH1F *JDBEYESJ3 = (TH1F *)hfile->Get("h_totalAmplitudeHOperEvent");
2716  JDBEYESJ3->SetStats(0);
2717  JDBEYESJ3->SetMarkerStyle(20);
2718  JDBEYESJ3->SetMarkerSize(0.8);
2719  JDBEYESJ3->GetYaxis()->SetLabelSize(0.04);
2720  JDBEYESJ3->SetXTitle("iEvent \b");
2721  JDBEYESJ3->SetYTitle("totalAmplitude perEvent \b");
2722  JDBEYESJ3->SetTitle("HO \b");
2723  JDBEYESJ3->SetMarkerColor(2);
2724  JDBEYESJ3->SetLineColor(1);
2725  JDBEYESJ3->SetMinimum(0.8);
2726  JDBEYESJ3->Draw("HIST same P0");
2727 
2728  cmain1->Modified();
2729  cmain1->Update();
2730  cmain1->Print("EVENTDEPENDENCE.png");
2731 
2732  std::cout << " EVENTDEPENDENCE " << std::endl;
2733 
2735  // ALL SubDet
2736  gStyle->SetOptTitle(0);
2737  TCanvas *cmain = new TCanvas("cmain", "MAP", 1000, 1000);
2738  gPad->SetGridy();
2739  gPad->SetGridx();
2740  // gPad->SetLogz();
2741  Map_ALL->SetTitleOffset(1.3, "Y");
2742  Map_ALL->SetXTitle("#eta \b");
2743  Map_ALL->SetYTitle("#phi \b");
2744  Map_ALL->Draw("COL");
2745  Map_ALL->GetYaxis()->SetRangeUser(0, 72.);
2746  Map_ALL->GetZaxis()->SetRangeUser(0, 1.);
2747  cmain->Modified();
2748  cmain->Update();
2749  cmain->Print("MAP.png");
2750 
2751  std::cout << " MAP_ALL " << std::endl;
2752 
2753  //======================================================================
2754 
2755  //======================================================================
2756  // Creating each test kind for each subdet html pages:
2757  std::string raw_class, raw_class1, raw_class2, raw_class3;
2758  int ind = 0;
2759 
2760  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
2761  ofstream htmlFileT, htmlFileC, htmlFileD, htmlFileP, htmlFileS;
2762  if (sub == 1) {
2763  htmlFileT.open("HB_Tile.html");
2764  htmlFileC.open("HB_Calib.html");
2765  htmlFileD.open("HB_Drift.html");
2766  htmlFileP.open("HB_Pedestals.html");
2767  htmlFileS.open("HB_Shapes.html");
2768  }
2769  if (sub == 2) {
2770  htmlFileT.open("HE_Tile.html");
2771  htmlFileC.open("HE_Calib.html");
2772  htmlFileD.open("HE_Drift.html");
2773  htmlFileP.open("HE_Pedestals.html");
2774  htmlFileS.open("HE_Shapes.html");
2775  }
2776  if (sub == 3) {
2777  htmlFileT.open("HO_Tile.html");
2778  htmlFileC.open("HO_Calib.html");
2779  htmlFileD.open("HO_Drift.html");
2780  htmlFileP.open("HO_Pedestals.html");
2781  htmlFileS.open("HO_Shapes.html");
2782  }
2783  if (sub == 4) {
2784  htmlFileT.open("HF_Tile.html");
2785  htmlFileC.open("HF_Calib.html");
2786  htmlFileD.open("HF_Drift.html");
2787  htmlFileP.open("HF_Pedestals.html");
2788  htmlFileS.open("HF_Shapes.html");
2789  }
2790 
2791  // Megatile channels
2792  htmlFileT << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
2793  htmlFileT << "<head>" << std::endl;
2794  htmlFileT << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
2795  htmlFileT << "<title> Remote Monitoring Tool Global</title>" << std::endl;
2796  htmlFileT << "<style type=\"text/css\">" << std::endl;
2797  htmlFileT << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
2798  << std::endl;
2799  htmlFileT << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
2800  htmlFileT << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
2801  "text-align: center;}"
2802  << std::endl;
2803  htmlFileT << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
2804  htmlFileT << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
2805  htmlFileT << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
2806  htmlFileT << "</style>" << std::endl;
2807  htmlFileT << "<body>" << std::endl;
2808 
2809  if (sub == 1)
2810  htmlFileT << "<h1> Criteria for megatile channels for HB, RUN = " << runnumber << " </h1>" << std::endl;
2811  if (sub == 2)
2812  htmlFileT << "<h1> Criteria for megatile channels for HE, RUN = " << runnumber << " </h1>" << std::endl;
2813  if (sub == 3)
2814  htmlFileT << "<h1> Criteria for megatile channels for HO, RUN = " << runnumber << " </h1>" << std::endl;
2815  if (sub == 4)
2816  htmlFileT << "<h1> Criteria for megatile channels for HF, RUN = " << runnumber << " </h1>" << std::endl;
2817  htmlFileT << "<br>" << std::endl;
2818 
2819  // Test Entries
2820 
2821  htmlFileT << "<h2> 0. Entries for each channel.</h3>" << std::endl;
2822  htmlFileT << "<h3> 0.A. Entries in each channel for each depth.</h3>" << std::endl;
2823  htmlFileT << "<h4> Channel legend: color is rate of entries </h4>" << std::endl;
2824  if (sub == 1)
2825  htmlFileT << " <img src=\"MapRateEntryHB.png\" />" << std::endl;
2826  if (sub == 2)
2827  htmlFileT << " <img src=\"MapRateEntryHE.png\" />" << std::endl;
2828  if (sub == 3)
2829  htmlFileT << " <img src=\"MapRateEntryHO.png\" />" << std::endl;
2830  if (sub == 4)
2831  htmlFileT << " <img src=\"MapRateEntryHF.png\" />" << std::endl;
2832  htmlFileT << "<br>" << std::endl;
2833 
2834  // Test Cm
2835  htmlFileT << "<h2> 1. Cm criterion: CapID errors for each channel.</h3>" << std::endl;
2836  htmlFileT << "<h3> 1.A. Rate of CapId failures in each channel for each depth.</h3>" << std::endl;
2837  htmlFileT << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
2838  if (sub == 1)
2839  htmlFileT << " <img src=\"MapRateCapIDHB.png\" />" << std::endl;
2840  if (sub == 2)
2841  htmlFileT << " <img src=\"MapRateCapIDHE.png\" />" << std::endl;
2842  if (sub == 3)
2843  htmlFileT << " <img src=\"MapRateCapIDHO.png\" />" << std::endl;
2844  if (sub == 4)
2845  htmlFileT << " <img src=\"MapRateCapIDHF.png\" />" << std::endl;
2846  htmlFileT << "<br>" << std::endl;
2847 
2848  // Am
2849  htmlFileT << "<h2> 2. Am criterion: ADC amplitude collected over all TSs(Full Amplitude) for each channel. </h3>"
2850  << std::endl;
2851  htmlFileT << "<h3> 2.A. Full ADC amplitude distribution over all events, channels and depths.</h3>" << std::endl;
2852  htmlFileT << "<h4> Legend: Bins less " << MIN_M[2][sub] << " correpond to bad ADC amplitude </h4>" << std::endl;
2853  if (sub == 1)
2854  htmlFileT << " <img src=\"HistAmplHB.png\" />" << std::endl;
2855  if (sub == 2)
2856  htmlFileT << " <img src=\"HistAmplHE.png\" />" << std::endl;
2857  if (sub == 3)
2858  htmlFileT << " <img src=\"HistAmplHO.png\" />" << std::endl;
2859  if (sub == 4)
2860  htmlFileT << " <img src=\"HistAmplHF.png\" />" << std::endl;
2861  htmlFileT << "<br>" << std::endl;
2862  htmlFileT << "<h3> 2.B. Rate of bad ADC amplitude (<" << MIN_M[2][sub] << ") in each channel for each depth. </h3>"
2863  << std::endl;
2864  htmlFileT << "<h4> Channel legend: white - good, other colours - bad. </h4>" << std::endl;
2865  if (sub == 1)
2866  htmlFileT << " <img src=\"MapRateAmplHB.png\" />" << std::endl;
2867  if (sub == 2)
2868  htmlFileT << " <img src=\"MapRateAmplHE.png\" />" << std::endl;
2869  if (sub == 3)
2870  htmlFileT << " <img src=\"MapRateAmplHO.png\" />" << std::endl;
2871  if (sub == 4)
2872  htmlFileT << " <img src=\"MapRateAmplHF.png\" />" << std::endl;
2873  htmlFileT << "<br>" << std::endl;
2874 
2875  // Test Wm
2876  htmlFileT << "<h2> 3. Wm criterion: RMS (width) of ADC amplutude for each channel.</h3>" << std::endl;
2877  htmlFileT << "<h3> 3.A. RMS distribution over all events, channel and depth.</h3>" << std::endl;
2878  htmlFileT << "<h4> Legend: Bins less " << MIN_M[3][sub] << " and more " << MAX_M[3][sub]
2879  << " correpond to bad RMS </h4>" << std::endl;
2880  if (sub == 1)
2881  htmlFileT << " <img src=\"HistRMSHB.png\" />" << std::endl;
2882  if (sub == 2)
2883  htmlFileT << " <img src=\"HistRMSHE.png\" />" << std::endl;
2884  if (sub == 3)
2885  htmlFileT << " <img src=\"HistRMSHO.png\" />" << std::endl;
2886  if (sub == 4)
2887  htmlFileT << " <img src=\"HistRMSHF.png\" />" << std::endl;
2888  htmlFileT << "<br>" << std::endl;
2889  htmlFileT << "<h3> 3.B. Rate of bad RMS (<" << MIN_M[3][sub] << ",>" << MAX_M[3][sub]
2890  << ") in each channel for each depth.</h3>" << std::endl;
2891  htmlFileT << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
2892  if (sub == 1)
2893  htmlFileT << " <img src=\"MapRateRMSHB.png\" />" << std::endl;
2894  if (sub == 2)
2895  htmlFileT << " <img src=\"MapRateRMSHE.png\" />" << std::endl;
2896  if (sub == 3)
2897  htmlFileT << " <img src=\"MapRateRMSHO.png\" />" << std::endl;
2898  if (sub == 4)
2899  htmlFileT << " <img src=\"MapRateRMSHF.png\" />" << std::endl;
2900  htmlFileT << "<br>" << std::endl;
2901 
2902  // Rm
2903  htmlFileT << "<h2> 4. Rm criterion: Ratio ADC value sum over four near maximum (-2, -1, max, +1) TS to ADC value "
2904  "sum over all TS for each channel. </h3>"
2905  << std::endl;
2906  htmlFileT << "<h3> 4.A. Ratio distribution over all events, channels and depths.</h3>" << std::endl;
2907  htmlFileT << "<h4> Legend: Bins less " << MIN_M[4][sub] << " and more " << MAX_M[4][sub]
2908  << " correpond to bad ratio </h4>" << std::endl;
2909  if (sub == 1)
2910  htmlFileT << " <img src=\"Hist43TStoAllTSHB.png\" />" << std::endl;
2911  if (sub == 2)
2912  htmlFileT << " <img src=\"Hist43TStoAllTSHE.png\" />" << std::endl;
2913  if (sub == 3)
2914  htmlFileT << " <img src=\"Hist43TStoAllTSHO.png\" />" << std::endl;
2915  if (sub == 4)
2916  htmlFileT << " <img src=\"Hist43TStoAllTSHF.png\" />" << std::endl;
2917  htmlFileT << "<br>" << std::endl;
2918  htmlFileT << "<h3> 4.B. Rate of bad ratio (<" << MIN_M[4][sub] << ", >" << MAX_M[4][sub]
2919  << ") in each channel for each depth.</h3>" << std::endl;
2920  htmlFileT << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
2921  if (sub == 1)
2922  htmlFileT << " <img src=\"MapRate43TStoAllTSHB.png\" />" << std::endl;
2923  if (sub == 2)
2924  htmlFileT << " <img src=\"MapRate43TStoAllTSHE.png\" />" << std::endl;
2925  if (sub == 3)
2926  htmlFileT << " <img src=\"MapRate43TStoAllTSHO.png\" />" << std::endl;
2927  if (sub == 4)
2928  htmlFileT << " <img src=\"MapRate43TStoAllTSHF.png\" />" << std::endl;
2929  htmlFileT << "<br>" << std::endl;
2930 
2931  // TNm
2932  htmlFileT << "<h2> 5. TNm criterion: Mean TS position for each channel.</h3>" << std::endl;
2933  htmlFileT << "<h3> 5.A. TN position distribution over all events, channels and depths.</h3>" << std::endl;
2934  htmlFileT << "<h4> Legend: Bins less " << MIN_M[5][sub] << " and more " << MAX_M[5][sub]
2935  << " correpond to bad mean position </h4>" << std::endl;
2936  if (sub == 1)
2937  htmlFileT << " <img src=\"HistMeanPosHB.png\" />" << std::endl;
2938  if (sub == 2)
2939  htmlFileT << " <img src=\"HistMeanPosHE.png\" />" << std::endl;
2940  if (sub == 3)
2941  htmlFileT << " <img src=\"HistMeanPosHO.png\" />" << std::endl;
2942  if (sub == 4)
2943  htmlFileT << " <img src=\"HistMeanPosHF.png\" />" << std::endl;
2944  htmlFileT << "<br>" << std::endl;
2945  htmlFileT << "<h3> 5.B. Rate of bad TN position (<" << MIN_M[5][sub] << ", >" << MAX_M[5][sub]
2946  << ") in each channel for each depth. </h3>" << std::endl;
2947  htmlFileT << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
2948  if (sub == 1)
2949  htmlFileT << " <img src=\"MapRateMeanPosHB.png\" />" << std::endl;
2950  if (sub == 2)
2951  htmlFileT << " <img src=\"MapRateMeanPosHE.png\" />" << std::endl;
2952  if (sub == 3)
2953  htmlFileT << " <img src=\"MapRateMeanPosHO.png\" />" << std::endl;
2954  if (sub == 4)
2955  htmlFileT << " <img src=\"MapRateMeanPosHF.png\" />" << std::endl;
2956  htmlFileT << "<br>" << std::endl;
2957 
2958  // TXm
2959  htmlFileT << "<h2> 6.TXm criterion: Maximum TS position for each channel.</h3>" << std::endl;
2960  htmlFileT << "<h3> 6.A. TX position distribution over all events, channel and depth.</h3>" << std::endl;
2961  htmlFileT << "<h4> Legend: Bins less " << MIN_M[6][sub] << " and more " << MAX_M[6][sub]
2962  << " correpond to bad position </h4>" << std::endl;
2963  if (sub == 1)
2964  htmlFileT << " <img src=\"HistMaxPosHB.png\" />" << std::endl;
2965  if (sub == 2)
2966  htmlFileT << " <img src=\"HistMaxPosHE.png\" />" << std::endl;
2967  if (sub == 3)
2968  htmlFileT << " <img src=\"HistMaxPosHO.png\" />" << std::endl;
2969  if (sub == 4)
2970  htmlFileT << " <img src=\"HistMaxPosHF.png\" />" << std::endl;
2971  htmlFileT << "<br>" << std::endl;
2972  htmlFileT << "<h3> 6.B. Rate of bad TX position (<" << MIN_M[6][sub] << ", >" << MAX_M[6][sub]
2973  << ") in each channel for each depth. </h3>" << std::endl;
2974  htmlFileT << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
2975  if (sub == 1)
2976  htmlFileT << " <img src=\"MapRateMaxPosHB.png\" />" << std::endl;
2977  if (sub == 2)
2978  htmlFileT << " <img src=\"MapRateMaxPosHE.png\" />" << std::endl;
2979  if (sub == 3)
2980  htmlFileT << " <img src=\"MapRateMaxPosHO.png\" />" << std::endl;
2981  if (sub == 4)
2982  htmlFileT << " <img src=\"MapRateMaxPosHF.png\" />" << std::endl;
2983  htmlFileT << "<br>" << std::endl;
2984 
2985  htmlFileT << "</body> " << std::endl;
2986  htmlFileT << "</html> " << std::endl;
2987  htmlFileT.close();
2988 
2989  //Calibration channels
2990  htmlFileC << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
2991  htmlFileC << "<head>" << std::endl;
2992  htmlFileC << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
2993  htmlFileC << "<title> Raw Data Analyser </title>" << std::endl;
2994  htmlFileC << "<style type=\"text/css\">" << std::endl;
2995  htmlFileC << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
2996  << std::endl;
2997  htmlFileC << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
2998  htmlFileC << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
2999  "text-align: center;}"
3000  << std::endl;
3001  htmlFileC << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
3002  htmlFileC << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
3003  htmlFileC << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
3004  htmlFileC << "</style>" << std::endl;
3005  htmlFileC << "<body>" << std::endl;
3006 
3007  if (sub == 1)
3008  htmlFileC << "<h1> Criteria for calibration channels for HB, RUN = " << runnumber << " </h1>" << std::endl;
3009  if (sub == 2)
3010  htmlFileC << "<h1> Criteria for calibration channels for HE, RUN = " << runnumber << " </h1>" << std::endl;
3011  if (sub == 3)
3012  htmlFileC << "<h1> Criteria for calibration channels for HO, RUN = " << runnumber << " </h1>" << std::endl;
3013  if (sub == 4)
3014  htmlFileC << "<h1> Criteria for calibration channels for HF, RUN = " << runnumber << " </h1>" << std::endl;
3015  htmlFileC << "<br>" << std::endl;
3016 
3017  // Test Cc
3018  htmlFileC << "<h2> 1.Cc criterion: CapID errors for each channel.</h3>" << std::endl;
3019  htmlFileC << "<h3> 1.A. Rate of CapId failures in each channel for each depth.</h3>" << std::endl;
3020  htmlFileC << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
3021  if (sub == 1)
3022  htmlFileC << " <img src=\"MapRateCapCalibHB.png\" />" << std::endl;
3023  if (sub == 2)
3024  htmlFileC << " <img src=\"MapRateCapCalibHE.png\" />" << std::endl;
3025  if (sub == 3)
3026  htmlFileC << " <img src=\"MapRateCapCalibHO.png\" />" << std::endl;
3027  if (sub == 4)
3028  htmlFileC << " <img src=\"MapRateCapCalibHF.png\" />" << std::endl;
3029  htmlFileC << "<br>" << std::endl;
3030 
3031  // Ac
3032  htmlFileC << "<h2> 2. Ac criterion: ADC amplitude collected over all TSs(Full Amplitude) for each channel. </h3>"
3033  << std::endl;
3034  htmlFileC << "<h3> 2.A. Full ADC amplitude distribution over all events, channels and depths.</h3>" << std::endl;
3035  htmlFileC << "<h4> Legend: Bins less " << MIN_C[2][sub] << " correpond to bad ADC amplitude </h4>" << std::endl;
3036  if (sub == 1)
3037  htmlFileC << " <img src=\"HistAmplCalibHB.png\" />" << std::endl;
3038  if (sub == 2)
3039  htmlFileC << " <img src=\"HistAmplCalibHE.png\" />" << std::endl;
3040  if (sub == 3)
3041  htmlFileC << " <img src=\"HistAmplCalibHO.png\" />" << std::endl;
3042  if (sub == 4)
3043  htmlFileC << " <img src=\"HistAmplCalibHF.png\" />" << std::endl;
3044  htmlFileC << "<br>" << std::endl;
3045  htmlFileC << "<h3> 2.B. Rate of bad ADC amplitude (<" << MIN_C[2][sub] << ") in each channel for each depth. </h3>"
3046  << std::endl;
3047  htmlFileC << "<h4> Channel legend: white - good, other colours - bad. </h4>" << std::endl;
3048  if (sub == 1)
3049  htmlFileC << " <img src=\"MapRateAmplCalibHB.png\" />" << std::endl;
3050  if (sub == 2)
3051  htmlFileC << " <img src=\"MapRateAmplCalibHE.png\" />" << std::endl;
3052  if (sub == 3)
3053  htmlFileC << " <img src=\"MapRateAmplCalibHO.png\" />" << std::endl;
3054  if (sub == 4)
3055  htmlFileC << " <img src=\"MapRateAmplCalibHF.png\" />" << std::endl;
3056  htmlFileC << "<br>" << std::endl;
3057 
3058  // Test Wc
3059  htmlFileC << "<h2> 3. Wc criterion: RMS (width) of ADC amplutude for each channel.</h3>" << std::endl;
3060  htmlFileC << "<h3> 3.A. W distribution over all events, channel and depth.</h3>" << std::endl;
3061  htmlFileC << "<h4> Legend: Bins less " << MIN_C[3][sub] << " and more " << MAX_C[3][sub]
3062  << " correpond to bad RMS </h4>" << std::endl;
3063  if (sub == 1)
3064  htmlFileC << " <img src=\"HistRMSCalibHB.png\" />" << std::endl;
3065  if (sub == 2)
3066  htmlFileC << " <img src=\"HistRMSCalibHE.png\" />" << std::endl;
3067  if (sub == 3)
3068  htmlFileC << " <img src=\"HistRMSCalibHO.png\" />" << std::endl;
3069  if (sub == 4)
3070  htmlFileC << " <img src=\"HistRMSCalibHF.png\" />" << std::endl;
3071  htmlFileC << "<br>" << std::endl;
3072  htmlFileC << "<h3> 3.B. Rate of bad W (<" << MIN_C[3][sub] << ",>" << MAX_C[3][sub]
3073  << ") in each channel for each depth.</h3>" << std::endl;
3074  htmlFileC << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
3075  if (sub == 1)
3076  htmlFileC << " <img src=\"MapRateRMSCalibHB.png\" />" << std::endl;
3077  if (sub == 2)
3078  htmlFileC << " <img src=\"MapRateRMSCalibHE.png\" />" << std::endl;
3079  if (sub == 3)
3080  htmlFileC << " <img src=\"MapRateRMSCalibHO.png\" />" << std::endl;
3081  if (sub == 4)
3082  htmlFileC << " <img src=\"MapRateRMSCalibHF.png\" />" << std::endl;
3083  htmlFileC << "<br>" << std::endl;
3084 
3085  // Rc
3086  htmlFileC << "<h2> 4. Rc criterion: Ratio ADC value sum over five near maximum (-2, -1, max, +1, +2) TS to ADC "
3087  "value sum over all TS for each channel. </h3>"
3088  << std::endl;
3089  htmlFileC << "<h3> 4.A. Ratio distribution over all events, channels and depths.</h3>" << std::endl;
3090  htmlFileC << "<h4> Legend: Bins less " << MIN_C[4][sub] << " and more " << MAX_C[4][sub]
3091  << " correpond to bad ratio </h4>" << std::endl;
3092  if (sub == 1)
3093  htmlFileC << " <img src=\"Hist43TStoAllTSCalibHB.png\" />" << std::endl;
3094  if (sub == 2)
3095  htmlFileC << " <img src=\"Hist43TStoAllTSCalibHE.png\" />" << std::endl;
3096  if (sub == 3)
3097  htmlFileC << " <img src=\"Hist43TStoAllTSCalibHO.png\" />" << std::endl;
3098  if (sub == 4)
3099  htmlFileC << " <img src=\"Hist43TStoAllTSCalibHF.png\" />" << std::endl;
3100  htmlFileC << "<br>" << std::endl;
3101  htmlFileC << "<h3> 4.B. Rate of bad Ratio (<" << MIN_C[4][sub] << ", >" << MAX_C[4][sub]
3102  << ") in each channel for each depth.</h3>" << std::endl;
3103  htmlFileC << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
3104  if (sub == 1)
3105  htmlFileC << " <img src=\"MapRate43TStoAllTSCalibHB.png\" />" << std::endl;
3106  if (sub == 2)
3107  htmlFileC << " <img src=\"MapRate43TStoAllTSCalibHE.png\" />" << std::endl;
3108  if (sub == 3)
3109  htmlFileC << " <img src=\"MapRate43TStoAllTSCalibHO.png\" />" << std::endl;
3110  if (sub == 4)
3111  htmlFileC << " <img src=\"MapRate43TStoAllTSCalibHF.png\" />" << std::endl;
3112  htmlFileC << "<br>" << std::endl;
3113 
3114  // TNc
3115  htmlFileC << "<h2> 5. TNc criterion: Mean TS position for each channel.</h3>" << std::endl;
3116  htmlFileC << "<h3> 5.A. TN position distribution over all events, channels and depths.</h3>" << std::endl;
3117  htmlFileC << "<h4> Legend: Bins less " << MIN_C[5][sub] << " and more " << MAX_C[5][sub]
3118  << " correpond to bad position </h4>" << std::endl;
3119  if (sub == 1)
3120  htmlFileC << " <img src=\"HistMeanPosCalibHB.png\" />" << std::endl;
3121  if (sub == 2)
3122  htmlFileC << " <img src=\"HistMeanPosCalibHE.png\" />" << std::endl;
3123  if (sub == 3)
3124  htmlFileC << " <img src=\"HistMeanPosCalibHO.png\" />" << std::endl;
3125  if (sub == 4)
3126  htmlFileC << " <img src=\"HistMeanPosCalibHF.png\" />" << std::endl;
3127  htmlFileC << "<br>" << std::endl;
3128  htmlFileC << "<h3> 5.B. Rate of bad TN position (<" << MIN_C[5][sub] << ", >" << MAX_C[5][sub]
3129  << ") in each channel for each depth. </h3>" << std::endl;
3130  htmlFileC << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
3131  if (sub == 1)
3132  htmlFileC << " <img src=\"MapRateMeanPosCalibHB.png\" />" << std::endl;
3133  if (sub == 2)
3134  htmlFileC << " <img src=\"MapRateMeanPosCalibHE.png\" />" << std::endl;
3135  if (sub == 3)
3136  htmlFileC << " <img src=\"MapRateMeanPosCalibHO.png\" />" << std::endl;
3137  if (sub == 4)
3138  htmlFileC << " <img src=\"MapRateMeanPosCalibHF.png\" />" << std::endl;
3139  htmlFileC << "<br>" << std::endl;
3140 
3141  // TXm
3142  htmlFileC << "<h2> 6.TXc criterion: Maximum TS position for each channel.</h3>" << std::endl;
3143  htmlFileC << "<h3> 6.A. TX position distribution over all events, channel and depth.</h3>" << std::endl;
3144  htmlFileC << "<h4> Legend: Bins less " << MIN_C[6][sub] << " and more " << MAX_C[6][sub]
3145  << " correpond to bad position </h4>" << std::endl;
3146  if (sub == 1)
3147  htmlFileC << " <img src=\"HistMaxPosCalibHB.png\" />" << std::endl;
3148  if (sub == 2)
3149  htmlFileC << " <img src=\"HistMaxPosCalibHE.png\" />" << std::endl;
3150  if (sub == 3)
3151  htmlFileC << " <img src=\"HistMaxPosCalibHO.png\" />" << std::endl;
3152  if (sub == 4)
3153  htmlFileC << " <img src=\"HistMaxPosCalibHF.png\" />" << std::endl;
3154  htmlFileC << "<br>" << std::endl;
3155  htmlFileC << "<h3> 6.B. Rate of bad TX position (<" << MIN_C[6][sub] << ", >" << MAX_C[6][sub]
3156  << ") in each channel for each depth. </h3>" << std::endl;
3157  htmlFileC << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
3158  if (sub == 1)
3159  htmlFileC << " <img src=\"MapRateMaxPosCalibHB.png\" />" << std::endl;
3160  if (sub == 2)
3161  htmlFileC << " <img src=\"MapRateMaxPosCalibHE.png\" />" << std::endl;
3162  if (sub == 3)
3163  htmlFileC << " <img src=\"MapRateMaxPosCalibHO.png\" />" << std::endl;
3164  if (sub == 4)
3165  htmlFileC << " <img src=\"MapRateMaxPosCalibHF.png\" />" << std::endl;
3166  htmlFileC << "<br>" << std::endl;
3167 
3168  htmlFileC << "</body> " << std::endl;
3169  htmlFileC << "</html> " << std::endl;
3170  htmlFileC.close();
3171 
3172  //Response drift
3173  htmlFileD << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
3174  htmlFileD << "<head>" << std::endl;
3175  htmlFileD << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
3176  htmlFileD << "<title> Remote Monitoring Tool Global </title>" << std::endl;
3177  htmlFileD << "<style type=\"text/css\">" << std::endl;
3178  htmlFileD << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
3179  << std::endl;
3180  htmlFileD << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
3181  htmlFileD << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
3182  "text-align: center;}"
3183  << std::endl;
3184  htmlFileD << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
3185  htmlFileD << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
3186  htmlFileD << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
3187  htmlFileD << "</style>" << std::endl;
3188  htmlFileD << "<body>" << std::endl;
3189 
3190  if (sub == 1)
3191  htmlFileD << "<h1> Response drift for HB: Current RUN = " << runnumber << ", Reference RUN = " << refrunnumber
3192  << " </h1>" << std::endl;
3193  if (sub == 2)
3194  htmlFileD << "<h1> Response drift for HE: Current RUN = " << runnumber << ", Reference RUN = " << refrunnumber
3195  << " </h1>" << std::endl;
3196  if (sub == 3)
3197  htmlFileD << "<h1> Response drift for HO: Current RUN = " << runnumber << ", Reference RUN = " << refrunnumber
3198  << " </h1>" << std::endl;
3199  if (sub == 4)
3200  htmlFileD << "<h1> Response drift for HF: Current RUN = " << runnumber << ", Reference RUN = " << refrunnumber
3201  << " </h1>" << std::endl;
3202  htmlFileD << "<br>" << std::endl;
3203 
3204  // test GS
3205  htmlFileD << "<h2> 1. Gain Stability (GS) </h3>" << std::endl;
3206  htmlFileD << "<h3> 1.A. Averaged channel response, collected over all TS, for Current run in each channel for each "
3207  "depth.</h3>"
3208  << std::endl;
3209  htmlFileD << "<h4> Channel legend: colour means cooresponding value of mean response. </h4>" << std::endl;
3210  if (sub == 1)
3211  htmlFileD << " <img src=\"MapRateAmpl1HB.png\" />" << std::endl;
3212  if (sub == 2)
3213  htmlFileD << " <img src=\"MapRateAmpl1HE.png\" />" << std::endl;
3214  if (sub == 3)
3215  htmlFileD << " <img src=\"MapRateAmpl1HO.png\" />" << std::endl;
3216  if (sub == 4)
3217  htmlFileD << " <img src=\"MapRateAmpl1HF.png\" />" << std::endl;
3218  htmlFileD << "<br>" << std::endl;
3219  htmlFileD << "<h3> 1.B. Averaged channel response, collected over all TS, for Reference run in each channel for "
3220  "each depth.</h3>"
3221  << std::endl;
3222  htmlFileD << "<h4> Channel legend: colour means cooresponding value of mean response. </h4>" << std::endl;
3223  if (sub == 1)
3224  htmlFileD << " <img src=\"MapRateAmpl2HB.png\" />" << std::endl;
3225  if (sub == 2)
3226  htmlFileD << " <img src=\"MapRateAmpl2HE.png\" />" << std::endl;
3227  if (sub == 3)
3228  htmlFileD << " <img src=\"MapRateAmpl2HO.png\" />" << std::endl;
3229  if (sub == 4)
3230  htmlFileD << " <img src=\"MapRateAmpl2HF.png\" />" << std::endl;
3231  htmlFileD << "<br>" << std::endl;
3232  htmlFileD << "<h3> 1.C. Relative difference between Current run and Current run distribution over all events, "
3233  "channels for each depth.</h3>"
3234  << std::endl;
3235  htmlFileD << "<h4> Legend: Bins less -" << porog[sub] << "% and more +" << porog[sub]
3236  << "% correpond to bad relative difference position </h4>" << std::endl;
3237  if (sub == 1)
3238  htmlFileD << " <img src=\"HistAmplDriftDepthHB.png\" />" << std::endl;
3239  if (sub == 2)
3240  htmlFileD << " <img src=\"HistAmplDriftDepthHE.png\" />" << std::endl;
3241  if (sub == 3)
3242  htmlFileD << " <img src=\"HistAmplDriftDepthHO.png\" />" << std::endl;
3243  if (sub == 4)
3244  htmlFileD << " <img src=\"HistAmplDriftDepthHF.png\" />" << std::endl;
3245  htmlFileD << "<br>" << std::endl;
3246  htmlFileD << "<h3> 1.D. Rate of bad relative difference (<-" << porog[sub] << ", >+" << porog[sub]
3247  << ") in each channel for each depth.</h3>" << std::endl;
3248  htmlFileD << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
3249  if (sub == 1)
3250  htmlFileD << " <img src=\"MapRateAmplDriftHB.png\" />" << std::endl;
3251  if (sub == 2)
3252  htmlFileD << " <img src=\"MapRateAmplDriftHE.png\" />" << std::endl;
3253  if (sub == 3)
3254  htmlFileD << " <img src=\"MapRateAmplDriftHO.png\" />" << std::endl;
3255  if (sub == 4)
3256  htmlFileD << " <img src=\"MapRateAmplDriftHF.png\" />" << std::endl;
3257  htmlFileD << "<br>" << std::endl;
3258 
3259  htmlFileD << "</body> " << std::endl;
3260  htmlFileD << "</html> " << std::endl;
3261  htmlFileD.close();
3262 
3263  // Pedestals
3264  htmlFileP << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
3265  htmlFileP << "<head>" << std::endl;
3266  htmlFileP << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
3267  htmlFileP << "<title> Remote Monitoring Tool Global</title>" << std::endl;
3268  htmlFileP << "<style type=\"text/css\">" << std::endl;
3269  htmlFileP << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
3270  << std::endl;
3271  htmlFileP << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
3272  htmlFileP << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
3273  "text-align: center;}"
3274  << std::endl;
3275  htmlFileP << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
3276  htmlFileP << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
3277  htmlFileP << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
3278  htmlFileP << "</style>" << std::endl;
3279  htmlFileP << "<body>" << std::endl;
3280 
3281  if (sub == 1)
3282  htmlFileP << "<h1> Pedestals for HB, RUN = " << runnumber << " </h1>" << std::endl;
3283  if (sub == 2)
3284  htmlFileP << "<h1> Pedestals for HE, RUN = " << runnumber << " </h1>" << std::endl;
3285  if (sub == 3)
3286  htmlFileP << "<h1> Pedestals for HO, RUN = " << runnumber << " </h1>" << std::endl;
3287  if (sub == 4)
3288  htmlFileP << "<h1> Pedestals for HF, RUN = " << runnumber << " </h1>" << std::endl;
3289  htmlFileP << "<br>" << std::endl;
3290 
3291  // Pedestal:
3292  htmlFileP << "<h2> 1.Pm criterion: Pedestals for each CapID .</h3>" << std::endl;
3293  htmlFileP << "<h3> 1.A. Pedestal distribution over all events, channels for each CapID and all depths.</h3>"
3294  << std::endl;
3295  htmlFileP << "<h4> Legend: Bins less " << Pedest[0][sub] << " correpond to bad Pedestals </h4>" << std::endl;
3296  if (sub == 1)
3297  htmlFileP << " <img src=\"HistPedestalsHB.png\" />" << std::endl;
3298  if (sub == 2)
3299  htmlFileP << " <img src=\"HistPedestalsHE.png\" />" << std::endl;
3300  if (sub == 3)
3301  htmlFileP << " <img src=\"HistPedestalsHO.png\" />" << std::endl;
3302  if (sub == 4)
3303  htmlFileP << " <img src=\"HistPedestalsHF.png\" />" << std::endl;
3304  htmlFileP << "<br>" << std::endl;
3305  htmlFileP << "<h3> 1.B. Rate of channels at very low Pedestals at least in one CapID for each depth.</h3>"
3306  << std::endl;
3307  htmlFileP << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
3308  if (sub == 1)
3309  htmlFileP << " <img src=\"MapRatePedHB.png\" />" << std::endl;
3310  if (sub == 2)
3311  htmlFileP << " <img src=\"MapRatePedHE.png\" />" << std::endl;
3312  if (sub == 3)
3313  htmlFileP << " <img src=\"MapRatePedHO.png\" />" << std::endl;
3314  if (sub == 4)
3315  htmlFileP << " <img src=\"MapRatePedHF.png\" />" << std::endl;
3316 
3317  // PedestalWidth:
3318  htmlFileP << "<h2> 2.pWm criterion: Pedestal Widths for each CapID .</h3>" << std::endl;
3319  htmlFileP << "<h3> 2.A. Pedestal Widths distribution over all events, channels for each CapID and all depths.</h3>"
3320  << std::endl;
3321  htmlFileP << "<h4> Legend: Bins less " << Pedest[1][sub] << " correpond to bad Pedestal Widths </h4>" << std::endl;
3322  if (sub == 1)
3323  htmlFileP << " <img src=\"HistPedestalWidthsHB.png\" />" << std::endl;
3324  if (sub == 2)
3325  htmlFileP << " <img src=\"HistPedestalWidthsHE.png\" />" << std::endl;
3326  if (sub == 3)
3327  htmlFileP << " <img src=\"HistPedestalWidthsHO.png\" />" << std::endl;
3328  if (sub == 4)
3329  htmlFileP << " <img src=\"HistPedestalWidthsHF.png\" />" << std::endl;
3330  htmlFileP << "<br>" << std::endl;
3331  htmlFileP << "<h3> 2.B. Rate of channels at very low Pedestal Widths at least in one CapID for each depth.</h3>"
3332  << std::endl;
3333  htmlFileP << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
3334  if (sub == 1)
3335  htmlFileP << " <img src=\"MapRatePedWidthsHB.png\" />" << std::endl;
3336  if (sub == 2)
3337  htmlFileP << " <img src=\"MapRatePedWidthsHE.png\" />" << std::endl;
3338  if (sub == 3)
3339  htmlFileP << " <img src=\"MapRatePedWidthsHO.png\" />" << std::endl;
3340  if (sub == 4)
3341  htmlFileP << " <img src=\"MapRatePedWidthsHF.png\" />" << std::endl;
3342 
3343  // Correlations of Pedestal(Width) and fullAmplitude:
3344  htmlFileP << "<h2> 3.Pedestal and pedestalWidths vs Amplitude .</h3>" << std::endl;
3345  htmlFileP << "<h3> 3.A. Correlation of Pedestal(pedestalWidths) and Amplitude over all channels and events .</h3>"
3346  << std::endl;
3347  htmlFileP << "<h4> Legend: colour - entries </h4>" << std::endl;
3348  if (sub == 1)
3349  htmlFileP << "<img src=\"CorrelationsMapPedestalVsfullAmplitudeHB.png\" />" << std::endl;
3350  if (sub == 2)
3351  htmlFileP << "<img src=\"CorrelationsMapPedestalVsfullAmplitudeHE.png\" />" << std::endl;
3352  if (sub == 3)
3353  htmlFileP << "<img src=\"CorrelationsMapPedestalVsfullAmplitudeHO.png\" />" << std::endl;
3354  if (sub == 4)
3355  htmlFileP << "<img src=\"CorrelationsMapPedestalVsfullAmplitudeHF.png\" />" << std::endl;
3356  htmlFileP << "<br>" << std::endl;
3357 
3358  // TSs Shapes:
3359 
3360  htmlFileS << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
3361  htmlFileS << "<head>" << std::endl;
3362  htmlFileS << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
3363  htmlFileS << "<title> Remote Monitoring Tool Global</title>" << std::endl;
3364  htmlFileS << "<style type=\"text/css\">" << std::endl;
3365  htmlFileS << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
3366  << std::endl;
3367  htmlFileS << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
3368  htmlFileS << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
3369  "text-align: center;}"
3370  << std::endl;
3371  htmlFileS << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
3372  htmlFileS << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
3373  htmlFileS << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
3374  htmlFileS << "</style>" << std::endl;
3375  htmlFileS << "<body>" << std::endl;
3376 
3377  if (sub == 1)
3378  htmlFileS << "<h1> ADC Shape for HB, RUN = " << runnumber << " </h1>" << std::endl;
3379  if (sub == 2)
3380  htmlFileS << "<h1> ADC Shape for HE, RUN = " << runnumber << " </h1>" << std::endl;
3381  if (sub == 3)
3382  htmlFileS << "<h1> ADC Shape for HO, RUN = " << runnumber << " </h1>" << std::endl;
3383  if (sub == 4)
3384  htmlFileS << "<h1> ADC Shape for HF, RUN = " << runnumber << " </h1>" << std::endl;
3385  htmlFileP << "<br>" << std::endl;
3386 
3387  htmlFileS << "<h2> 1.Mean ADC Shape </h3>" << std::endl;
3388  htmlFileS << "<h3> 1.A. ADC shape averaged over all good channels, depth and events.</h3>" << std::endl;
3389  // htmlFileS << "<h4> Legend: Bins less "<<Pedest[0][sub]<<" correpond to bad Pedestals </h4>"<< std::endl;
3390  if (sub == 1)
3391  htmlFileS << " <img src=\"HistGoodTSshapesHB.png\" />" << std::endl;
3392  if (sub == 2)
3393  htmlFileS << " <img src=\"HistGoodTSshapesHE.png\" />" << std::endl;
3394  if (sub == 3)
3395  htmlFileS << " <img src=\"HistGoodTSshapesHO.png\" />" << std::endl;
3396  if (sub == 4)
3397  htmlFileS << " <img src=\"HistGoodTSshapesHF.png\" />" << std::endl;
3398  htmlFileS << "<br>" << std::endl;
3399  htmlFileS << "<h3> 1.B. ADC shape averaged over all bad channels, depth and events. Bad channels are selected by 5 "
3400  "criteria: CapId, A, W, P, Pw</h3>"
3401  << std::endl;
3402  // htmlFileS << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
3403  if (sub == 1)
3404  htmlFileS << " <img src=\"HistBadTSshapesHB.png\" />" << std::endl;
3405  if (sub == 2)
3406  htmlFileS << " <img src=\"HistBadTSshapesHE.png\" />" << std::endl;
3407  if (sub == 3)
3408  htmlFileS << " <img src=\"HistBadTSshapesHO.png\" />" << std::endl;
3409  if (sub == 4)
3410  htmlFileS << " <img src=\"HistBadTSshapesHF.png\" />" << std::endl;
3411 
3412  htmlFileS << "<h2> 2. ADC in Time Slice </h3>" << std::endl;
3413  htmlFileS << "<h3> 2.A. ADC counts histogrammed over all channels, depth and events.</h3>" << std::endl;
3414  // htmlFileS << "<h4> Legend: Bins less "<<Pedest[0][sub]<<" correpond to bad Pedestals </h4>"<< std::endl;
3415  if (sub == 1)
3416  htmlFileS << " <img src=\"Hist_ADC_HB_All.png\" />" << std::endl;
3417  if (sub == 2)
3418  htmlFileS << " <img src=\"Hist_ADC_HE_All.png\" />" << std::endl;
3419  if (sub == 3)
3420  htmlFileS << " <img src=\"Hist_ADC_HO_All.png\" />" << std::endl;
3421  if (sub == 4)
3422  htmlFileS << " <img src=\"Hist_ADC_HF_All.png\" />" << std::endl;
3423  htmlFileS << "<br>" << std::endl;
3424  htmlFileS << "<h3> 2.B. ADC counts histogrammed over all channels and events for each depth separately. </h3>"
3425  << std::endl;
3426  // htmlFileS << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
3427  if (sub == 1)
3428  htmlFileS << " <img src=\"Hist_ADC_HB_DS.png\" />" << std::endl;
3429  if (sub == 2)
3430  htmlFileS << " <img src=\"Hist_ADC_HE_DS.png\" />" << std::endl;
3431  if (sub == 3)
3432  htmlFileS << " <img src=\"Hist_ADC_HO_DS.png\" />" << std::endl;
3433  if (sub == 4)
3434  htmlFileS << " <img src=\"Hist_ADC_HF_DS.png\" />" << std::endl;
3435 
3436  htmlFileS << "<h2> 3. ADC Sum in Time Slice </h3>" << std::endl;
3437  htmlFileS << "<h3> 3.A. ADC Sum over all channels histogrammed over all events for each depth separately. </h3>"
3438  << std::endl;
3439  // htmlFileS << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
3440  if (sub == 1)
3441  htmlFileS << " <img src=\"Hist_SumADC_HB.png\" />" << std::endl;
3442  if (sub == 2)
3443  htmlFileS << " <img src=\"Hist_SumADC_HE.png\" />" << std::endl;
3444  if (sub == 3)
3445  htmlFileS << " <img src=\"Hist_SumADC_HO.png\" />" << std::endl;
3446  if (sub == 4)
3447  htmlFileS << " <img src=\"Hist_SumADC_HF.png\" />" << std::endl;
3448 
3449  htmlFileS << "<h3> 3.B. ADC Sum over all channels histogrammed over all events for each depth separately. </h3>"
3450  << std::endl;
3451  // htmlFileS << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
3452  if (sub == 1)
3453  htmlFileS << " <img src=\"Hist_SumADC_HB0.png\" />" << std::endl;
3454  if (sub == 2)
3455  htmlFileS << " <img src=\"Hist_SumADC_HE0.png\" />" << std::endl;
3456  if (sub == 3)
3457  htmlFileS << " <img src=\"Hist_SumADC_HO0.png\" />" << std::endl;
3458  if (sub == 4)
3459  htmlFileS << " <img src=\"Hist_SumADC_HF0.png\" />" << std::endl;
3460 
3461  htmlFileS << "<h3> 3.C. ADC Sum over all channels histogrammed over all events for each depth separately. </h3>"
3462  << std::endl;
3463  // htmlFileS << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
3464  if (sub == 1)
3465  htmlFileS << " <img src=\"Hist_SumADC_HB1.png\" />" << std::endl;
3466  if (sub == 2)
3467  htmlFileS << " <img src=\"Hist_SumADC_HE1.png\" />" << std::endl;
3468  if (sub == 3)
3469  htmlFileS << " <img src=\"Hist_SumADC_HO1.png\" />" << std::endl;
3470  if (sub == 4)
3471  htmlFileS << " <img src=\"Hist_SumADC_HF1.png\" />" << std::endl;
3472 
3473  htmlFileS.close();
3474  } // end sub
3475 
3476  //======================================================================
3477 
3478  //======================================================================
3479  // Creating subdet html pages:
3480 
3481  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
3482  ofstream htmlFile;
3483  if (sub == 1)
3484  htmlFile.open("HB.html");
3485  if (sub == 2)
3486  htmlFile.open("HE.html");
3487  if (sub == 3)
3488  htmlFile.open("HO.html");
3489  if (sub == 4)
3490  htmlFile.open("HF.html");
3491 
3492  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
3493  htmlFile << "<head>" << std::endl;
3494  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
3495  htmlFile << "<title> Remote Monitoring Tool </title>" << std::endl;
3496  htmlFile << "<style type=\"text/css\">" << std::endl;
3497  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
3498  << std::endl;
3499  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
3500  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
3501  "text-align: center;}"
3502  << std::endl;
3503  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
3504  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
3505  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
3506  htmlFile << " td.s5 { font-family: arial, arial ce, helvetica; background-color: #FF00FF; }" << std::endl;
3507  htmlFile << " td.s6 { font-family: arial, arial ce, helvetica; background-color: #9ACD32; }" << std::endl;
3508  htmlFile << " td.s7 { font-family: arial, arial ce, helvetica; background-color: #32CD32; }" << std::endl;
3509  htmlFile << " td.s8 { font-family: arial, arial ce, helvetica; background-color: #00FFFF; }" << std::endl;
3510  htmlFile << " td.s9 { font-family: arial, arial ce, helvetica; background-color: #FFE4E1; }" << std::endl;
3511  htmlFile << " td.s10 { font-family: arial, arial ce, helvetica; background-color: #A0522D; }" << std::endl;
3512  htmlFile << " td.s11 { font-family: arial, arial ce, helvetica; background-color: #1E90FF; }" << std::endl;
3513  htmlFile << " td.s12 { font-family: arial, arial ce, helvetica; background-color: #00BFFF; }" << std::endl;
3514  htmlFile << " td.s13 { font-family: arial, arial ce, helvetica; background-color: #FFFF00; }" << std::endl;
3515  htmlFile << " td.s14 { font-family: arial, arial ce, helvetica; background-color: #B8860B; }" << std::endl;
3516  htmlFile << "</style>" << std::endl;
3517  htmlFile << "<body>" << std::endl;
3518  if (sub == 1)
3519  htmlFile << "<h1> HCAL BARREL, RUN = " << runnumber << " </h1>" << std::endl;
3520  if (sub == 2)
3521  htmlFile << "<h1> HCAL ENDCAP, RUN = " << runnumber << " </h1>" << std::endl;
3522  if (sub == 3)
3523  htmlFile << "<h1> HCAL OUTER, RUN = " << runnumber << " </h1>" << std::endl;
3524  if (sub == 4)
3525  htmlFile << "<h1> HCAL FORWARD, RUN = " << runnumber << " </h1>" << std::endl;
3526  htmlFile << "<br>" << std::endl;
3527 
3528  htmlFile << "<a name=\"Top\"></a>\n";
3529  htmlFile << "<b>Contents:<br>\n";
3530  htmlFile << "1. <a href=\"#AnalysisResults\">Analysis results</a><br>\n";
3531  htmlFile << "2. <a href=\"#Status\">Status</a><br>\n";
3532  htmlFile << "2A. <a href=\"#ChannelMap\">Channel map</a><br>\n";
3533  // htmlFile << "2B. <a href=\"#BadChannels\">List of bad channels</a><br>\n";
3534  // htmlFile << "2C. <a href=\"#BadPedestals\">List of channels with bad pedestals</a><br>\n";
3535 
3536  htmlFile << "<a name=\"AnalysisResults\"></a>\n";
3537  if (sub == 1)
3538  htmlFile << "<h2> 1. Analysis results for HB</h2>" << std::endl;
3539  if (sub == 2)
3540  htmlFile << "<h2> 1. Analysis results for HE</h2>" << std::endl;
3541  if (sub == 3)
3542  htmlFile << "<h2> 1. Analysis results for HO</h2>" << std::endl;
3543  if (sub == 4)
3544  htmlFile << "<h2> 1. Analysis results for HF</h2>" << std::endl;
3545  htmlFile << "<table width=\"400\">" << std::endl;
3546  htmlFile << "<tr>" << std::endl;
3547 
3548  if (sub == 1) {
3549  // AZ 12.03.2019
3550  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
3551  << runnumber << "/HB_Tile.html\">Megatile Channels</a></td>" << std::endl;
3552  // htmlFile << " <td><a href=\"HB_Tile.html\">Megatile Channels</a></td>"<< std::endl;
3553 
3554  // htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"<<runnumber<<"/HB_Calib.html\">Calibration Channels</a></td>"<< std::endl;
3555  // htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"<<runnumber<<"/HB_Drift.html\">Gain Stability</a></td>"<< std::endl;
3556  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
3557  << runnumber << "/HB_Pedestals.html\">Pedestals</a></td>" << std::endl;
3558  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
3559  << runnumber << "/HB_Shapes.html\">ADC Shapes</a></td>" << std::endl;
3560  }
3561  if (sub == 2) {
3562  // AZ 12.03.2019
3563  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
3564  << runnumber << "/HE_Tile.html\">Megatile Channels</a></td>" << std::endl;
3565  // htmlFile << " <td><a href=\"HE_Tile.html\">Megatile Channels</a></td>"<< std::endl;
3566 
3567  // htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"<<runnumber<<"/HE_Calib.html\">Calibration Channels</a></td>"<< std::endl;
3568  // htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"<<runnumber<<"/HE_Drift.html\">Gain Stability</a></td>"<< std::endl;
3569  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
3570  << runnumber << "/HE_Pedestals.html\">Pedestals</a></td>" << std::endl;
3571  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
3572  << runnumber << "/HE_Shapes.html\">ADC Shapes</a></td>" << std::endl;
3573  }
3574  if (sub == 3) {
3575  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
3576  << runnumber << "/HO_Tile.html\">Megatile Channels</a></td>" << std::endl;
3577  // htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"<<runnumber<<"/HO_Calib.html\">Calibration Channels</a></td>"<< std::endl;
3578  // htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"<<runnumber<<"/HO_Drift.html\">Gain Stability</a></td>"<< std::endl;
3579  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
3580  << runnumber << "/HO_Pedestals.html\">Pedestals</a></td>" << std::endl;
3581  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
3582  << runnumber << "/HO_Shapes.html\">ADC Shapes</a></td>" << std::endl;
3583  }
3584  if (sub == 4) {
3585  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
3586  << runnumber << "/HF_Tile.html\">Megatile Channels</a></td>" << std::endl;
3587  // htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"<<runnumber<<"/HF_Calib.html\">Calibration Channels</a></td>"<< std::endl;
3588  // htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"<<runnumber<<"/HF_Drift.html\">Gain Stability</a></td>"<< std::endl;
3589  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
3590  << runnumber << "/HF_Pedestals.html\">Pedestals</a></td>" << std::endl;
3591  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
3592  << runnumber << "/HF_Shapes.html\">ADC Shapes</a></td>" << std::endl;
3593  }
3594 
3595  htmlFile << "</tr>" << std::endl;
3596  htmlFile << "</table>" << std::endl;
3597  htmlFile << "<br>" << std::endl;
3598 
3599  htmlFile << "<a name=\"Status\"></a>\n";
3600  if (sub == 1)
3601  htmlFile << "<h2> 2.Status HB over all criteria </h2>" << std::endl;
3602  if (sub == 2)
3603  htmlFile << "<h2> 2.Status HE over all criteria </h2>" << std::endl;
3604  if (sub == 3)
3605  htmlFile << "<h2> 2.Status HO over all criteria </h2>" << std::endl;
3606  if (sub == 4)
3607  htmlFile << "<h2> 2.Status HF over all criteria </h2>" << std::endl;
3608 
3609  htmlFile << "<a name=\"ChannelMap\"></a>\n";
3610  htmlFile << "<h3> 2.A.Channel map for each Depth </h3>" << std::endl;
3611  htmlFile << "<h4> Channel legend: green - good, not yellow - suspicious(rate of failures at least 0.1), white - "
3612  "not applicable or out of range </h4>"
3613  << std::endl;
3614  if (sub == 1)
3615  htmlFile << " <img src=\"MAPHB.png\" />" << std::endl;
3616  if (sub == 2)
3617  htmlFile << " <img src=\"MAPHE.png\" />" << std::endl;
3618  if (sub == 3)
3619  htmlFile << " <img src=\"MAPHO.png\" />" << std::endl;
3620  if (sub == 4)
3621  htmlFile << " <img src=\"MAPHF.png\" />" << std::endl;
3622  htmlFile << "<br>" << std::endl;
3623  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
3624 
3626  /*
3627 // htmlFile << "<h3> 2.B.List of Bad channels (rate > 0.1) and its rates for each RMT criteria (for GS - %) </h3>"<< std::endl;
3628 
3629  htmlFile << "<a name=\"BadChannels\"></a>\n";
3630  htmlFile << "<h3> 2.B.List of Bad channels (rate > 0.1) and its rates for each RMT criteria </h3>"<< std::endl;
3631 
3632  //htmlFile << " <td><a href=\"HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
3633  // htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"<<runnumber<<"/HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
3634  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
3635 
3636  htmlFile << "<table>"<< std::endl;
3637  htmlFile << "<tr>";
3638  htmlFile << "<td class=\"s4\" align=\"center\">#</td>" << std::endl;
3639  htmlFile << "<td class=\"s1\" align=\"center\">ETA</td>" << std::endl;
3640  htmlFile << "<td class=\"s1\" align=\"center\">PHI</td>" << std::endl;
3641  htmlFile << "<td class=\"s1\" align=\"center\">DEPTH</td>"<< std::endl;
3642  htmlFile << "<td class=\"s1\" align=\"center\">RBX</td>" << std::endl;
3643  htmlFile << "<td class=\"s1\" align=\"center\">RM</td>" << std::endl;
3644  htmlFile << "<td class=\"s1\" align=\"center\">PIXEL</td>" << std::endl;
3645  htmlFile << "<td class=\"s1\" align=\"center\">RM_FIBER</td>" << std::endl;
3646  htmlFile << "<td class=\"s1\" align=\"center\">FIBER_CH</td>" << std::endl;
3647  htmlFile << "<td class=\"s1\" align=\"center\">QIE</td>" << std::endl;
3648  htmlFile << "<td class=\"s1\" align=\"center\">ADC</td>" << std::endl;
3649  htmlFile << "<td class=\"s1\" align=\"center\">CRATE</td>" << std::endl;
3650  htmlFile << "<td class=\"s1\" align=\"center\">DCC</td>" << std::endl;
3651  htmlFile << "<td class=\"s1\" align=\"center\">SPIGOT</td>" << std::endl;
3652  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FIBER</td>" << std::endl;
3653  htmlFile << "<td class=\"s1\" align=\"center\">HTR_SLOT</td>" << std::endl;
3654  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FPGA</td>" << std::endl;
3655  htmlFile << "<td class=\"s5\" align=\"center\">Cm</td>" << std::endl;
3656  htmlFile << "<td class=\"s5\" align=\"center\">Am</td>" << std::endl;
3657  htmlFile << "<td class=\"s5\" align=\"center\">Wm</td>" << std::endl;
3658  htmlFile << "<td class=\"s5\" align=\"center\">Rm</td>" << std::endl;
3659  htmlFile << "<td class=\"s5\" align=\"center\">TNm</td>" << std::endl;
3660  htmlFile << "<td class=\"s5\" align=\"center\">TXm</td>" << std::endl;
3661 // htmlFile << "<td class=\"s8\" align=\"center\">Cc</td>" << std::endl;
3662 // htmlFile << "<td class=\"s8\" align=\"center\">Ac</td>" << std::endl;
3663 // htmlFile << "<td class=\"s8\" align=\"center\">Wc</td>" << std::endl;
3664 // htmlFile << "<td class=\"s8\" align=\"center\">Rc</td>" << std::endl;
3665 // htmlFile << "<td class=\"s8\" align=\"center\">TNc</td>" << std::endl;
3666 // htmlFile << "<td class=\"s8\" align=\"center\">TXc</td>" << std::endl;
3667 // htmlFile << "<td class=\"s9\" align=\"center\">GS (%)</td>" << std::endl;
3668  htmlFile << "<td class=\"s4\" align=\"center\">Pm</td>" << std::endl;
3669  htmlFile << "<td class=\"s4\" align=\"center\">pWm</td>" << std::endl;
3670  htmlFile << "</tr>" << std::endl;
3671 
3672  for (int i=1;i<=NBad;i++) {
3673  if((ind%2)==1){
3674  raw_class="<td class=\"s2\" align=\"center\">";
3675  raw_class1="<td class=\"s6\" align=\"center\">";
3676  raw_class2="<td class=\"s11\" align=\"center\">";
3677  raw_class3="<td class=\"s13\" align=\"center\">";
3678 
3679  }else{
3680  raw_class="<td class=\"s3\" align=\"center\">";
3681  raw_class1="<td class=\"s7\" align=\"center\">";
3682  raw_class2="<td class=\"s12\" align=\"center\">";
3683  raw_class3="<td class=\"s14\" align=\"center\">";
3684  }
3685  const CellDB db;
3686  CellDB ce;
3687  if ((ce.size()>=1)&&(Sub[2][i]==sub)) {
3688  // AZ 19.03.2018
3689 
3690 // AZ 19 if (Sub[2][i]==1) {
3691 // AZ 19 ce = db.find("subdet", "HB").find("Eta", Eta[2][i]).find("Phi", Phi[2][i]).find("Depth", Depth[2][i]);
3692 // AZ 19 if (ce.size()==0) {cout<<"Error: No such HB, Eta="<< Eta[2][i] <<", Phi="<< Phi[2][i] <<", Depth="<< Depth[2][i] <<" in database"<<endl; continue;}
3693 // AZ 19 else if (ce.size()>1) {cout<<"Warning: More than one line correspond to such HB, Eta="<< Eta[2][i] <<", Phi="<< Phi[2][i] <<", Depth="<< Depth[2][i] <<" in database"<<endl;}
3694 // AZ 19 }
3695 // AZ 19 if (Sub[2][i]==2) {
3696 // AZ 19 ce = db.find("subdet", "HE").find("Eta", Eta[2][i]).find("Phi", Phi[2][i]).find("Depth", Depth[2][i]);
3697 // AZ 19 if (ce.size()==0) {cout<<"Error: No such HE, Eta="<< Eta[2][i] <<", Phi="<< Phi[2][i] <<", Depth="<< Depth[2][i] <<" in database"<<endl;continue;}
3698 // AZ 19 else if (ce.size()>1) {cout<<"Warning: More than one line correspond to such HE, Eta="<< Eta[2][i] <<", Phi="<< Phi[2][i] <<", Depth="<< Depth[2][i] <<" in database"<<endl;}
3699 // AZ 19 }
3700 // AZ 19 if (Sub[2][i]==3) {
3701 // AZ 19 ce = db.find("subdet", "HO").find("Eta", Eta[2][i]).find("Phi", Phi[2][i]).find("Depth", Depth[2][i]);
3702 // AZ 19 if (ce.size()==0) {cout<<"Error: No such HO, Eta="<< Eta[2][i] <<", Phi="<< Phi[2][i] <<", Depth="<< Depth[2][i] <<" in database"<<endl;continue;}
3703 // AZ 19 else if (ce.size()>1) {cout<<"Warning: More than one line correspond to such HO, Eta="<< Eta[2][i] <<", Phi="<< Phi[2][i] <<", Depth="<< Depth[2][i] <<" in database"<<endl;}
3704 // AZ 19 }
3705 // AZ 19 if (Sub[2][i]==4) {
3706 // AZ 19 ce = db.find("subdet", "HF").find("Eta", Eta[2][i]).find("Phi", Phi[2][i]).find("Depth", Depth[2][i]);
3707 // AZ 19 if (ce.size()==0) {cout<<"Error: No such HF, Eta="<< Eta[2][i] <<", Phi="<< Phi[2][i] <<", Depth="<< Depth[2][i] <<" in database"<<endl;continue;}
3708 // AZ 19 else if (ce.size()>1) {cout<<"Warning: More than one line correspond to such HF, Eta="<< Eta[2][i] <<", Phi="<< Phi[2][i] <<", Depth="<< Depth[2][i] <<" in database"<<endl;}
3709 // AZ 19 }
3710 
3711  htmlFile << "<tr>"<< std::endl;
3712  htmlFile << "<td class=\"s4\" align=\"center\">" << ind+1 <<"</td>"<< std::endl;
3713  htmlFile << raw_class<< Eta[2][i]<<"</td>"<< std::endl;
3714  htmlFile << raw_class<< Phi[2][i]<<"</td>"<< std::endl;
3715  htmlFile << raw_class<< Depth[2][i] <<"</td>"<< std::endl;
3716  htmlFile << raw_class<< ce[0].RBX <<"</td>"<< std::endl;
3717  htmlFile << raw_class<< ce[0].RM <<"</td>"<< std::endl;
3718  htmlFile << raw_class<< ce[0].Pixel <<"</td>"<< std::endl;
3719  htmlFile << raw_class<< ce[0].RMfiber <<"</td>"<< std::endl;
3720  htmlFile << raw_class<< ce[0].FiberCh <<"</td>"<< std::endl;
3721  htmlFile << raw_class<< ce[0].QIE <<"</td>"<< std::endl;
3722  htmlFile << raw_class<< ce[0].ADC<<"</td>"<< std::endl;
3723  htmlFile << raw_class<< ce[0].VMECardID <<"</td>"<< std::endl;
3724  htmlFile << raw_class<< ce[0].dccID <<"</td>"<< std::endl;
3725  htmlFile << raw_class<< ce[0].Spigot <<"</td>"<< std::endl;
3726  htmlFile << raw_class<< ce[0].FiberIndex <<"</td>"<< std::endl;
3727  htmlFile << raw_class<< ce[0].HtrSlot <<"</td>"<< std::endl;
3728  htmlFile << raw_class<< ce[0].HtrTB <<"</td>"<< std::endl;
3729  htmlFile << raw_class1<< Map_Ampl[1][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
3730  htmlFile << raw_class1<< Map_Ampl[2][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
3731  htmlFile << raw_class1<< Map_Ampl[3][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
3732  htmlFile << raw_class1<< Map_Ampl[4][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
3733  htmlFile << raw_class1<< Map_Ampl[5][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
3734  htmlFile << raw_class1<< Map_Ampl[6][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
3735 // htmlFile << raw_class2<< Map_Ampl[11][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
3736 // htmlFile << raw_class2<< Map_Ampl[12][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
3737 // htmlFile << raw_class2<< Map_Ampl[13][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
3738 // htmlFile << raw_class2<< Map_Ampl[14][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
3739 // htmlFile << raw_class2<< Map_Ampl[15][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
3740 // htmlFile << raw_class2<< Map_Ampl[16][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
3741 // htmlFile << raw_class3<< Map_Ampl[21][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
3742  htmlFile << raw_class<< Map_Ampl[31][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
3743  htmlFile << raw_class<< Map_Ampl[32][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
3744  htmlFile << "</tr>" << std::endl;
3745 
3746  ind+=1;
3747  }
3748  }
3749  htmlFile << "</table>" << std::endl;
3750  htmlFile << "<br>"<< std::endl;
3751  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
3752 
3753 
3754  htmlFile << "<h3> 2.C.List of Gain unstable channels and its value in % (for other criterias - rate)</h3>"<< std::endl;
3755  htmlFile << "<table>"<< std::endl;
3756  htmlFile << "<tr>";
3757  htmlFile << "<td class=\"s4\" align=\"center\">#</td>" << std::endl;
3758  htmlFile << "<td class=\"s1\" align=\"center\">ETA</td>" << std::endl;
3759  htmlFile << "<td class=\"s1\" align=\"center\">PHI</td>" << std::endl;
3760  htmlFile << "<td class=\"s1\" align=\"center\">DEPTH</td>"<< std::endl;
3761  htmlFile << "<td class=\"s1\" align=\"center\">RBX</td>" << std::endl;
3762  htmlFile << "<td class=\"s1\" align=\"center\">RM</td>" << std::endl;
3763  htmlFile << "<td class=\"s1\" align=\"center\">PIXEL</td>" << std::endl;
3764  htmlFile << "<td class=\"s1\" align=\"center\">RM_FIBER</td>" << std::endl;
3765  htmlFile << "<td class=\"s1\" align=\"center\">FIBER_CH</td>" << std::endl;
3766  htmlFile << "<td class=\"s1\" align=\"center\">QIE</td>" << std::endl;
3767  htmlFile << "<td class=\"s1\" align=\"center\">ADC</td>" << std::endl;
3768  htmlFile << "<td class=\"s1\" align=\"center\">CRATE</td>" << std::endl;
3769  htmlFile << "<td class=\"s1\" align=\"center\">DCC</td>" << std::endl;
3770  htmlFile << "<td class=\"s1\" align=\"center\">SPIGOT</td>" << std::endl;
3771  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FIBER</td>" << std::endl;
3772  htmlFile << "<td class=\"s1\" align=\"center\">HTR_SLOT</td>" << std::endl;
3773  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FPGA</td>" << std::endl;
3774  htmlFile << "<td class=\"s5\" align=\"center\">Cm</td>" << std::endl;
3775  htmlFile << "<td class=\"s5\" align=\"center\">Am</td>" << std::endl;
3776  htmlFile << "<td class=\"s5\" align=\"center\">Wm</td>" << std::endl;
3777  htmlFile << "<td class=\"s5\" align=\"center\">Rm</td>" << std::endl;
3778  htmlFile << "<td class=\"s5\" align=\"center\">TNm</td>" << std::endl;
3779  htmlFile << "<td class=\"s5\" align=\"center\">TXm</td>" << std::endl;
3780 // htmlFile << "<td class=\"s8\" align=\"center\">Cc</td>" << std::endl;
3781 // htmlFile << "<td class=\"s8\" align=\"center\">Ac</td>" << std::endl;
3782 // htmlFile << "<td class=\"s8\" align=\"center\">Wc</td>" << std::endl;
3783 // htmlFile << "<td class=\"s8\" align=\"center\">Rc</td>" << std::endl;
3784 // htmlFile << "<td class=\"s8\" align=\"center\">TNc</td>" << std::endl;
3785 // htmlFile << "<td class=\"s8\" align=\"center\">TXc</td>" << std::endl;
3786 // htmlFile << "<td class=\"s9\" align=\"center\">GS(%)</td>" << std::endl;
3787  htmlFile << "<td class=\"s4\" align=\"center\">Pm</td>" << std::endl;
3788  htmlFile << "<td class=\"s4\" align=\"center\">pWm</td>" << std::endl;
3789  htmlFile << "</tr>" << std::endl;
3790 
3791  for (int i=1;i<=NWarn;i++) {
3792  if((ind%2)==1){
3793  raw_class="<td class=\"s2\" align=\"center\">";
3794  raw_class1="<td class=\"s6\" align=\"center\">";
3795  raw_class2="<td class=\"s11\" align=\"center\">";
3796  raw_class3="<td class=\"s13\" align=\"center\">";
3797 
3798  }else{
3799  raw_class="<td class=\"s3\" align=\"center\">";
3800  raw_class1="<td class=\"s7\" align=\"center\">";
3801  raw_class2="<td class=\"s12\" align=\"center\">";
3802  raw_class3="<td class=\"s14\" align=\"center\">";
3803  }
3804  const CellDB db;
3805  CellDB ce;
3806  if ((ce.size()>=1)&&(Sub[1][i]==sub)) {
3807  if (Sub[1][i]==1) {
3808  ce = db.find("subdet", "HB").find("Eta", Eta[1][i]).find("Phi", Phi[1][i]).find("Depth", Depth[1][i]);
3809  if (ce.size()==0) {cout<<"Error: No such HB, Eta="<< Eta[1][i] <<", Phi="<< Phi[1][i] <<", Depth="<< Depth[1][i] <<" in database"<<endl;}
3810  else if (ce.size()>1) {cout<<"Warning: More than one line correspond to such HB, Eta="<< Eta[1][i] <<", Phi="<< Phi[1][i] <<", Depth="<< Depth[1][i] <<" in database"<<endl;}
3811  }
3812  if (Sub[1][i]==2) {
3813  ce = db.find("subdet", "HE").find("Eta", Eta[1][i]).find("Phi", Phi[1][i]).find("Depth", Depth[1][i]);
3814  if (ce.size()==0) {cout<<"Error: No such HE, Eta="<< Eta[1][i] <<", Phi="<< Phi[1][i] <<", Depth="<< Depth[1][i] <<" in database"<<endl;}
3815  else if (ce.size()>1) {cout<<"Warning: More than one line correspond to such HE, Eta="<< Eta[1][i] <<", Phi="<< Phi[1][i] <<", Depth="<< Depth[1][i] <<" in database"<<endl;}
3816  }
3817  if (Sub[1][i]==3) {
3818  ce = db.find("subdet", "HO").find("Eta", Eta[1][i]).find("Phi", Phi[1][i]).find("Depth", Depth[1][i]);
3819  if (ce.size()==0) {cout<<"Error: No such HO, Eta="<< Eta[1][i] <<", Phi="<< Phi[1][i] <<", Depth="<< Depth[1][i] <<" in database"<<endl;}
3820  else if (ce.size()>1) {cout<<"Warning: More than one line correspond to such HO, Eta="<< Eta[1][i] <<", Phi="<< Phi[1][i] <<", Depth="<< Depth[1][i] <<" in database"<<endl;}
3821  }
3822  if (Sub[1][i]==4) {
3823  ce = db.find("subdet", "HF").find("Eta", Eta[1][i]).find("Phi", Phi[1][i]).find("Depth", Depth[1][i]);
3824  if (ce.size()==0) {cout<<"Error: No such HF, Eta="<< Eta[1][i] <<", Phi="<< Phi[1][i] <<", Depth="<< Depth[1][i] <<" in database"<<endl;}
3825  else if (ce.size()>1) {cout<<"Warning: More than one line correspond to such HF, Eta="<< Eta[1][i] <<", Phi="<< Phi[1][i] <<", Depth="<< Depth[1][i] <<" in database"<<endl;}
3826  }
3827  htmlFile << "<td class=\"s4\" align=\"center\">" << ind+1 <<"</td>"<< std::endl;
3828  htmlFile << raw_class<< Eta[1][i]<<"</td>"<< std::endl;
3829  htmlFile << raw_class<< Phi[1][i]<<"</td>"<< std::endl;
3830  htmlFile << raw_class<< Depth[1][i] <<"</td>"<< std::endl;
3831  htmlFile << raw_class<< ce[0].RBX <<"</td>"<< std::endl;
3832  htmlFile << raw_class<< ce[0].RM <<"</td>"<< std::endl;
3833  htmlFile << raw_class<< ce[0].Pixel <<"</td>"<< std::endl;
3834  htmlFile << raw_class<< ce[0].RMfiber <<"</td>"<< std::endl;
3835  htmlFile << raw_class<< ce[0].FiberCh <<"</td>"<< std::endl;
3836  htmlFile << raw_class<< ce[0].QIE <<"</td>"<< std::endl;
3837  htmlFile << raw_class<< ce[0].ADC<<"</td>"<< std::endl;
3838  htmlFile << raw_class<< ce[0].VMECardID <<"</td>"<< std::endl;
3839  htmlFile << raw_class<< ce[0].dccID <<"</td>"<< std::endl;
3840  htmlFile << raw_class<< ce[0].Spigot <<"</td>"<< std::endl;
3841  htmlFile << raw_class<< ce[0].FiberIndex <<"</td>"<< std::endl;
3842  htmlFile << raw_class<< ce[0].HtrSlot <<"</td>"<< std::endl;
3843  htmlFile << raw_class<< ce[0].HtrTB <<"</td>"<< std::endl;
3844  htmlFile << raw_class1<< Map_Ampl[1][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
3845  htmlFile << raw_class1<< Map_Ampl[2][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
3846  htmlFile << raw_class1<< Map_Ampl[3][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
3847  htmlFile << raw_class1<< Map_Ampl[4][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
3848  htmlFile << raw_class1<< Map_Ampl[5][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
3849  htmlFile << raw_class1<< Map_Ampl[6][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
3850 // htmlFile << raw_class2<< Map_Ampl[11][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
3851 // htmlFile << raw_class2<< Map_Ampl[12][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
3852 // htmlFile << raw_class2<< Map_Ampl[13][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
3853 // htmlFile << raw_class2<< Map_Ampl[14][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
3854 // htmlFile << raw_class2<< Map_Ampl[15][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
3855 // htmlFile << raw_class2<< Map_Ampl[16][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
3856 // htmlFile << raw_class3<< Map_Ampl[21][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
3857  htmlFile << raw_class<< Map_Ampl[31][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
3858  htmlFile << raw_class<< Map_Ampl[32][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
3859  htmlFile << "</tr>" << std::endl;
3860  htmlFile << "</tr>" << std::endl;
3861  ind+=1;
3862  }
3863  }
3864  htmlFile << "</table>" << std::endl;
3865  htmlFile << "<br>"<< std::endl;
3866 
3867 
3868 // htmlFile << "<h3> 2.D.List of channels with Bad Pedestals (rate > 0.1) and its rates (for GS - %)</h3>"<< std::endl;
3869  htmlFile << "<a name=\"BadPedestals\"></a>\n";
3870  htmlFile << "<h3> 2.C.List of channels with Bad Pedestals (rate > 0.1) and its rates </h3>"<< std::endl;
3871  htmlFile << "<table>"<< std::endl;
3872  htmlFile << "<tr>";
3873  htmlFile << "<td class=\"s4\" align=\"center\">#</td>" << std::endl;
3874  htmlFile << "<td class=\"s1\" align=\"center\">ETA</td>" << std::endl;
3875  htmlFile << "<td class=\"s1\" align=\"center\">PHI</td>" << std::endl;
3876  htmlFile << "<td class=\"s1\" align=\"center\">DEPTH</td>"<< std::endl;
3877  htmlFile << "<td class=\"s1\" align=\"center\">RBX</td>" << std::endl;
3878  htmlFile << "<td class=\"s1\" align=\"center\">RM</td>" << std::endl;
3879  htmlFile << "<td class=\"s1\" align=\"center\">PIXEL</td>" << std::endl;
3880  htmlFile << "<td class=\"s1\" align=\"center\">RM_FIBER</td>" << std::endl;
3881  htmlFile << "<td class=\"s1\" align=\"center\">FIBER_CH</td>" << std::endl;
3882  htmlFile << "<td class=\"s1\" align=\"center\">QIE</td>" << std::endl;
3883  htmlFile << "<td class=\"s1\" align=\"center\">ADC</td>" << std::endl;
3884  htmlFile << "<td class=\"s1\" align=\"center\">CRATE</td>" << std::endl;
3885  htmlFile << "<td class=\"s1\" align=\"center\">DCC</td>" << std::endl;
3886  htmlFile << "<td class=\"s1\" align=\"center\">SPIGOT</td>" << std::endl;
3887  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FIBER</td>" << std::endl;
3888  htmlFile << "<td class=\"s1\" align=\"center\">HTR_SLOT</td>" << std::endl;
3889  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FPGA</td>" << std::endl;
3890  htmlFile << "<td class=\"s5\" align=\"center\">Cm</td>" << std::endl;
3891  htmlFile << "<td class=\"s5\" align=\"center\">Am</td>" << std::endl;
3892  htmlFile << "<td class=\"s5\" align=\"center\">Wm</td>" << std::endl;
3893  htmlFile << "<td class=\"s5\" align=\"center\">Rm</td>" << std::endl;
3894  htmlFile << "<td class=\"s5\" align=\"center\">TNm</td>" << std::endl;
3895  htmlFile << "<td class=\"s5\" align=\"center\">TXm</td>" << std::endl;
3896 // htmlFile << "<td class=\"s8\" align=\"center\">Cc</td>" << std::endl;
3897 // htmlFile << "<td class=\"s8\" align=\"center\">Ac</td>" << std::endl;
3898 // htmlFile << "<td class=\"s8\" align=\"center\">Wc</td>" << std::endl;
3899 // htmlFile << "<td class=\"s8\" align=\"center\">Rc</td>" << std::endl;
3900 // htmlFile << "<td class=\"s8\" align=\"center\">TNc</td>" << std::endl;
3901 // htmlFile << "<td class=\"s8\" align=\"center\">TXc</td>" << std::endl;
3902 // htmlFile << "<td class=\"s9\" align=\"center\">GS(%)</td>" << std::endl;
3903  htmlFile << "<td class=\"s4\" align=\"center\">Pm</td>" << std::endl;
3904  htmlFile << "<td class=\"s4\" align=\"center\">pWm</td>" << std::endl;
3905  htmlFile << "</tr>" << std::endl;
3906 
3907  for (int i=1;i<=NPed;i++) {
3908  if((ind%2)==1){
3909  raw_class="<td class=\"s2\" align=\"center\">";
3910  raw_class1="<td class=\"s6\" align=\"center\">";
3911  raw_class2="<td class=\"s11\" align=\"center\">";
3912  raw_class3="<td class=\"s13\" align=\"center\">";
3913 
3914  }else{
3915  raw_class="<td class=\"s3\" align=\"center\">";
3916  raw_class1="<td class=\"s7\" align=\"center\">";
3917  raw_class2="<td class=\"s12\" align=\"center\">";
3918  raw_class3="<td class=\"s14\" align=\"center\">";
3919  }
3920  const CellDB db;
3921  CellDB ce;
3922  if ((ce.size()>=1)&&(Sub[3][i]==sub)) {
3923 
3924  // AZ 19.03.2018
3925 // AZ 19 if (Sub[3][i]==1) {
3926 // AZ 19 ce = db.find("subdet", "HB").find("Eta", Eta[3][i]).find("Phi", Phi[3][i]).find("Depth", Depth[3][i]);
3927 // AZ 19 if (ce.size()==0) {cout<<"Error: No such HB, Eta="<< Eta[3][i] <<", Phi="<< Phi[3][i] <<", Depth="<< Depth[3][i] <<" in database"<<endl;continue;}
3928 // AZ 19 else if (ce.size()>1) {cout<<"Warning: More than one line correspond to such HB, Eta="<< Eta[3][i] <<", Phi="<< Phi[3][i] <<", Depth="<< Depth[3][i] <<" in database"<<endl;}
3929 // AZ 19 }
3930 // AZ 19 if (Sub[3][i]==2) {
3931 // AZ 19 ce = db.find("subdet", "HE").find("Eta", Eta[3][i]).find("Phi", Phi[3][i]).find("Depth", Depth[3][i]);
3932 // AZ 19 if (ce.size()==0) {cout<<"Error: No such HE, Eta="<< Eta[3][i] <<", Phi="<< Phi[3][i] <<", Depth="<< Depth[3][i] <<" in database"<<endl;continue;}
3933 // AZ 19 else if (ce.size()>1) {cout<<"Warning: More than one line correspond to such HE, Eta="<< Eta[3][i] <<", Phi="<< Phi[3][i] <<", Depth="<< Depth[3][i] <<" in database"<<endl;}
3934 // AZ 19 }
3935 // AZ 19 if (Sub[3][i]==3) {
3936 // AZ 19 ce = db.find("subdet", "HO").find("Eta", Eta[3][i]).find("Phi", Phi[3][i]).find("Depth", Depth[3][i]);
3937 // AZ 19 if (ce.size()==0) {cout<<"Error: No such HO, Eta="<< Eta[3][i] <<", Phi="<< Phi[3][i] <<", Depth="<< Depth[3][i] <<" in database"<<endl;continue;}
3938 // AZ 19 else if (ce.size()>1) {cout<<"Warning: More than one line correspond to such HO, Eta="<< Eta[3][i] <<", Phi="<< Phi[3][i] <<", Depth="<< Depth[3][i] <<" in database"<<endl;}
3939 // AZ 19 }
3940 // AZ 19 if (Sub[3][i]==4) {
3941 // AZ 19 ce = db.find("subdet", "HF").find("Eta", Eta[3][i]).find("Phi", Phi[3][i]).find("Depth", Depth[3][i]);
3942 // AZ 19 if (ce.size()==0) {cout<<"Error: No such HF, Eta="<< Eta[3][i] <<", Phi="<< Phi[3][i] <<", Depth="<< Depth[3][i] <<" in database"<<endl;continue;}
3943 // AZ 19 else if (ce.size()>1) {cout<<"Warning: More than one line correspond to such HF, Eta="<< Eta[3][i] <<", Phi="<< Phi[3][i] <<", Depth="<< Depth[3][i] <<" in database"<<endl;}
3944 // AZ 19 }
3945 
3946  htmlFile << "<td class=\"s4\" align=\"center\">" << ind+1 <<"</td>"<< std::endl;
3947  htmlFile << raw_class<< Eta[3][i]<<"</td>"<< std::endl;
3948  htmlFile << raw_class<< Phi[3][i]<<"</td>"<< std::endl;
3949  htmlFile << raw_class<< Depth[3][i] <<"</td>"<< std::endl;
3950  htmlFile << raw_class<< ce[0].RBX <<"</td>"<< std::endl;
3951  htmlFile << raw_class<< ce[0].RM <<"</td>"<< std::endl;
3952  htmlFile << raw_class<< ce[0].Pixel <<"</td>"<< std::endl;
3953  htmlFile << raw_class<< ce[0].RMfiber <<"</td>"<< std::endl;
3954  htmlFile << raw_class<< ce[0].FiberCh <<"</td>"<< std::endl;
3955  htmlFile << raw_class<< ce[0].QIE <<"</td>"<< std::endl;
3956  htmlFile << raw_class<< ce[0].ADC<<"</td>"<< std::endl;
3957  htmlFile << raw_class<< ce[0].VMECardID <<"</td>"<< std::endl;
3958  htmlFile << raw_class<< ce[0].dccID <<"</td>"<< std::endl;
3959  htmlFile << raw_class<< ce[0].Spigot <<"</td>"<< std::endl;
3960  htmlFile << raw_class<< ce[0].FiberIndex <<"</td>"<< std::endl;
3961  htmlFile << raw_class<< ce[0].HtrSlot <<"</td>"<< std::endl;
3962  htmlFile << raw_class<< ce[0].HtrTB <<"</td>"<< std::endl;
3963  htmlFile << raw_class1<< Map_Ampl[1][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
3964  htmlFile << raw_class1<< Map_Ampl[2][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
3965  htmlFile << raw_class1<< Map_Ampl[3][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
3966  htmlFile << raw_class1<< Map_Ampl[4][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
3967  htmlFile << raw_class1<< Map_Ampl[5][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
3968  htmlFile << raw_class1<< Map_Ampl[6][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
3969 // htmlFile << raw_class2<< Map_Ampl[11][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
3970 // htmlFile << raw_class2<< Map_Ampl[12][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
3971 // htmlFile << raw_class2<< Map_Ampl[13][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
3972 // htmlFile << raw_class2<< Map_Ampl[14][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
3973 // htmlFile << raw_class2<< Map_Ampl[15][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
3974 // htmlFile << raw_class2<< Map_Ampl[16][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
3975 // htmlFile << raw_class3<< Map_Ampl[21][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
3976  htmlFile << raw_class<< Map_Ampl[31][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
3977  htmlFile << raw_class<< Map_Ampl[32][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
3978  htmlFile << "</tr>" << std::endl;
3979  htmlFile << "</tr>" << std::endl;
3980  ind+=1;
3981  }
3982  }
3983  htmlFile << "</table><br>" << std::endl;
3984  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
3985 */
3987 
3988  htmlFile << "</body> " << std::endl;
3989  htmlFile << "</html> " << std::endl;
3990  htmlFile.close();
3991  }
3992 
3993  //======================================================================
3994  // Creating description html file:
3995  ofstream htmlFile;
3996 
3997  //======================================================================
3998  /*
3999  htmlFile.open("HELP.html");
4000  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">"<< std::endl;
4001  htmlFile << "<head>"<< std::endl;
4002  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>"<< std::endl;
4003  htmlFile << "<title> Remote Monitoring Tool </title>"<< std::endl;
4004  htmlFile << "<style type=\"text/css\">"<< std::endl;
4005  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"<< std::endl;
4006  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }"<< std::endl;
4007  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; text-align: center;}"<< std::endl;
4008  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }"<< std::endl;
4009  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }"<< std::endl;
4010  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }"<< std::endl;
4011  htmlFile << "</style>"<< std::endl;
4012  htmlFile << "<body>"<< std::endl;
4013  htmlFile << "<h1> Description of Remote Monitoring Tool criteria for bad channel selection</h1>"<< std::endl;
4014  htmlFile << "<br>"<< std::endl;
4015  htmlFile << "<h3> - C means 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;
4016  htmlFile << "<br>"<< std::endl;
4017  htmlFile << "<h3> - A means full amplitude, collected over all time slices </h3> "<< std::endl;
4018  htmlFile << "<h3> - R means ratio criterion 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;
4019  htmlFile << "<br>"<< std::endl;
4020  htmlFile << "<h3> - W means width of shape distribution. Width is defined as square root from dispersion. </h3> "<< std::endl;
4021  htmlFile << "<br>"<< std::endl;
4022  htmlFile << "<h3> - TN means mean time position of adc signal. </h3> "<< std::endl;
4023  htmlFile << "<br>"<< std::endl;
4024  htmlFile << "<h3> - TX means TS number of maximum signal </h3> "<< std::endl;
4025  htmlFile << "<br>"<< std::endl;
4026  htmlFile << "<h3> - m means megatile channels. For example Am means Amplitude criteria for megatile channels </h3> "<< std::endl;
4027  htmlFile << "<br>"<< std::endl;
4028  htmlFile << "<h3> - c means calibration channels. For example Ac means Amplitude criteria for calibration channels </h3> "<< std::endl;
4029  htmlFile << "<br>"<< std::endl;
4030  htmlFile << "<h3> - Pm means Pedestals. </h3> "<< std::endl;
4031  htmlFile << "<br>"<< std::endl;
4032  htmlFile << "<h3> - pWm means pedestal Width. </h3> "<< std::endl;
4033  htmlFile << "<br>"<< std::endl;
4034  htmlFile << "</body> " << std::endl;
4035  htmlFile << "</html> " << std::endl;
4036  htmlFile.close();
4037 */
4038  //======================================================================
4039 
4040  //======================================================================
4041  // Creating main html file:
4042  htmlFile.open("MAP.html");
4043  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
4044  htmlFile << "<head>" << std::endl;
4045  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
4046  htmlFile << "<title> Remote Monitoring Tool </title>" << std::endl;
4047  htmlFile << "<style type=\"text/css\">" << std::endl;
4048  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
4049  << std::endl;
4050  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
4051  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
4052  "text-align: center;}"
4053  << std::endl;
4054  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
4055  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
4056  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
4057  htmlFile << " td.s5 { font-family: arial, arial ce, helvetica; background-color: #FF00FF; }" << std::endl;
4058  htmlFile << " td.s6 { font-family: arial, arial ce, helvetica; background-color: #9ACD32; }" << std::endl;
4059  htmlFile << " td.s7 { font-family: arial, arial ce, helvetica; background-color: #32CD32; }" << std::endl;
4060  htmlFile << "</style>" << std::endl;
4061  htmlFile << "<body>" << std::endl;
4062 
4063  htmlFile << "<h1> Remote Monitoring Tool, RUN = " << runnumber << ". </h1>" << std::endl;
4064  htmlFile << "<br>" << std::endl;
4065 
4066  htmlFile << "<h2> 1. Analysis results for subdetectors </h2>" << std::endl;
4067  htmlFile << "<table width=\"400\">" << std::endl;
4068  htmlFile << "<tr>" << std::endl;
4069 
4070  // AZ 12.03.2019
4071  /*
4072  htmlFile << " <td><a href=\"HB.html\">HB</a></td>"<< std::endl;
4073  htmlFile << " <td><a href=\"HE.html\">HE</a></td>"<< std::endl;
4074  htmlFile << " <td><a href=\"HO.html\">HO</a></td>"<< std::endl;
4075  htmlFile << " <td><a href=\"HF.html\">HF</a></td>"<< std::endl;
4076 */
4077 
4078  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
4079  << runnumber << "/HB.html\">HB</a></td>" << std::endl;
4080  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
4081  << runnumber << "/HE.html\">HE</a></td>" << std::endl;
4082  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
4083  << runnumber << "/HO.html\">HO</a></td>" << std::endl;
4084  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
4085  << runnumber << "/HF.html\">HF</a></td>" << std::endl;
4086 
4087  htmlFile << "</tr>" << std::endl;
4088  htmlFile << "</table>" << std::endl;
4089  htmlFile << "<br>" << std::endl;
4090 
4091  htmlFile << "<h2> 2. HCAL status over all criteria and subdetectors </h2>" << std::endl;
4092  htmlFile << "<h3> 2.A. Channels in detector space </h3>" << std::endl;
4093  htmlFile << "<h4> Legend for channel status: green - good, others - may be a problems, white - not applicable or out "
4094  "of range </h4>"
4095  << std::endl;
4096  htmlFile << " <img src=\"MAP.png\" />" << std::endl;
4097  htmlFile << "<br>" << std::endl;
4098 
4099  htmlFile << "<h3> 2.B. List of Bad channels </h3>" << std::endl;
4100 
4101  //htmlFile << " <td><a href=\"HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
4102  // htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"<<runnumber<<"/HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
4103  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/HELP.html\"> "
4104  "Description of criteria for bad channel selection</a></td>"
4105  << std::endl;
4106 
4107  htmlFile << "<table>" << std::endl;
4108  htmlFile << "<tr>";
4109  htmlFile << "<td class=\"s4\" align=\"center\">#</td>" << std::endl;
4110  htmlFile << "<td class=\"s1\" align=\"center\">ETA</td>" << std::endl;
4111  htmlFile << "<td class=\"s1\" align=\"center\">PHI</td>" << std::endl;
4112  htmlFile << "<td class=\"s1\" align=\"center\">DEPTH</td>" << std::endl;
4113  htmlFile << "<td class=\"s1\" align=\"center\">RBX</td>" << std::endl;
4114  htmlFile << "<td class=\"s1\" align=\"center\">RM</td>" << std::endl;
4115  htmlFile << "<td class=\"s1\" align=\"center\">PIXEL</td>" << std::endl;
4116  htmlFile << "<td class=\"s1\" align=\"center\">RM_FIBER</td>" << std::endl;
4117  htmlFile << "<td class=\"s1\" align=\"center\">FIBER_CH</td>" << std::endl;
4118  htmlFile << "<td class=\"s1\" align=\"center\">QIE</td>" << std::endl;
4119  htmlFile << "<td class=\"s1\" align=\"center\">ADC</td>" << std::endl;
4120  htmlFile << "<td class=\"s1\" align=\"center\">CRATE</td>" << std::endl;
4121  htmlFile << "<td class=\"s1\" align=\"center\">DCC</td>" << std::endl;
4122  htmlFile << "<td class=\"s1\" align=\"center\">SPIGOT</td>" << std::endl;
4123  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FIBER</td>" << std::endl;
4124  htmlFile << "<td class=\"s1\" align=\"center\">HTR_SLOT</td>" << std::endl;
4125  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FPGA</td>" << std::endl;
4126  htmlFile << "<td class=\"s5\" align=\"center\">RMT-criteria</td>" << std::endl;
4127  htmlFile << "</tr>" << std::endl;
4128 
4129  ind = 0;
4130  // AZ 19.03.2018
4131  /*
4132  for (int i=1;i<=NBad;i++) {
4133  if((ind%2)==1){
4134  raw_class="<td class=\"s2\" align=\"center\">";
4135  raw_class1="<td class=\"s6\" align=\"center\">";
4136  }else{
4137  raw_class="<td class=\"s3\" align=\"center\">";
4138  raw_class1="<td class=\"s7\" align=\"center\">";
4139  }
4140  const CellDB db;
4141  const CellDB ce = db.find("Eta", Eta[2][i]).find("Phi", Phi[2][i]).find("Depth", Depth[2][i]);
4142  // if (ce.size()==0) {cout<<"Error: No such Eta="<< Eta[2][i] <<", Phi="<< Phi[2][i] <<", Depth="<< Depth[2][i] <<" in database"<<endl;continue;}
4143 // else if (ce.size()>1) { cout<<"Warning: More than one line correspond to such Eta="<< Eta[2][i] <<", Phi="<< Phi[2][i] <<", Depth="<< Depth[2][i] <<" in database"<<endl;}
4144 
4145  if (ce.size()>=1) {
4146  htmlFile << "<tr>"<< std::endl;
4147  htmlFile << "<td class=\"s1\" align=\"center\">" << ind+1 <<"</td>"<< std::endl;
4148  htmlFile << raw_class<< Eta[2][i]<<"</td>"<< std::endl;
4149  htmlFile << raw_class<< Phi[2][i]<<"</td>"<< std::endl;
4150  htmlFile << raw_class<< Depth[2][i] <<"</td>"<< std::endl;
4151  htmlFile << raw_class<< ce[0].RBX <<"</td>"<< std::endl;
4152  htmlFile << raw_class<< ce[0].RM <<"</td>"<< std::endl;
4153  htmlFile << raw_class<< ce[0].Pixel <<"</td>"<< std::endl;
4154  htmlFile << raw_class<< ce[0].RMfiber <<"</td>"<< std::endl;
4155  htmlFile << raw_class<< ce[0].FiberCh <<"</td>"<< std::endl;
4156  htmlFile << raw_class<< ce[0].QIE <<"</td>"<< std::endl;
4157  htmlFile << raw_class<< ce[0].ADC<<"</td>"<< std::endl;
4158  htmlFile << raw_class<< ce[0].VMECardID <<"</td>"<< std::endl;
4159  htmlFile << raw_class<< ce[0].dccID <<"</td>"<< std::endl;
4160  htmlFile << raw_class<< ce[0].Spigot <<"</td>"<< std::endl;
4161  htmlFile << raw_class<< ce[0].FiberIndex <<"</td>"<< std::endl;
4162  htmlFile << raw_class<< ce[0].HtrSlot <<"</td>"<< std::endl;
4163  htmlFile << raw_class<< ce[0].HtrTB <<"</td>"<< std::endl;
4164  htmlFile << raw_class1<< Comment[2][i]<<"</td>"<< std::endl;
4165  htmlFile << "</tr>" << std::endl;
4166 
4167  ind+=1;
4168  }
4169  } /// end loop
4170 */
4171  htmlFile << "</table>" << std::endl;
4172  htmlFile << "<br>" << std::endl;
4173  /*
4174  htmlFile << "<h3> 2.C.List of Gain unstable channels </h3>"<< std::endl;
4175  //htmlFile << " <td><a href=\"HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
4176  // htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"<<runnumber<<"/HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
4177  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
4178 
4179  htmlFile << "<table>"<< std::endl;
4180  htmlFile << "<tr>";
4181  htmlFile << "<td class=\"s4\" align=\"center\">#</td>" << std::endl;
4182  htmlFile << "<td class=\"s1\" align=\"center\">ETA</td>" << std::endl;
4183  htmlFile << "<td class=\"s1\" align=\"center\">PHI</td>" << std::endl;
4184  htmlFile << "<td class=\"s1\" align=\"center\">DEPTH</td>"<< std::endl;
4185  htmlFile << "<td class=\"s1\" align=\"center\">RBX</td>" << std::endl;
4186  htmlFile << "<td class=\"s1\" align=\"center\">RM</td>" << std::endl;
4187  htmlFile << "<td class=\"s1\" align=\"center\">PIXEL</td>" << std::endl;
4188  htmlFile << "<td class=\"s1\" align=\"center\">RM_FIBER</td>" << std::endl;
4189  htmlFile << "<td class=\"s1\" align=\"center\">FIBER_CH</td>" << std::endl;
4190  htmlFile << "<td class=\"s1\" align=\"center\">QIE</td>" << std::endl;
4191  htmlFile << "<td class=\"s1\" align=\"center\">ADC</td>" << std::endl;
4192  htmlFile << "<td class=\"s1\" align=\"center\">CRATE</td>" << std::endl;
4193  htmlFile << "<td class=\"s1\" align=\"center\">DCC</td>" << std::endl;
4194  htmlFile << "<td class=\"s1\" align=\"center\">SPIGOT</td>" << std::endl;
4195  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FIBER</td>" << std::endl;
4196  htmlFile << "<td class=\"s1\" align=\"center\">HTR_SLOT</td>" << std::endl;
4197  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FPGA</td>" << std::endl;
4198  htmlFile << "<td class=\"s5\" align=\"center\">Failed criteria</td>" << std::endl;
4199  htmlFile << "</tr>" << std::endl;
4200 
4201  for (int i=1;i<=NWarn;i++) {
4202  if((ind%2)==1){
4203  raw_class="<td class=\"s2\" align=\"center\">";
4204  raw_class1="<td class=\"s6\" align=\"center\">";
4205  }else{
4206  raw_class="<td class=\"s3\" align=\"center\">";
4207  raw_class1="<td class=\"s7\" align=\"center\">";
4208  }
4209  const CellDB db;
4210  const CellDB ce = db.find("Eta", Eta[1][i]).find("Phi", Phi[1][i]).find("Depth", Depth[1][i]);
4211  // if (ce.size()==0) {cout<<"Error: No such Eta="<< Eta[1][i] <<", Phi="<< Phi[1][i] <<", Depth="<< Depth[1][i] <<" in database"<<endl;continue;}
4212 // else if (ce.size()>1) { cout<<"Warning: More than one line correspond to such Eta="<< Eta[1][i] <<", Phi="<< Phi[1][i] <<", Depth="<< Depth[1][i] <<" in database"<<endl;}
4213 
4214  if (ce.size()>=1) {
4215  htmlFile << "<tr>"<< std::endl;
4216  htmlFile << "<td class=\"s1\" align=\"center\">" << ind+1 <<"</td>"<< std::endl;
4217  htmlFile << raw_class<< Eta[1][i]<<"</td>"<< std::endl;
4218  htmlFile << raw_class<< Phi[1][i]<<"</td>"<< std::endl;
4219  htmlFile << raw_class<< Depth[1][i] <<"</td>"<< std::endl;
4220  htmlFile << raw_class<< ce[0].RBX <<"</td>"<< std::endl;
4221  htmlFile << raw_class<< ce[0].RM <<"</td>"<< std::endl;
4222  htmlFile << raw_class<< ce[0].Pixel <<"</td>"<< std::endl;
4223  htmlFile << raw_class<< ce[0].RMfiber <<"</td>"<< std::endl;
4224  htmlFile << raw_class<< ce[0].FiberCh <<"</td>"<< std::endl;
4225  htmlFile << raw_class<< ce[0].QIE <<"</td>"<< std::endl;
4226  htmlFile << raw_class<< ce[0].ADC<<"</td>"<< std::endl;
4227  htmlFile << raw_class<< ce[0].VMECardID <<"</td>"<< std::endl;
4228  htmlFile << raw_class<< ce[0].dccID <<"</td>"<< std::endl;
4229  htmlFile << raw_class<< ce[0].Spigot <<"</td>"<< std::endl;
4230  htmlFile << raw_class<< ce[0].FiberIndex <<"</td>"<< std::endl;
4231  htmlFile << raw_class<< ce[0].HtrSlot <<"</td>"<< std::endl;
4232  htmlFile << raw_class<< ce[0].HtrTB <<"</td>"<< std::endl;
4233  htmlFile << raw_class1<< Comment[1][i]<<"</td>"<< std::endl;
4234  htmlFile << "</tr>" << std::endl;
4235 
4236  ind+=1;
4237  }
4238  }
4239 
4240 
4241  htmlFile << "</table>" << std::endl;
4242  htmlFile << "<br>"<< std::endl;
4243 
4244 
4245  htmlFile << "<h3> 2.D.List of channels with bad Pedestals </h3>"<< std::endl;
4246  // htmlFile << " <td><a href=\"HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
4247  // htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"<<runnumber<<"/HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
4248  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
4249 
4250  htmlFile << "<table>"<< std::endl;
4251  htmlFile << "<tr>";
4252  htmlFile << "<td class=\"s4\" align=\"center\">#</td>" << std::endl;
4253  htmlFile << "<td class=\"s1\" align=\"center\">ETA</td>" << std::endl;
4254  htmlFile << "<td class=\"s1\" align=\"center\">PHI</td>" << std::endl;
4255  htmlFile << "<td class=\"s1\" align=\"center\">DEPTH</td>"<< std::endl;
4256  htmlFile << "<td class=\"s1\" align=\"center\">RBX</td>" << std::endl;
4257  htmlFile << "<td class=\"s1\" align=\"center\">RM</td>" << std::endl;
4258  htmlFile << "<td class=\"s1\" align=\"center\">PIXEL</td>" << std::endl;
4259  htmlFile << "<td class=\"s1\" align=\"center\">RM_FIBER</td>" << std::endl;
4260  htmlFile << "<td class=\"s1\" align=\"center\">FIBER_CH</td>" << std::endl;
4261  htmlFile << "<td class=\"s1\" align=\"center\">QIE</td>" << std::endl;
4262  htmlFile << "<td class=\"s1\" align=\"center\">ADC</td>" << std::endl;
4263  htmlFile << "<td class=\"s1\" align=\"center\">CRATE</td>" << std::endl;
4264  htmlFile << "<td class=\"s1\" align=\"center\">DCC</td>" << std::endl;
4265  htmlFile << "<td class=\"s1\" align=\"center\">SPIGOT</td>" << std::endl;
4266  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FIBER</td>" << std::endl;
4267  htmlFile << "<td class=\"s1\" align=\"center\">HTR_SLOT</td>" << std::endl;
4268  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FPGA</td>" << std::endl;
4269  htmlFile << "<td class=\"s5\" align=\"center\">Failed criteria</td>" << std::endl;
4270  htmlFile << "</tr>" << std::endl;
4271 
4272  for (int i=1;i<=NPed;i++) {
4273  if((ind%2)==1){
4274  raw_class="<td class=\"s2\" align=\"center\">";
4275  raw_class1="<td class=\"s6\" align=\"center\">";
4276  }else{
4277  raw_class="<td class=\"s3\" align=\"center\">";
4278  raw_class1="<td class=\"s7\" align=\"center\">";
4279  }
4280  const CellDB db;
4281  const CellDB ce = db.find("Eta", Eta[3][i]).find("Phi", Phi[3][i]).find("Depth", Depth[3][i]);
4282  // if (ce.size()==0) {cout<<"Error: No such Eta="<< Eta[3][i] <<", Phi="<< Phi[3][i] <<", Depth="<< Depth[3][i] <<" in database"<<endl;continue;}
4283 // else if (ce.size()>1) { cout<<"Warning: More than one line correspond to such Eta="<< Eta[1][i] <<", Phi="<< Phi[1][i] <<", Depth="<< Depth[1][i] <<" in database"<<endl;}
4284 
4285  if (ce.size()>=1) {
4286  htmlFile << "<tr>"<< std::endl;
4287  htmlFile << "<td class=\"s1\" align=\"center\">" << ind+1 <<"</td>"<< std::endl;
4288  htmlFile << raw_class<< Eta[3][i]<<"</td>"<< std::endl;
4289  htmlFile << raw_class<< Phi[3][i]<<"</td>"<< std::endl;
4290  htmlFile << raw_class<< Depth[3][i] <<"</td>"<< std::endl;
4291  htmlFile << raw_class<< ce[0].RBX <<"</td>"<< std::endl;
4292  htmlFile << raw_class<< ce[0].RM <<"</td>"<< std::endl;
4293  htmlFile << raw_class<< ce[0].Pixel <<"</td>"<< std::endl;
4294  htmlFile << raw_class<< ce[0].RMfiber <<"</td>"<< std::endl;
4295  htmlFile << raw_class<< ce[0].FiberCh <<"</td>"<< std::endl;
4296  htmlFile << raw_class<< ce[0].QIE <<"</td>"<< std::endl;
4297  htmlFile << raw_class<< ce[0].ADC<<"</td>"<< std::endl;
4298  htmlFile << raw_class<< ce[0].VMECardID <<"</td>"<< std::endl;
4299  htmlFile << raw_class<< ce[0].dccID <<"</td>"<< std::endl;
4300  htmlFile << raw_class<< ce[0].Spigot <<"</td>"<< std::endl;
4301  htmlFile << raw_class<< ce[0].FiberIndex <<"</td>"<< std::endl;
4302  htmlFile << raw_class<< ce[0].HtrSlot <<"</td>"<< std::endl;
4303  htmlFile << raw_class<< ce[0].HtrTB <<"</td>"<< std::endl;
4304  htmlFile << raw_class1<< Comment[3][i]<<"</td>"<< std::endl;
4305  htmlFile << "</tr>" << std::endl;
4306 
4307  ind+=1;
4308  }
4309  }
4310 
4311 
4312  htmlFile << "</table>" << std::endl;
4313 */
4314  htmlFile << "</body> " << std::endl;
4315  htmlFile << "</html> " << std::endl;
4316  htmlFile.close();
4317  //======================================================================
4318 
4319  //======================================================================
4320  // Close and delete all possible things:
4321  hfile->Close();
4322  // hfile->Delete();
4323  // Exit Root
4324  gSystem->Exit(0);
4325  //======================================================================
4326 }
cmsBatch.argv
argv
Definition: cmsBatch.py:279
mps_fire.i
i
Definition: mps_fire.py:428
electronHcalTowerIsolationLcone_cfi.Depth
Depth
Definition: electronHcalTowerIsolationLcone_cfi.py:9
dir2webdir.argc
argc
Definition: dir2webdir.py:39
gather_cfg.cout
cout
Definition: gather_cfg.py:144
test
Definition: SmallWORMDict.h:13
ctpps_dqm_sourceclient-live_cfg.test
test
Definition: ctpps_dqm_sourceclient-live_cfg.py:7
str
#define str(s)
Definition: TestProcessor.cc:51
VtxSmearedParameters_cfi.Phi
Phi
Definition: VtxSmearedParameters_cfi.py:112
dqmdumpme.k
k
Definition: dqmdumpme.py:60
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
main
int main(int argc, char *argv[])
Definition: RemoteMonitoringMAP_Global.cc:33
LogEleMapdb.h
cond::runnumber
Definition: Time.h:19
HLT_FULL_cff.cap
cap
Definition: HLT_FULL_cff.py:6332
alignmentValidation.fname
string fname
main script
Definition: alignmentValidation.py:959
std
Definition: JetResolutionObject.h:76
TTT
TrackTransientTrack TTT
Definition: TransientTrack.cc:9
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66