CMS 3D CMS Logo

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

◆ main()

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

Prepare maps of good/bad channels:

Definition at line 35 of file RemoteMonitoringMAP_Global.cc.

References dir2webdir::argc, cmsBatch::argv, HLT_2022v11_cff::cap, gather_cfg::cout, DeadROC_duringRun::dir, alignmentValidation::fname, mps_fire::i, dqmiolumiharvest::j, dqmdumpme::k, cond::runnumber, str, AlCaHLTBitMon_QueryRunRegistry::string, and ctpps_dqm_sourceclient-live_cfg::test.

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