CMS 3D CMS Logo

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

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Prepare maps of good/bad channels:

Definition at line 35 of file RemoteMonitoringMAP_Global.cc.

References gather_cfg::cout, alignmentValidation::fname, mps_fire::i, dqmiolumiharvest::j, isotrackApplyRegressor::k, cond::runnumber, str, AlCaHLTBitMon_QueryRunRegistry::string, and ctpps_dqm_sourceclient-live_cfg::test.

35  {
36  gROOT->Reset();
37  gROOT->SetStyle("Plain");
38  gStyle->SetOptStat(0);
39  gStyle->SetOptTitle(1);
40 
41  if (argc < 2)
42  return 1;
43  char fname[300];
44  char refname[300];
45  sprintf(fname, "%s", argv[1]);
46  sprintf(refname, "%s", argv[2]);
47 
48  cout << fname << " " << refname << std::endl;
49 
50  //
51 
52  //======================================================================
53  // Connect the input files, parameters and get the 2-d histogram in memory
54  // TFile *hfile= new TFile("GlobalHist.root", "READ");
55  string promt = (string)fname;
56  string runnumber = "";
57  for (unsigned int i = promt.size() - 11; i < promt.size() - 5; i++)
58  runnumber += fname[i];
59  string refrunnumber = "";
60  promt = (string)refname;
61  for (unsigned int i = promt.size() - 11; i < promt.size() - 5; i++)
62  refrunnumber += refname[i];
63 
64  TFile *hfile = new TFile(fname, "READ");
65  TFile *hreffile = new TFile(refname, "READ");
66  //megatile channels
67  //CUTS: [test][subdetector] CapID(Test=1; ADC amplitude Am(Test= 2); Width for Wm(Test=3); Ratio cut for Rm(Test=4); TS mean for TNm(test=5); TS max for TXm(Test=6);
68  double MIN_M[7][5] = {{0., 0., 0., 0., 0.},
69  {0., 0., 0., 0., 0.},
70  {0, 0., 0., 0., 0.},
71  {0, 1.0, 1.0, 0.2, 0.1},
72  {0, 0.10, 0.10, 0.18, 0.30},
73  {0, 0.8, 0.8, 0.8, 0.1},
74  {0, -0.5, -0.5, -0.5, -0.5}};
75  double MAX_M[7][5] = {{0., 0., 0., 0., 0.},
76  {0., 0., 0., 0., 0.},
77  {0, 900, 900, 9000, 3000},
78  {0, 3.9, 3.9, 4.4, 2.0},
79  {0, 0.95, 0.98, 0.96, 1.04},
80  {0, 8.0, 8.0, 8.0, 2.8},
81  {0, 6.5, 6.5, 6.5, 3.5}};
82 
83  // calibration channels:
84  double MIN_C[7][5] = {{0., 0., 0., 0., 0.},
85  {0., 0., 0., 0., 0.},
86  {0, 120., 120., 120., 60.},
87  {0, 1.0, 1.0, 0.50, 0.2},
88  {0, 0.6, 0.64, 0.25, 0.25},
89  {0, 1.0, 1.0, 1.0, 1.0},
90  {0, 0.5, 0.5, 0.5, 0.5}};
91  double MAX_C[7][5] = {{0., 0., 0., 0., 0.},
92  {0., 0., 0., 0., 0.},
93  {0, 1E20, 1E20, 1E20, 1E20},
94  {0, 2.3, 2.3, 3.0, 2.3},
95  {0, 1., 1., 1., 1.00},
96  {0, 5.5, 5.5, 3.5, 5.2},
97  {0, 8.5, 8.5, 8.5, 9.5}};
98  double porog[5] = {0., 2., 2., 5., 1.}; // Cut for GS test in pro cents
99  // double porog[5] = {0., 200., 200., 100., 100.}; // Cut for GS test in pro cents
100  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
101  //======================================================================
102  //======================================================================
103  // Prepare histograms and plot them to .png files
104 
105  //TCanvas *cHB = new TCanvas("cHB","cHB",1000,500);
106  TCanvas *cHB = new TCanvas("cHB", "cHB", 1000, 1000);
107  //TCanvas *cHE = new TCanvas("cHE","cHE",1500,500);
108  TCanvas *cHE = new TCanvas("cHE", "cHE", 1500, 1500);
109  // TCanvas *cONE = new TCanvas("cONE","cONE",500,500);
110  TCanvas *cONE = new TCanvas("cONE", "cONE", 1500, 500);
111  TCanvas *cPED = new TCanvas("cPED", "cPED", 1000, 500);
112  //TCanvas *cHF = new TCanvas("cHF","cHF",1000,1000);
113  TCanvas *cHF = new TCanvas("cHF", "cHF", 1000, 1000);
114 
115  char *str = (char *)alloca(10000);
116 
117  // before upgrade 2017:
118  // depth: HB depth1,2; HE depth1,2,3; HO depth4; HF depth1,2
119  // 5 depthes: 0(empty), 1,2,3,4
120 
121  // upgrade 2017:
122  // depth: HB depth1,2; HE depth1,2,3,4,5,6,7; HO depth4; HF depth1,2,3,4
123  // 8 depthes: 0(empty), 1,2,3,4,5,6,7
124 
125  // upgrade 2019:
126  // depth: HB depth1,2,3,4; HE depth1,2,3,4,5,6,7; HO depth4; HF depth1,2,3,4
127  // 10 depthes: 0(empty), 1,2,3,4,5,6,7,8,9
128 
129  // Int_t ALLDEPTH = 5;
130  // Int_t ALLDEPTH = 8;
131  Int_t ALLDEPTH = 10;
132  //massive_indx=1 2 3 4 5
133  // 0, HB,HE,HO,HF
134  int k_min[5] = {0, 1, 1, 4, 1}; // minimum depth for each subdet
135 
136  //int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
137  //int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
138  int k_max[5] = {0, 4, 7, 4, 4}; // maximum depth for each subdet
139 
140  TH2F *Map_Ampl[33][5][ALLDEPTH]; // 2D histogramm for test,subdet,depth
141  TH2F *Map_SUBGOOD[5][ALLDEPTH]; // 2d histogramm for subdet, depth
142  TH2F *Map_SUB[5][ALLDEPTH]; // 2d histogramm for subdet, depth
143  TH1F *HistAmplDepth[22][5][ALLDEPTH]; // 1d histogramm for test,subdet, depth
144  TH1F *HistAmpl[22][5]; // 1d histogramm for test,subdet
145  TH2F *Map_SUBTS[5][ALLDEPTH]; // 2d histogramm for subdet, depth in different TSs
146 
147  TH1F *HistPed[3][5][4]; // 1d histogramm for test,subdet, CapID
148  TH2F *Map_Ped[3][5]; // 2d histogramm for test,subdet -> test 33
149  TH1F *hist_GoodTSshape[5]; // 1d histogramm for TS shape subdet -> test 41
150  TH1F *hist_GoodTSshape0[5]; // 1d histogramm for TS shape subdet -> test 41
151  TH1F *hist_BadTSshape[5]; // 1d histogramm for TS shape subdet -> test 41
152  TH1F *hist_BadTSshape0[5]; // 1d histogramm for TS shape subdet -> test 41
153  TH1F *hist_ADC_All[5]; // 1d histogramm for TS shape subdet -> test 42
154  TH1F *hist_ADC_DS[5][ALLDEPTH]; // 1d histogramm for TS shape subdet, depth -> test 42
155  TH1F *hist_SumADC[5][ALLDEPTH]; // 1d histogramm for TS shape subdet, depth -> test 43
156  TH1F *hist_SumADC0[5][ALLDEPTH]; // 1d histogramm for TS shape subdet, depth -> test 43
157  TH1F *hist_SumADC1[5][ALLDEPTH]; // 1d histogramm for TS shape subdet, depth -> test 43
158 
159  Map_SUB[1][1] = (TH2F *)hfile->Get("h_mapDepth1_HB");
160  Map_SUB[1][2] = (TH2F *)hfile->Get("h_mapDepth2_HB");
161  Map_SUB[1][3] = (TH2F *)hfile->Get("h_mapDepth3_HB");
162  Map_SUB[1][4] = (TH2F *)hfile->Get("h_mapDepth4_HB");
163  Map_SUB[2][1] = (TH2F *)hfile->Get("h_mapDepth1_HE");
164  Map_SUB[2][2] = (TH2F *)hfile->Get("h_mapDepth2_HE");
165  Map_SUB[2][3] = (TH2F *)hfile->Get("h_mapDepth3_HE");
166  Map_SUB[2][4] = (TH2F *)hfile->Get("h_mapDepth4_HE");
167  Map_SUB[2][5] = (TH2F *)hfile->Get("h_mapDepth5_HE");
168  Map_SUB[2][6] = (TH2F *)hfile->Get("h_mapDepth6_HE");
169  Map_SUB[2][7] = (TH2F *)hfile->Get("h_mapDepth7_HE");
170  Map_SUB[3][4] = (TH2F *)hfile->Get("h_mapDepth4_HO");
171  Map_SUB[4][1] = (TH2F *)hfile->Get("h_mapDepth1_HF");
172  Map_SUB[4][2] = (TH2F *)hfile->Get("h_mapDepth2_HF");
173  Map_SUB[4][3] = (TH2F *)hfile->Get("h_mapDepth3_HF");
174  Map_SUB[4][4] = (TH2F *)hfile->Get("h_mapDepth4_HF");
175 
176  Map_SUBGOOD[1][1] = (TH2F *)hfile->Get("h_mapDepth1_HB");
177  Map_SUBGOOD[1][2] = (TH2F *)hfile->Get("h_mapDepth2_HB");
178  Map_SUBGOOD[1][3] = (TH2F *)hfile->Get("h_mapDepth3_HB");
179  Map_SUBGOOD[1][4] = (TH2F *)hfile->Get("h_mapDepth4_HB");
180  Map_SUBGOOD[2][1] = (TH2F *)hfile->Get("h_mapDepth1_HE");
181  Map_SUBGOOD[2][2] = (TH2F *)hfile->Get("h_mapDepth2_HE");
182  Map_SUBGOOD[2][3] = (TH2F *)hfile->Get("h_mapDepth3_HE");
183  Map_SUBGOOD[2][4] = (TH2F *)hfile->Get("h_mapDepth4_HE");
184  Map_SUBGOOD[2][5] = (TH2F *)hfile->Get("h_mapDepth5_HE");
185  Map_SUBGOOD[2][6] = (TH2F *)hfile->Get("h_mapDepth6_HE");
186  Map_SUBGOOD[2][7] = (TH2F *)hfile->Get("h_mapDepth7_HE");
187  Map_SUBGOOD[3][4] = (TH2F *)hfile->Get("h_mapDepth4_HO");
188  Map_SUBGOOD[4][1] = (TH2F *)hfile->Get("h_mapDepth1_HF");
189  Map_SUBGOOD[4][2] = (TH2F *)hfile->Get("h_mapDepth2_HF");
190  Map_SUBGOOD[4][3] = (TH2F *)hfile->Get("h_mapDepth3_HF");
191  Map_SUBGOOD[4][4] = (TH2F *)hfile->Get("h_mapDepth4_HF");
192 
193  //+++++++++++++++++++++++++++++
194  //Test 0 Entries
195  //+++++++++++++++++++++++++++++
196 
197  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
198  // if (sub==1) cHB->Divide(2,1);
199  if (sub == 1)
200  cHB->Divide(2, 2);
201  // if (sub==2) cHE->Divide(3,1);
202  if (sub == 2)
203  cHE->Divide(3, 3);
204  if (sub == 3)
205  cONE->Divide(1, 1);
206  // if (sub==4) cHF->Divide(2,1);
207  if (sub == 4)
208  cHF->Divide(2, 2);
209  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
210  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
211  // int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
212  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
213  if (sub == 1)
214  cHB->cd(k);
215  if (sub == 2)
216  cHE->cd(k);
217  if (sub == 3)
218  cONE->cd(k - 3);
219  if (sub == 4)
220  cHF->cd(k);
221  gPad->SetGridy();
222  gPad->SetGridx();
223  gPad->SetLogz();
224  if (sub == 1)
225  sprintf(str, "HB, Depth%d \b", k);
226  if (sub == 2)
227  sprintf(str, "HE, Depth%d \b", k);
228  if (sub == 3)
229  sprintf(str, "HO, Depth%d \b", k);
230  if (sub == 4)
231  sprintf(str, "HF, Depth%d \b", k);
232  Map_SUB[sub][k]->SetTitle(str);
233  Map_SUB[sub][k]->SetXTitle("#eta \b");
234  Map_SUB[sub][k]->SetYTitle("#phi \b");
235  Map_SUB[sub][k]->SetZTitle("Number of events \b");
236  if (sub == 3)
237  Map_SUB[sub][k]->SetTitleOffset(0.8, "Z");
238  Map_SUB[sub][k]->Draw("COLZ");
239  Map_SUB[sub][k]->GetYaxis()->SetRangeUser(0, 72.);
240  // Map_SUB[sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
241  if (sub == 1) {
242  cHB->Modified();
243  cHB->Update();
244  }
245  if (sub == 2) {
246  cHE->Modified();
247  cHE->Update();
248  }
249  if (sub == 3) {
250  cONE->Modified();
251  cONE->Update();
252  }
253  if (sub == 4) {
254  cHF->Modified();
255  cHF->Update();
256  }
257  } //end depth
258 
259  if (sub == 1) {
260  cHB->Print("MapRateEntryHB.png");
261  cHB->Clear();
262  }
263  if (sub == 2) {
264  cHE->Print("MapRateEntryHE.png");
265  cHE->Clear();
266  }
267  if (sub == 3) {
268  cONE->Print("MapRateEntryHO.png");
269  cONE->Clear();
270  }
271  if (sub == 4) {
272  cHF->Print("MapRateEntryHF.png");
273  cHF->Clear();
274  }
275  } // end sub
276 
277  //+++++++++++++++++++++++++++++
278  //Test 1 (Cm) Rate of Cap ID errors
279  //+++++++++++++++++++++++++++++
280 
281  Map_Ampl[1][1][1] = (TH2F *)hfile->Get("h_mapDepth1Error_HB");
282  Map_Ampl[1][1][2] = (TH2F *)hfile->Get("h_mapDepth2Error_HB");
283  Map_Ampl[1][2][1] = (TH2F *)hfile->Get("h_mapDepth1Error_HE");
284  Map_Ampl[1][2][2] = (TH2F *)hfile->Get("h_mapDepth2Error_HE");
285  Map_Ampl[1][2][3] = (TH2F *)hfile->Get("h_mapDepth3Error_HE");
286  Map_Ampl[1][3][4] = (TH2F *)hfile->Get("h_mapDepth4Error_HO");
287  Map_Ampl[1][4][1] = (TH2F *)hfile->Get("h_mapDepth1Error_HF");
288  Map_Ampl[1][4][2] = (TH2F *)hfile->Get("h_mapDepth2Error_HF");
289 
290  Map_Ampl[1][2][4] = (TH2F *)hfile->Get("h_mapDepth4Error_HE");
291  Map_Ampl[1][2][5] = (TH2F *)hfile->Get("h_mapDepth5Error_HE");
292  Map_Ampl[1][2][6] = (TH2F *)hfile->Get("h_mapDepth6Error_HE");
293  Map_Ampl[1][2][7] = (TH2F *)hfile->Get("h_mapDepth7Error_HE");
294  Map_Ampl[1][4][3] = (TH2F *)hfile->Get("h_mapDepth3Error_HF");
295  Map_Ampl[1][4][4] = (TH2F *)hfile->Get("h_mapDepth4Error_HF");
296 
297  Map_Ampl[1][1][3] = (TH2F *)hfile->Get("h_mapDepth3Error_HB");
298  Map_Ampl[1][1][4] = (TH2F *)hfile->Get("h_mapDepth4Error_HB");
299 
300  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
301  // if (sub==1) cHB->Divide(2,1);
302  if (sub == 1)
303  cHB->Divide(2, 2);
304  // if (sub==2) cHE->Divide(3,1);
305  if (sub == 2)
306  cHE->Divide(3, 3);
307  if (sub == 3)
308  cONE->Divide(1, 1);
309  // if (sub==4) cHF->Divide(2,1);
310  if (sub == 4)
311  cHF->Divide(2, 2);
312  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
313  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
314  // int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
315  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
316  if (sub == 1)
317  cHB->cd(k);
318  if (sub == 2)
319  cHE->cd(k);
320  if (sub == 3)
321  cONE->cd(k - 3);
322  if (sub == 4)
323  cHF->cd(k);
324  Map_Ampl[1][sub][k]->Divide(Map_Ampl[1][sub][k], Map_SUB[sub][k], 1, 1, "B");
325  gPad->SetGridy();
326  gPad->SetGridx();
327  gPad->SetLogz();
328  if (sub == 1)
329  sprintf(str, "HB, Depth%d \b", k);
330  if (sub == 2)
331  sprintf(str, "HE, Depth%d \b", k);
332  if (sub == 3)
333  sprintf(str, "HO, Depth%d \b", k);
334  if (sub == 4)
335  sprintf(str, "HF, Depth%d \b", k);
336  Map_Ampl[1][sub][k]->SetTitle(str);
337  Map_Ampl[1][sub][k]->SetXTitle("#eta \b");
338  Map_Ampl[1][sub][k]->SetYTitle("#phi \b");
339  Map_Ampl[1][sub][k]->SetZTitle("Rate \b");
340  if (sub == 3)
341  Map_Ampl[1][sub][k]->SetTitleOffset(0.8, "Z");
342  Map_Ampl[1][sub][k]->Draw("COLZ");
343  Map_Ampl[1][sub][k]->GetYaxis()->SetRangeUser(0, 72.);
344  Map_Ampl[1][sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
345  if (sub == 1) {
346  cHB->Modified();
347  cHB->Update();
348  }
349  if (sub == 2) {
350  cHE->Modified();
351  cHE->Update();
352  }
353  if (sub == 3) {
354  cONE->Modified();
355  cONE->Update();
356  }
357  if (sub == 4) {
358  cHF->Modified();
359  cHF->Update();
360  }
361  } //end depth
362 
363  if (sub == 1) {
364  cHB->Print("MapRateCapIDHB.png");
365  cHB->Clear();
366  }
367  if (sub == 2) {
368  cHE->Print("MapRateCapIDHE.png");
369  cHE->Clear();
370  }
371  if (sub == 3) {
372  cONE->Print("MapRateCapIDHO.png");
373  cONE->Clear();
374  }
375  if (sub == 4) {
376  cHF->Print("MapRateCapIDHF.png");
377  cHF->Clear();
378  }
379  } // end sub
380 
381  //+++++++++++++++++++++++++++++
382  //Test 2 (Am) ADC amplitude
383  //+++++++++++++++++++++++++++++
384 
385  Map_Ampl[2][1][1] = (TH2F *)hfile->Get("h_mapDepth1ADCAmpl225_HB");
386  Map_Ampl[2][1][2] = (TH2F *)hfile->Get("h_mapDepth2ADCAmpl225_HB");
387  Map_Ampl[2][2][1] = (TH2F *)hfile->Get("h_mapDepth1ADCAmpl225_HE");
388  Map_Ampl[2][2][2] = (TH2F *)hfile->Get("h_mapDepth2ADCAmpl225_HE");
389  Map_Ampl[2][2][3] = (TH2F *)hfile->Get("h_mapDepth3ADCAmpl225_HE");
390  Map_Ampl[2][3][4] = (TH2F *)hfile->Get("h_mapDepth4ADCAmpl225_HO");
391  Map_Ampl[2][4][1] = (TH2F *)hfile->Get("h_mapDepth1ADCAmpl225_HF");
392  Map_Ampl[2][4][2] = (TH2F *)hfile->Get("h_mapDepth2ADCAmpl225_HF");
393 
394  Map_Ampl[2][2][4] = (TH2F *)hfile->Get("h_mapDepth4ADCAmpl225_HE");
395  Map_Ampl[2][2][5] = (TH2F *)hfile->Get("h_mapDepth5ADCAmpl225_HE");
396  Map_Ampl[2][2][6] = (TH2F *)hfile->Get("h_mapDepth6ADCAmpl225_HE");
397  Map_Ampl[2][2][7] = (TH2F *)hfile->Get("h_mapDepth7ADCAmpl225_HE");
398  Map_Ampl[2][4][3] = (TH2F *)hfile->Get("h_mapDepth3ADCAmpl225_HF");
399  Map_Ampl[2][4][4] = (TH2F *)hfile->Get("h_mapDepth4ADCAmpl225_HF");
400 
401  Map_Ampl[2][1][3] = (TH2F *)hfile->Get("h_mapDepth3ADCAmpl225_HB");
402  Map_Ampl[2][1][4] = (TH2F *)hfile->Get("h_mapDepth4ADCAmpl225_HB");
403 
404  HistAmpl[2][1] = (TH1F *)hfile->Get("h_ADCAmpl_HB");
405  HistAmpl[2][2] = (TH1F *)hfile->Get("h_ADCAmpl_HE");
406  HistAmpl[2][3] = (TH1F *)hfile->Get("h_ADCAmpl_HO");
407  HistAmpl[2][4] = (TH1F *)hfile->Get("h_ADCAmpl_HF");
408 
409  //+++++++++++++++++++++++++++++
410  //Test 3 (Wm) Rate of RMS
411  //+++++++++++++++++++++++++++++
412 
413  Map_Ampl[3][1][1] = (TH2F *)hfile->Get("h_mapDepth1Amplitude225_HB");
414  Map_Ampl[3][1][2] = (TH2F *)hfile->Get("h_mapDepth2Amplitude225_HB");
415  Map_Ampl[3][2][1] = (TH2F *)hfile->Get("h_mapDepth1Amplitude225_HE");
416  Map_Ampl[3][2][2] = (TH2F *)hfile->Get("h_mapDepth2Amplitude225_HE");
417  Map_Ampl[3][2][3] = (TH2F *)hfile->Get("h_mapDepth3Amplitude225_HE");
418  Map_Ampl[3][3][4] = (TH2F *)hfile->Get("h_mapDepth4Amplitude225_HO");
419  Map_Ampl[3][4][1] = (TH2F *)hfile->Get("h_mapDepth1Amplitude225_HF");
420  Map_Ampl[3][4][2] = (TH2F *)hfile->Get("h_mapDepth2Amplitude225_HF");
421 
422  Map_Ampl[3][2][4] = (TH2F *)hfile->Get("h_mapDepth4Amplitude225_HE");
423  Map_Ampl[3][2][5] = (TH2F *)hfile->Get("h_mapDepth5Amplitude225_HE");
424  Map_Ampl[3][2][6] = (TH2F *)hfile->Get("h_mapDepth6Amplitude225_HE");
425  Map_Ampl[3][2][7] = (TH2F *)hfile->Get("h_mapDepth7Amplitude225_HE");
426  Map_Ampl[3][4][3] = (TH2F *)hfile->Get("h_mapDepth3Amplitude225_HF");
427  Map_Ampl[3][4][4] = (TH2F *)hfile->Get("h_mapDepth4Amplitude225_HF");
428 
429  Map_Ampl[3][1][3] = (TH2F *)hfile->Get("h_mapDepth3Amplitude225_HB");
430  Map_Ampl[3][1][4] = (TH2F *)hfile->Get("h_mapDepth4Amplitude225_HB");
431 
432  HistAmpl[3][1] = (TH1F *)hfile->Get("h_Amplitude_HB");
433  HistAmpl[3][2] = (TH1F *)hfile->Get("h_Amplitude_HE");
434  HistAmpl[3][3] = (TH1F *)hfile->Get("h_Amplitude_HO");
435  HistAmpl[3][4] = (TH1F *)hfile->Get("h_Amplitude_HF");
436 
437  //+++++++++++++++++++++++++++++
438  //Test 4 (Rm) Rate of ratio 4 near max TS/ All TS
439  //+++++++++++++++++++++++++++++
440 
441  Map_Ampl[4][1][1] = (TH2F *)hfile->Get("h_mapDepth1Ampl047_HB");
442  Map_Ampl[4][1][2] = (TH2F *)hfile->Get("h_mapDepth2Ampl047_HB");
443  Map_Ampl[4][2][1] = (TH2F *)hfile->Get("h_mapDepth1Ampl047_HE");
444  Map_Ampl[4][2][2] = (TH2F *)hfile->Get("h_mapDepth2Ampl047_HE");
445  Map_Ampl[4][2][3] = (TH2F *)hfile->Get("h_mapDepth3Ampl047_HE");
446  Map_Ampl[4][3][4] = (TH2F *)hfile->Get("h_mapDepth4Ampl047_HO");
447  Map_Ampl[4][4][1] = (TH2F *)hfile->Get("h_mapDepth1Ampl047_HF");
448  Map_Ampl[4][4][2] = (TH2F *)hfile->Get("h_mapDepth2Ampl047_HF");
449 
450  Map_Ampl[4][2][4] = (TH2F *)hfile->Get("h_mapDepth4Ampl047_HE");
451  Map_Ampl[4][2][5] = (TH2F *)hfile->Get("h_mapDepth5Ampl047_HE");
452  Map_Ampl[4][2][6] = (TH2F *)hfile->Get("h_mapDepth6Ampl047_HE");
453  Map_Ampl[4][2][7] = (TH2F *)hfile->Get("h_mapDepth7Ampl047_HE");
454  Map_Ampl[4][4][3] = (TH2F *)hfile->Get("h_mapDepth3Ampl047_HF");
455  Map_Ampl[4][4][4] = (TH2F *)hfile->Get("h_mapDepth4Ampl047_HF");
456 
457  Map_Ampl[4][1][3] = (TH2F *)hfile->Get("h_mapDepth3Ampl047_HB");
458  Map_Ampl[4][1][4] = (TH2F *)hfile->Get("h_mapDepth4Ampl047_HB");
459 
460  HistAmpl[4][1] = (TH1F *)hfile->Get("h_Ampl_HB");
461  HistAmpl[4][2] = (TH1F *)hfile->Get("h_Ampl_HE");
462  HistAmpl[4][3] = (TH1F *)hfile->Get("h_Ampl_HO");
463  HistAmpl[4][4] = (TH1F *)hfile->Get("h_Ampl_HF");
464 
465  //+++++++++++++++++++++++++++++
466  //Test 5 (TNm) Mean position in 1-8 TS range
467  //+++++++++++++++++++++++++++++
468 
469  Map_Ampl[5][1][1] = (TH2F *)hfile->Get("h_mapDepth1TSmeanA225_HB");
470  Map_Ampl[5][1][2] = (TH2F *)hfile->Get("h_mapDepth2TSmeanA225_HB");
471  Map_Ampl[5][2][1] = (TH2F *)hfile->Get("h_mapDepth1TSmeanA225_HE");
472  Map_Ampl[5][2][2] = (TH2F *)hfile->Get("h_mapDepth2TSmeanA225_HE");
473  Map_Ampl[5][2][3] = (TH2F *)hfile->Get("h_mapDepth3TSmeanA225_HE");
474  Map_Ampl[5][3][4] = (TH2F *)hfile->Get("h_mapDepth4TSmeanA225_HO");
475  Map_Ampl[5][4][1] = (TH2F *)hfile->Get("h_mapDepth1TSmeanA225_HF");
476  Map_Ampl[5][4][2] = (TH2F *)hfile->Get("h_mapDepth2TSmeanA225_HF");
477 
478  Map_Ampl[5][2][4] = (TH2F *)hfile->Get("h_mapDepth4TSmeanA225_HE");
479  Map_Ampl[5][2][5] = (TH2F *)hfile->Get("h_mapDepth5TSmeanA225_HE");
480  Map_Ampl[5][2][6] = (TH2F *)hfile->Get("h_mapDepth6TSmeanA225_HE");
481  Map_Ampl[5][2][7] = (TH2F *)hfile->Get("h_mapDepth7TSmeanA225_HE");
482  Map_Ampl[5][4][3] = (TH2F *)hfile->Get("h_mapDepth3TSmeanA225_HF");
483  Map_Ampl[5][4][4] = (TH2F *)hfile->Get("h_mapDepth4TSmeanA225_HF");
484 
485  Map_Ampl[5][1][3] = (TH2F *)hfile->Get("h_mapDepth3TSmeanA225_HB");
486  Map_Ampl[5][1][4] = (TH2F *)hfile->Get("h_mapDepth4TSmeanA225_HB");
487 
488  HistAmpl[5][1] = (TH1F *)hfile->Get("h_TSmeanA_HB");
489  HistAmpl[5][2] = (TH1F *)hfile->Get("h_TSmeanA_HE");
490  HistAmpl[5][3] = (TH1F *)hfile->Get("h_TSmeanA_HO");
491  HistAmpl[5][4] = (TH1F *)hfile->Get("h_TSmeanA_HF");
492 
493  //+++++++++++++++++++++++++++++
494  //Test 6 (TXm) Maximum position in 1-8 TS range
495  //+++++++++++++++++++++++++++++
496 
497  Map_Ampl[6][1][1] = (TH2F *)hfile->Get("h_mapDepth1TSmaxA225_HB");
498  Map_Ampl[6][1][2] = (TH2F *)hfile->Get("h_mapDepth2TSmaxA225_HB");
499  Map_Ampl[6][2][1] = (TH2F *)hfile->Get("h_mapDepth1TSmaxA225_HE");
500  Map_Ampl[6][2][2] = (TH2F *)hfile->Get("h_mapDepth2TSmaxA225_HE");
501  Map_Ampl[6][2][3] = (TH2F *)hfile->Get("h_mapDepth3TSmaxA225_HE");
502  Map_Ampl[6][3][4] = (TH2F *)hfile->Get("h_mapDepth4TSmaxA225_HO");
503  Map_Ampl[6][4][1] = (TH2F *)hfile->Get("h_mapDepth1TSmaxA225_HF");
504  Map_Ampl[6][4][2] = (TH2F *)hfile->Get("h_mapDepth2TSmaxA225_HF");
505 
506  Map_Ampl[6][2][4] = (TH2F *)hfile->Get("h_mapDepth4TSmaxA225_HE");
507  Map_Ampl[6][2][5] = (TH2F *)hfile->Get("h_mapDepth5TSmaxA225_HE");
508  Map_Ampl[6][2][6] = (TH2F *)hfile->Get("h_mapDepth6TSmaxA225_HE");
509  Map_Ampl[6][2][7] = (TH2F *)hfile->Get("h_mapDepth7TSmaxA225_HE");
510  Map_Ampl[6][4][3] = (TH2F *)hfile->Get("h_mapDepth3TSmaxA225_HF");
511  Map_Ampl[6][4][4] = (TH2F *)hfile->Get("h_mapDepth4TSmaxA225_HF");
512 
513  Map_Ampl[6][1][3] = (TH2F *)hfile->Get("h_mapDepth3TSmaxA225_HB");
514  Map_Ampl[6][1][4] = (TH2F *)hfile->Get("h_mapDepth4TSmaxA225_HB");
515 
516  HistAmpl[6][1] = (TH1F *)hfile->Get("h_TSmaxA_HB");
517  HistAmpl[6][2] = (TH1F *)hfile->Get("h_TSmaxA_HE");
518  HistAmpl[6][3] = (TH1F *)hfile->Get("h_TSmaxA_HO");
519  HistAmpl[6][4] = (TH1F *)hfile->Get("h_TSmaxA_HF");
520 
521  for (int test = 2; test <= 6; test++) { //Test: 2-Am, 3-Wm, 4-Rm, 5-TNm, 6-TXm,
522  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
523  // if (sub==1) cHB->Divide(2,1);
524  if (sub == 1)
525  cHB->Divide(2, 2);
526  // if (sub==2) cHE->Divide(3,1);
527  if (sub == 2)
528  cHE->Divide(3, 3);
529  if (sub == 3)
530  cONE->Divide(1, 1);
531  // if (sub==4) cHF->Divide(2,1);
532  if (sub == 4)
533  cHF->Divide(2, 2);
534  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
535  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
536  // int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
537  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
538  if (sub == 1)
539  cHB->cd(k);
540  if (sub == 2)
541  cHE->cd(k);
542  if (sub == 3)
543  cONE->cd(k - 3);
544  if (sub == 4)
545  cHF->cd(k);
546  Map_Ampl[test][sub][k]->Divide(Map_Ampl[test][sub][k], Map_SUB[sub][k], 1, 1, "B");
547  gPad->SetGridy();
548  gPad->SetGridx();
549  gPad->SetLogz();
550  if (sub == 1)
551  sprintf(str, "HB, Depth%d \b", k);
552  if (sub == 2)
553  sprintf(str, "HE, Depth%d \b", k);
554  if (sub == 3)
555  sprintf(str, "HO, Depth%d \b", k);
556  if (sub == 4)
557  sprintf(str, "HF, Depth%d \b", k);
558  Map_Ampl[test][sub][k]->SetTitle(str);
559  Map_Ampl[test][sub][k]->SetXTitle("#eta \b");
560  Map_Ampl[test][sub][k]->SetYTitle("#phi \b");
561  Map_Ampl[test][sub][k]->SetZTitle("Rate \b");
562  if (sub == 3)
563  Map_Ampl[test][sub][k]->SetTitleOffset(0.8, "Z");
564  Map_Ampl[test][sub][k]->Draw("COLZ");
565  Map_Ampl[test][sub][k]->GetYaxis()->SetRangeUser(0, 72.);
566  Map_Ampl[test][sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
567  if (sub == 1) {
568  cHB->Modified();
569  cHB->Update();
570  }
571  if (sub == 2) {
572  cHE->Modified();
573  cHE->Update();
574  }
575  if (sub == 3) {
576  cONE->Modified();
577  cONE->Update();
578  }
579  if (sub == 4) {
580  cHF->Modified();
581  cHF->Update();
582  }
583  } //end depth
584  if (test == 2) {
585  if (sub == 1) {
586  cHB->Print("MapRateAmplHB.png");
587  cHB->Clear();
588  }
589  if (sub == 2) {
590  cHE->Print("MapRateAmplHE.png");
591  cHE->Clear();
592  }
593  if (sub == 3) {
594  cONE->Print("MapRateAmplHO.png");
595  cONE->Clear();
596  }
597  if (sub == 4) {
598  cHF->Print("MapRateAmplHF.png");
599  cHF->Clear();
600  }
601  }
602  if (test == 3) {
603  if (sub == 1) {
604  cHB->Print("MapRateRMSHB.png");
605  cHB->Clear();
606  }
607  if (sub == 2) {
608  cHE->Print("MapRateRMSHE.png");
609  cHE->Clear();
610  }
611  if (sub == 3) {
612  cONE->Print("MapRateRMSHO.png");
613  cONE->Clear();
614  }
615  if (sub == 4) {
616  cHF->Print("MapRateRMSHF.png");
617  cHF->Clear();
618  }
619  }
620  if (test == 4) {
621  if (sub == 1) {
622  cHB->Print("MapRate43TStoAllTSHB.png");
623  cHB->Clear();
624  }
625  if (sub == 2) {
626  cHE->Print("MapRate43TStoAllTSHE.png");
627  cHE->Clear();
628  }
629  if (sub == 3) {
630  cONE->Print("MapRate43TStoAllTSHO.png");
631  cONE->Clear();
632  }
633  if (sub == 4) {
634  cHF->Print("MapRate43TStoAllTSHF.png");
635  cHF->Clear();
636  }
637  }
638  if (test == 5) {
639  if (sub == 1) {
640  cHB->Print("MapRateMeanPosHB.png");
641  cHB->Clear();
642  }
643  if (sub == 2) {
644  cHE->Print("MapRateMeanPosHE.png");
645  cHE->Clear();
646  }
647  if (sub == 3) {
648  cONE->Print("MapRateMeanPosHO.png");
649  cONE->Clear();
650  }
651  if (sub == 4) {
652  cHF->Print("MapRateMeanPosHF.png");
653  cHF->Clear();
654  }
655  }
656  if (test == 6) {
657  if (sub == 1) {
658  cHB->Print("MapRateMaxPosHB.png");
659  cHB->Clear();
660  }
661  if (sub == 2) {
662  cHE->Print("MapRateMaxPosHE.png");
663  cHE->Clear();
664  }
665  if (sub == 3) {
666  cONE->Print("MapRateMaxPosHO.png");
667  cONE->Clear();
668  }
669  if (sub == 4) {
670  cHF->Print("MapRateMaxPosHF.png");
671  cHF->Clear();
672  }
673  }
674 
675  // cONE->Divide(1,1);
676  /*
677  cONE->Divide(2,1);
678  if(test == 2 && sub == 2 ) {
679  cONE->cd(2);
680  TH1F *kjkjkhj2= (TH1F*)hfile->Get("h_ADCAmpl_HE");kjkjkhj2->Draw("");kjkjkhj2->SetTitle("HE, All Depth: shunt6");
681  }
682  if(test == 2 && sub == 1 ) {
683  cONE->cd(2);
684  TH1F *kjkjkhj1= (TH1F*)hfile->Get("h_ADCAmpl_HB");kjkjkhj1->Draw("");kjkjkhj1->SetTitle("HB, All Depth: shunt6");
685  }
686 */
687 
688  cONE->Divide(3, 1);
689  if (test == 2 && sub == 2) {
690  cONE->cd(2);
691  TH1F *kjkjkhj2 = (TH1F *)hfile->Get("h_AmplitudeHEtest1");
692  kjkjkhj2->Draw("");
693  kjkjkhj2->SetTitle("HE, All Depth: shunt1");
694  cONE->cd(3);
695  TH1F *kjkjkhj3 = (TH1F *)hfile->Get("h_AmplitudeHEtest6");
696  kjkjkhj3->Draw("");
697  kjkjkhj3->SetTitle("HE, All Depth: shunt6");
698  }
699  if (test == 2 && sub == 1) {
700  cONE->cd(2);
701  TH1F *kjkjkhb2 = (TH1F *)hfile->Get("h_AmplitudeHBtest1");
702  kjkjkhb2->Draw("");
703  kjkjkhb2->SetTitle("HB, All Depth: shunt1");
704  cONE->cd(3);
705  TH1F *kjkjkhb3 = (TH1F *)hfile->Get("h_AmplitudeHBtest6");
706  kjkjkhb3->Draw("");
707  kjkjkhb3->SetTitle("HB, All Depth: shunt6");
708  }
709 
710  cONE->cd(1);
711  gPad->SetGridy();
712  gPad->SetGridx();
713  gPad->SetLogy();
714  if (sub == 1)
715  HistAmpl[test][sub]->SetTitle("HB, All Depth: shunt6");
716  if (sub == 2)
717  HistAmpl[test][sub]->SetTitle("HE, All Depth: shunt6");
718  if (sub == 3)
719  HistAmpl[test][sub]->SetTitle("HO, All Depth");
720  if (sub == 4)
721  HistAmpl[test][sub]->SetTitle("HF, All Depth");
722  if (test == 2)
723  HistAmpl[test][sub]->SetXTitle("ADC Amlitude in each event & cell \b");
724  if (test == 3)
725  HistAmpl[test][sub]->SetXTitle("RMS in each event & cell \b");
726  if (test == 4)
727  HistAmpl[test][sub]->SetXTitle("Ratio in each event & cell \b");
728  if (test == 5)
729  HistAmpl[test][sub]->SetXTitle("Mean TS position in each event & cell \b");
730  if (test == 6)
731  HistAmpl[test][sub]->SetXTitle("Max TS position in each event & cell \b");
732  HistAmpl[test][sub]->SetYTitle("Number of cell-events \b");
733  HistAmpl[test][sub]->SetLineColor(4);
734  HistAmpl[test][sub]->SetLineWidth(2);
735  HistAmpl[test][sub]->SetTitleOffset(1.4, "Y");
736  HistAmpl[test][sub]->Draw("");
737  // // HistAmpl[test][sub]->GetYaxis()->SetRangeUser(1., 100.);
738  // if (test==2) {gPad->SetLogx(); HistAmpl[test][sub]->GetXaxis()->SetRangeUser(1., 10000.);}
739  if (test == 2) {
740  gPad->SetLogx();
741  }
742  if (test == 3)
743  HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 5.); // width
744  if (test == 4)
745  HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 1.); // R
746  if (test == 5)
747  HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 9.); // Tn
748  if (test == 6)
749  HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 9.); // Tx
750  cONE->Modified();
751  cONE->Update();
752  double min_x[] = {MIN_M[test][sub], MIN_M[test][sub]};
753  double min_y[] = {0., 100000000.};
754  TGraph *MIN = new TGraph(2, min_x, min_y);
755  MIN->SetLineStyle(2);
756  MIN->SetLineColor(2);
757  MIN->SetLineWidth(2 + 100 * 100);
758  MIN->SetFillStyle(3005);
759  MIN->SetFillColor(2);
760  MIN->Draw("L");
761  double max_x[] = {MAX_M[test][sub], MAX_M[test][sub]};
762  double max_y[] = {0., 100000000.};
763  TGraph *MAX = new TGraph(2, max_x, max_y);
764  MAX->SetLineStyle(2);
765  MAX->SetLineColor(2);
766  MAX->SetLineWidth(-2 - 100 * 100);
767  MAX->SetFillStyle(3004);
768  MAX->SetFillColor(2);
769  MAX->Draw("L");
770  if (test == 2) {
771  if (sub == 1) {
772  cONE->Print("HistAmplHB.png");
773  cONE->Clear();
774  }
775  if (sub == 2) {
776  cONE->Print("HistAmplHE.png");
777  cONE->Clear();
778  }
779  if (sub == 3) {
780  cONE->Print("HistAmplHO.png");
781  cONE->Clear();
782  }
783  if (sub == 4) {
784  cONE->Print("HistAmplHF.png");
785  cONE->Clear();
786  }
787  }
788  if (test == 3) {
789  if (sub == 1) {
790  cONE->Print("HistRMSHB.png");
791  cONE->Clear();
792  }
793  if (sub == 2) {
794  cONE->Print("HistRMSHE.png");
795  cONE->Clear();
796  }
797  if (sub == 3) {
798  cONE->Print("HistRMSHO.png");
799  cONE->Clear();
800  }
801  if (sub == 4) {
802  cONE->Print("HistRMSHF.png");
803  cONE->Clear();
804  }
805  }
806  if (test == 4) {
807  if (sub == 1) {
808  cONE->Print("Hist43TStoAllTSHB.png");
809  cONE->Clear();
810  }
811  if (sub == 2) {
812  cONE->Print("Hist43TStoAllTSHE.png");
813  cONE->Clear();
814  }
815  if (sub == 3) {
816  cONE->Print("Hist43TStoAllTSHO.png");
817  cONE->Clear();
818  }
819  if (sub == 4) {
820  cONE->Print("Hist43TStoAllTSHF.png");
821  cONE->Clear();
822  }
823  }
824  if (test == 5) {
825  if (sub == 1) {
826  cONE->Print("HistMeanPosHB.png");
827  cONE->Clear();
828  }
829  if (sub == 2) {
830  cONE->Print("HistMeanPosHE.png");
831  cONE->Clear();
832  }
833  if (sub == 3) {
834  cONE->Print("HistMeanPosHO.png");
835  cONE->Clear();
836  }
837  if (sub == 4) {
838  cONE->Print("HistMeanPosHF.png");
839  cONE->Clear();
840  }
841  }
842  if (test == 6) {
843  if (sub == 1) {
844  cONE->Print("HistMaxPosHB.png");
845  cONE->Clear();
846  }
847  if (sub == 2) {
848  cONE->Print("HistMaxPosHE.png");
849  cONE->Clear();
850  }
851  if (sub == 3) {
852  cONE->Print("HistMaxPosHO.png");
853  cONE->Clear();
854  }
855  if (sub == 4) {
856  cONE->Print("HistMaxPosHF.png");
857  cONE->Clear();
858  }
859  }
860  } // end sub
861  } //end test
862 
863  //+++++++++++++++++++++++++++++++++++
864  //Test 31, 32 Pedestal, pedestalWidths
865  //++++++++++++++++++++++++++++++++++++
866 
867  Map_Ampl[31][1][1] = (TH2F *)hfile->Get("h_mapDepth1pedestal_HB");
868  Map_Ampl[31][1][2] = (TH2F *)hfile->Get("h_mapDepth2pedestal_HB");
869  Map_Ampl[31][1][3] = (TH2F *)hfile->Get("h_mapDepth3pedestal_HB");
870  Map_Ampl[31][1][4] = (TH2F *)hfile->Get("h_mapDepth4pedestal_HB");
871  Map_Ampl[31][2][1] = (TH2F *)hfile->Get("h_mapDepth1pedestal_HE");
872  Map_Ampl[31][2][2] = (TH2F *)hfile->Get("h_mapDepth2pedestal_HE");
873  Map_Ampl[31][2][3] = (TH2F *)hfile->Get("h_mapDepth3pedestal_HE");
874  Map_Ampl[31][2][4] = (TH2F *)hfile->Get("h_mapDepth4pedestal_HE");
875  Map_Ampl[31][2][5] = (TH2F *)hfile->Get("h_mapDepth5pedestal_HE");
876  Map_Ampl[31][2][6] = (TH2F *)hfile->Get("h_mapDepth6pedestal_HE");
877  Map_Ampl[31][2][7] = (TH2F *)hfile->Get("h_mapDepth7pedestal_HE");
878  Map_Ampl[31][3][4] = (TH2F *)hfile->Get("h_mapDepth4pedestal_HO");
879  Map_Ampl[31][4][1] = (TH2F *)hfile->Get("h_mapDepth1pedestal_HF");
880  Map_Ampl[31][4][2] = (TH2F *)hfile->Get("h_mapDepth2pedestal_HF");
881  Map_Ampl[31][4][3] = (TH2F *)hfile->Get("h_mapDepth3pedestal_HF");
882  Map_Ampl[31][4][4] = (TH2F *)hfile->Get("h_mapDepth4pedestal_HF");
883 
884  Map_Ampl[32][1][1] = (TH2F *)hfile->Get("h_mapDepth1pedestalw_HB");
885  Map_Ampl[32][1][2] = (TH2F *)hfile->Get("h_mapDepth2pedestalw_HB");
886  Map_Ampl[32][1][3] = (TH2F *)hfile->Get("h_mapDepth3pedestalw_HB");
887  Map_Ampl[32][1][4] = (TH2F *)hfile->Get("h_mapDepth4pedestalw_HB");
888  Map_Ampl[32][2][1] = (TH2F *)hfile->Get("h_mapDepth1pedestalw_HE");
889  Map_Ampl[32][2][2] = (TH2F *)hfile->Get("h_mapDepth2pedestalw_HE");
890  Map_Ampl[32][2][3] = (TH2F *)hfile->Get("h_mapDepth3pedestalw_HE");
891  Map_Ampl[32][2][4] = (TH2F *)hfile->Get("h_mapDepth4pedestalw_HE");
892  Map_Ampl[32][2][5] = (TH2F *)hfile->Get("h_mapDepth5pedestalw_HE");
893  Map_Ampl[32][2][6] = (TH2F *)hfile->Get("h_mapDepth6pedestalw_HE");
894  Map_Ampl[32][2][7] = (TH2F *)hfile->Get("h_mapDepth7pedestalw_HE");
895  Map_Ampl[32][3][4] = (TH2F *)hfile->Get("h_mapDepth4pedestalw_HO");
896  Map_Ampl[32][4][1] = (TH2F *)hfile->Get("h_mapDepth1pedestalw_HF");
897  Map_Ampl[32][4][2] = (TH2F *)hfile->Get("h_mapDepth2pedestalw_HF");
898  Map_Ampl[32][4][3] = (TH2F *)hfile->Get("h_mapDepth3pedestalw_HF");
899  Map_Ampl[32][4][4] = (TH2F *)hfile->Get("h_mapDepth4pedestalw_HF");
900 
901  HistPed[1][1][0] = (TH1F *)hfile->Get("h_pedestal0_HB");
902  HistPed[1][1][1] = (TH1F *)hfile->Get("h_pedestal1_HB");
903  HistPed[1][1][2] = (TH1F *)hfile->Get("h_pedestal2_HB");
904  HistPed[1][1][3] = (TH1F *)hfile->Get("h_pedestal3_HB");
905  HistPed[2][1][0] = (TH1F *)hfile->Get("h_pedestalw0_HB");
906  HistPed[2][1][1] = (TH1F *)hfile->Get("h_pedestalw1_HB");
907  HistPed[2][1][2] = (TH1F *)hfile->Get("h_pedestalw2_HB");
908  HistPed[2][1][3] = (TH1F *)hfile->Get("h_pedestalw3_HB");
909 
910  HistPed[1][2][0] = (TH1F *)hfile->Get("h_pedestal0_HE");
911  HistPed[1][2][1] = (TH1F *)hfile->Get("h_pedestal1_HE");
912  HistPed[1][2][2] = (TH1F *)hfile->Get("h_pedestal2_HE");
913  HistPed[1][2][3] = (TH1F *)hfile->Get("h_pedestal3_HE");
914  HistPed[2][2][0] = (TH1F *)hfile->Get("h_pedestalw0_HE");
915  HistPed[2][2][1] = (TH1F *)hfile->Get("h_pedestalw1_HE");
916  HistPed[2][2][2] = (TH1F *)hfile->Get("h_pedestalw2_HE");
917  HistPed[2][2][3] = (TH1F *)hfile->Get("h_pedestalw3_HE");
918 
919  HistPed[1][3][0] = (TH1F *)hfile->Get("h_pedestal0_HO");
920  HistPed[1][3][1] = (TH1F *)hfile->Get("h_pedestal1_HO");
921  HistPed[1][3][2] = (TH1F *)hfile->Get("h_pedestal2_HO");
922  HistPed[1][3][3] = (TH1F *)hfile->Get("h_pedestal3_HO");
923  HistPed[2][3][0] = (TH1F *)hfile->Get("h_pedestalw0_HO");
924  HistPed[2][3][1] = (TH1F *)hfile->Get("h_pedestalw1_HO");
925  HistPed[2][3][2] = (TH1F *)hfile->Get("h_pedestalw2_HO");
926  HistPed[2][3][3] = (TH1F *)hfile->Get("h_pedestalw3_HO");
927 
928  HistPed[1][4][0] = (TH1F *)hfile->Get("h_pedestal0_HF");
929  HistPed[1][4][1] = (TH1F *)hfile->Get("h_pedestal1_HF");
930  HistPed[1][4][2] = (TH1F *)hfile->Get("h_pedestal2_HF");
931  HistPed[1][4][3] = (TH1F *)hfile->Get("h_pedestal3_HF");
932  HistPed[2][4][0] = (TH1F *)hfile->Get("h_pedestalw0_HF");
933  HistPed[2][4][1] = (TH1F *)hfile->Get("h_pedestalw1_HF");
934  HistPed[2][4][2] = (TH1F *)hfile->Get("h_pedestalw2_HF");
935  HistPed[2][4][3] = (TH1F *)hfile->Get("h_pedestalw3_HF");
936 
937  for (int test = 31; test <= 32; test++) { //Test: 31-Pedestals, 32-pedestal Widths,
938  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
939  // if (sub==1) cHB->Divide(2,1);
940  if (sub == 1)
941  cHB->Divide(2, 2);
942  // if (sub==2) cHE->Divide(3,1);
943  if (sub == 2)
944  cHE->Divide(3, 3);
945  if (sub == 3)
946  cONE->Divide(1, 1);
947  // if (sub==4) cHF->Divide(2,1);
948  if (sub == 4)
949  cHF->Divide(2, 2);
950  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
951  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
952  // int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
953  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depths
954  if (sub == 1)
955  cHB->cd(k);
956  if (sub == 2)
957  cHE->cd(k);
958  if (sub == 3)
959  cONE->cd(k - 3);
960  if (sub == 4)
961  cHF->cd(k);
962  Map_Ampl[test][sub][k]->Divide(Map_Ampl[test][sub][k], Map_SUB[sub][k], 1, 1, "B");
963  gPad->SetGridy();
964  gPad->SetGridx();
965  gPad->SetLogz();
966  if (sub == 1)
967  sprintf(str, "HB, Depth%d \b", k);
968  if (sub == 2)
969  sprintf(str, "HE, Depth%d \b", k);
970  if (sub == 3)
971  sprintf(str, "HO, Depth%d \b", k);
972  if (sub == 4)
973  sprintf(str, "HF, Depth%d \b", k);
974  Map_Ampl[test][sub][k]->SetTitle(str);
975  Map_Ampl[test][sub][k]->SetXTitle("#eta \b");
976  Map_Ampl[test][sub][k]->SetYTitle("#phi \b");
977  Map_Ampl[test][sub][k]->SetZTitle("Rate \b");
978  if (sub == 3)
979  Map_Ampl[test][sub][k]->SetTitleOffset(0.8, "Z");
980  Map_Ampl[test][sub][k]->Draw("COLZ");
981  Map_Ampl[test][sub][k]->GetYaxis()->SetRangeUser(0, 72.);
982  Map_Ampl[test][sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
983  if (sub == 1) {
984  cHB->Modified();
985  cHB->Update();
986  }
987  if (sub == 2) {
988  cHE->Modified();
989  cHE->Update();
990  }
991  if (sub == 3) {
992  cONE->Modified();
993  cONE->Update();
994  }
995  if (sub == 4) {
996  cHF->Modified();
997  cHF->Update();
998  }
999  } //end depth
1000  if (test == 31) {
1001  if (sub == 1) {
1002  cHB->Print("MapRatePedHB.png");
1003  cHB->Clear();
1004  }
1005  if (sub == 2) {
1006  cHE->Print("MapRatePedHE.png");
1007  cHE->Clear();
1008  }
1009  if (sub == 3) {
1010  cONE->Print("MapRatePedHO.png");
1011  cONE->Clear();
1012  }
1013  if (sub == 4) {
1014  cHF->Print("MapRatePedHF.png");
1015  cHF->Clear();
1016  }
1017  }
1018  if (test == 32) {
1019  if (sub == 1) {
1020  cHB->Print("MapRatePedWidthsHB.png");
1021  cHB->Clear();
1022  }
1023  if (sub == 2) {
1024  cHE->Print("MapRatePedWidthsHE.png");
1025  cHE->Clear();
1026  }
1027  if (sub == 3) {
1028  cONE->Print("MapRatePedWidthsHO.png");
1029  cONE->Clear();
1030  }
1031  if (sub == 4) {
1032  cHF->Print("MapRatePedWidthsHF.png");
1033  cHF->Clear();
1034  }
1035  }
1036 
1038 
1039  cPED->Divide(2, 2);
1040  for (int cap = 0; cap <= 3; cap++) {
1041  cPED->cd(cap + 1);
1042  gPad->SetGridy();
1043  gPad->SetGridx();
1044  gPad->SetLogy();
1045 
1046  if (sub == 1)
1047  sprintf(str, "HB, Cap%d, all depth\b", cap);
1048  if (sub == 2)
1049  sprintf(str, "HE, Cap%d, all depth\b", cap);
1050  if (sub == 3)
1051  sprintf(str, "HO, Cap%d, all depth\b", cap);
1052  if (sub == 4)
1053  sprintf(str, "HF, Cap%d, all depth\b", cap);
1054 
1055  HistPed[test - 30][sub][cap]->SetTitle(str);
1056 
1057  if (test == 31)
1058  HistPed[test - 30][sub][cap]->SetXTitle("Pedestals in each event & cell \b");
1059  if (test == 32)
1060  HistPed[test - 30][sub][cap]->SetXTitle("Pedestal Widths in each event & cell \b");
1061 
1062  HistPed[test - 30][sub][cap]->SetYTitle("Number of channel-events \b");
1063  HistPed[test - 30][sub][cap]->SetLineColor(4);
1064  HistPed[test - 30][sub][cap]->SetLineWidth(2);
1065  HistPed[test - 30][sub][cap]->SetTitleOffset(1.4, "Y");
1066  HistPed[test - 30][sub][cap]->Draw("");
1067  // HistPed[test-30][sub][cap]->GetYaxis()->SetRangeUser(1., 100.);
1068  // if (test==31) {gPad->SetLogx(); HistPed[test-30][sub][cap]->GetXaxis()->SetRangeUser(1., 10000.);}
1069  // if (test==32) HistPed[test-30][sub][cap]->GetXaxis()->SetRangeUser(0., 5.);
1070 
1071  cPED->Modified();
1072  cPED->Update();
1073  double min_x[] = {Pedest[test - 31][sub], Pedest[test - 31][sub]};
1074  double min_y[] = {0., 100000000.};
1075  TGraph *MIN = new TGraph(2, min_x, min_y);
1076  MIN->SetLineStyle(2);
1077  MIN->SetLineColor(2);
1078  MIN->SetLineWidth(2 + 100 * 100);
1079  MIN->SetFillStyle(3005);
1080  MIN->SetFillColor(2);
1081  MIN->Draw("L");
1082  }
1083  if (test == 31) {
1084  if (sub == 1) {
1085  cPED->Print("HistPedestalsHB.png");
1086  cPED->Clear();
1087  }
1088  if (sub == 2) {
1089  cPED->Print("HistPedestalsHE.png");
1090  cPED->Clear();
1091  }
1092  if (sub == 3) {
1093  cPED->Print("HistPedestalsHO.png");
1094  cPED->Clear();
1095  }
1096  if (sub == 4) {
1097  cPED->Print("HistPedestalsHF.png");
1098  cPED->Clear();
1099  }
1100  }
1101  if (test == 32) {
1102  if (sub == 1) {
1103  cPED->Print("HistPedestalWidthsHB.png");
1104  cPED->Clear();
1105  }
1106  if (sub == 2) {
1107  cPED->Print("HistPedestalWidthsHE.png");
1108  cPED->Clear();
1109  }
1110  if (sub == 3) {
1111  cPED->Print("HistPedestalWidthsHO.png");
1112  cPED->Clear();
1113  }
1114  if (sub == 4) {
1115  cPED->Print("HistPedestalWidthsHF.png");
1116  cPED->Clear();
1117  }
1118  }
1119  } // end sub
1120  } //end test 31,32
1121 
1122  //+++++++++++++++++++++++++++++++++++
1123  //Test 33 Correlation of Pedestal, pedestalWidths Vs fullAmplitude
1124  //++++++++++++++++++++++++++++++++++++
1125 
1126  cPED->Clear();
1127  Map_Ped[1][1] = (TH2F *)hfile->Get("h2_pedvsampl_HB");
1128  Map_Ped[1][2] = (TH2F *)hfile->Get("h2_pedvsampl_HE");
1129  Map_Ped[1][3] = (TH2F *)hfile->Get("h2_pedvsampl_HO");
1130  Map_Ped[1][4] = (TH2F *)hfile->Get("h2_pedvsampl_HF");
1131  Map_Ped[2][1] = (TH2F *)hfile->Get("h2_pedwvsampl_HB");
1132  Map_Ped[2][2] = (TH2F *)hfile->Get("h2_pedwvsampl_HE");
1133  Map_Ped[2][3] = (TH2F *)hfile->Get("h2_pedwvsampl_HO");
1134  Map_Ped[2][4] = (TH2F *)hfile->Get("h2_pedwvsampl_HF");
1135  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
1136  cPED->Divide(2, 1);
1137  for (int test = 1; test <= 2; test++) {
1138  cPED->cd(test);
1139  gPad->SetGridy();
1140  gPad->SetGridx();
1141  gPad->SetLogz();
1142  if (test == 1)
1143  Map_Ped[test][sub]->SetXTitle("Pedestal, fC \b");
1144  if (test == 2)
1145  Map_Ped[test][sub]->SetXTitle("pedestal Width, fC \b");
1146  Map_Ped[test][sub]->SetYTitle("Amplitude, fC \b");
1147  Map_Ped[test][sub]->SetZTitle("entries \b");
1148  if (test == 1)
1149  sprintf(str, "Cap0 Pedestal vs Amplitude \b");
1150  if (test == 2)
1151  sprintf(str, "Cap0 pedestalWidth vs Amplitude \b");
1152  Map_Ped[test][sub]->SetTitle(str);
1153  Map_Ped[test][sub]->Draw("COLZ");
1154  // Map_Ped[test][sub]->GetYaxis()->SetRangeUser(0, 72.);
1155  // Map_Ped[test][sub]->GetZaxis()->SetRangeUser(0.0001, 1.);
1156  cPED->Modified();
1157  cPED->Update();
1158  } // test 1,2
1159  if (sub == 1) {
1160  cPED->Print("CorrelationsMapPedestalVsfullAmplitudeHB.png");
1161  cPED->Clear();
1162  }
1163  if (sub == 2) {
1164  cPED->Print("CorrelationsMapPedestalVsfullAmplitudeHE.png");
1165  cPED->Clear();
1166  }
1167  if (sub == 3) {
1168  cPED->Print("CorrelationsMapPedestalVsfullAmplitudeHO.png");
1169  cPED->Clear();
1170  }
1171  if (sub == 4) {
1172  cPED->Print("CorrelationsMapPedestalVsfullAmplitudeHF.png");
1173  cPED->Clear();
1174  }
1175  } // end sub
1176 
1177  //+++++++++++++++++++++++++++++++++++
1178  //Test 41 Time Slices shape for good and bad channels
1179  //++++++++++++++++++++++++++++++++++++
1180 
1181  cONE->Clear();
1182  hist_GoodTSshape[1] = (TH1F *)hfile->Get("h_shape_good_channels_HB");
1183  hist_GoodTSshape[2] = (TH1F *)hfile->Get("h_shape_good_channels_HE");
1184  hist_GoodTSshape[3] = (TH1F *)hfile->Get("h_shape_good_channels_HO");
1185  hist_GoodTSshape[4] = (TH1F *)hfile->Get("h_shape_good_channels_HF");
1186 
1187  hist_GoodTSshape0[1] = (TH1F *)hfile->Get("h_shape0_good_channels_HB");
1188  hist_GoodTSshape0[2] = (TH1F *)hfile->Get("h_shape0_good_channels_HE");
1189  hist_GoodTSshape0[3] = (TH1F *)hfile->Get("h_shape0_good_channels_HO");
1190  hist_GoodTSshape0[4] = (TH1F *)hfile->Get("h_shape0_good_channels_HF");
1191 
1192  hist_BadTSshape[1] = (TH1F *)hfile->Get("h_shape_bad_channels_HB");
1193  hist_BadTSshape[2] = (TH1F *)hfile->Get("h_shape_bad_channels_HE");
1194  hist_BadTSshape[3] = (TH1F *)hfile->Get("h_shape_bad_channels_HO");
1195  hist_BadTSshape[4] = (TH1F *)hfile->Get("h_shape_bad_channels_HF");
1196 
1197  hist_BadTSshape0[1] = (TH1F *)hfile->Get("h_shape0_bad_channels_HB");
1198  hist_BadTSshape0[2] = (TH1F *)hfile->Get("h_shape0_bad_channels_HE");
1199  hist_BadTSshape0[3] = (TH1F *)hfile->Get("h_shape0_bad_channels_HO");
1200  hist_BadTSshape0[4] = (TH1F *)hfile->Get("h_shape0_bad_channels_HF");
1201 
1202  cONE->cd(1);
1203 
1204  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
1205 
1206  gPad->SetGridy();
1207  gPad->SetGridx();
1208  gPad->SetLogz();
1209  hist_GoodTSshape[sub]->Divide(hist_GoodTSshape[sub], hist_GoodTSshape0[sub], 1, 1, "B");
1210  hist_GoodTSshape[sub]->SetXTitle("Time slice \b");
1211  hist_GoodTSshape[sub]->SetYTitle("ADC counts \b");
1212  sprintf(str, "Mean ADC Shape \b");
1213  hist_GoodTSshape[sub]->SetTitle(str);
1214  hist_GoodTSshape[sub]->Draw("");
1215  // hist_GoodTSshape[sub]->GetYaxis()->SetRangeUser(0, 72.);
1216  // hist_GoodTSshape[sub]->GetZaxis()->SetRangeUser(0.0001, 1.);
1217  cONE->Modified();
1218  cONE->Update();
1219  if (sub == 1) {
1220  cONE->Print("HistGoodTSshapesHB.png");
1221  cONE->Clear();
1222  }
1223  if (sub == 2) {
1224  cONE->Print("HistGoodTSshapesHE.png");
1225  cONE->Clear();
1226  }
1227  if (sub == 3) {
1228  cONE->Print("HistGoodTSshapesHO.png");
1229  cONE->Clear();
1230  }
1231  if (sub == 4) {
1232  cONE->Print("HistGoodTSshapesHF.png");
1233  cONE->Clear();
1234  }
1235  } // end sub
1236 
1237  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
1238 
1239  gPad->SetGridy();
1240  gPad->SetGridx();
1241  gPad->SetLogz();
1242  hist_BadTSshape[sub]->Divide(hist_BadTSshape[sub], hist_BadTSshape0[sub], 1, 1, "B");
1243  hist_BadTSshape[sub]->SetXTitle("Time slice \b");
1244  hist_BadTSshape[sub]->SetYTitle("ADC counts \b");
1245  sprintf(str, "Mean ADC Shape \b");
1246  hist_BadTSshape[sub]->SetTitle(str);
1247  hist_BadTSshape[sub]->Draw("");
1248  // hist_BadTSshape[sub]->GetYaxis()->SetRangeUser(0, 72.);
1249  // hist_BadTSshape[sub]->GetZaxis()->SetRangeUser(0.0001, 1.);
1250  cONE->Modified();
1251  cONE->Update();
1252  if (sub == 1) {
1253  cONE->Print("HistBadTSshapesHB.png");
1254  cONE->Clear();
1255  }
1256  if (sub == 2) {
1257  cONE->Print("HistBadTSshapesHE.png");
1258  cONE->Clear();
1259  }
1260  if (sub == 3) {
1261  cONE->Print("HistBadTSshapesHO.png");
1262  cONE->Clear();
1263  }
1264  if (sub == 4) {
1265  cONE->Print("HistBadTSshapesHF.png");
1266  cONE->Clear();
1267  }
1268  } // end sub
1269 
1270  //+++++++++++++++++++++++++++++
1271  //Entries in different TSs:
1272  //+++++++++++++++++++++++++++++
1273  Map_SUBTS[1][1] = (TH2F *)hfile->Get("h_mapDepth1TS2_HB");
1274  Map_SUBTS[1][2] = (TH2F *)hfile->Get("h_mapDepth2TS2_HB");
1275  Map_SUBTS[1][3] = (TH2F *)hfile->Get("h_mapDepth3TS2_HB");
1276  Map_SUBTS[1][4] = (TH2F *)hfile->Get("h_mapDepth4TS2_HB");
1277 
1278  Map_SUBTS[2][1] = (TH2F *)hfile->Get("h_mapDepth1TS2_HE");
1279  Map_SUBTS[2][2] = (TH2F *)hfile->Get("h_mapDepth2TS2_HE");
1280  Map_SUBTS[2][3] = (TH2F *)hfile->Get("h_mapDepth3TS2_HE");
1281  Map_SUBTS[2][4] = (TH2F *)hfile->Get("h_mapDepth4TS2_HE");
1282  Map_SUBTS[2][5] = (TH2F *)hfile->Get("h_mapDepth5TS2_HE");
1283  Map_SUBTS[2][6] = (TH2F *)hfile->Get("h_mapDepth6TS2_HE");
1284  Map_SUBTS[2][7] = (TH2F *)hfile->Get("h_mapDepth7TS2_HE");
1285 
1286  Map_SUBTS[3][4] = (TH2F *)hfile->Get("h_mapDepth4TS012_HO");
1287 
1288  Map_SUBTS[4][1] = (TH2F *)hfile->Get("h_mapDepth1TS1_HF");
1289  Map_SUBTS[4][2] = (TH2F *)hfile->Get("h_mapDepth2TS1_HF");
1290  Map_SUBTS[4][3] = (TH2F *)hfile->Get("h_mapDepth3TS1_HF");
1291  Map_SUBTS[4][4] = (TH2F *)hfile->Get("h_mapDepth4TS1_HF");
1292 
1293  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
1294  // if (sub==1) cHB->Divide(2,1);
1295  if (sub == 1)
1296  cHB->Divide(2, 2);
1297  // if (sub==2) cHE->Divide(3,1);
1298  if (sub == 2)
1299  cHE->Divide(3, 3);
1300  if (sub == 3)
1301  cONE->Divide(1, 1);
1302  // if (sub==4) cHF->Divide(2,1);
1303  if (sub == 4)
1304  cHF->Divide(2, 2);
1305  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
1306  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
1307  // int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
1308  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
1309  if (sub == 1)
1310  cHB->cd(k);
1311  if (sub == 2)
1312  cHE->cd(k);
1313  if (sub == 3)
1314  cONE->cd(k - 3);
1315  if (sub == 4)
1316  cHF->cd(k);
1317  Map_SUBTS[sub][k]->Divide(Map_SUBTS[sub][k], Map_SUB[sub][k], 1, 1, "B");
1318  gPad->SetGridy();
1319  gPad->SetGridx();
1320  gPad->SetLogz();
1321  if (sub == 1)
1322  sprintf(str, "HB, Depth%d \b", k);
1323  if (sub == 2)
1324  sprintf(str, "HE, Depth%d \b", k);
1325  if (sub == 3)
1326  sprintf(str, "HO, Depth%d \b", k);
1327  if (sub == 4)
1328  sprintf(str, "HF, Depth%d \b", k);
1329  Map_SUBTS[sub][k]->SetTitle(str);
1330  Map_SUBTS[sub][k]->SetXTitle("#eta \b");
1331  Map_SUBTS[sub][k]->SetYTitle("#phi \b");
1332  Map_SUBTS[sub][k]->SetZTitle("Number of events \b");
1333  if (sub == 3)
1334  Map_SUBTS[sub][k]->SetTitleOffset(0.8, "Z");
1335  Map_SUBTS[sub][k]->Draw("COLZ");
1336  Map_SUBTS[sub][k]->GetYaxis()->SetRangeUser(0, 72.);
1337  // Map_SUBTS[sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
1338  if (sub == 1) {
1339  cHB->Modified();
1340  cHB->Update();
1341  }
1342  if (sub == 2) {
1343  cHE->Modified();
1344  cHE->Update();
1345  }
1346  if (sub == 3) {
1347  cONE->Modified();
1348  cONE->Update();
1349  }
1350  if (sub == 4) {
1351  cHF->Modified();
1352  cHF->Update();
1353  }
1354  } //end depth
1355 
1356  if (sub == 1) {
1357  cHB->Print("Hist_mapDepthAllTS2_HB.png");
1358  cHB->Clear();
1359  }
1360  if (sub == 2) {
1361  cHE->Print("Hist_mapDepthAllTS2_HE.png");
1362  cHE->Clear();
1363  }
1364  if (sub == 3) {
1365  cONE->Print("Hist_mapDepthAllTS012_HO.png");
1366  cONE->Clear();
1367  }
1368  if (sub == 4) {
1369  cHF->Print("Hist_mapDepthAllTS1_HF.png");
1370  cHF->Clear();
1371  }
1372  } // end sub
1373 
1374  //======================================================================
1375 
1376  std::cout << " We are here to print general 2D MAP " << std::endl;
1377 
1378  //======================================================================
1379 
1380  //======================================================================
1382  // i - Eta; j - Phi
1383  //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
1384  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
1385  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet before upgrade
1386  // int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
1387  //k-Depth
1388 
1389  // TH2F *Map_ALL = new TH2F("Map_All", "Map_all", 82, -41, 40, 72, 0, 71);
1390  TH2F *Map_ALL = new TH2F("Map_All", "Map_all", 82, -41, 41, 72, 0, 72);
1391 
1392  int nx = Map_ALL->GetXaxis()->GetNbins();
1393  int ny = Map_ALL->GetYaxis()->GetNbins();
1394  cout << " nx= " << nx << " ny= " << ny << endl;
1395  // int NBad = 0;
1396  // int NWarn = 0;
1397  // int NCalib = 0;
1398  // int NPed = 0;
1399  // // int Eta[3][10000]={0};
1400  // int Eta[4][10000] = {0};
1401  // int Phi[4][10000] = {0};
1402  // int Sub[4][10000] = {0};
1403  // int Depth[4][10000] = {0};
1404  // string Comment[4][10000] = {""};
1405  // string Text[33] = {"", "Cm", "Am", "Wm", "Rm", "TNm", "TXm", "", "", "", "", "Cc", "Ac", "Wc", "Rc", "TNc", "TXc",
1406  // "", "", "", "", "GS", "", "", "", "", "", "", "", "", "", "Pm", "pWm"};
1407  // int flag_W = 0;
1408  // int flag_B = 0;
1409  // int flag_P = 0;
1410  int fffffflag = 0;
1411  std::cout << " Map_ALL SUBGOOD update " << std::endl;
1412  for (int sub = 1; sub <= 4; sub++) {
1413  for (int k = k_min[sub]; k <= k_max[sub]; k++) {
1414  for (int i = 1; i <= nx; i++) {
1415  for (int j = 1; j <= ny; j++) {
1416  if (Map_SUB[sub][k]->GetBinContent(i, j) != 0) {
1417  Map_SUBGOOD[sub][k]->SetBinContent(i, j, 0.5);
1418  Map_ALL->SetBinContent(i, j, 0.5);
1419  }
1420  }
1421  }
1422  }
1423  }
1424 
1425  std::cout << " Map_ALL SUBGOOD filling............... " << std::endl;
1426  for (int sub = 1; sub <= 4; sub++) {
1427  for (int k = k_min[sub]; k <= k_max[sub]; k++) {
1428  for (int i = 1; i <= nx; i++) {
1429  for (int j = 1; j <= ny; j++) {
1430  // flag_W = 0;
1431  // flag_B = 0;
1432  // flag_P = 0;
1433  // CapID(Test=1; ADC amplitude Am(Test= 2); Width for Wm(Test=3); Ratio cut for Rm(Test=4); TS mean for TNm(test=5); TS max for TXm(Test=6);
1434  for (int test = 3; test <= 6; test++) {
1435  // cout<<" test= "<<test<<" sbd= "<<sub<<" depth= "<<k<<" eta= "<<i<<" , phi= "<<j<<endl;
1436  // cout<<" initial content Map_Ampl[test][sub][k]->GetBinContent(i, j)= "<< Map_Ampl[test][sub][k]->GetBinContent(i, j) <<endl;
1437 
1438  //Bad
1439  //Rate 0.1 for displaying on whole detector map and subdetector map
1440  if (Map_Ampl[test][sub][k]->GetBinContent(i, j) > 0.1) {
1441  Map_ALL->SetBinContent(i, j, 1.);
1442  Map_SUBGOOD[sub][k]->SetBinContent(i, j, 1.);
1443  fffffflag = 1;
1444  /*
1445  if (flag_B == 0) {
1446  NBad += 1;
1447  Eta[2][NBad] = i - 41;
1448  Phi[2][NBad] = j - 1;
1449  Sub[2][NBad] = sub;
1450  Depth[2][NBad] = k;
1451  Comment[2][NBad] = Text[test];
1452  }
1453  else {
1454  Comment[2][NBad] += ", " + Text[test];
1455  flag_B = 1;
1456  }
1457 */
1458  }
1459 
1460  if ((Map_Ampl[test][sub][k]->GetBinContent(i, j) != 0.) &&
1461  (Map_Ampl[test][sub][k]->GetBinContent(i, j) < 0.001)) {
1462  if (Map_SUBGOOD[sub][k]->GetBinContent(i, j) != 1.)
1463  Map_SUBGOOD[sub][k]->SetBinContent(i, j, 0.75);
1464  if (Map_ALL->GetBinContent(i, j) != 1.)
1465  Map_ALL->SetBinContent(i, j, 0.75);
1466  fffffflag = 2;
1467  /*
1468  if (flag_W == 0) {
1469  NWarn +=1;
1470  Eta[1][NWarn]=i-41;
1471  Phi[1][NWarn]=j-1;
1472  Sub[1][NWarn]=sub;
1473  Depth[1][NWarn]=k;
1474  Comment[1][NWarn]=Text[test];
1475  }
1476  else {Comment[1][NWarn]+=", "+Text[test];
1477  flag_W = 1;
1478  }
1479 */
1480  }
1481 
1483 
1484  // if(fffffflag != 0) cout<<"Map_Ampl["<<test<<"]["<<sub<<"]["<<k<<"]->GetBinContent("<<i<<","<<j<<")= "<<Map_Ampl[test][sub][k]->GetBinContent(i,j) << "fffffflag = "<< fffffflag <<endl;
1485 
1486  } //end test
1487 
1488  // std::cout << " RUN3 2022 MAPS_SUB: Pedestals......"<< std::endl;
1489  //Pedestals
1490  for (int test = 31; test <= 32; test++) {
1491  // cout<<"Pedestals test= "<<test<<" sbd= "<<sub<<" depth= "<<k<<" eta= "<<i<<" , phi= "<<j<<endl;
1492  if (Map_Ampl[test][sub][k]->GetBinContent(i, j) > 0.9) {
1493  if (Map_SUBGOOD[sub][k]->GetBinContent(i, j) != 1.0)
1494  Map_SUBGOOD[sub][k]->SetBinContent(i, j, 0.15);
1495  if (Map_ALL->GetBinContent(i, j) != 1.)
1496  Map_ALL->SetBinContent(i, j, 0.15);
1497  /*
1498  if (flag_P == 0) {
1499  NPed += 1;
1500  Eta[3][NPed] = i - 41;
1501  Phi[3][NPed] = j - 1;
1502  Sub[3][NPed] = sub;
1503  Depth[3][NPed] = k;
1504  Comment[3][NPed] = Text[test];
1505  }
1506  else {
1507  Comment[3][NPed] += ", " + Text[test];
1508  flag_P = 1;
1509  }
1510 */
1511  }
1512  // cout<<"Pedestals Map_Ampl["<<test<<"]["<<sub<<"]["<<k<<"]->GetBinContent("<<i<<","<<j<<")= "<<Map_Ampl[test][sub][k]->GetBinContent(i,j)<<endl;
1513  } //end test
1514  }
1515  }
1516  }
1517  }
1518 
1519  std::cout << " RUN3: 2022 Plots with MAPS_SUB: start ..............................." << std::endl;
1520  // subdet maps
1521  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
1522 
1523  std::cout << " RUN3: 2022 MAPS_SUB= " << sub << std::endl;
1524  // if (sub==1) cHB->Divide(2,1);
1525  if (sub == 1)
1526  cHB->Divide(2, 2);
1527  // if (sub==2) cHE->Divide(3,1);
1528  if (sub == 2)
1529  cHE->Divide(3, 3);
1530  if (sub == 3)
1531  cONE->Divide(1, 1);
1532  // if (sub==4) cHB->Divide(2,1);
1533  if (sub == 4)
1534  cHF->Divide(2, 2);
1535  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
1536  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
1537  // int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
1538  //k = Depth
1539  for (int k = k_min[sub]; k <= k_max[sub]; k++) {
1540  if (sub == 1)
1541  cHB->cd(k);
1542  if (sub == 2)
1543  cHE->cd(k);
1544  if (sub == 3)
1545  cONE->cd(k - 3);
1546  if (sub == 4)
1547  cHF->cd(k);
1548  gPad->SetGridy();
1549  gPad->SetGridx();
1550  gPad->SetLogz();
1551  // gStyle->SetTitleOffset(0.5, "Y");
1552  if (sub == 1)
1553  sprintf(str, "HB, Depth%d \b", k);
1554  if (sub == 2)
1555  sprintf(str, "HE, Depth%d \b", k);
1556  if (sub == 3)
1557  sprintf(str, "HO, Depth%d \b", k);
1558  if (sub == 4)
1559  sprintf(str, "HF, Depth%d \b", k);
1560  Map_SUBGOOD[sub][k]->SetTitle(str);
1561  Map_SUBGOOD[sub][k]->SetXTitle("#eta \b");
1562  Map_SUBGOOD[sub][k]->SetYTitle("#phi \b");
1563  Map_SUBGOOD[sub][k]->Draw("COLZ");
1564  Map_SUBGOOD[sub][k]->GetYaxis()->SetRangeUser(0, 72.);
1565  Map_SUBGOOD[sub][k]->GetZaxis()->SetRangeUser(0., 1.);
1566 
1567  if (sub == 1) {
1568  cHB->Modified();
1569  cHB->Update();
1570  }
1571  if (sub == 2) {
1572  cHE->Modified();
1573  cHE->Update();
1574  }
1575  if (sub == 3) {
1576  cONE->Modified();
1577  cONE->Update();
1578  }
1579  if (sub == 4) {
1580  cHF->Modified();
1581  cHF->Update();
1582  }
1583  } //end depth
1584  if (sub == 1) {
1585  cHB->Print("MAPHB.png");
1586  cHB->Clear();
1587  }
1588  if (sub == 2) {
1589  cHE->Print("MAPHE.png");
1590  cHE->Clear();
1591  }
1592  if (sub == 3) {
1593  cONE->Print("MAPHO.png");
1594  cONE->Clear();
1595  }
1596  if (sub == 4) {
1597  cHF->Print("MAPHF.png");
1598  cHF->Clear();
1599  }
1600  } // end sub
1601 
1603 
1604  TCanvas *cmain1 = new TCanvas("cmain1", "MAP", 200, 10, 1400, 1800);
1605  cmain1->Divide(2, 2);
1606 
1607  cmain1->cd(1);
1608  TH1F *JDBEYESJ0 = (TH1F *)hfile->Get("h_totalAmplitudeHBperEvent");
1609  JDBEYESJ0->SetStats(0);
1610  JDBEYESJ0->SetMarkerStyle(20);
1611  JDBEYESJ0->SetMarkerSize(0.8);
1612  JDBEYESJ0->GetYaxis()->SetLabelSize(0.04);
1613  JDBEYESJ0->SetXTitle("iEvent \b");
1614  JDBEYESJ0->SetYTitle("totalAmplitude perEvent \b");
1615  JDBEYESJ0->SetTitle("HB \b");
1616  JDBEYESJ0->SetMarkerColor(2);
1617  JDBEYESJ0->SetLineColor(1);
1618  JDBEYESJ0->SetMinimum(0.8);
1619  JDBEYESJ0->Draw("HIST same P0");
1620  JDBEYESJ0->Clear();
1621 
1622  cmain1->cd(2);
1623  TH1F *JDBEYESJ1 = (TH1F *)hfile->Get("h_totalAmplitudeHEperEvent");
1624  JDBEYESJ1->SetStats(0);
1625  JDBEYESJ1->SetMarkerStyle(20);
1626  JDBEYESJ1->SetMarkerSize(0.8);
1627  JDBEYESJ1->GetYaxis()->SetLabelSize(0.04);
1628  JDBEYESJ1->SetXTitle("iEvent \b");
1629  JDBEYESJ1->SetYTitle("totalAmplitude perEvent \b");
1630  JDBEYESJ1->SetTitle("HE \b");
1631  JDBEYESJ1->SetMarkerColor(2);
1632  JDBEYESJ1->SetLineColor(1);
1633  JDBEYESJ1->SetMinimum(0.8);
1634  JDBEYESJ1->Draw("HIST same P0");
1635  JDBEYESJ1->Clear();
1636 
1637  cmain1->cd(3);
1638  TH1F *JDBEYESJ2 = (TH1F *)hfile->Get("h_totalAmplitudeHFperEvent");
1639  JDBEYESJ2->SetStats(0);
1640  JDBEYESJ2->SetMarkerStyle(20);
1641  JDBEYESJ2->SetMarkerSize(0.8);
1642  JDBEYESJ2->GetYaxis()->SetLabelSize(0.04);
1643  JDBEYESJ2->SetXTitle("iEvent \b");
1644  JDBEYESJ2->SetYTitle("totalAmplitude perEvent \b");
1645  JDBEYESJ2->SetTitle("HF \b");
1646  JDBEYESJ2->SetMarkerColor(2);
1647  JDBEYESJ2->SetLineColor(1);
1648  JDBEYESJ2->SetMinimum(0.8);
1649  JDBEYESJ2->Draw("HIST same P0");
1650  JDBEYESJ2->Clear();
1651 
1652  cmain1->cd(4);
1653  TH1F *JDBEYESJ3 = (TH1F *)hfile->Get("h_totalAmplitudeHOperEvent");
1654  JDBEYESJ3->SetStats(0);
1655  JDBEYESJ3->SetMarkerStyle(20);
1656  JDBEYESJ3->SetMarkerSize(0.8);
1657  JDBEYESJ3->GetYaxis()->SetLabelSize(0.04);
1658  JDBEYESJ3->SetXTitle("iEvent \b");
1659  JDBEYESJ3->SetYTitle("totalAmplitude perEvent \b");
1660  JDBEYESJ3->SetTitle("HO \b");
1661  JDBEYESJ3->SetMarkerColor(2);
1662  JDBEYESJ3->SetLineColor(1);
1663  JDBEYESJ3->SetMinimum(0.8);
1664  JDBEYESJ3->Draw("HIST same P0");
1665  JDBEYESJ3->Clear();
1666 
1667  cmain1->Modified();
1668  cmain1->Update();
1669  cmain1->Print("EVENTDEPENDENCE.png");
1670  cmain1->Clear();
1671 
1672  std::cout << " EVENTDEPENDENCE " << std::endl;
1673 
1675 
1676  // ALL SubDet
1677  gStyle->SetOptTitle(0);
1678  TCanvas *cmain = new TCanvas("cmain", "MAP", 1000, 1000);
1679  gPad->SetGridy();
1680  gPad->SetGridx();
1681  gPad->SetLogz();
1682  Map_ALL->SetTitleOffset(1.3, "Y");
1683  Map_ALL->SetXTitle("#eta \b");
1684  Map_ALL->SetYTitle("#phi \b");
1685  Map_ALL->Draw("COLZ");
1686  Map_ALL->GetYaxis()->SetRangeUser(0, 72.);
1687  Map_ALL->GetZaxis()->SetRangeUser(0, 1.);
1688  cmain->Modified();
1689  cmain->Update();
1690  cmain->Print("MAP.png");
1691  cmain->Clear();
1692 
1693  std::cout << " MAP_ALL " << std::endl;
1694  //======================================================================
1695 
1696  //====================================================================== html pages CREATING:
1697  //======================================================================
1698  // Creating each test kind for each subdet html pages:
1699  std::string raw_class, raw_class1, raw_class2, raw_class3;
1700  int ind = 0;
1701 
1702  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
1703  ofstream htmlFileT, htmlFileC, htmlFileD, htmlFileP, htmlFileS;
1704  if (sub == 1) {
1705  htmlFileT.open("HB_Tile.html");
1706  htmlFileC.open("HB_Calib.html");
1707  htmlFileD.open("HB_Drift.html");
1708  htmlFileP.open("HB_Pedestals.html");
1709  htmlFileS.open("HB_Shapes.html");
1710  }
1711  if (sub == 2) {
1712  htmlFileT.open("HE_Tile.html");
1713  htmlFileC.open("HE_Calib.html");
1714  htmlFileD.open("HE_Drift.html");
1715  htmlFileP.open("HE_Pedestals.html");
1716  htmlFileS.open("HE_Shapes.html");
1717  }
1718  if (sub == 3) {
1719  htmlFileT.open("HO_Tile.html");
1720  htmlFileC.open("HO_Calib.html");
1721  htmlFileD.open("HO_Drift.html");
1722  htmlFileP.open("HO_Pedestals.html");
1723  htmlFileS.open("HO_Shapes.html");
1724  }
1725  if (sub == 4) {
1726  htmlFileT.open("HF_Tile.html");
1727  htmlFileC.open("HF_Calib.html");
1728  htmlFileD.open("HF_Drift.html");
1729  htmlFileP.open("HF_Pedestals.html");
1730  htmlFileS.open("HF_Shapes.html");
1731  }
1732 
1733  // Megatile channels
1734  htmlFileT << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
1735  htmlFileT << "<head>" << std::endl;
1736  htmlFileT << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
1737  htmlFileT << "<title> Remote Monitoring Tool Global</title>" << std::endl;
1738  htmlFileT << "<style type=\"text/css\">" << std::endl;
1739  htmlFileT << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
1740  << std::endl;
1741  htmlFileT << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
1742  htmlFileT << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
1743  "text-align: center;}"
1744  << std::endl;
1745  htmlFileT << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
1746  htmlFileT << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
1747  htmlFileT << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
1748  htmlFileT << "</style>" << std::endl;
1749  htmlFileT << "<body>" << std::endl;
1750 
1751  if (sub == 1)
1752  htmlFileT << "<h1> Criteria for megatile channels for HB, RUN = " << runnumber << " </h1>" << std::endl;
1753  if (sub == 2)
1754  htmlFileT << "<h1> Criteria for megatile channels for HE, RUN = " << runnumber << " </h1>" << std::endl;
1755  if (sub == 3)
1756  htmlFileT << "<h1> Criteria for megatile channels for HO, RUN = " << runnumber << " </h1>" << std::endl;
1757  if (sub == 4)
1758  htmlFileT << "<h1> Criteria for megatile channels for HF, RUN = " << runnumber << " </h1>" << std::endl;
1759  htmlFileT << "<br>" << std::endl;
1760 
1761  // Test Entries
1762 
1763  htmlFileT << "<h2> 0. Entries for each channel.</h3>" << std::endl;
1764  htmlFileT << "<h3> 0.A. Entries in each channel for each depth.</h3>" << std::endl;
1765  htmlFileT << "<h4> Channel legend: color is number of hits in digi collection </h4>" << std::endl;
1766  if (sub == 1)
1767  htmlFileT << " <img src=\"MapRateEntryHB.png\" />" << std::endl;
1768  if (sub == 2)
1769  htmlFileT << " <img src=\"MapRateEntryHE.png\" />" << std::endl;
1770  if (sub == 3)
1771  htmlFileT << " <img src=\"MapRateEntryHO.png\" />" << std::endl;
1772  if (sub == 4)
1773  htmlFileT << " <img src=\"MapRateEntryHF.png\" />" << std::endl;
1774  htmlFileT << "<br>" << std::endl;
1775 
1776  // Test Cm
1777  htmlFileT << "<h2> 1. Cm criterion: CapID errors for each channel.</h3>" << std::endl;
1778  htmlFileT << "<h3> 1.A. Rate of CapId failures in each channel for each depth.</h3>" << std::endl;
1779  htmlFileT << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
1780  if (sub == 1)
1781  htmlFileT << " <img src=\"MapRateCapIDHB.png\" />" << std::endl;
1782  if (sub == 2)
1783  htmlFileT << " <img src=\"MapRateCapIDHE.png\" />" << std::endl;
1784  if (sub == 3)
1785  htmlFileT << " <img src=\"MapRateCapIDHO.png\" />" << std::endl;
1786  if (sub == 4)
1787  htmlFileT << " <img src=\"MapRateCapIDHF.png\" />" << std::endl;
1788  htmlFileT << "<br>" << std::endl;
1789 
1790  // Am
1791  htmlFileT << "<h2> 2. Am criterion: ADC amplitude collected over all TSs(Full Amplitude) for each channel. </h3>"
1792  << std::endl;
1793  htmlFileT << "<h3> 2.A. Full ADC amplitude distribution over all events, channels and depths.</h3>" << std::endl;
1794  htmlFileT << "<h4> Legend: Bins less " << MIN_M[2][sub] << " correpond to bad ADC amplitude </h4>" << std::endl;
1795  if (sub == 1)
1796  htmlFileT << " <img src=\"HistAmplHB.png\" />" << std::endl;
1797  if (sub == 2)
1798  htmlFileT << " <img src=\"HistAmplHE.png\" />" << std::endl;
1799  if (sub == 3)
1800  htmlFileT << " <img src=\"HistAmplHO.png\" />" << std::endl;
1801  if (sub == 4)
1802  htmlFileT << " <img src=\"HistAmplHF.png\" />" << std::endl;
1803  htmlFileT << "<br>" << std::endl;
1804  htmlFileT << "<h3> 2.B. Rate of bad ADC amplitude (<" << MIN_M[2][sub] << ") in each channel for each depth. </h3>"
1805  << std::endl;
1806  htmlFileT << "<h4> Channel legend: white - good, other colours - bad. </h4>" << std::endl;
1807  if (sub == 1)
1808  htmlFileT << " <img src=\"MapRateAmplHB.png\" />" << std::endl;
1809  if (sub == 2)
1810  htmlFileT << " <img src=\"MapRateAmplHE.png\" />" << std::endl;
1811  if (sub == 3)
1812  htmlFileT << " <img src=\"MapRateAmplHO.png\" />" << std::endl;
1813  if (sub == 4)
1814  htmlFileT << " <img src=\"MapRateAmplHF.png\" />" << std::endl;
1815  htmlFileT << "<br>" << std::endl;
1816 
1817  // Test Wm
1818  htmlFileT << "<h2> 3. Wm criterion: RMS (width) of ADC amplutude for each channel.</h3>" << std::endl;
1819  htmlFileT << "<h3> 3.A. RMS distribution over all events, channel and depth.</h3>" << std::endl;
1820  htmlFileT << "<h4> Legend: Bins less " << MIN_M[3][sub] << " and more " << MAX_M[3][sub]
1821  << " correpond to bad RMS </h4>" << std::endl;
1822  if (sub == 1)
1823  htmlFileT << " <img src=\"HistRMSHB.png\" />" << std::endl;
1824  if (sub == 2)
1825  htmlFileT << " <img src=\"HistRMSHE.png\" />" << std::endl;
1826  if (sub == 3)
1827  htmlFileT << " <img src=\"HistRMSHO.png\" />" << std::endl;
1828  if (sub == 4)
1829  htmlFileT << " <img src=\"HistRMSHF.png\" />" << std::endl;
1830  htmlFileT << "<br>" << std::endl;
1831  htmlFileT << "<h3> 3.B. Rate of bad RMS (<" << MIN_M[3][sub] << ",>" << MAX_M[3][sub]
1832  << ") in each channel for each depth.</h3>" << std::endl;
1833  htmlFileT << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
1834  if (sub == 1)
1835  htmlFileT << " <img src=\"MapRateRMSHB.png\" />" << std::endl;
1836  if (sub == 2)
1837  htmlFileT << " <img src=\"MapRateRMSHE.png\" />" << std::endl;
1838  if (sub == 3)
1839  htmlFileT << " <img src=\"MapRateRMSHO.png\" />" << std::endl;
1840  if (sub == 4)
1841  htmlFileT << " <img src=\"MapRateRMSHF.png\" />" << std::endl;
1842  htmlFileT << "<br>" << std::endl;
1843 
1844  // Rm
1845  htmlFileT << "<h2> 4. Rm criterion: Ratio ADC value sum over four near maximum (-2, -1, max, +1) TS to ADC value "
1846  "sum over all TS for each channel. </h3>"
1847  << std::endl;
1848  htmlFileT << "<h3> 4.A. Ratio distribution over all events, channels and depths.</h3>" << std::endl;
1849  htmlFileT << "<h4> Legend: Bins less " << MIN_M[4][sub] << " and more " << MAX_M[4][sub]
1850  << " correpond to bad ratio </h4>" << std::endl;
1851  if (sub == 1)
1852  htmlFileT << " <img src=\"Hist43TStoAllTSHB.png\" />" << std::endl;
1853  if (sub == 2)
1854  htmlFileT << " <img src=\"Hist43TStoAllTSHE.png\" />" << std::endl;
1855  if (sub == 3)
1856  htmlFileT << " <img src=\"Hist43TStoAllTSHO.png\" />" << std::endl;
1857  if (sub == 4)
1858  htmlFileT << " <img src=\"Hist43TStoAllTSHF.png\" />" << std::endl;
1859  htmlFileT << "<br>" << std::endl;
1860  htmlFileT << "<h3> 4.B. Rate of bad ratio (<" << MIN_M[4][sub] << ", >" << MAX_M[4][sub]
1861  << ") in each channel for each depth.</h3>" << std::endl;
1862  htmlFileT << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
1863  if (sub == 1)
1864  htmlFileT << " <img src=\"MapRate43TStoAllTSHB.png\" />" << std::endl;
1865  if (sub == 2)
1866  htmlFileT << " <img src=\"MapRate43TStoAllTSHE.png\" />" << std::endl;
1867  if (sub == 3)
1868  htmlFileT << " <img src=\"MapRate43TStoAllTSHO.png\" />" << std::endl;
1869  if (sub == 4)
1870  htmlFileT << " <img src=\"MapRate43TStoAllTSHF.png\" />" << std::endl;
1871  htmlFileT << "<br>" << std::endl;
1872 
1873  // TNm
1874  htmlFileT << "<h2> 5. TNm criterion: Mean TS position for each channel.</h3>" << std::endl;
1875  htmlFileT << "<h3> 5.A. TN position distribution over all events, channels and depths.</h3>" << std::endl;
1876  htmlFileT << "<h4> Legend: Bins less " << MIN_M[5][sub] << " and more " << MAX_M[5][sub]
1877  << " correpond to bad mean position </h4>" << std::endl;
1878  if (sub == 1)
1879  htmlFileT << " <img src=\"HistMeanPosHB.png\" />" << std::endl;
1880  if (sub == 2)
1881  htmlFileT << " <img src=\"HistMeanPosHE.png\" />" << std::endl;
1882  if (sub == 3)
1883  htmlFileT << " <img src=\"HistMeanPosHO.png\" />" << std::endl;
1884  if (sub == 4)
1885  htmlFileT << " <img src=\"HistMeanPosHF.png\" />" << std::endl;
1886  htmlFileT << "<br>" << std::endl;
1887  htmlFileT << "<h3> 5.B. Rate of bad TN position (<" << MIN_M[5][sub] << ", >" << MAX_M[5][sub]
1888  << ") in each channel for each depth. </h3>" << std::endl;
1889  htmlFileT << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
1890  if (sub == 1)
1891  htmlFileT << " <img src=\"MapRateMeanPosHB.png\" />" << std::endl;
1892  if (sub == 2)
1893  htmlFileT << " <img src=\"MapRateMeanPosHE.png\" />" << std::endl;
1894  if (sub == 3)
1895  htmlFileT << " <img src=\"MapRateMeanPosHO.png\" />" << std::endl;
1896  if (sub == 4)
1897  htmlFileT << " <img src=\"MapRateMeanPosHF.png\" />" << std::endl;
1898  htmlFileT << "<br>" << std::endl;
1899 
1900  // TXm
1901  htmlFileT << "<h2> 6.TXm criterion: Maximum TS position for each channel.</h3>" << std::endl;
1902  htmlFileT << "<h3> 6.A. TX position distribution over all events, channel and depth.</h3>" << std::endl;
1903  htmlFileT << "<h4> Legend: Bins less " << MIN_M[6][sub] << " and more " << MAX_M[6][sub]
1904  << " correpond to bad position </h4>" << std::endl;
1905  if (sub == 1)
1906  htmlFileT << " <img src=\"HistMaxPosHB.png\" />" << std::endl;
1907  if (sub == 2)
1908  htmlFileT << " <img src=\"HistMaxPosHE.png\" />" << std::endl;
1909  if (sub == 3)
1910  htmlFileT << " <img src=\"HistMaxPosHO.png\" />" << std::endl;
1911  if (sub == 4)
1912  htmlFileT << " <img src=\"HistMaxPosHF.png\" />" << std::endl;
1913  htmlFileT << "<br>" << std::endl;
1914  htmlFileT << "<h3> 6.B. Rate of bad TX position (<" << MIN_M[6][sub] << ", >" << MAX_M[6][sub]
1915  << ") in each channel for each depth. </h3>" << std::endl;
1916  htmlFileT << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
1917  if (sub == 1)
1918  htmlFileT << " <img src=\"MapRateMaxPosHB.png\" />" << std::endl;
1919  if (sub == 2)
1920  htmlFileT << " <img src=\"MapRateMaxPosHE.png\" />" << std::endl;
1921  if (sub == 3)
1922  htmlFileT << " <img src=\"MapRateMaxPosHO.png\" />" << std::endl;
1923  if (sub == 4)
1924  htmlFileT << " <img src=\"MapRateMaxPosHF.png\" />" << std::endl;
1925  htmlFileT << "<br>" << std::endl;
1926 
1927  htmlFileT << "</body> " << std::endl;
1928  htmlFileT << "</html> " << std::endl;
1929  htmlFileT.close();
1930 
1931  // Pedestals
1932  htmlFileP << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
1933  htmlFileP << "<head>" << std::endl;
1934  htmlFileP << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
1935  htmlFileP << "<title> Remote Monitoring Tool Global</title>" << std::endl;
1936  htmlFileP << "<style type=\"text/css\">" << std::endl;
1937  htmlFileP << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
1938  << std::endl;
1939  htmlFileP << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
1940  htmlFileP << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
1941  "text-align: center;}"
1942  << std::endl;
1943  htmlFileP << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
1944  htmlFileP << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
1945  htmlFileP << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
1946  htmlFileP << "</style>" << std::endl;
1947  htmlFileP << "<body>" << std::endl;
1948 
1949  if (sub == 1)
1950  htmlFileP << "<h1> Pedestals for HB, RUN = " << runnumber << " </h1>" << std::endl;
1951  if (sub == 2)
1952  htmlFileP << "<h1> Pedestals for HE, RUN = " << runnumber << " </h1>" << std::endl;
1953  if (sub == 3)
1954  htmlFileP << "<h1> Pedestals for HO, RUN = " << runnumber << " </h1>" << std::endl;
1955  if (sub == 4)
1956  htmlFileP << "<h1> Pedestals for HF, RUN = " << runnumber << " </h1>" << std::endl;
1957  htmlFileP << "<br>" << std::endl;
1958 
1959  // Pedestal:
1960  htmlFileP << "<h2> 1.Pm criterion: Pedestals for each CapID .</h3>" << std::endl;
1961  htmlFileP << "<h3> 1.A. Pedestal distribution over all events, channels for each CapID and all depths.</h3>"
1962  << std::endl;
1963  htmlFileP << "<h4> Legend: Bins less " << Pedest[0][sub] << " correpond to bad Pedestals </h4>" << std::endl;
1964  if (sub == 1)
1965  htmlFileP << " <img src=\"HistPedestalsHB.png\" />" << std::endl;
1966  if (sub == 2)
1967  htmlFileP << " <img src=\"HistPedestalsHE.png\" />" << std::endl;
1968  if (sub == 3)
1969  htmlFileP << " <img src=\"HistPedestalsHO.png\" />" << std::endl;
1970  if (sub == 4)
1971  htmlFileP << " <img src=\"HistPedestalsHF.png\" />" << std::endl;
1972  htmlFileP << "<br>" << std::endl;
1973  htmlFileP << "<h3> 1.B. Rate of channels at very low Pedestals at least in one CapID for each depth.</h3>"
1974  << std::endl;
1975  htmlFileP << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
1976  if (sub == 1)
1977  htmlFileP << " <img src=\"MapRatePedHB.png\" />" << std::endl;
1978  if (sub == 2)
1979  htmlFileP << " <img src=\"MapRatePedHE.png\" />" << std::endl;
1980  if (sub == 3)
1981  htmlFileP << " <img src=\"MapRatePedHO.png\" />" << std::endl;
1982  if (sub == 4)
1983  htmlFileP << " <img src=\"MapRatePedHF.png\" />" << std::endl;
1984 
1985  // PedestalWidth:
1986  htmlFileP << "<h2> 2.pWm criterion: Pedestal Widths for each CapID .</h3>" << std::endl;
1987  htmlFileP << "<h3> 2.A. Pedestal Widths distribution over all events, channels for each CapID and all depths.</h3>"
1988  << std::endl;
1989  htmlFileP << "<h4> Legend: Bins less " << Pedest[1][sub] << " correpond to bad Pedestal Widths </h4>" << std::endl;
1990  if (sub == 1)
1991  htmlFileP << " <img src=\"HistPedestalWidthsHB.png\" />" << std::endl;
1992  if (sub == 2)
1993  htmlFileP << " <img src=\"HistPedestalWidthsHE.png\" />" << std::endl;
1994  if (sub == 3)
1995  htmlFileP << " <img src=\"HistPedestalWidthsHO.png\" />" << std::endl;
1996  if (sub == 4)
1997  htmlFileP << " <img src=\"HistPedestalWidthsHF.png\" />" << std::endl;
1998  htmlFileP << "<br>" << std::endl;
1999  htmlFileP << "<h3> 2.B. Rate of channels at very low Pedestal Widths at least in one CapID for each depth.</h3>"
2000  << std::endl;
2001  htmlFileP << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
2002  if (sub == 1)
2003  htmlFileP << " <img src=\"MapRatePedWidthsHB.png\" />" << std::endl;
2004  if (sub == 2)
2005  htmlFileP << " <img src=\"MapRatePedWidthsHE.png\" />" << std::endl;
2006  if (sub == 3)
2007  htmlFileP << " <img src=\"MapRatePedWidthsHO.png\" />" << std::endl;
2008  if (sub == 4)
2009  htmlFileP << " <img src=\"MapRatePedWidthsHF.png\" />" << std::endl;
2010 
2011  // Correlations of Pedestal(Width) and fullAmplitude:
2012  htmlFileP << "<h2> 3.Pedestal and pedestalWidths vs Amplitude .</h3>" << std::endl;
2013  htmlFileP << "<h3> 3.A. Correlation of Pedestal(pedestalWidths) and Amplitude over all channels and events .</h3>"
2014  << std::endl;
2015  htmlFileP << "<h4> Legend: colour - entries </h4>" << std::endl;
2016  if (sub == 1)
2017  htmlFileP << "<img src=\"CorrelationsMapPedestalVsfullAmplitudeHB.png\" />" << std::endl;
2018  if (sub == 2)
2019  htmlFileP << "<img src=\"CorrelationsMapPedestalVsfullAmplitudeHE.png\" />" << std::endl;
2020  if (sub == 3)
2021  htmlFileP << "<img src=\"CorrelationsMapPedestalVsfullAmplitudeHO.png\" />" << std::endl;
2022  if (sub == 4)
2023  htmlFileP << "<img src=\"CorrelationsMapPedestalVsfullAmplitudeHF.png\" />" << std::endl;
2024  htmlFileP << "<br>" << std::endl;
2025 
2026  // TSs Shapes:
2027 
2028  htmlFileS << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
2029  htmlFileS << "<head>" << std::endl;
2030  htmlFileS << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
2031  htmlFileS << "<title> Remote Monitoring Tool Global</title>" << std::endl;
2032  htmlFileS << "<style type=\"text/css\">" << std::endl;
2033  htmlFileS << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
2034  << std::endl;
2035  htmlFileS << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
2036  htmlFileS << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
2037  "text-align: center;}"
2038  << std::endl;
2039  htmlFileS << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
2040  htmlFileS << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
2041  htmlFileS << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
2042  htmlFileS << "</style>" << std::endl;
2043  htmlFileS << "<body>" << std::endl;
2044 
2045  if (sub == 1)
2046  htmlFileS << "<h1> ADC Shape for HB, RUN = " << runnumber << " </h1>" << std::endl;
2047  if (sub == 2)
2048  htmlFileS << "<h1> ADC Shape for HE, RUN = " << runnumber << " </h1>" << std::endl;
2049  if (sub == 3)
2050  htmlFileS << "<h1> ADC Shape for HO, RUN = " << runnumber << " </h1>" << std::endl;
2051  if (sub == 4)
2052  htmlFileS << "<h1> ADC Shape for HF, RUN = " << runnumber << " </h1>" << std::endl;
2053  htmlFileP << "<br>" << std::endl;
2054 
2055  htmlFileS << "<h2> 1.Mean ADC Shape </h3>" << std::endl;
2056  htmlFileS << "<h3> 1.A. ADC shape averaged over all good channels, depth and events.</h3>" << std::endl;
2057  // htmlFileS << "<h4> Legend: Bins less "<<Pedest[0][sub]<<" correpond to bad Pedestals </h4>"<< std::endl;
2058  if (sub == 1)
2059  htmlFileS << " <img src=\"HistGoodTSshapesHB.png\" />" << std::endl;
2060  if (sub == 2)
2061  htmlFileS << " <img src=\"HistGoodTSshapesHE.png\" />" << std::endl;
2062  if (sub == 3)
2063  htmlFileS << " <img src=\"HistGoodTSshapesHO.png\" />" << std::endl;
2064  if (sub == 4)
2065  htmlFileS << " <img src=\"HistGoodTSshapesHF.png\" />" << std::endl;
2066  htmlFileS << "<br>" << std::endl;
2067  htmlFileS << "<h3> 1.B. ADC shape averaged over all bad channels, depth and events. Bad channels are selected by 5 "
2068  "criteria: CapId, A, W, P, Pw</h3>"
2069  << std::endl;
2070  // htmlFileS << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
2071  if (sub == 1)
2072  htmlFileS << " <img src=\"HistBadTSshapesHB.png\" />" << std::endl;
2073  if (sub == 2)
2074  htmlFileS << " <img src=\"HistBadTSshapesHE.png\" />" << std::endl;
2075  if (sub == 3)
2076  htmlFileS << " <img src=\"HistBadTSshapesHO.png\" />" << std::endl;
2077  if (sub == 4)
2078  htmlFileS << " <img src=\"HistBadTSshapesHF.png\" />" << std::endl;
2079 
2080  htmlFileS << "<h2> 2. Pattern of channels for Sub-Detector over depth,eta.phi </h3>" << std::endl;
2081  htmlFileS << "<h3> 2.A. reminder:.......................... for HBHE, TS=2;...................................... "
2082  "for HF, TS=1;..................................... for HO, TS=0,1,2 </h3>"
2083  << std::endl;
2084  if (sub == 1)
2085  htmlFileS << " <img src=\"Hist_mapDepthAllTS2_HB.png\" />" << std::endl;
2086  if (sub == 2)
2087  htmlFileS << " <img src=\"Hist_mapDepthAllTS2_HE.png\" />" << std::endl;
2088  if (sub == 3)
2089  htmlFileS << " <img src=\"Hist_mapDepthAllTS012_HO.png\" />" << std::endl;
2090  if (sub == 4)
2091  htmlFileS << " <img src=\"Hist_mapDepthAllTS1_HF.png\" />" << std::endl;
2092  htmlFileS << "<br>" << std::endl;
2093 
2094  htmlFileS.close();
2095  } // end sub
2096 
2097  //======================================================================
2098 
2099  //======================================================================
2100  // Creating subdet html pages:
2101 
2102  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
2103  ofstream htmlFile;
2104  if (sub == 1)
2105  htmlFile.open("HB.html");
2106  if (sub == 2)
2107  htmlFile.open("HE.html");
2108  if (sub == 3)
2109  htmlFile.open("HO.html");
2110  if (sub == 4)
2111  htmlFile.open("HF.html");
2112 
2113  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
2114  htmlFile << "<head>" << std::endl;
2115  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
2116  htmlFile << "<title> Remote Monitoring Tool </title>" << std::endl;
2117  htmlFile << "<style type=\"text/css\">" << std::endl;
2118  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
2119  << std::endl;
2120  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
2121  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
2122  "text-align: center;}"
2123  << std::endl;
2124  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
2125  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
2126  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
2127  htmlFile << " td.s5 { font-family: arial, arial ce, helvetica; background-color: #FF00FF; }" << std::endl;
2128  htmlFile << " td.s6 { font-family: arial, arial ce, helvetica; background-color: #9ACD32; }" << std::endl;
2129  htmlFile << " td.s7 { font-family: arial, arial ce, helvetica; background-color: #32CD32; }" << std::endl;
2130  htmlFile << " td.s8 { font-family: arial, arial ce, helvetica; background-color: #00FFFF; }" << std::endl;
2131  htmlFile << " td.s9 { font-family: arial, arial ce, helvetica; background-color: #FFE4E1; }" << std::endl;
2132  htmlFile << " td.s10 { font-family: arial, arial ce, helvetica; background-color: #A0522D; }" << std::endl;
2133  htmlFile << " td.s11 { font-family: arial, arial ce, helvetica; background-color: #1E90FF; }" << std::endl;
2134  htmlFile << " td.s12 { font-family: arial, arial ce, helvetica; background-color: #00BFFF; }" << std::endl;
2135  htmlFile << " td.s13 { font-family: arial, arial ce, helvetica; background-color: #FFFF00; }" << std::endl;
2136  htmlFile << " td.s14 { font-family: arial, arial ce, helvetica; background-color: #B8860B; }" << std::endl;
2137  htmlFile << "</style>" << std::endl;
2138  htmlFile << "<body>" << std::endl;
2139  if (sub == 1)
2140  htmlFile << "<h1> HCAL BARREL, RUN = " << runnumber << " </h1>" << std::endl;
2141  if (sub == 2)
2142  htmlFile << "<h1> HCAL ENDCAP, RUN = " << runnumber << " </h1>" << std::endl;
2143  if (sub == 3)
2144  htmlFile << "<h1> HCAL OUTER, RUN = " << runnumber << " </h1>" << std::endl;
2145  if (sub == 4)
2146  htmlFile << "<h1> HCAL FORWARD, RUN = " << runnumber << " </h1>" << std::endl;
2147  htmlFile << "<br>" << std::endl;
2148 
2149  htmlFile << "<a name=\"Top\"></a>\n";
2150  htmlFile << "<b>Contents:<br>\n";
2151  htmlFile << "1. <a href=\"#AnalysisResults\">Analysis results</a><br>\n";
2152  htmlFile << "2. <a href=\"#Status\">Status</a><br>\n";
2153  htmlFile << "2A. <a href=\"#ChannelMap\">Channel map</a><br>\n";
2154  // htmlFile << "2B. <a href=\"#BadChannels\">List of bad channels</a><br>\n";
2155  // htmlFile << "2C. <a href=\"#BadPedestals\">List of channels with bad pedestals</a><br>\n";
2156 
2157  htmlFile << "<a name=\"AnalysisResults\"></a>\n";
2158  if (sub == 1)
2159  htmlFile << "<h2> 1. Analysis results for HB</h2>" << std::endl;
2160  if (sub == 2)
2161  htmlFile << "<h2> 1. Analysis results for HE</h2>" << std::endl;
2162  if (sub == 3)
2163  htmlFile << "<h2> 1. Analysis results for HO</h2>" << std::endl;
2164  if (sub == 4)
2165  htmlFile << "<h2> 1. Analysis results for HF</h2>" << std::endl;
2166  htmlFile << "<table width=\"400\">" << std::endl;
2167  htmlFile << "<tr>" << std::endl;
2168 
2169  if (sub == 1) {
2170  // AZ 12.03.2019
2171  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
2172  << runnumber << "/HB_Tile.html\">Megatile Channels</a></td>" << std::endl;
2173  // htmlFile << " <td><a href=\"HB_Tile.html\">Megatile Channels</a></td>"<< std::endl;
2174 
2175  // htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"<<runnumber<<"/HB_Calib.html\">Calibration Channels</a></td>"<< std::endl;
2176  // htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"<<runnumber<<"/HB_Drift.html\">Gain Stability</a></td>"<< std::endl;
2177  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
2178  << runnumber << "/HB_Pedestals.html\">Pedestals</a></td>" << std::endl;
2179  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
2180  << runnumber << "/HB_Shapes.html\">ADC Shapes</a></td>" << std::endl;
2181  }
2182  if (sub == 2) {
2183  // AZ 12.03.2019
2184  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
2185  << runnumber << "/HE_Tile.html\">Megatile Channels</a></td>" << std::endl;
2186  // htmlFile << " <td><a href=\"HE_Tile.html\">Megatile Channels</a></td>"<< std::endl;
2187 
2188  // htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"<<runnumber<<"/HE_Calib.html\">Calibration Channels</a></td>"<< std::endl;
2189  // htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"<<runnumber<<"/HE_Drift.html\">Gain Stability</a></td>"<< std::endl;
2190  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
2191  << runnumber << "/HE_Pedestals.html\">Pedestals</a></td>" << std::endl;
2192  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
2193  << runnumber << "/HE_Shapes.html\">ADC Shapes</a></td>" << std::endl;
2194  }
2195  if (sub == 3) {
2196  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
2197  << runnumber << "/HO_Tile.html\">Megatile Channels</a></td>" << std::endl;
2198  // htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"<<runnumber<<"/HO_Calib.html\">Calibration Channels</a></td>"<< std::endl;
2199  // htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"<<runnumber<<"/HO_Drift.html\">Gain Stability</a></td>"<< std::endl;
2200  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
2201  << runnumber << "/HO_Pedestals.html\">Pedestals</a></td>" << std::endl;
2202  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
2203  << runnumber << "/HO_Shapes.html\">ADC Shapes</a></td>" << std::endl;
2204  }
2205  if (sub == 4) {
2206  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
2207  << runnumber << "/HF_Tile.html\">Megatile Channels</a></td>" << std::endl;
2208  // htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"<<runnumber<<"/HF_Calib.html\">Calibration Channels</a></td>"<< std::endl;
2209  // htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"<<runnumber<<"/HF_Drift.html\">Gain Stability</a></td>"<< std::endl;
2210  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
2211  << runnumber << "/HF_Pedestals.html\">Pedestals</a></td>" << std::endl;
2212  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
2213  << runnumber << "/HF_Shapes.html\">ADC Shapes</a></td>" << std::endl;
2214  }
2215 
2216  htmlFile << "</tr>" << std::endl;
2217  htmlFile << "</table>" << std::endl;
2218  htmlFile << "<br>" << std::endl;
2219 
2220  htmlFile << "<a name=\"Status\"></a>\n";
2221  if (sub == 1)
2222  htmlFile << "<h2> 2.Status HB over all criteria </h2>" << std::endl;
2223  if (sub == 2)
2224  htmlFile << "<h2> 2.Status HE over all criteria </h2>" << std::endl;
2225  if (sub == 3)
2226  htmlFile << "<h2> 2.Status HO over all criteria </h2>" << std::endl;
2227  if (sub == 4)
2228  htmlFile << "<h2> 2.Status HF over all criteria </h2>" << std::endl;
2229 
2230  htmlFile << "<a name=\"ChannelMap\"></a>\n";
2231  htmlFile << "<h3> 2.A.Channel map for each Depth </h3>" << std::endl;
2232  htmlFile << "<h4> Channel legend: yellow - good, white - "
2233  "not applicable or out of range </h4>"
2234  << std::endl;
2235  if (sub == 1)
2236  htmlFile << " <img src=\"MAPHB.png\" />" << std::endl;
2237  if (sub == 2)
2238  htmlFile << " <img src=\"MAPHE.png\" />" << std::endl;
2239  if (sub == 3)
2240  htmlFile << " <img src=\"MAPHO.png\" />" << std::endl;
2241  if (sub == 4)
2242  htmlFile << " <img src=\"MAPHF.png\" />" << std::endl;
2243  htmlFile << "<br>" << std::endl;
2244  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
2245 
2247  /*
2248 // htmlFile << "<h3> 2.B.List of Bad channels (rate > 0.1) and its rates for each RMT criteria (for GS - %) </h3>"<< std::endl;
2249 
2250  htmlFile << "<a name=\"BadChannels\"></a>\n";
2251  htmlFile << "<h3> 2.B.List of Bad channels (rate > 0.1) and its rates for each RMT criteria </h3>"<< std::endl;
2252 
2253  //htmlFile << " <td><a href=\"HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
2254  // 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;
2255  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;
2256 
2257  htmlFile << "<table>"<< std::endl;
2258  htmlFile << "<tr>";
2259  htmlFile << "<td class=\"s4\" align=\"center\">#</td>" << std::endl;
2260  htmlFile << "<td class=\"s1\" align=\"center\">ETA</td>" << std::endl;
2261  htmlFile << "<td class=\"s1\" align=\"center\">PHI</td>" << std::endl;
2262  htmlFile << "<td class=\"s1\" align=\"center\">DEPTH</td>"<< std::endl;
2263  htmlFile << "<td class=\"s1\" align=\"center\">RBX</td>" << std::endl;
2264  htmlFile << "<td class=\"s1\" align=\"center\">RM</td>" << std::endl;
2265  htmlFile << "<td class=\"s1\" align=\"center\">PIXEL</td>" << std::endl;
2266  htmlFile << "<td class=\"s1\" align=\"center\">RM_FIBER</td>" << std::endl;
2267  htmlFile << "<td class=\"s1\" align=\"center\">FIBER_CH</td>" << std::endl;
2268  htmlFile << "<td class=\"s1\" align=\"center\">QIE</td>" << std::endl;
2269  htmlFile << "<td class=\"s1\" align=\"center\">ADC</td>" << std::endl;
2270  htmlFile << "<td class=\"s1\" align=\"center\">CRATE</td>" << std::endl;
2271  htmlFile << "<td class=\"s1\" align=\"center\">DCC</td>" << std::endl;
2272  htmlFile << "<td class=\"s1\" align=\"center\">SPIGOT</td>" << std::endl;
2273  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FIBER</td>" << std::endl;
2274  htmlFile << "<td class=\"s1\" align=\"center\">HTR_SLOT</td>" << std::endl;
2275  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FPGA</td>" << std::endl;
2276  htmlFile << "<td class=\"s5\" align=\"center\">Cm</td>" << std::endl;
2277  htmlFile << "<td class=\"s5\" align=\"center\">Am</td>" << std::endl;
2278  htmlFile << "<td class=\"s5\" align=\"center\">Wm</td>" << std::endl;
2279  htmlFile << "<td class=\"s5\" align=\"center\">Rm</td>" << std::endl;
2280  htmlFile << "<td class=\"s5\" align=\"center\">TNm</td>" << std::endl;
2281  htmlFile << "<td class=\"s5\" align=\"center\">TXm</td>" << std::endl;
2282 // htmlFile << "<td class=\"s8\" align=\"center\">Cc</td>" << std::endl;
2283 // htmlFile << "<td class=\"s8\" align=\"center\">Ac</td>" << std::endl;
2284 // htmlFile << "<td class=\"s8\" align=\"center\">Wc</td>" << std::endl;
2285 // htmlFile << "<td class=\"s8\" align=\"center\">Rc</td>" << std::endl;
2286 // htmlFile << "<td class=\"s8\" align=\"center\">TNc</td>" << std::endl;
2287 // htmlFile << "<td class=\"s8\" align=\"center\">TXc</td>" << std::endl;
2288 // htmlFile << "<td class=\"s9\" align=\"center\">GS (%)</td>" << std::endl;
2289  htmlFile << "<td class=\"s4\" align=\"center\">Pm</td>" << std::endl;
2290  htmlFile << "<td class=\"s4\" align=\"center\">pWm</td>" << std::endl;
2291  htmlFile << "</tr>" << std::endl;
2292 
2293  for (int i=1;i<=NBad;i++) {
2294  if((ind%2)==1){
2295  raw_class="<td class=\"s2\" align=\"center\">";
2296  raw_class1="<td class=\"s6\" align=\"center\">";
2297  raw_class2="<td class=\"s11\" align=\"center\">";
2298  raw_class3="<td class=\"s13\" align=\"center\">";
2299 
2300  }else{
2301  raw_class="<td class=\"s3\" align=\"center\">";
2302  raw_class1="<td class=\"s7\" align=\"center\">";
2303  raw_class2="<td class=\"s12\" align=\"center\">";
2304  raw_class3="<td class=\"s14\" align=\"center\">";
2305  }
2306  const CellDB db;
2307  CellDB ce;
2308  if ((ce.size()>=1)&&(Sub[2][i]==sub)) {
2309  // AZ 19.03.2018
2310 
2311 // AZ 19 if (Sub[2][i]==1) {
2312 // AZ 19 ce = db.find("subdet", "HB").find("Eta", Eta[2][i]).find("Phi", Phi[2][i]).find("Depth", Depth[2][i]);
2313 // 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;}
2314 // 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;}
2315 // AZ 19 }
2316 // AZ 19 if (Sub[2][i]==2) {
2317 // AZ 19 ce = db.find("subdet", "HE").find("Eta", Eta[2][i]).find("Phi", Phi[2][i]).find("Depth", Depth[2][i]);
2318 // 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;}
2319 // 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;}
2320 // AZ 19 }
2321 // AZ 19 if (Sub[2][i]==3) {
2322 // AZ 19 ce = db.find("subdet", "HO").find("Eta", Eta[2][i]).find("Phi", Phi[2][i]).find("Depth", Depth[2][i]);
2323 // 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;}
2324 // 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;}
2325 // AZ 19 }
2326 // AZ 19 if (Sub[2][i]==4) {
2327 // AZ 19 ce = db.find("subdet", "HF").find("Eta", Eta[2][i]).find("Phi", Phi[2][i]).find("Depth", Depth[2][i]);
2328 // 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;}
2329 // 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;}
2330 // AZ 19 }
2331 
2332  htmlFile << "<tr>"<< std::endl;
2333  htmlFile << "<td class=\"s4\" align=\"center\">" << ind+1 <<"</td>"<< std::endl;
2334  htmlFile << raw_class<< Eta[2][i]<<"</td>"<< std::endl;
2335  htmlFile << raw_class<< Phi[2][i]<<"</td>"<< std::endl;
2336  htmlFile << raw_class<< Depth[2][i] <<"</td>"<< std::endl;
2337  htmlFile << raw_class<< ce[0].RBX <<"</td>"<< std::endl;
2338  htmlFile << raw_class<< ce[0].RM <<"</td>"<< std::endl;
2339  htmlFile << raw_class<< ce[0].Pixel <<"</td>"<< std::endl;
2340  htmlFile << raw_class<< ce[0].RMfiber <<"</td>"<< std::endl;
2341  htmlFile << raw_class<< ce[0].FiberCh <<"</td>"<< std::endl;
2342  htmlFile << raw_class<< ce[0].QIE <<"</td>"<< std::endl;
2343  htmlFile << raw_class<< ce[0].ADC<<"</td>"<< std::endl;
2344  htmlFile << raw_class<< ce[0].VMECardID <<"</td>"<< std::endl;
2345  htmlFile << raw_class<< ce[0].dccID <<"</td>"<< std::endl;
2346  htmlFile << raw_class<< ce[0].Spigot <<"</td>"<< std::endl;
2347  htmlFile << raw_class<< ce[0].FiberIndex <<"</td>"<< std::endl;
2348  htmlFile << raw_class<< ce[0].HtrSlot <<"</td>"<< std::endl;
2349  htmlFile << raw_class<< ce[0].HtrTB <<"</td>"<< std::endl;
2350  htmlFile << raw_class1<< Map_Ampl[1][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
2351  htmlFile << raw_class1<< Map_Ampl[2][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
2352  htmlFile << raw_class1<< Map_Ampl[3][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
2353  htmlFile << raw_class1<< Map_Ampl[4][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
2354  htmlFile << raw_class1<< Map_Ampl[5][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
2355  htmlFile << raw_class1<< Map_Ampl[6][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
2356 // htmlFile << raw_class2<< Map_Ampl[11][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
2357 // htmlFile << raw_class2<< Map_Ampl[12][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
2358 // htmlFile << raw_class2<< Map_Ampl[13][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
2359 // htmlFile << raw_class2<< Map_Ampl[14][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
2360 // htmlFile << raw_class2<< Map_Ampl[15][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
2361 // htmlFile << raw_class2<< Map_Ampl[16][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
2362 // htmlFile << raw_class3<< Map_Ampl[21][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
2363  htmlFile << raw_class<< Map_Ampl[31][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
2364  htmlFile << raw_class<< Map_Ampl[32][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i]+41,Phi[2][i]+1)<<"</td>"<< std::endl;
2365  htmlFile << "</tr>" << std::endl;
2366 
2367  ind+=1;
2368  }
2369  }
2370  htmlFile << "</table>" << std::endl;
2371  htmlFile << "<br>"<< std::endl;
2372  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
2373 
2374 
2375  htmlFile << "<h3> 2.C.List of Gain unstable channels and its value in % (for other criterias - rate)</h3>"<< std::endl;
2376  htmlFile << "<table>"<< std::endl;
2377  htmlFile << "<tr>";
2378  htmlFile << "<td class=\"s4\" align=\"center\">#</td>" << std::endl;
2379  htmlFile << "<td class=\"s1\" align=\"center\">ETA</td>" << std::endl;
2380  htmlFile << "<td class=\"s1\" align=\"center\">PHI</td>" << std::endl;
2381  htmlFile << "<td class=\"s1\" align=\"center\">DEPTH</td>"<< std::endl;
2382  htmlFile << "<td class=\"s1\" align=\"center\">RBX</td>" << std::endl;
2383  htmlFile << "<td class=\"s1\" align=\"center\">RM</td>" << std::endl;
2384  htmlFile << "<td class=\"s1\" align=\"center\">PIXEL</td>" << std::endl;
2385  htmlFile << "<td class=\"s1\" align=\"center\">RM_FIBER</td>" << std::endl;
2386  htmlFile << "<td class=\"s1\" align=\"center\">FIBER_CH</td>" << std::endl;
2387  htmlFile << "<td class=\"s1\" align=\"center\">QIE</td>" << std::endl;
2388  htmlFile << "<td class=\"s1\" align=\"center\">ADC</td>" << std::endl;
2389  htmlFile << "<td class=\"s1\" align=\"center\">CRATE</td>" << std::endl;
2390  htmlFile << "<td class=\"s1\" align=\"center\">DCC</td>" << std::endl;
2391  htmlFile << "<td class=\"s1\" align=\"center\">SPIGOT</td>" << std::endl;
2392  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FIBER</td>" << std::endl;
2393  htmlFile << "<td class=\"s1\" align=\"center\">HTR_SLOT</td>" << std::endl;
2394  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FPGA</td>" << std::endl;
2395  htmlFile << "<td class=\"s5\" align=\"center\">Cm</td>" << std::endl;
2396  htmlFile << "<td class=\"s5\" align=\"center\">Am</td>" << std::endl;
2397  htmlFile << "<td class=\"s5\" align=\"center\">Wm</td>" << std::endl;
2398  htmlFile << "<td class=\"s5\" align=\"center\">Rm</td>" << std::endl;
2399  htmlFile << "<td class=\"s5\" align=\"center\">TNm</td>" << std::endl;
2400  htmlFile << "<td class=\"s5\" align=\"center\">TXm</td>" << std::endl;
2401 // htmlFile << "<td class=\"s8\" align=\"center\">Cc</td>" << std::endl;
2402 // htmlFile << "<td class=\"s8\" align=\"center\">Ac</td>" << std::endl;
2403 // htmlFile << "<td class=\"s8\" align=\"center\">Wc</td>" << std::endl;
2404 // htmlFile << "<td class=\"s8\" align=\"center\">Rc</td>" << std::endl;
2405 // htmlFile << "<td class=\"s8\" align=\"center\">TNc</td>" << std::endl;
2406 // htmlFile << "<td class=\"s8\" align=\"center\">TXc</td>" << std::endl;
2407 // htmlFile << "<td class=\"s9\" align=\"center\">GS(%)</td>" << std::endl;
2408  htmlFile << "<td class=\"s4\" align=\"center\">Pm</td>" << std::endl;
2409  htmlFile << "<td class=\"s4\" align=\"center\">pWm</td>" << std::endl;
2410  htmlFile << "</tr>" << std::endl;
2411 
2412  for (int i=1;i<=NWarn;i++) {
2413  if((ind%2)==1){
2414  raw_class="<td class=\"s2\" align=\"center\">";
2415  raw_class1="<td class=\"s6\" align=\"center\">";
2416  raw_class2="<td class=\"s11\" align=\"center\">";
2417  raw_class3="<td class=\"s13\" align=\"center\">";
2418 
2419  }else{
2420  raw_class="<td class=\"s3\" align=\"center\">";
2421  raw_class1="<td class=\"s7\" align=\"center\">";
2422  raw_class2="<td class=\"s12\" align=\"center\">";
2423  raw_class3="<td class=\"s14\" align=\"center\">";
2424  }
2425  const CellDB db;
2426  CellDB ce;
2427  if ((ce.size()>=1)&&(Sub[1][i]==sub)) {
2428  if (Sub[1][i]==1) {
2429  ce = db.find("subdet", "HB").find("Eta", Eta[1][i]).find("Phi", Phi[1][i]).find("Depth", Depth[1][i]);
2430  if (ce.size()==0) {cout<<"Error: No such HB, Eta="<< Eta[1][i] <<", Phi="<< Phi[1][i] <<", Depth="<< Depth[1][i] <<" in database"<<endl;}
2431  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;}
2432  }
2433  if (Sub[1][i]==2) {
2434  ce = db.find("subdet", "HE").find("Eta", Eta[1][i]).find("Phi", Phi[1][i]).find("Depth", Depth[1][i]);
2435  if (ce.size()==0) {cout<<"Error: No such HE, Eta="<< Eta[1][i] <<", Phi="<< Phi[1][i] <<", Depth="<< Depth[1][i] <<" in database"<<endl;}
2436  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;}
2437  }
2438  if (Sub[1][i]==3) {
2439  ce = db.find("subdet", "HO").find("Eta", Eta[1][i]).find("Phi", Phi[1][i]).find("Depth", Depth[1][i]);
2440  if (ce.size()==0) {cout<<"Error: No such HO, Eta="<< Eta[1][i] <<", Phi="<< Phi[1][i] <<", Depth="<< Depth[1][i] <<" in database"<<endl;}
2441  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;}
2442  }
2443  if (Sub[1][i]==4) {
2444  ce = db.find("subdet", "HF").find("Eta", Eta[1][i]).find("Phi", Phi[1][i]).find("Depth", Depth[1][i]);
2445  if (ce.size()==0) {cout<<"Error: No such HF, Eta="<< Eta[1][i] <<", Phi="<< Phi[1][i] <<", Depth="<< Depth[1][i] <<" in database"<<endl;}
2446  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;}
2447  }
2448  htmlFile << "<td class=\"s4\" align=\"center\">" << ind+1 <<"</td>"<< std::endl;
2449  htmlFile << raw_class<< Eta[1][i]<<"</td>"<< std::endl;
2450  htmlFile << raw_class<< Phi[1][i]<<"</td>"<< std::endl;
2451  htmlFile << raw_class<< Depth[1][i] <<"</td>"<< std::endl;
2452  htmlFile << raw_class<< ce[0].RBX <<"</td>"<< std::endl;
2453  htmlFile << raw_class<< ce[0].RM <<"</td>"<< std::endl;
2454  htmlFile << raw_class<< ce[0].Pixel <<"</td>"<< std::endl;
2455  htmlFile << raw_class<< ce[0].RMfiber <<"</td>"<< std::endl;
2456  htmlFile << raw_class<< ce[0].FiberCh <<"</td>"<< std::endl;
2457  htmlFile << raw_class<< ce[0].QIE <<"</td>"<< std::endl;
2458  htmlFile << raw_class<< ce[0].ADC<<"</td>"<< std::endl;
2459  htmlFile << raw_class<< ce[0].VMECardID <<"</td>"<< std::endl;
2460  htmlFile << raw_class<< ce[0].dccID <<"</td>"<< std::endl;
2461  htmlFile << raw_class<< ce[0].Spigot <<"</td>"<< std::endl;
2462  htmlFile << raw_class<< ce[0].FiberIndex <<"</td>"<< std::endl;
2463  htmlFile << raw_class<< ce[0].HtrSlot <<"</td>"<< std::endl;
2464  htmlFile << raw_class<< ce[0].HtrTB <<"</td>"<< std::endl;
2465  htmlFile << raw_class1<< Map_Ampl[1][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
2466  htmlFile << raw_class1<< Map_Ampl[2][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
2467  htmlFile << raw_class1<< Map_Ampl[3][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
2468  htmlFile << raw_class1<< Map_Ampl[4][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
2469  htmlFile << raw_class1<< Map_Ampl[5][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
2470  htmlFile << raw_class1<< Map_Ampl[6][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
2471 // htmlFile << raw_class2<< Map_Ampl[11][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
2472 // htmlFile << raw_class2<< Map_Ampl[12][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
2473 // htmlFile << raw_class2<< Map_Ampl[13][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
2474 // htmlFile << raw_class2<< Map_Ampl[14][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
2475 // htmlFile << raw_class2<< Map_Ampl[15][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
2476 // htmlFile << raw_class2<< Map_Ampl[16][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
2477 // htmlFile << raw_class3<< Map_Ampl[21][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
2478  htmlFile << raw_class<< Map_Ampl[31][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
2479  htmlFile << raw_class<< Map_Ampl[32][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i]+41,Phi[1][i]+1)<<"</td>"<< std::endl;
2480  htmlFile << "</tr>" << std::endl;
2481  htmlFile << "</tr>" << std::endl;
2482  ind+=1;
2483  }
2484  }
2485  htmlFile << "</table>" << std::endl;
2486  htmlFile << "<br>"<< std::endl;
2487 
2488 
2489 // htmlFile << "<h3> 2.D.List of channels with Bad Pedestals (rate > 0.1) and its rates (for GS - %)</h3>"<< std::endl;
2490  htmlFile << "<a name=\"BadPedestals\"></a>\n";
2491  htmlFile << "<h3> 2.C.List of channels with Bad Pedestals (rate > 0.1) and its rates </h3>"<< std::endl;
2492  htmlFile << "<table>"<< std::endl;
2493  htmlFile << "<tr>";
2494  htmlFile << "<td class=\"s4\" align=\"center\">#</td>" << std::endl;
2495  htmlFile << "<td class=\"s1\" align=\"center\">ETA</td>" << std::endl;
2496  htmlFile << "<td class=\"s1\" align=\"center\">PHI</td>" << std::endl;
2497  htmlFile << "<td class=\"s1\" align=\"center\">DEPTH</td>"<< std::endl;
2498  htmlFile << "<td class=\"s1\" align=\"center\">RBX</td>" << std::endl;
2499  htmlFile << "<td class=\"s1\" align=\"center\">RM</td>" << std::endl;
2500  htmlFile << "<td class=\"s1\" align=\"center\">PIXEL</td>" << std::endl;
2501  htmlFile << "<td class=\"s1\" align=\"center\">RM_FIBER</td>" << std::endl;
2502  htmlFile << "<td class=\"s1\" align=\"center\">FIBER_CH</td>" << std::endl;
2503  htmlFile << "<td class=\"s1\" align=\"center\">QIE</td>" << std::endl;
2504  htmlFile << "<td class=\"s1\" align=\"center\">ADC</td>" << std::endl;
2505  htmlFile << "<td class=\"s1\" align=\"center\">CRATE</td>" << std::endl;
2506  htmlFile << "<td class=\"s1\" align=\"center\">DCC</td>" << std::endl;
2507  htmlFile << "<td class=\"s1\" align=\"center\">SPIGOT</td>" << std::endl;
2508  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FIBER</td>" << std::endl;
2509  htmlFile << "<td class=\"s1\" align=\"center\">HTR_SLOT</td>" << std::endl;
2510  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FPGA</td>" << std::endl;
2511  htmlFile << "<td class=\"s5\" align=\"center\">Cm</td>" << std::endl;
2512  htmlFile << "<td class=\"s5\" align=\"center\">Am</td>" << std::endl;
2513  htmlFile << "<td class=\"s5\" align=\"center\">Wm</td>" << std::endl;
2514  htmlFile << "<td class=\"s5\" align=\"center\">Rm</td>" << std::endl;
2515  htmlFile << "<td class=\"s5\" align=\"center\">TNm</td>" << std::endl;
2516  htmlFile << "<td class=\"s5\" align=\"center\">TXm</td>" << std::endl;
2517 // htmlFile << "<td class=\"s8\" align=\"center\">Cc</td>" << std::endl;
2518 // htmlFile << "<td class=\"s8\" align=\"center\">Ac</td>" << std::endl;
2519 // htmlFile << "<td class=\"s8\" align=\"center\">Wc</td>" << std::endl;
2520 // htmlFile << "<td class=\"s8\" align=\"center\">Rc</td>" << std::endl;
2521 // htmlFile << "<td class=\"s8\" align=\"center\">TNc</td>" << std::endl;
2522 // htmlFile << "<td class=\"s8\" align=\"center\">TXc</td>" << std::endl;
2523 // htmlFile << "<td class=\"s9\" align=\"center\">GS(%)</td>" << std::endl;
2524  htmlFile << "<td class=\"s4\" align=\"center\">Pm</td>" << std::endl;
2525  htmlFile << "<td class=\"s4\" align=\"center\">pWm</td>" << std::endl;
2526  htmlFile << "</tr>" << std::endl;
2527 
2528  for (int i=1;i<=NPed;i++) {
2529  if((ind%2)==1){
2530  raw_class="<td class=\"s2\" align=\"center\">";
2531  raw_class1="<td class=\"s6\" align=\"center\">";
2532  raw_class2="<td class=\"s11\" align=\"center\">";
2533  raw_class3="<td class=\"s13\" align=\"center\">";
2534 
2535  }else{
2536  raw_class="<td class=\"s3\" align=\"center\">";
2537  raw_class1="<td class=\"s7\" align=\"center\">";
2538  raw_class2="<td class=\"s12\" align=\"center\">";
2539  raw_class3="<td class=\"s14\" align=\"center\">";
2540  }
2541  const CellDB db;
2542  CellDB ce;
2543  if ((ce.size()>=1)&&(Sub[3][i]==sub)) {
2544 
2545  // AZ 19.03.2018
2546 // AZ 19 if (Sub[3][i]==1) {
2547 // AZ 19 ce = db.find("subdet", "HB").find("Eta", Eta[3][i]).find("Phi", Phi[3][i]).find("Depth", Depth[3][i]);
2548 // 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;}
2549 // 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;}
2550 // AZ 19 }
2551 // AZ 19 if (Sub[3][i]==2) {
2552 // AZ 19 ce = db.find("subdet", "HE").find("Eta", Eta[3][i]).find("Phi", Phi[3][i]).find("Depth", Depth[3][i]);
2553 // 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;}
2554 // 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;}
2555 // AZ 19 }
2556 // AZ 19 if (Sub[3][i]==3) {
2557 // AZ 19 ce = db.find("subdet", "HO").find("Eta", Eta[3][i]).find("Phi", Phi[3][i]).find("Depth", Depth[3][i]);
2558 // 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;}
2559 // 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;}
2560 // AZ 19 }
2561 // AZ 19 if (Sub[3][i]==4) {
2562 // AZ 19 ce = db.find("subdet", "HF").find("Eta", Eta[3][i]).find("Phi", Phi[3][i]).find("Depth", Depth[3][i]);
2563 // 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;}
2564 // 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;}
2565 // AZ 19 }
2566 
2567  htmlFile << "<td class=\"s4\" align=\"center\">" << ind+1 <<"</td>"<< std::endl;
2568  htmlFile << raw_class<< Eta[3][i]<<"</td>"<< std::endl;
2569  htmlFile << raw_class<< Phi[3][i]<<"</td>"<< std::endl;
2570  htmlFile << raw_class<< Depth[3][i] <<"</td>"<< std::endl;
2571  htmlFile << raw_class<< ce[0].RBX <<"</td>"<< std::endl;
2572  htmlFile << raw_class<< ce[0].RM <<"</td>"<< std::endl;
2573  htmlFile << raw_class<< ce[0].Pixel <<"</td>"<< std::endl;
2574  htmlFile << raw_class<< ce[0].RMfiber <<"</td>"<< std::endl;
2575  htmlFile << raw_class<< ce[0].FiberCh <<"</td>"<< std::endl;
2576  htmlFile << raw_class<< ce[0].QIE <<"</td>"<< std::endl;
2577  htmlFile << raw_class<< ce[0].ADC<<"</td>"<< std::endl;
2578  htmlFile << raw_class<< ce[0].VMECardID <<"</td>"<< std::endl;
2579  htmlFile << raw_class<< ce[0].dccID <<"</td>"<< std::endl;
2580  htmlFile << raw_class<< ce[0].Spigot <<"</td>"<< std::endl;
2581  htmlFile << raw_class<< ce[0].FiberIndex <<"</td>"<< std::endl;
2582  htmlFile << raw_class<< ce[0].HtrSlot <<"</td>"<< std::endl;
2583  htmlFile << raw_class<< ce[0].HtrTB <<"</td>"<< std::endl;
2584  htmlFile << raw_class1<< Map_Ampl[1][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
2585  htmlFile << raw_class1<< Map_Ampl[2][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
2586  htmlFile << raw_class1<< Map_Ampl[3][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
2587  htmlFile << raw_class1<< Map_Ampl[4][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
2588  htmlFile << raw_class1<< Map_Ampl[5][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
2589  htmlFile << raw_class1<< Map_Ampl[6][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
2590 // htmlFile << raw_class2<< Map_Ampl[11][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
2591 // htmlFile << raw_class2<< Map_Ampl[12][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
2592 // htmlFile << raw_class2<< Map_Ampl[13][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
2593 // htmlFile << raw_class2<< Map_Ampl[14][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
2594 // htmlFile << raw_class2<< Map_Ampl[15][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
2595 // htmlFile << raw_class2<< Map_Ampl[16][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
2596 // htmlFile << raw_class3<< Map_Ampl[21][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
2597  htmlFile << raw_class<< Map_Ampl[31][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
2598  htmlFile << raw_class<< Map_Ampl[32][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i]+41,Phi[3][i]+1)<<"</td>"<< std::endl;
2599  htmlFile << "</tr>" << std::endl;
2600  htmlFile << "</tr>" << std::endl;
2601  ind+=1;
2602  }
2603  }
2604  htmlFile << "</table><br>" << std::endl;
2605  htmlFile << "<a href=\"#Top\">to top</a><br>\n";
2606 */
2608 
2609  htmlFile << "</body> " << std::endl;
2610  htmlFile << "</html> " << std::endl;
2611  htmlFile.close();
2612  }
2613 
2614  //======================================================================
2615  // Creating description html file:
2616  ofstream htmlFile;
2617 
2618  //======================================================================
2619  /*
2620  htmlFile.open("HELP.html");
2621  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">"<< std::endl;
2622  htmlFile << "<head>"<< std::endl;
2623  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>"<< std::endl;
2624  htmlFile << "<title> Remote Monitoring Tool </title>"<< std::endl;
2625  htmlFile << "<style type=\"text/css\">"<< std::endl;
2626  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"<< std::endl;
2627  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }"<< std::endl;
2628  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; text-align: center;}"<< std::endl;
2629  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }"<< std::endl;
2630  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }"<< std::endl;
2631  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }"<< std::endl;
2632  htmlFile << "</style>"<< std::endl;
2633  htmlFile << "<body>"<< std::endl;
2634  htmlFile << "<h1> Description of Remote Monitoring Tool criteria for bad channel selection</h1>"<< std::endl;
2635  htmlFile << "<br>"<< std::endl;
2636  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;
2637  htmlFile << "<br>"<< std::endl;
2638  htmlFile << "<h3> - A means full amplitude, collected over all time slices </h3> "<< std::endl;
2639  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;
2640  htmlFile << "<br>"<< std::endl;
2641  htmlFile << "<h3> - W means width of shape distribution. Width is defined as square root from dispersion. </h3> "<< std::endl;
2642  htmlFile << "<br>"<< std::endl;
2643  htmlFile << "<h3> - TN means mean time position of adc signal. </h3> "<< std::endl;
2644  htmlFile << "<br>"<< std::endl;
2645  htmlFile << "<h3> - TX means TS number of maximum signal </h3> "<< std::endl;
2646  htmlFile << "<br>"<< std::endl;
2647  htmlFile << "<h3> - m means megatile channels. For example Am means Amplitude criteria for megatile channels </h3> "<< std::endl;
2648  htmlFile << "<br>"<< std::endl;
2649  htmlFile << "<h3> - c means calibration channels. For example Ac means Amplitude criteria for calibration channels </h3> "<< std::endl;
2650  htmlFile << "<br>"<< std::endl;
2651  htmlFile << "<h3> - Pm means Pedestals. </h3> "<< std::endl;
2652  htmlFile << "<br>"<< std::endl;
2653  htmlFile << "<h3> - pWm means pedestal Width. </h3> "<< std::endl;
2654  htmlFile << "<br>"<< std::endl;
2655  htmlFile << "</body> " << std::endl;
2656  htmlFile << "</html> " << std::endl;
2657  htmlFile.close();
2658 */
2659  //======================================================================
2660 
2661  //======================================================================
2662  // Creating main html file:
2663  htmlFile.open("MAP.html");
2664  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
2665  htmlFile << "<head>" << std::endl;
2666  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
2667  htmlFile << "<title> Remote Monitoring Tool </title>" << std::endl;
2668  htmlFile << "<style type=\"text/css\">" << std::endl;
2669  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
2670  << std::endl;
2671  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
2672  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
2673  "text-align: center;}"
2674  << std::endl;
2675  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
2676  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
2677  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
2678  htmlFile << " td.s5 { font-family: arial, arial ce, helvetica; background-color: #FF00FF; }" << std::endl;
2679  htmlFile << " td.s6 { font-family: arial, arial ce, helvetica; background-color: #9ACD32; }" << std::endl;
2680  htmlFile << " td.s7 { font-family: arial, arial ce, helvetica; background-color: #32CD32; }" << std::endl;
2681  htmlFile << "</style>" << std::endl;
2682  htmlFile << "<body>" << std::endl;
2683 
2684  htmlFile << "<h1> Remote Monitoring Tool, RUN = " << runnumber << ". </h1>" << std::endl;
2685  htmlFile << "<br>" << std::endl;
2686 
2687  htmlFile << "<h2> 1. Analysis results for subdetectors </h2>" << std::endl;
2688  htmlFile << "<table width=\"400\">" << std::endl;
2689  htmlFile << "<tr>" << std::endl;
2690 
2691  // AZ 12.03.2019
2692  /*
2693  htmlFile << " <td><a href=\"HB.html\">HB</a></td>"<< std::endl;
2694  htmlFile << " <td><a href=\"HE.html\">HE</a></td>"<< std::endl;
2695  htmlFile << " <td><a href=\"HO.html\">HO</a></td>"<< std::endl;
2696  htmlFile << " <td><a href=\"HF.html\">HF</a></td>"<< std::endl;
2697 */
2698 
2699  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
2700  << runnumber << "/HB.html\">HB</a></td>" << std::endl;
2701  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
2702  << runnumber << "/HE.html\">HE</a></td>" << std::endl;
2703  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
2704  << runnumber << "/HO.html\">HO</a></td>" << std::endl;
2705  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/GLOBAL_"
2706  << runnumber << "/HF.html\">HF</a></td>" << std::endl;
2707 
2708  htmlFile << "</tr>" << std::endl;
2709  htmlFile << "</table>" << std::endl;
2710  htmlFile << "<br>" << std::endl;
2711 
2712  htmlFile << "<h2> 2. HCAL status over all criteria and subdetectors </h2>" << std::endl;
2713  htmlFile << "<h3> 2.A. Channels in detector space </h3>" << std::endl;
2714  htmlFile << "<h4> Legend for channel status: green - good, others - may be a problems, white - not applicable or out "
2715  "of range </h4>"
2716  << std::endl;
2717  htmlFile << " <img src=\"MAP.png\" />" << std::endl;
2718  htmlFile << "<br>" << std::endl;
2719 
2720  htmlFile << "<h3> 2.B. List of Bad channels </h3>" << std::endl;
2721 
2722  //htmlFile << " <td><a href=\"HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
2723  // 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;
2724  htmlFile << " <td><a href=\"https://cms-conddb.cern.ch/eosweb/hcal/HcalRemoteMonitoring/GlobalRMT/HELP.html\"> "
2725  "Description of criteria for bad channel selection</a></td>"
2726  << std::endl;
2727 
2728  htmlFile << "<table>" << std::endl;
2729  htmlFile << "<tr>";
2730  htmlFile << "<td class=\"s4\" align=\"center\">#</td>" << std::endl;
2731  htmlFile << "<td class=\"s1\" align=\"center\">ETA</td>" << std::endl;
2732  htmlFile << "<td class=\"s1\" align=\"center\">PHI</td>" << std::endl;
2733  htmlFile << "<td class=\"s1\" align=\"center\">DEPTH</td>" << std::endl;
2734  htmlFile << "<td class=\"s1\" align=\"center\">RBX</td>" << std::endl;
2735  htmlFile << "<td class=\"s1\" align=\"center\">RM</td>" << std::endl;
2736  htmlFile << "<td class=\"s1\" align=\"center\">PIXEL</td>" << std::endl;
2737  htmlFile << "<td class=\"s1\" align=\"center\">RM_FIBER</td>" << std::endl;
2738  htmlFile << "<td class=\"s1\" align=\"center\">FIBER_CH</td>" << std::endl;
2739  htmlFile << "<td class=\"s1\" align=\"center\">QIE</td>" << std::endl;
2740  htmlFile << "<td class=\"s1\" align=\"center\">ADC</td>" << std::endl;
2741  htmlFile << "<td class=\"s1\" align=\"center\">CRATE</td>" << std::endl;
2742  htmlFile << "<td class=\"s1\" align=\"center\">DCC</td>" << std::endl;
2743  htmlFile << "<td class=\"s1\" align=\"center\">SPIGOT</td>" << std::endl;
2744  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FIBER</td>" << std::endl;
2745  htmlFile << "<td class=\"s1\" align=\"center\">HTR_SLOT</td>" << std::endl;
2746  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FPGA</td>" << std::endl;
2747  htmlFile << "<td class=\"s5\" align=\"center\">RMT-criteria</td>" << std::endl;
2748  htmlFile << "</tr>" << std::endl;
2749 
2750  ind = 0;
2751  // AZ 19.03.2018
2752  /*
2753  for (int i=1;i<=NBad;i++) {
2754  if((ind%2)==1){
2755  raw_class="<td class=\"s2\" align=\"center\">";
2756  raw_class1="<td class=\"s6\" align=\"center\">";
2757  }else{
2758  raw_class="<td class=\"s3\" align=\"center\">";
2759  raw_class1="<td class=\"s7\" align=\"center\">";
2760  }
2761  const CellDB db;
2762  const CellDB ce = db.find("Eta", Eta[2][i]).find("Phi", Phi[2][i]).find("Depth", Depth[2][i]);
2763  // if (ce.size()==0) {cout<<"Error: No such Eta="<< Eta[2][i] <<", Phi="<< Phi[2][i] <<", Depth="<< Depth[2][i] <<" in database"<<endl;continue;}
2764 // 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;}
2765 
2766  if (ce.size()>=1) {
2767  htmlFile << "<tr>"<< std::endl;
2768  htmlFile << "<td class=\"s1\" align=\"center\">" << ind+1 <<"</td>"<< std::endl;
2769  htmlFile << raw_class<< Eta[2][i]<<"</td>"<< std::endl;
2770  htmlFile << raw_class<< Phi[2][i]<<"</td>"<< std::endl;
2771  htmlFile << raw_class<< Depth[2][i] <<"</td>"<< std::endl;
2772  htmlFile << raw_class<< ce[0].RBX <<"</td>"<< std::endl;
2773  htmlFile << raw_class<< ce[0].RM <<"</td>"<< std::endl;
2774  htmlFile << raw_class<< ce[0].Pixel <<"</td>"<< std::endl;
2775  htmlFile << raw_class<< ce[0].RMfiber <<"</td>"<< std::endl;
2776  htmlFile << raw_class<< ce[0].FiberCh <<"</td>"<< std::endl;
2777  htmlFile << raw_class<< ce[0].QIE <<"</td>"<< std::endl;
2778  htmlFile << raw_class<< ce[0].ADC<<"</td>"<< std::endl;
2779  htmlFile << raw_class<< ce[0].VMECardID <<"</td>"<< std::endl;
2780  htmlFile << raw_class<< ce[0].dccID <<"</td>"<< std::endl;
2781  htmlFile << raw_class<< ce[0].Spigot <<"</td>"<< std::endl;
2782  htmlFile << raw_class<< ce[0].FiberIndex <<"</td>"<< std::endl;
2783  htmlFile << raw_class<< ce[0].HtrSlot <<"</td>"<< std::endl;
2784  htmlFile << raw_class<< ce[0].HtrTB <<"</td>"<< std::endl;
2785  htmlFile << raw_class1<< Comment[2][i]<<"</td>"<< std::endl;
2786  htmlFile << "</tr>" << std::endl;
2787 
2788  ind+=1;
2789  }
2790  } /// end loop
2791 */
2792  htmlFile << "</table>" << std::endl;
2793  htmlFile << "<br>" << std::endl;
2794  /*
2795  htmlFile << "<h3> 2.C.List of Gain unstable channels </h3>"<< std::endl;
2796  //htmlFile << " <td><a href=\"HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
2797  // 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;
2798  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;
2799 
2800  htmlFile << "<table>"<< std::endl;
2801  htmlFile << "<tr>";
2802  htmlFile << "<td class=\"s4\" align=\"center\">#</td>" << std::endl;
2803  htmlFile << "<td class=\"s1\" align=\"center\">ETA</td>" << std::endl;
2804  htmlFile << "<td class=\"s1\" align=\"center\">PHI</td>" << std::endl;
2805  htmlFile << "<td class=\"s1\" align=\"center\">DEPTH</td>"<< std::endl;
2806  htmlFile << "<td class=\"s1\" align=\"center\">RBX</td>" << std::endl;
2807  htmlFile << "<td class=\"s1\" align=\"center\">RM</td>" << std::endl;
2808  htmlFile << "<td class=\"s1\" align=\"center\">PIXEL</td>" << std::endl;
2809  htmlFile << "<td class=\"s1\" align=\"center\">RM_FIBER</td>" << std::endl;
2810  htmlFile << "<td class=\"s1\" align=\"center\">FIBER_CH</td>" << std::endl;
2811  htmlFile << "<td class=\"s1\" align=\"center\">QIE</td>" << std::endl;
2812  htmlFile << "<td class=\"s1\" align=\"center\">ADC</td>" << std::endl;
2813  htmlFile << "<td class=\"s1\" align=\"center\">CRATE</td>" << std::endl;
2814  htmlFile << "<td class=\"s1\" align=\"center\">DCC</td>" << std::endl;
2815  htmlFile << "<td class=\"s1\" align=\"center\">SPIGOT</td>" << std::endl;
2816  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FIBER</td>" << std::endl;
2817  htmlFile << "<td class=\"s1\" align=\"center\">HTR_SLOT</td>" << std::endl;
2818  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FPGA</td>" << std::endl;
2819  htmlFile << "<td class=\"s5\" align=\"center\">Failed criteria</td>" << std::endl;
2820  htmlFile << "</tr>" << std::endl;
2821 
2822  for (int i=1;i<=NWarn;i++) {
2823  if((ind%2)==1){
2824  raw_class="<td class=\"s2\" align=\"center\">";
2825  raw_class1="<td class=\"s6\" align=\"center\">";
2826  }else{
2827  raw_class="<td class=\"s3\" align=\"center\">";
2828  raw_class1="<td class=\"s7\" align=\"center\">";
2829  }
2830  const CellDB db;
2831  const CellDB ce = db.find("Eta", Eta[1][i]).find("Phi", Phi[1][i]).find("Depth", Depth[1][i]);
2832  // if (ce.size()==0) {cout<<"Error: No such Eta="<< Eta[1][i] <<", Phi="<< Phi[1][i] <<", Depth="<< Depth[1][i] <<" in database"<<endl;continue;}
2833 // 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;}
2834 
2835  if (ce.size()>=1) {
2836  htmlFile << "<tr>"<< std::endl;
2837  htmlFile << "<td class=\"s1\" align=\"center\">" << ind+1 <<"</td>"<< std::endl;
2838  htmlFile << raw_class<< Eta[1][i]<<"</td>"<< std::endl;
2839  htmlFile << raw_class<< Phi[1][i]<<"</td>"<< std::endl;
2840  htmlFile << raw_class<< Depth[1][i] <<"</td>"<< std::endl;
2841  htmlFile << raw_class<< ce[0].RBX <<"</td>"<< std::endl;
2842  htmlFile << raw_class<< ce[0].RM <<"</td>"<< std::endl;
2843  htmlFile << raw_class<< ce[0].Pixel <<"</td>"<< std::endl;
2844  htmlFile << raw_class<< ce[0].RMfiber <<"</td>"<< std::endl;
2845  htmlFile << raw_class<< ce[0].FiberCh <<"</td>"<< std::endl;
2846  htmlFile << raw_class<< ce[0].QIE <<"</td>"<< std::endl;
2847  htmlFile << raw_class<< ce[0].ADC<<"</td>"<< std::endl;
2848  htmlFile << raw_class<< ce[0].VMECardID <<"</td>"<< std::endl;
2849  htmlFile << raw_class<< ce[0].dccID <<"</td>"<< std::endl;
2850  htmlFile << raw_class<< ce[0].Spigot <<"</td>"<< std::endl;
2851  htmlFile << raw_class<< ce[0].FiberIndex <<"</td>"<< std::endl;
2852  htmlFile << raw_class<< ce[0].HtrSlot <<"</td>"<< std::endl;
2853  htmlFile << raw_class<< ce[0].HtrTB <<"</td>"<< std::endl;
2854  htmlFile << raw_class1<< Comment[1][i]<<"</td>"<< std::endl;
2855  htmlFile << "</tr>" << std::endl;
2856 
2857  ind+=1;
2858  }
2859  }
2860 
2861 
2862  htmlFile << "</table>" << std::endl;
2863  htmlFile << "<br>"<< std::endl;
2864 
2865 
2866  htmlFile << "<h3> 2.D.List of channels with bad Pedestals </h3>"<< std::endl;
2867  // htmlFile << " <td><a href=\"HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
2868  // 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;
2869  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;
2870 
2871  htmlFile << "<table>"<< std::endl;
2872  htmlFile << "<tr>";
2873  htmlFile << "<td class=\"s4\" align=\"center\">#</td>" << std::endl;
2874  htmlFile << "<td class=\"s1\" align=\"center\">ETA</td>" << std::endl;
2875  htmlFile << "<td class=\"s1\" align=\"center\">PHI</td>" << std::endl;
2876  htmlFile << "<td class=\"s1\" align=\"center\">DEPTH</td>"<< std::endl;
2877  htmlFile << "<td class=\"s1\" align=\"center\">RBX</td>" << std::endl;
2878  htmlFile << "<td class=\"s1\" align=\"center\">RM</td>" << std::endl;
2879  htmlFile << "<td class=\"s1\" align=\"center\">PIXEL</td>" << std::endl;
2880  htmlFile << "<td class=\"s1\" align=\"center\">RM_FIBER</td>" << std::endl;
2881  htmlFile << "<td class=\"s1\" align=\"center\">FIBER_CH</td>" << std::endl;
2882  htmlFile << "<td class=\"s1\" align=\"center\">QIE</td>" << std::endl;
2883  htmlFile << "<td class=\"s1\" align=\"center\">ADC</td>" << std::endl;
2884  htmlFile << "<td class=\"s1\" align=\"center\">CRATE</td>" << std::endl;
2885  htmlFile << "<td class=\"s1\" align=\"center\">DCC</td>" << std::endl;
2886  htmlFile << "<td class=\"s1\" align=\"center\">SPIGOT</td>" << std::endl;
2887  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FIBER</td>" << std::endl;
2888  htmlFile << "<td class=\"s1\" align=\"center\">HTR_SLOT</td>" << std::endl;
2889  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FPGA</td>" << std::endl;
2890  htmlFile << "<td class=\"s5\" align=\"center\">Failed criteria</td>" << std::endl;
2891  htmlFile << "</tr>" << std::endl;
2892 
2893  for (int i=1;i<=NPed;i++) {
2894  if((ind%2)==1){
2895  raw_class="<td class=\"s2\" align=\"center\">";
2896  raw_class1="<td class=\"s6\" align=\"center\">";
2897  }else{
2898  raw_class="<td class=\"s3\" align=\"center\">";
2899  raw_class1="<td class=\"s7\" align=\"center\">";
2900  }
2901  const CellDB db;
2902  const CellDB ce = db.find("Eta", Eta[3][i]).find("Phi", Phi[3][i]).find("Depth", Depth[3][i]);
2903  // if (ce.size()==0) {cout<<"Error: No such Eta="<< Eta[3][i] <<", Phi="<< Phi[3][i] <<", Depth="<< Depth[3][i] <<" in database"<<endl;continue;}
2904 // 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;}
2905 
2906  if (ce.size()>=1) {
2907  htmlFile << "<tr>"<< std::endl;
2908  htmlFile << "<td class=\"s1\" align=\"center\">" << ind+1 <<"</td>"<< std::endl;
2909  htmlFile << raw_class<< Eta[3][i]<<"</td>"<< std::endl;
2910  htmlFile << raw_class<< Phi[3][i]<<"</td>"<< std::endl;
2911  htmlFile << raw_class<< Depth[3][i] <<"</td>"<< std::endl;
2912  htmlFile << raw_class<< ce[0].RBX <<"</td>"<< std::endl;
2913  htmlFile << raw_class<< ce[0].RM <<"</td>"<< std::endl;
2914  htmlFile << raw_class<< ce[0].Pixel <<"</td>"<< std::endl;
2915  htmlFile << raw_class<< ce[0].RMfiber <<"</td>"<< std::endl;
2916  htmlFile << raw_class<< ce[0].FiberCh <<"</td>"<< std::endl;
2917  htmlFile << raw_class<< ce[0].QIE <<"</td>"<< std::endl;
2918  htmlFile << raw_class<< ce[0].ADC<<"</td>"<< std::endl;
2919  htmlFile << raw_class<< ce[0].VMECardID <<"</td>"<< std::endl;
2920  htmlFile << raw_class<< ce[0].dccID <<"</td>"<< std::endl;
2921  htmlFile << raw_class<< ce[0].Spigot <<"</td>"<< std::endl;
2922  htmlFile << raw_class<< ce[0].FiberIndex <<"</td>"<< std::endl;
2923  htmlFile << raw_class<< ce[0].HtrSlot <<"</td>"<< std::endl;
2924  htmlFile << raw_class<< ce[0].HtrTB <<"</td>"<< std::endl;
2925  htmlFile << raw_class1<< Comment[3][i]<<"</td>"<< std::endl;
2926  htmlFile << "</tr>" << std::endl;
2927 
2928  ind+=1;
2929  }
2930  }
2931 
2932 
2933  htmlFile << "</table>" << std::endl;
2934 */
2935  htmlFile << "</body> " << std::endl;
2936  htmlFile << "</html> " << std::endl;
2937  htmlFile.close();
2938  //======================================================================
2939 
2940  //======================================================================
2941  // Close and delete all possible things:
2942  hfile->Close();
2943  // hfile->Delete();
2944  // Exit Root
2945  gSystem->Exit(0);
2946  //======================================================================
2947 }
tuple argc
Definition: dir2webdir.py:39
string fname
main script
tuple cout
Definition: gather_cfg.py:144
#define str(s)