CMS 3D CMS Logo

Functions
RemoteMonitoringMAP.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"

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 31 of file RemoteMonitoringMAP.cc.

31  {
32  gROOT->Reset();
33  gROOT->SetStyle("Plain");
34  gStyle->SetOptStat(0);
35  gStyle->SetOptTitle(1);
36  // ok change
37  if (argc < 3)
38  return 1;
39  char fname[300];
40  char refname[300];
41  char runtypeC[300];
42  sprintf(fname, "%s", argv[1]);
43  sprintf(refname, "%s", argv[2]);
44  sprintf(runtypeC, "%s", argv[3]);
45  std::cout << fname << " " << refname << " " << runtypeC << std::endl;
46  // ok change
47 
48  //======================================================================
49  // Connect the input files, parameters and get the 2-d histogram in memory
50  // TFile *hfile= new TFile("GlobalHist.root", "READ");
51  string promt = (string)fname;
52  string runtype = (string)runtypeC;
53  string runnumber = "";
54  for (unsigned int i = promt.size() - 11; i < promt.size() - 5; i++)
55  runnumber += fname[i];
56  string refrunnumber = "";
57  promt = (string)refname;
58  for (unsigned int i = promt.size() - 11; i < promt.size() - 5; i++)
59  refrunnumber += refname[i];
60 
61  TFile *hfile = new TFile(fname, "READ");
62  TFile *hreffile = new TFile(refname, "READ");
63  double MIN_M[7][5];
64  double MAX_M[7][5];
65  double MIN_C[7][5];
66  double MAX_C[7][5];
67  double porog[5];
68  double Pedest[2][5];
69 
70  if (runtype == "LED") {
71  //CUTS: [test][subdetector] ADC amplitude Am Width for Wm Ratio cut for Rm TS mean for TNm TS max for TXm
72  double MIN_M_LED[7][5] = {{0., 0., 0., 0., 0.},
73  {0., 0., 0., 0., 0.},
74  {0, 100., 70., 40., 40.},
75  {0, 0.7, 0.7, 0.1, 0.1},
76  {0, 0.7, 0.6, 0.40, 0.45},
77  {0, 2.5, 1.0, 1.0, 1.0},
78  {0, 1.5, 1.5, 0.5, 0.5}};
79  double MAX_M_LED[7][5] = {{0., 0., 0., 0., 0.},
80  {0., 0., 0., 0., 0.},
81  {0, 3000, 500000, 3000, 150000},
82  {0, 2.5, 2.5, 2.8, 2.6},
83  {0, 0.94, 0.95, 1.04, 1.02},
84  {0, 5.5, 5.2, 4.8, 4.2},
85  {0, 6.5, 6.5, 8.5, 8.5}};
86  double MIN_C_LED[7][5] = {{0., 0., 0., 0., 0.},
87  {0., 0., 0., 0., 0.},
88  {0, 1000., 1000., 1000., 100.},
89  {0, 1.3, 1.3, 0.7, 0.3},
90  {0, 0.76, 0.76, 0.85, 0.5},
91  {0, 2.4, 2.4, 1.5, 3.5},
92  {0, 1.5, 1.5, 1.5, 3.5}};
93  double MAX_C_LED[7][5] = {{0., 0., 0., 0., 0.},
94  {0., 0., 0., 0., 0.},
95  {0, 1E20, 1E20, 1E20, 1E20},
96  {0, 1.9, 1.9, 1.65, 1.5},
97  {0, 0.94, 0.94, 0.99, 0.8},
98  {0, 3.7, 3.7, 2.7, 4.5},
99  {0, 2.5, 2.5, 2.5, 4.5}};
100  double porog_LED[5] = {0., 2., 2., 2., 2.}; // Cut for GS test in pro cents
101  double Pedest_LED[2][5] = {{0., 0.1, 0.6, 0.1, 0.8},
102  {0., 0.1, 0.1, 0.1, 0.4}}; //Cuts for Pedestal and pedestal Width
103  for (int i = 0; i <= 6; i++)
104  for (int j = 0; j <= 4; j++) {
105  MIN_M[i][j] = MIN_M_LED[i][j];
106  MAX_M[i][j] = MAX_M_LED[i][j];
107  MIN_C[i][j] = MIN_C_LED[i][j];
108  MAX_C[i][j] = MAX_C_LED[i][j];
109  }
110  for (int i = 0; i <= 4; i++) {
111  porog[i] = porog_LED[i];
112  Pedest[0][i] = Pedest_LED[0][i];
113  Pedest[1][i] = Pedest_LED[1][i];
114  }
115  }
116 
117  if (runtype == "LASER") {
118  //CUTS: [test][subdetector] ADC amplitude Am Width for Wm Ratio cut for Rm TS mean for TNm TS max for TXm
119  double MIN_M_LASER[7][5] = {{0., 0., 0., 0., 0.},
120  {0., 0., 0., 0., 0.},
121  {0, 40., 40., 100., 40.},
122  {0, 0.3, 0.9, 0.2, 0.2},
123  {0, 0.5, 0.55, 0.55, 0.60},
124  {0, 5.0, 2.5, 1.1, 5.5},
125  {0, 1.5, 1.5, 1.5, 1.5}};
126  double MAX_M_LASER[7][5] = {{0., 0., 0., 0., 0.},
127  {0., 0., 0., 0., 0.},
128  {0, 3500, 350000, 3500, 150000},
129  {0, 2.5, 3.6, 2.6, 2.1},
130  {0, 1.00, 1.00, 1.04, 1.02},
131  {0, 7.5, 6.5, 4.4, 8.5},
132  {0, 8.5, 8.5, 6.5, 8.5}};
133  double MIN_C_LASER[7][5] = {{0., 0., 0., 0., 0.},
134  {0., 0., 0., 0., 0.},
135  {0, 1000., 1000., 1000., 100.},
136  {0, 1.3, 1.3, 0.7, 0.3},
137  {0, 0.76, 0.76, 0.85, 0.5},
138  {0, 2.4, 2.4, 1.5, 3.5},
139  {0, 1.5, 1.5, 1.5, 3.5}};
140  double MAX_C_LASER[7][5] = {{0., 0., 0., 0., 0.},
141  {0., 0., 0., 0., 0.},
142  {0, 1E20, 1E20, 1E20, 1E20},
143  {0, 1.9, 1.9, 1.65, 1.5},
144  {0, 0.94, 0.94, 1.0, 0.8},
145  {0, 3.7, 3.7, 2.7, 4.5},
146  {0, 2.5, 2.5, 2.5, 4.5}};
147  double porog_LASER[5] = {0., 2., 2., 2., 2.}; // Cut for GS test in pro cents
148  // double porog_LASER[5] = {0., 200., 200., 100., 100.}; // Cut for GS test in pro cents
149  double Pedest_LASER[2][5] = {{0., 0.1, 0.6, 0.1, 0.8},
150  {0., 0.1, 0.1, 0.1, 0.4}}; //Cuts for Pedestal and pedestal Width
151  for (int i = 0; i <= 6; i++)
152  for (int j = 0; j <= 4; j++) {
153  MIN_M[i][j] = MIN_M_LASER[i][j];
154  MAX_M[i][j] = MAX_M_LASER[i][j];
155  MIN_C[i][j] = MIN_C_LASER[i][j];
156  MAX_C[i][j] = MAX_C_LASER[i][j];
157  }
158  for (int i = 0; i <= 4; i++) {
159  porog[i] = porog_LASER[i];
160  Pedest[0][i] = Pedest_LASER[0][i];
161  Pedest[1][i] = Pedest_LASER[1][i];
162  }
163  }
164  if (runtype == "PEDESTAL") {
165  //CUTS: [test][subdetector] ADC amplitude Am Width for Wm Ratio cut for Rm TS mean for TNm TS max for TXm
166  double MIN_M_PEDESTAL[7][5] = {{0., 0., 0., 0., 0.},
167  {0., 0., 0., 0., 0.},
168  {0, 10., 10., 200., 5.},
169  {0, 2.7, 2.7, 2.7, 0.2},
170  {0, 0.31, 0.31, 0.05, 0.15},
171  {0, 4.5, 4.5, 4.5, 2.0},
172  {0, 0.5, 0.5, 0.5, 0.5}};
173  double MAX_M_PEDESTAL[7][5] = {{0., 0., 0., 0., 0.},
174  {0., 0., 0., 0., 0.},
175  {0, 2500., 250000., 2500., 150000.},
176  {0, 3.0, 3.0, 5.0, 3.0},
177  {0, 0.95, 0.95, 1.00, 0.98},
178  {0, 4.6, 4.6, 4.6, 7.0},
179  {0, 9.5, 9.5, 8.5, 8.5}};
180  double MIN_C_PEDESTAL[7][5] = {{0., 0., 0., 0., 0.},
181  {0., 0., 0., 0., 0.},
182  {0, 1000., 1000., 1000., 100.},
183  {0, 1.3, 1.3, 0.7, 0.3},
184  {0, 0.76, 0.76, 0.85, 0.5},
185  {0, 2.4, 2.4, 1.5, 3.5},
186  {0, 1.5, 1.5, 1.5, 3.5}};
187  double MAX_C_PEDESTAL[7][5] = {{0., 0., 0., 0., 0.},
188  {0., 0., 0., 0., 0.},
189  {0, 1E20, 1E20, 1E20, 1E20},
190  {0, 1.9, 1.9, 1.65, 1.5},
191  {0, 0.94, 0.94, 1.0, 0.8},
192  {0, 3.7, 3.7, 2.7, 4.5},
193  {0, 2.5, 2.5, 2.5, 4.5}};
194  double porog_PEDESTAL[5] = {0., 2., 2., 2., 2.}; // Cut for GS test in pro cents
195  // double porog_PEDESTAL[5] = {0., 200., 200., 100., 100.}; // Cut for GS test in pro cents
196  double Pedest_PEDESTAL[2][5] = {{0., 0.1, 0.6, 0.1, 0.8},
197  {0., 0.1, 0.1, 0.1, 0.4}}; //Cuts for Pedestal and pedestal Width
198  for (int i = 0; i <= 6; i++)
199  for (int j = 0; j <= 4; j++) {
200  MIN_M[i][j] = MIN_M_PEDESTAL[i][j];
201  MAX_M[i][j] = MAX_M_PEDESTAL[i][j];
202  MIN_C[i][j] = MIN_C_PEDESTAL[i][j];
203  MAX_C[i][j] = MAX_C_PEDESTAL[i][j];
204  }
205  for (int i = 0; i <= 4; i++) {
206  porog[i] = porog_PEDESTAL[i];
207  Pedest[0][i] = Pedest_PEDESTAL[0][i];
208  Pedest[1][i] = Pedest_PEDESTAL[1][i];
209  }
210  }
211 
212  //======================================================================
213 
214  cout << endl;
215  cout << MIN_M[2][1] << endl;
216 
217  //======================================================================
218  // Prepare histograms and plot them to .png files
219 
220  //TCanvas *cHB = new TCanvas("cHB","cHB",1000,500);
221  TCanvas *cHB = new TCanvas("cHB", "cHB", 1000, 1000);
222  //TCanvas *cHE = new TCanvas("cHE","cHE",1500,500);
223  TCanvas *cHE = new TCanvas("cHE", "cHE", 1500, 1500);
224  //TCanvas *cONE = new TCanvas("cONE","cONE",500,500);
225  TCanvas *cONE = new TCanvas("cONE", "cONE", 1500, 500);
226  TCanvas *cPED = new TCanvas("cPED", "cPED", 1000, 500);
227  //TCanvas *cHF = new TCanvas("cHF","cHF",1000,1000);
228  TCanvas *cHF = new TCanvas("cHF", "cHF", 1000, 1000);
229 
230  // Iteration Method for Calibration Group:
231 
232  TCanvas *c1x0 = new TCanvas("c1x0", "c1x0", 300, 10, 800, 700);
233 
234  TCanvas *c1x1 = new TCanvas("c1x1", "c1x1", 100, 10, 600, 700);
235 
236  TCanvas *c3x5 = new TCanvas("c3x5", "c3x5", 1000, 1500);
237  //
238 
239  char *str = (char *)alloca(10000);
240 
241  // before upgrade 2017:
242  // depth: HB depth1,2; HE depth1,2,3; HO depth4; HF depth1,2
243  // 5 depthes: 0(empty), 1,2,3,4
244 
245  // upgrade 2017:
246  // depth: HB depth1,2; HE depth1,2,3,4,5,6,7; HO depth4; HF depth1,2,3,4
247  // 8 depthes: 0(empty), 1,2,3,4,5,6,7
248 
249  // upgrade 2021:
250  // depth: HB depth1,2,3,4; HE depth1,2,3,4,5,6,7; HO depth4; HF depth1,2,3,4
251  // 10 depthes: 0(empty), 1,2,3,4,5,6,7,8,9
252 
253  // Int_t ALLDEPTH = 5;
254  // Int_t ALLDEPTH = 8;
255  Int_t ALLDEPTH = 10;
256 
257  int k_min[5] = {0, 1, 1, 4, 1}; // minimum depth for each subdet
258  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
259  // int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
260  int k_max[5] = {0, 4, 7, 4, 4}; // maximum depth for each subdet
261 
262  TH2F *Map_Ampl[33][5][ALLDEPTH]; // 2D histogramm for test,subdet,depth
263  TH2F *Map_SUB[5][ALLDEPTH]; // 2d histogramm for subdet, depth
264  TH1F *HistAmplDepth[22][5][ALLDEPTH]; // 1d histogramm for test,subdet, depth
265  TH1F *HistAmpl[22][5]; // 1d histogramm for test,subdet
266 
267  TH1F *HistPed[3][5][4]; // 1d histogramm for test,subdet, CapID
268  TH2F *Map_Ped[3][5]; // 2d histogramm for test,subdet -> test 33
269  TH1F *hist_GoodTSshape[5]; // 1d histogramm for TS shape subdet -> test 41
270  TH1F *hist_GoodTSshape0[5]; // 1d histogramm for TS shape subdet -> test 41
271  TH1F *hist_BadTSshape[5]; // 1d histogramm for TS shape subdet -> test 41
272  TH1F *hist_BadTSshape0[5]; // 1d histogramm for TS shape subdet -> test 41
273  TH1F *hist_ADC_All[5]; // 1d histogramm for TS shape subdet -> test 42
274  TH1F *hist_ADC_DS[5][ALLDEPTH]; // 1d histogramm for TS shape subdet, depth -> test 42
275  TH1F *hist_SumADC[5][ALLDEPTH]; // 1d histogramm for TS shape subdet, depth -> test 43
276  TH1F *hist_SumADC0[5][ALLDEPTH]; // 1d histogramm for TS shape subdet, depth -> test 43
277  TH1F *hist_SumADC1[5][ALLDEPTH]; // 1d histogramm for TS shape subdet, depth -> test 43
278 
279  Map_SUB[1][1] = (TH2F *)hfile->Get("h_mapDepth1_HB");
280  Map_SUB[1][2] = (TH2F *)hfile->Get("h_mapDepth2_HB");
281  Map_SUB[2][1] = (TH2F *)hfile->Get("h_mapDepth1_HE");
282  Map_SUB[2][2] = (TH2F *)hfile->Get("h_mapDepth2_HE");
283  Map_SUB[2][3] = (TH2F *)hfile->Get("h_mapDepth3_HE");
284  Map_SUB[3][4] = (TH2F *)hfile->Get("h_mapDepth4_HO");
285  Map_SUB[4][1] = (TH2F *)hfile->Get("h_mapDepth1_HF");
286  Map_SUB[4][2] = (TH2F *)hfile->Get("h_mapDepth2_HF");
287 
288  Map_SUB[1][3] = (TH2F *)hfile->Get("h_mapDepth3_HB");
289  Map_SUB[1][4] = (TH2F *)hfile->Get("h_mapDepth4_HB");
290  Map_SUB[2][4] = (TH2F *)hfile->Get("h_mapDepth4_HE");
291  Map_SUB[2][5] = (TH2F *)hfile->Get("h_mapDepth5_HE");
292  Map_SUB[2][6] = (TH2F *)hfile->Get("h_mapDepth6_HE");
293  Map_SUB[2][7] = (TH2F *)hfile->Get("h_mapDepth7_HE");
294  Map_SUB[4][3] = (TH2F *)hfile->Get("h_mapDepth3_HF");
295  Map_SUB[4][4] = (TH2F *)hfile->Get("h_mapDepth4_HF");
296 
297  //+++++++++++++++++++++++++++++
298  //Test 0 Entries
299  //+++++++++++++++++++++++++++++
300 
301  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
302  // if (sub==1) cHB->Divide(2,1);
303  if (sub == 1)
304  cHB->Divide(2, 2);
305  // if (sub==2) cHE->Divide(3,1);
306  if (sub == 2)
307  cHE->Divide(3, 3);
308  if (sub == 3)
309  cONE->Divide(1, 1);
310  // if (sub==4) cHF->Divide(2,1);
311  if (sub == 4)
312  cHF->Divide(2, 2);
313  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
314  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
315  // int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
316  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
317  if (sub == 1)
318  cHB->cd(k);
319  if (sub == 2)
320  cHE->cd(k);
321  if (sub == 3)
322  cONE->cd(k - 3);
323  if (sub == 4)
324  cHF->cd(k);
325  gPad->SetGridy();
326  gPad->SetGridx();
327  gPad->SetLogz();
328  if (sub == 1)
329  sprintf(str, "HB, Depth%d \b", k);
330  if (sub == 2)
331  sprintf(str, "HE, Depth%d \b", k);
332  if (sub == 3)
333  sprintf(str, "HO, Depth%d \b", k);
334  if (sub == 4)
335  sprintf(str, "HF, Depth%d \b", k);
336  Map_SUB[sub][k]->SetTitle(str);
337  Map_SUB[sub][k]->SetXTitle("#eta \b");
338  Map_SUB[sub][k]->SetYTitle("#phi \b");
339  Map_SUB[sub][k]->SetZTitle("Number of events \b");
340  if (sub == 3)
341  Map_SUB[sub][k]->SetTitleOffset(0.8, "Z");
342  Map_SUB[sub][k]->Draw("COLZ");
343  Map_SUB[sub][k]->GetYaxis()->SetRangeUser(0, 72.);
344  // Map_SUB[sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
345  if (sub == 1) {
346  cHB->Modified();
347  cHB->Update();
348  }
349  if (sub == 2) {
350  cHE->Modified();
351  cHE->Update();
352  }
353  if (sub == 3) {
354  cONE->Modified();
355  cONE->Update();
356  }
357  if (sub == 4) {
358  cHF->Modified();
359  cHF->Update();
360  }
361  } //end depth
362 
363  if (sub == 1) {
364  cHB->Print("MapRateEntryHB.png");
365  cHB->Clear();
366  }
367  if (sub == 2) {
368  cHE->Print("MapRateEntryHE.png");
369  cHE->Clear();
370  }
371  if (sub == 3) {
372  cONE->Print("MapRateEntryHO.png");
373  cONE->Clear();
374  }
375  if (sub == 4) {
376  cHF->Print("MapRateEntryHF.png");
377  cHF->Clear();
378  }
379  } // end sub
380 
381  //+++++++++++++++++++++++++++++
382  //Test 1 (Cm) Rate of Cap ID errors
383  //+++++++++++++++++++++++++++++
384 
385  Map_Ampl[1][1][1] = (TH2F *)hfile->Get("h_mapDepth1Error_HB");
386  Map_Ampl[1][1][2] = (TH2F *)hfile->Get("h_mapDepth2Error_HB");
387  Map_Ampl[1][2][1] = (TH2F *)hfile->Get("h_mapDepth1Error_HE");
388  Map_Ampl[1][2][2] = (TH2F *)hfile->Get("h_mapDepth2Error_HE");
389  Map_Ampl[1][2][3] = (TH2F *)hfile->Get("h_mapDepth3Error_HE");
390  Map_Ampl[1][3][4] = (TH2F *)hfile->Get("h_mapDepth4Error_HO");
391  Map_Ampl[1][4][1] = (TH2F *)hfile->Get("h_mapDepth1Error_HF");
392  Map_Ampl[1][4][2] = (TH2F *)hfile->Get("h_mapDepth2Error_HF");
393 
394  Map_Ampl[1][1][3] = (TH2F *)hfile->Get("h_mapDepth3Error_HB");
395  Map_Ampl[1][1][4] = (TH2F *)hfile->Get("h_mapDepth4Error_HB");
396  Map_Ampl[1][2][4] = (TH2F *)hfile->Get("h_mapDepth4Error_HE");
397  Map_Ampl[1][2][5] = (TH2F *)hfile->Get("h_mapDepth5Error_HE");
398  Map_Ampl[1][2][6] = (TH2F *)hfile->Get("h_mapDepth6Error_HE");
399  Map_Ampl[1][2][7] = (TH2F *)hfile->Get("h_mapDepth7Error_HE");
400  Map_Ampl[1][4][3] = (TH2F *)hfile->Get("h_mapDepth3Error_HF");
401  Map_Ampl[1][4][4] = (TH2F *)hfile->Get("h_mapDepth4Error_HF");
402 
403  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
404  // if (sub==1) cHB->Divide(2,1);
405  if (sub == 1)
406  cHB->Divide(2, 2);
407  // if (sub==2) cHE->Divide(3,1);
408  if (sub == 2)
409  cHE->Divide(3, 3);
410  if (sub == 3)
411  cONE->Divide(1, 1);
412  // if (sub==4) cHF->Divide(2,1);
413  if (sub == 4)
414  cHF->Divide(2, 2);
415  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
416  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
417  // int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
418  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
419  if (sub == 1)
420  cHB->cd(k);
421  if (sub == 2)
422  cHE->cd(k);
423  if (sub == 3)
424  cONE->cd(k - 3);
425  if (sub == 4)
426  cHF->cd(k);
427  Map_Ampl[1][sub][k]->Divide(Map_Ampl[1][sub][k], Map_SUB[sub][k], 1, 1, "B");
428  gPad->SetGridy();
429  gPad->SetGridx();
430  gPad->SetLogz();
431  if (sub == 1)
432  sprintf(str, "HB, Depth%d \b", k);
433  if (sub == 2)
434  sprintf(str, "HE, Depth%d \b", k);
435  if (sub == 3)
436  sprintf(str, "HO, Depth%d \b", k);
437  if (sub == 4)
438  sprintf(str, "HF, Depth%d \b", k);
439  Map_Ampl[1][sub][k]->SetTitle(str);
440  Map_Ampl[1][sub][k]->SetXTitle("#eta \b");
441  Map_Ampl[1][sub][k]->SetYTitle("#phi \b");
442  Map_Ampl[1][sub][k]->SetZTitle("Rate \b");
443  if (sub == 3)
444  Map_Ampl[1][sub][k]->SetTitleOffset(0.8, "Z");
445  Map_Ampl[1][sub][k]->Draw("COLZ");
446  Map_Ampl[1][sub][k]->GetYaxis()->SetRangeUser(0, 72.);
447  Map_Ampl[1][sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
448  if (sub == 1) {
449  cHB->Modified();
450  cHB->Update();
451  }
452  if (sub == 2) {
453  cHE->Modified();
454  cHE->Update();
455  }
456  if (sub == 3) {
457  cONE->Modified();
458  cONE->Update();
459  }
460  if (sub == 4) {
461  cHF->Modified();
462  cHF->Update();
463  }
464  } //end depth
465 
466  if (sub == 1) {
467  cHB->Print("MapRateCapIDHB.png");
468  cHB->Clear();
469  }
470  if (sub == 2) {
471  cHE->Print("MapRateCapIDHE.png");
472  cHE->Clear();
473  }
474  if (sub == 3) {
475  cONE->Print("MapRateCapIDHO.png");
476  cONE->Clear();
477  }
478  if (sub == 4) {
479  cHF->Print("MapRateCapIDHF.png");
480  cHF->Clear();
481  }
482  } // end sub
483 
484  //+++++++++++++++++++++++++++++
485  //Test 2 (Am) ADC amplitude
486  //+++++++++++++++++++++++++++++
487 
488  Map_Ampl[2][1][1] = (TH2F *)hfile->Get("h_mapDepth1ADCAmpl225_HB");
489  Map_Ampl[2][1][2] = (TH2F *)hfile->Get("h_mapDepth2ADCAmpl225_HB");
490  Map_Ampl[2][2][1] = (TH2F *)hfile->Get("h_mapDepth1ADCAmpl225_HE");
491  Map_Ampl[2][2][2] = (TH2F *)hfile->Get("h_mapDepth2ADCAmpl225_HE");
492  Map_Ampl[2][2][3] = (TH2F *)hfile->Get("h_mapDepth3ADCAmpl225_HE");
493  Map_Ampl[2][3][4] = (TH2F *)hfile->Get("h_mapDepth4ADCAmpl225_HO");
494  Map_Ampl[2][4][1] = (TH2F *)hfile->Get("h_mapDepth1ADCAmpl225_HF");
495  Map_Ampl[2][4][2] = (TH2F *)hfile->Get("h_mapDepth2ADCAmpl225_HF");
496 
497  Map_Ampl[2][1][3] = (TH2F *)hfile->Get("h_mapDepth3ADCAmpl225_HB");
498  Map_Ampl[2][1][4] = (TH2F *)hfile->Get("h_mapDepth4ADCAmpl225_HB");
499  Map_Ampl[2][2][4] = (TH2F *)hfile->Get("h_mapDepth4ADCAmpl225_HE");
500  Map_Ampl[2][2][5] = (TH2F *)hfile->Get("h_mapDepth5ADCAmpl225_HE");
501  Map_Ampl[2][2][6] = (TH2F *)hfile->Get("h_mapDepth6ADCAmpl225_HE");
502  Map_Ampl[2][2][7] = (TH2F *)hfile->Get("h_mapDepth7ADCAmpl225_HE");
503  Map_Ampl[2][4][3] = (TH2F *)hfile->Get("h_mapDepth3ADCAmpl225_HF");
504  Map_Ampl[2][4][4] = (TH2F *)hfile->Get("h_mapDepth4ADCAmpl225_HF");
505 
506  HistAmpl[2][1] = (TH1F *)hfile->Get("h_ADCAmpl_HB");
507  HistAmpl[2][2] = (TH1F *)hfile->Get("h_ADCAmpl_HE");
508  HistAmpl[2][3] = (TH1F *)hfile->Get("h_ADCAmpl_HO");
509  HistAmpl[2][4] = (TH1F *)hfile->Get("h_ADCAmpl_HF");
510 
511  //+++++++++++++++++++++++++++++
512  //Test 3 (Wm) Rate of RMS
513  //+++++++++++++++++++++++++++++
514 
515  Map_Ampl[3][1][1] = (TH2F *)hfile->Get("h_mapDepth1Amplitude225_HB");
516  Map_Ampl[3][1][2] = (TH2F *)hfile->Get("h_mapDepth2Amplitude225_HB");
517  Map_Ampl[3][2][1] = (TH2F *)hfile->Get("h_mapDepth1Amplitude225_HE");
518  Map_Ampl[3][2][2] = (TH2F *)hfile->Get("h_mapDepth2Amplitude225_HE");
519  Map_Ampl[3][2][3] = (TH2F *)hfile->Get("h_mapDepth3Amplitude225_HE");
520  Map_Ampl[3][3][4] = (TH2F *)hfile->Get("h_mapDepth4Amplitude225_HO");
521  Map_Ampl[3][4][1] = (TH2F *)hfile->Get("h_mapDepth1Amplitude225_HF");
522  Map_Ampl[3][4][2] = (TH2F *)hfile->Get("h_mapDepth2Amplitude225_HF");
523 
524  Map_Ampl[3][1][3] = (TH2F *)hfile->Get("h_mapDepth3Amplitude225_HB");
525  Map_Ampl[3][1][4] = (TH2F *)hfile->Get("h_mapDepth4Amplitude225_HB");
526  Map_Ampl[3][2][4] = (TH2F *)hfile->Get("h_mapDepth4Amplitude225_HE");
527  Map_Ampl[3][2][5] = (TH2F *)hfile->Get("h_mapDepth5Amplitude225_HE");
528  Map_Ampl[3][2][6] = (TH2F *)hfile->Get("h_mapDepth6Amplitude225_HE");
529  Map_Ampl[3][2][7] = (TH2F *)hfile->Get("h_mapDepth7Amplitude225_HE");
530  Map_Ampl[3][4][3] = (TH2F *)hfile->Get("h_mapDepth3Amplitude225_HF");
531  Map_Ampl[3][4][4] = (TH2F *)hfile->Get("h_mapDepth4Amplitude225_HF");
532 
533  HistAmpl[3][1] = (TH1F *)hfile->Get("h_Amplitude_HB");
534  HistAmpl[3][2] = (TH1F *)hfile->Get("h_Amplitude_HE");
535  HistAmpl[3][3] = (TH1F *)hfile->Get("h_Amplitude_HO");
536  HistAmpl[3][4] = (TH1F *)hfile->Get("h_Amplitude_HF");
537 
538  //+++++++++++++++++++++++++++++
539  //Test 4 (Rm) Rate of ratio 4 near max TS/ All TS
540  //+++++++++++++++++++++++++++++
541 
542  Map_Ampl[4][1][1] = (TH2F *)hfile->Get("h_mapDepth1Ampl047_HB");
543  Map_Ampl[4][1][2] = (TH2F *)hfile->Get("h_mapDepth2Ampl047_HB");
544  Map_Ampl[4][2][1] = (TH2F *)hfile->Get("h_mapDepth1Ampl047_HE");
545  Map_Ampl[4][2][2] = (TH2F *)hfile->Get("h_mapDepth2Ampl047_HE");
546  Map_Ampl[4][2][3] = (TH2F *)hfile->Get("h_mapDepth3Ampl047_HE");
547  Map_Ampl[4][3][4] = (TH2F *)hfile->Get("h_mapDepth4Ampl047_HO");
548  Map_Ampl[4][4][1] = (TH2F *)hfile->Get("h_mapDepth1Ampl047_HF");
549  Map_Ampl[4][4][2] = (TH2F *)hfile->Get("h_mapDepth2Ampl047_HF");
550 
551  Map_Ampl[4][1][3] = (TH2F *)hfile->Get("h_mapDepth3Ampl047_HB");
552  Map_Ampl[4][1][4] = (TH2F *)hfile->Get("h_mapDepth4Ampl047_HB");
553  Map_Ampl[4][2][4] = (TH2F *)hfile->Get("h_mapDepth4Ampl047_HE");
554  Map_Ampl[4][2][5] = (TH2F *)hfile->Get("h_mapDepth5Ampl047_HE");
555  Map_Ampl[4][2][6] = (TH2F *)hfile->Get("h_mapDepth6Ampl047_HE");
556  Map_Ampl[4][2][7] = (TH2F *)hfile->Get("h_mapDepth7Ampl047_HE");
557  Map_Ampl[4][4][3] = (TH2F *)hfile->Get("h_mapDepth3Ampl047_HF");
558  Map_Ampl[4][4][4] = (TH2F *)hfile->Get("h_mapDepth4Ampl047_HF");
559 
560  HistAmpl[4][1] = (TH1F *)hfile->Get("h_Ampl_HB");
561  HistAmpl[4][2] = (TH1F *)hfile->Get("h_Ampl_HE");
562  HistAmpl[4][3] = (TH1F *)hfile->Get("h_Ampl_HO");
563  HistAmpl[4][4] = (TH1F *)hfile->Get("h_Ampl_HF");
564 
565  //+++++++++++++++++++++++++++++
566  //Test 5 (TNm) Mean position in 1-8 TS range
567  //+++++++++++++++++++++++++++++
568 
569  Map_Ampl[5][1][1] = (TH2F *)hfile->Get("h_mapDepth1TSmeanA225_HB");
570  Map_Ampl[5][1][2] = (TH2F *)hfile->Get("h_mapDepth2TSmeanA225_HB");
571  Map_Ampl[5][2][1] = (TH2F *)hfile->Get("h_mapDepth1TSmeanA225_HE");
572  Map_Ampl[5][2][2] = (TH2F *)hfile->Get("h_mapDepth2TSmeanA225_HE");
573  Map_Ampl[5][2][3] = (TH2F *)hfile->Get("h_mapDepth3TSmeanA225_HE");
574  Map_Ampl[5][3][4] = (TH2F *)hfile->Get("h_mapDepth4TSmeanA225_HO");
575  Map_Ampl[5][4][1] = (TH2F *)hfile->Get("h_mapDepth1TSmeanA225_HF");
576  Map_Ampl[5][4][2] = (TH2F *)hfile->Get("h_mapDepth2TSmeanA225_HF");
577 
578  Map_Ampl[5][1][3] = (TH2F *)hfile->Get("h_mapDepth3TSmeanA225_HB");
579  Map_Ampl[5][1][4] = (TH2F *)hfile->Get("h_mapDepth4TSmeanA225_HB");
580  Map_Ampl[5][2][4] = (TH2F *)hfile->Get("h_mapDepth4TSmeanA225_HE");
581  Map_Ampl[5][2][5] = (TH2F *)hfile->Get("h_mapDepth5TSmeanA225_HE");
582  Map_Ampl[5][2][6] = (TH2F *)hfile->Get("h_mapDepth6TSmeanA225_HE");
583  Map_Ampl[5][2][7] = (TH2F *)hfile->Get("h_mapDepth7TSmeanA225_HE");
584  Map_Ampl[5][4][3] = (TH2F *)hfile->Get("h_mapDepth3TSmeanA225_HF");
585  Map_Ampl[5][4][4] = (TH2F *)hfile->Get("h_mapDepth4TSmeanA225_HF");
586 
587  HistAmpl[5][1] = (TH1F *)hfile->Get("h_TSmeanA_HB");
588  HistAmpl[5][2] = (TH1F *)hfile->Get("h_TSmeanA_HE");
589  HistAmpl[5][3] = (TH1F *)hfile->Get("h_TSmeanA_HO");
590  HistAmpl[5][4] = (TH1F *)hfile->Get("h_TSmeanA_HF");
591 
592  //+++++++++++++++++++++++++++++
593  //Test 6 (TXm) Maximum position in 1-8 TS range
594  //+++++++++++++++++++++++++++++
595 
596  Map_Ampl[6][1][1] = (TH2F *)hfile->Get("h_mapDepth1TSmaxA225_HB");
597  Map_Ampl[6][1][2] = (TH2F *)hfile->Get("h_mapDepth2TSmaxA225_HB");
598  Map_Ampl[6][2][1] = (TH2F *)hfile->Get("h_mapDepth1TSmaxA225_HE");
599  Map_Ampl[6][2][2] = (TH2F *)hfile->Get("h_mapDepth2TSmaxA225_HE");
600  Map_Ampl[6][2][3] = (TH2F *)hfile->Get("h_mapDepth3TSmaxA225_HE");
601  Map_Ampl[6][3][4] = (TH2F *)hfile->Get("h_mapDepth4TSmaxA225_HO");
602  Map_Ampl[6][4][1] = (TH2F *)hfile->Get("h_mapDepth1TSmaxA225_HF");
603  Map_Ampl[6][4][2] = (TH2F *)hfile->Get("h_mapDepth2TSmaxA225_HF");
604 
605  Map_Ampl[6][1][3] = (TH2F *)hfile->Get("h_mapDepth3TSmaxA225_HB");
606  Map_Ampl[6][1][4] = (TH2F *)hfile->Get("h_mapDepth4TSmaxA225_HB");
607  Map_Ampl[6][2][4] = (TH2F *)hfile->Get("h_mapDepth4TSmaxA225_HE");
608  Map_Ampl[6][2][5] = (TH2F *)hfile->Get("h_mapDepth5TSmaxA225_HE");
609  Map_Ampl[6][2][6] = (TH2F *)hfile->Get("h_mapDepth6TSmaxA225_HE");
610  Map_Ampl[6][2][7] = (TH2F *)hfile->Get("h_mapDepth7TSmaxA225_HE");
611  Map_Ampl[6][4][3] = (TH2F *)hfile->Get("h_mapDepth3TSmaxA225_HF");
612  Map_Ampl[6][4][4] = (TH2F *)hfile->Get("h_mapDepth4TSmaxA225_HF");
613 
614  HistAmpl[6][1] = (TH1F *)hfile->Get("h_TSmaxA_HB");
615  HistAmpl[6][2] = (TH1F *)hfile->Get("h_TSmaxA_HE");
616  HistAmpl[6][3] = (TH1F *)hfile->Get("h_TSmaxA_HO");
617  HistAmpl[6][4] = (TH1F *)hfile->Get("h_TSmaxA_HF");
618 
619  for (int test = 2; test <= 6; test++) { //Test: 2-Am, 3-Wm, 4-Rm, 5-TNm, 6-TXm,
620  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
621  // if (sub==1) cHB->Divide(2,1);
622  if (sub == 1)
623  cHB->Divide(2, 2);
624  // if (sub==2) cHE->Divide(3,1);
625  if (sub == 2)
626  cHE->Divide(3, 3);
627  if (sub == 3)
628  cONE->Divide(1, 1);
629  // if (sub==4) cHF->Divide(2,1);
630  if (sub == 4)
631  cHF->Divide(2, 2);
632  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
633  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
634  // int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
635  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
636  if (sub == 1)
637  cHB->cd(k);
638  if (sub == 2)
639  cHE->cd(k);
640  if (sub == 3)
641  cONE->cd(k - 3);
642  if (sub == 4)
643  cHF->cd(k);
644  Map_Ampl[test][sub][k]->Divide(Map_Ampl[test][sub][k], Map_SUB[sub][k], 1, 1, "B");
645  gPad->SetGridy();
646  gPad->SetGridx();
647  gPad->SetLogz();
648  if (sub == 1)
649  sprintf(str, "HB, Depth%d \b", k);
650  if (sub == 2)
651  sprintf(str, "HE, Depth%d \b", k);
652  if (sub == 3)
653  sprintf(str, "HO, Depth%d \b", k);
654  if (sub == 4)
655  sprintf(str, "HF, Depth%d \b", k);
656  Map_Ampl[test][sub][k]->SetTitle(str);
657  Map_Ampl[test][sub][k]->SetXTitle("#eta \b");
658  Map_Ampl[test][sub][k]->SetYTitle("#phi \b");
659  Map_Ampl[test][sub][k]->SetZTitle("Rate \b");
660  if (sub == 3)
661  Map_Ampl[test][sub][k]->SetTitleOffset(0.8, "Z");
662  Map_Ampl[test][sub][k]->Draw("COLZ");
663  Map_Ampl[test][sub][k]->GetYaxis()->SetRangeUser(0, 72.);
664  Map_Ampl[test][sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
665  if (sub == 1) {
666  cHB->Modified();
667  cHB->Update();
668  }
669  if (sub == 2) {
670  cHE->Modified();
671  cHE->Update();
672  }
673  if (sub == 3) {
674  cONE->Modified();
675  cONE->Update();
676  }
677  if (sub == 4) {
678  cHF->Modified();
679  cHF->Update();
680  }
681  } //end depth
682  if (test == 2) {
683  if (sub == 1) {
684  cHB->Print("MapRateAmplHB.png");
685  cHB->Clear();
686  }
687  if (sub == 2) {
688  cHE->Print("MapRateAmplHE.png");
689  cHE->Clear();
690  }
691  if (sub == 3) {
692  cONE->Print("MapRateAmplHO.png");
693  cONE->Clear();
694  }
695  if (sub == 4) {
696  cHF->Print("MapRateAmplHF.png");
697  cHF->Clear();
698  }
699  }
700  if (test == 3) {
701  if (sub == 1) {
702  cHB->Print("MapRateRMSHB.png");
703  cHB->Clear();
704  }
705  if (sub == 2) {
706  cHE->Print("MapRateRMSHE.png");
707  cHE->Clear();
708  }
709  if (sub == 3) {
710  cONE->Print("MapRateRMSHO.png");
711  cONE->Clear();
712  }
713  if (sub == 4) {
714  cHF->Print("MapRateRMSHF.png");
715  cHF->Clear();
716  }
717  }
718  if (test == 4) {
719  if (sub == 1) {
720  cHB->Print("MapRate43TStoAllTSHB.png");
721  cHB->Clear();
722  }
723  if (sub == 2) {
724  cHE->Print("MapRate43TStoAllTSHE.png");
725  cHE->Clear();
726  }
727  if (sub == 3) {
728  cONE->Print("MapRate43TStoAllTSHO.png");
729  cONE->Clear();
730  }
731  if (sub == 4) {
732  cHF->Print("MapRate43TStoAllTSHF.png");
733  cHF->Clear();
734  }
735  }
736  if (test == 5) {
737  if (sub == 1) {
738  cHB->Print("MapRateMeanPosHB.png");
739  cHB->Clear();
740  }
741  if (sub == 2) {
742  cHE->Print("MapRateMeanPosHE.png");
743  cHE->Clear();
744  }
745  if (sub == 3) {
746  cONE->Print("MapRateMeanPosHO.png");
747  cONE->Clear();
748  }
749  if (sub == 4) {
750  cHF->Print("MapRateMeanPosHF.png");
751  cHF->Clear();
752  }
753  }
754  if (test == 6) {
755  if (sub == 1) {
756  cHB->Print("MapRateMaxPosHB.png");
757  cHB->Clear();
758  }
759  if (sub == 2) {
760  cHE->Print("MapRateMaxPosHE.png");
761  cHE->Clear();
762  }
763  if (sub == 3) {
764  cONE->Print("MapRateMaxPosHO.png");
765  cONE->Clear();
766  }
767  if (sub == 4) {
768  cHF->Print("MapRateMaxPosHF.png");
769  cHF->Clear();
770  }
771  }
772 
773  // cONE->Divide(1,1);
774  cONE->Divide(3, 1);
775  if (test == 2 && sub == 2) {
776  cONE->cd(2);
777  TH1F *kjkjkhj2 = (TH1F *)hfile->Get("h_AmplitudeHEtest1");
778  kjkjkhj2->Draw("");
779  kjkjkhj2->SetTitle("HE, All Depth: shunt1");
780  cONE->cd(3);
781  TH1F *kjkjkhj3 = (TH1F *)hfile->Get("h_AmplitudeHEtest6");
782  kjkjkhj3->Draw("");
783  kjkjkhj3->SetTitle("HE, All Depth: shunt6");
784  }
785  if (test == 2 && sub == 1) {
786  cONE->cd(2);
787  TH1F *kjkjkhb2 = (TH1F *)hfile->Get("h_AmplitudeHBtest1");
788  kjkjkhb2->Draw("");
789  kjkjkhb2->SetTitle("HB, All Depth: shunt1");
790  cONE->cd(3);
791  TH1F *kjkjkhb3 = (TH1F *)hfile->Get("h_AmplitudeHBtest6");
792  kjkjkhb3->Draw("");
793  kjkjkhb3->SetTitle("HB, All Depth: shunt6");
794  }
795  cONE->cd(1);
796  gPad->SetGridy();
797  gPad->SetGridx();
798  gPad->SetLogy();
799  if (sub == 1)
800  HistAmpl[test][sub]->SetTitle("HB, All Depth: shunt6");
801  if (sub == 2)
802  HistAmpl[test][sub]->SetTitle("HE, All Depth: shunt6");
803  if (sub == 3)
804  HistAmpl[test][sub]->SetTitle("HO, All Depth");
805  if (sub == 4)
806  HistAmpl[test][sub]->SetTitle("HF, All Depth");
807  if (test == 2)
808  HistAmpl[test][sub]->SetXTitle("ADC Amlitude in each event & cell \b");
809  if (test == 3)
810  HistAmpl[test][sub]->SetXTitle("RMS in each event & cell \b");
811  if (test == 4)
812  HistAmpl[test][sub]->SetXTitle("Ratio in each event & cell \b");
813  if (test == 5)
814  HistAmpl[test][sub]->SetXTitle("Mean TS position in each event & cell \b");
815  if (test == 6)
816  HistAmpl[test][sub]->SetXTitle("Max TS position in each event & cell \b");
817  HistAmpl[test][sub]->SetYTitle("Number of cell-events \b");
818  HistAmpl[test][sub]->SetLineColor(4);
819  HistAmpl[test][sub]->SetLineWidth(2);
820  HistAmpl[test][sub]->SetTitleOffset(1.4, "Y");
821  HistAmpl[test][sub]->Draw("");
822  // // HistAmpl[test][sub]->GetYaxis()->SetRangeUser(1., 100.);
823  // if (test==2) {gPad->SetLogx(); HistAmpl[test][sub]->GetXaxis()->SetRangeUser(1., 10000.);}
824  if (test == 2) {
825  gPad->SetLogx();
826  }
827  if (test == 3)
828  HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 5.); // width
829  if (test == 4)
830  HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 1.); // R
831  if (test == 5)
832  HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 9.); //Tn
833  if (test == 6)
834  HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 9.); //Tx
835  cONE->Modified();
836  cONE->Update();
837  double min_x[] = {MIN_M[test][sub], MIN_M[test][sub]};
838  double min_y[] = {0., 100000000.};
839  TGraph *MIN = new TGraph(2, min_x, min_y);
840  MIN->SetLineStyle(2);
841  MIN->SetLineColor(2);
842  MIN->SetLineWidth(2 + 100 * 100);
843  MIN->SetFillStyle(3005);
844  MIN->SetFillColor(2);
845  MIN->Draw("L");
846  double max_x[] = {MAX_M[test][sub], MAX_M[test][sub]};
847  double max_y[] = {0., 100000000.};
848  TGraph *MAX = new TGraph(2, max_x, max_y);
849  MAX->SetLineStyle(2);
850  MAX->SetLineColor(2);
851  MAX->SetLineWidth(-2 - 100 * 100);
852  MAX->SetFillStyle(3004);
853  MAX->SetFillColor(2);
854  MAX->Draw("L");
855  if (test == 2) {
856  if (sub == 1) {
857  cONE->Print("HistAmplHB.png");
858  cONE->Clear();
859  }
860  if (sub == 2) {
861  cONE->Print("HistAmplHE.png");
862  cONE->Clear();
863  }
864  if (sub == 3) {
865  cONE->Print("HistAmplHO.png");
866  cONE->Clear();
867  }
868  if (sub == 4) {
869  cONE->Print("HistAmplHF.png");
870  cONE->Clear();
871  }
872  }
873  if (test == 3) {
874  if (sub == 1) {
875  cONE->Print("HistRMSHB.png");
876  cONE->Clear();
877  }
878  if (sub == 2) {
879  cONE->Print("HistRMSHE.png");
880  cONE->Clear();
881  }
882  if (sub == 3) {
883  cONE->Print("HistRMSHO.png");
884  cONE->Clear();
885  }
886  if (sub == 4) {
887  cONE->Print("HistRMSHF.png");
888  cONE->Clear();
889  }
890  }
891  if (test == 4) {
892  if (sub == 1) {
893  cONE->Print("Hist43TStoAllTSHB.png");
894  cONE->Clear();
895  }
896  if (sub == 2) {
897  cONE->Print("Hist43TStoAllTSHE.png");
898  cONE->Clear();
899  }
900  if (sub == 3) {
901  cONE->Print("Hist43TStoAllTSHO.png");
902  cONE->Clear();
903  }
904  if (sub == 4) {
905  cONE->Print("Hist43TStoAllTSHF.png");
906  cONE->Clear();
907  }
908  }
909  if (test == 5) {
910  if (sub == 1) {
911  cONE->Print("HistMeanPosHB.png");
912  cONE->Clear();
913  }
914  if (sub == 2) {
915  cONE->Print("HistMeanPosHE.png");
916  cONE->Clear();
917  }
918  if (sub == 3) {
919  cONE->Print("HistMeanPosHO.png");
920  cONE->Clear();
921  }
922  if (sub == 4) {
923  cONE->Print("HistMeanPosHF.png");
924  cONE->Clear();
925  }
926  }
927  if (test == 6) {
928  if (sub == 1) {
929  cONE->Print("HistMaxPosHB.png");
930  cONE->Clear();
931  }
932  if (sub == 2) {
933  cONE->Print("HistMaxPosHE.png");
934  cONE->Clear();
935  }
936  if (sub == 3) {
937  cONE->Print("HistMaxPosHO.png");
938  cONE->Clear();
939  }
940  if (sub == 4) {
941  cONE->Print("HistMaxPosHF.png");
942  cONE->Clear();
943  }
944  }
945  } // end sub
946  } //end test
947 
948  TH2F *Map_Calib[5][5]; // 2d histogramm for subdet, depth
949 
950  Map_Calib[1][1] = (TH2F *)hfile->Get("h_map_HB");
951  Map_Calib[1][2] = (TH2F *)hfile->Get("h_map_HB");
952  Map_Calib[2][1] = (TH2F *)hfile->Get("h_map_HE");
953  Map_Calib[2][2] = (TH2F *)hfile->Get("h_map_HE");
954  Map_Calib[2][3] = (TH2F *)hfile->Get("h_map_HE");
955  Map_Calib[3][4] = (TH2F *)hfile->Get("h_map_HO");
956  Map_Calib[4][1] = (TH2F *)hfile->Get("h_map_HF");
957  Map_Calib[4][2] = (TH2F *)hfile->Get("h_map_HF");
958 
959  //+++++++++++++++++++++++++++++
960  //Test 0 Entries
961  //+++++++++++++++++++++++++++++
962 
963  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
964  // if (sub==1) cHB->Divide(2,1);
965  // if (sub==2) cHE->Divide(3,1);
966  cONE->Divide(1, 1);
967  // if (sub==4) cHB->Divide(2,1);
968  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
969  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
970  // for (int k=k_min[sub];k<=k_max[sub];k++) { //Depth
971  int k = 1;
972  cONE->cd(k);
973  // if (sub==1) cHB->cd(k);
974  // if (sub==2) cHE->cd(k);
975  if (sub == 3)
976  k = 4;
977  // if (sub==4) cHB->cd(k);
978  gPad->SetGridy();
979  gPad->SetGridx();
980  gPad->SetLogz();
981  if (sub == 1)
982  sprintf(str, "HB");
983  if (sub == 2)
984  sprintf(str, "HE");
985  if (sub == 3)
986  sprintf(str, "HO");
987  if (sub == 4)
988  sprintf(str, "HF");
989  Map_Calib[sub][k]->SetTitle(str);
990  Map_Calib[sub][k]->SetXTitle("#eta \b");
991  Map_Calib[sub][k]->SetYTitle("#phi \b");
992  Map_Calib[sub][k]->SetZTitle("Number of events\b");
993  if (sub == 3)
994  Map_Calib[sub][k]->SetTitleOffset(0.8, "Z");
995  Map_Calib[sub][k]->Draw("COLZ");
996  Map_Calib[sub][k]->GetYaxis()->SetRangeUser(0, 72.);
997  // Map_Calib[sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
998  // if (sub==1) {cHB->Modified(); cHB->Update();}
999  // if (sub==2) {cHE->Modified(); cHE->Update();}
1000  cONE->Modified();
1001  cONE->Update();
1002  // if (sub==4) {cHB->Modified(); cHB->Update();}
1003  // }//end depth
1004 
1005  if (sub == 1) {
1006  cONE->Print("MapRateCalibEntryHB.png");
1007  cONE->Clear();
1008  }
1009  if (sub == 2) {
1010  cONE->Print("MapRateCalibEntryHE.png");
1011  cONE->Clear();
1012  }
1013  if (sub == 3) {
1014  cONE->Print("MapRateCalibEntryHO.png");
1015  cONE->Clear();
1016  }
1017  if (sub == 4) {
1018  cONE->Print("MapRateCalibEntryHF.png");
1019  cONE->Clear();
1020  }
1021  } // end sub
1022 
1023  //+++++++++++++++++++++++++++++
1024  //Test 11 (Cc) Rate of Cap ID errors for calibration channels
1025  //+++++++++++++++++++++++++++++
1026 
1027  Map_Ampl[11][1][1] = (TH2F *)hfile->Get("h_mapCapCalib047_HB");
1028  Map_Ampl[11][1][2] = (TH2F *)hfile->Get("h_mapCapCalib047_HB");
1029  Map_Ampl[11][2][1] = (TH2F *)hfile->Get("h_mapCapCalib047_HE");
1030  Map_Ampl[11][2][2] = (TH2F *)hfile->Get("h_mapCapCalib047_HE");
1031  Map_Ampl[11][2][3] = (TH2F *)hfile->Get("h_mapCapCalib047_HE");
1032  Map_Ampl[11][3][4] = (TH2F *)hfile->Get("h_mapCapCalib047_HO");
1033  Map_Ampl[11][4][1] = (TH2F *)hfile->Get("h_mapCapCalib047_HF");
1034  Map_Ampl[11][4][2] = (TH2F *)hfile->Get("h_mapCapCalib047_HF");
1035 
1036  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
1037  // if (sub==1) cHB->Divide(2,1);
1038  // if (sub==2) cHE->Divide(3,1);
1039  cONE->Divide(1, 1);
1040  // if (sub==4) cHB->Divide(2,1);
1041  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
1042  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
1043  // for (int k=k_min[sub];k<=k_max[sub];k++) { //Depth
1044  int k = 1;
1045  cONE->cd(k);
1046  // if (sub==1) cHB->cd(k);
1047  // if (sub==2) cHE->cd(k);
1048  if (sub == 3)
1049  k = 4;
1050  // if (sub==4) cHB->cd(k);
1051  Map_Ampl[11][sub][k]->Divide(Map_Ampl[11][sub][k], Map_Calib[sub][k], 1, 1, "B");
1052  gPad->SetGridy();
1053  gPad->SetGridx();
1054  gPad->SetLogz();
1055  if (sub == 1)
1056  sprintf(str, "HB");
1057  if (sub == 2)
1058  sprintf(str, "HE");
1059  if (sub == 3)
1060  sprintf(str, "HO");
1061  if (sub == 4)
1062  sprintf(str, "HF");
1063  Map_Ampl[11][sub][k]->SetTitle(str);
1064  Map_Ampl[11][sub][k]->SetXTitle("#eta \b");
1065  Map_Ampl[11][sub][k]->SetYTitle("#phi \b");
1066  Map_Ampl[11][sub][k]->SetZTitle("Rate \b");
1067  Map_Ampl[11][sub][k]->SetTitleOffset(0.75, "Z");
1068  Map_Ampl[11][sub][k]->Draw("COLZ");
1069  Map_Ampl[11][sub][k]->GetYaxis()->SetRangeUser(0, 72.);
1070  Map_Ampl[11][sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
1071  // if (sub==1) {cHB->Modified(); cHB->Update();}
1072  // if (sub==2) {cHE->Modified(); cHE->Update();}
1073  cONE->Modified();
1074  cONE->Update();
1075  // if (sub==4) {cHB->Modified(); cHB->Update();}
1076  // }//end depth
1077 
1078  if (sub == 1) {
1079  cONE->Print("MapRateCapCalibHB.png");
1080  cONE->Clear();
1081  }
1082  if (sub == 2) {
1083  cONE->Print("MapRateCapCalibHE.png");
1084  cONE->Clear();
1085  }
1086  if (sub == 3) {
1087  cONE->Print("MapRateCapCalibHO.png");
1088  cONE->Clear();
1089  }
1090  if (sub == 4) {
1091  cONE->Print("MapRateCapCalibHF.png");
1092  cONE->Clear();
1093  }
1094  } // end sub
1095 
1096  //+++++++++++++++++++++++++++++
1097  //Test 12 (Ac) ADC amplitude for calibration chanels
1098  //+++++++++++++++++++++++++++++
1099 
1100  Map_Ampl[12][1][1] = (TH2F *)hfile->Get("h_mapADCCalib047_HB");
1101  Map_Ampl[12][1][2] = (TH2F *)hfile->Get("h_mapADCCalib047_HB");
1102  Map_Ampl[12][2][1] = (TH2F *)hfile->Get("h_mapADCCalib047_HE");
1103  Map_Ampl[12][2][2] = (TH2F *)hfile->Get("h_mapADCCalib047_HE");
1104  Map_Ampl[12][2][3] = (TH2F *)hfile->Get("h_mapADCCalib047_HE");
1105  Map_Ampl[12][3][4] = (TH2F *)hfile->Get("h_mapADCCalib047_HO");
1106  Map_Ampl[12][4][1] = (TH2F *)hfile->Get("h_mapADCCalib047_HF");
1107  Map_Ampl[12][4][2] = (TH2F *)hfile->Get("h_mapADCCalib047_HF");
1108 
1109  HistAmpl[12][1] = (TH1F *)hfile->Get("h_ADCCalib_HB");
1110  HistAmpl[12][2] = (TH1F *)hfile->Get("h_ADCCalib_HE");
1111  HistAmpl[12][3] = (TH1F *)hfile->Get("h_ADCCalib_HO");
1112  HistAmpl[12][4] = (TH1F *)hfile->Get("h_ADCCalib_HF");
1113 
1114  //+++++++++++++++++++++++++++++
1115  //Test 13 (Wc) Rate of RMS
1116  //+++++++++++++++++++++++++++++
1117 
1118  Map_Ampl[13][1][1] = (TH2F *)hfile->Get("h_mapWidthCalib047_HB");
1119  Map_Ampl[13][1][2] = (TH2F *)hfile->Get("h_mapWidthCalib047_HB");
1120  Map_Ampl[13][2][1] = (TH2F *)hfile->Get("h_mapWidthCalib047_HE");
1121  Map_Ampl[13][2][2] = (TH2F *)hfile->Get("h_mapWidthCalib047_HE");
1122  Map_Ampl[13][2][3] = (TH2F *)hfile->Get("h_mapWidthCalib047_HE");
1123  Map_Ampl[13][3][4] = (TH2F *)hfile->Get("h_mapWidthCalib047_HO");
1124  Map_Ampl[13][4][1] = (TH2F *)hfile->Get("h_mapWidthCalib047_HF");
1125  Map_Ampl[13][4][2] = (TH2F *)hfile->Get("h_mapWidthCalib047_HF");
1126 
1127  HistAmpl[13][1] = (TH1F *)hfile->Get("h_WidthCalib_HB");
1128  HistAmpl[13][2] = (TH1F *)hfile->Get("h_WidthCalib_HE");
1129  HistAmpl[13][3] = (TH1F *)hfile->Get("h_WidthCalib_HO");
1130  HistAmpl[13][4] = (TH1F *)hfile->Get("h_WidthCalib_HF");
1131 
1132  //+++++++++++++++++++++++++++++
1133  //Test 14 (Rc) Rate of ratio 4 near max TS/ All TS
1134  //+++++++++++++++++++++++++++++
1135 
1136  Map_Ampl[14][1][1] = (TH2F *)hfile->Get("h_mapRatioCalib047_HB");
1137  Map_Ampl[14][1][2] = (TH2F *)hfile->Get("h_mapRatioCalib047_HB");
1138  Map_Ampl[14][2][1] = (TH2F *)hfile->Get("h_mapRatioCalib047_HE");
1139  Map_Ampl[14][2][2] = (TH2F *)hfile->Get("h_mapRatioCalib047_HE");
1140  Map_Ampl[14][2][3] = (TH2F *)hfile->Get("h_mapRatioCalib047_HE");
1141  Map_Ampl[14][3][4] = (TH2F *)hfile->Get("h_mapRatioCalib047_HO");
1142  Map_Ampl[14][4][1] = (TH2F *)hfile->Get("h_mapRatioCalib047_HF");
1143  Map_Ampl[14][4][2] = (TH2F *)hfile->Get("h_mapRatioCalib047_HF");
1144 
1145  HistAmpl[14][1] = (TH1F *)hfile->Get("h_RatioCalib_HB");
1146  HistAmpl[14][2] = (TH1F *)hfile->Get("h_RatioCalib_HE");
1147  HistAmpl[14][3] = (TH1F *)hfile->Get("h_RatioCalib_HO");
1148  HistAmpl[14][4] = (TH1F *)hfile->Get("h_RatioCalib_HF");
1149 
1150  //+++++++++++++++++++++++++++++
1151  //Test 15 (TNc) Mean position in 1-8 TS range
1152  //+++++++++++++++++++++++++++++
1153 
1154  Map_Ampl[15][1][1] = (TH2F *)hfile->Get("h_mapTSmeanCalib047_HB");
1155  Map_Ampl[15][1][2] = (TH2F *)hfile->Get("h_mapTSmeanCalib047_HB");
1156  Map_Ampl[15][2][1] = (TH2F *)hfile->Get("h_mapTSmeanCalib047_HE");
1157  Map_Ampl[15][2][2] = (TH2F *)hfile->Get("h_mapTSmeanCalib047_HE");
1158  Map_Ampl[15][2][3] = (TH2F *)hfile->Get("h_mapTSmeanCalib047_HE");
1159  Map_Ampl[15][3][4] = (TH2F *)hfile->Get("h_mapTSmeanCalib047_HO");
1160  Map_Ampl[15][4][1] = (TH2F *)hfile->Get("h_mapTSmeanCalib047_HF");
1161  Map_Ampl[15][4][2] = (TH2F *)hfile->Get("h_mapTSmeanCalib047_HF");
1162 
1163  HistAmpl[15][1] = (TH1F *)hfile->Get("h_TSmeanCalib_HB");
1164  HistAmpl[15][2] = (TH1F *)hfile->Get("h_TSmeanCalib_HE");
1165  HistAmpl[15][3] = (TH1F *)hfile->Get("h_TSmeanCalib_HO");
1166  HistAmpl[15][4] = (TH1F *)hfile->Get("h_TSmeanCalib_HF");
1167 
1168  //+++++++++++++++++++++++++++++
1169  //Test 16 (TXc) Maximum position in 1-8 TS range
1170  //+++++++++++++++++++++++++++++
1171 
1172  Map_Ampl[16][1][1] = (TH2F *)hfile->Get("h_mapTSmaxCalib047_HB");
1173  Map_Ampl[16][1][2] = (TH2F *)hfile->Get("h_mapTSmaxCalib047_HB");
1174  Map_Ampl[16][2][1] = (TH2F *)hfile->Get("h_mapTSmaxCalib047_HE");
1175  Map_Ampl[16][2][2] = (TH2F *)hfile->Get("h_mapTSmaxCalib047_HE");
1176  Map_Ampl[16][2][3] = (TH2F *)hfile->Get("h_mapTSmaxCalib047_HE");
1177  Map_Ampl[16][3][4] = (TH2F *)hfile->Get("h_mapTSmaxCalib047_HO");
1178  Map_Ampl[16][4][1] = (TH2F *)hfile->Get("h_mapTSmaxCalib047_HF");
1179  Map_Ampl[16][4][2] = (TH2F *)hfile->Get("h_mapTSmaxCalib047_HF");
1180 
1181  HistAmpl[16][1] = (TH1F *)hfile->Get("h_TSmaxCalib_HB");
1182  HistAmpl[16][2] = (TH1F *)hfile->Get("h_TSmaxCalib_HE");
1183  HistAmpl[16][3] = (TH1F *)hfile->Get("h_TSmaxCalib_HO");
1184  HistAmpl[16][4] = (TH1F *)hfile->Get("h_TSmaxCalib_HF");
1185 
1186  for (int test = 12; test <= 16; test++) { //Test: 2-Am, 3-Wm, 4-Rm, 5-TNm, 6-TXm,
1187  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
1188  if (sub == 1)
1189  cONE->Divide(1, 1); //cHB->Divide(2,1);
1190  if (sub == 2)
1191  cONE->Divide(1, 1); //cHE->Divide(3,1);
1192  if (sub == 3)
1193  cONE->Divide(1, 1);
1194  if (sub == 4)
1195  cONE->Divide(1, 1); //cHB->Divide(2,1);
1196  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
1197  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
1198  // for (int k=k_min[sub];k<=k_max[sub];k++) { //Depth
1199  int k = 1;
1200  if (sub == 1) {
1201  k = 1;
1202  cONE->cd(k);
1203  } //cHB->cd(k); }
1204  if (sub == 2) {
1205  k = 1;
1206  cONE->cd(k);
1207  } //cHE->cd(k); }
1208  if (sub == 3) {
1209  k = 4;
1210  cONE->cd(k - 3);
1211  }
1212  if (sub == 4) {
1213  k = 1;
1214  cONE->cd(k);
1215  } //cHB->cd(k); }
1216  Map_Ampl[test][sub][k]->Divide(Map_Ampl[test][sub][k], Map_Calib[sub][k], 1, 1, "B");
1217  gPad->SetGridy();
1218  gPad->SetGridx();
1219  gPad->SetLogz();
1220  if (sub == 1)
1221  sprintf(str, "HB");
1222  if (sub == 2)
1223  sprintf(str, "HE");
1224  if (sub == 3)
1225  sprintf(str, "HO");
1226  if (sub == 4)
1227  sprintf(str, "HF");
1228  Map_Ampl[test][sub][k]->SetTitle(str);
1229  Map_Ampl[test][sub][k]->SetXTitle("#eta \b");
1230  Map_Ampl[test][sub][k]->SetYTitle("#phi \b");
1231  Map_Ampl[test][sub][k]->SetZTitle("Rate \b");
1232  Map_Ampl[test][sub][k]->SetTitleOffset(0.8, "Z");
1233  Map_Ampl[test][sub][k]->Draw("COLZ");
1234  Map_Ampl[test][sub][k]->GetYaxis()->SetRangeUser(0, 72.);
1235  Map_Ampl[test][sub][k]->GetZaxis()->SetRangeUser(0.00001, 1.);
1236  // if (sub==1) {cHB->Modified(); cHB->Update();}
1237  // if (sub==2) {cHE->Modified(); cHE->Update();}
1238  cONE->Modified();
1239  cONE->Update();
1240  // if (sub==4) {cHB->Modified(); cHB->Update();}
1241  // }//end depth
1242  if (test == 12) {
1243  if (sub == 1) {
1244  cONE->Print("MapRateAmplCalibHB.png");
1245  cONE->Clear();
1246  }
1247  if (sub == 2) {
1248  cONE->Print("MapRateAmplCalibHE.png");
1249  cONE->Clear();
1250  }
1251  if (sub == 3) {
1252  cONE->Print("MapRateAmplCalibHO.png");
1253  cONE->Clear();
1254  }
1255  if (sub == 4) {
1256  cONE->Print("MapRateAmplCalibHF.png");
1257  cONE->Clear();
1258  }
1259  }
1260  if (test == 13) {
1261  if (sub == 1) {
1262  cONE->Print("MapRateRMSCalibHB.png");
1263  cONE->Clear();
1264  }
1265  if (sub == 2) {
1266  cONE->Print("MapRateRMSCalibHE.png");
1267  cONE->Clear();
1268  }
1269  if (sub == 3) {
1270  cONE->Print("MapRateRMSCalibHO.png");
1271  cONE->Clear();
1272  }
1273  if (sub == 4) {
1274  cONE->Print("MapRateRMSCalibHF.png");
1275  cONE->Clear();
1276  }
1277  }
1278  if (test == 14) {
1279  if (sub == 1) {
1280  cONE->Print("MapRate43TStoAllTSCalibHB.png");
1281  cONE->Clear();
1282  }
1283  if (sub == 2) {
1284  cONE->Print("MapRate43TStoAllTSCalibHE.png");
1285  cONE->Clear();
1286  }
1287  if (sub == 3) {
1288  cONE->Print("MapRate43TStoAllTSCalibHO.png");
1289  cONE->Clear();
1290  }
1291  if (sub == 4) {
1292  cONE->Print("MapRate43TStoAllTSCalibHF.png");
1293  cONE->Clear();
1294  }
1295  }
1296  if (test == 15) {
1297  if (sub == 1) {
1298  cONE->Print("MapRateMeanPosCalibHB.png");
1299  cONE->Clear();
1300  }
1301  if (sub == 2) {
1302  cONE->Print("MapRateMeanPosCalibHE.png");
1303  cONE->Clear();
1304  }
1305  if (sub == 3) {
1306  cONE->Print("MapRateMeanPosCalibHO.png");
1307  cONE->Clear();
1308  }
1309  if (sub == 4) {
1310  cONE->Print("MapRateMeanPosCalibHF.png");
1311  cONE->Clear();
1312  }
1313  }
1314  if (test == 16) {
1315  if (sub == 1) {
1316  cONE->Print("MapRateMaxPosCalibHB.png");
1317  cONE->Clear();
1318  }
1319  if (sub == 2) {
1320  cONE->Print("MapRateMaxPosCalibHE.png");
1321  cONE->Clear();
1322  }
1323  if (sub == 3) {
1324  cONE->Print("MapRateMaxPosCalibHO.png");
1325  cONE->Clear();
1326  }
1327  if (sub == 4) {
1328  cONE->Print("MapRateMaxPosCalibHF.png");
1329  cONE->Clear();
1330  }
1331  }
1332 
1333  cONE->Divide(1, 1);
1334  cONE->cd(1);
1335  gPad->SetGridy();
1336  gPad->SetGridx();
1337  gPad->SetLogy();
1338  if (sub == 1)
1339  HistAmpl[test][sub]->SetTitle("HB, All Depth");
1340  if (sub == 2)
1341  HistAmpl[test][sub]->SetTitle("HE, All Depth");
1342  if (sub == 3)
1343  HistAmpl[test][sub]->SetTitle("HO, All Depth");
1344  if (sub == 4)
1345  HistAmpl[test][sub]->SetTitle("HF, All Depth");
1346  if (test == 12)
1347  HistAmpl[test][sub]->SetXTitle("ADC Amlitude in each event & cell \b");
1348  if (test == 13)
1349  HistAmpl[test][sub]->SetXTitle("Amplitude RMS in each event & cell \b");
1350  if (test == 14)
1351  HistAmpl[test][sub]->SetXTitle("Ratio in each event & cell \b");
1352  if (test == 15)
1353  HistAmpl[test][sub]->SetXTitle("Mean TS position in each event & cell \b");
1354  if (test == 16)
1355  HistAmpl[test][sub]->SetXTitle("Max TS position in each event & cell \b");
1356  HistAmpl[test][sub]->SetYTitle("Number of cell-events \b");
1357  HistAmpl[test][sub]->SetLineColor(4);
1358  HistAmpl[test][sub]->SetLineWidth(2);
1359  HistAmpl[test][sub]->SetTitleOffset(1.4, "Y");
1360  HistAmpl[test][sub]->Draw("");
1361  // HistAmpl[test][sub]->GetYaxis()->SetRangeUser(1., 100.);
1362  if (test == 12) {
1363  gPad->SetLogx();
1364  HistAmpl[test][sub]->GetXaxis()->SetRangeUser(1., 10000.);
1365  }
1366  if (test == 13)
1367  HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 5.);
1368  if (test == 14)
1369  HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 1.);
1370  if (test == 15)
1371  HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 9.);
1372  if (test == 16)
1373  HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 9.);
1374  cONE->Modified();
1375  cONE->Update();
1376  double min_x[] = {MIN_C[test - 10][sub], MIN_C[test - 10][sub]};
1377  double min_y[] = {0., 100000000.};
1378  TGraph *MIN = new TGraph(2, min_x, min_y);
1379  MIN->SetLineStyle(2);
1380  MIN->SetLineColor(2);
1381  MIN->SetLineWidth(2 + 100 * 100);
1382  MIN->SetFillStyle(3005);
1383  MIN->SetFillColor(2);
1384  MIN->Draw("L");
1385  double max_x[] = {MAX_C[test - 10][sub], MAX_C[test - 10][sub]};
1386  double max_y[] = {0., 100000000.};
1387  TGraph *MAX = new TGraph(2, max_x, max_y);
1388  MAX->SetLineStyle(2);
1389  MAX->SetLineColor(2);
1390  MAX->SetLineWidth(-2 - 100 * 100);
1391  MAX->SetFillStyle(3004);
1392  MAX->SetFillColor(2);
1393  MAX->Draw("L");
1394  if (test == 12) {
1395  if (sub == 1) {
1396  cONE->Print("HistAmplCalibHB.png");
1397  cONE->Clear();
1398  }
1399  if (sub == 2) {
1400  cONE->Print("HistAmplCalibHE.png");
1401  cONE->Clear();
1402  }
1403  if (sub == 3) {
1404  cONE->Print("HistAmplCalibHO.png");
1405  cONE->Clear();
1406  }
1407  if (sub == 4) {
1408  cONE->Print("HistAmplCalibHF.png");
1409  cONE->Clear();
1410  }
1411  }
1412  if (test == 13) {
1413  if (sub == 1) {
1414  cONE->Print("HistRMSCalibHB.png");
1415  cONE->Clear();
1416  }
1417  if (sub == 2) {
1418  cONE->Print("HistRMSCalibHE.png");
1419  cONE->Clear();
1420  }
1421  if (sub == 3) {
1422  cONE->Print("HistRMSCalibHO.png");
1423  cONE->Clear();
1424  }
1425  if (sub == 4) {
1426  cONE->Print("HistRMSCalibHF.png");
1427  cONE->Clear();
1428  }
1429  }
1430  if (test == 14) {
1431  if (sub == 1) {
1432  cONE->Print("Hist43TStoAllTSCalibHB.png");
1433  cONE->Clear();
1434  }
1435  if (sub == 2) {
1436  cONE->Print("Hist43TStoAllTSCalibHE.png");
1437  cONE->Clear();
1438  }
1439  if (sub == 3) {
1440  cONE->Print("Hist43TStoAllTSCalibHO.png");
1441  cONE->Clear();
1442  }
1443  if (sub == 4) {
1444  cONE->Print("Hist43TStoAllTSCalibHF.png");
1445  cONE->Clear();
1446  }
1447  }
1448  if (test == 15) {
1449  if (sub == 1) {
1450  cONE->Print("HistMeanPosCalibHB.png");
1451  cONE->Clear();
1452  }
1453  if (sub == 2) {
1454  cONE->Print("HistMeanPosCalibHE.png");
1455  cONE->Clear();
1456  }
1457  if (sub == 3) {
1458  cONE->Print("HistMeanPosCalibHO.png");
1459  cONE->Clear();
1460  }
1461  if (sub == 4) {
1462  cONE->Print("HistMeanPosCalibHF.png");
1463  cONE->Clear();
1464  }
1465  }
1466  if (test == 16) {
1467  if (sub == 1) {
1468  cONE->Print("HistMaxPosCalibHB.png");
1469  cONE->Clear();
1470  }
1471  if (sub == 2) {
1472  cONE->Print("HistMaxPosCalibHE.png");
1473  cONE->Clear();
1474  }
1475  if (sub == 3) {
1476  cONE->Print("HistMaxPosCalibHO.png");
1477  cONE->Clear();
1478  }
1479  if (sub == 4) {
1480  cONE->Print("HistMaxPosCalibHF.png");
1481  cONE->Clear();
1482  }
1483  }
1484  } // end sub
1485  } //end test
1486 
1487  //+++++++++++++++++++++++++++++
1488  //Test 21 (GS) Amplitude drift
1489  //+++++++++++++++++++++++++++++
1490 
1491  Map_Ampl[21][1][1] = (TH2F *)hfile->Get("h_mapDepth1AmplE34_HB");
1492  Map_Ampl[21][1][2] = (TH2F *)hfile->Get("h_mapDepth2AmplE34_HB");
1493  Map_Ampl[21][1][3] = (TH2F *)hfile->Get("h_mapDepth3AmplE34_HB");
1494  Map_Ampl[21][1][4] = (TH2F *)hfile->Get("h_mapDepth4AmplE34_HB");
1495  Map_Ampl[21][2][1] = (TH2F *)hfile->Get("h_mapDepth1AmplE34_HE");
1496  Map_Ampl[21][2][2] = (TH2F *)hfile->Get("h_mapDepth2AmplE34_HE");
1497  Map_Ampl[21][2][3] = (TH2F *)hfile->Get("h_mapDepth3AmplE34_HE");
1498  Map_Ampl[21][2][4] = (TH2F *)hfile->Get("h_mapDepth4AmplE34_HE");
1499  Map_Ampl[21][2][5] = (TH2F *)hfile->Get("h_mapDepth5AmplE34_HE");
1500  Map_Ampl[21][2][6] = (TH2F *)hfile->Get("h_mapDepth6AmplE34_HE");
1501  Map_Ampl[21][2][7] = (TH2F *)hfile->Get("h_mapDepth7AmplE34_HE");
1502  Map_Ampl[21][3][4] = (TH2F *)hfile->Get("h_mapDepth4AmplE34_HO");
1503  Map_Ampl[21][4][1] = (TH2F *)hfile->Get("h_mapDepth1AmplE34_HF");
1504  Map_Ampl[21][4][2] = (TH2F *)hfile->Get("h_mapDepth2AmplE34_HF");
1505  Map_Ampl[21][4][3] = (TH2F *)hfile->Get("h_mapDepth3AmplE34_HF");
1506  Map_Ampl[21][4][4] = (TH2F *)hfile->Get("h_mapDepth4AmplE34_HF");
1507 
1508  TH2F *Map_RefAmpl[5][ALLDEPTH]; // 2D histogramm for subdet, depth
1509  TH2F *Map_RefSUB[5][ALLDEPTH]; // 2d histogramm for subdet, depth
1510 
1511  Map_RefAmpl[1][1] = (TH2F *)hreffile->Get("h_mapDepth1AmplE34_HB");
1512  Map_RefAmpl[1][2] = (TH2F *)hreffile->Get("h_mapDepth2AmplE34_HB");
1513  Map_RefAmpl[1][3] = (TH2F *)hreffile->Get("h_mapDepth3AmplE34_HB");
1514  Map_RefAmpl[1][4] = (TH2F *)hreffile->Get("h_mapDepth4AmplE34_HB");
1515  Map_RefAmpl[2][1] = (TH2F *)hreffile->Get("h_mapDepth1AmplE34_HE");
1516  Map_RefAmpl[2][2] = (TH2F *)hreffile->Get("h_mapDepth2AmplE34_HE");
1517  Map_RefAmpl[2][3] = (TH2F *)hreffile->Get("h_mapDepth3AmplE34_HE");
1518  Map_RefAmpl[2][4] = (TH2F *)hreffile->Get("h_mapDepth4AmplE34_HE");
1519  Map_RefAmpl[2][5] = (TH2F *)hreffile->Get("h_mapDepth5AmplE34_HE");
1520  Map_RefAmpl[2][6] = (TH2F *)hreffile->Get("h_mapDepth6AmplE34_HE");
1521  Map_RefAmpl[2][7] = (TH2F *)hreffile->Get("h_mapDepth7AmplE34_HE");
1522  Map_RefAmpl[3][4] = (TH2F *)hreffile->Get("h_mapDepth4AmplE34_HO");
1523  Map_RefAmpl[4][1] = (TH2F *)hreffile->Get("h_mapDepth1AmplE34_HF");
1524  Map_RefAmpl[4][2] = (TH2F *)hreffile->Get("h_mapDepth2AmplE34_HF");
1525  Map_RefAmpl[4][3] = (TH2F *)hreffile->Get("h_mapDepth3AmplE34_HF");
1526  Map_RefAmpl[4][4] = (TH2F *)hreffile->Get("h_mapDepth4AmplE34_HF");
1527 
1528  Map_RefSUB[1][1] = (TH2F *)hreffile->Get("h_mapDepth1_HB");
1529  Map_RefSUB[1][2] = (TH2F *)hreffile->Get("h_mapDepth2_HB");
1530  Map_RefSUB[1][3] = (TH2F *)hreffile->Get("h_mapDepth3_HB");
1531  Map_RefSUB[1][4] = (TH2F *)hreffile->Get("h_mapDepth4_HB");
1532  Map_RefSUB[2][1] = (TH2F *)hreffile->Get("h_mapDepth1_HE");
1533  Map_RefSUB[2][2] = (TH2F *)hreffile->Get("h_mapDepth2_HE");
1534  Map_RefSUB[2][3] = (TH2F *)hreffile->Get("h_mapDepth3_HE");
1535  Map_RefSUB[2][4] = (TH2F *)hreffile->Get("h_mapDepth4_HE");
1536  Map_RefSUB[2][5] = (TH2F *)hreffile->Get("h_mapDepth5_HE");
1537  Map_RefSUB[2][6] = (TH2F *)hreffile->Get("h_mapDepth6_HE");
1538  Map_RefSUB[2][7] = (TH2F *)hreffile->Get("h_mapDepth7_HE");
1539  Map_RefSUB[3][4] = (TH2F *)hreffile->Get("h_mapDepth4_HO");
1540  Map_RefSUB[4][1] = (TH2F *)hreffile->Get("h_mapDepth1_HF");
1541  Map_RefSUB[4][2] = (TH2F *)hreffile->Get("h_mapDepth2_HF");
1542  Map_RefSUB[4][3] = (TH2F *)hreffile->Get("h_mapDepth3_HF");
1543  Map_RefSUB[4][4] = (TH2F *)hreffile->Get("h_mapDepth4_HF");
1544 
1545  HistAmplDepth[21][1][1] = new TH1F("diffAmpl_Depth1_HB", "", 100, -10., 10.);
1546  HistAmplDepth[21][1][2] = new TH1F("diffAmpl_Depth2_HB", "", 100, -10., 10.);
1547  HistAmplDepth[21][1][3] = new TH1F("diffAmpl_Depth3_HB", "", 100, -10., 10.);
1548  HistAmplDepth[21][1][4] = new TH1F("diffAmpl_Depth4_HB", "", 100, -10., 10.);
1549  HistAmplDepth[21][2][1] = new TH1F("diffAmpl_Depth1_HE", "", 100, -10., 10.);
1550  HistAmplDepth[21][2][2] = new TH1F("diffAmpl_Depth2_HE", "", 100, -10., 10.);
1551  HistAmplDepth[21][2][3] = new TH1F("diffAmpl_Depth3_HE", "", 100, -10., 10.);
1552  HistAmplDepth[21][2][4] = new TH1F("diffAmpl_Depth4_HE", "", 100, -10., 10.);
1553  HistAmplDepth[21][2][5] = new TH1F("diffAmpl_Depth5_HE", "", 100, -10., 10.);
1554  HistAmplDepth[21][2][6] = new TH1F("diffAmpl_Depth6_HE", "", 100, -10., 10.);
1555  HistAmplDepth[21][2][7] = new TH1F("diffAmpl_Depth7_HE", "", 100, -10., 10.);
1556  HistAmplDepth[21][3][4] = new TH1F("diffAmpl_Depth4_HO", "", 100, -10., 10.);
1557  HistAmplDepth[21][4][1] = new TH1F("diffAmpl_Depth1_HF", "", 100, -10., 10.);
1558  HistAmplDepth[21][4][2] = new TH1F("diffAmpl_Depth2_HF", "", 100, -10., 10.);
1559  HistAmplDepth[21][4][3] = new TH1F("diffAmpl_Depth3_HF", "", 100, -10., 10.);
1560  HistAmplDepth[21][4][4] = new TH1F("diffAmpl_Depth4_HF", "", 100, -10., 10.);
1561 
1562  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
1563  // if (sub==1) cHB->Divide(2,1);
1564  if (sub == 1)
1565  cHB->Divide(2, 2);
1566  // if (sub==2) cHE->Divide(3,1);
1567  if (sub == 2)
1568  cHE->Divide(3, 3);
1569  if (sub == 3)
1570  cONE->Divide(1, 1);
1571  // if (sub==4) cHF->Divide(2,1);
1572  if (sub == 4)
1573  cHF->Divide(2, 2);
1574  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
1575  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
1576  // int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
1577  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
1578  if (sub == 1)
1579  cHB->cd(k);
1580  if (sub == 2)
1581  cHE->cd(k);
1582  if (sub == 3)
1583  cONE->cd(k - 3);
1584  if (sub == 4)
1585  cHF->cd(k);
1586  Map_Ampl[21][sub][k]->Divide(Map_Ampl[21][sub][k], Map_SUB[sub][k], 1, 1, "B");
1587  gPad->SetGridy();
1588  gPad->SetGridx();
1589  gPad->SetLogz();
1590  if (sub == 1)
1591  sprintf(str, "HB, Depth%d \b", k);
1592  if (sub == 2)
1593  sprintf(str, "HE, Depth%d \b", k);
1594  if (sub == 3)
1595  sprintf(str, "HO, Depth%d \b", k);
1596  if (sub == 4)
1597  sprintf(str, "HF, Depth%d \b", k);
1598  Map_Ampl[21][sub][k]->SetTitle(str);
1599  Map_Ampl[21][sub][k]->SetXTitle("#eta \b");
1600  Map_Ampl[21][sub][k]->SetYTitle("#phi \b");
1601  Map_Ampl[21][sub][k]->SetZTitle("Response \b");
1602  Map_Ampl[21][sub][k]->SetTitleOffset(1.1, "Z");
1603  Map_Ampl[21][sub][k]->Draw("COLZ");
1604  Map_Ampl[21][sub][k]->GetYaxis()->SetRangeUser(0, 71.);
1605  // Map_Ampl[21][sub][k]->GetZaxis()->SetRangeUser(1., 10.);
1606  if (sub == 1) {
1607  cHB->Modified();
1608  cHB->Update();
1609  }
1610  if (sub == 2) {
1611  cHE->Modified();
1612  cHE->Update();
1613  }
1614  if (sub == 3) {
1615  cONE->Modified();
1616  cONE->Update();
1617  }
1618  if (sub == 4) {
1619  cHF->Modified();
1620  cHF->Update();
1621  }
1622  } //end depth
1623  if (sub == 1) {
1624  cHB->Print("MapRateAmpl1HB.png");
1625  cHB->Clear();
1626  }
1627  if (sub == 2) {
1628  cHE->Print("MapRateAmpl1HE.png");
1629  cHE->Clear();
1630  }
1631  if (sub == 3) {
1632  cONE->Print("MapRateAmpl1HO.png");
1633  cONE->Clear();
1634  }
1635  if (sub == 4) {
1636  cHF->Print("MapRateAmpl1HF.png");
1637  cHF->Clear();
1638  }
1639 
1640  // if (sub==1) cHB->Divide(2,1);
1641  if (sub == 1)
1642  cHB->Divide(2, 2);
1643  // if (sub==2) cHE->Divide(3,1);
1644  if (sub == 2)
1645  cHE->Divide(3, 3);
1646  if (sub == 3)
1647  cONE->Divide(1, 1);
1648  // if (sub==4) cHF->Divide(2,1);
1649  if (sub == 4)
1650  cHF->Divide(2, 2);
1651 
1652  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
1653  if (sub == 1)
1654  cHB->cd(k);
1655  if (sub == 2)
1656  cHE->cd(k);
1657  if (sub == 3)
1658  cONE->cd(k - 3);
1659  if (sub == 4)
1660  cHF->cd(k);
1661  Map_RefAmpl[sub][k]->Divide(Map_RefAmpl[sub][k], Map_RefSUB[sub][k], 1, 1, "B");
1662  gPad->SetGridy();
1663  gPad->SetGridx();
1664  gPad->SetLogz();
1665  if (sub == 1)
1666  sprintf(str, "HB, Depth%d \b", k);
1667  if (sub == 2)
1668  sprintf(str, "HE, Depth%d \b", k);
1669  if (sub == 3)
1670  sprintf(str, "HO, Depth%d \b", k);
1671  if (sub == 4)
1672  sprintf(str, "HF, Depth%d \b", k);
1673  Map_RefAmpl[sub][k]->SetTitle(str);
1674  Map_RefAmpl[sub][k]->SetXTitle("#eta \b");
1675  Map_RefAmpl[sub][k]->SetYTitle("#phi \b");
1676  Map_RefAmpl[sub][k]->SetZTitle("Response\b");
1677  Map_RefAmpl[sub][k]->SetTitleOffset(1.1, "Z");
1678  Map_RefAmpl[sub][k]->Draw("COLZ");
1679  Map_RefAmpl[sub][k]->GetYaxis()->SetRangeUser(0, 71.);
1680  // Map_RefAmpl[21][sub][k]->GetZaxis()->SetRangeUser(1., 10.);
1681  if (sub == 1) {
1682  cHB->Modified();
1683  cHB->Update();
1684  }
1685  if (sub == 2) {
1686  cHE->Modified();
1687  cHE->Update();
1688  }
1689  if (sub == 3) {
1690  cONE->Modified();
1691  cONE->Update();
1692  }
1693  if (sub == 4) {
1694  cHF->Modified();
1695  cHF->Update();
1696  }
1697  } //end depth
1698  if (sub == 1) {
1699  cHB->Print("MapRateAmpl2HB.png");
1700  cHB->Clear();
1701  }
1702  if (sub == 2) {
1703  cHE->Print("MapRateAmpl2HE.png");
1704  cHE->Clear();
1705  }
1706  if (sub == 3) {
1707  cONE->Print("MapRateAmpl2HO.png");
1708  cONE->Clear();
1709  }
1710  if (sub == 4) {
1711  cHF->Print("MapRateAmpl2HF.png");
1712  cHF->Clear();
1713  }
1714 
1715  // if (sub==1) cHB->Divide(2,1);
1716  if (sub == 1)
1717  cHB->Divide(2, 2);
1718  // if (sub==2) cHE->Divide(3,1);
1719  if (sub == 2)
1720  cHE->Divide(3, 3);
1721  if (sub == 3)
1722  cONE->Divide(1, 1);
1723  // if (sub==4) cHF->Divide(2,1);
1724  if (sub == 4)
1725  cHF->Divide(2, 2);
1726 
1727  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
1728  if (sub == 1)
1729  cHB->cd(k);
1730  if (sub == 2)
1731  cHE->cd(k);
1732  if (sub == 3)
1733  cONE->cd(k - 3);
1734  if (sub == 4)
1735  cHF->cd(k);
1736  TH2F *TTT = new TH2F("Map", "Map", 82, -41, 40, 72, 0, 71);
1737  for (int x = 1; x <= Map_Ampl[21][sub][k]->GetXaxis()->GetNbins(); x++) {
1738  for (int y = 1; y <= Map_Ampl[21][sub][k]->GetYaxis()->GetNbins(); y++) {
1739  if (Map_Ampl[21][sub][k]->GetBinContent(x, y) != 0 && Map_RefAmpl[sub][k]->GetBinContent(x, y) != 0) {
1740  double ccc1 = Map_Ampl[21][sub][k]->GetBinContent(x, y) - Map_RefAmpl[sub][k]->GetBinContent(x, y);
1741  ccc1 = 100. * ccc1 / Map_Ampl[21][sub][k]->GetBinContent(x, y); // in %
1742  HistAmplDepth[21][sub][k]->Fill(ccc1);
1743  Map_Ampl[21][sub][k]->SetBinContent(x, y, fabs(ccc1));
1744  if (fabs(ccc1) > porog[sub])
1745  TTT->SetBinContent(x, y, fabs(ccc1));
1746  else
1747  TTT->SetBinContent(x, y, 0);
1748  }
1749  } //end y
1750  } //esnd x
1751  gPad->SetGridy();
1752  gPad->SetGridx();
1753  // gPad->SetLogz();
1754  if (sub == 1)
1755  sprintf(str, "HB, Depth%d \b", k);
1756  if (sub == 2)
1757  sprintf(str, "HE, Depth%d \b", k);
1758  if (sub == 3)
1759  sprintf(str, "HO, Depth%d \b", k);
1760  if (sub == 4)
1761  sprintf(str, "HF, Depth%d \b", k);
1762  TTT->SetTitle(str);
1763  TTT->SetXTitle("#eta \b");
1764  TTT->SetYTitle("#phi \b");
1765  TTT->SetZTitle("Relative difference, % \b");
1766  TTT->SetTitleOffset(0.9, "Z");
1767  TTT->Draw("COLZ");
1768  TTT->GetYaxis()->SetRangeUser(0, 71.);
1769  TTT->GetZaxis()->SetRangeUser(0, 10.);
1770  if (sub == 1) {
1771  cHB->Modified();
1772  cHB->Update();
1773  }
1774  if (sub == 2) {
1775  cHE->Modified();
1776  cHE->Update();
1777  }
1778  if (sub == 3) {
1779  cONE->Modified();
1780  cONE->Update();
1781  }
1782  if (sub == 4) {
1783  cHF->Modified();
1784  cHF->Update();
1785  }
1786  } //end depth
1787 
1788  if (sub == 1) {
1789  cHB->Print("MapRateAmplDriftHB.png");
1790  cHB->Clear();
1791  }
1792  if (sub == 2) {
1793  cHE->Print("MapRateAmplDriftHE.png");
1794  cHE->Clear();
1795  }
1796  if (sub == 3) {
1797  cONE->Print("MapRateAmplDriftHO.png");
1798  cONE->Clear();
1799  }
1800  if (sub == 4) {
1801  cHF->Print("MapRateAmplDriftHF.png");
1802  cHF->Clear();
1803  }
1805 
1806  // if (sub==1) cHB->Divide(2,1);
1807  if (sub == 1)
1808  cHB->Divide(2, 2);
1809  // if (sub==2) cHE->Divide(3,1);
1810  if (sub == 2)
1811  cHE->Divide(3, 3);
1812  if (sub == 3)
1813  cONE->Divide(1, 1);
1814  // if (sub==4) cHF->Divide(2,1);
1815  if (sub == 4)
1816  cHF->Divide(2, 2);
1817 
1818  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
1819  if (sub == 1)
1820  cHB->cd(k);
1821  if (sub == 2)
1822  cHE->cd(k);
1823  if (sub == 3)
1824  cONE->cd(k - 3);
1825  if (sub == 4)
1826  cHF->cd(k);
1827  gPad->SetGridy();
1828  gPad->SetGridx();
1829  gPad->SetLogy();
1830  if (sub == 1)
1831  sprintf(str, "HB, Depth%d \b", k);
1832  if (sub == 2)
1833  sprintf(str, "HE, Depth%d \b", k);
1834  if (sub == 3)
1835  sprintf(str, "HO, Depth%d \b", k);
1836  if (sub == 4)
1837  sprintf(str, "HF, Depth%d \b", k);
1838  HistAmplDepth[21][sub][k]->SetTitle(str);
1839  HistAmplDepth[21][sub][k]->SetYTitle("Number of cell-events \b");
1840  HistAmplDepth[21][sub][k]->SetXTitle("Per cent \b");
1841  HistAmplDepth[21][sub][k]->SetLineColor(4);
1842  HistAmplDepth[21][sub][k]->SetLineWidth(2);
1843  HistAmplDepth[21][sub][k]->SetTitleOffset(1.4, "Y");
1844  HistAmplDepth[21][sub][k]->Draw();
1845  // HistAmplDepth[21][sub][k]->GetYaxis()->SetRangeUser(0, 72.);
1846  HistAmplDepth[21][sub][k]->GetXaxis()->SetRangeUser(-10., 10.);
1847  if (sub == 1) {
1848  cHB->Modified();
1849  cHB->Update();
1850  }
1851  if (sub == 2) {
1852  cHE->Modified();
1853  cHE->Update();
1854  }
1855  if (sub == 3) {
1856  cONE->Modified();
1857  cONE->Update();
1858  }
1859  if (sub == 4) {
1860  cHF->Modified();
1861  cHF->Update();
1862  }
1863  double min_x[] = {-1 * porog[sub], -1 * porog[sub]};
1864  double min_y[] = {0., 100000000.};
1865  TGraph *MIN = new TGraph(2, min_x, min_y);
1866  MIN->SetLineStyle(2);
1867  MIN->SetLineColor(2);
1868  MIN->SetLineWidth(2 + 100 * 100);
1869  MIN->SetFillStyle(3005);
1870  MIN->SetFillColor(2);
1871  MIN->Draw("L");
1872  double max_x[] = {porog[sub], porog[sub]};
1873  double max_y[] = {0., 100000000.};
1874  TGraph *MAX = new TGraph(2, max_x, max_y);
1875  MAX->SetLineStyle(2);
1876  MAX->SetLineColor(2);
1877  MAX->SetLineWidth(-2 - 100 * 100);
1878  MAX->SetFillStyle(3004);
1879  MAX->SetFillColor(2);
1880  MAX->Draw("L");
1881  } // end depth
1882  if (sub == 1) {
1883  cHB->Print("HistAmplDriftDepthHB.png");
1884  cHB->Clear();
1885  }
1886  if (sub == 2) {
1887  cHE->Print("HistAmplDriftDepthHE.png");
1888  cHE->Clear();
1889  }
1890  if (sub == 3) {
1891  cONE->Print("HistAmplDriftDepthHO.png");
1892  cONE->Clear();
1893  }
1894  if (sub == 4) {
1895  cHF->Print("HistAmplDriftDepthHF.png");
1896  cHF->Clear();
1897  }
1898  } //end sub
1899 
1900  //+++++++++++++++++++++++++++++++++++
1901  //Test 31, 32 Pedestal, pedestalWidths
1902  //++++++++++++++++++++++++++++++++++++
1903 
1904  Map_Ampl[31][1][1] = (TH2F *)hfile->Get("h_mapDepth1pedestal_HB");
1905  Map_Ampl[31][1][2] = (TH2F *)hfile->Get("h_mapDepth2pedestal_HB");
1906  Map_Ampl[31][1][3] = (TH2F *)hfile->Get("h_mapDepth3pedestal_HB");
1907  Map_Ampl[31][1][4] = (TH2F *)hfile->Get("h_mapDepth4pedestal_HB");
1908  Map_Ampl[31][2][1] = (TH2F *)hfile->Get("h_mapDepth1pedestal_HE");
1909  Map_Ampl[31][2][2] = (TH2F *)hfile->Get("h_mapDepth2pedestal_HE");
1910  Map_Ampl[31][2][3] = (TH2F *)hfile->Get("h_mapDepth3pedestal_HE");
1911  Map_Ampl[31][2][4] = (TH2F *)hfile->Get("h_mapDepth4pedestal_HE");
1912  Map_Ampl[31][2][5] = (TH2F *)hfile->Get("h_mapDepth5pedestal_HE");
1913  Map_Ampl[31][2][6] = (TH2F *)hfile->Get("h_mapDepth6pedestal_HE");
1914  Map_Ampl[31][2][7] = (TH2F *)hfile->Get("h_mapDepth7pedestal_HE");
1915  Map_Ampl[31][3][4] = (TH2F *)hfile->Get("h_mapDepth4pedestal_HO");
1916  Map_Ampl[31][4][1] = (TH2F *)hfile->Get("h_mapDepth1pedestal_HF");
1917  Map_Ampl[31][4][2] = (TH2F *)hfile->Get("h_mapDepth2pedestal_HF");
1918  Map_Ampl[31][4][3] = (TH2F *)hfile->Get("h_mapDepth3pedestal_HF");
1919  Map_Ampl[31][4][4] = (TH2F *)hfile->Get("h_mapDepth4pedestal_HF");
1920 
1921  Map_Ampl[32][1][1] = (TH2F *)hfile->Get("h_mapDepth1pedestalw_HB");
1922  Map_Ampl[32][1][2] = (TH2F *)hfile->Get("h_mapDepth2pedestalw_HB");
1923  Map_Ampl[32][1][3] = (TH2F *)hfile->Get("h_mapDepth3pedestalw_HB");
1924  Map_Ampl[32][1][4] = (TH2F *)hfile->Get("h_mapDepth4pedestalw_HB");
1925  Map_Ampl[32][2][1] = (TH2F *)hfile->Get("h_mapDepth1pedestalw_HE");
1926  Map_Ampl[32][2][2] = (TH2F *)hfile->Get("h_mapDepth2pedestalw_HE");
1927  Map_Ampl[32][2][3] = (TH2F *)hfile->Get("h_mapDepth3pedestalw_HE");
1928  Map_Ampl[32][2][4] = (TH2F *)hfile->Get("h_mapDepth4pedestalw_HE");
1929  Map_Ampl[32][2][5] = (TH2F *)hfile->Get("h_mapDepth5pedestalw_HE");
1930  Map_Ampl[32][2][6] = (TH2F *)hfile->Get("h_mapDepth6pedestalw_HE");
1931  Map_Ampl[32][2][7] = (TH2F *)hfile->Get("h_mapDepth7pedestalw_HE");
1932  Map_Ampl[32][3][4] = (TH2F *)hfile->Get("h_mapDepth4pedestalw_HO");
1933  Map_Ampl[32][4][1] = (TH2F *)hfile->Get("h_mapDepth1pedestalw_HF");
1934  Map_Ampl[32][4][2] = (TH2F *)hfile->Get("h_mapDepth2pedestalw_HF");
1935  Map_Ampl[32][4][3] = (TH2F *)hfile->Get("h_mapDepth3pedestalw_HF");
1936  Map_Ampl[32][4][4] = (TH2F *)hfile->Get("h_mapDepth4pedestalw_HF");
1937 
1938  HistPed[1][1][0] = (TH1F *)hfile->Get("h_pedestal0_HB");
1939  HistPed[1][1][1] = (TH1F *)hfile->Get("h_pedestal1_HB");
1940  HistPed[1][1][2] = (TH1F *)hfile->Get("h_pedestal2_HB");
1941  HistPed[1][1][3] = (TH1F *)hfile->Get("h_pedestal3_HB");
1942  HistPed[2][1][0] = (TH1F *)hfile->Get("h_pedestalw0_HB");
1943  HistPed[2][1][1] = (TH1F *)hfile->Get("h_pedestalw1_HB");
1944  HistPed[2][1][2] = (TH1F *)hfile->Get("h_pedestalw2_HB");
1945  HistPed[2][1][3] = (TH1F *)hfile->Get("h_pedestalw3_HB");
1946 
1947  HistPed[1][2][0] = (TH1F *)hfile->Get("h_pedestal0_HE");
1948  HistPed[1][2][1] = (TH1F *)hfile->Get("h_pedestal1_HE");
1949  HistPed[1][2][2] = (TH1F *)hfile->Get("h_pedestal2_HE");
1950  HistPed[1][2][3] = (TH1F *)hfile->Get("h_pedestal3_HE");
1951  HistPed[2][2][0] = (TH1F *)hfile->Get("h_pedestalw0_HE");
1952  HistPed[2][2][1] = (TH1F *)hfile->Get("h_pedestalw1_HE");
1953  HistPed[2][2][2] = (TH1F *)hfile->Get("h_pedestalw2_HE");
1954  HistPed[2][2][3] = (TH1F *)hfile->Get("h_pedestalw3_HE");
1955 
1956  HistPed[1][3][0] = (TH1F *)hfile->Get("h_pedestal0_HO");
1957  HistPed[1][3][1] = (TH1F *)hfile->Get("h_pedestal1_HO");
1958  HistPed[1][3][2] = (TH1F *)hfile->Get("h_pedestal2_HO");
1959  HistPed[1][3][3] = (TH1F *)hfile->Get("h_pedestal3_HO");
1960  HistPed[2][3][0] = (TH1F *)hfile->Get("h_pedestalw0_HO");
1961  HistPed[2][3][1] = (TH1F *)hfile->Get("h_pedestalw1_HO");
1962  HistPed[2][3][2] = (TH1F *)hfile->Get("h_pedestalw2_HO");
1963  HistPed[2][3][3] = (TH1F *)hfile->Get("h_pedestalw3_HO");
1964 
1965  HistPed[1][4][0] = (TH1F *)hfile->Get("h_pedestal0_HF");
1966  HistPed[1][4][1] = (TH1F *)hfile->Get("h_pedestal1_HF");
1967  HistPed[1][4][2] = (TH1F *)hfile->Get("h_pedestal2_HF");
1968  HistPed[1][4][3] = (TH1F *)hfile->Get("h_pedestal3_HF");
1969  HistPed[2][4][0] = (TH1F *)hfile->Get("h_pedestalw0_HF");
1970  HistPed[2][4][1] = (TH1F *)hfile->Get("h_pedestalw1_HF");
1971  HistPed[2][4][2] = (TH1F *)hfile->Get("h_pedestalw2_HF");
1972  HistPed[2][4][3] = (TH1F *)hfile->Get("h_pedestalw3_HF");
1973 
1974  for (int test = 31; test <= 32; test++) { //Test: 31-Pedestals, 32-pedestal Widths,
1975  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
1976  // if (sub==1) cHB->Divide(2,1);
1977  if (sub == 1)
1978  cHB->Divide(2, 2);
1979  // if (sub==2) cHE->Divide(3,1);
1980  if (sub == 2)
1981  cHE->Divide(3, 3);
1982  if (sub == 3)
1983  cONE->Divide(1, 1);
1984  // if (sub==4) cHF->Divide(2,1);
1985  if (sub == 4)
1986  cHF->Divide(2, 2);
1987  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
1988  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
1989  // int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
1990  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depths
1991  if (sub == 1)
1992  cHB->cd(k);
1993  if (sub == 2)
1994  cHE->cd(k);
1995  if (sub == 3)
1996  cONE->cd(k - 3);
1997  if (sub == 4)
1998  cHF->cd(k);
1999  Map_Ampl[test][sub][k]->Divide(Map_Ampl[test][sub][k], Map_SUB[sub][k], 1, 1, "B");
2000  gPad->SetGridy();
2001  gPad->SetGridx();
2002  gPad->SetLogz();
2003  if (sub == 1)
2004  sprintf(str, "HB, Depth%d \b", k);
2005  if (sub == 2)
2006  sprintf(str, "HE, Depth%d \b", k);
2007  if (sub == 3)
2008  sprintf(str, "HO, Depth%d \b", k);
2009  if (sub == 4)
2010  sprintf(str, "HF, Depth%d \b", k);
2011  Map_Ampl[test][sub][k]->SetTitle(str);
2012  Map_Ampl[test][sub][k]->SetXTitle("#eta \b");
2013  Map_Ampl[test][sub][k]->SetYTitle("#phi \b");
2014  Map_Ampl[test][sub][k]->SetZTitle("Rate \b");
2015  if (sub == 3)
2016  Map_Ampl[test][sub][k]->SetTitleOffset(0.8, "Z");
2017  Map_Ampl[test][sub][k]->Draw("COLZ");
2018  Map_Ampl[test][sub][k]->GetYaxis()->SetRangeUser(0, 72.);
2019  Map_Ampl[test][sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
2020  if (sub == 1) {
2021  cHB->Modified();
2022  cHB->Update();
2023  }
2024  if (sub == 2) {
2025  cHE->Modified();
2026  cHE->Update();
2027  }
2028  if (sub == 3) {
2029  cONE->Modified();
2030  cONE->Update();
2031  }
2032  if (sub == 4) {
2033  cHF->Modified();
2034  cHF->Update();
2035  }
2036  } //end depth
2037  if (test == 31) {
2038  if (sub == 1) {
2039  cHB->Print("MapRatePedHB.png");
2040  cHB->Clear();
2041  }
2042  if (sub == 2) {
2043  cHE->Print("MapRatePedHE.png");
2044  cHE->Clear();
2045  }
2046  if (sub == 3) {
2047  cONE->Print("MapRatePedHO.png");
2048  cONE->Clear();
2049  }
2050  if (sub == 4) {
2051  cHF->Print("MapRatePedHF.png");
2052  cHF->Clear();
2053  }
2054  }
2055  if (test == 32) {
2056  if (sub == 1) {
2057  cHB->Print("MapRatePedWidthsHB.png");
2058  cHB->Clear();
2059  }
2060  if (sub == 2) {
2061  cHE->Print("MapRatePedWidthsHE.png");
2062  cHE->Clear();
2063  }
2064  if (sub == 3) {
2065  cONE->Print("MapRatePedWidthsHO.png");
2066  cONE->Clear();
2067  }
2068  if (sub == 4) {
2069  cHF->Print("MapRatePedWidthsHF.png");
2070  cHF->Clear();
2071  }
2072  }
2073 
2075 
2076  cPED->Divide(2, 2);
2077  for (int cap = 0; cap <= 3; cap++) {
2078  cPED->cd(cap + 1);
2079  gPad->SetGridy();
2080  gPad->SetGridx();
2081  gPad->SetLogy();
2082 
2083  if (sub == 1)
2084  sprintf(str, "HB, Cap%d, all depth\b", cap);
2085  if (sub == 2)
2086  sprintf(str, "HE, Cap%d, all depth\b", cap);
2087  if (sub == 3)
2088  sprintf(str, "HO, Cap%d, all depth\b", cap);
2089  if (sub == 4)
2090  sprintf(str, "HF, Cap%d, all depth\b", cap);
2091 
2092  HistPed[test - 30][sub][cap]->SetTitle(str);
2093 
2094  if (test == 31)
2095  HistPed[test - 30][sub][cap]->SetXTitle("Pedestals in each event & cell \b");
2096  if (test == 32)
2097  HistPed[test - 30][sub][cap]->SetXTitle("Pedestal Widths in each event & cell \b");
2098 
2099  HistPed[test - 30][sub][cap]->SetYTitle("Number of channel-events \b");
2100  HistPed[test - 30][sub][cap]->SetLineColor(4);
2101  HistPed[test - 30][sub][cap]->SetLineWidth(2);
2102  HistPed[test - 30][sub][cap]->SetTitleOffset(1.4, "Y");
2103  HistPed[test - 30][sub][cap]->Draw("");
2104  // HistPed[test-30][sub][cap]->GetYaxis()->SetRangeUser(1., 100.);
2105  // if (test==31) {gPad->SetLogx(); HistPed[test-30][sub][cap]->GetXaxis()->SetRangeUser(1., 10000.);}
2106  // if (test==32) HistPed[test-30][sub][cap]->GetXaxis()->SetRangeUser(0., 5.);
2107 
2108  cPED->Modified();
2109  cPED->Update();
2110  double min_x[] = {Pedest[test - 31][sub], Pedest[test - 31][sub]};
2111  double min_y[] = {0., 100000000.};
2112  TGraph *MIN = new TGraph(2, min_x, min_y);
2113  MIN->SetLineStyle(2);
2114  MIN->SetLineColor(2);
2115  MIN->SetLineWidth(2 + 100 * 100);
2116  MIN->SetFillStyle(3005);
2117  MIN->SetFillColor(2);
2118  MIN->Draw("L");
2119  }
2120  if (test == 31) {
2121  if (sub == 1) {
2122  cPED->Print("HistPedestalsHB.png");
2123  cPED->Clear();
2124  }
2125  if (sub == 2) {
2126  cPED->Print("HistPedestalsHE.png");
2127  cPED->Clear();
2128  }
2129  if (sub == 3) {
2130  cPED->Print("HistPedestalsHO.png");
2131  cPED->Clear();
2132  }
2133  if (sub == 4) {
2134  cPED->Print("HistPedestalsHF.png");
2135  cPED->Clear();
2136  }
2137  }
2138  if (test == 32) {
2139  if (sub == 1) {
2140  cPED->Print("HistPedestalWidthsHB.png");
2141  cPED->Clear();
2142  }
2143  if (sub == 2) {
2144  cPED->Print("HistPedestalWidthsHE.png");
2145  cPED->Clear();
2146  }
2147  if (sub == 3) {
2148  cPED->Print("HistPedestalWidthsHO.png");
2149  cPED->Clear();
2150  }
2151  if (sub == 4) {
2152  cPED->Print("HistPedestalWidthsHF.png");
2153  cPED->Clear();
2154  }
2155  }
2156  } // end sub
2157  } //end test 31,32
2158 
2159  //+++++++++++++++++++++++++++++++++++
2160  //Test 33 Correlation of Pedestal, pedestalWidths Vs fullAmplitude
2161  //++++++++++++++++++++++++++++++++++++
2162 
2163  cPED->Clear();
2164  Map_Ped[1][1] = (TH2F *)hfile->Get("h2_pedvsampl_HB");
2165  Map_Ped[1][2] = (TH2F *)hfile->Get("h2_pedvsampl_HE");
2166  Map_Ped[1][3] = (TH2F *)hfile->Get("h2_pedvsampl_HO");
2167  Map_Ped[1][4] = (TH2F *)hfile->Get("h2_pedvsampl_HF");
2168  Map_Ped[2][1] = (TH2F *)hfile->Get("h2_pedwvsampl_HB");
2169  Map_Ped[2][2] = (TH2F *)hfile->Get("h2_pedwvsampl_HE");
2170  Map_Ped[2][3] = (TH2F *)hfile->Get("h2_pedwvsampl_HO");
2171  Map_Ped[2][4] = (TH2F *)hfile->Get("h2_pedwvsampl_HF");
2172  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
2173  cPED->Divide(2, 1);
2174  for (int test = 1; test <= 2; test++) {
2175  cPED->cd(test);
2176  gPad->SetGridy();
2177  gPad->SetGridx();
2178  gPad->SetLogz();
2179  if (test == 1)
2180  Map_Ped[test][sub]->SetXTitle("Pedestal, fC \b");
2181  if (test == 2)
2182  Map_Ped[test][sub]->SetXTitle("pedestal Width, fC \b");
2183  Map_Ped[test][sub]->SetYTitle("Amplitude, fC \b");
2184  Map_Ped[test][sub]->SetZTitle("entries \b");
2185  if (test == 1)
2186  sprintf(str, "Cap0 Pedestal vs Amplitude \b");
2187  if (test == 2)
2188  sprintf(str, "Cap0 pedestalWidth vs Amplitude \b");
2189  Map_Ped[test][sub]->SetTitle(str);
2190  Map_Ped[test][sub]->Draw("COLZ");
2191  // Map_Ped[test][sub]->GetYaxis()->SetRangeUser(0, 72.);
2192  // Map_Ped[test][sub]->GetZaxis()->SetRangeUser(0.0001, 1.);
2193  cPED->Modified();
2194  cPED->Update();
2195  } // test 1,2
2196  if (sub == 1) {
2197  cPED->Print("CorrelationsMapPedestalVsfullAmplitudeHB.png");
2198  cPED->Clear();
2199  }
2200  if (sub == 2) {
2201  cPED->Print("CorrelationsMapPedestalVsfullAmplitudeHE.png");
2202  cPED->Clear();
2203  }
2204  if (sub == 3) {
2205  cPED->Print("CorrelationsMapPedestalVsfullAmplitudeHO.png");
2206  cPED->Clear();
2207  }
2208  if (sub == 4) {
2209  cPED->Print("CorrelationsMapPedestalVsfullAmplitudeHF.png");
2210  cPED->Clear();
2211  }
2212  } // end sub
2213 
2214  //+++++++++++++++++++++++++++++++++++
2215  //Test 41 Time Slices shape for good and bad channels
2216  //++++++++++++++++++++++++++++++++++++
2217 
2218  cONE->Clear();
2219  hist_GoodTSshape[1] = (TH1F *)hfile->Get("h_shape_good_channels_HB");
2220  hist_GoodTSshape[2] = (TH1F *)hfile->Get("h_shape_good_channels_HE");
2221  hist_GoodTSshape[3] = (TH1F *)hfile->Get("h_shape_good_channels_HO");
2222  hist_GoodTSshape[4] = (TH1F *)hfile->Get("h_shape_good_channels_HF");
2223 
2224  hist_GoodTSshape0[1] = (TH1F *)hfile->Get("h_shape0_good_channels_HB");
2225  hist_GoodTSshape0[2] = (TH1F *)hfile->Get("h_shape0_good_channels_HE");
2226  hist_GoodTSshape0[3] = (TH1F *)hfile->Get("h_shape0_good_channels_HO");
2227  hist_GoodTSshape0[4] = (TH1F *)hfile->Get("h_shape0_good_channels_HF");
2228 
2229  hist_BadTSshape[1] = (TH1F *)hfile->Get("h_shape_bad_channels_HB");
2230  hist_BadTSshape[2] = (TH1F *)hfile->Get("h_shape_bad_channels_HE");
2231  hist_BadTSshape[3] = (TH1F *)hfile->Get("h_shape_bad_channels_HO");
2232  hist_BadTSshape[4] = (TH1F *)hfile->Get("h_shape_bad_channels_HF");
2233 
2234  hist_BadTSshape0[1] = (TH1F *)hfile->Get("h_shape0_bad_channels_HB");
2235  hist_BadTSshape0[2] = (TH1F *)hfile->Get("h_shape0_bad_channels_HE");
2236  hist_BadTSshape0[3] = (TH1F *)hfile->Get("h_shape0_bad_channels_HO");
2237  hist_BadTSshape0[4] = (TH1F *)hfile->Get("h_shape0_bad_channels_HF");
2238 
2239  cONE->cd(1);
2240 
2241  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
2242 
2243  gPad->SetGridy();
2244  gPad->SetGridx();
2245  gPad->SetLogz();
2246  hist_GoodTSshape[sub]->Divide(hist_GoodTSshape[sub], hist_GoodTSshape0[sub], 1, 1, "B");
2247  hist_GoodTSshape[sub]->SetXTitle("Time slice \b");
2248  hist_GoodTSshape[sub]->SetYTitle("ADC counts \b");
2249  sprintf(str, "Mean ADC Shape \b");
2250  hist_GoodTSshape[sub]->SetTitle(str);
2251  hist_GoodTSshape[sub]->Draw("");
2252  // hist_GoodTSshape[sub]->GetYaxis()->SetRangeUser(0, 72.);
2253  // hist_GoodTSshape[sub]->GetZaxis()->SetRangeUser(0.0001, 1.);
2254  cONE->Modified();
2255  cONE->Update();
2256  if (sub == 1) {
2257  cONE->Print("HistGoodTSshapesHB.png");
2258  cONE->Clear();
2259  }
2260  if (sub == 2) {
2261  cONE->Print("HistGoodTSshapesHE.png");
2262  cONE->Clear();
2263  }
2264  if (sub == 3) {
2265  cONE->Print("HistGoodTSshapesHO.png");
2266  cONE->Clear();
2267  }
2268  if (sub == 4) {
2269  cONE->Print("HistGoodTSshapesHF.png");
2270  cONE->Clear();
2271  }
2272  } // end sub
2273 
2274  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
2275 
2276  gPad->SetGridy();
2277  gPad->SetGridx();
2278  gPad->SetLogz();
2279  hist_BadTSshape[sub]->Divide(hist_BadTSshape[sub], hist_BadTSshape0[sub], 1, 1, "B");
2280  hist_BadTSshape[sub]->SetXTitle("Time slice \b");
2281  hist_BadTSshape[sub]->SetYTitle("ADC counts \b");
2282  sprintf(str, "Mean ADC Shape \b");
2283  hist_BadTSshape[sub]->SetTitle(str);
2284  hist_BadTSshape[sub]->Draw("");
2285  // hist_BadTSshape[sub]->GetYaxis()->SetRangeUser(0, 72.);
2286  // hist_BadTSshape[sub]->GetZaxis()->SetRangeUser(0.0001, 1.);
2287  cONE->Modified();
2288  cONE->Update();
2289  if (sub == 1) {
2290  cONE->Print("HistBadTSshapesHB.png");
2291  cONE->Clear();
2292  }
2293  if (sub == 2) {
2294  cONE->Print("HistBadTSshapesHE.png");
2295  cONE->Clear();
2296  }
2297  if (sub == 3) {
2298  cONE->Print("HistBadTSshapesHO.png");
2299  cONE->Clear();
2300  }
2301  if (sub == 4) {
2302  cONE->Print("HistBadTSshapesHF.png");
2303  cONE->Clear();
2304  }
2305  } // end sub
2306 
2307  /*
2308  //+++++++++++++++++++++++++++++++++++
2309 //Test 42 ADC in TS distributions
2310 //++++++++++++++++++++++++++++++++++++
2311 
2312 std::cout<<" We are here to print ADC "<<std::endl;
2313 
2314  hist_ADC_All[1] = (TH1F*)hfile->Get("h_ADC_HB");
2315  hist_ADC_All[2] = (TH1F*)hfile->Get("h_ADC_HE");
2316  hist_ADC_All[3] = (TH1F*)hfile->Get("h_ADC_HO");
2317  hist_ADC_All[4] = (TH1F*)hfile->Get("h_ADC_HF");
2318 
2319 
2320  hist_ADC_DS[1][1] = (TH1F*)hfile->Get("h_ADC_HBdepth1");
2321  hist_ADC_DS[1][2] = (TH1F*)hfile->Get("h_ADC_HBdepth2");
2322  hist_ADC_DS[2][1] = (TH1F*)hfile->Get("h_ADC_HEdepth1");
2323  hist_ADC_DS[2][2] = (TH1F*)hfile->Get("h_ADC_HEdepth2");
2324  hist_ADC_DS[2][3] = (TH1F*)hfile->Get("h_ADC_HEdepth3");
2325  hist_ADC_DS[3][4] = (TH1F*)hfile->Get("h_ADC_HOdepth4");
2326  hist_ADC_DS[4][1] = (TH1F*)hfile->Get("h_ADC_HFdepth1");
2327  hist_ADC_DS[4][2] = (TH1F*)hfile->Get("h_ADC_HFdepth2");
2328 
2329 
2330  cONE->Clear();
2331  cONE->Divide(1,1);
2332  cONE->cd(1);
2333 
2334  for (int sub=1;sub<=4;sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
2335  gPad->SetGridy();
2336  gPad->SetGridx();
2337  gPad->SetLogy();
2338  hist_ADC_All[sub]->SetXTitle("ADC counts \b");
2339  hist_ADC_All[sub]->SetYTitle("Number of channels-events \b");
2340  if (sub==1) sprintf(str,"ADC counts Distribution HB\b");
2341  if (sub==2) sprintf(str,"ADC counts Distribution HE\b");
2342  if (sub==3) sprintf(str,"ADC counts Distribution HO\b");
2343  if (sub==4) sprintf(str,"ADC counts Distribution HF\b");
2344  hist_ADC_All[sub]->SetTitle(str);
2345  hist_ADC_All[sub]->Draw("");
2346  // hist_ADC_All[sub]->GetYaxis()->SetRangeUser(0, 72.);
2347  hist_ADC_All[sub]->GetXaxis()->SetRangeUser(0.000, 1000.);
2348  cONE->Modified(); cONE->Update();
2349  if (sub==1) {cONE->Print("Hist_ADC_HB_All.png"); cONE->Clear();}
2350  if (sub==2) {cONE->Print("Hist_ADC_HE_All.png"); cONE->Clear();}
2351  if (sub==3) {cONE->Print("Hist_ADC_HO_All.png"); cONE->Clear();}
2352  if (sub==4) {cONE->Print("Hist_ADC_HF_All.png"); cONE->Clear();}
2353  }// end sub
2354 
2355 
2356  for (int sub=1;sub<=4;sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
2357  if (sub==1) cHB->Divide(2,1);
2358  if (sub==2) cHE->Divide(3,1);
2359  if (sub==3) cONE->Divide(1,1);
2360  if (sub==4) cHB->Divide(2,1);
2361  int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
2362  int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
2363  for (int k=k_min[sub];k<=k_max[sub];k++) { //Depths
2364  if (sub==1) cHB->cd(k);
2365  if (sub==2) cHE->cd(k);
2366  if (sub==3) cONE->cd(k-3);
2367  if (sub==4) cHB->cd(k);
2368  gPad->SetGridy();
2369  gPad->SetGridx();
2370  gPad->SetLogy();
2371  hist_ADC_DS[sub][k]->SetXTitle("ADC counts \b");
2372  hist_ADC_DS[sub][k]->SetYTitle("Number of channels-events \b");
2373  if (sub==1) sprintf(str,"HB, Depth%d \b", k);
2374  if (sub==2) sprintf(str,"HE, Depth%d \b", k);
2375  if (sub==3) sprintf(str,"HO, Depth%d \b", k);
2376  if (sub==4) sprintf(str,"HF, Depth%d \b", k);
2377  hist_ADC_DS[sub][k]->SetTitle(str);
2378  hist_ADC_DS[sub][k]->Draw("");
2379  // hist_ADC_DS[sub][k]->GetYaxis()->SetRangeUser(0, 72.);
2380  hist_ADC_DS[sub][k]->GetXaxis()->SetRangeUser(0.000, 1000.);
2381  if (sub==1) {cHB->Modified(); cHB->Update();}
2382  if (sub==2) {cHE->Modified(); cHE->Update();}
2383  if (sub==3) {cONE->Modified();cONE->Update();}
2384  if (sub==4) {cHB->Modified(); cHB->Update();}
2385  }//end depth
2386  if (sub==1) {cHB->Print("Hist_ADC_HB_DS.png"); cHB->Clear();}
2387  if (sub==2) {cHE->Print("Hist_ADC_HE_DS.png"); cHE->Clear();}
2388  if (sub==3) {cONE->Print("Hist_ADC_HO_DS.png"); cONE->Clear();}
2389  if (sub==4) {cHB->Print("Hist_ADC_HF_DS.png"); cHB->Clear();}
2390  }// end sub
2391 
2392 
2393  //+++++++++++++++++++++++++++++++++++
2394 //Test 43 Sum ADC in TS distributions
2395 //++++++++++++++++++++++++++++++++++++
2396 
2397  hist_SumADC[1][1] = (TH1F*)hfile->Get("h_sumamplitude_depth1_HB");
2398  hist_SumADC[1][2] = (TH1F*)hfile->Get("h_sumamplitude_depth2_HB");
2399  hist_SumADC[2][1] = (TH1F*)hfile->Get("h_sumamplitude_depth1_HE");
2400  hist_SumADC[2][2] = (TH1F*)hfile->Get("h_sumamplitude_depth2_HE");
2401  hist_SumADC[2][3] = (TH1F*)hfile->Get("h_sumamplitude_depth3_HE");
2402  hist_SumADC[3][4] = (TH1F*)hfile->Get("h_sumamplitude_depth4_HO");
2403  hist_SumADC[4][1] = (TH1F*)hfile->Get("h_sumamplitude_depth1_HF");
2404  hist_SumADC[4][2] = (TH1F*)hfile->Get("h_sumamplitude_depth2_HF");
2405 
2406  hist_SumADC0[1][1] = (TH1F*)hfile->Get("h_sumamplitude_depth1_HB0");
2407  hist_SumADC0[1][2] = (TH1F*)hfile->Get("h_sumamplitude_depth2_HB0");
2408  hist_SumADC0[2][1] = (TH1F*)hfile->Get("h_sumamplitude_depth1_HE0");
2409  hist_SumADC0[2][2] = (TH1F*)hfile->Get("h_sumamplitude_depth2_HE0");
2410  hist_SumADC0[2][3] = (TH1F*)hfile->Get("h_sumamplitude_depth3_HE0");
2411  hist_SumADC0[3][4] = (TH1F*)hfile->Get("h_sumamplitude_depth4_HO0");
2412  hist_SumADC0[4][1] = (TH1F*)hfile->Get("h_sumamplitude_depth1_HF0");
2413  hist_SumADC0[4][2] = (TH1F*)hfile->Get("h_sumamplitude_depth2_HF0");
2414 
2415  hist_SumADC1[1][1] = (TH1F*)hfile->Get("h_sumamplitude_depth1_HB1");
2416  hist_SumADC1[1][2] = (TH1F*)hfile->Get("h_sumamplitude_depth2_HB1");
2417  hist_SumADC1[2][1] = (TH1F*)hfile->Get("h_sumamplitude_depth1_HE1");
2418  hist_SumADC1[2][2] = (TH1F*)hfile->Get("h_sumamplitude_depth2_HE1");
2419  hist_SumADC1[2][3] = (TH1F*)hfile->Get("h_sumamplitude_depth3_HE1");
2420  hist_SumADC1[3][4] = (TH1F*)hfile->Get("h_sumamplitude_depth4_HO1");
2421  hist_SumADC1[4][1] = (TH1F*)hfile->Get("h_sumamplitude_depth1_HF1");
2422  hist_SumADC1[4][2] = (TH1F*)hfile->Get("h_sumamplitude_depth2_HF1");
2423 
2424  for (int sub=1;sub<=4;sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
2425  if (sub==1) cHB->Divide(2,1);
2426  if (sub==2) cHE->Divide(3,1);
2427  if (sub==3) cONE->Divide(1,1);
2428  if (sub==4) cHB->Divide(2,1);
2429  int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
2430  int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
2431  for (int k=k_min[sub];k<=k_max[sub];k++) { //Depths
2432  if (sub==1) cHB->cd(k);
2433  if (sub==2) cHE->cd(k);
2434  if (sub==3) cONE->cd(k-3);
2435  if (sub==4) cHB->cd(k);
2436  gPad->SetGridy();
2437  gPad->SetGridx();
2438  gPad->SetLogy();
2439  hist_SumADC[sub][k]->SetXTitle("ADC sum \b");
2440  hist_SumADC[sub][k]->SetYTitle("Number of channels-events \b");
2441  if (sub==1) sprintf(str,"HB, Depth%d \b", k);
2442  if (sub==2) sprintf(str,"HE, Depth%d \b", k);
2443  if (sub==3) sprintf(str,"HO, Depth%d \b", k);
2444  if (sub==4) sprintf(str,"HF, Depth%d \b", k);
2445  hist_SumADC[sub][k]->SetTitle(str);
2446  hist_SumADC[sub][k]->Draw("");
2447  // hist_SumADC[sub][k]->GetYaxis()->SetRangeUser(0, 72.);
2448  // hist_SumADC[sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
2449  if (sub==1) {cHB->Modified(); cHB->Update();}
2450  if (sub==2) {cHE->Modified(); cHE->Update();}
2451  if (sub==3) {cONE->Modified();cONE->Update();}
2452  if (sub==4) {cHB->Modified(); cHB->Update();}
2453  }//end depth
2454  if (sub==1) {cHB->Print("Hist_SumADC_HB.png"); cHB->Clear();}
2455  if (sub==2) {cHE->Print("Hist_SumADC_HE.png"); cHE->Clear();}
2456  if (sub==3) {cONE->Print("Hist_SumADC_HO.png"); cONE->Clear();}
2457  if (sub==4) {cHB->Print("Hist_SumADC_HF.png"); cHB->Clear();}
2458  }// end sub
2459 
2460 
2461  for (int sub=1;sub<=4;sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
2462  if (sub==1) cHB->Divide(2,1);
2463  if (sub==2) cHE->Divide(3,1);
2464  if (sub==3) cONE->Divide(1,1);
2465  if (sub==4) cHB->Divide(2,1);
2466  int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
2467  int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
2468  for (int k=k_min[sub];k<=k_max[sub];k++) { //Depths
2469  if (sub==1) cHB->cd(k);
2470  if (sub==2) cHE->cd(k);
2471  if (sub==3) cONE->cd(k-3);
2472  if (sub==4) cHB->cd(k);
2473  gPad->SetGridy();
2474  gPad->SetGridx();
2475  gPad->SetLogy();
2476  hist_SumADC0[sub][k]->SetXTitle("ADC sum \b");
2477  hist_SumADC0[sub][k]->SetYTitle("Number of channels-events \b");
2478  if (sub==1) sprintf(str,"HB, Depth%d \b", k);
2479  if (sub==2) sprintf(str,"HE, Depth%d \b", k);
2480  if (sub==3) sprintf(str,"HO, Depth%d \b", k);
2481  if (sub==4) sprintf(str,"HF, Depth%d \b", k);
2482  hist_SumADC0[sub][k]->SetTitle(str);
2483  hist_SumADC0[sub][k]->Draw("");
2484  // hist_SumADC0[sub][k]->GetYaxis()->SetRangeUser(0, 72.);
2485  // hist_SumADC0[sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
2486  if (sub==1) {cHB->Modified(); cHB->Update();}
2487  if (sub==2) {cHE->Modified(); cHE->Update();}
2488  if (sub==3) {cONE->Modified();cONE->Update();}
2489  if (sub==4) {cHB->Modified(); cHB->Update();}
2490  }//end depth
2491  if (sub==1) {cHB->Print("Hist_SumADC_HB0.png"); cHB->Clear();}
2492  if (sub==2) {cHE->Print("Hist_SumADC_HE0.png"); cHE->Clear();}
2493  if (sub==3) {cONE->Print("Hist_SumADC_HO0.png"); cONE->Clear();}
2494  if (sub==4) {cHB->Print("Hist_SumADC_HF0.png"); cHB->Clear();}
2495  }// end sub
2496 
2497  for (int sub=1;sub<=4;sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
2498  if (sub==1) cHB->Divide(2,1);
2499  if (sub==2) cHE->Divide(3,1);
2500  if (sub==3) cONE->Divide(1,1);
2501  if (sub==4) cHB->Divide(2,1);
2502  int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
2503  int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
2504  for (int k=k_min[sub];k<=k_max[sub];k++) { //Depths
2505  if (sub==1) cHB->cd(k);
2506  if (sub==2) cHE->cd(k);
2507  if (sub==3) cONE->cd(k-3);
2508  if (sub==4) cHB->cd(k);
2509  gPad->SetGridy();
2510  gPad->SetGridx();
2511  gPad->SetLogy();
2512  hist_SumADC1[sub][k]->SetXTitle("ADC sum \b");
2513  hist_SumADC1[sub][k]->SetYTitle("Number of channels-events \b");
2514  if (sub==1) sprintf(str,"HB, Depth%d \b", k);
2515  if (sub==2) sprintf(str,"HE, Depth%d \b", k);
2516  if (sub==3) sprintf(str,"HO, Depth%d \b", k);
2517  if (sub==4) sprintf(str,"HF, Depth%d \b", k);
2518  hist_SumADC1[sub][k]->SetTitle(str);
2519  hist_SumADC1[sub][k]->Draw("");
2520  // hist_SumADC1[sub][k]->GetYaxis()->SetRangeUser(0, 72.);
2521  // hist_SumADC1[sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
2522  if (sub==1) {cHB->Modified(); cHB->Update();}
2523  if (sub==2) {cHE->Modified(); cHE->Update();}
2524  if (sub==3) {cONE->Modified();cONE->Update();}
2525  if (sub==4) {cHB->Modified(); cHB->Update();}
2526  }//end depth
2527  if (sub==1) {cHB->Print("Hist_SumADC_HB1.png"); cHB->Clear();}
2528  if (sub==2) {cHE->Print("Hist_SumADC_HE1.png"); cHE->Clear();}
2529  if (sub==3) {cONE->Print("Hist_SumADC_HO1.png"); cONE->Clear();}
2530  if (sub==4) {cHB->Print("Hist_SumADC_HF1.png"); cHB->Clear();}
2531  }// end sub
2532 
2533 */
2534 
2540 
2541  const int nsub = 4;
2542  const int ndepth = 7;
2543  const int neta = 82;
2544  const int nphi = 72;
2545  int njeta = neta;
2546  int njphi = nphi;
2547  int njdepth = ndepth;
2548  double alexhe[ndepth][njeta][njphi];
2549  double variance[ndepth][njeta][njphi];
2550 
2551  const int jposbeg = 57;
2552  const int jposend = 71;
2553 
2554  const int jnegbeg = 12;
2555  const int jnegend = 26;
2556 
2557  cout << "Iteration Method for Calibration Group nsub= " << nsub << " ndepth = " << ndepth << " neta = " << neta
2558  << " nphi = " << nphi << endl;
2559  cout << "Iteration Method for Calibration Group njdepth = " << njdepth << " njeta = " << njeta
2560  << " njphi = " << njphi << endl;
2561  cout << "Iteration Method for Calibration Group jposbeg = " << jposbeg << " jposend = " << jposend
2562  << " jnegbeg = " << jnegbeg << " jnegend = " << jnegend << endl;
2563 
2564  /*
2565  depth=5 all
2566  i=1-82 in initial histo
2567  j=i-1 in massives
2568 
2569  j= 13 23 (11) 12 25 (!!!)
2570  j-41 in histo
2571  -28 -18 (11) -29 -16
2572 
2573  j= 59 69 (11) 57 70 (!!!)
2574  j-41 in histo
2575  18 28 (11) 16 29
2576  */
2577 
2578  // RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR:
2579 
2580  TH2F *maprphinorm1HE1 = (TH2F *)hfile->Get("h_maprphinorm_HE1");
2581  TH2F *maprphinorm0HE1 = (TH2F *)hfile->Get("h_maprphinorm0_HE1");
2582  TH2F *maprphinormHE1 = (TH2F *)maprphinorm1HE1->Clone("maprphinormHE1");
2583  maprphinormHE1->Divide(maprphinorm1HE1, maprphinorm0HE1, 1, 1, "B");
2584  TH2F *maprphinorm1HE2 = (TH2F *)hfile->Get("h_maprphinorm_HE2");
2585  TH2F *maprphinorm0HE2 = (TH2F *)hfile->Get("h_maprphinorm0_HE2");
2586  TH2F *maprphinormHE2 = (TH2F *)maprphinorm1HE2->Clone("maprphinormHE2");
2587  maprphinormHE2->Divide(maprphinorm1HE2, maprphinorm0HE2, 1, 1, "B");
2588  TH2F *maprphinorm1HE3 = (TH2F *)hfile->Get("h_maprphinorm_HE3");
2589  TH2F *maprphinorm0HE3 = (TH2F *)hfile->Get("h_maprphinorm0_HE3");
2590  TH2F *maprphinormHE3 = (TH2F *)maprphinorm1HE3->Clone("maprphinormHE3");
2591  maprphinormHE3->Divide(maprphinorm1HE3, maprphinorm0HE3, 1, 1, "B");
2592  TH2F *maprphinorm1HE4 = (TH2F *)hfile->Get("h_maprphinorm_HE4");
2593  TH2F *maprphinorm0HE4 = (TH2F *)hfile->Get("h_maprphinorm0_HE4");
2594  TH2F *maprphinormHE4 = (TH2F *)maprphinorm1HE4->Clone("maprphinormHE4");
2595  maprphinormHE4->Divide(maprphinorm1HE4, maprphinorm0HE4, 1, 1, "B");
2596  TH2F *maprphinorm1HE5 = (TH2F *)hfile->Get("h_maprphinorm_HE5");
2597  TH2F *maprphinorm0HE5 = (TH2F *)hfile->Get("h_maprphinorm0_HE5");
2598  TH2F *maprphinormHE5 = (TH2F *)maprphinorm1HE5->Clone("maprphinormHE5");
2599  maprphinormHE5->Divide(maprphinorm1HE5, maprphinorm0HE5, 1, 1, "B");
2600  TH2F *maprphinorm1HE6 = (TH2F *)hfile->Get("h_maprphinorm_HE6");
2601  TH2F *maprphinorm0HE6 = (TH2F *)hfile->Get("h_maprphinorm0_HE6");
2602  TH2F *maprphinormHE6 = (TH2F *)maprphinorm1HE6->Clone("maprphinormHE6");
2603  maprphinormHE6->Divide(maprphinorm1HE6, maprphinorm0HE6, 1, 1, "B");
2604  TH2F *maprphinorm1HE7 = (TH2F *)hfile->Get("h_maprphinorm_HE7");
2605  TH2F *maprphinorm0HE7 = (TH2F *)hfile->Get("h_maprphinorm0_HE7");
2606  TH2F *maprphinormHE7 = (TH2F *)maprphinorm1HE7->Clone("maprphinormHE7");
2607  maprphinormHE7->Divide(maprphinorm1HE7, maprphinorm0HE7, 1, 1, "B");
2608  //=========================== put R into massive alexhe
2609  for (int jeta = 0; jeta < njeta; jeta++) {
2610  for (int jphi = 0; jphi < njphi; jphi++) {
2611  alexhe[0][jeta][jphi] = maprphinormHE1->GetBinContent(jeta + 1, jphi + 1);
2612  alexhe[1][jeta][jphi] = maprphinormHE2->GetBinContent(jeta + 1, jphi + 1);
2613  alexhe[2][jeta][jphi] = maprphinormHE3->GetBinContent(jeta + 1, jphi + 1);
2614  alexhe[3][jeta][jphi] = maprphinormHE4->GetBinContent(jeta + 1, jphi + 1);
2615  alexhe[4][jeta][jphi] = maprphinormHE5->GetBinContent(jeta + 1, jphi + 1);
2616  alexhe[5][jeta][jphi] = maprphinormHE6->GetBinContent(jeta + 1, jphi + 1);
2617  alexhe[6][jeta][jphi] = maprphinormHE7->GetBinContent(jeta + 1, jphi + 1);
2618  }
2619  }
2620 
2621  //------------------------ 2D-eta/phi-plot: R, averaged over depthes
2622  //======================================================================
2623  //======================================================================
2624  cout << " R2D-eta/phi-plot: R, averaged over depthes *****" << endl;
2625  c1x0->Clear();
2627  c1x0->Divide(1, 1);
2628  c1x0->cd(1);
2629  TH2F *Gefz42D = new TH2F("Gefz42D", "", neta, -41., 41., nphi, 0., 72.);
2630  TH2F *Gefz42D0 = new TH2F("Gefz42D0", "", neta, -41., 41., nphi, 0., 72.);
2631  TH2F *Gefz42DF = (TH2F *)Gefz42D0->Clone("Gefz42DF");
2632  for (int i = 0; i < ndepth; i++) {
2633  for (int jeta = 0; jeta < neta; jeta++) {
2634  for (int jphi = 0; jphi < nphi; jphi++) {
2635  double ccc1 = alexhe[i][jeta][jphi];
2636  int k2plot = jeta - 41;
2637  int kkk = k2plot; //if(k2plot >0 ) kkk=k2plot+1; //-41 +41 !=0
2638  if (ccc1 != 0.) {
2639  Gefz42D->Fill(kkk, jphi, ccc1);
2640  Gefz42D0->Fill(kkk, jphi, 1.);
2641  }
2642  }
2643  }
2644  }
2645  Gefz42DF->Divide(Gefz42D, Gefz42D0, 1, 1, "B"); // average A
2646  gPad->SetGridy();
2647  gPad->SetGridx(); // gPad->SetLogz();
2648  Gefz42DF->SetMarkerStyle(20);
2649  Gefz42DF->SetMarkerSize(0.4);
2650  Gefz42DF->GetZaxis()->SetLabelSize(0.08);
2651  Gefz42DF->SetXTitle("<R>_depth #eta \b");
2652  Gefz42DF->SetYTitle(" #phi \b");
2653  Gefz42DF->SetZTitle("<R>_depth \b");
2654  Gefz42DF->SetMarkerColor(2);
2655  Gefz42DF->SetLineColor(0); // Gefz42DF->SetMaximum(1.000); // Gefz42DF->SetMinimum(1.0);
2656  Gefz42DF->Draw("COLZ");
2657 
2659  c1x0->Update();
2660  c1x0->Print("Rhist2IterationMethodHE.png");
2661  c1x0->Clear();
2662  // clean-up
2663  if (Gefz42D)
2664  delete Gefz42D;
2665  if (Gefz42D0)
2666  delete Gefz42D0;
2667  if (Gefz42DF)
2668  delete Gefz42DF;
2669 
2670  //====================================================================== 1D plot: R vs phi , averaged over depthes & eta
2671  //======================================================================
2672  cout << " 1D plot: R vs phi , averaged over depthes & eta *****" << endl;
2673  c1x1->Clear();
2675  c1x1->Divide(1, 1);
2676  c1x1->cd(1);
2677  TH1F *Gefz41D = new TH1F("Gefz41D", "", nphi, 0., 72.);
2678  TH1F *Gefz41D0 = new TH1F("Gefz41D0", "", nphi, 0., 72.);
2679  TH1F *Gefz41DF = (TH1F *)Gefz41D0->Clone("Gefz41DF");
2680 
2681  for (int jphi = 0; jphi < nphi; jphi++) {
2682  for (int jeta = 0; jeta < neta; jeta++) {
2683  for (int i = 0; i < ndepth; i++) {
2684  double ccc1 = alexhe[i][jeta][jphi];
2685  if (ccc1 != 0.) {
2686  Gefz41D->Fill(jphi, ccc1);
2687  Gefz41D0->Fill(jphi, 1.);
2688  }
2689  }
2690  }
2691  }
2692  // Gefz41D->Sumw2();Gefz41D0->Sumw2();
2693 
2694  Gefz41DF->Divide(Gefz41D, Gefz41D0, 1, 1, "B"); // R averaged over depthes & eta
2695  Gefz41D0->Sumw2();
2696  // for (int jphi=1;jphi<73;jphi++) {Gefz41DF->SetBinError(jphi,0.01);}
2697  gPad->SetGridy();
2698  gPad->SetGridx(); // gPad->SetLogz();
2699  Gefz41DF->SetMarkerStyle(20);
2700  Gefz41DF->SetMarkerSize(1.4);
2701  Gefz41DF->GetZaxis()->SetLabelSize(0.08);
2702  Gefz41DF->SetXTitle("#phi \b");
2703  Gefz41DF->SetYTitle(" <R> \b");
2704  Gefz41DF->SetZTitle("<R>_PHI - AllDepthes \b");
2705  Gefz41DF->SetMarkerColor(4);
2706  Gefz41DF->SetLineColor(4);
2707  Gefz41DF->SetMinimum(0.8); // Gefz41DF->SetMaximum(1.000);
2708  Gefz41DF->Draw("Error");
2709 
2711  c1x1->Update();
2712  c1x1->Print("Rhist1IterationMethodHE.png");
2713  c1x1->Clear();
2714  // clean-up
2715  if (Gefz41D)
2716  delete Gefz41D;
2717  if (Gefz41D0)
2718  delete Gefz41D0;
2719  if (Gefz41DF)
2720  delete Gefz41DF;
2721 
2722  //========================================================================================== 4
2723  //======================================================================
2724  //======================================================================1D plot: R vs phi , different eta, depth=1
2725  cout << " 1D plot: R vs phi , different eta, depth=1 *****" << endl;
2726  c3x5->Clear();
2728  c3x5->Divide(3, 5);
2729  c3x5->cd(1);
2730  int kcountHEpositivedirection1 = 1;
2731  TH1F *h2CeffHEpositivedirection1 = new TH1F("h2CeffHEpositivedirection1", "", nphi, 0., 72.);
2732 
2733  for (int jeta = 0; jeta < njeta; jeta++) {
2734  // positivedirection:
2735  if (jeta - 41 > 0) {
2736  // for (int i=0;i<ndepth;i++) {
2737  // depth=1
2738  for (int i = 0; i < 1; i++) {
2739  TH1F *HEpositivedirection1 = (TH1F *)h2CeffHEpositivedirection1->Clone("twod1");
2740 
2741  float ccctest = 0; // to avoid empty massive elements
2742  for (int jphi = 0; jphi < nphi; jphi++) {
2743  double ccc1 = alexhe[i][jeta][jphi];
2744  if (ccc1 != 0.) {
2745  HEpositivedirection1->Fill(jphi, ccc1);
2746  ccctest = 1.; //HEpositivedirection1->SetBinError(i,0.01);
2747  }
2748  } // for jphi
2749  if (ccctest > 0.) {
2750  cout << "444 kcountHEpositivedirection1 = " << kcountHEpositivedirection1
2751  << " jeta-41= " << jeta - 41 << endl;
2752  c3x5->cd(kcountHEpositivedirection1);
2753  HEpositivedirection1->SetMarkerStyle(20);
2754  HEpositivedirection1->SetMarkerSize(0.4);
2755  HEpositivedirection1->GetYaxis()->SetLabelSize(0.04);
2756  HEpositivedirection1->SetXTitle("HEpositivedirection1 \b");
2757  HEpositivedirection1->SetMarkerColor(2);
2758  HEpositivedirection1->SetLineColor(0);
2759  gPad->SetGridy();
2760  gPad->SetGridx();
2761  // gPad->SetLogy();
2762  if (kcountHEpositivedirection1 == 1)
2763  HEpositivedirection1->SetXTitle("R for HE+ jeta = 18; depth = 1 \b");
2764  if (kcountHEpositivedirection1 == 2)
2765  HEpositivedirection1->SetXTitle("R for HE+ jeta = 19; depth = 1 \b");
2766  if (kcountHEpositivedirection1 == 3)
2767  HEpositivedirection1->SetXTitle("R for HE+ jeta = 20; depth = 1 \b");
2768  if (kcountHEpositivedirection1 == 4)
2769  HEpositivedirection1->SetXTitle("R for HE+ jeta = 21; depth = 1 \b");
2770  if (kcountHEpositivedirection1 == 5)
2771  HEpositivedirection1->SetXTitle("R for HE+ jeta = 22; depth = 1 \b");
2772  if (kcountHEpositivedirection1 == 6)
2773  HEpositivedirection1->SetXTitle("R for HE+ jeta = 23; depth = 1 \b");
2774  if (kcountHEpositivedirection1 == 7)
2775  HEpositivedirection1->SetXTitle("R for HE+ jeta = 24; depth = 1 \b");
2776  if (kcountHEpositivedirection1 == 8)
2777  HEpositivedirection1->SetXTitle("R for HE+ jeta = 25; depth = 1 \b");
2778  if (kcountHEpositivedirection1 == 9)
2779  HEpositivedirection1->SetXTitle("R for HE+ jeta = 26; depth = 1 \b");
2780  if (kcountHEpositivedirection1 == 10)
2781  HEpositivedirection1->SetXTitle("R for HE+ jeta = 27; depth = 1 \b");
2782  if (kcountHEpositivedirection1 == 11)
2783  HEpositivedirection1->SetXTitle("R for HE+ jeta = 28; depth = 1 \b");
2784  if (kcountHEpositivedirection1 == 12)
2785  HEpositivedirection1->SetXTitle("R for HE+ jeta = 29; depth = 1 \b");
2786  HEpositivedirection1->Draw("Error");
2787  kcountHEpositivedirection1++;
2788  if (kcountHEpositivedirection1 > 15)
2789  break; // 4x6 = 24
2790  } //ccctest>0
2791 
2792  } // for i
2793  } //if(jeta-41 > 0)
2794  } //for jeta
2796  c3x5->Update();
2797  c3x5->Print("Rhist1IterationMethodDepth1HE.png");
2798  c3x5->Clear();
2799  // clean-up
2800  if (h2CeffHEpositivedirection1)
2801  delete h2CeffHEpositivedirection1;
2802 
2803  //========================================================================================== 5
2804  //======================================================================
2805  //======================================================================1D plot: R vs phi , different eta, depth=2
2806  cout << " 1D plot: R vs phi , different eta, depth=2 *****" << endl;
2807  c3x5->Clear();
2809  c3x5->Divide(3, 5);
2810  c3x5->cd(1);
2811  int kcountHEpositivedirection2 = 1;
2812  TH1F *h2CeffHEpositivedirection2 = new TH1F("h2CeffHEpositivedirection2", "", nphi, 0., 72.);
2813 
2814  for (int jeta = 0; jeta < njeta; jeta++) {
2815  // positivedirection:
2816  if (jeta - 41 > 0) {
2817  // for (int i=0;i<ndepth;i++) {
2818  // depth=2
2819  for (int i = 1; i < 2; i++) {
2820  TH1F *HEpositivedirection2 = (TH1F *)h2CeffHEpositivedirection2->Clone("twod1");
2821 
2822  float ccctest = 0; // to avoid empty massive elements
2823  for (int jphi = 0; jphi < nphi; jphi++) {
2824  double ccc1 = alexhe[i][jeta][jphi];
2825  if (ccc1 != 0.) {
2826  HEpositivedirection2->Fill(jphi, ccc1);
2827  ccctest = 1.; //HEpositivedirection2->SetBinError(i,0.01);
2828  }
2829  } // for jphi
2830  if (ccctest > 0.) {
2831  cout << "555 kcountHEpositivedirection2 = " << kcountHEpositivedirection2
2832  << " jeta-41= " << jeta - 41 << endl;
2833  c3x5->cd(kcountHEpositivedirection2);
2834  HEpositivedirection2->SetMarkerStyle(20);
2835  HEpositivedirection2->SetMarkerSize(0.4);
2836  HEpositivedirection2->GetYaxis()->SetLabelSize(0.04);
2837  HEpositivedirection2->SetXTitle("HEpositivedirection2 \b");
2838  HEpositivedirection2->SetMarkerColor(2);
2839  HEpositivedirection2->SetLineColor(0);
2840  gPad->SetGridy();
2841  gPad->SetGridx();
2842  // gPad->SetLogy();
2843  if (kcountHEpositivedirection2 == 1)
2844  HEpositivedirection2->SetXTitle("R for HE+ jeta = 17; depth = 2 \b");
2845  if (kcountHEpositivedirection2 == 2)
2846  HEpositivedirection2->SetXTitle("R for HE+ jeta = 18; depth = 2 \b");
2847  if (kcountHEpositivedirection2 == 3)
2848  HEpositivedirection2->SetXTitle("R for HE+ jeta = 19; depth = 2 \b");
2849  if (kcountHEpositivedirection2 == 4)
2850  HEpositivedirection2->SetXTitle("R for HE+ jeta = 20; depth = 2 \b");
2851  if (kcountHEpositivedirection2 == 5)
2852  HEpositivedirection2->SetXTitle("R for HE+ jeta = 21; depth = 2 \b");
2853  if (kcountHEpositivedirection2 == 6)
2854  HEpositivedirection2->SetXTitle("R for HE+ jeta = 22; depth = 2 \b");
2855  if (kcountHEpositivedirection2 == 7)
2856  HEpositivedirection2->SetXTitle("R for HE+ jeta = 23; depth = 2 \b");
2857  if (kcountHEpositivedirection2 == 8)
2858  HEpositivedirection2->SetXTitle("R for HE+ jeta = 24; depth = 2 \b");
2859  if (kcountHEpositivedirection2 == 9)
2860  HEpositivedirection2->SetXTitle("R for HE+ jeta = 25; depth = 2 \b");
2861  if (kcountHEpositivedirection2 == 10)
2862  HEpositivedirection2->SetXTitle("R for HE+ jeta = 26; depth = 2 \b");
2863  if (kcountHEpositivedirection2 == 11)
2864  HEpositivedirection2->SetXTitle("R for HE+ jeta = 27; depth = 2 \b");
2865  if (kcountHEpositivedirection2 == 12)
2866  HEpositivedirection2->SetXTitle("R for HE+ jeta = 28; depth = 2 \b");
2867  if (kcountHEpositivedirection2 == 13)
2868  HEpositivedirection2->SetXTitle("R for HE+ jeta = 29; depth = 2 \b");
2869  HEpositivedirection2->Draw("Error");
2870  kcountHEpositivedirection2++;
2871  if (kcountHEpositivedirection2 > 15)
2872  break; // 4x6 = 24
2873  } //ccctest>0
2874 
2875  } // for i
2876  } //if(jeta-41 > 0)
2877  } //for jeta
2879  c3x5->Update();
2880  c3x5->Print("Rhist1IterationMethodDepth2HE.png");
2881  c3x5->Clear();
2882  // clean-up
2883  if (h2CeffHEpositivedirection2)
2884  delete h2CeffHEpositivedirection2;
2885  //========================================================================================== 6
2886  //======================================================================
2887  //======================================================================1D plot: R vs phi , different eta, depth=3
2888  cout << " 1D plot: R vs phi , different eta, depth=3 *****" << endl;
2889  c3x5->Clear();
2891  c3x5->Divide(3, 5);
2892  c3x5->cd(1);
2893  int kcountHEpositivedirection3 = 1;
2894  TH1F *h2CeffHEpositivedirection3 = new TH1F("h2CeffHEpositivedirection3", "", nphi, 0., 72.);
2895 
2896  for (int jeta = 0; jeta < njeta; jeta++) {
2897  // positivedirection:
2898  if (jeta - 41 > 0) {
2899  // for (int i=0;i<ndepth;i++) {
2900  // depth=3
2901  for (int i = 2; i < 3; i++) {
2902  TH1F *HEpositivedirection3 = (TH1F *)h2CeffHEpositivedirection3->Clone("twod1");
2903 
2904  float ccctest = 0; // to avoid empty massive elements
2905  for (int jphi = 0; jphi < nphi; jphi++) {
2906  double ccc1 = alexhe[i][jeta][jphi];
2907  if (ccc1 != 0.) {
2908  HEpositivedirection3->Fill(jphi, ccc1);
2909  ccctest = 1.; //HEpositivedirection3->SetBinError(i,0.01);
2910  }
2911  } // for jphi
2912  if (ccctest > 0.) {
2913  cout << "666 kcountHEpositivedirection3 = " << kcountHEpositivedirection3
2914  << " jeta-41= " << jeta - 41 << endl;
2915  c3x5->cd(kcountHEpositivedirection3);
2916  HEpositivedirection3->SetMarkerStyle(20);
2917  HEpositivedirection3->SetMarkerSize(0.4);
2918  HEpositivedirection3->GetYaxis()->SetLabelSize(0.04);
2919  HEpositivedirection3->SetXTitle("HEpositivedirection3 \b");
2920  HEpositivedirection3->SetMarkerColor(2);
2921  HEpositivedirection3->SetLineColor(0);
2922  gPad->SetGridy();
2923  gPad->SetGridx();
2924  // gPad->SetLogy();
2925  if (kcountHEpositivedirection3 == 1)
2926  HEpositivedirection3->SetXTitle("R for HE+ jeta = 17; depth = 3 \b");
2927  if (kcountHEpositivedirection3 == 2)
2928  HEpositivedirection3->SetXTitle("R for HE+ jeta = 18; depth = 3 \b");
2929  if (kcountHEpositivedirection3 == 3)
2930  HEpositivedirection3->SetXTitle("R for HE+ jeta = 19; depth = 3 \b");
2931  if (kcountHEpositivedirection3 == 4)
2932  HEpositivedirection3->SetXTitle("R for HE+ jeta = 20; depth = 3 \b");
2933  if (kcountHEpositivedirection3 == 5)
2934  HEpositivedirection3->SetXTitle("R for HE+ jeta = 21; depth = 3 \b");
2935  if (kcountHEpositivedirection3 == 6)
2936  HEpositivedirection3->SetXTitle("R for HE+ jeta = 22; depth = 3 \b");
2937  if (kcountHEpositivedirection3 == 7)
2938  HEpositivedirection3->SetXTitle("R for HE+ jeta = 23; depth = 3 \b");
2939  if (kcountHEpositivedirection3 == 8)
2940  HEpositivedirection3->SetXTitle("R for HE+ jeta = 24; depth = 3 \b");
2941  if (kcountHEpositivedirection3 == 9)
2942  HEpositivedirection3->SetXTitle("R for HE+ jeta = 25; depth = 3 \b");
2943  if (kcountHEpositivedirection3 == 10)
2944  HEpositivedirection3->SetXTitle("R for HE+ jeta = 26; depth = 3 \b");
2945  if (kcountHEpositivedirection3 == 11)
2946  HEpositivedirection3->SetXTitle("R for HE+ jeta = 27; depth = 3 \b");
2947  if (kcountHEpositivedirection3 == 12)
2948  HEpositivedirection3->SetXTitle("R for HE+ jeta = 28; depth = 3 \b");
2949  if (kcountHEpositivedirection3 == 13)
2950  HEpositivedirection3->SetXTitle("R for HE+ jeta = 29; depth = 3 \b");
2951  HEpositivedirection3->Draw("Error");
2952  kcountHEpositivedirection3++;
2953  if (kcountHEpositivedirection3 > 15)
2954  break; // 4x6 = 24
2955  } //ccctest>0
2956 
2957  } // for i
2958  } //if(jeta-41 > 0)
2959  } //for jeta
2961  c3x5->Update();
2962  c3x5->Print("Rhist1IterationMethodDepth3HE.png");
2963  c3x5->Clear();
2964  // clean-up
2965  if (h2CeffHEpositivedirection3)
2966  delete h2CeffHEpositivedirection3;
2967  //========================================================================================== 7
2968  //======================================================================
2969  //======================================================================1D plot: R vs phi , different eta, depth=4
2970  cout << " 1D plot: R vs phi , different eta, depth=4 *****" << endl;
2971  c3x5->Clear();
2973  c3x5->Divide(3, 5);
2974  c3x5->cd(1);
2975  int kcountHEpositivedirection4 = 1;
2976  TH1F *h2CeffHEpositivedirection4 = new TH1F("h2CeffHEpositivedirection4", "", nphi, 0., 72.);
2977 
2978  for (int jeta = 0; jeta < njeta; jeta++) {
2979  // positivedirection:
2980  if (jeta - 41 > 0) {
2981  // for (int i=0;i<ndepth;i++) {
2982  // depth=4
2983  for (int i = 3; i < 4; i++) {
2984  TH1F *HEpositivedirection4 = (TH1F *)h2CeffHEpositivedirection4->Clone("twod1");
2985 
2986  float ccctest = 0; // to avoid empty massive elements
2987  for (int jphi = 0; jphi < nphi; jphi++) {
2988  double ccc1 = alexhe[i][jeta][jphi];
2989  if (ccc1 != 0.) {
2990  HEpositivedirection4->Fill(jphi, ccc1);
2991  ccctest = 1.; //HEpositivedirection4->SetBinError(i,0.01);
2992  }
2993  } // for jphi
2994  if (ccctest > 0.) {
2995  cout << "777 kcountHEpositivedirection4 = " << kcountHEpositivedirection4
2996  << " jeta-41= " << jeta - 41 << endl;
2997  c3x5->cd(kcountHEpositivedirection4);
2998  HEpositivedirection4->SetMarkerStyle(20);
2999  HEpositivedirection4->SetMarkerSize(0.4);
3000  HEpositivedirection4->GetYaxis()->SetLabelSize(0.04);
3001  HEpositivedirection4->SetXTitle("HEpositivedirection4 \b");
3002  HEpositivedirection4->SetMarkerColor(2);
3003  HEpositivedirection4->SetLineColor(0);
3004  gPad->SetGridy();
3005  gPad->SetGridx();
3006  // gPad->SetLogy();
3007  if (kcountHEpositivedirection4 == 1)
3008  HEpositivedirection4->SetXTitle("R for HE+ jeta = 16; depth = 4 \b");
3009  if (kcountHEpositivedirection4 == 2)
3010  HEpositivedirection4->SetXTitle("R for HE+ jeta = 18; depth = 4 \b");
3011  if (kcountHEpositivedirection4 == 3)
3012  HEpositivedirection4->SetXTitle("R for HE+ jeta = 19; depth = 4 \b");
3013  if (kcountHEpositivedirection4 == 4)
3014  HEpositivedirection4->SetXTitle("R for HE+ jeta = 20; depth = 4 \b");
3015  if (kcountHEpositivedirection4 == 5)
3016  HEpositivedirection4->SetXTitle("R for HE+ jeta = 21; depth = 4 \b");
3017  if (kcountHEpositivedirection4 == 6)
3018  HEpositivedirection4->SetXTitle("R for HE+ jeta = 22; depth = 4 \b");
3019  if (kcountHEpositivedirection4 == 7)
3020  HEpositivedirection4->SetXTitle("R for HE+ jeta = 23; depth = 4 \b");
3021  if (kcountHEpositivedirection4 == 8)
3022  HEpositivedirection4->SetXTitle("R for HE+ jeta = 24; depth = 4 \b");
3023  if (kcountHEpositivedirection4 == 9)
3024  HEpositivedirection4->SetXTitle("R for HE+ jeta = 25; depth = 4 \b");
3025  if (kcountHEpositivedirection4 == 10)
3026  HEpositivedirection4->SetXTitle("R for HE+ jeta = 26; depth = 4 \b");
3027  if (kcountHEpositivedirection4 == 11)
3028  HEpositivedirection4->SetXTitle("R for HE+ jeta = 27; depth = 4 \b");
3029  if (kcountHEpositivedirection4 == 12)
3030  HEpositivedirection4->SetXTitle("R for HE+ jeta = 28; depth = 4 \b");
3031  HEpositivedirection4->Draw("Error");
3032  kcountHEpositivedirection4++;
3033  if (kcountHEpositivedirection4 > 15)
3034  break; // 4x6 = 24
3035  } //ccctest>0
3036 
3037  } // for i
3038  } //if(jeta-41 > 0)
3039  } //for jeta
3041  c3x5->Update();
3042  c3x5->Print("Rhist1IterationMethodDepth4HE.png");
3043  c3x5->Clear();
3044  // clean-up
3045  if (h2CeffHEpositivedirection4)
3046  delete h2CeffHEpositivedirection4;
3047  //========================================================================================== 8
3048  //======================================================================
3049  //======================================================================1D plot: R vs phi , different eta, depth=5
3050  cout << " 1D plot: R vs phi , different eta, depth=5 *****" << endl;
3051  c3x5->Clear();
3053  c3x5->Divide(3, 5);
3054  c3x5->cd(1);
3055  int kcountHEpositivedirection5 = 1;
3056  TH1F *h2CeffHEpositivedirection5 = new TH1F("h2CeffHEpositivedirection5", "", nphi, 0., 72.);
3057 
3058  for (int jeta = 0; jeta < njeta; jeta++) {
3059  // positivedirection:
3060  if (jeta - 41 > 0) {
3061  // for (int i=0;i<ndepth;i++) {
3062  // depth=5
3063  for (int i = 4; i < 5; i++) {
3064  TH1F *HEpositivedirection5 = (TH1F *)h2CeffHEpositivedirection5->Clone("twod1");
3065 
3066  float ccctest = 0; // to avoid empty massive elements
3067  for (int jphi = 0; jphi < nphi; jphi++) {
3068  // cout<<"888 initial kcountHEpositivedirection5 = "<<kcountHEpositivedirection5 <<" jeta-41= "<< jeta-41 <<" jphi= "<< jphi <<" alexhe[i][jeta][jphi]= "<< alexhe[i][jeta][jphi] <<" depth= "<< i <<endl;
3069 
3070  double ccc1 = alexhe[i][jeta][jphi];
3071  if (ccc1 != 0.) {
3072  HEpositivedirection5->Fill(jphi, ccc1);
3073  ccctest = 1.; //HEpositivedirection5->SetBinError(i,0.01);
3074  }
3075  } // for jphi
3076  if (ccctest > 0.) {
3077  cout << "888 kcountHEpositivedirection5 = " << kcountHEpositivedirection5
3078  << " jeta-41= " << jeta - 41 << endl;
3079  c3x5->cd(kcountHEpositivedirection5);
3080  HEpositivedirection5->SetMarkerStyle(20);
3081  HEpositivedirection5->SetMarkerSize(0.4);
3082  HEpositivedirection5->GetYaxis()->SetLabelSize(0.04);
3083  HEpositivedirection5->SetXTitle("HEpositivedirection5 \b");
3084  HEpositivedirection5->SetMarkerColor(2);
3085  HEpositivedirection5->SetLineColor(0);
3086  gPad->SetGridy();
3087  gPad->SetGridx();
3088  // gPad->SetLogy();
3089  if (kcountHEpositivedirection5 == 1)
3090  HEpositivedirection5->SetXTitle("R for HE+ jeta = 18; depth = 5 \b");
3091  if (kcountHEpositivedirection5 == 2)
3092  HEpositivedirection5->SetXTitle("R for HE+ jeta = 19; depth = 5 \b");
3093  if (kcountHEpositivedirection5 == 3)
3094  HEpositivedirection5->SetXTitle("R for HE+ jeta = 20; depth = 5 \b");
3095  if (kcountHEpositivedirection5 == 4)
3096  HEpositivedirection5->SetXTitle("R for HE+ jeta = 21; depth = 5 \b");
3097  if (kcountHEpositivedirection5 == 5)
3098  HEpositivedirection5->SetXTitle("R for HE+ jeta = 22; depth = 5 \b");
3099  if (kcountHEpositivedirection5 == 6)
3100  HEpositivedirection5->SetXTitle("R for HE+ jeta = 23; depth = 5 \b");
3101  if (kcountHEpositivedirection5 == 7)
3102  HEpositivedirection5->SetXTitle("R for HE+ jeta = 24; depth = 5 \b");
3103  if (kcountHEpositivedirection5 == 8)
3104  HEpositivedirection5->SetXTitle("R for HE+ jeta = 25; depth = 5 \b");
3105  if (kcountHEpositivedirection5 == 9)
3106  HEpositivedirection5->SetXTitle("R for HE+ jeta = 26; depth = 5 \b");
3107  if (kcountHEpositivedirection5 == 10)
3108  HEpositivedirection5->SetXTitle("R for HE+ jeta = 27; depth = 5 \b");
3109  if (kcountHEpositivedirection5 == 11)
3110  HEpositivedirection5->SetXTitle("R for HE+ jeta = 28; depth = 5 \b");
3111  HEpositivedirection5->Draw("Error");
3112  kcountHEpositivedirection5++;
3113  if (kcountHEpositivedirection5 > 15)
3114  break; // 4x6 = 24
3115  } //ccctest>0
3116 
3117  } // for i
3118  } //if(jeta-41 > 0)
3119  } //for jeta
3121  c3x5->Update();
3122  c3x5->Print("Rhist1IterationMethodDepth5HE.png");
3123  c3x5->Clear();
3124  // clean-up
3125  if (h2CeffHEpositivedirection5)
3126  delete h2CeffHEpositivedirection5;
3127  //========================================================================================== 9
3128  //======================================================================
3129  //======================================================================1D plot: R vs phi , different eta, depth=6
3130  cout << " 1D plot: R vs phi , different eta, depth=6 *****" << endl;
3131  c3x5->Clear();
3133  c3x5->Divide(3, 5);
3134  c3x5->cd(1);
3135  int kcountHEpositivedirection6 = 1;
3136  TH1F *h2CeffHEpositivedirection6 = new TH1F("h2CeffHEpositivedirection6", "", nphi, 0., 72.);
3137 
3138  for (int jeta = 0; jeta < njeta; jeta++) {
3139  // positivedirection:
3140  if (jeta - 41 > 0) {
3141  // for (int i=0;i<ndepth;i++) {
3142  // depth=6
3143  for (int i = 5; i < 6; i++) {
3144  TH1F *HEpositivedirection6 = (TH1F *)h2CeffHEpositivedirection6->Clone("twod1");
3145 
3146  float ccctest = 0; // to avoid empty massive elements
3147  for (int jphi = 0; jphi < nphi; jphi++) {
3148  double ccc1 = alexhe[i][jeta][jphi];
3149  if (ccc1 != 0.) {
3150  HEpositivedirection6->Fill(jphi, ccc1);
3151  ccctest = 1.; //HEpositivedirection6->SetBinError(i,0.01);
3152  }
3153  } // for jphi
3154  if (ccctest > 0.) {
3155  cout << "999 kcountHEpositivedirection6 = " << kcountHEpositivedirection6
3156  << " jeta-41= " << jeta - 41 << endl;
3157  c3x5->cd(kcountHEpositivedirection6);
3158  HEpositivedirection6->SetMarkerStyle(20);
3159  HEpositivedirection6->SetMarkerSize(0.4);
3160  HEpositivedirection6->GetYaxis()->SetLabelSize(0.04);
3161  HEpositivedirection6->SetXTitle("HEpositivedirection6 \b");
3162  HEpositivedirection6->SetMarkerColor(2);
3163  HEpositivedirection6->SetLineColor(0);
3164  gPad->SetGridy();
3165  gPad->SetGridx();
3166  // gPad->SetLogy();
3167  if (kcountHEpositivedirection6 == 1)
3168  HEpositivedirection6->SetXTitle("R for HE+ jeta = 19; depth = 6 \b");
3169  if (kcountHEpositivedirection6 == 2)
3170  HEpositivedirection6->SetXTitle("R for HE+ jeta = 20; depth = 6 \b");
3171  if (kcountHEpositivedirection6 == 3)
3172  HEpositivedirection6->SetXTitle("R for HE+ jeta = 21; depth = 6 \b");
3173  if (kcountHEpositivedirection6 == 4)
3174  HEpositivedirection6->SetXTitle("R for HE+ jeta = 22; depth = 6 \b");
3175  if (kcountHEpositivedirection6 == 5)
3176  HEpositivedirection6->SetXTitle("R for HE+ jeta = 23; depth = 6 \b");
3177  if (kcountHEpositivedirection6 == 6)
3178  HEpositivedirection6->SetXTitle("R for HE+ jeta = 24; depth = 6 \b");
3179  if (kcountHEpositivedirection6 == 7)
3180  HEpositivedirection6->SetXTitle("R for HE+ jeta = 25; depth = 6 \b");
3181  if (kcountHEpositivedirection6 == 8)
3182  HEpositivedirection6->SetXTitle("R for HE+ jeta = 26; depth = 6 \b");
3183  if (kcountHEpositivedirection6 == 9)
3184  HEpositivedirection6->SetXTitle("R for HE+ jeta = 27; depth = 6 \b");
3185  if (kcountHEpositivedirection6 == 10)
3186  HEpositivedirection6->SetXTitle("R for HE+ jeta = 28; depth = 6 \b");
3187  HEpositivedirection6->Draw("Error");
3188  kcountHEpositivedirection6++;
3189  if (kcountHEpositivedirection6 > 15)
3190  break; // 4x6 = 24
3191  } //ccctest>0
3192 
3193  } // for i
3194  } //if(jeta-41 > 0)
3195  } //for jeta
3197  c3x5->Update();
3198  c3x5->Print("Rhist1IterationMethodDepth6HE.png");
3199  c3x5->Clear();
3200  // clean-up
3201  if (h2CeffHEpositivedirection6)
3202  delete h2CeffHEpositivedirection6;
3203  //========================================================================================== 10
3204  //======================================================================
3205  //======================================================================1D plot: R vs phi , different eta, depth=7
3206  cout << " 1D plot: R vs phi , different eta, depth=7 *****" << endl;
3207  c3x5->Clear();
3209  c3x5->Divide(3, 5);
3210  c3x5->cd(1);
3211  int kcountHEpositivedirection7 = 1;
3212  TH1F *h2CeffHEpositivedirection7 = new TH1F("h2CeffHEpositivedirection7", "", nphi, 0., 72.);
3213 
3214  for (int jeta = 0; jeta < njeta; jeta++) {
3215  // positivedirection:
3216  if (jeta - 41 > 0) {
3217  // for (int i=0;i<ndepth;i++) {
3218  // depth=7
3219  for (int i = 6; i < 7; i++) {
3220  TH1F *HEpositivedirection7 = (TH1F *)h2CeffHEpositivedirection7->Clone("twod1");
3221 
3222  float ccctest = 0; // to avoid empty massive elements
3223  for (int jphi = 0; jphi < nphi; jphi++) {
3224  double ccc1 = alexhe[i][jeta][jphi];
3225  if (ccc1 != 0.) {
3226  HEpositivedirection7->Fill(jphi, ccc1);
3227  ccctest = 1.; //HEpositivedirection7->SetBinError(i,0.01);
3228  }
3229  } // for jphi
3230  if (ccctest > 0.) {
3231  cout << "1010 kcountHEpositivedirection7 = " << kcountHEpositivedirection7
3232  << " jeta-41= " << jeta - 41 << endl;
3233  c3x5->cd(kcountHEpositivedirection7);
3234  HEpositivedirection7->SetMarkerStyle(20);
3235  HEpositivedirection7->SetMarkerSize(0.4);
3236  HEpositivedirection7->GetYaxis()->SetLabelSize(0.04);
3237  HEpositivedirection7->SetXTitle("HEpositivedirection7 \b");
3238  HEpositivedirection7->SetMarkerColor(2);
3239  HEpositivedirection7->SetLineColor(0);
3240  gPad->SetGridy();
3241  gPad->SetGridx();
3242  // gPad->SetLogy();
3243  if (kcountHEpositivedirection7 == 1)
3244  HEpositivedirection7->SetXTitle("R for HE+ jeta = 26; depth = 7 \b");
3245  if (kcountHEpositivedirection7 == 2)
3246  HEpositivedirection7->SetXTitle("R for HE+ jeta = 27; depth = 7 \b");
3247  if (kcountHEpositivedirection7 == 3)
3248  HEpositivedirection7->SetXTitle("R for HE+ jeta = 28; depth = 7 \b");
3249  HEpositivedirection7->Draw("Error");
3250  kcountHEpositivedirection7++;
3251  if (kcountHEpositivedirection7 > 15)
3252  break; // 4x6 = 24
3253  } //ccctest>0
3254 
3255  } // for i
3256  } //if(jeta-41 > 0)
3257  } //for jeta
3259  c3x5->Update();
3260  c3x5->Print("Rhist1IterationMethodDepth7HE.png");
3261  c3x5->Clear();
3262  // clean-up
3263  if (h2CeffHEpositivedirection7)
3264  delete h2CeffHEpositivedirection7;
3265 
3266  // DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD:
3267 
3268  cout << " Start Vaiance: preparation *****" << endl;
3269  TH2F *mapdphinorm1HE1 = (TH2F *)hfile->Get("h_maprphinorm2_HE1");
3270  TH2F *mapdphinorm0HE1 = (TH2F *)hfile->Get("h_maprphinorm0_HE1");
3271  TH2F *mapdphinormHE1 = (TH2F *)mapdphinorm1HE1->Clone("mapdphinormHE1");
3272  mapdphinormHE1->Divide(mapdphinorm1HE1, mapdphinorm0HE1, 1, 1, "B");
3273  TH2F *mapdphinorm1HE2 = (TH2F *)hfile->Get("h_maprphinorm2_HE2");
3274  TH2F *mapdphinorm0HE2 = (TH2F *)hfile->Get("h_maprphinorm0_HE2");
3275  TH2F *mapdphinormHE2 = (TH2F *)mapdphinorm1HE2->Clone("mapdphinormHE2");
3276  mapdphinormHE2->Divide(mapdphinorm1HE2, mapdphinorm0HE2, 1, 1, "B");
3277  TH2F *mapdphinorm1HE3 = (TH2F *)hfile->Get("h_maprphinorm2_HE3");
3278  TH2F *mapdphinorm0HE3 = (TH2F *)hfile->Get("h_maprphinorm0_HE3");
3279  TH2F *mapdphinormHE3 = (TH2F *)mapdphinorm1HE3->Clone("mapdphinormHE3");
3280  mapdphinormHE3->Divide(mapdphinorm1HE3, mapdphinorm0HE3, 1, 1, "B");
3281  TH2F *mapdphinorm1HE4 = (TH2F *)hfile->Get("h_maprphinorm2_HE4");
3282  TH2F *mapdphinorm0HE4 = (TH2F *)hfile->Get("h_maprphinorm0_HE4");
3283  TH2F *mapdphinormHE4 = (TH2F *)mapdphinorm1HE4->Clone("mapdphinormHE4");
3284  mapdphinormHE4->Divide(mapdphinorm1HE4, mapdphinorm0HE4, 1, 1, "B");
3285  TH2F *mapdphinorm1HE5 = (TH2F *)hfile->Get("h_maprphinorm2_HE5");
3286  TH2F *mapdphinorm0HE5 = (TH2F *)hfile->Get("h_maprphinorm0_HE5");
3287  TH2F *mapdphinormHE5 = (TH2F *)mapdphinorm1HE5->Clone("mapdphinormHE5");
3288  mapdphinormHE5->Divide(mapdphinorm1HE5, mapdphinorm0HE5, 1, 1, "B");
3289  TH2F *mapdphinorm1HE6 = (TH2F *)hfile->Get("h_maprphinorm2_HE6");
3290  TH2F *mapdphinorm0HE6 = (TH2F *)hfile->Get("h_maprphinorm0_HE6");
3291  TH2F *mapdphinormHE6 = (TH2F *)mapdphinorm1HE6->Clone("mapdphinormHE6");
3292  mapdphinormHE6->Divide(mapdphinorm1HE6, mapdphinorm0HE6, 1, 1, "B");
3293  TH2F *mapdphinorm1HE7 = (TH2F *)hfile->Get("h_maprphinorm2_HE7");
3294  TH2F *mapdphinorm0HE7 = (TH2F *)hfile->Get("h_maprphinorm0_HE7");
3295  TH2F *mapdphinormHE7 = (TH2F *)mapdphinorm1HE7->Clone("mapdphinormHE7");
3296  mapdphinormHE7->Divide(mapdphinorm1HE7, mapdphinorm0HE7, 1, 1, "B");
3297  cout << " Vaiance: preparation DONE *****" << endl;
3298  //====================================================================== put Vaiance=Dispersia = Sig**2=<R**2> - (<R>)**2
3299  // = sum(R*R)/N - (sum(R)/N)**2
3300  // = mapdphinormHE1,2,3..7 - alexhe*alexhe
3301  for (int jeta = 0; jeta < njeta; jeta++) {
3302  for (int jphi = 0; jphi < njphi; jphi++) {
3303  variance[0][jeta][jphi] =
3304  fabs(mapdphinormHE1->GetBinContent(jeta + 1, jphi + 1) - alexhe[0][jeta][jphi] * alexhe[0][jeta][jphi]);
3305  if (variance[0][jeta][jphi] < 0.00003)
3306  variance[0][jeta][jphi] = 0.000067;
3307  variance[1][jeta][jphi] =
3308  fabs(mapdphinormHE2->GetBinContent(jeta + 1, jphi + 1) - alexhe[1][jeta][jphi] * alexhe[1][jeta][jphi]);
3309  if (variance[1][jeta][jphi] < 0.00003)
3310  variance[1][jeta][jphi] = 0.000067;
3311  variance[2][jeta][jphi] =
3312  fabs(mapdphinormHE3->GetBinContent(jeta + 1, jphi + 1) - alexhe[2][jeta][jphi] * alexhe[2][jeta][jphi]);
3313  if (variance[2][jeta][jphi] < 0.00003)
3314  variance[2][jeta][jphi] = 0.000067;
3315  variance[3][jeta][jphi] =
3316  fabs(mapdphinormHE4->GetBinContent(jeta + 1, jphi + 1) - alexhe[3][jeta][jphi] * alexhe[3][jeta][jphi]);
3317  if (variance[3][jeta][jphi] < 0.00003)
3318  variance[3][jeta][jphi] = 0.000067;
3319  variance[4][jeta][jphi] =
3320  fabs(mapdphinormHE5->GetBinContent(jeta + 1, jphi + 1) - alexhe[4][jeta][jphi] * alexhe[4][jeta][jphi]);
3321  if (variance[4][jeta][jphi] < 0.00003)
3322  variance[4][jeta][jphi] = 0.000067;
3323  variance[5][jeta][jphi] =
3324  fabs(mapdphinormHE6->GetBinContent(jeta + 1, jphi + 1) - alexhe[5][jeta][jphi] * alexhe[5][jeta][jphi]);
3325  if (variance[5][jeta][jphi] < 0.00003)
3326  variance[5][jeta][jphi] = 0.000067;
3327  variance[6][jeta][jphi] =
3328  fabs(mapdphinormHE7->GetBinContent(jeta + 1, jphi + 1) - alexhe[6][jeta][jphi] * alexhe[6][jeta][jphi]);
3329  if (variance[6][jeta][jphi] < 0.00003)
3330  variance[6][jeta][jphi] = 0.000067;
3331  }
3332  }
3333  cout << " Vaiance: DONE*****" << endl;
3334 
3335  //------------------------ 2D-eta/phi-plot: D, averaged over depthes
3336  //======================================================================
3337  //======================================================================
3338  cout << " R2D-eta/phi-plot: D, averaged over depthes *****" << endl;
3339  c1x1->Clear();
3341  c1x0->Divide(1, 1);
3342  c1x0->cd(1);
3343  TH2F *Defz42D = new TH2F("Defz42D", "", neta, -41., 41., nphi, 0., 72.);
3344  TH2F *Defz42D0 = new TH2F("Defz42D0", "", neta, -41., 41., nphi, 0., 72.);
3345  TH2F *Defz42DF = (TH2F *)Defz42D0->Clone("Defz42DF");
3346  for (int i = 0; i < ndepth; i++) {
3347  for (int jeta = 0; jeta < neta; jeta++) {
3348  for (int jphi = 0; jphi < nphi; jphi++) {
3349  double ccc1 = variance[i][jeta][jphi];
3350  int k2plot = jeta - 41;
3351  int kkk = k2plot; //if(k2plot >0 kkk=k2plot+1; //-41 +41 !=0
3352  if (alexhe[i][jeta][jphi] > 0.) {
3353  Defz42D->Fill(kkk, jphi, ccc1);
3354  Defz42D0->Fill(kkk, jphi, 1.);
3355  }
3356  }
3357  }
3358  }
3359  Defz42DF->Divide(Defz42D, Defz42D0, 1, 1, "B"); // average A
3360  // Defz1->Sumw2();
3361  gPad->SetGridy();
3362  gPad->SetGridx(); // gPad->SetLogz();
3363  Defz42DF->SetMarkerStyle(20);
3364  Defz42DF->SetMarkerSize(0.4);
3365  Defz42DF->GetZaxis()->SetLabelSize(0.08);
3366  Defz42DF->SetXTitle("<D>_depth #eta \b");
3367  Defz42DF->SetYTitle(" #phi \b");
3368  Defz42DF->SetZTitle("<D>_depth \b");
3369  Defz42DF->SetMarkerColor(2);
3370  Defz42DF->SetLineColor(0); // Defz42DF->SetMaximum(1.000); // Defz42DF->SetMinimum(1.0);
3371  Defz42DF->Draw("COLZ");
3373  c1x0->Update();
3374  c1x0->Print("Dhist2IterationMethodHE.png");
3375  c1x0->Clear();
3376  // clean-up
3377  if (Defz42D)
3378  delete Defz42D;
3379  if (Defz42D0)
3380  delete Defz42D0;
3381  if (Defz42DF)
3382  delete Defz42DF;
3383 
3384  //====================================================================== 1D plot: D vs phi , averaged over depthes & eta
3385  //======================================================================
3386  cout << " 1D plot: D vs phi , averaged over depthes & eta *****" << endl;
3387  c1x1->Clear();
3389  c1x1->Divide(1, 1);
3390  c1x1->cd(1);
3391  TH1F *Defz41D = new TH1F("Defz41D", "", nphi, 0., 72.);
3392  TH1F *Defz41D0 = new TH1F("Defz41D0", "", nphi, 0., 72.);
3393  TH1F *Defz41DF = (TH1F *)Defz41D0->Clone("Defz41DF");
3394 
3395  for (int jphi = 0; jphi < nphi; jphi++) {
3396  for (int jeta = 0; jeta < neta; jeta++) {
3397  for (int i = 0; i < ndepth; i++) {
3398  double ccc1 = variance[i][jeta][jphi];
3399  if (alexhe[i][jeta][jphi] > 0.) {
3400  Defz41D->Fill(jphi, ccc1);
3401  Defz41D0->Fill(jphi, 1.);
3402  }
3403  }
3404  }
3405  }
3406  // Defz41D->Sumw2();Defz41D0->Sumw2();
3407 
3408  Defz41DF->Divide(Defz41D, Defz41D0, 1, 1, "B"); // R averaged over depthes & eta
3409  Defz41D0->Sumw2();
3410  // for (int jphi=1;jphi<73;jphi++) {Defz41DF->SetBinError(jphi,0.01);}
3411  gPad->SetGridy();
3412  gPad->SetGridx(); // gPad->SetLogz();
3413  Defz41DF->SetMarkerStyle(20);
3414  Defz41DF->SetMarkerSize(1.4);
3415  Defz41DF->GetZaxis()->SetLabelSize(0.08);
3416  Defz41DF->SetXTitle("#phi \b");
3417  Defz41DF->SetYTitle(" <D> \b");
3418  Defz41DF->SetZTitle("<D>_PHI - AllDepthes \b");
3419  Defz41DF->SetMarkerColor(4);
3420  Defz41DF->SetLineColor(4);
3421  Defz41DF->SetMinimum(0.8);
3422  Defz41DF->SetMinimum(-0.015);
3423  Defz41DF->Draw("Error");
3425  c1x1->Update();
3426  c1x1->Print("Dhist1IterationMethodHE.png");
3427  c1x1->Clear();
3428  // clean-up
3429  if (Defz41D)
3430  delete Defz41D;
3431  if (Defz41D0)
3432  delete Defz41D0;
3433  if (Defz41DF)
3434  delete Defz41DF;
3435 
3436  //========================================================================================== 14
3437  //======================================================================
3438  //======================================================================1D plot: D vs phi , different eta, depth=1
3439  cout << " 1D plot: D vs phi , different eta, depth=1 *****" << endl;
3440  c3x5->Clear();
3442  c3x5->Divide(3, 5);
3443  c3x5->cd(1);
3444 
3445  int kcountHEpositivedirectionD1 = 1;
3446  TH1F *h2CeffHEpositivedirectionD1 = new TH1F("h2CeffHEpositivedirectionD1", "", nphi, 0., 72.);
3447 
3448  for (int jeta = 0; jeta < njeta; jeta++) {
3449  // positivedirectionD:
3450  if (jeta - 41 > 0) {
3451  // for (int i=0;i<ndepth;i++) {
3452  // depth=1
3453  for (int i = 0; i < 1; i++) {
3454  TH1F *HEpositivedirectionD1 = (TH1F *)h2CeffHEpositivedirectionD1->Clone("twod1");
3455 
3456  float ccctest = 0; // to avoid empty massive elements
3457  for (int jphi = 0; jphi < nphi; jphi++) {
3458  double ccc1 = variance[i][jeta][jphi];
3459  if (alexhe[i][jeta][jphi] > 0.) {
3460  HEpositivedirectionD1->Fill(jphi, ccc1);
3461  ccctest = 1.; //HEpositivedirectionD1->SetBinError(i,0.01);
3462  }
3463  } // for jphi
3464  if (ccctest > 0.) {
3465  cout << "1414 kcountHEpositivedirectionD1 = " << kcountHEpositivedirectionD1
3466  << " jeta-41= " << jeta - 41 << endl;
3467  c3x5->cd(kcountHEpositivedirectionD1);
3468  HEpositivedirectionD1->SetMarkerStyle(20);
3469  HEpositivedirectionD1->SetMarkerSize(0.4);
3470  HEpositivedirectionD1->GetYaxis()->SetLabelSize(0.04);
3471  HEpositivedirectionD1->SetXTitle("HEpositivedirectionD1 \b");
3472  HEpositivedirectionD1->SetMarkerColor(2);
3473  HEpositivedirectionD1->SetLineColor(0);
3474  gPad->SetGridy();
3475  gPad->SetGridx();
3476  // gPad->SetLogy();
3477  if (kcountHEpositivedirectionD1 == 1)
3478  HEpositivedirectionD1->SetXTitle("D for HE+ jeta = 18; depth = 1 \b");
3479  if (kcountHEpositivedirectionD1 == 2)
3480  HEpositivedirectionD1->SetXTitle("D for HE+ jeta = 19; depth = 1 \b");
3481  if (kcountHEpositivedirectionD1 == 3)
3482  HEpositivedirectionD1->SetXTitle("D for HE+ jeta = 20; depth = 1 \b");
3483  if (kcountHEpositivedirectionD1 == 4)
3484  HEpositivedirectionD1->SetXTitle("D for HE+ jeta = 21; depth = 1 \b");
3485  if (kcountHEpositivedirectionD1 == 5)
3486  HEpositivedirectionD1->SetXTitle("D for HE+ jeta = 22; depth = 1 \b");
3487  if (kcountHEpositivedirectionD1 == 6)
3488  HEpositivedirectionD1->SetXTitle("D for HE+ jeta = 23; depth = 1 \b");
3489  if (kcountHEpositivedirectionD1 == 7)
3490  HEpositivedirectionD1->SetXTitle("D for HE+ jeta = 24; depth = 1 \b");
3491  if (kcountHEpositivedirectionD1 == 8)
3492  HEpositivedirectionD1->SetXTitle("D for HE+ jeta = 25; depth = 1 \b");
3493  if (kcountHEpositivedirectionD1 == 9)
3494  HEpositivedirectionD1->SetXTitle("D for HE+ jeta = 26; depth = 1 \b");
3495  if (kcountHEpositivedirectionD1 == 10)
3496  HEpositivedirectionD1->SetXTitle("D for HE+ jeta = 27; depth = 1 \b");
3497  if (kcountHEpositivedirectionD1 == 11)
3498  HEpositivedirectionD1->SetXTitle("D for HE+ jeta = 28; depth = 1 \b");
3499  if (kcountHEpositivedirectionD1 == 12)
3500  HEpositivedirectionD1->SetXTitle("D for HE+ jeta = 29; depth = 1 \b");
3501  HEpositivedirectionD1->Draw("Error");
3502  kcountHEpositivedirectionD1++;
3503  if (kcountHEpositivedirectionD1 > 15)
3504  break; // 4x6 = 24
3505  } //ccctest>0
3506 
3507  } // for i
3508  } //if(jeta-41 > 0)
3509  } //for jeta
3511  c3x5->Update();
3512  c3x5->Print("Dhist1IterationMethodDepth1HE.png");
3513  c3x5->Clear();
3514  // clean-up
3515  if (h2CeffHEpositivedirectionD1)
3516  delete h2CeffHEpositivedirectionD1;
3517 
3518  //========================================================================================== 15
3519  //======================================================================
3520  //======================================================================1D plot: D vs phi , different eta, depth=2
3521  cout << " 1D plot: D vs phi , different eta, depth=2 *****" << endl;
3522  c3x5->Clear();
3523  c3x5->Divide(3, 5);
3524  c3x5->cd(1);
3525  int kcountHEpositivedirectionD2 = 1;
3526  TH1F *h2CeffHEpositivedirectionD2 = new TH1F("h2CeffHEpositivedirectionD2", "", nphi, 0., 72.);
3527 
3528  for (int jeta = 0; jeta < njeta; jeta++) {
3529  // positivedirectionD:
3530  if (jeta - 41 > 0) {
3531  // for (int i=0;i<ndepth;i++) {
3532  // depth=2
3533  for (int i = 1; i < 2; i++) {
3534  TH1F *HEpositivedirectionD2 = (TH1F *)h2CeffHEpositivedirectionD2->Clone("twod1");
3535 
3536  float ccctest = 0; // to avoid empty massive elements
3537  for (int jphi = 0; jphi < nphi; jphi++) {
3538  double ccc1 = variance[i][jeta][jphi];
3539  if (alexhe[i][jeta][jphi] > 0.) {
3540  HEpositivedirectionD2->Fill(jphi, ccc1);
3541  ccctest = 1.; //HEpositivedirectionD2->SetBinError(i,0.01);
3542  }
3543  } // for jphi
3544  if (ccctest > 0.) {
3545  cout << "1515 kcountHEpositivedirectionD2 = " << kcountHEpositivedirectionD2
3546  << " jeta-41= " << jeta - 41 << endl;
3547  c3x5->cd(kcountHEpositivedirectionD2);
3548  HEpositivedirectionD2->SetMarkerStyle(20);
3549  HEpositivedirectionD2->SetMarkerSize(0.4);
3550  HEpositivedirectionD2->GetYaxis()->SetLabelSize(0.04);
3551  HEpositivedirectionD2->SetXTitle("HEpositivedirectionD2 \b");
3552  HEpositivedirectionD2->SetMarkerColor(2);
3553  HEpositivedirectionD2->SetLineColor(0);
3554  gPad->SetGridy();
3555  gPad->SetGridx();
3556  // gPad->SetLogy();
3557  if (kcountHEpositivedirectionD2 == 1)
3558  HEpositivedirectionD2->SetXTitle("D for HE+ jeta = 17; depth = 2 \b");
3559  if (kcountHEpositivedirectionD2 == 2)
3560  HEpositivedirectionD2->SetXTitle("D for HE+ jeta = 18; depth = 2 \b");
3561  if (kcountHEpositivedirectionD2 == 3)
3562  HEpositivedirectionD2->SetXTitle("D for HE+ jeta = 19; depth = 2 \b");
3563  if (kcountHEpositivedirectionD2 == 4)
3564  HEpositivedirectionD2->SetXTitle("D for HE+ jeta = 20; depth = 2 \b");
3565  if (kcountHEpositivedirectionD2 == 5)
3566  HEpositivedirectionD2->SetXTitle("D for HE+ jeta = 21; depth = 2 \b");
3567  if (kcountHEpositivedirectionD2 == 6)
3568  HEpositivedirectionD2->SetXTitle("D for HE+ jeta = 22; depth = 2 \b");
3569  if (kcountHEpositivedirectionD2 == 7)
3570  HEpositivedirectionD2->SetXTitle("D for HE+ jeta = 23; depth = 2 \b");
3571  if (kcountHEpositivedirectionD2 == 8)
3572  HEpositivedirectionD2->SetXTitle("D for HE+ jeta = 24; depth = 2 \b");
3573  if (kcountHEpositivedirectionD2 == 9)
3574  HEpositivedirectionD2->SetXTitle("D for HE+ jeta = 25; depth = 2 \b");
3575  if (kcountHEpositivedirectionD2 == 10)
3576  HEpositivedirectionD2->SetXTitle("D for HE+ jeta = 26; depth = 2 \b");
3577  if (kcountHEpositivedirectionD2 == 11)
3578  HEpositivedirectionD2->SetXTitle("D for HE+ jeta = 27; depth = 2 \b");
3579  if (kcountHEpositivedirectionD2 == 12)
3580  HEpositivedirectionD2->SetXTitle("D for HE+ jeta = 28; depth = 2 \b");
3581  if (kcountHEpositivedirectionD2 == 13)
3582  HEpositivedirectionD2->SetXTitle("D for HE+ jeta = 29; depth = 2 \b");
3583  HEpositivedirectionD2->Draw("Error");
3584  kcountHEpositivedirectionD2++;
3585  if (kcountHEpositivedirectionD2 > 15)
3586  break; // 4x6 = 24
3587  } //ccctest>0
3588 
3589  } // for i
3590  } //if(jeta-41 > 0)
3591  } //for jeta
3593  c3x5->Update();
3594  c3x5->Print("Dhist1IterationMethodDepth2HE.png");
3595  c3x5->Clear();
3596  // clean-up
3597  if (h2CeffHEpositivedirectionD2)
3598  delete h2CeffHEpositivedirectionD2;
3599 
3600  //========================================================================================== 16
3601  //======================================================================
3602  //======================================================================1D plot: D vs phi , different eta, depth=3
3603  cout << " 1D plot: D vs phi , different eta, depth=3 *****" << endl;
3604  c3x5->Clear();
3605  c3x5->Divide(3, 5);
3606  c3x5->cd(1);
3607  int kcountHEpositivedirectionD3 = 1;
3608  TH1F *h2CeffHEpositivedirectionD3 = new TH1F("h2CeffHEpositivedirectionD3", "", nphi, 0., 72.);
3609 
3610  for (int jeta = 0; jeta < njeta; jeta++) {
3611  // positivedirectionD:
3612  if (jeta - 41 > 0) {
3613  // for (int i=0;i<ndepth;i++) {
3614  // depth=3
3615  for (int i = 2; i < 3; i++) {
3616  TH1F *HEpositivedirectionD3 = (TH1F *)h2CeffHEpositivedirectionD3->Clone("twod1");
3617 
3618  float ccctest = 0; // to avoid empty massive elements
3619  for (int jphi = 0; jphi < nphi; jphi++) {
3620  double ccc1 = variance[i][jeta][jphi];
3621  if (alexhe[i][jeta][jphi] > 0.) {
3622  HEpositivedirectionD3->Fill(jphi, ccc1);
3623  ccctest = 1.; //HEpositivedirectionD3->SetBinError(i,0.01);
3624  }
3625  } // for jphi
3626  if (ccctest > 0.) {
3627  cout << "1616 kcountHEpositivedirectionD3 = " << kcountHEpositivedirectionD3
3628  << " jeta-41= " << jeta - 41 << endl;
3629  c3x5->cd(kcountHEpositivedirectionD3);
3630  HEpositivedirectionD3->SetMarkerStyle(20);
3631  HEpositivedirectionD3->SetMarkerSize(0.4);
3632  HEpositivedirectionD3->GetYaxis()->SetLabelSize(0.04);
3633  HEpositivedirectionD3->SetXTitle("HEpositivedirectionD3 \b");
3634  HEpositivedirectionD3->SetMarkerColor(2);
3635  HEpositivedirectionD3->SetLineColor(0);
3636  gPad->SetGridy();
3637  gPad->SetGridx();
3638  // gPad->SetLogy();
3639  if (kcountHEpositivedirectionD3 == 1)
3640  HEpositivedirectionD3->SetXTitle("D for HE+ jeta = 17; depth = 3 \b");
3641  if (kcountHEpositivedirectionD3 == 2)
3642  HEpositivedirectionD3->SetXTitle("D for HE+ jeta = 18; depth = 3 \b");
3643  if (kcountHEpositivedirectionD3 == 3)
3644  HEpositivedirectionD3->SetXTitle("D for HE+ jeta = 19; depth = 3 \b");
3645  if (kcountHEpositivedirectionD3 == 4)
3646  HEpositivedirectionD3->SetXTitle("D for HE+ jeta = 20; depth = 3 \b");
3647  if (kcountHEpositivedirectionD3 == 5)
3648  HEpositivedirectionD3->SetXTitle("D for HE+ jeta = 21; depth = 3 \b");
3649  if (kcountHEpositivedirectionD3 == 6)
3650  HEpositivedirectionD3->SetXTitle("D for HE+ jeta = 22; depth = 3 \b");
3651  if (kcountHEpositivedirectionD3 == 7)
3652  HEpositivedirectionD3->SetXTitle("D for HE+ jeta = 23; depth = 3 \b");
3653  if (kcountHEpositivedirectionD3 == 8)
3654  HEpositivedirectionD3->SetXTitle("D for HE+ jeta = 24; depth = 3 \b");
3655  if (kcountHEpositivedirectionD3 == 9)
3656  HEpositivedirectionD3->SetXTitle("D for HE+ jeta = 25; depth = 3 \b");
3657  if (kcountHEpositivedirectionD3 == 10)
3658  HEpositivedirectionD3->SetXTitle("D for HE+ jeta = 26; depth = 3 \b");
3659  if (kcountHEpositivedirectionD3 == 11)
3660  HEpositivedirectionD3->SetXTitle("D for HE+ jeta = 27; depth = 3 \b");
3661  if (kcountHEpositivedirectionD3 == 12)
3662  HEpositivedirectionD3->SetXTitle("D for HE+ jeta = 28; depth = 3 \b");
3663  if (kcountHEpositivedirectionD3 == 13)
3664  HEpositivedirectionD3->SetXTitle("D for HE+ jeta = 29; depth = 3 \b");
3665  HEpositivedirectionD3->Draw("Error");
3666  kcountHEpositivedirectionD3++;
3667  if (kcountHEpositivedirectionD3 > 15)
3668  break; // 4x6 = 24
3669  } //ccctest>0
3670 
3671  } // for i
3672  } //if(jeta-41 > 0)
3673  } //for jeta
3675  c3x5->Update();
3676  c3x5->Print("Dhist1IterationMethodDepth3HE.png");
3677  c3x5->Clear();
3678  // clean-up
3679  if (h2CeffHEpositivedirectionD3)
3680  delete h2CeffHEpositivedirectionD3;
3681 
3682  //========================================================================================== 17
3683  //======================================================================
3684  //======================================================================1D plot: D vs phi , different eta, depth=4
3685  cout << " 1D plot: D vs phi , different eta, depth=4 *****" << endl;
3686  c3x5->Clear();
3687  c3x5->Divide(3, 5);
3688  c3x5->cd(1);
3689  int kcountHEpositivedirectionD4 = 1;
3690  TH1F *h2CeffHEpositivedirectionD4 = new TH1F("h2CeffHEpositivedirectionD4", "", nphi, 0., 72.);
3691 
3692  for (int jeta = 0; jeta < njeta; jeta++) {
3693  // positivedirectionD:
3694  if (jeta - 41 > 0) {
3695  // for (int i=0;i<ndepth;i++) {
3696  // depth=4
3697  for (int i = 3; i < 4; i++) {
3698  TH1F *HEpositivedirectionD4 = (TH1F *)h2CeffHEpositivedirectionD4->Clone("twod1");
3699 
3700  float ccctest = 0; // to avoid empty massive elements
3701  for (int jphi = 0; jphi < nphi; jphi++) {
3702  double ccc1 = variance[i][jeta][jphi];
3703  if (alexhe[i][jeta][jphi] > 0.) {
3704  HEpositivedirectionD4->Fill(jphi, ccc1);
3705  ccctest = 1.; //HEpositivedirectionD4->SetBinError(i,0.01);
3706  }
3707  } // for jphi
3708  if (ccctest > 0.) {
3709  cout << "1717 kcountHEpositivedirectionD4 = " << kcountHEpositivedirectionD4
3710  << " jeta-41= " << jeta - 41 << endl;
3711  c3x5->cd(kcountHEpositivedirectionD4);
3712  HEpositivedirectionD4->SetMarkerStyle(20);
3713  HEpositivedirectionD4->SetMarkerSize(0.4);
3714  HEpositivedirectionD4->GetYaxis()->SetLabelSize(0.04);
3715  HEpositivedirectionD4->SetXTitle("HEpositivedirectionD4 \b");
3716  HEpositivedirectionD4->SetMarkerColor(2);
3717  HEpositivedirectionD4->SetLineColor(0);
3718  gPad->SetGridy();
3719  gPad->SetGridx();
3720  // gPad->SetLogy();
3721  if (kcountHEpositivedirectionD4 == 1)
3722  HEpositivedirectionD4->SetXTitle("D for HE+ jeta = 16; depth = 4 \b");
3723  if (kcountHEpositivedirectionD4 == 2)
3724  HEpositivedirectionD4->SetXTitle("D for HE+ jeta = 18; depth = 4 \b");
3725  if (kcountHEpositivedirectionD4 == 3)
3726  HEpositivedirectionD4->SetXTitle("D for HE+ jeta = 19; depth = 4 \b");
3727  if (kcountHEpositivedirectionD4 == 4)
3728  HEpositivedirectionD4->SetXTitle("D for HE+ jeta = 20; depth = 4 \b");
3729  if (kcountHEpositivedirectionD4 == 5)
3730  HEpositivedirectionD4->SetXTitle("D for HE+ jeta = 21; depth = 4 \b");
3731  if (kcountHEpositivedirectionD4 == 6)
3732  HEpositivedirectionD4->SetXTitle("D for HE+ jeta = 22; depth = 4 \b");
3733  if (kcountHEpositivedirectionD4 == 7)
3734  HEpositivedirectionD4->SetXTitle("D for HE+ jeta = 23; depth = 4 \b");
3735  if (kcountHEpositivedirectionD4 == 8)
3736  HEpositivedirectionD4->SetXTitle("D for HE+ jeta = 24; depth = 4 \b");
3737  if (kcountHEpositivedirectionD4 == 9)
3738  HEpositivedirectionD4->SetXTitle("D for HE+ jeta = 25; depth = 4 \b");
3739  if (kcountHEpositivedirectionD4 == 10)
3740  HEpositivedirectionD4->SetXTitle("D for HE+ jeta = 26; depth = 4 \b");
3741  if (kcountHEpositivedirectionD4 == 11)
3742  HEpositivedirectionD4->SetXTitle("D for HE+ jeta = 27; depth = 4 \b");
3743  if (kcountHEpositivedirectionD4 == 12)
3744  HEpositivedirectionD4->SetXTitle("D for HE+ jeta = 28; depth = 4 \b");
3745  HEpositivedirectionD4->Draw("Error");
3746  kcountHEpositivedirectionD4++;
3747  if (kcountHEpositivedirectionD4 > 15)
3748  break; // 4x6 = 24
3749  } //ccctest>0
3750 
3751  } // for i
3752  } //if(jeta-41 > 0)
3753  } //for jeta
3755  c3x5->Update();
3756  c3x5->Print("Dhist1IterationMethodDepth4HE.png");
3757  c3x5->Clear();
3758  // clean-up
3759  if (h2CeffHEpositivedirectionD4)
3760  delete h2CeffHEpositivedirectionD4;
3761 
3762  //========================================================================================== 18
3763  //======================================================================
3764  //======================================================================1D plot: D vs phi , different eta, depth=5
3765  cout << " 1D plot: D vs phi , different eta, depth=5 *****" << endl;
3766  c3x5->Clear();
3767  c3x5->Divide(3, 5);
3768  c3x5->cd(1);
3769  int kcountHEpositivedirectionD5 = 1;
3770  TH1F *h2CeffHEpositivedirectionD5 = new TH1F("h2CeffHEpositivedirectionD5", "", nphi, 0., 72.);
3771 
3772  for (int jeta = 0; jeta < njeta; jeta++) {
3773  // positivedirectionD:
3774  if (jeta - 41 > 0) {
3775  // for (int i=0;i<ndepth;i++) {
3776  // depth=5
3777  for (int i = 4; i < 5; i++) {
3778  TH1F *HEpositivedirectionD5 = (TH1F *)h2CeffHEpositivedirectionD5->Clone("twod1");
3779 
3780  float ccctest = 0; // to avoid empty massive elements
3781  for (int jphi = 0; jphi < nphi; jphi++) {
3782  double ccc1 = variance[i][jeta][jphi];
3783  if (alexhe[i][jeta][jphi] > 0.) {
3784  HEpositivedirectionD5->Fill(jphi, ccc1);
3785  ccctest = 1.; //HEpositivedirectionD5->SetBinError(i,0.01);
3786  }
3787  } // for jphi
3788  if (ccctest > 0.) {
3789  cout << "1818 kcountHEpositivedirectionD5 = " << kcountHEpositivedirectionD5
3790  << " jeta-41= " << jeta - 41 << endl;
3791  c3x5->cd(kcountHEpositivedirectionD5);
3792  HEpositivedirectionD5->SetMarkerStyle(20);
3793  HEpositivedirectionD5->SetMarkerSize(0.4);
3794  HEpositivedirectionD5->GetYaxis()->SetLabelSize(0.04);
3795  HEpositivedirectionD5->SetXTitle("HEpositivedirectionD5 \b");
3796  HEpositivedirectionD5->SetMarkerColor(2);
3797  HEpositivedirectionD5->SetLineColor(0);
3798  gPad->SetGridy();
3799  gPad->SetGridx();
3800  // gPad->SetLogy();
3801  if (kcountHEpositivedirectionD5 == 1)
3802  HEpositivedirectionD5->SetXTitle("D for HE+ jeta = 18; depth = 5 \b");
3803  if (kcountHEpositivedirectionD5 == 2)
3804  HEpositivedirectionD5->SetXTitle("D for HE+ jeta = 19; depth = 5 \b");
3805  if (kcountHEpositivedirectionD5 == 3)
3806  HEpositivedirectionD5->SetXTitle("D for HE+ jeta = 20; depth = 5 \b");
3807  if (kcountHEpositivedirectionD5 == 4)
3808  HEpositivedirectionD5->SetXTitle("D for HE+ jeta = 21; depth = 5 \b");
3809  if (kcountHEpositivedirectionD5 == 5)
3810  HEpositivedirectionD5->SetXTitle("D for HE+ jeta = 22; depth = 5 \b");
3811  if (kcountHEpositivedirectionD5 == 6)
3812  HEpositivedirectionD5->SetXTitle("D for HE+ jeta = 23; depth = 5 \b");
3813  if (kcountHEpositivedirectionD5 == 7)
3814  HEpositivedirectionD5->SetXTitle("D for HE+ jeta = 24; depth = 5 \b");
3815  if (kcountHEpositivedirectionD5 == 8)
3816  HEpositivedirectionD5->SetXTitle("D for HE+ jeta = 25; depth = 5 \b");
3817  if (kcountHEpositivedirectionD5 == 9)
3818  HEpositivedirectionD5->SetXTitle("D for HE+ jeta = 26; depth = 5 \b");
3819  if (kcountHEpositivedirectionD5 == 10)
3820  HEpositivedirectionD5->SetXTitle("D for HE+ jeta = 27; depth = 5 \b");
3821  if (kcountHEpositivedirectionD5 == 11)
3822  HEpositivedirectionD5->SetXTitle("D for HE+ jeta = 28; depth = 5 \b");
3823  HEpositivedirectionD5->Draw("Error");
3824  kcountHEpositivedirectionD5++;
3825  if (kcountHEpositivedirectionD5 > 15)
3826  break; // 4x6 = 24
3827  } //ccctest>0
3828 
3829  } // for i
3830  } //if(jeta-41 > 0)
3831  } //for jeta
3833  c3x5->Update();
3834  c3x5->Print("Dhist1IterationMethodDepth5HE.png");
3835  c3x5->Clear();
3836  // clean-up
3837  if (h2CeffHEpositivedirectionD5)
3838  delete h2CeffHEpositivedirectionD5;
3839 
3840  //========================================================================================== 19
3841  //======================================================================
3842  //======================================================================1D plot: D vs phi , different eta, depth=6
3843  cout << " 1D plot: D vs phi , different eta, depth=6 *****" << endl;
3844  c3x5->Clear();
3845  c3x5->Divide(3, 5);
3846  c3x5->cd(1);
3847  int kcountHEpositivedirectionD6 = 1;
3848  TH1F *h2CeffHEpositivedirectionD6 = new TH1F("h2CeffHEpositivedirectionD6", "", nphi, 0., 72.);
3849 
3850  for (int jeta = 0; jeta < njeta; jeta++) {
3851  // positivedirectionD:
3852  if (jeta - 41 > 0) {
3853  // for (int i=0;i<ndepth;i++) {
3854  // depth=6
3855  for (int i = 5; i < 6; i++) {
3856  TH1F *HEpositivedirectionD6 = (TH1F *)h2CeffHEpositivedirectionD6->Clone("twod1");
3857 
3858  float ccctest = 0; // to avoid empty massive elements
3859  for (int jphi = 0; jphi < nphi; jphi++) {
3860  double ccc1 = variance[i][jeta][jphi];
3861  if (alexhe[i][jeta][jphi] > 0.) {
3862  HEpositivedirectionD6->Fill(jphi, ccc1);
3863  ccctest = 1.; //HEpositivedirectionD6->SetBinError(i,0.01);
3864  }
3865  } // for jphi
3866  if (ccctest > 0.) {
3867  cout << "1919 kcountHEpositivedirectionD6 = " << kcountHEpositivedirectionD6
3868  << " jeta-41= " << jeta - 41 << endl;
3869  c3x5->cd(kcountHEpositivedirectionD6);
3870  HEpositivedirectionD6->SetMarkerStyle(20);
3871  HEpositivedirectionD6->SetMarkerSize(0.4);
3872  HEpositivedirectionD6->GetYaxis()->SetLabelSize(0.04);
3873  HEpositivedirectionD6->SetXTitle("HEpositivedirectionD6 \b");
3874  HEpositivedirectionD6->SetMarkerColor(2);
3875  HEpositivedirectionD6->SetLineColor(0);
3876  gPad->SetGridy();
3877  gPad->SetGridx();
3878  // gPad->SetLogy();
3879  if (kcountHEpositivedirectionD6 == 1)
3880  HEpositivedirectionD6->SetXTitle("D for HE+ jeta = 19; depth = 6 \b");
3881  if (kcountHEpositivedirectionD6 == 2)
3882  HEpositivedirectionD6->SetXTitle("D for HE+ jeta = 20; depth = 6 \b");
3883  if (kcountHEpositivedirectionD6 == 3)
3884  HEpositivedirectionD6->SetXTitle("D for HE+ jeta = 21; depth = 6 \b");
3885  if (kcountHEpositivedirectionD6 == 4)
3886  HEpositivedirectionD6->SetXTitle("D for HE+ jeta = 22; depth = 6 \b");
3887  if (kcountHEpositivedirectionD6 == 5)
3888  HEpositivedirectionD6->SetXTitle("D for HE+ jeta = 23; depth = 6 \b");
3889  if (kcountHEpositivedirectionD6 == 6)
3890  HEpositivedirectionD6->SetXTitle("D for HE+ jeta = 24; depth = 6 \b");
3891  if (kcountHEpositivedirectionD6 == 7)
3892  HEpositivedirectionD6->SetXTitle("D for HE+ jeta = 25; depth = 6 \b");
3893  if (kcountHEpositivedirectionD6 == 8)
3894  HEpositivedirectionD6->SetXTitle("D for HE+ jeta = 26; depth = 6 \b");
3895  if (kcountHEpositivedirectionD6 == 9)
3896  HEpositivedirectionD6->SetXTitle("D for HE+ jeta = 27; depth = 6 \b");
3897  if (kcountHEpositivedirectionD6 == 10)
3898  HEpositivedirectionD6->SetXTitle("D for HE+ jeta = 28; depth = 6 \b");
3899  HEpositivedirectionD6->Draw("Error");
3900  kcountHEpositivedirectionD6++;
3901  if (kcountHEpositivedirectionD6 > 15)
3902  break; // 4x6 = 24
3903  } //ccctest>0
3904 
3905  } // for i
3906  } //if(jeta-41 > 0)
3907  } //for jeta
3909  c3x5->Update();
3910  c3x5->Print("Dhist1IterationMethodDepth6HE.png");
3911  c3x5->Clear();
3912  // clean-up
3913  if (h2CeffHEpositivedirectionD6)
3914  delete h2CeffHEpositivedirectionD6;
3915 
3916  //========================================================================================== 20
3917  //======================================================================
3918  //======================================================================1D plot: D vs phi , different eta, depth=7
3919  cout << " 1D plot: D vs phi , different eta, depth=7 *****" << endl;
3920  c3x5->Clear();
3921  c3x5->Divide(3, 5);
3922  c3x5->cd(1);
3923  int kcountHEpositivedirectionD7 = 1;
3924  TH1F *h2CeffHEpositivedirectionD7 = new TH1F("h2CeffHEpositivedirectionD7", "", nphi, 0., 72.);
3925 
3926  for (int jeta = 0; jeta < njeta; jeta++) {
3927  // positivedirectionD:
3928  if (jeta - 41 > 0) {
3929  // for (int i=0;i<ndepth;i++) {
3930  // depth=7
3931  for (int i = 6; i < 7; i++) {
3932  TH1F *HEpositivedirectionD7 = (TH1F *)h2CeffHEpositivedirectionD7->Clone("twod1");
3933 
3934  float ccctest = 0; // to avoid empty massive elements
3935  for (int jphi = 0; jphi < nphi; jphi++) {
3936  double ccc1 = variance[i][jeta][jphi];
3937  if (alexhe[i][jeta][jphi] > 0.) {
3938  HEpositivedirectionD7->Fill(jphi, ccc1);
3939  ccctest = 1.; //HEpositivedirectionD7->SetBinError(i,0.01);
3940  }
3941  } // for jphi
3942  if (ccctest != 0.) {
3943  cout << "2020 kcountHEpositivedirectionD7 = " << kcountHEpositivedirectionD7
3944  << " jeta-41= " << jeta - 41 << endl;
3945  c3x5->cd(kcountHEpositivedirectionD7);
3946  HEpositivedirectionD7->SetMarkerStyle(20);
3947  HEpositivedirectionD7->SetMarkerSize(0.4);
3948  HEpositivedirectionD7->GetYaxis()->SetLabelSize(0.04);
3949  HEpositivedirectionD7->SetXTitle("HEpositivedirectionD7 \b");
3950  HEpositivedirectionD7->SetMarkerColor(2);
3951  HEpositivedirectionD7->SetLineColor(0);
3952  gPad->SetGridy();
3953  gPad->SetGridx();
3954  // gPad->SetLogy();
3955  if (kcountHEpositivedirectionD7 == 1)
3956  HEpositivedirectionD7->SetXTitle("D for HE+ jeta = 26; depth = 7 \b");
3957  if (kcountHEpositivedirectionD7 == 2)
3958  HEpositivedirectionD7->SetXTitle("D for HE+ jeta = 27; depth = 7 \b");
3959  if (kcountHEpositivedirectionD7 == 3)
3960  HEpositivedirectionD7->SetXTitle("D for HE+ jeta = 28; depth = 7 \b");
3961  HEpositivedirectionD7->Draw("Error");
3962  kcountHEpositivedirectionD7++;
3963  if (kcountHEpositivedirectionD7 > 15)
3964  break; // 4x6 = 24
3965  } //ccctest>0
3966 
3967  } // for i
3968  } //if(jeta-41 > 0)
3969  } //for jeta
3971  c3x5->Update();
3972  c3x5->Print("Dhist1IterationMethodDepth7HE.png");
3973  c3x5->Clear();
3974  // clean-up
3975  if (h2CeffHEpositivedirectionD7)
3976  delete h2CeffHEpositivedirectionD7;
3977 
3978  //=====================================================================
3979  //======================================================================
3980  //======================================================================
3981  //======================================================================
3982  //======================================================================
3983  //======================================================================
3984 
3985  std::cout << " We are here to print 2017 MAPs " << std::endl;
3986  //======================================================================
3987 
3988  //======================================================================
3990 
3991  TH2F *Map_ALL = new TH2F("Map_All", "Map_all", 82, -41, 40, 72, 0, 71);
3992  int nx = Map_ALL->GetXaxis()->GetNbins();
3993  int ny = Map_ALL->GetYaxis()->GetNbins();
3994  int NBad = 0;
3995  int NWarn = 0;
3996  int NCalib = 0;
3997  int NPed = 0;
3998  // int Eta[3][10000]={0};
3999  int Eta[4][10000] = {0};
4000  int Phi[4][10000] = {0};
4001  int Sub[4][10000] = {0};
4002  int Depth[4][10000] = {0};
4003  string Comment[4][10000] = {""};
4004  string Text[33] = {"", "Cm", "Am", "Wm", "Rm", "TNm", "TXm", "", "", "", "", "Cc", "Ac", "Wc", "Rc", "TNc", "TXc",
4005  "", "", "", "", "GS", "", "", "", "", "", "", "", "", "", "Pm", "pWm"};
4006  int flag_W = 0;
4007  int flag_B = 0;
4008  int flag_P = 0;
4009 
4010  for (int i = 1; i <= nx; i++) { //Eta
4011  for (int j = 1; j <= ny; j++) { // Phi
4012  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
4013  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
4014  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
4015  // int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
4016  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
4017  if (Map_SUB[sub][k]->GetBinContent(i, j) != 0) {
4018  Map_SUB[sub][k]->SetBinContent(i, j, 0.5);
4019  Map_ALL->SetBinContent(i, j, 0.5);
4020  }
4021  }
4022  }
4023  }
4024  }
4025 
4026  for (int i = 1; i <= nx; i++) { //Eta
4027  for (int j = 1; j <= ny; j++) { // Phi
4028  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
4029  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
4030  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
4031  // int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
4032  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
4033  flag_W = 0;
4034  flag_B = 0;
4035  flag_P = 0;
4036  for (int test = 1; test <= 6; test++) { //Test: 1-Wm, 2-Rm, etc
4037  //Bad
4038  if (Map_Ampl[test][sub][k]->GetBinContent(i, j) >
4039  0.1) { //Rate 0.1 for displaying on whole detector map and subdetector map
4040  Map_ALL->SetBinContent(i, j, 1.);
4041  Map_SUB[sub][k]->SetBinContent(i, j, 1.);
4042  if (flag_B == 0) {
4043  NBad += 1;
4044  Eta[2][NBad] = i - 41;
4045  Phi[2][NBad] = j - 1;
4046  Sub[2][NBad] = sub;
4047  Depth[2][NBad] = k;
4048  Comment[2][NBad] = Text[test];
4049  } else
4050  Comment[2][NBad] += ", " + Text[test];
4051  flag_B = 1;
4052  // cout<<"Map_Ampl["<<test<<"]["<<sub<<"]["<<k<<"]->GetBinContent("<<i<<","<<j<<")= "<<Map_Ampl[test][sub][k]->GetBinContent(i,j)<<endl;
4053  }
4054  //Warning
4055  /*
4056  if ((Map_Ampl[test][sub][k]->GetBinContent(i,j) != 0.)&&(Map_Ampl[test][sub][k]->GetBinContent(i,j) < 0.001) ) {
4057  if (Map_SUB[sub][k]->GetBinContent(i,j)!=1.) Map_SUB[sub][k]->SetBinContent(i,j,0.75);
4058  if (Map_ALL->GetBinContent(i,j)!=1.) Map_ALL->SetBinContent(i,j,0.75);
4059  if (flag_W == 0) {
4060  NWarn +=1;
4061  Eta[1][NWarn]=i-41;
4062  Phi[1][NWarn]=j-1;
4063  Sub[1][NWarn]=sub;
4064  Depth[1][NWarn]=k;
4065  Comment[1][NWarn]=Text[test];
4066  }
4067  else Comment[1][NWarn]+=", "+Text[test];
4068  flag_W = 1;
4069 // cout<<"Map_Ampl["<<test<<"]["<<sub<<"]["<<k<<"]->GetBinContent("<<i<<","<<j<<")= "<<Map_Ampl[test][sub][k]->GetBinContent(i,j)<<endl;
4070  }
4071 */
4072 
4073  } //end test
4074 
4075  //Calib
4076  /*
4077  for (int test=11;test<=16;test++) { //Test: 1-2.E, 2-2.F, etc
4078  if (Map_Ampl[test][sub][k]->GetBinContent(i,j) != 0.) {
4079 // if (Map_SUB[sub][k]->GetBinContent(i,j)!=1.0) Map_SUB[sub][k]->SetBinContent(i,j,0.3);
4080 // if (Map_ALL->GetBinContent(i,j)!=1.) Map_ALL->SetBinContent(i,j,0.3);
4081  if (flag_W == 0) {
4082  NWarn +=1;
4083  Eta[1][NWarn]=i-41;
4084  Phi[1][NWarn]=j-1;
4085  Sub[1][NWarn]=sub;
4086  Depth[1][NWarn]=k;
4087  Comment[1][NWarn]=Text[test];
4088  }
4089  else Comment[1][NWarn]+=", "+Text[test];
4090  flag_W = 1;
4091 // cout<<"Map_Ampl["<<test<<"]["<<sub<<"]["<<k<<"]->GetBinContent("<<i<<","<<j<<")= "<<Map_Ampl[test][sub][k]->GetBinContent(i,j)<<endl;
4092  }
4093  } //end test
4094 */
4095  //Gain stabil
4096  for (int test = 21; test <= 21; test++) {
4097  if (abs(Map_Ampl[test][sub][k]->GetBinContent(i, j)) > porog[sub]) {
4098  if (Map_SUB[sub][k]->GetBinContent(i, j) != 1.0)
4099  Map_SUB[sub][k]->SetBinContent(i, j, 0.75);
4100  if (Map_ALL->GetBinContent(i, j) != 1.) {
4101  Map_ALL->SetBinContent(i, j, 0.75);
4102  if (flag_W == 0) {
4103  NWarn += 1;
4104  Eta[1][NWarn] = i - 41;
4105  Phi[1][NWarn] = j - 1;
4106  Sub[1][NWarn] = sub;
4107  Depth[1][NWarn] = k;
4108  Comment[1][NWarn] = Text[test];
4109  } else
4110  Comment[1][NWarn] += ", " + Text[test];
4111  flag_W = 1;
4112 
4113  cout << "Map_Ampl[" << test << "][" << sub << "][" << k << "]->GetBinContent(" << i << "," << j
4114  << ")= " << Map_Ampl[test][sub][k]->GetBinContent(i, j) << endl;
4115  }
4116  }
4117  } //end test
4118 
4119  //Pedestals
4120  for (int test = 31; test <= 32; test++) {
4121  if (Map_Ampl[test][sub][k]->GetBinContent(i, j) > 0.1) {
4122  // if (Map_SUB[sub][k]->GetBinContent(i,j)!=1.0) Map_SUB[sub][k]->SetBinContent(i,j,0.75);
4123  // if (Map_ALL->GetBinContent(i,j)!=1.) Map_ALL->SetBinContent(i,j,0.75);
4124  if (flag_P == 0) {
4125  NPed += 1;
4126  Eta[3][NPed] = i - 41;
4127  Phi[3][NPed] = j - 1;
4128  Sub[3][NPed] = sub;
4129  Depth[3][NPed] = k;
4130  Comment[3][NPed] = Text[test];
4131  } else
4132  Comment[3][NPed] += ", " + Text[test];
4133  flag_P = 1;
4134 
4135  // cout<<"Map_Ampl["<<test<<"]["<<sub<<"]["<<k<<"]->GetBinContent("<<i<<","<<j<<")= "<<Map_Ampl[test][sub][k]->GetBinContent(i,j)<<endl;
4136  }
4137  } //end test
4138 
4139  } //end Depth
4140  } //end Sub
4141  } //end Phi
4142  } //end Eta
4143  // subdet maps
4144  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
4145 
4146  std::cout << " 2017 MAPS_SUB " << sub << std::endl;
4147  // if (sub==1) cHB->Divide(2,1);
4148  if (sub == 1)
4149  cHB->Divide(2, 2);
4150  // if (sub==2) cHE->Divide(3,1);
4151  if (sub == 2)
4152  cHE->Divide(3, 3);
4153  if (sub == 3)
4154  cONE->Divide(1, 1);
4155  // if (sub==4) cHB->Divide(2,1);
4156  if (sub == 4)
4157  cHF->Divide(2, 2);
4158  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
4159  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
4160  // int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
4161  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
4162  if (sub == 1)
4163  cHB->cd(k);
4164  if (sub == 2)
4165  cHE->cd(k);
4166  if (sub == 3)
4167  cONE->cd(k - 3);
4168  if (sub == 4)
4169  cHF->cd(k);
4170  gPad->SetGridy();
4171  gPad->SetGridx();
4172  // gPad->SetLogz();
4173  // gStyle->SetTitleOffset(0.5, "Y");
4174  if (sub == 1)
4175  sprintf(str, "HB, Depth%d \b", k);
4176  if (sub == 2)
4177  sprintf(str, "HE, Depth%d \b", k);
4178  if (sub == 3)
4179  sprintf(str, "HO, Depth%d \b", k);
4180  if (sub == 4)
4181  sprintf(str, "HF, Depth%d \b", k);
4182  Map_SUB[sub][k]->SetTitle(str);
4183  Map_SUB[sub][k]->SetXTitle("#eta \b");
4184  Map_SUB[sub][k]->SetYTitle("#phi \b");
4185  Map_SUB[sub][k]->Draw("COL");
4186  Map_SUB[sub][k]->GetYaxis()->SetRangeUser(0, 72.);
4187  Map_SUB[sub][k]->GetZaxis()->SetRangeUser(0., 1.);
4188  if (sub == 1) {
4189  cHB->Modified();
4190  cHB->Update();
4191  }
4192  if (sub == 2) {
4193  cHE->Modified();
4194  cHE->Update();
4195  }
4196  if (sub == 3) {
4197  cONE->Modified();
4198  cONE->Update();
4199  }
4200  if (sub == 4) {
4201  cHF->Modified();
4202  cHF->Update();
4203  }
4204  } //end depth
4205  if (sub == 1) {
4206  cHB->Print("MAPHB.png");
4207  cHB->Clear();
4208  }
4209  if (sub == 2) {
4210  cHE->Print("MAPHE.png");
4211  cHE->Clear();
4212  }
4213  if (sub == 3) {
4214  cONE->Print("MAPHO.png");
4215  cONE->Clear();
4216  }
4217  if (sub == 4) {
4218  cHF->Print("MAPHF.png");
4219  cHF->Clear();
4220  }
4221  }
4222 
4224  // TCanvas *cmain1 = new TCanvas("cmain1","MAP",200,10,1400,1800);
4225  TCanvas *cmain1 = new TCanvas("cmain1", "MAP", 250, 10, 1450, 1410);
4226  cmain1->Divide(2, 2);
4227 
4228  cmain1->cd(1);
4229  TH1F *JDBEYESJ0 = (TH1F *)hfile->Get("h_totalAmplitudeHBperEvent");
4230  JDBEYESJ0->SetStats(0);
4231  JDBEYESJ0->SetMarkerStyle(20);
4232  JDBEYESJ0->SetMarkerSize(0.8);
4233  JDBEYESJ0->GetYaxis()->SetLabelSize(0.04);
4234  JDBEYESJ0->SetXTitle("iEvent \b");
4235  JDBEYESJ0->SetYTitle("totalAmplitude perEvent \b");
4236  JDBEYESJ0->SetTitle("HB \b");
4237  JDBEYESJ0->SetMarkerColor(2);
4238  JDBEYESJ0->SetLineColor(1);
4239  JDBEYESJ0->SetMinimum(0.8);
4240  JDBEYESJ0->Draw("HIST same P0");
4241 
4242  cmain1->cd(2);
4243  TH1F *JDBEYESJ1 = (TH1F *)hfile->Get("h_totalAmplitudeHEperEvent");
4244  JDBEYESJ1->SetStats(0);
4245  JDBEYESJ1->SetMarkerStyle(20);
4246  JDBEYESJ1->SetMarkerSize(0.8);
4247  JDBEYESJ1->GetYaxis()->SetLabelSize(0.04);
4248  JDBEYESJ1->SetXTitle("iEvent \b");
4249  JDBEYESJ1->SetYTitle("totalAmplitude perEvent \b");
4250  JDBEYESJ1->SetTitle("HE \b");
4251  JDBEYESJ1->SetMarkerColor(2);
4252  JDBEYESJ1->SetLineColor(1);
4253  JDBEYESJ1->SetMinimum(0.8);
4254  JDBEYESJ1->Draw("HIST same P0");
4255 
4256  cmain1->cd(3);
4257  TH1F *JDBEYESJ2 = (TH1F *)hfile->Get("h_totalAmplitudeHFperEvent");
4258  JDBEYESJ2->SetStats(0);
4259  JDBEYESJ2->SetMarkerStyle(20);
4260  JDBEYESJ2->SetMarkerSize(0.8);
4261  JDBEYESJ2->GetYaxis()->SetLabelSize(0.04);
4262  JDBEYESJ2->SetXTitle("iEvent \b");
4263  JDBEYESJ2->SetYTitle("totalAmplitude perEvent \b");
4264  JDBEYESJ2->SetTitle("HF \b");
4265  JDBEYESJ2->SetMarkerColor(2);
4266  JDBEYESJ2->SetLineColor(1);
4267  JDBEYESJ2->SetMinimum(0.8);
4268  JDBEYESJ2->Draw("HIST same P0");
4269 
4270  cmain1->cd(4);
4271  TH1F *JDBEYESJ3 = (TH1F *)hfile->Get("h_totalAmplitudeHOperEvent");
4272  JDBEYESJ3->SetStats(0);
4273  JDBEYESJ3->SetMarkerStyle(20);
4274  JDBEYESJ3->SetMarkerSize(0.8);
4275  JDBEYESJ3->GetYaxis()->SetLabelSize(0.04);
4276  JDBEYESJ3->SetXTitle("iEvent \b");
4277  JDBEYESJ3->SetYTitle("totalAmplitude perEvent \b");
4278  JDBEYESJ3->SetTitle("HO \b");
4279  JDBEYESJ3->SetMarkerColor(2);
4280  JDBEYESJ3->SetLineColor(1);
4281  JDBEYESJ3->SetMinimum(0.8);
4282  JDBEYESJ3->Draw("HIST same P0");
4283 
4284  cmain1->Modified();
4285  cmain1->Update();
4286  cmain1->Print("EVENTDEPENDENCE.png");
4287 
4288  std::cout << " EVENTDEPENDENCE " << std::endl;
4289 
4291  // ALL SubDet
4292  gStyle->SetOptTitle(0);
4293  TCanvas *cmain = new TCanvas("cmain", "MAP", 1000, 1000);
4294  //cmain->cd(1);
4295  gPad->SetGridy();
4296  gPad->SetGridx();
4297  // gPad->SetLogz();
4298  Map_ALL->SetTitleOffset(1.3, "Y");
4299  Map_ALL->SetXTitle("#eta \b");
4300  Map_ALL->SetYTitle("#phi \b");
4301  Map_ALL->Draw("COL");
4302  Map_ALL->GetYaxis()->SetRangeUser(0, 72.);
4303  Map_ALL->GetZaxis()->SetRangeUser(0, 1.);
4304  cmain->Modified();
4305  cmain->Update();
4306  cmain->Print("MAP.png");
4307 
4308  std::cout << "******** MAP_ALL done" << std::endl;
4309  std::cout << "********" << std::endl;
4310 
4311  std::cout << "********" << std::endl;
4312  std::cout << "************ Start creating each test kind for each subdet html pages:" << std::endl;
4313 
4314  //======================================================================
4315 
4316  //======================================================================
4317  // Creating each test kind for each subdet html pages:
4318  std::string raw_class, raw_class1, raw_class2, raw_class3;
4319  int ind = 0;
4320 
4321  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
4322  ofstream htmlFileT, htmlFileC, htmlFileD, htmlFileP, htmlFileS, htmlFileM;
4323  if (sub == 1) {
4324  htmlFileT.open("HB_Tile.html");
4325  htmlFileC.open("HB_Calib.html");
4326  htmlFileD.open("HB_Drift.html");
4327  htmlFileP.open("HB_Pedestals.html");
4328  htmlFileS.open("HB_Shapes.html");
4329  }
4330  if (sub == 2) {
4331  htmlFileT.open("HE_Tile.html");
4332  htmlFileC.open("HE_Calib.html");
4333  htmlFileD.open("HE_Drift.html");
4334  htmlFileP.open("HE_Pedestals.html");
4335  htmlFileS.open("HE_Shapes.html");
4336  htmlFileM.open("HE_IterationMethod.html");
4337  }
4338  if (sub == 3) {
4339  htmlFileT.open("HO_Tile.html");
4340  htmlFileC.open("HO_Calib.html");
4341  htmlFileD.open("HO_Drift.html");
4342  htmlFileP.open("HO_Pedestals.html");
4343  htmlFileS.open("HO_Shapes.html");
4344  }
4345  if (sub == 4) {
4346  htmlFileT.open("HF_Tile.html");
4347  htmlFileC.open("HF_Calib.html");
4348  htmlFileD.open("HF_Drift.html");
4349  htmlFileP.open("HF_Pedestals.html");
4350  htmlFileS.open("HF_Shapes.html");
4351  }
4352 
4353  // Megatile channels
4354  htmlFileT << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
4355  htmlFileT << "<head>" << std::endl;
4356  htmlFileT << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
4357  htmlFileT << "<title> Remote Monitoring Tool </title>" << std::endl;
4358  htmlFileT << "<style type=\"text/css\">" << std::endl;
4359  htmlFileT << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
4360  << std::endl;
4361  htmlFileT << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
4362  htmlFileT << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
4363  "text-align: center;}"
4364  << std::endl;
4365  htmlFileT << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
4366  htmlFileT << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
4367  htmlFileT << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
4368  htmlFileT << "</style>" << std::endl;
4369  htmlFileT << "<body>" << std::endl;
4370 
4371  if (sub == 1)
4372  htmlFileT << "<h1> Criteria for megatile channels for HB, RUN = " << runnumber << " </h1>" << std::endl;
4373  if (sub == 2)
4374  htmlFileT << "<h1> Criteria for megatile channels for HE, RUN = " << runnumber << " </h1>" << std::endl;
4375  if (sub == 3)
4376  htmlFileT << "<h1> Criteria for megatile channels for HO, RUN = " << runnumber << " </h1>" << std::endl;
4377  if (sub == 4)
4378  htmlFileT << "<h1> Criteria for megatile channels for HF, RUN = " << runnumber << " </h1>" << std::endl;
4379  htmlFileT << "<br>" << std::endl;
4380 
4381  // Test Entries
4382 
4383  htmlFileT << "<h2> 0. Entries for each channel.</h3>" << std::endl;
4384  htmlFileT << "<h3> 0.A. Entries in each channel for each depth.</h3>" << std::endl;
4385  htmlFileT << "<h4> Channel legend: color is rate of entries </h4>" << std::endl;
4386  if (sub == 1)
4387  htmlFileT << " <img src=\"MapRateEntryHB.png\" />" << std::endl;
4388  if (sub == 2)
4389  htmlFileT << " <img src=\"MapRateEntryHE.png\" />" << std::endl;
4390  if (sub == 3)
4391  htmlFileT << " <img src=\"MapRateEntryHO.png\" />" << std::endl;
4392  if (sub == 4)
4393  htmlFileT << " <img src=\"MapRateEntryHF.png\" />" << std::endl;
4394  htmlFileT << "<br>" << std::endl;
4395 
4396  // Test Cm
4397  htmlFileT << "<h2> 1. Cm criterion: CapID errors for each channel.</h3>" << std::endl;
4398  htmlFileT << "<h3> 1.A. Rate of CapId failures in each channel for each depth.</h3>" << std::endl;
4399  htmlFileT << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
4400  if (sub == 1)
4401  htmlFileT << " <img src=\"MapRateCapIDHB.png\" />" << std::endl;
4402  if (sub == 2)
4403  htmlFileT << " <img src=\"MapRateCapIDHE.png\" />" << std::endl;
4404  if (sub == 3)
4405  htmlFileT << " <img src=\"MapRateCapIDHO.png\" />" << std::endl;
4406  if (sub == 4)
4407  htmlFileT << " <img src=\"MapRateCapIDHF.png\" />" << std::endl;
4408  htmlFileT << "<br>" << std::endl;
4409 
4410  // Am
4411  htmlFileT << "<h2> 2. Am criterion: ADC amplitude collected over all TSs(Full Amplitude) for each channel. </h3>"
4412  << std::endl;
4413  htmlFileT << "<h3> 2.A. Full ADC amplitude distribution over all events, channels and depths.</h3>" << std::endl;
4414  htmlFileT << "<h4> Legend: Bins less " << MIN_M[2][sub] << " correpond to bad ADC amplitude </h4>" << std::endl;
4415  if (sub == 1)
4416  htmlFileT << " <img src=\"HistAmplHB.png\" />" << std::endl;
4417  if (sub == 2)
4418  htmlFileT << " <img src=\"HistAmplHE.png\" />" << std::endl;
4419  if (sub == 3)
4420  htmlFileT << " <img src=\"HistAmplHO.png\" />" << std::endl;
4421  if (sub == 4)
4422  htmlFileT << " <img src=\"HistAmplHF.png\" />" << std::endl;
4423  htmlFileT << "<br>" << std::endl;
4424  htmlFileT << "<h3> 2.B. Rate of bad ADC amplitude (<" << MIN_M[2][sub] << ") in each channel for each depth. </h3>"
4425  << std::endl;
4426  htmlFileT << "<h4> Channel legend: white - good, other colours - bad. </h4>" << std::endl;
4427  if (sub == 1)
4428  htmlFileT << " <img src=\"MapRateAmplHB.png\" />" << std::endl;
4429  if (sub == 2)
4430  htmlFileT << " <img src=\"MapRateAmplHE.png\" />" << std::endl;
4431  if (sub == 3)
4432  htmlFileT << " <img src=\"MapRateAmplHO.png\" />" << std::endl;
4433  if (sub == 4)
4434  htmlFileT << " <img src=\"MapRateAmplHF.png\" />" << std::endl;
4435  htmlFileT << "<br>" << std::endl;
4436 
4437  // Test Wm
4438  htmlFileT << "<h2> 3. Wm criterion: RMS (width) of ADC amplutude for each channel.</h3>" << std::endl;
4439  htmlFileT << "<h3> 3.A. RMS distribution over all events, channel and depth.</h3>" << std::endl;
4440  htmlFileT << "<h4> Legend: Bins less " << MIN_M[3][sub] << " and more " << MAX_M[3][sub]
4441  << " correpond to bad RMS </h4>" << std::endl;
4442  if (sub == 1)
4443  htmlFileT << " <img src=\"HistRMSHB.png\" />" << std::endl;
4444  if (sub == 2)
4445  htmlFileT << " <img src=\"HistRMSHE.png\" />" << std::endl;
4446  if (sub == 3)
4447  htmlFileT << " <img src=\"HistRMSHO.png\" />" << std::endl;
4448  if (sub == 4)
4449  htmlFileT << " <img src=\"HistRMSHF.png\" />" << std::endl;
4450  htmlFileT << "<br>" << std::endl;
4451  htmlFileT << "<h3> 3.B. Rate of bad RMS (<" << MIN_M[3][sub] << ",>" << MAX_M[3][sub]
4452  << ") in each channel for each depth.</h3>" << std::endl;
4453  htmlFileT << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
4454  if (sub == 1)
4455  htmlFileT << " <img src=\"MapRateRMSHB.png\" />" << std::endl;
4456  if (sub == 2)
4457  htmlFileT << " <img src=\"MapRateRMSHE.png\" />" << std::endl;
4458  if (sub == 3)
4459  htmlFileT << " <img src=\"MapRateRMSHO.png\" />" << std::endl;
4460  if (sub == 4)
4461  htmlFileT << " <img src=\"MapRateRMSHF.png\" />" << std::endl;
4462  htmlFileT << "<br>" << std::endl;
4463 
4464  // Rm
4465  htmlFileT << "<h2> 4. Rm criterion: Ratio ADC value sum over four near maximum (-2, -1, max, +1) TS to ADC value "
4466  "sum over all TS for each channel. </h3>"
4467  << std::endl;
4468  htmlFileT << "<h3> 4.A. Ratio distribution over all events, channels and depths.</h3>" << std::endl;
4469  htmlFileT << "<h4> Legend: Bins less " << MIN_M[4][sub] << " and more " << MAX_M[4][sub]
4470  << " correpond to bad ratio </h4>" << std::endl;
4471  if (sub == 1)
4472  htmlFileT << " <img src=\"Hist43TStoAllTSHB.png\" />" << std::endl;
4473  if (sub == 2)
4474  htmlFileT << " <img src=\"Hist43TStoAllTSHE.png\" />" << std::endl;
4475  if (sub == 3)
4476  htmlFileT << " <img src=\"Hist43TStoAllTSHO.png\" />" << std::endl;
4477  if (sub == 4)
4478  htmlFileT << " <img src=\"Hist43TStoAllTSHF.png\" />" << std::endl;
4479  htmlFileT << "<br>" << std::endl;
4480  htmlFileT << "<h3> 4.B. Rate of bad ratio (<" << MIN_M[4][sub] << ", >" << MAX_M[4][sub]
4481  << ") in each channel for each depth.</h3>" << std::endl;
4482  htmlFileT << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
4483  if (sub == 1)
4484  htmlFileT << " <img src=\"MapRate43TStoAllTSHB.png\" />" << std::endl;
4485  if (sub == 2)
4486  htmlFileT << " <img src=\"MapRate43TStoAllTSHE.png\" />" << std::endl;
4487  if (sub == 3)
4488  htmlFileT << " <img src=\"MapRate43TStoAllTSHO.png\" />" << std::endl;
4489  if (sub == 4)
4490  htmlFileT << " <img src=\"MapRate43TStoAllTSHF.png\" />" << std::endl;
4491  htmlFileT << "<br>" << std::endl;
4492 
4493  // TNm
4494  htmlFileT << "<h2> 5. TNm criterion: Mean TS position for each channel.</h3>" << std::endl;
4495  htmlFileT << "<h3> 5.A. TN position distribution over all events, channels and depths.</h3>" << std::endl;
4496  htmlFileT << "<h4> Legend: Bins less " << MIN_M[5][sub] << " and more " << MAX_M[5][sub]
4497  << " correpond to bad mean position </h4>" << std::endl;
4498  if (sub == 1)
4499  htmlFileT << " <img src=\"HistMeanPosHB.png\" />" << std::endl;
4500  if (sub == 2)
4501  htmlFileT << " <img src=\"HistMeanPosHE.png\" />" << std::endl;
4502  if (sub == 3)
4503  htmlFileT << " <img src=\"HistMeanPosHO.png\" />" << std::endl;
4504  if (sub == 4)
4505  htmlFileT << " <img src=\"HistMeanPosHF.png\" />" << std::endl;
4506  htmlFileT << "<br>" << std::endl;
4507  htmlFileT << "<h3> 5.B. Rate of bad TN position (<" << MIN_M[5][sub] << ", >" << MAX_M[5][sub]
4508  << ") in each channel for each depth. </h3>" << std::endl;
4509  htmlFileT << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
4510  if (sub == 1)
4511  htmlFileT << " <img src=\"MapRateMeanPosHB.png\" />" << std::endl;
4512  if (sub == 2)
4513  htmlFileT << " <img src=\"MapRateMeanPosHE.png\" />" << std::endl;
4514  if (sub == 3)
4515  htmlFileT << " <img src=\"MapRateMeanPosHO.png\" />" << std::endl;
4516  if (sub == 4)
4517  htmlFileT << " <img src=\"MapRateMeanPosHF.png\" />" << std::endl;
4518  htmlFileT << "<br>" << std::endl;
4519 
4520  // TXm
4521  htmlFileT << "<h2> 6.TXm criterion: Maximum TS position for each channel.</h3>" << std::endl;
4522  htmlFileT << "<h3> 6.A. TX position distribution over all events, channel and depth.</h3>" << std::endl;
4523  htmlFileT << "<h4> Legend: Bins less " << MIN_M[6][sub] << " and more " << MAX_M[6][sub]
4524  << " correpond to bad position </h4>" << std::endl;
4525  if (sub == 1)
4526  htmlFileT << " <img src=\"HistMaxPosHB.png\" />" << std::endl;
4527  if (sub == 2)
4528  htmlFileT << " <img src=\"HistMaxPosHE.png\" />" << std::endl;
4529  if (sub == 3)
4530  htmlFileT << " <img src=\"HistMaxPosHO.png\" />" << std::endl;
4531  if (sub == 4)
4532  htmlFileT << " <img src=\"HistMaxPosHF.png\" />" << std::endl;
4533  htmlFileT << "<br>" << std::endl;
4534  htmlFileT << "<h3> 6.B. Rate of bad TX position (<" << MIN_M[6][sub] << ", >" << MAX_M[6][sub]
4535  << ") in each channel for each depth. </h3>" << std::endl;
4536  htmlFileT << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
4537  if (sub == 1)
4538  htmlFileT << " <img src=\"MapRateMaxPosHB.png\" />" << std::endl;
4539  if (sub == 2)
4540  htmlFileT << " <img src=\"MapRateMaxPosHE.png\" />" << std::endl;
4541  if (sub == 3)
4542  htmlFileT << " <img src=\"MapRateMaxPosHO.png\" />" << std::endl;
4543  if (sub == 4)
4544  htmlFileT << " <img src=\"MapRateMaxPosHF.png\" />" << std::endl;
4545  htmlFileT << "<br>" << std::endl;
4546 
4547  htmlFileT << "</body> " << std::endl;
4548  htmlFileT << "</html> " << std::endl;
4549  htmlFileT.close();
4550 
4551  //Calibration channels
4552  htmlFileC << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
4553  htmlFileC << "<head>" << std::endl;
4554  htmlFileC << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
4555  htmlFileC << "<title> Raw Data Analyser </title>" << std::endl;
4556  htmlFileC << "<style type=\"text/css\">" << std::endl;
4557  htmlFileC << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
4558  << std::endl;
4559  htmlFileC << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
4560  htmlFileC << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
4561  "text-align: center;}"
4562  << std::endl;
4563  htmlFileC << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
4564  htmlFileC << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
4565  htmlFileC << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
4566  htmlFileC << "</style>" << std::endl;
4567  htmlFileC << "<body>" << std::endl;
4568 
4569  if (sub == 1)
4570  htmlFileC << "<h1> Criteria for calibration channels for HB, RUN = " << runnumber << " </h1>" << std::endl;
4571  if (sub == 2)
4572  htmlFileC << "<h1> Criteria for calibration channels for HE, RUN = " << runnumber << " </h1>" << std::endl;
4573  if (sub == 3)
4574  htmlFileC << "<h1> Criteria for calibration channels for HO, RUN = " << runnumber << " </h1>" << std::endl;
4575  if (sub == 4)
4576  htmlFileC << "<h1> Criteria for calibration channels for HF, RUN = " << runnumber << " </h1>" << std::endl;
4577  htmlFileC << "<br>" << std::endl;
4578 
4579  // Test Entries
4580 
4581  htmlFileC << "<h2> 0. Entries for each channel.</h3>" << std::endl;
4582  htmlFileC << "<h3> 0.A. Entries in each channel for each depth.</h3>" << std::endl;
4583  htmlFileC << "<h4> Channel legend: color is rate of entries </h4>" << std::endl;
4584  if (sub == 1)
4585  htmlFileC << " <img src=\"MapRateCalibEntryHB.png\" />" << std::endl;
4586  if (sub == 2)
4587  htmlFileC << " <img src=\"MapRateCalibEntryHE.png\" />" << std::endl;
4588  if (sub == 3)
4589  htmlFileC << " <img src=\"MapRateCalibEntryHO.png\" />" << std::endl;
4590  if (sub == 4)
4591  htmlFileC << " <img src=\"MapRateCalibEntryHF.png\" />" << std::endl;
4592  htmlFileC << "<br>" << std::endl;
4593 
4594  // Test Cc
4595  htmlFileC << "<h2> 1. Cc criterion: CapID errors for each channel.</h3>" << std::endl;
4596  htmlFileC << "<h3> 1.A. Rate of CapId failures in each channel for each depth.</h3>" << std::endl;
4597  htmlFileC << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
4598  if (sub == 1)
4599  htmlFileC << " <img src=\"MapRateCapCalibHB.png\" />" << std::endl;
4600  if (sub == 2)
4601  htmlFileC << " <img src=\"MapRateCapCalibHE.png\" />" << std::endl;
4602  if (sub == 3)
4603  htmlFileC << " <img src=\"MapRateCapCalibHO.png\" />" << std::endl;
4604  if (sub == 4)
4605  htmlFileC << " <img src=\"MapRateCapCalibHF.png\" />" << std::endl;
4606  htmlFileC << "<br>" << std::endl;
4607 
4608  // Ac
4609  htmlFileC << "<h2> 2. Ac criterion: ADC amplitude collected over all TSs(Full Amplitude) for each channel. </h3>"
4610  << std::endl;
4611  htmlFileC << "<h3> 2.A. Full ADC amplitude distribution over all events, channels and depths.</h3>" << std::endl;
4612  htmlFileC << "<h4> Legend: Bins less " << MIN_C[2][sub] << " correpond to bad ADC amplitude </h4>" << std::endl;
4613  if (sub == 1)
4614  htmlFileC << " <img src=\"HistAmplCalibHB.png\" />" << std::endl;
4615  if (sub == 2)
4616  htmlFileC << " <img src=\"HistAmplCalibHE.png\" />" << std::endl;
4617  if (sub == 3)
4618  htmlFileC << " <img src=\"HistAmplCalibHO.png\" />" << std::endl;
4619  if (sub == 4)
4620  htmlFileC << " <img src=\"HistAmplCalibHF.png\" />" << std::endl;
4621  htmlFileC << "<br>" << std::endl;
4622  htmlFileC << "<h3> 2.B. Rate of bad ADC amplitude (<" << MIN_C[2][sub] << ") in each channel for each depth. </h3>"
4623  << std::endl;
4624  htmlFileC << "<h4> Channel legend: white - good, other colours - bad. </h4>" << std::endl;
4625  if (sub == 1)
4626  htmlFileC << " <img src=\"MapRateAmplCalibHB.png\" />" << std::endl;
4627  if (sub == 2)
4628  htmlFileC << " <img src=\"MapRateAmplCalibHE.png\" />" << std::endl;
4629  if (sub == 3)
4630  htmlFileC << " <img src=\"MapRateAmplCalibHO.png\" />" << std::endl;
4631  if (sub == 4)
4632  htmlFileC << " <img src=\"MapRateAmplCalibHF.png\" />" << std::endl;
4633  htmlFileC << "<br>" << std::endl;
4634 
4635  // Test Wc
4636  htmlFileC << "<h2> 3. Wc criterion: RMS (width) of ADC amplutude for each channel.</h3>" << std::endl;
4637  htmlFileC << "<h3> 3.A. W distribution over all events, channel and depth.</h3>" << std::endl;
4638  htmlFileC << "<h4> Legend: Bins less " << MIN_C[3][sub] << " and more " << MAX_C[3][sub]
4639  << " correpond to bad RMS </h4>" << std::endl;
4640  if (sub == 1)
4641  htmlFileC << " <img src=\"HistRMSCalibHB.png\" />" << std::endl;
4642  if (sub == 2)
4643  htmlFileC << " <img src=\"HistRMSCalibHE.png\" />" << std::endl;
4644  if (sub == 3)
4645  htmlFileC << " <img src=\"HistRMSCalibHO.png\" />" << std::endl;
4646  if (sub == 4)
4647  htmlFileC << " <img src=\"HistRMSCalibHF.png\" />" << std::endl;
4648  htmlFileC << "<br>" << std::endl;
4649  htmlFileC << "<h3> 3.B. Rate of bad W (<" << MIN_C[3][sub] << ",>" << MAX_C[3][sub]
4650  << ") in each channel for each depth.</h3>" << std::endl;
4651  htmlFileC << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
4652  if (sub == 1)
4653  htmlFileC << " <img src=\"MapRateRMSCalibHB.png\" />" << std::endl;
4654  if (sub == 2)
4655  htmlFileC << " <img src=\"MapRateRMSCalibHE.png\" />" << std::endl;
4656  if (sub == 3)
4657  htmlFileC << " <img src=\"MapRateRMSCalibHO.png\" />" << std::endl;
4658  if (sub == 4)
4659  htmlFileC << " <img src=\"MapRateRMSCalibHF.png\" />" << std::endl;
4660  htmlFileC << "<br>" << std::endl;
4661 
4662  // Rc
4663  htmlFileC << "<h2> 4. Rc criterion: Ratio ADC value sum over five near maximum (-2, -1, max, +1, +2) TS to ADC "
4664  "value sum over all TS for each channel. </h3>"
4665  << std::endl;
4666  htmlFileC << "<h3> 4.A. Ratio distribution over all events, channels and depths.</h3>" << std::endl;
4667  htmlFileC << "<h4> Legend: Bins less " << MIN_C[4][sub] << " and more " << MAX_C[4][sub]
4668  << " correpond to bad ratio </h4>" << std::endl;
4669  if (sub == 1)
4670  htmlFileC << " <img src=\"Hist43TStoAllTSCalibHB.png\" />" << std::endl;
4671  if (sub == 2)
4672  htmlFileC << " <img src=\"Hist43TStoAllTSCalibHE.png\" />" << std::endl;
4673  if (sub == 3)
4674  htmlFileC << " <img src=\"Hist43TStoAllTSCalibHO.png\" />" << std::endl;
4675  if (sub == 4)
4676  htmlFileC << " <img src=\"Hist43TStoAllTSCalibHF.png\" />" << std::endl;
4677  htmlFileC << "<br>" << std::endl;
4678  htmlFileC << "<h3> 4.B. Rate of bad Ratio (<" << MIN_C[4][sub] << ", >" << MAX_C[4][sub]
4679  << ") in each channel for each depth.</h3>" << std::endl;
4680  htmlFileC << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
4681  if (sub == 1)
4682  htmlFileC << " <img src=\"MapRate43TStoAllTSCalibHB.png\" />" << std::endl;
4683  if (sub == 2)
4684  htmlFileC << " <img src=\"MapRate43TStoAllTSCalibHE.png\" />" << std::endl;
4685  if (sub == 3)
4686  htmlFileC << " <img src=\"MapRate43TStoAllTSCalibHO.png\" />" << std::endl;
4687  if (sub == 4)
4688  htmlFileC << " <img src=\"MapRate43TStoAllTSCalibHF.png\" />" << std::endl;
4689  htmlFileC << "<br>" << std::endl;
4690 
4691  // TNc
4692  htmlFileC << "<h2> 5. TNc criterion: Mean TS position for each channel.</h3>" << std::endl;
4693  htmlFileC << "<h3> 5.A. TN position distribution over all events, channels and depths.</h3>" << std::endl;
4694  htmlFileC << "<h4> Legend: Bins less " << MIN_C[5][sub] << " and more " << MAX_C[5][sub]
4695  << " correpond to bad position </h4>" << std::endl;
4696  if (sub == 1)
4697  htmlFileC << " <img src=\"HistMeanPosCalibHB.png\" />" << std::endl;
4698  if (sub == 2)
4699  htmlFileC << " <img src=\"HistMeanPosCalibHE.png\" />" << std::endl;
4700  if (sub == 3)
4701  htmlFileC << " <img src=\"HistMeanPosCalibHO.png\" />" << std::endl;
4702  if (sub == 4)
4703  htmlFileC << " <img src=\"HistMeanPosCalibHF.png\" />" << std::endl;
4704  htmlFileC << "<br>" << std::endl;
4705  htmlFileC << "<h3> 5.B. Rate of bad TN position (<" << MIN_C[5][sub] << ", >" << MAX_C[5][sub]
4706  << ") in each channel for each depth. </h3>" << std::endl;
4707  htmlFileC << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
4708  if (sub == 1)
4709  htmlFileC << " <img src=\"MapRateMeanPosCalibHB.png\" />" << std::endl;
4710  if (sub == 2)
4711  htmlFileC << " <img src=\"MapRateMeanPosCalibHE.png\" />" << std::endl;
4712  if (sub == 3)
4713  htmlFileC << " <img src=\"MapRateMeanPosCalibHO.png\" />" << std::endl;
4714  if (sub == 4)
4715  htmlFileC << " <img src=\"MapRateMeanPosCalibHF.png\" />" << std::endl;
4716  htmlFileC << "<br>" << std::endl;
4717 
4718  // TXm
4719  htmlFileC << "<h2> 6.TXc criterion: Maximum TS position for each channel.</h3>" << std::endl;
4720  htmlFileC << "<h3> 6.A. TX position distribution over all events, channel and depth.</h3>" << std::endl;
4721  htmlFileC << "<h4> Legend: Bins less " << MIN_C[6][sub] << " and more " << MAX_C[6][sub]
4722  << " correpond to bad position </h4>" << std::endl;
4723  if (sub == 1)
4724  htmlFileC << " <img src=\"HistMaxPosCalibHB.png\" />" << std::endl;
4725  if (sub == 2)
4726  htmlFileC << " <img src=\"HistMaxPosCalibHE.png\" />" << std::endl;
4727  if (sub == 3)
4728  htmlFileC << " <img src=\"HistMaxPosCalibHO.png\" />" << std::endl;
4729  if (sub == 4)
4730  htmlFileC << " <img src=\"HistMaxPosCalibHF.png\" />" << std::endl;
4731  htmlFileC << "<br>" << std::endl;
4732  htmlFileC << "<h3> 6.B. Rate of bad TX position (<" << MIN_C[6][sub] << ", >" << MAX_C[6][sub]
4733  << ") in each channel for each depth. </h3>" << std::endl;
4734  htmlFileC << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
4735  if (sub == 1)
4736  htmlFileC << " <img src=\"MapRateMaxPosCalibHB.png\" />" << std::endl;
4737  if (sub == 2)
4738  htmlFileC << " <img src=\"MapRateMaxPosCalibHE.png\" />" << std::endl;
4739  if (sub == 3)
4740  htmlFileC << " <img src=\"MapRateMaxPosCalibHO.png\" />" << std::endl;
4741  if (sub == 4)
4742  htmlFileC << " <img src=\"MapRateMaxPosCalibHF.png\" />" << std::endl;
4743  htmlFileC << "<br>" << std::endl;
4744 
4745  htmlFileC << "</body> " << std::endl;
4746  htmlFileC << "</html> " << std::endl;
4747  htmlFileC.close();
4748 
4749  //Response drift
4750  htmlFileD << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
4751  htmlFileD << "<head>" << std::endl;
4752  htmlFileD << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
4753  htmlFileD << "<title> Remore Monitoring Tool </title>" << std::endl;
4754  htmlFileD << "<style type=\"text/css\">" << std::endl;
4755  htmlFileD << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
4756  << std::endl;
4757  htmlFileD << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
4758  htmlFileD << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
4759  "text-align: center;}"
4760  << std::endl;
4761  htmlFileD << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
4762  htmlFileD << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
4763  htmlFileD << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
4764  htmlFileD << "</style>" << std::endl;
4765  htmlFileD << "<body>" << std::endl;
4766 
4767  if (sub == 1)
4768  htmlFileD << "<h1> Response drift for HB: Current RUN = " << runnumber << ", Reference RUN = " << refrunnumber
4769  << " </h1>" << std::endl;
4770  if (sub == 2)
4771  htmlFileD << "<h1> Response drift for HE: Current RUN = " << runnumber << ", Reference RUN = " << refrunnumber
4772  << " </h1>" << std::endl;
4773  if (sub == 3)
4774  htmlFileD << "<h1> Response drift for HO: Current RUN = " << runnumber << ", Reference RUN = " << refrunnumber
4775  << " </h1>" << std::endl;
4776  if (sub == 4)
4777  htmlFileD << "<h1> Response drift for HF: Current RUN = " << runnumber << ", Reference RUN = " << refrunnumber
4778  << " </h1>" << std::endl;
4779  htmlFileD << "<br>" << std::endl;
4780 
4781  // test GS
4782  htmlFileD << "<h2> 1. Gain Stability (GS) </h3>" << std::endl;
4783  htmlFileD << "<h3> 1.A. Averaged channel response, collected over all TS, for Current run in each channel for each "
4784  "depth.</h3>"
4785  << std::endl;
4786  htmlFileD << "<h4> Channel legend: colour means cooresponding value of mean response. </h4>" << std::endl;
4787  if (sub == 1)
4788  htmlFileD << " <img src=\"MapRateAmpl1HB.png\" />" << std::endl;
4789  if (sub == 2)
4790  htmlFileD << " <img src=\"MapRateAmpl1HE.png\" />" << std::endl;
4791  if (sub == 3)
4792  htmlFileD << " <img src=\"MapRateAmpl1HO.png\" />" << std::endl;
4793  if (sub == 4)
4794  htmlFileD << " <img src=\"MapRateAmpl1HF.png\" />" << std::endl;
4795  htmlFileD << "<br>" << std::endl;
4796  htmlFileD << "<h3> 1.B. Averaged channel response, collected over all TS, for Reference run in each channel for "
4797  "each depth.</h3>"
4798  << std::endl;
4799  htmlFileD << "<h4> Channel legend: colour means cooresponding value of mean response. </h4>" << std::endl;
4800  if (sub == 1)
4801  htmlFileD << " <img src=\"MapRateAmpl2HB.png\" />" << std::endl;
4802  if (sub == 2)
4803  htmlFileD << " <img src=\"MapRateAmpl2HE.png\" />" << std::endl;
4804  if (sub == 3)
4805  htmlFileD << " <img src=\"MapRateAmpl2HO.png\" />" << std::endl;
4806  if (sub == 4)
4807  htmlFileD << " <img src=\"MapRateAmpl2HF.png\" />" << std::endl;
4808  htmlFileD << "<br>" << std::endl;
4809  htmlFileD << "<h3> 1.C. Relative difference between Current and Reference run distribution over all events, "
4810  "channels for each depth.</h3>"
4811  << std::endl;
4812  htmlFileD << "<h4> Legend: Bins less -" << porog[sub] << "% and more +" << porog[sub]
4813  << "% correpond to bad relative difference position </h4>" << std::endl;
4814  if (sub == 1)
4815  htmlFileD << " <img src=\"HistAmplDriftDepthHB.png\" />" << std::endl;
4816  if (sub == 2)
4817  htmlFileD << " <img src=\"HistAmplDriftDepthHE.png\" />" << std::endl;
4818  if (sub == 3)
4819  htmlFileD << " <img src=\"HistAmplDriftDepthHO.png\" />" << std::endl;
4820  if (sub == 4)
4821  htmlFileD << " <img src=\"HistAmplDriftDepthHF.png\" />" << std::endl;
4822  htmlFileD << "<br>" << std::endl;
4823  htmlFileD << "<h3> 1.D. Rate of bad relative difference (<-" << porog[sub] << ", >+" << porog[sub]
4824  << ") in each channel for each depth.</h3>" << std::endl;
4825  htmlFileD << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
4826  if (sub == 1)
4827  htmlFileD << " <img src=\"MapRateAmplDriftHB.png\" />" << std::endl;
4828  if (sub == 2)
4829  htmlFileD << " <img src=\"MapRateAmplDriftHE.png\" />" << std::endl;
4830  if (sub == 3)
4831  htmlFileD << " <img src=\"MapRateAmplDriftHO.png\" />" << std::endl;
4832  if (sub == 4)
4833  htmlFileD << " <img src=\"MapRateAmplDriftHF.png\" />" << std::endl;
4834  htmlFileD << "<br>" << std::endl;
4835 
4836  htmlFileD << "</body> " << std::endl;
4837  htmlFileD << "</html> " << std::endl;
4838  htmlFileD.close();
4839 
4840  // Pedestals
4841  htmlFileP << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
4842  htmlFileP << "<head>" << std::endl;
4843  htmlFileP << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
4844  htmlFileP << "<title> Remote Monitoring Tool </title>" << std::endl;
4845  htmlFileP << "<style type=\"text/css\">" << std::endl;
4846  htmlFileP << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
4847  << std::endl;
4848  htmlFileP << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
4849  htmlFileP << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
4850  "text-align: center;}"
4851  << std::endl;
4852  htmlFileP << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
4853  htmlFileP << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
4854  htmlFileP << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
4855  htmlFileP << "</style>" << std::endl;
4856  htmlFileP << "<body>" << std::endl;
4857 
4858  if (sub == 1)
4859  htmlFileP << "<h1> Pedestals for HB, RUN = " << runnumber << " </h1>" << std::endl;
4860  if (sub == 2)
4861  htmlFileP << "<h1> Pedestals for HE, RUN = " << runnumber << " </h1>" << std::endl;
4862  if (sub == 3)
4863  htmlFileP << "<h1> Pedestals for HO, RUN = " << runnumber << " </h1>" << std::endl;
4864  if (sub == 4)
4865  htmlFileP << "<h1> Pedestals for HF, RUN = " << runnumber << " </h1>" << std::endl;
4866  htmlFileP << "<br>" << std::endl;
4867 
4868  // Pedestal:
4869  htmlFileP << "<h2> 1.Pm criterion: Pedestals for each CapID .</h3>" << std::endl;
4870  htmlFileP << "<h3> 1.A. Pedestal distribution over all events, channels for each CapID and all depths.</h3>"
4871  << std::endl;
4872  htmlFileP << "<h4> Legend: Bins less " << Pedest[0][sub] << " correpond to bad Pedestals </h4>" << std::endl;
4873  if (sub == 1)
4874  htmlFileP << " <img src=\"HistPedestalsHB.png\" />" << std::endl;
4875  if (sub == 2)
4876  htmlFileP << " <img src=\"HistPedestalsHE.png\" />" << std::endl;
4877  if (sub == 3)
4878  htmlFileP << " <img src=\"HistPedestalsHO.png\" />" << std::endl;
4879  if (sub == 4)
4880  htmlFileP << " <img src=\"HistPedestalsHF.png\" />" << std::endl;
4881  htmlFileP << "<br>" << std::endl;
4882  htmlFileP << "<h3> 1.B. Rate of channels at very low Pedestals at least in one CapID for each depth.</h3>"
4883  << std::endl;
4884  htmlFileP << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
4885  if (sub == 1)
4886  htmlFileP << " <img src=\"MapRatePedHB.png\" />" << std::endl;
4887  if (sub == 2)
4888  htmlFileP << " <img src=\"MapRatePedHE.png\" />" << std::endl;
4889  if (sub == 3)
4890  htmlFileP << " <img src=\"MapRatePedHO.png\" />" << std::endl;
4891  if (sub == 4)
4892  htmlFileP << " <img src=\"MapRatePedHF.png\" />" << std::endl;
4893 
4894  // PedestalWidth:
4895  htmlFileP << "<h2> 2.pWm criterion: Pedestal Widths for each CapID .</h3>" << std::endl;
4896  htmlFileP << "<h3> 2.A. Pedestal Widths distribution over all events, channels for each CapID and all depths.</h3>"
4897  << std::endl;
4898  htmlFileP << "<h4> Legend: Bins less " << Pedest[1][sub] << " correpond to bad Pedestal Widths </h4>" << std::endl;
4899  if (sub == 1)
4900  htmlFileP << " <img src=\"HistPedestalWidthsHB.png\" />" << std::endl;
4901  if (sub == 2)
4902  htmlFileP << " <img src=\"HistPedestalWidthsHE.png\" />" << std::endl;
4903  if (sub == 3)
4904  htmlFileP << " <img src=\"HistPedestalWidthsHO.png\" />" << std::endl;
4905  if (sub == 4)
4906  htmlFileP << " <img src=\"HistPedestalWidthsHF.png\" />" << std::endl;
4907  htmlFileP << "<br>" << std::endl;
4908  htmlFileP << "<h3> 2.B. Rate of channels at very low Pedestal Widths at least in one CapID for each depth.</h3>"
4909  << std::endl;
4910  htmlFileP << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
4911  if (sub == 1)
4912  htmlFileP << " <img src=\"MapRatePedWidthsHB.png\" />" << std::endl;
4913  if (sub == 2)
4914  htmlFileP << " <img src=\"MapRatePedWidthsHE.png\" />" << std::endl;
4915  if (sub == 3)
4916  htmlFileP << " <img src=\"MapRatePedWidthsHO.png\" />" << std::endl;
4917  if (sub == 4)
4918  htmlFileP << " <img src=\"MapRatePedWidthsHF.png\" />" << std::endl;
4919 
4920  // Correlations of Pedestal(Width) and fullAmplitude:
4921  htmlFileP << "<h2> 3.Pedestal and pedestalWidths vs Amplitude .</h3>" << std::endl;
4922  htmlFileP << "<h3> 3.A. Correlation of Pedestal(pedestalWidths) and Amplitude over all channels and events .</h3>"
4923  << std::endl;
4924  htmlFileP << "<h4> Legend: colour - entries </h4>" << std::endl;
4925  if (sub == 1)
4926  htmlFileP << "<img src=\"CorrelationsMapPedestalVsfullAmplitudeHB.png\" />" << std::endl;
4927  if (sub == 2)
4928  htmlFileP << "<img src=\"CorrelationsMapPedestalVsfullAmplitudeHE.png\" />" << std::endl;
4929  if (sub == 3)
4930  htmlFileP << "<img src=\"CorrelationsMapPedestalVsfullAmplitudeHO.png\" />" << std::endl;
4931  if (sub == 4)
4932  htmlFileP << "<img src=\"CorrelationsMapPedestalVsfullAmplitudeHF.png\" />" << std::endl;
4933  htmlFileP << "<br>" << std::endl;
4934  htmlFileP.close();
4935 
4936  // TSs Shapes:
4937 
4938  htmlFileS << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
4939  htmlFileS << "<head>" << std::endl;
4940  htmlFileS << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
4941  htmlFileS << "<title> Remote Monitoring Tool </title>" << std::endl;
4942  htmlFileS << "<style type=\"text/css\">" << std::endl;
4943  htmlFileS << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
4944  << std::endl;
4945  htmlFileS << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
4946  htmlFileS << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
4947  "text-align: center;}"
4948  << std::endl;
4949  htmlFileS << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
4950  htmlFileS << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
4951  htmlFileS << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
4952  htmlFileS << "</style>" << std::endl;
4953  htmlFileS << "<body>" << std::endl;
4954 
4955  if (sub == 1)
4956  htmlFileS << "<h1> ADC Shape for HB, RUN = " << runnumber << " </h1>" << std::endl;
4957  if (sub == 2)
4958  htmlFileS << "<h1> ADC Shape for HE, RUN = " << runnumber << " </h1>" << std::endl;
4959  if (sub == 3)
4960  htmlFileS << "<h1> ADC Shape for HO, RUN = " << runnumber << " </h1>" << std::endl;
4961  if (sub == 4)
4962  htmlFileS << "<h1> ADC Shape for HF, RUN = " << runnumber << " </h1>" << std::endl;
4963  htmlFileS << "<br>" << std::endl;
4964 
4965  htmlFileS << "<h2> 1.Mean ADC Shape.</h3>" << std::endl;
4966  htmlFileS << "<h3> 1.A. ADC shape averaged over all good channels, depth and events.</h3>" << std::endl;
4967  // htmlFileS << "<h4> Legend: Bins less "<<Pedest[0][sub]<<" correpond to bad Pedestals </h4>"<< std::endl;
4968  if (sub == 1)
4969  htmlFileS << " <img src=\"HistGoodTSshapesHB.png\" />" << std::endl;
4970  if (sub == 2)
4971  htmlFileS << " <img src=\"HistGoodTSshapesHE.png\" />" << std::endl;
4972  if (sub == 3)
4973  htmlFileS << " <img src=\"HistGoodTSshapesHO.png\" />" << std::endl;
4974  if (sub == 4)
4975  htmlFileS << " <img src=\"HistGoodTSshapesHF.png\" />" << std::endl;
4976  htmlFileS << "<br>" << std::endl;
4977  htmlFileS << "<h3> 1.B. ADC shape averaged over all bad channels, depth and events. Bad channels are selected by 5 "
4978  "criteria: CapId, A, W, P, Pw </h3>"
4979  << std::endl;
4980  // htmlFileS << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
4981  if (sub == 1)
4982  htmlFileS << " <img src=\"HistBadTSshapesHB.png\" />" << std::endl;
4983  if (sub == 2)
4984  htmlFileS << " <img src=\"HistBadTSshapesHE.png\" />" << std::endl;
4985  if (sub == 3)
4986  htmlFileS << " <img src=\"HistBadTSshapesHO.png\" />" << std::endl;
4987  if (sub == 4)
4988  htmlFileS << " <img src=\"HistBadTSshapesHF.png\" />" << std::endl;
4989  /*
4990  htmlFileS << "<h2> 2. ADC in Time Slice </h3>"<< std::endl;
4991  htmlFileS << "<h3> 2.A. ADC counts histogrammed over all channels, depth and events.</h3>"<< std::endl;
4992 // htmlFileS << "<h4> Legend: Bins less "<<Pedest[0][sub]<<" correpond to bad Pedestals </h4>"<< std::endl;
4993  if (sub==1) htmlFileS << " <img src=\"Hist_ADC_HB_All.png\" />" << std::endl;
4994  if (sub==2) htmlFileS << " <img src=\"Hist_ADC_HE_All.png\" />" << std::endl;
4995  if (sub==3) htmlFileS << " <img src=\"Hist_ADC_HO_All.png\" />" << std::endl;
4996  if (sub==4) htmlFileS << " <img src=\"Hist_ADC_HF_All.png\" />" << std::endl;
4997  htmlFileS << "<br>"<< std::endl;
4998  htmlFileS << "<h3> 2.B. ADC counts histogrammed over all channels and events for each depth separately. </h3>"<< std::endl;
4999 // htmlFileS << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5000  if (sub==1) htmlFileS << " <img src=\"Hist_ADC_HB_DS.png\" />" << std::endl;
5001  if (sub==2) htmlFileS << " <img src=\"Hist_ADC_HE_DS.png\" />" << std::endl;
5002  if (sub==3) htmlFileS << " <img src=\"Hist_ADC_HO_DS.png\" />" << std::endl;
5003  if (sub==4) htmlFileS << " <img src=\"Hist_ADC_HF_DS.png\" />" << std::endl;
5004 
5005  htmlFileS << "<h2> 3. ADC Sum in Time Slice </h3>"<< std::endl;
5006  htmlFileS << "<h3> 3.A. ADC Sum over all channels histogrammed over all events for each depth separately. </h3>"<< std::endl;
5007 // htmlFileS << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5008  if (sub==1) htmlFileS << " <img src=\"Hist_SumADC_HB.png\" />" << std::endl;
5009  if (sub==2) htmlFileS << " <img src=\"Hist_SumADC_HE.png\" />" << std::endl;
5010  if (sub==3) htmlFileS << " <img src=\"Hist_SumADC_HO.png\" />" << std::endl;
5011  if (sub==4) htmlFileS << " <img src=\"Hist_SumADC_HF.png\" />" << std::endl;
5012 
5013  htmlFileS << "<h3> 3.B. ADC Sum over all channels histogrammed over all events for each depth separately. </h3>"<< std::endl;
5014 // htmlFileS << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5015  if (sub==1) htmlFileS << " <img src=\"Hist_SumADC_HB0.png\" />" << std::endl;
5016  if (sub==2) htmlFileS << " <img src=\"Hist_SumADC_HE0.png\" />" << std::endl;
5017  if (sub==3) htmlFileS << " <img src=\"Hist_SumADC_HO0.png\" />" << std::endl;
5018  if (sub==4) htmlFileS << " <img src=\"Hist_SumADC_HF0.png\" />" << std::endl;
5019 
5020  htmlFileS << "<h3> 3.C. ADC Sum over all channels histogrammed over all events for each depth separately. </h3>"<< std::endl;
5021 // htmlFileS << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5022  if (sub==1) htmlFileS << " <img src=\"Hist_SumADC_HB1.png\" />" << std::endl;
5023  if (sub==2) htmlFileS << " <img src=\"Hist_SumADC_HE1.png\" />" << std::endl;
5024  if (sub==3) htmlFileS << " <img src=\"Hist_SumADC_HO1.png\" />" << std::endl;
5025  if (sub==4) htmlFileS << " <img src=\"Hist_SumADC_HF1.png\" />" << std::endl;
5026 */
5027  htmlFileS.close();
5028 
5030 
5031  // Iteration Method for Calibration Group:
5032 
5033  htmlFileM << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
5034  htmlFileM << "<head>" << std::endl;
5035  htmlFileM << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
5036  htmlFileM << "<title> Remote Monitoring Tool </title>" << std::endl;
5037  htmlFileM << "<style type=\"text/css\">" << std::endl;
5038  htmlFileM << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
5039  << std::endl;
5040  htmlFileM << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
5041  htmlFileM << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
5042  "text-align: center;}"
5043  << std::endl;
5044  htmlFileM << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
5045  htmlFileM << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
5046  htmlFileM << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
5047  htmlFileM << "</style>" << std::endl;
5048  htmlFileM << "<body>" << std::endl;
5049 
5050  if (sub == 1)
5051  htmlFileM << "<h1> Iteration Method for Calibration Group, HB, RUN = " << runnumber << " </h1>" << std::endl;
5052  if (sub == 2)
5053  htmlFileM << "<h1> Iteration Method for Calibration Group, HE, RUN = " << runnumber << " </h1>" << std::endl;
5054  if (sub == 3)
5055  htmlFileM << "<h1> Iteration Method for Calibration Group, HO, RUN = " << runnumber << " </h1>" << std::endl;
5056  if (sub == 4)
5057  htmlFileM << "<h1> Iteration Method for Calibration Group, HF, RUN = " << runnumber << " </h1>" << std::endl;
5058  htmlFileM << "<br>" << std::endl;
5059 
5060  htmlFileM << "<h2> 1: Positive direction, R = R_depth_ieta_iphi = E_depth_ieta_iphi/E_depth_ieta </h3>"
5061  << std::endl;
5062 
5063  htmlFileM << "<h3> 1.A. eta/phi-plot: R, averaged over depthes </h3>" << std::endl;
5064  // htmlFileM << "<h4> Legend: Bins less "<<Pedest[0][sub]<<" correpond to bad Pedestals </h4>"<< std::endl;
5065  if (sub == 1)
5066  htmlFileM << " <img src=\"Rhist2IterationMethodHB.png\" />" << std::endl;
5067  if (sub == 2)
5068  htmlFileM << " <img src=\"Rhist2IterationMethodHE.png\" />" << std::endl;
5069  if (sub == 3)
5070  htmlFileM << " <img src=\"Rhist2IterationMethodHO.png\" />" << std::endl;
5071  if (sub == 4)
5072  htmlFileM << " <img src=\"Rhist2IterationMethodHF.png\" />" << std::endl;
5073  htmlFileM << "<br>" << std::endl;
5074 
5075  htmlFileM << "<h3> 1B: R vs phi , averaged over depthes & eta </h3>" << std::endl;
5076  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5077  if (sub == 1)
5078  htmlFileM << " <img src=\"Rhist1IterationMethodHB.png\" />" << std::endl;
5079  if (sub == 2)
5080  htmlFileM << " <img src=\"Rhist1IterationMethodHE.png\" />" << std::endl;
5081  if (sub == 3)
5082  htmlFileM << " <img src=\"Rhist1IterationMethodHO.png\" />" << std::endl;
5083  if (sub == 4)
5084  htmlFileM << " <img src=\"Rhist1IterationMethodHF.png\" />" << std::endl;
5085  htmlFileM << "<br>" << std::endl;
5086 
5088 
5089  htmlFileM << "<h3> 1C: R vs phi , different eta, Depth1 </h3>" << std::endl;
5090  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5091  if (sub == 1)
5092  htmlFileM << " <img src=\"Rhist1IterationMethodDepth1HB.png\" />" << std::endl;
5093  if (sub == 2)
5094  htmlFileM << " <img src=\"Rhist1IterationMethodDepth1HE.png\" />" << std::endl;
5095  if (sub == 4)
5096  htmlFileM << " <img src=\"Rhist1IterationMethodDepth1HF.png\" />" << std::endl;
5097  htmlFileM << "<br>" << std::endl;
5098 
5099  htmlFileM << "<h3> 1D: R vs phi , different eta, Depth2 </h3>" << std::endl;
5100  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5101  if (sub == 1)
5102  htmlFileM << " <img src=\"Rhist1IterationMethodDepth2HB.png\" />" << std::endl;
5103  if (sub == 2)
5104  htmlFileM << " <img src=\"Rhist1IterationMethodDepth2HE.png\" />" << std::endl;
5105  if (sub == 4)
5106  htmlFileM << " <img src=\"Rhist1IterationMethodDepth2HF.png\" />" << std::endl;
5107  htmlFileM << "<br>" << std::endl;
5108 
5109  htmlFileM << "<h3> 1E: R vs phi , different eta, Depth3 </h3>" << std::endl;
5110  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5111  if (sub == 1)
5112  htmlFileM << " <img src=\"Rhist1IterationMethodDepth3HB.png\" />" << std::endl;
5113  if (sub == 2)
5114  htmlFileM << " <img src=\"Rhist1IterationMethodDepth3HE.png\" />" << std::endl;
5115  if (sub == 4)
5116  htmlFileM << " <img src=\"Rhist1IterationMethodDepth3HF.png\" />" << std::endl;
5117  htmlFileM << "<br>" << std::endl;
5118 
5119  htmlFileM << "<h3> 1F: R vs phi , different eta, Depth4 </h3>" << std::endl;
5120  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5121  if (sub == 1)
5122  htmlFileM << " <img src=\"Rhist1IterationMethodDepth4HB.png\" />" << std::endl;
5123  if (sub == 2)
5124  htmlFileM << " <img src=\"Rhist1IterationMethodDepth4HE.png\" />" << std::endl;
5125  if (sub == 3)
5126  htmlFileM << " <img src=\"Rhist1IterationMethodDepth4HO.png\" />" << std::endl;
5127  if (sub == 4)
5128  htmlFileM << " <img src=\"Rhist1IterationMethodDepth4HF.png\" />" << std::endl;
5129  htmlFileM << "<br>" << std::endl;
5130 
5131  htmlFileM << "<h3> 1G: R vs phi , different eta, Depth5 </h3>" << std::endl;
5132  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5133  if (sub == 2)
5134  htmlFileM << " <img src=\"Rhist1IterationMethodDepth5HE.png\" />" << std::endl;
5135  htmlFileM << "<br>" << std::endl;
5136 
5137  htmlFileM << "<h3> 1H: R vs phi , different eta, Depth6 </h3>" << std::endl;
5138  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5139  if (sub == 2)
5140  htmlFileM << " <img src=\"Rhist1IterationMethodDepth6HE.png\" />" << std::endl;
5141  htmlFileM << "<br>" << std::endl;
5142 
5143  htmlFileM << "<h3> 1I: R vs phi , different eta, Depth7 </h3>" << std::endl;
5144  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5145  if (sub == 2)
5146  htmlFileM << " <img src=\"Rhist1IterationMethodDepth7HE.png\" />" << std::endl;
5147  htmlFileM << "<br>" << std::endl;
5148 
5149  htmlFileM << "<h2> 2: Positive direction, D(variance) </h3>" << std::endl;
5150 
5151  htmlFileM << "<h3> 2A: eta/phi-plot: D(variance), averaged over depthes </h3>" << std::endl;
5152  // htmlFileM << "<h4> Legend: Bins less "<<Pedest[0][sub]<<" correpond to bad Pedestals </h4>"<< std::endl;
5153  if (sub == 1)
5154  htmlFileM << " <img src=\"Dhist2IterationMethodHB.png\" />" << std::endl;
5155  if (sub == 2)
5156  htmlFileM << " <img src=\"Dhist2IterationMethodHE.png\" />" << std::endl;
5157  if (sub == 3)
5158  htmlFileM << " <img src=\"Dhist2IterationMethodHO.png\" />" << std::endl;
5159  if (sub == 4)
5160  htmlFileM << " <img src=\"Dhist2IterationMethodHF.png\" />" << std::endl;
5161  htmlFileM << "<br>" << std::endl;
5162 
5163  htmlFileM << "<h3> 2B: D(variance) vs phi , averaged over depthes & eta </h3>" << std::endl;
5164  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5165  if (sub == 1)
5166  htmlFileM << " <img src=\"Dhist1IterationMethodHB.png\" />" << std::endl;
5167  if (sub == 2)
5168  htmlFileM << " <img src=\"Dhist1IterationMethodHE.png\" />" << std::endl;
5169  if (sub == 3)
5170  htmlFileM << " <img src=\"Dhist1IterationMethodHO.png\" />" << std::endl;
5171  if (sub == 4)
5172  htmlFileM << " <img src=\"Dhist1IterationMethodHF.png\" />" << std::endl;
5173  htmlFileM << "<br>" << std::endl;
5174 
5176 
5177  htmlFileM << "<h3> 2C: D(variance) vs phi , different eta, Depth1 </h3>" << std::endl;
5178  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5179  if (sub == 1)
5180  htmlFileM << " <img src=\"Dhist1IterationMethodDepth1HB.png\" />" << std::endl;
5181  if (sub == 2)
5182  htmlFileM << " <img src=\"Dhist1IterationMethodDepth1HE.png\" />" << std::endl;
5183  if (sub == 4)
5184  htmlFileM << " <img src=\"Dhist1IterationMethodDepth1HF.png\" />" << std::endl;
5185  htmlFileM << "<br>" << std::endl;
5186 
5187  htmlFileM << "<h3> 2.D. D(variance) vs phi , different eta, Depth2 </h3>" << std::endl;
5188  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5189  if (sub == 1)
5190  htmlFileM << " <img src=\"Dhist1IterationMethodDepth2HB.png\" />" << std::endl;
5191  if (sub == 2)
5192  htmlFileM << " <img src=\"Dhist1IterationMethodDepth2HE.png\" />" << std::endl;
5193  if (sub == 4)
5194  htmlFileM << " <img src=\"Dhist1IterationMethodDepth2HF.png\" />" << std::endl;
5195  htmlFileM << "<br>" << std::endl;
5196 
5197  htmlFileM << "<h3> 2E: D(variance) vs phi , different eta, Depth3 </h3>" << std::endl;
5198  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5199  if (sub == 1)
5200  htmlFileM << " <img src=\"Dhist1IterationMethodDepth3HB.png\" />" << std::endl;
5201  if (sub == 2)
5202  htmlFileM << " <img src=\"Dhist1IterationMethodDepth3HE.png\" />" << std::endl;
5203  if (sub == 4)
5204  htmlFileM << " <img src=\"Dhist1IterationMethodDepth3HF.png\" />" << std::endl;
5205  htmlFileM << "<br>" << std::endl;
5206 
5207  htmlFileM << "<h3> 2F: D(variance) vs phi , different eta, Depth4 </h3>" << std::endl;
5208  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5209  if (sub == 1)
5210  htmlFileM << " <img src=\"Dhist1IterationMethodDepth4HB.png\" />" << std::endl;
5211  if (sub == 2)
5212  htmlFileM << " <img src=\"Dhist1IterationMethodDepth4HE.png\" />" << std::endl;
5213  if (sub == 3)
5214  htmlFileM << " <img src=\"Dhist1IterationMethodDepth4HO.png\" />" << std::endl;
5215  if (sub == 4)
5216  htmlFileM << " <img src=\"Dhist1IterationMethodDepth4HF.png\" />" << std::endl;
5217  htmlFileM << "<br>" << std::endl;
5218 
5219  htmlFileM << "<h3> 2G: D(variance) vs phi , different eta, Depth5 </h3>" << std::endl;
5220  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5221  if (sub == 2)
5222  htmlFileM << " <img src=\"Dhist1IterationMethodDepth5HE.png\" />" << std::endl;
5223  htmlFileM << "<br>" << std::endl;
5224 
5225  htmlFileM << "<h3> 2H: D(variance) vs phi , different eta, Depth6 </h3>" << std::endl;
5226  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5227  if (sub == 2)
5228  htmlFileM << " <img src=\"Dhist1IterationMethodDepth6HE.png\" />" << std::endl;
5229  htmlFileM << "<br>" << std::endl;
5230 
5231  htmlFileM << "<h3> 2I: D(variance) vs phi , different eta, Depth7 </h3>" << std::endl;
5232  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5233  if (sub == 2)
5234  htmlFileM << " <img src=\"Dhist1IterationMethodDepth7HE.png\" />" << std::endl;
5235  htmlFileM << "<br>" << std::endl;
5236 
5237  htmlFileM.close();
5238 
5240  //
5241  //
5242  } // end sub //for (int sub=1;sub<=4;sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
5243 
5244  //======================================================================
5245 
5246  std::cout << "********" << std::endl;
5247  std::cout << "************ Start creating subdet html pages: - rather long time needed, waiting please"
5248  << std::endl;
5249  //======================================================================
5250  // Creating subdet html pages:
5251 
5252  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
5253  ofstream htmlFile;
5254  if (sub == 1)
5255  htmlFile.open("HB.html");
5256  if (sub == 2)
5257  htmlFile.open("HE.html");
5258  if (sub == 3)
5259  htmlFile.open("HO.html");
5260  if (sub == 4)
5261  htmlFile.open("HF.html");
5262 
5263  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
5264  htmlFile << "<head>" << std::endl;
5265  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
5266  htmlFile << "<title> Remote Monitoring Tool </title>" << std::endl;
5267  htmlFile << "<style type=\"text/css\">" << std::endl;
5268  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
5269  << std::endl;
5270  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
5271  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
5272  "text-align: center;}"
5273  << std::endl;
5274  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
5275  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
5276  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
5277  htmlFile << " td.s5 { font-family: arial, arial ce, helvetica; background-color: #FF00FF; }" << std::endl;
5278  htmlFile << " td.s6 { font-family: arial, arial ce, helvetica; background-color: #9ACD32; }" << std::endl;
5279  htmlFile << " td.s7 { font-family: arial, arial ce, helvetica; background-color: #32CD32; }" << std::endl;
5280  htmlFile << " td.s8 { font-family: arial, arial ce, helvetica; background-color: #00FFFF; }" << std::endl;
5281  htmlFile << " td.s9 { font-family: arial, arial ce, helvetica; background-color: #FFE4E1; }" << std::endl;
5282  htmlFile << " td.s10 { font-family: arial, arial ce, helvetica; background-color: #A0522D; }" << std::endl;
5283  htmlFile << " td.s11 { font-family: arial, arial ce, helvetica; background-color: #1E90FF; }" << std::endl;
5284  htmlFile << " td.s12 { font-family: arial, arial ce, helvetica; background-color: #00BFFF; }" << std::endl;
5285  htmlFile << " td.s13 { font-family: arial, arial ce, helvetica; background-color: #FFFF00; }" << std::endl;
5286  htmlFile << " td.s14 { font-family: arial, arial ce, helvetica; background-color: #B8860B; }" << std::endl;
5287  htmlFile << "</style>" << std::endl;
5288  htmlFile << "<body>" << std::endl;
5289  if (sub == 1)
5290  htmlFile << "<h1> HCAL BARREL, RUN = " << runnumber << " </h1>" << std::endl;
5291  if (sub == 2)
5292  htmlFile << "<h1> HCAL ENDCAP, RUN = " << runnumber << " </h1>" << std::endl;
5293  if (sub == 3)
5294  htmlFile << "<h1> HCAL OUTER, RUN = " << runnumber << " </h1>" << std::endl;
5295  if (sub == 4)
5296  htmlFile << "<h1> HCAL FORWARD, RUN = " << runnumber << " </h1>" << std::endl;
5297  htmlFile << "<br>" << std::endl;
5298  if (sub == 1)
5299  htmlFile << "<h2> 1. Analysis results for HB</h2>" << std::endl;
5300  if (sub == 2)
5301  htmlFile << "<h2> 1. Analysis results for HE</h2>" << std::endl;
5302  if (sub == 3)
5303  htmlFile << "<h2> 1. Analysis results for HO</h2>" << std::endl;
5304  if (sub == 4)
5305  htmlFile << "<h2> 1. Analysis results for HF</h2>" << std::endl;
5306  htmlFile << "<table width=\"600\">" << std::endl;
5307  htmlFile << "<tr>" << std::endl;
5308 
5309  if (sub == 1) {
5310  htmlFile << " <td><a href=\"HB_Tile.html\">Megatile Channels</a></td>" << std::endl;
5311  htmlFile << " <td><a href=\"HB_Calib.html\">Calibration Channels</a></td>" << std::endl;
5312  htmlFile << " <td><a href=\"HB_Drift.html\">Gain Stability</a></td>" << std::endl;
5313  htmlFile << " <td><a href=\"HB_Pedestals.html\">Pedestals</a></td>" << std::endl;
5314  htmlFile << " <td><a href=\"HB_Shapes.html\">ADC Shapes</a></td>" << std::endl;
5315 
5316  /*
5317  htmlFile << " <td><a href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/RMT/LED_"<<runnumber<<"/HB_Tile.html\">Megatile Channels</a></td>"<< std::endl;
5318  htmlFile << " <td><a href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/RMT/LED_"<<runnumber<<"/HB_Calib.html\">Calibration Channels</a></td>"<< std::endl;
5319  htmlFile << " <td><a href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/RMT/LED_"<<runnumber<<"/HB_Drift.html\">Gain Stability</a></td>"<< std::endl;
5320  htmlFile << " <td><a href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/RMT/LED_"<<runnumber<<"/HB_Pedestals.html\">Pedestals</a></td>"<< std::endl;
5321  htmlFile << " <td><a href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/RMT/LED_"<<runnumber<<"/HB_Shapes.html\">ADC Shapes</a></td>"<< std::endl;
5322 */
5323  }
5324  if (sub == 2) {
5325  htmlFile << " <td><a href=\"HE_Tile.html\">Megatile Channels</a></td>" << std::endl;
5326  htmlFile << " <td><a href=\"HE_Calib.html\">Calibration Channels</a></td>" << std::endl;
5327  htmlFile << " <td><a href=\"HE_Drift.html\">Gain Stability</a></td>" << std::endl;
5328  htmlFile << " <td><a href=\"HE_Pedestals.html\">Pedestals</a></td>" << std::endl;
5329  htmlFile << " <td><a href=\"HE_Shapes.html\">ADC Shapes</a></td>" << std::endl;
5330  htmlFile << " <td><a href=\"HE_IterationMethod.html\">Iteration Method</a></td>" << std::endl;
5331 
5332  /*
5333  htmlFile << " <td><a href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/RMT/LED_"<<runnumber<<"/HE_Tile.html\">Megatile Channels</a></td>"<< std::endl;
5334  htmlFile << " <td><a href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/RMT/LED_"<<runnumber<<"/HE_Calib.html\">Calibration Channels</a></td>"<< std::endl;
5335  htmlFile << " <td><a href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/RMT/LED_"<<runnumber<<"/HE_Drift.html\">Gain Stability</a></td>"<< std::endl;
5336  htmlFile << " <td><a href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/RMT/LED_"<<runnumber<<"/HE_Pedestals.html\">Pedestals</a></td>"<< std::endl;
5337  htmlFile << " <td><a href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/RMT/LED_"<<runnumber<<"/HE_Shapes.html\">ADC Shapes</a></td>"<< std::endl;
5338  htmlFile << " <td><a href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/RMT/LED_"<<runnumber<<"/HE_IterationMethod.html\">Iteration Method</a></td>"<< std::endl;
5339 */
5340  }
5341  if (sub == 3) {
5342  /*
5343  htmlFile << " <td><a href=\"HO_Tile.html\">Megatile Channels</a></td>"<< std::endl;
5344  htmlFile << " <td><a href=\"HO_Calib.html\">Calibration Channels</a></td>"<< std::endl;
5345  htmlFile << " <td><a href=\"HO_Drift.html\">Gain Stability</a></td>"<< std::endl;
5346  htmlFile << " <td><a href=\"HO_Pedestals.html\">Pedestals</a></td>"<< std::endl;
5347  htmlFile << " <td><a href=\"HO_Shapes.html\">ADC Shapes</a></td>"<< std::endl;
5348  */
5349  htmlFile << " <td><a "
5350  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5351  "HcalRemoteMonitoring/RMT/LED_"
5352  << runnumber << "/HO_Tile.html\">Megatile Channels</a></td>" << std::endl;
5353  htmlFile << " <td><a "
5354  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5355  "HcalRemoteMonitoring/RMT/LED_"
5356  << runnumber << "/HO_Calib.html\">Calibration Channels</a></td>" << std::endl;
5357  htmlFile << " <td><a "
5358  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5359  "HcalRemoteMonitoring/RMT/LED_"
5360  << runnumber << "/HO_Drift.html\">Gain Stability</a></td>" << std::endl;
5361  htmlFile << " <td><a "
5362  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5363  "HcalRemoteMonitoring/RMT/LED_"
5364  << runnumber << "/HO_Pedestals.html\">Pedestals</a></td>" << std::endl;
5365  htmlFile << " <td><a "
5366  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5367  "HcalRemoteMonitoring/RMT/LED_"
5368  << runnumber << "/HO_Shapes.html\">ADC Shapes</a></td>" << std::endl;
5369  }
5370  if (sub == 4) {
5371  /*
5372  htmlFile << " <td><a href=\"HF_Tile.html\">Megatile Channels</a></td>"<< std::endl;
5373  htmlFile << " <td><a href=\"HF_Calib.html\">Calibration Channels</a></td>"<< std::endl;
5374  htmlFile << " <td><a href=\"HF_Drift.html\">Gain Stability</a></td>"<< std::endl;
5375  htmlFile << " <td><a href=\"HF_Pedestals.html\">Pedestals</a></td>"<< std::endl;
5376  htmlFile << " <td><a href=\"HF_Shapes.html\">ADC Shapes</a></td>"<< std::endl;
5377  */
5378  htmlFile << " <td><a "
5379  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5380  "HcalRemoteMonitoring/RMT/LED_"
5381  << runnumber << "/HF_Tile.html\">Megatile Channels</a></td>" << std::endl;
5382  htmlFile << " <td><a "
5383  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5384  "HcalRemoteMonitoring/RMT/LED_"
5385  << runnumber << "/HF_Calib.html\">Calibration Channels</a></td>" << std::endl;
5386  htmlFile << " <td><a "
5387  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5388  "HcalRemoteMonitoring/RMT/LED_"
5389  << runnumber << "/HF_Drift.html\">Gain Stability</a></td>" << std::endl;
5390  htmlFile << " <td><a "
5391  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5392  "HcalRemoteMonitoring/RMT/LED_"
5393  << runnumber << "/HF_Pedestals.html\">Pedestals</a></td>" << std::endl;
5394  htmlFile << " <td><a "
5395  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5396  "HcalRemoteMonitoring/RMT/LED_"
5397  << runnumber << "/HF_Shapes.html\">ADC Shapes</a></td>" << std::endl;
5398  }
5399 
5400  htmlFile << "</tr>" << std::endl;
5401  htmlFile << "</table>" << std::endl;
5402  htmlFile << "<br>" << std::endl;
5403  if (sub == 1)
5404  htmlFile << "<h2> 2.Status HB over all criteria </h2>" << std::endl;
5405  if (sub == 2)
5406  htmlFile << "<h2> 2.Status HE over all criteria </h2>" << std::endl;
5407  if (sub == 3)
5408  htmlFile << "<h2> 2.Status HO over all criteria </h2>" << std::endl;
5409  if (sub == 4)
5410  htmlFile << "<h2> 2.Status HF over all criteria </h2>" << std::endl;
5411  htmlFile << "<h3> 2.A.Channel map for each Depth </h3>" << std::endl;
5412  htmlFile << "<h4> Channel legend: green - good, red - bad (rate of failures at least 0.1), yellow - at least 2% "
5413  "gain drift, white - not applicable or out of range </h4>"
5414  << std::endl;
5415  if (sub == 1)
5416  htmlFile << " <img src=\"MAPHB.png\" />" << std::endl;
5417  if (sub == 2)
5418  htmlFile << " <img src=\"MAPHE.png\" />" << std::endl;
5419  if (sub == 3)
5420  htmlFile << " <img src=\"MAPHO.png\" />" << std::endl;
5421  if (sub == 4)
5422  htmlFile << " <img src=\"MAPHF.png\" />" << std::endl;
5423  htmlFile << "<br>" << std::endl;
5424 
5425  htmlFile << "<h3> 2.B.List of Bad channels (rate > 0.1) and its rates for each RMT criteria (for GS - %) </h3>"
5426  << std::endl;
5427 
5428  htmlFile << " <td><a href=\"HELP.html\"> Description of criteria for bad channel selection</a></td>" << std::endl;
5429  // htmlFile << " <td><a href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/RMT/LED_"<<runnumber<<"/HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
5430 
5431  htmlFile << "<table>" << std::endl;
5432  htmlFile << "<tr>";
5433  htmlFile << "<td class=\"s4\" align=\"center\">#</td>" << std::endl;
5434  htmlFile << "<td class=\"s1\" align=\"center\">ETA</td>" << std::endl;
5435  htmlFile << "<td class=\"s1\" align=\"center\">PHI</td>" << std::endl;
5436  htmlFile << "<td class=\"s1\" align=\"center\">DEPTH</td>" << std::endl;
5437  htmlFile << "<td class=\"s1\" align=\"center\">RBX</td>" << std::endl;
5438  htmlFile << "<td class=\"s1\" align=\"center\">RM</td>" << std::endl;
5439  htmlFile << "<td class=\"s1\" align=\"center\">PIXEL</td>" << std::endl;
5440  htmlFile << "<td class=\"s1\" align=\"center\">RM_FIBER</td>" << std::endl;
5441  htmlFile << "<td class=\"s1\" align=\"center\">FIBER_CH</td>" << std::endl;
5442  htmlFile << "<td class=\"s1\" align=\"center\">QIE</td>" << std::endl;
5443  htmlFile << "<td class=\"s1\" align=\"center\">ADC</td>" << std::endl;
5444  htmlFile << "<td class=\"s1\" align=\"center\">CRATE</td>" << std::endl;
5445  htmlFile << "<td class=\"s1\" align=\"center\">DCC</td>" << std::endl;
5446  htmlFile << "<td class=\"s1\" align=\"center\">SPIGOT</td>" << std::endl;
5447  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FIBER</td>" << std::endl;
5448  htmlFile << "<td class=\"s1\" align=\"center\">HTR_SLOT</td>" << std::endl;
5449  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FPGA</td>" << std::endl;
5450  htmlFile << "<td class=\"s5\" align=\"center\">Cm</td>" << std::endl;
5451  htmlFile << "<td class=\"s5\" align=\"center\">Am</td>" << std::endl;
5452  htmlFile << "<td class=\"s5\" align=\"center\">Wm</td>" << std::endl;
5453  htmlFile << "<td class=\"s5\" align=\"center\">Rm</td>" << std::endl;
5454  htmlFile << "<td class=\"s5\" align=\"center\">TNm</td>" << std::endl;
5455  htmlFile << "<td class=\"s5\" align=\"center\">TXm</td>" << std::endl;
5456  htmlFile << "<td class=\"s9\" align=\"center\">GS (%)</td>" << std::endl;
5457  htmlFile << "<td class=\"s4\" align=\"center\">Pm</td>" << std::endl;
5458  htmlFile << "<td class=\"s4\" align=\"center\">pWm</td>" << std::endl;
5459  htmlFile << "<td class=\"s8\" align=\"center\">Cc</td>" << std::endl;
5460  htmlFile << "<td class=\"s8\" align=\"center\">Ac</td>" << std::endl;
5461  htmlFile << "<td class=\"s8\" align=\"center\">Wc</td>" << std::endl;
5462  htmlFile << "<td class=\"s8\" align=\"center\">Rc</td>" << std::endl;
5463  htmlFile << "<td class=\"s8\" align=\"center\">TNc</td>" << std::endl;
5464  htmlFile << "<td class=\"s8\" align=\"center\">TXc</td>" << std::endl;
5465 
5466  htmlFile << "</tr>" << std::endl;
5467 
5468  for (int i = 1; i <= NBad; i++) {
5469  if ((ind % 2) == 1) {
5470  raw_class = "<td class=\"s2\" align=\"center\">";
5471  raw_class1 = "<td class=\"s6\" align=\"center\">";
5472  raw_class2 = "<td class=\"s11\" align=\"center\">";
5473  raw_class3 = "<td class=\"s13\" align=\"center\">";
5474 
5475  } else {
5476  raw_class = "<td class=\"s3\" align=\"center\">";
5477  raw_class1 = "<td class=\"s7\" align=\"center\">";
5478  raw_class2 = "<td class=\"s12\" align=\"center\">";
5479  raw_class3 = "<td class=\"s14\" align=\"center\">";
5480  }
5481  const CellDB db;
5482  CellDB ce;
5483  if ((ce.size() >= 1) && (Sub[2][i] == sub)) {
5484  if (Sub[2][i] == 1) {
5485  ce = db.find("subdet", "HB").find("Eta", Eta[2][i]).find("Phi", Phi[2][i]).find("Depth", Depth[2][i]);
5486  if (ce.size() == 0) {
5487  // cout<<"Error: No such HB, Eta="<< Eta[2][i] <<", Phi="<< Phi[2][i] <<", Depth="<< Depth[2][i] <<" in database"<<endl;
5488  continue;
5489  } else if (ce.size() > 1) {
5490  cout << "Warning: More than one line correspond to such HB, Eta=" << Eta[2][i] << ", Phi=" << Phi[2][i]
5491  << ", Depth=" << Depth[2][i] << " in database" << endl;
5492  }
5493  }
5494  if (Sub[2][i] == 2) {
5495  ce = db.find("subdet", "HE").find("Eta", Eta[2][i]).find("Phi", Phi[2][i]).find("Depth", Depth[2][i]);
5496  if (ce.size() == 0) {
5497  // cout<<"Error: No such HE, Eta="<< Eta[2][i] <<", Phi="<< Phi[2][i] <<", Depth="<< Depth[2][i] <<" in database"<<endl;
5498  continue;
5499  } else if (ce.size() > 1) {
5500  cout << "Warning: More than one line correspond to such HE, Eta=" << Eta[2][i] << ", Phi=" << Phi[2][i]
5501  << ", Depth=" << Depth[2][i] << " in database" << endl;
5502  }
5503  }
5504  if (Sub[2][i] == 3) {
5505  ce = db.find("subdet", "HO").find("Eta", Eta[2][i]).find("Phi", Phi[2][i]).find("Depth", Depth[2][i]);
5506  if (ce.size() == 0) {
5507  // cout<<"Error: No such HO, Eta="<< Eta[2][i] <<", Phi="<< Phi[2][i] <<", Depth="<< Depth[2][i] <<" in database"<<endl;
5508  continue;
5509  } else if (ce.size() > 1) {
5510  cout << "Warning: More than one line correspond to such HO, Eta=" << Eta[2][i] << ", Phi=" << Phi[2][i]
5511  << ", Depth=" << Depth[2][i] << " in database" << endl;
5512  }
5513  }
5514  if (Sub[2][i] == 4) {
5515  ce = db.find("subdet", "HF").find("Eta", Eta[2][i]).find("Phi", Phi[2][i]).find("Depth", Depth[2][i]);
5516  if (ce.size() == 0) {
5517  // cout<<"Error: No such HF, Eta="<< Eta[2][i] <<", Phi="<< Phi[2][i] <<", Depth="<< Depth[2][i] <<" in database"<<endl;
5518  continue;
5519  } else if (ce.size() > 1) {
5520  cout << "Warning: More than one line correspond to such HF, Eta=" << Eta[2][i] << ", Phi=" << Phi[2][i]
5521  << ", Depth=" << Depth[2][i] << " in database" << endl;
5522  }
5523  }
5524  htmlFile << "<tr>" << std::endl;
5525  htmlFile << "<td class=\"s4\" align=\"center\">" << ind + 1 << "</td>" << std::endl;
5526  htmlFile << raw_class << Eta[2][i] << "</td>" << std::endl;
5527  htmlFile << raw_class << Phi[2][i] << "</td>" << std::endl;
5528  htmlFile << raw_class << Depth[2][i] << "</td>" << std::endl;
5529  htmlFile << raw_class << ce[0].RBX << "</td>" << std::endl;
5530  htmlFile << raw_class << ce[0].RM << "</td>" << std::endl;
5531  htmlFile << raw_class << ce[0].Pixel << "</td>" << std::endl;
5532  htmlFile << raw_class << ce[0].RMfiber << "</td>" << std::endl;
5533  htmlFile << raw_class << ce[0].FiberCh << "</td>" << std::endl;
5534  htmlFile << raw_class << ce[0].QIE << "</td>" << std::endl;
5535  htmlFile << raw_class << ce[0].ADC << "</td>" << std::endl;
5536  htmlFile << raw_class << ce[0].VMECardID << "</td>" << std::endl;
5537  htmlFile << raw_class << ce[0].dccID << "</td>" << std::endl;
5538  htmlFile << raw_class << ce[0].Spigot << "</td>" << std::endl;
5539  htmlFile << raw_class << ce[0].FiberIndex << "</td>" << std::endl;
5540  htmlFile << raw_class << ce[0].HtrSlot << "</td>" << std::endl;
5541  htmlFile << raw_class << ce[0].HtrTB << "</td>" << std::endl;
5542  htmlFile << raw_class1 << Map_Ampl[1][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5543  << "</td>" << std::endl;
5544  htmlFile << raw_class1 << Map_Ampl[2][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5545  << "</td>" << std::endl;
5546  htmlFile << raw_class1 << Map_Ampl[3][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5547  << "</td>" << std::endl;
5548  htmlFile << raw_class1 << Map_Ampl[4][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5549  << "</td>" << std::endl;
5550  htmlFile << raw_class1 << Map_Ampl[5][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5551  << "</td>" << std::endl;
5552  htmlFile << raw_class1 << Map_Ampl[6][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5553  << "</td>" << std::endl;
5554  htmlFile << raw_class3 << Map_Ampl[21][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5555  << "</td>" << std::endl;
5556  htmlFile << raw_class << Map_Ampl[31][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5557  << "</td>" << std::endl;
5558  htmlFile << raw_class << Map_Ampl[32][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5559  << "</td>" << std::endl;
5560  htmlFile << raw_class2 << Map_Ampl[11][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5561  << "</td>" << std::endl;
5562  htmlFile << raw_class2 << Map_Ampl[12][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5563  << "</td>" << std::endl;
5564  htmlFile << raw_class2 << Map_Ampl[13][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5565  << "</td>" << std::endl;
5566  htmlFile << raw_class2 << Map_Ampl[14][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5567  << "</td>" << std::endl;
5568  htmlFile << raw_class2 << Map_Ampl[15][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5569  << "</td>" << std::endl;
5570  htmlFile << raw_class2 << Map_Ampl[16][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5571  << "</td>" << std::endl;
5572  htmlFile << "</tr>" << std::endl;
5573 
5574  ind += 1;
5575  }
5576  }
5577  htmlFile << "</table>" << std::endl;
5578  htmlFile << "<br>" << std::endl;
5579 
5580  htmlFile << "<h3> 2.C.List of Gain unstable channels and its value in % (for other criterias - rate)</h3>"
5581  << std::endl;
5582  htmlFile << "<table>" << std::endl;
5583  htmlFile << "<tr>";
5584  htmlFile << "<td class=\"s4\" align=\"center\">#</td>" << std::endl;
5585  htmlFile << "<td class=\"s1\" align=\"center\">ETA</td>" << std::endl;
5586  htmlFile << "<td class=\"s1\" align=\"center\">PHI</td>" << std::endl;
5587  htmlFile << "<td class=\"s1\" align=\"center\">DEPTH</td>" << std::endl;
5588  htmlFile << "<td class=\"s1\" align=\"center\">RBX</td>" << std::endl;
5589  htmlFile << "<td class=\"s1\" align=\"center\">RM</td>" << std::endl;
5590  htmlFile << "<td class=\"s1\" align=\"center\">PIXEL</td>" << std::endl;
5591  htmlFile << "<td class=\"s1\" align=\"center\">RM_FIBER</td>" << std::endl;
5592  htmlFile << "<td class=\"s1\" align=\"center\">FIBER_CH</td>" << std::endl;
5593  htmlFile << "<td class=\"s1\" align=\"center\">QIE</td>" << std::endl;
5594  htmlFile << "<td class=\"s1\" align=\"center\">ADC</td>" << std::endl;
5595  htmlFile << "<td class=\"s1\" align=\"center\">CRATE</td>" << std::endl;
5596  htmlFile << "<td class=\"s1\" align=\"center\">DCC</td>" << std::endl;
5597  htmlFile << "<td class=\"s1\" align=\"center\">SPIGOT</td>" << std::endl;
5598  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FIBER</td>" << std::endl;
5599  htmlFile << "<td class=\"s1\" align=\"center\">HTR_SLOT</td>" << std::endl;
5600  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FPGA</td>" << std::endl;
5601  htmlFile << "<td class=\"s5\" align=\"center\">Cm</td>" << std::endl;
5602  htmlFile << "<td class=\"s5\" align=\"center\">Am</td>" << std::endl;
5603  htmlFile << "<td class=\"s5\" align=\"center\">Wm</td>" << std::endl;
5604  htmlFile << "<td class=\"s5\" align=\"center\">Rm</td>" << std::endl;
5605  htmlFile << "<td class=\"s5\" align=\"center\">TNm</td>" << std::endl;
5606  htmlFile << "<td class=\"s5\" align=\"center\">TXm</td>" << std::endl;
5607  htmlFile << "<td class=\"s9\" align=\"center\">GS(%)</td>" << std::endl;
5608  htmlFile << "<td class=\"s4\" align=\"center\">Pm</td>" << std::endl;
5609  htmlFile << "<td class=\"s4\" align=\"center\">pWm</td>" << std::endl;
5610  htmlFile << "<td class=\"s8\" align=\"center\">Cc</td>" << std::endl;
5611  htmlFile << "<td class=\"s8\" align=\"center\">Ac</td>" << std::endl;
5612  htmlFile << "<td class=\"s8\" align=\"center\">Wc</td>" << std::endl;
5613  htmlFile << "<td class=\"s8\" align=\"center\">Rc</td>" << std::endl;
5614  htmlFile << "<td class=\"s8\" align=\"center\">TNc</td>" << std::endl;
5615  htmlFile << "<td class=\"s8\" align=\"center\">TXc</td>" << std::endl;
5616  htmlFile << "</tr>" << std::endl;
5617 
5618  for (int i = 1; i <= NWarn; i++) {
5619  if ((ind % 2) == 1) {
5620  raw_class = "<td class=\"s2\" align=\"center\">";
5621  raw_class1 = "<td class=\"s6\" align=\"center\">";
5622  raw_class2 = "<td class=\"s11\" align=\"center\">";
5623  raw_class3 = "<td class=\"s13\" align=\"center\">";
5624 
5625  } else {
5626  raw_class = "<td class=\"s3\" align=\"center\">";
5627  raw_class1 = "<td class=\"s7\" align=\"center\">";
5628  raw_class2 = "<td class=\"s12\" align=\"center\">";
5629  raw_class3 = "<td class=\"s14\" align=\"center\">";
5630  }
5631  const CellDB db;
5632  CellDB ce;
5633  if ((ce.size() >= 1) && (Sub[1][i] == sub)) {
5634  if (Sub[1][i] == 1) {
5635  ce = db.find("subdet", "HB").find("Eta", Eta[1][i]).find("Phi", Phi[1][i]).find("Depth", Depth[1][i]);
5636  if (ce.size() == 0) {
5637  // cout<<"Error: No such HB, Eta="<< Eta[1][i] <<", Phi="<< Phi[1][i] <<", Depth="<< Depth[1][i] <<" in database"<<endl;
5638  continue;
5639  } else if (ce.size() > 1) {
5640  cout << "Warning: More than one line correspond to such HB, Eta=" << Eta[1][i] << ", Phi=" << Phi[1][i]
5641  << ", Depth=" << Depth[1][i] << " in database" << endl;
5642  }
5643  }
5644  if (Sub[1][i] == 2) {
5645  ce = db.find("subdet", "HE").find("Eta", Eta[1][i]).find("Phi", Phi[1][i]).find("Depth", Depth[1][i]);
5646  if (ce.size() == 0) {
5647  // cout<<"Error: No such HE, Eta="<< Eta[1][i] <<", Phi="<< Phi[1][i] <<", Depth="<< Depth[1][i] <<" in database"<<endl;
5648  continue;
5649  } else if (ce.size() > 1) {
5650  cout << "Warning: More than one line correspond to such HE, Eta=" << Eta[1][i] << ", Phi=" << Phi[1][i]
5651  << ", Depth=" << Depth[1][i] << " in database" << endl;
5652  }
5653  }
5654  if (Sub[1][i] == 3) {
5655  ce = db.find("subdet", "HO").find("Eta", Eta[1][i]).find("Phi", Phi[1][i]).find("Depth", Depth[1][i]);
5656  if (ce.size() == 0) {
5657  // cout<<"Error: No such HO, Eta="<< Eta[1][i] <<", Phi="<< Phi[1][i] <<", Depth="<< Depth[1][i] <<" in database"<<endl;
5658  continue;
5659  } else if (ce.size() > 1) {
5660  cout << "Warning: More than one line correspond to such HO, Eta=" << Eta[1][i] << ", Phi=" << Phi[1][i]
5661  << ", Depth=" << Depth[1][i] << " in database" << endl;
5662  }
5663  }
5664  if (Sub[1][i] == 4) {
5665  ce = db.find("subdet", "HF").find("Eta", Eta[1][i]).find("Phi", Phi[1][i]).find("Depth", Depth[1][i]);
5666  if (ce.size() == 0) {
5667  // cout<<"Error: No such HF, Eta="<< Eta[1][i] <<", Phi="<< Phi[1][i] <<", Depth="<< Depth[1][i] <<" in database"<<endl;
5668  continue;
5669  } else if (ce.size() > 1) {
5670  cout << "Warning: More than one line correspond to such HF, Eta=" << Eta[1][i] << ", Phi=" << Phi[1][i]
5671  << ", Depth=" << Depth[1][i] << " in database" << endl;
5672  }
5673  }
5674  htmlFile << "<td class=\"s4\" align=\"center\">" << ind + 1 << "</td>" << std::endl;
5675  htmlFile << raw_class << Eta[1][i] << "</td>" << std::endl;
5676  htmlFile << raw_class << Phi[1][i] << "</td>" << std::endl;
5677  htmlFile << raw_class << Depth[1][i] << "</td>" << std::endl;
5678  htmlFile << raw_class << ce[0].RBX << "</td>" << std::endl;
5679  htmlFile << raw_class << ce[0].RM << "</td>" << std::endl;
5680  htmlFile << raw_class << ce[0].Pixel << "</td>" << std::endl;
5681  htmlFile << raw_class << ce[0].RMfiber << "</td>" << std::endl;
5682  htmlFile << raw_class << ce[0].FiberCh << "</td>" << std::endl;
5683  htmlFile << raw_class << ce[0].QIE << "</td>" << std::endl;
5684  htmlFile << raw_class << ce[0].ADC << "</td>" << std::endl;
5685  htmlFile << raw_class << ce[0].VMECardID << "</td>" << std::endl;
5686  htmlFile << raw_class << ce[0].dccID << "</td>" << std::endl;
5687  htmlFile << raw_class << ce[0].Spigot << "</td>" << std::endl;
5688  htmlFile << raw_class << ce[0].FiberIndex << "</td>" << std::endl;
5689  htmlFile << raw_class << ce[0].HtrSlot << "</td>" << std::endl;
5690  htmlFile << raw_class << ce[0].HtrTB << "</td>" << std::endl;
5691  htmlFile << raw_class1 << Map_Ampl[1][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5692  << "</td>" << std::endl;
5693  htmlFile << raw_class1 << Map_Ampl[2][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5694  << "</td>" << std::endl;
5695  htmlFile << raw_class1 << Map_Ampl[3][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5696  << "</td>" << std::endl;
5697  htmlFile << raw_class1 << Map_Ampl[4][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5698  << "</td>" << std::endl;
5699  htmlFile << raw_class1 << Map_Ampl[5][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5700  << "</td>" << std::endl;
5701  htmlFile << raw_class1 << Map_Ampl[6][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5702  << "</td>" << std::endl;
5703  htmlFile << raw_class3 << Map_Ampl[21][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5704  << "</td>" << std::endl;
5705  htmlFile << raw_class << Map_Ampl[31][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5706  << "</td>" << std::endl;
5707  htmlFile << raw_class << Map_Ampl[32][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5708  << "</td>" << std::endl;
5709  htmlFile << raw_class2 << Map_Ampl[11][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5710  << "</td>" << std::endl;
5711  htmlFile << raw_class2 << Map_Ampl[12][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5712  << "</td>" << std::endl;
5713  htmlFile << raw_class2 << Map_Ampl[13][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5714  << "</td>" << std::endl;
5715  htmlFile << raw_class2 << Map_Ampl[14][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5716  << "</td>" << std::endl;
5717  htmlFile << raw_class2 << Map_Ampl[15][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5718  << "</td>" << std::endl;
5719  htmlFile << raw_class2 << Map_Ampl[16][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5720  << "</td>" << std::endl;
5721  htmlFile << "</tr>" << std::endl;
5722  htmlFile << "</tr>" << std::endl;
5723  ind += 1;
5724  }
5725  }
5726  htmlFile << "</table>" << std::endl;
5727  htmlFile << "<br>" << std::endl;
5728 
5729  htmlFile << "<h3> 2.D.List of channels with Bad Pedestals (rate > 0.1) and its rates (for GS - %)</h3>"
5730  << std::endl;
5731  htmlFile << "<table>" << std::endl;
5732  htmlFile << "<tr>";
5733  htmlFile << "<td class=\"s4\" align=\"center\">#</td>" << std::endl;
5734  htmlFile << "<td class=\"s1\" align=\"center\">ETA</td>" << std::endl;
5735  htmlFile << "<td class=\"s1\" align=\"center\">PHI</td>" << std::endl;
5736  htmlFile << "<td class=\"s1\" align=\"center\">DEPTH</td>" << std::endl;
5737  htmlFile << "<td class=\"s1\" align=\"center\">RBX</td>" << std::endl;
5738  htmlFile << "<td class=\"s1\" align=\"center\">RM</td>" << std::endl;
5739  htmlFile << "<td class=\"s1\" align=\"center\">PIXEL</td>" << std::endl;
5740  htmlFile << "<td class=\"s1\" align=\"center\">RM_FIBER</td>" << std::endl;
5741  htmlFile << "<td class=\"s1\" align=\"center\">FIBER_CH</td>" << std::endl;
5742  htmlFile << "<td class=\"s1\" align=\"center\">QIE</td>" << std::endl;
5743  htmlFile << "<td class=\"s1\" align=\"center\">ADC</td>" << std::endl;
5744  htmlFile << "<td class=\"s1\" align=\"center\">CRATE</td>" << std::endl;
5745  htmlFile << "<td class=\"s1\" align=\"center\">DCC</td>" << std::endl;
5746  htmlFile << "<td class=\"s1\" align=\"center\">SPIGOT</td>" << std::endl;
5747  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FIBER</td>" << std::endl;
5748  htmlFile << "<td class=\"s1\" align=\"center\">HTR_SLOT</td>" << std::endl;
5749  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FPGA</td>" << std::endl;
5750  htmlFile << "<td class=\"s5\" align=\"center\">Cm</td>" << std::endl;
5751  htmlFile << "<td class=\"s5\" align=\"center\">Am</td>" << std::endl;
5752  htmlFile << "<td class=\"s5\" align=\"center\">Wm</td>" << std::endl;
5753  htmlFile << "<td class=\"s5\" align=\"center\">Rm</td>" << std::endl;
5754  htmlFile << "<td class=\"s5\" align=\"center\">TNm</td>" << std::endl;
5755  htmlFile << "<td class=\"s5\" align=\"center\">TXm</td>" << std::endl;
5756  htmlFile << "<td class=\"s9\" align=\"center\">GS(%)</td>" << std::endl;
5757  htmlFile << "<td class=\"s4\" align=\"center\">Pm</td>" << std::endl;
5758  htmlFile << "<td class=\"s4\" align=\"center\">pWm</td>" << std::endl;
5759  htmlFile << "<td class=\"s8\" align=\"center\">Cc</td>" << std::endl;
5760  htmlFile << "<td class=\"s8\" align=\"center\">Ac</td>" << std::endl;
5761  htmlFile << "<td class=\"s8\" align=\"center\">Wc</td>" << std::endl;
5762  htmlFile << "<td class=\"s8\" align=\"center\">Rc</td>" << std::endl;
5763  htmlFile << "<td class=\"s8\" align=\"center\">TNc</td>" << std::endl;
5764  htmlFile << "<td class=\"s8\" align=\"center\">TXc</td>" << std::endl;
5765  htmlFile << "</tr>" << std::endl;
5766 
5767  for (int i = 1; i <= NPed; i++) {
5768  if ((ind % 2) == 1) {
5769  raw_class = "<td class=\"s2\" align=\"center\">";
5770  raw_class1 = "<td class=\"s6\" align=\"center\">";
5771  raw_class2 = "<td class=\"s11\" align=\"center\">";
5772  raw_class3 = "<td class=\"s13\" align=\"center\">";
5773 
5774  } else {
5775  raw_class = "<td class=\"s3\" align=\"center\">";
5776  raw_class1 = "<td class=\"s7\" align=\"center\">";
5777  raw_class2 = "<td class=\"s12\" align=\"center\">";
5778  raw_class3 = "<td class=\"s14\" align=\"center\">";
5779  }
5780  const CellDB db;
5781  CellDB ce;
5782  if ((ce.size() >= 1) && (Sub[3][i] == sub)) {
5783  if (Sub[3][i] == 1) {
5784  ce = db.find("subdet", "HB").find("Eta", Eta[3][i]).find("Phi", Phi[3][i]).find("Depth", Depth[3][i]);
5785  if (ce.size() == 0) {
5786  // cout<<"Error: No such HB, Eta="<< Eta[3][i] <<", Phi="<< Phi[3][i] <<", Depth="<< Depth[3][i] <<" in database"<<endl;
5787  continue;
5788  } else if (ce.size() > 1) {
5789  cout << "Warning: More than one line correspond to such HB, Eta=" << Eta[3][i] << ", Phi=" << Phi[3][i]
5790  << ", Depth=" << Depth[3][i] << " in database" << endl;
5791  }
5792  }
5793  if (Sub[3][i] == 2) {
5794  ce = db.find("subdet", "HE").find("Eta", Eta[3][i]).find("Phi", Phi[3][i]).find("Depth", Depth[3][i]);
5795  if (ce.size() == 0) {
5796  // cout<<"Error: No such HE, Eta="<< Eta[3][i] <<", Phi="<< Phi[3][i] <<", Depth="<< Depth[3][i] <<" in database"<<endl;
5797  continue;
5798  } else if (ce.size() > 1) {
5799  cout << "Warning: More than one line correspond to such HE, Eta=" << Eta[3][i] << ", Phi=" << Phi[3][i]
5800  << ", Depth=" << Depth[3][i] << " in database" << endl;
5801  }
5802  }
5803  if (Sub[3][i] == 3) {
5804  ce = db.find("subdet", "HO").find("Eta", Eta[3][i]).find("Phi", Phi[3][i]).find("Depth", Depth[3][i]);
5805  if (ce.size() == 0) {
5806  // cout<<"Error: No such HO, Eta="<< Eta[3][i] <<", Phi="<< Phi[3][i] <<", Depth="<< Depth[3][i] <<" in database"<<endl;
5807  continue;
5808  } else if (ce.size() > 1) {
5809  cout << "Warning: More than one line correspond to such HO, Eta=" << Eta[3][i] << ", Phi=" << Phi[3][i]
5810  << ", Depth=" << Depth[3][i] << " in database" << endl;
5811  }
5812  }
5813  if (Sub[3][i] == 4) {
5814  ce = db.find("subdet", "HF").find("Eta", Eta[3][i]).find("Phi", Phi[3][i]).find("Depth", Depth[3][i]);
5815  if (ce.size() == 0) {
5816  // cout<<"Error: No such HF, Eta="<< Eta[3][i] <<", Phi="<< Phi[3][i] <<", Depth="<< Depth[3][i] <<" in database"<<endl;
5817  continue;
5818  } else if (ce.size() > 1) {
5819  cout << "Warning: More than one line correspond to such HF, Eta=" << Eta[3][i] << ", Phi=" << Phi[3][i]
5820  << ", Depth=" << Depth[3][i] << " in database" << endl;
5821  }
5822  }
5823  htmlFile << "<td class=\"s4\" align=\"center\">" << ind + 1 << "</td>" << std::endl;
5824  htmlFile << raw_class << Eta[3][i] << "</td>" << std::endl;
5825  htmlFile << raw_class << Phi[3][i] << "</td>" << std::endl;
5826  htmlFile << raw_class << Depth[3][i] << "</td>" << std::endl;
5827  htmlFile << raw_class << ce[0].RBX << "</td>" << std::endl;
5828  htmlFile << raw_class << ce[0].RM << "</td>" << std::endl;
5829  htmlFile << raw_class << ce[0].Pixel << "</td>" << std::endl;
5830  htmlFile << raw_class << ce[0].RMfiber << "</td>" << std::endl;
5831  htmlFile << raw_class << ce[0].FiberCh << "</td>" << std::endl;
5832  htmlFile << raw_class << ce[0].QIE << "</td>" << std::endl;
5833  htmlFile << raw_class << ce[0].ADC << "</td>" << std::endl;
5834  htmlFile << raw_class << ce[0].VMECardID << "</td>" << std::endl;
5835  htmlFile << raw_class << ce[0].dccID << "</td>" << std::endl;
5836  htmlFile << raw_class << ce[0].Spigot << "</td>" << std::endl;
5837  htmlFile << raw_class << ce[0].FiberIndex << "</td>" << std::endl;
5838  htmlFile << raw_class << ce[0].HtrSlot << "</td>" << std::endl;
5839  htmlFile << raw_class << ce[0].HtrTB << "</td>" << std::endl;
5840  htmlFile << raw_class1 << Map_Ampl[1][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5841  << "</td>" << std::endl;
5842  htmlFile << raw_class1 << Map_Ampl[2][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5843  << "</td>" << std::endl;
5844  htmlFile << raw_class1 << Map_Ampl[3][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5845  << "</td>" << std::endl;
5846  htmlFile << raw_class1 << Map_Ampl[4][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5847  << "</td>" << std::endl;
5848  htmlFile << raw_class1 << Map_Ampl[5][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5849  << "</td>" << std::endl;
5850  htmlFile << raw_class1 << Map_Ampl[6][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5851  << "</td>" << std::endl;
5852  htmlFile << raw_class3 << Map_Ampl[21][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5853  << "</td>" << std::endl;
5854  htmlFile << raw_class << Map_Ampl[31][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5855  << "</td>" << std::endl;
5856  htmlFile << raw_class << Map_Ampl[32][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5857  << "</td>" << std::endl;
5858  htmlFile << raw_class2 << Map_Ampl[11][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5859  << "</td>" << std::endl;
5860  htmlFile << raw_class2 << Map_Ampl[12][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5861  << "</td>" << std::endl;
5862  htmlFile << raw_class2 << Map_Ampl[13][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5863  << "</td>" << std::endl;
5864  htmlFile << raw_class2 << Map_Ampl[14][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5865  << "</td>" << std::endl;
5866  htmlFile << raw_class2 << Map_Ampl[15][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5867  << "</td>" << std::endl;
5868  htmlFile << raw_class2 << Map_Ampl[16][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5869  << "</td>" << std::endl;
5870  htmlFile << "</tr>" << std::endl;
5871  htmlFile << "</tr>" << std::endl;
5872  ind += 1;
5873  }
5874  }
5875  htmlFile << "</table>" << std::endl;
5876 
5877  htmlFile << "</body> " << std::endl;
5878  htmlFile << "</html> " << std::endl;
5879  htmlFile.close();
5880  }
5881 
5882  //======================================================================
5883 
5884  std::cout << "********" << std::endl;
5885  std::cout << "************ Start creating description HELP html file:" << std::endl;
5886  //======================================================================
5887  // Creating description html file:
5888  ofstream htmlFile;
5889  htmlFile.open("HELP.html");
5890  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
5891  htmlFile << "<head>" << std::endl;
5892  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
5893  htmlFile << "<title> Remote Monitoring Tool </title>" << std::endl;
5894  htmlFile << "<style type=\"text/css\">" << std::endl;
5895  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
5896  << std::endl;
5897  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
5898  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
5899  "text-align: center;}"
5900  << std::endl;
5901  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
5902  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
5903  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
5904  htmlFile << "</style>" << std::endl;
5905  htmlFile << "<body>" << std::endl;
5906  htmlFile << "<h1> Description of Remote Monitoring Tool criteria for bad channel selection</h1>" << std::endl;
5907  htmlFile << "<br>" << std::endl;
5908  htmlFile << "<h3> - C means CAPID Errors assuming we inspect CAPID non-rotation,error & validation bits, and for "
5909  "this criterion - no need to apply any cuts to select bcs.</h3> "
5910  << std::endl;
5911  htmlFile << "<br>" << std::endl;
5912  htmlFile << "<h3> - A means full amplitude, collected over all time slices </h3> " << std::endl;
5913  htmlFile << "<h3> - R means ratio criterion where we define as a bad, the channels, for which the signal portion in "
5914  "4 middle TSs(plus one, minus two around TS with maximal amplitude) is out of some range of reasonable "
5915  "values </h3> "
5916  << std::endl;
5917  htmlFile << "<br>" << std::endl;
5918  htmlFile << "<h3> - W means width of shape distribution. Width is defined as square root from dispersion. </h3> "
5919  << std::endl;
5920  htmlFile << "<br>" << std::endl;
5921  htmlFile << "<h3> - TN means mean time position of adc signal. </h3> " << std::endl;
5922  htmlFile << "<br>" << std::endl;
5923  htmlFile << "<h3> - TX means TS number of maximum signal </h3> " << std::endl;
5924  htmlFile << "<br>" << std::endl;
5925  htmlFile << "<h3> - m means megatile channels. For example Am means Amplitude criteria for megatile channels </h3> "
5926  << std::endl;
5927  htmlFile << "<br>" << std::endl;
5928  htmlFile
5929  << "<h3> - c means calibration channels. For example Ac means Amplitude criteria for calibration channels </h3> "
5930  << std::endl;
5931  htmlFile << "<br>" << std::endl;
5932  htmlFile << "<h3> - Pm means Pedestals. </h3> " << std::endl;
5933  htmlFile << "<br>" << std::endl;
5934  htmlFile << "<h3> - pWm means pedestal Width. </h3> " << std::endl;
5935  htmlFile << "<br>" << std::endl;
5936  htmlFile << "</body> " << std::endl;
5937  htmlFile << "</html> " << std::endl;
5938  htmlFile.close();
5939 
5940  //======================================================================
5941 
5942  std::cout << "********" << std::endl;
5943  std::cout << "************ Start creating MAP html file: - rather long time needed, waiting please" << std::endl;
5944  //======================================================================
5945  // Creating main html file:
5946  htmlFile.open("MAP.html");
5947  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
5948  htmlFile << "<head>" << std::endl;
5949  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
5950  htmlFile << "<title> Remote Monitoring Tool </title>" << std::endl;
5951  htmlFile << "<style type=\"text/css\">" << std::endl;
5952  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
5953  << std::endl;
5954  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
5955  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
5956  "text-align: center;}"
5957  << std::endl;
5958  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
5959  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
5960  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
5961  htmlFile << " td.s5 { font-family: arial, arial ce, helvetica; background-color: #FF00FF; }" << std::endl;
5962  htmlFile << " td.s6 { font-family: arial, arial ce, helvetica; background-color: #9ACD32; }" << std::endl;
5963  htmlFile << " td.s7 { font-family: arial, arial ce, helvetica; background-color: #32CD32; }" << std::endl;
5964  htmlFile << "</style>" << std::endl;
5965  htmlFile << "<body>" << std::endl;
5966 
5967  htmlFile << "<h1> Remote Monitoring Tool, LED RUN = " << runnumber << ". </h1>" << std::endl;
5968  htmlFile << "<br>" << std::endl;
5969 
5970  htmlFile << "<h2> 1. Analysis results for subdetectors </h2>" << std::endl;
5971  htmlFile << "<table width=\"400\">" << std::endl;
5972  htmlFile << "<tr>" << std::endl;
5973 
5974  htmlFile << " <td><a href=\"HB.html\">HB</a></td>" << std::endl;
5975  htmlFile << " <td><a href=\"HE.html\">HE</a></td>" << std::endl;
5976  htmlFile << " <td><a href=\"HO.html\">HO</a></td>" << std::endl;
5977  htmlFile << " <td><a href=\"HF.html\">HF</a></td>" << std::endl;
5978 
5979  /*
5980  htmlFile << " <td><a href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/RMT/LED_"<<runnumber<<"/HB.html\">HB</a></td>"<< std::endl;
5981  htmlFile << " <td><a href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/RMT/LED_"<<runnumber<<"/HE.html\">HE</a></td>"<< std::endl;
5982  htmlFile << " <td><a href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/RMT/LED_"<<runnumber<<"/HO.html\">HO</a></td>"<< std::endl;
5983  htmlFile << " <td><a href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/RMT/LED_"<<runnumber<<"/HF.html\">HF</a></td>"<< std::endl;
5984 */
5985  htmlFile << "</tr>" << std::endl;
5986  htmlFile << "</table>" << std::endl;
5987  htmlFile << "<br>" << std::endl;
5988 
5989  htmlFile << "<h2> 2. Amplitude summed over all sub-detector channels vs first 1000 events of this Run </h2>"
5990  << std::endl;
5991  htmlFile << "<h3> 2.A. Total subdetector Amplitude vs iEvent </h3>" << std::endl;
5992  htmlFile << " <img src=\"EVENTDEPENDENCE.png\" />" << std::endl;
5993  htmlFile << "<br>" << std::endl;
5994  htmlFile << "<br>" << std::endl;
5995  htmlFile << "<br>" << std::endl;
5996 
5997  htmlFile << "<h2> 3. HCAL status over all criteria and subdetectors </h2>" << std::endl;
5998  htmlFile << "<h3> 3.A. Channels in detector space </h3>" << std::endl;
5999  htmlFile << "<h4> Legend for channel status: green - good, red - bad, yellow - at least 2% gain drift, white - not "
6000  "applicable or out of range </h4>"
6001  << std::endl;
6002  htmlFile << " <img src=\"MAP.png\" />" << std::endl;
6003  htmlFile << "<br>" << std::endl;
6004  htmlFile << "<br>" << std::endl;
6005 
6006  htmlFile << "<h3> 3.B. List of Bad channels </h3>" << std::endl;
6007 
6008  htmlFile << " <td><a href=\"HELP.html\"> Description of criteria for bad channel selection</a></td>" << std::endl;
6009  //htmlFile << " <td><a href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/RMT/LED_"<<runnumber<<"/HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
6010  htmlFile << "<table>" << std::endl;
6011  htmlFile << "<tr>";
6012  htmlFile << "<td class=\"s4\" align=\"center\">#</td>" << std::endl;
6013  htmlFile << "<td class=\"s1\" align=\"center\">ETA</td>" << std::endl;
6014  htmlFile << "<td class=\"s1\" align=\"center\">PHI</td>" << std::endl;
6015  htmlFile << "<td class=\"s1\" align=\"center\">DEPTH</td>" << std::endl;
6016  htmlFile << "<td class=\"s1\" align=\"center\">RBX</td>" << std::endl;
6017  htmlFile << "<td class=\"s1\" align=\"center\">RM</td>" << std::endl;
6018  htmlFile << "<td class=\"s1\" align=\"center\">PIXEL</td>" << std::endl;
6019  htmlFile << "<td class=\"s1\" align=\"center\">RM_FIBER</td>" << std::endl;
6020  htmlFile << "<td class=\"s1\" align=\"center\">FIBER_CH</td>" << std::endl;
6021  htmlFile << "<td class=\"s1\" align=\"center\">QIE</td>" << std::endl;
6022  htmlFile << "<td class=\"s1\" align=\"center\">ADC</td>" << std::endl;
6023  htmlFile << "<td class=\"s1\" align=\"center\">CRATE</td>" << std::endl;
6024  htmlFile << "<td class=\"s1\" align=\"center\">DCC</td>" << std::endl;
6025  htmlFile << "<td class=\"s1\" align=\"center\">SPIGOT</td>" << std::endl;
6026  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FIBER</td>" << std::endl;
6027  htmlFile << "<td class=\"s1\" align=\"center\">HTR_SLOT</td>" << std::endl;
6028  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FPGA</td>" << std::endl;
6029  htmlFile << "<td class=\"s5\" align=\"center\">RMT-criteria</td>" << std::endl;
6030  htmlFile << "</tr>" << std::endl;
6031 
6032  ind = 0;
6033 
6034  for (int i = 1; i <= NBad; i++) {
6035  if ((ind % 2) == 1) {
6036  raw_class = "<td class=\"s2\" align=\"center\">";
6037  raw_class1 = "<td class=\"s6\" align=\"center\">";
6038  } else {
6039  raw_class = "<td class=\"s3\" align=\"center\">";
6040  raw_class1 = "<td class=\"s7\" align=\"center\">";
6041  }
6042  const CellDB db;
6043  const CellDB ce = db.find("Eta", Eta[2][i]).find("Phi", Phi[2][i]).find("Depth", Depth[2][i]);
6044  if (ce.size() == 0) {
6045  // cout<<"Error: No such Eta="<< Eta[2][i] <<", Phi="<< Phi[2][i] <<", Depth="<< Depth[2][i] <<" in database"<<endl;
6046  continue;
6047  }
6048  // 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;}
6049 
6050  if (ce.size() >= 1) {
6051  htmlFile << "<tr>" << std::endl;
6052  htmlFile << "<td class=\"s1\" align=\"center\">" << ind + 1 << "</td>" << std::endl;
6053  htmlFile << raw_class << Eta[2][i] << "</td>" << std::endl;
6054  htmlFile << raw_class << Phi[2][i] << "</td>" << std::endl;
6055  htmlFile << raw_class << Depth[2][i] << "</td>" << std::endl;
6056  htmlFile << raw_class << ce[0].RBX << "</td>" << std::endl;
6057  htmlFile << raw_class << ce[0].RM << "</td>" << std::endl;
6058  htmlFile << raw_class << ce[0].Pixel << "</td>" << std::endl;
6059  htmlFile << raw_class << ce[0].RMfiber << "</td>" << std::endl;
6060  htmlFile << raw_class << ce[0].FiberCh << "</td>" << std::endl;
6061  htmlFile << raw_class << ce[0].QIE << "</td>" << std::endl;
6062  htmlFile << raw_class << ce[0].ADC << "</td>" << std::endl;
6063  htmlFile << raw_class << ce[0].VMECardID << "</td>" << std::endl;
6064  htmlFile << raw_class << ce[0].dccID << "</td>" << std::endl;
6065  htmlFile << raw_class << ce[0].Spigot << "</td>" << std::endl;
6066  htmlFile << raw_class << ce[0].FiberIndex << "</td>" << std::endl;
6067  htmlFile << raw_class << ce[0].HtrSlot << "</td>" << std::endl;
6068  htmlFile << raw_class << ce[0].HtrTB << "</td>" << std::endl;
6069  htmlFile << raw_class1 << Comment[2][i] << "</td>" << std::endl;
6070  htmlFile << "</tr>" << std::endl;
6071 
6072  ind += 1;
6073  }
6074  }
6075  htmlFile << "</table>" << std::endl;
6076  htmlFile << "<br>" << std::endl;
6077 
6078  htmlFile << "<h3> 2.C.List of Gain unstable channels </h3>" << std::endl;
6079  htmlFile << " <td><a href=\"HELP.html\"> Description of criteria for bad channel selection</a></td>" << std::endl;
6080  // htmlFile << " <td><a href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/RMT/LED_"<<runnumber<<"/HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
6081 
6082  htmlFile << "<table>" << std::endl;
6083  htmlFile << "<tr>";
6084  htmlFile << "<td class=\"s4\" align=\"center\">#</td>" << std::endl;
6085  htmlFile << "<td class=\"s1\" align=\"center\">ETA</td>" << std::endl;
6086  htmlFile << "<td class=\"s1\" align=\"center\">PHI</td>" << std::endl;
6087  htmlFile << "<td class=\"s1\" align=\"center\">DEPTH</td>" << std::endl;
6088  htmlFile << "<td class=\"s1\" align=\"center\">RBX</td>" << std::endl;
6089  htmlFile << "<td class=\"s1\" align=\"center\">RM</td>" << std::endl;
6090  htmlFile << "<td class=\"s1\" align=\"center\">PIXEL</td>" << std::endl;
6091  htmlFile << "<td class=\"s1\" align=\"center\">RM_FIBER</td>" << std::endl;
6092  htmlFile << "<td class=\"s1\" align=\"center\">FIBER_CH</td>" << std::endl;
6093  htmlFile << "<td class=\"s1\" align=\"center\">QIE</td>" << std::endl;
6094  htmlFile << "<td class=\"s1\" align=\"center\">ADC</td>" << std::endl;
6095  htmlFile << "<td class=\"s1\" align=\"center\">CRATE</td>" << std::endl;
6096  htmlFile << "<td class=\"s1\" align=\"center\">DCC</td>" << std::endl;
6097  htmlFile << "<td class=\"s1\" align=\"center\">SPIGOT</td>" << std::endl;
6098  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FIBER</td>" << std::endl;
6099  htmlFile << "<td class=\"s1\" align=\"center\">HTR_SLOT</td>" << std::endl;
6100  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FPGA</td>" << std::endl;
6101  htmlFile << "<td class=\"s5\" align=\"center\">Failed criteria</td>" << std::endl;
6102  htmlFile << "</tr>" << std::endl;
6103 
6104  for (int i = 1; i <= NWarn; i++) {
6105  if ((ind % 2) == 1) {
6106  raw_class = "<td class=\"s2\" align=\"center\">";
6107  raw_class1 = "<td class=\"s6\" align=\"center\">";
6108  } else {
6109  raw_class = "<td class=\"s3\" align=\"center\">";
6110  raw_class1 = "<td class=\"s7\" align=\"center\">";
6111  }
6112  const CellDB db;
6113  const CellDB ce = db.find("Eta", Eta[1][i]).find("Phi", Phi[1][i]).find("Depth", Depth[1][i]);
6114  if (ce.size() == 0) {
6115  // cout<<"Error: No such Eta="<< Eta[1][i] <<", Phi="<< Phi[1][i] <<", Depth="<< Depth[1][i] <<" in database"<<endl;
6116  continue;
6117  }
6118  // 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;}
6119 
6120  if (ce.size() >= 1) {
6121  htmlFile << "<tr>" << std::endl;
6122  htmlFile << "<td class=\"s1\" align=\"center\">" << ind + 1 << "</td>" << std::endl;
6123  htmlFile << raw_class << Eta[1][i] << "</td>" << std::endl;
6124  htmlFile << raw_class << Phi[1][i] << "</td>" << std::endl;
6125  htmlFile << raw_class << Depth[1][i] << "</td>" << std::endl;
6126  htmlFile << raw_class << ce[0].RBX << "</td>" << std::endl;
6127  htmlFile << raw_class << ce[0].RM << "</td>" << std::endl;
6128  htmlFile << raw_class << ce[0].Pixel << "</td>" << std::endl;
6129  htmlFile << raw_class << ce[0].RMfiber << "</td>" << std::endl;
6130  htmlFile << raw_class << ce[0].FiberCh << "</td>" << std::endl;
6131  htmlFile << raw_class << ce[0].QIE << "</td>" << std::endl;
6132  htmlFile << raw_class << ce[0].ADC << "</td>" << std::endl;
6133  htmlFile << raw_class << ce[0].VMECardID << "</td>" << std::endl;
6134  htmlFile << raw_class << ce[0].dccID << "</td>" << std::endl;
6135  htmlFile << raw_class << ce[0].Spigot << "</td>" << std::endl;
6136  htmlFile << raw_class << ce[0].FiberIndex << "</td>" << std::endl;
6137  htmlFile << raw_class << ce[0].HtrSlot << "</td>" << std::endl;
6138  htmlFile << raw_class << ce[0].HtrTB << "</td>" << std::endl;
6139  htmlFile << raw_class1 << Comment[1][i] << "</td>" << std::endl;
6140  htmlFile << "</tr>" << std::endl;
6141 
6142  ind += 1;
6143  }
6144  }
6145 
6146  htmlFile << "</table>" << std::endl;
6147  htmlFile << "<br>" << std::endl;
6148 
6149  htmlFile << "<h3> 2.D.List of channels with bad Pedestals </h3>" << std::endl;
6150  htmlFile << " <td><a href=\"HELP.html\"> Description of criteria for bad channel selection</a></td>" << std::endl;
6151  // htmlFile << " <td><a href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/HcalRemoteMonitoring/RMT/LED_"<<runnumber<<"/HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
6152 
6153  htmlFile << "<table>" << std::endl;
6154  htmlFile << "<tr>";
6155  htmlFile << "<td class=\"s4\" align=\"center\">#</td>" << std::endl;
6156  htmlFile << "<td class=\"s1\" align=\"center\">ETA</td>" << std::endl;
6157  htmlFile << "<td class=\"s1\" align=\"center\">PHI</td>" << std::endl;
6158  htmlFile << "<td class=\"s1\" align=\"center\">DEPTH</td>" << std::endl;
6159  htmlFile << "<td class=\"s1\" align=\"center\">RBX</td>" << std::endl;
6160  htmlFile << "<td class=\"s1\" align=\"center\">RM</td>" << std::endl;
6161  htmlFile << "<td class=\"s1\" align=\"center\">PIXEL</td>" << std::endl;
6162  htmlFile << "<td class=\"s1\" align=\"center\">RM_FIBER</td>" << std::endl;
6163  htmlFile << "<td class=\"s1\" align=\"center\">FIBER_CH</td>" << std::endl;
6164  htmlFile << "<td class=\"s1\" align=\"center\">QIE</td>" << std::endl;
6165  htmlFile << "<td class=\"s1\" align=\"center\">ADC</td>" << std::endl;
6166  htmlFile << "<td class=\"s1\" align=\"center\">CRATE</td>" << std::endl;
6167  htmlFile << "<td class=\"s1\" align=\"center\">DCC</td>" << std::endl;
6168  htmlFile << "<td class=\"s1\" align=\"center\">SPIGOT</td>" << std::endl;
6169  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FIBER</td>" << std::endl;
6170  htmlFile << "<td class=\"s1\" align=\"center\">HTR_SLOT</td>" << std::endl;
6171  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FPGA</td>" << std::endl;
6172  htmlFile << "<td class=\"s5\" align=\"center\">Failed criteria</td>" << std::endl;
6173  htmlFile << "</tr>" << std::endl;
6174 
6175  for (int i = 1; i <= NPed; i++) {
6176  if ((ind % 2) == 1) {
6177  raw_class = "<td class=\"s2\" align=\"center\">";
6178  raw_class1 = "<td class=\"s6\" align=\"center\">";
6179  } else {
6180  raw_class = "<td class=\"s3\" align=\"center\">";
6181  raw_class1 = "<td class=\"s7\" align=\"center\">";
6182  }
6183  const CellDB db;
6184  const CellDB ce = db.find("Eta", Eta[3][i]).find("Phi", Phi[3][i]).find("Depth", Depth[3][i]);
6185  if (ce.size() == 0) {
6186  // cout<<"Error: No such Eta="<< Eta[3][i] << ", Phi="<< Phi[3][i] <<", Depth="<< Depth[3][i] <<" in database"<<endl;
6187  continue;
6188  }
6189  // 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;}
6190 
6191  if (ce.size() >= 1) {
6192  htmlFile << "<tr>" << std::endl;
6193  htmlFile << "<td class=\"s1\" align=\"center\">" << ind + 1 << "</td>" << std::endl;
6194  htmlFile << raw_class << Eta[3][i] << "</td>" << std::endl;
6195  htmlFile << raw_class << Phi[3][i] << "</td>" << std::endl;
6196  htmlFile << raw_class << Depth[3][i] << "</td>" << std::endl;
6197  htmlFile << raw_class << ce[0].RBX << "</td>" << std::endl;
6198  htmlFile << raw_class << ce[0].RM << "</td>" << std::endl;
6199  htmlFile << raw_class << ce[0].Pixel << "</td>" << std::endl;
6200  htmlFile << raw_class << ce[0].RMfiber << "</td>" << std::endl;
6201  htmlFile << raw_class << ce[0].FiberCh << "</td>" << std::endl;
6202  htmlFile << raw_class << ce[0].QIE << "</td>" << std::endl;
6203  htmlFile << raw_class << ce[0].ADC << "</td>" << std::endl;
6204  htmlFile << raw_class << ce[0].VMECardID << "</td>" << std::endl;
6205  htmlFile << raw_class << ce[0].dccID << "</td>" << std::endl;
6206  htmlFile << raw_class << ce[0].Spigot << "</td>" << std::endl;
6207  htmlFile << raw_class << ce[0].FiberIndex << "</td>" << std::endl;
6208  htmlFile << raw_class << ce[0].HtrSlot << "</td>" << std::endl;
6209  htmlFile << raw_class << ce[0].HtrTB << "</td>" << std::endl;
6210  htmlFile << raw_class1 << Comment[3][i] << "</td>" << std::endl;
6211  htmlFile << "</tr>" << std::endl;
6212 
6213  ind += 1;
6214  }
6215  }
6216 
6217  htmlFile << "</table>" << std::endl;
6218 
6219  htmlFile << "</body> " << std::endl;
6220  htmlFile << "</html> " << std::endl;
6221  htmlFile.close();
6222  //======================================================================
6223 
6224  //======================================================================
6225  // Close and delete all possible things:
6226  hfile->Close();
6227  // hfile->Delete();
6228  // Exit Root
6229  gSystem->Exit(0);
6230  //======================================================================
6231 }

References funct::abs(), dir2webdir::argc, cmsBatch::argv, HLT_FULL_cff::cap, gather_cfg::cout, dqmiodatasetharvest::db, electronHcalTowerIsolationLcone_cfi::Depth, alignmentValidation::fname, mps_fire::i, dqmiolumiharvest::j, METSignificanceParams_cfi::jeta, dqmdumpme::k, ndepth, neta, nphi, nsub, VtxSmearedParameters_cfi::Phi, cond::runnumber, SiStripCommissioningClient_cfg::runtype, CellDB::size(), str, AlCaHLTBitMon_QueryRunRegistry::string, and ctpps_dqm_sourceclient-live_cfg::test.

neta
const int neta
Definition: CMTRawAnalyzer.h:423
cmsBatch.argv
argv
Definition: cmsBatch.py:279
mps_fire.i
i
Definition: mps_fire.py:428
electronHcalTowerIsolationLcone_cfi.Depth
Depth
Definition: electronHcalTowerIsolationLcone_cfi.py:9
dir2webdir.argc
argc
Definition: dir2webdir.py:39
METSignificanceParams_cfi.jeta
jeta
Definition: METSignificanceParams_cfi.py:12
gather_cfg.cout
cout
Definition: gather_cfg.py:144
CellDB
Definition: LogEleMapdb.h:14741
dqmiodatasetharvest.db
db
Definition: dqmiodatasetharvest.py:119
nphi
const int nphi
Definition: CMTRawAnalyzer.h:424
test
Definition: SmallWORMDict.h:13
ctpps_dqm_sourceclient-live_cfg.test
test
Definition: ctpps_dqm_sourceclient-live_cfg.py:7
nsub
const int nsub
Definition: CMTRawAnalyzer.h:421
str
#define str(s)
Definition: TestProcessor.cc:51
VtxSmearedParameters_cfi.Phi
Phi
Definition: VtxSmearedParameters_cfi.py:112
dqmdumpme.k
k
Definition: dqmdumpme.py:60
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ndepth
const int ndepth
Definition: CMTRawAnalyzer.h:422
cond::runnumber
Definition: Time.h:19
HLT_FULL_cff.cap
cap
Definition: HLT_FULL_cff.py:6335
alignmentValidation.fname
string fname
main script
Definition: alignmentValidation.py:959
genVertex_cff.x
x
Definition: genVertex_cff.py:12
detailsBasic3DVector::y
float float y
Definition: extBasic3DVector.h:14
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
CellDB::size
int size() const
Definition: LogEleMapdb.h:14748
reco::TrackTransientTrack
Definition: TrackTransientTrack.h:18
SiStripCommissioningClient_cfg.runtype
runtype
Definition: SiStripCommissioningClient_cfg.py:9