CMS 3D CMS Logo

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

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

Prepare maps of good/bad channels:

Definition at line 31 of file RemoteMonitoringMAPnoPSM.cc.

References funct::abs(), gather_cfg::cout, EcalCondDB::db, g4TestOverlap_cfg::Depth, CellDB::find(), alignmentValidation::fname, mps_fire::i, dqmiolumiharvest::j, isotrackApplyRegressor::k, ndepth, neta, nphi, nsub, colinearityKinematic::Phi, cond::runnumber, SiStripCommissioningClient_cfg::runtype, CellDB::size(), str, AlCaHLTBitMon_QueryRunRegistry::string, and ctpps_dqm_sourceclient-live_cfg::test.

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 jeta = 0; jeta < neta; jeta++) {
2682  // positivedirection:
2683  if (jeta - 41 > 0) {
2684  for (int jphi = 0; jphi < nphi; jphi++) {
2685  for (int i = 0; i < ndepth; i++) {
2686  double ccc1 = alexhe[i][jeta][jphi];
2687  if (ccc1 != 0.) {
2688  Gefz41D->Fill(jphi, ccc1);
2689  Gefz41D0->Fill(jphi, 1.);
2690  }
2691  }
2692  }
2693  }
2694  }
2695  // Gefz41D->Sumw2();Gefz41D0->Sumw2();
2696 
2697  Gefz41DF->Divide(Gefz41D, Gefz41D0, 1, 1, "B"); // R averaged over depthes & eta
2698  Gefz41D0->Sumw2();
2699  // for (int jphi=1;jphi<73;jphi++) {Gefz41DF->SetBinError(jphi,0.01);}
2700  gPad->SetGridy();
2701  gPad->SetGridx(); // gPad->SetLogz();
2702  Gefz41DF->SetMarkerStyle(20);
2703  Gefz41DF->SetMarkerSize(1.4);
2704  Gefz41DF->GetZaxis()->SetLabelSize(0.08);
2705  Gefz41DF->SetXTitle("#phi \b");
2706  Gefz41DF->SetYTitle(" <R> \b");
2707  Gefz41DF->SetZTitle("<R>_PHI - AllDepthes \b");
2708  Gefz41DF->SetMarkerColor(4);
2709  Gefz41DF->SetLineColor(4);
2710  Gefz41DF->SetMinimum(0.8); // Gefz41DF->SetMaximum(1.000);
2711  Gefz41DF->Draw("Error");
2712 
2714  c1x1->Update();
2715  c1x1->Print("Rhist1IterationMethodHE.png");
2716  c1x1->Clear();
2717  // clean-up
2718  if (Gefz41D)
2719  delete Gefz41D;
2720  if (Gefz41D0)
2721  delete Gefz41D0;
2722  if (Gefz41DF)
2723  delete Gefz41DF;
2724 
2725  //========================================================================================== 4
2726  //======================================================================
2727  //======================================================================1D plot: R vs phi , different eta, depth=1
2728  cout << " 1D plot: R vs phi , different eta, depth=1 *****" << endl;
2729  c3x5->Clear();
2731  c3x5->Divide(3, 5);
2732  c3x5->cd(1);
2733  int kcountHEpositivedirection1 = 1;
2734  TH1F *h2CeffHEpositivedirection1 = new TH1F("h2CeffHEpositivedirection1", "", nphi, 0., 72.);
2735 
2736  for (int jeta = 0; jeta < njeta; jeta++) {
2737  // positivedirection:
2738  if (jeta - 41 > 0) {
2739  // for (int i=0;i<ndepth;i++) {
2740  // depth=1
2741  for (int i = 0; i < 1; i++) {
2742  TH1F *HEpositivedirection1 = (TH1F *)h2CeffHEpositivedirection1->Clone("twod1");
2743 
2744  float ccctest = 0; // to avoid empty massive elements
2745  for (int jphi = 0; jphi < nphi; jphi++) {
2746  double ccc1 = alexhe[i][jeta][jphi];
2747  if (ccc1 != 0.) {
2748  HEpositivedirection1->Fill(jphi, ccc1);
2749  ccctest = 1.; //HEpositivedirection1->SetBinError(i,0.01);
2750  }
2751  } // for jphi
2752  if (ccctest > 0.) {
2753  cout << "444 kcountHEpositivedirection1 = " << kcountHEpositivedirection1
2754  << " jeta-41= " << jeta - 41 << endl;
2755  c3x5->cd(kcountHEpositivedirection1);
2756  HEpositivedirection1->SetMarkerStyle(20);
2757  HEpositivedirection1->SetMarkerSize(0.4);
2758  HEpositivedirection1->GetYaxis()->SetLabelSize(0.04);
2759  HEpositivedirection1->SetXTitle("HEpositivedirection1 \b");
2760  HEpositivedirection1->SetMarkerColor(2);
2761  HEpositivedirection1->SetLineColor(0);
2762  gPad->SetGridy();
2763  gPad->SetGridx();
2764  // gPad->SetLogy();
2765  if (kcountHEpositivedirection1 == 1)
2766  HEpositivedirection1->SetXTitle("R for HE+ jeta = 18; depth = 1 \b");
2767  if (kcountHEpositivedirection1 == 2)
2768  HEpositivedirection1->SetXTitle("R for HE+ jeta = 19; depth = 1 \b");
2769  if (kcountHEpositivedirection1 == 3)
2770  HEpositivedirection1->SetXTitle("R for HE+ jeta = 20; depth = 1 \b");
2771  if (kcountHEpositivedirection1 == 4)
2772  HEpositivedirection1->SetXTitle("R for HE+ jeta = 21; depth = 1 \b");
2773  if (kcountHEpositivedirection1 == 5)
2774  HEpositivedirection1->SetXTitle("R for HE+ jeta = 22; depth = 1 \b");
2775  if (kcountHEpositivedirection1 == 6)
2776  HEpositivedirection1->SetXTitle("R for HE+ jeta = 23; depth = 1 \b");
2777  if (kcountHEpositivedirection1 == 7)
2778  HEpositivedirection1->SetXTitle("R for HE+ jeta = 24; depth = 1 \b");
2779  if (kcountHEpositivedirection1 == 8)
2780  HEpositivedirection1->SetXTitle("R for HE+ jeta = 25; depth = 1 \b");
2781  if (kcountHEpositivedirection1 == 9)
2782  HEpositivedirection1->SetXTitle("R for HE+ jeta = 26; depth = 1 \b");
2783  if (kcountHEpositivedirection1 == 10)
2784  HEpositivedirection1->SetXTitle("R for HE+ jeta = 27; depth = 1 \b");
2785  if (kcountHEpositivedirection1 == 11)
2786  HEpositivedirection1->SetXTitle("R for HE+ jeta = 28; depth = 1 \b");
2787  if (kcountHEpositivedirection1 == 12)
2788  HEpositivedirection1->SetXTitle("R for HE+ jeta = 29; depth = 1 \b");
2789  HEpositivedirection1->Draw("Error");
2790  kcountHEpositivedirection1++;
2791  if (kcountHEpositivedirection1 > 15)
2792  break; // 4x6 = 24
2793  } //ccctest>0
2794 
2795  } // for i
2796  } //if(jeta-41 > 0)
2797  } //for jeta
2799  c3x5->Update();
2800  c3x5->Print("Rhist1IterationMethodDepth1HE.png");
2801  c3x5->Clear();
2802  // clean-up
2803  if (h2CeffHEpositivedirection1)
2804  delete h2CeffHEpositivedirection1;
2805 
2806  //========================================================================================== 5
2807  //======================================================================
2808  //======================================================================1D plot: R vs phi , different eta, depth=2
2809  cout << " 1D plot: R vs phi , different eta, depth=2 *****" << endl;
2810  c3x5->Clear();
2812  c3x5->Divide(3, 5);
2813  c3x5->cd(1);
2814  int kcountHEpositivedirection2 = 1;
2815  TH1F *h2CeffHEpositivedirection2 = new TH1F("h2CeffHEpositivedirection2", "", nphi, 0., 72.);
2816 
2817  for (int jeta = 0; jeta < njeta; jeta++) {
2818  // positivedirection:
2819  if (jeta - 41 > 0) {
2820  // for (int i=0;i<ndepth;i++) {
2821  // depth=2
2822  for (int i = 1; i < 2; i++) {
2823  TH1F *HEpositivedirection2 = (TH1F *)h2CeffHEpositivedirection2->Clone("twod1");
2824 
2825  float ccctest = 0; // to avoid empty massive elements
2826  for (int jphi = 0; jphi < nphi; jphi++) {
2827  double ccc1 = alexhe[i][jeta][jphi];
2828  if (ccc1 != 0.) {
2829  HEpositivedirection2->Fill(jphi, ccc1);
2830  ccctest = 1.; //HEpositivedirection2->SetBinError(i,0.01);
2831  }
2832  } // for jphi
2833  if (ccctest > 0.) {
2834  cout << "555 kcountHEpositivedirection2 = " << kcountHEpositivedirection2
2835  << " jeta-41= " << jeta - 41 << endl;
2836  c3x5->cd(kcountHEpositivedirection2);
2837  HEpositivedirection2->SetMarkerStyle(20);
2838  HEpositivedirection2->SetMarkerSize(0.4);
2839  HEpositivedirection2->GetYaxis()->SetLabelSize(0.04);
2840  HEpositivedirection2->SetXTitle("HEpositivedirection2 \b");
2841  HEpositivedirection2->SetMarkerColor(2);
2842  HEpositivedirection2->SetLineColor(0);
2843  gPad->SetGridy();
2844  gPad->SetGridx();
2845  // gPad->SetLogy();
2846  if (kcountHEpositivedirection2 == 1)
2847  HEpositivedirection2->SetXTitle("R for HE+ jeta = 17; depth = 2 \b");
2848  if (kcountHEpositivedirection2 == 2)
2849  HEpositivedirection2->SetXTitle("R for HE+ jeta = 18; depth = 2 \b");
2850  if (kcountHEpositivedirection2 == 3)
2851  HEpositivedirection2->SetXTitle("R for HE+ jeta = 19; depth = 2 \b");
2852  if (kcountHEpositivedirection2 == 4)
2853  HEpositivedirection2->SetXTitle("R for HE+ jeta = 20; depth = 2 \b");
2854  if (kcountHEpositivedirection2 == 5)
2855  HEpositivedirection2->SetXTitle("R for HE+ jeta = 21; depth = 2 \b");
2856  if (kcountHEpositivedirection2 == 6)
2857  HEpositivedirection2->SetXTitle("R for HE+ jeta = 22; depth = 2 \b");
2858  if (kcountHEpositivedirection2 == 7)
2859  HEpositivedirection2->SetXTitle("R for HE+ jeta = 23; depth = 2 \b");
2860  if (kcountHEpositivedirection2 == 8)
2861  HEpositivedirection2->SetXTitle("R for HE+ jeta = 24; depth = 2 \b");
2862  if (kcountHEpositivedirection2 == 9)
2863  HEpositivedirection2->SetXTitle("R for HE+ jeta = 25; depth = 2 \b");
2864  if (kcountHEpositivedirection2 == 10)
2865  HEpositivedirection2->SetXTitle("R for HE+ jeta = 26; depth = 2 \b");
2866  if (kcountHEpositivedirection2 == 11)
2867  HEpositivedirection2->SetXTitle("R for HE+ jeta = 27; depth = 2 \b");
2868  if (kcountHEpositivedirection2 == 12)
2869  HEpositivedirection2->SetXTitle("R for HE+ jeta = 28; depth = 2 \b");
2870  if (kcountHEpositivedirection2 == 13)
2871  HEpositivedirection2->SetXTitle("R for HE+ jeta = 29; depth = 2 \b");
2872  HEpositivedirection2->Draw("Error");
2873  kcountHEpositivedirection2++;
2874  if (kcountHEpositivedirection2 > 15)
2875  break; // 4x6 = 24
2876  } //ccctest>0
2877 
2878  } // for i
2879  } //if(jeta-41 > 0)
2880  } //for jeta
2882  c3x5->Update();
2883  c3x5->Print("Rhist1IterationMethodDepth2HE.png");
2884  c3x5->Clear();
2885  // clean-up
2886  if (h2CeffHEpositivedirection2)
2887  delete h2CeffHEpositivedirection2;
2888  //========================================================================================== 6
2889  //======================================================================
2890  //======================================================================1D plot: R vs phi , different eta, depth=3
2891  cout << " 1D plot: R vs phi , different eta, depth=3 *****" << endl;
2892  c3x5->Clear();
2894  c3x5->Divide(3, 5);
2895  c3x5->cd(1);
2896  int kcountHEpositivedirection3 = 1;
2897  TH1F *h2CeffHEpositivedirection3 = new TH1F("h2CeffHEpositivedirection3", "", nphi, 0., 72.);
2898 
2899  for (int jeta = 0; jeta < njeta; jeta++) {
2900  // positivedirection:
2901  if (jeta - 41 > 0) {
2902  // for (int i=0;i<ndepth;i++) {
2903  // depth=3
2904  for (int i = 2; i < 3; i++) {
2905  TH1F *HEpositivedirection3 = (TH1F *)h2CeffHEpositivedirection3->Clone("twod1");
2906 
2907  float ccctest = 0; // to avoid empty massive elements
2908  for (int jphi = 0; jphi < nphi; jphi++) {
2909  double ccc1 = alexhe[i][jeta][jphi];
2910  if (ccc1 != 0.) {
2911  HEpositivedirection3->Fill(jphi, ccc1);
2912  ccctest = 1.; //HEpositivedirection3->SetBinError(i,0.01);
2913  }
2914  } // for jphi
2915  if (ccctest > 0.) {
2916  cout << "666 kcountHEpositivedirection3 = " << kcountHEpositivedirection3
2917  << " jeta-41= " << jeta - 41 << endl;
2918  c3x5->cd(kcountHEpositivedirection3);
2919  HEpositivedirection3->SetMarkerStyle(20);
2920  HEpositivedirection3->SetMarkerSize(0.4);
2921  HEpositivedirection3->GetYaxis()->SetLabelSize(0.04);
2922  HEpositivedirection3->SetXTitle("HEpositivedirection3 \b");
2923  HEpositivedirection3->SetMarkerColor(2);
2924  HEpositivedirection3->SetLineColor(0);
2925  gPad->SetGridy();
2926  gPad->SetGridx();
2927  // gPad->SetLogy();
2928  if (kcountHEpositivedirection3 == 1)
2929  HEpositivedirection3->SetXTitle("R for HE+ jeta = 17; depth = 3 \b");
2930  if (kcountHEpositivedirection3 == 2)
2931  HEpositivedirection3->SetXTitle("R for HE+ jeta = 18; depth = 3 \b");
2932  if (kcountHEpositivedirection3 == 3)
2933  HEpositivedirection3->SetXTitle("R for HE+ jeta = 19; depth = 3 \b");
2934  if (kcountHEpositivedirection3 == 4)
2935  HEpositivedirection3->SetXTitle("R for HE+ jeta = 20; depth = 3 \b");
2936  if (kcountHEpositivedirection3 == 5)
2937  HEpositivedirection3->SetXTitle("R for HE+ jeta = 21; depth = 3 \b");
2938  if (kcountHEpositivedirection3 == 6)
2939  HEpositivedirection3->SetXTitle("R for HE+ jeta = 22; depth = 3 \b");
2940  if (kcountHEpositivedirection3 == 7)
2941  HEpositivedirection3->SetXTitle("R for HE+ jeta = 23; depth = 3 \b");
2942  if (kcountHEpositivedirection3 == 8)
2943  HEpositivedirection3->SetXTitle("R for HE+ jeta = 24; depth = 3 \b");
2944  if (kcountHEpositivedirection3 == 9)
2945  HEpositivedirection3->SetXTitle("R for HE+ jeta = 25; depth = 3 \b");
2946  if (kcountHEpositivedirection3 == 10)
2947  HEpositivedirection3->SetXTitle("R for HE+ jeta = 26; depth = 3 \b");
2948  if (kcountHEpositivedirection3 == 11)
2949  HEpositivedirection3->SetXTitle("R for HE+ jeta = 27; depth = 3 \b");
2950  if (kcountHEpositivedirection3 == 12)
2951  HEpositivedirection3->SetXTitle("R for HE+ jeta = 28; depth = 3 \b");
2952  if (kcountHEpositivedirection3 == 13)
2953  HEpositivedirection3->SetXTitle("R for HE+ jeta = 29; depth = 3 \b");
2954  HEpositivedirection3->Draw("Error");
2955  kcountHEpositivedirection3++;
2956  if (kcountHEpositivedirection3 > 15)
2957  break; // 4x6 = 24
2958  } //ccctest>0
2959 
2960  } // for i
2961  } //if(jeta-41 > 0)
2962  } //for jeta
2964  c3x5->Update();
2965  c3x5->Print("Rhist1IterationMethodDepth3HE.png");
2966  c3x5->Clear();
2967  // clean-up
2968  if (h2CeffHEpositivedirection3)
2969  delete h2CeffHEpositivedirection3;
2970  //========================================================================================== 7
2971  //======================================================================
2972  //======================================================================1D plot: R vs phi , different eta, depth=4
2973  cout << " 1D plot: R vs phi , different eta, depth=4 *****" << endl;
2974  c3x5->Clear();
2976  c3x5->Divide(3, 5);
2977  c3x5->cd(1);
2978  int kcountHEpositivedirection4 = 1;
2979  TH1F *h2CeffHEpositivedirection4 = new TH1F("h2CeffHEpositivedirection4", "", nphi, 0., 72.);
2980 
2981  for (int jeta = 0; jeta < njeta; jeta++) {
2982  // positivedirection:
2983  if (jeta - 41 > 0) {
2984  // for (int i=0;i<ndepth;i++) {
2985  // depth=4
2986  for (int i = 3; i < 4; i++) {
2987  TH1F *HEpositivedirection4 = (TH1F *)h2CeffHEpositivedirection4->Clone("twod1");
2988 
2989  float ccctest = 0; // to avoid empty massive elements
2990  for (int jphi = 0; jphi < nphi; jphi++) {
2991  double ccc1 = alexhe[i][jeta][jphi];
2992  if (ccc1 != 0.) {
2993  HEpositivedirection4->Fill(jphi, ccc1);
2994  ccctest = 1.; //HEpositivedirection4->SetBinError(i,0.01);
2995  }
2996  } // for jphi
2997  if (ccctest > 0.) {
2998  cout << "777 kcountHEpositivedirection4 = " << kcountHEpositivedirection4
2999  << " jeta-41= " << jeta - 41 << endl;
3000  c3x5->cd(kcountHEpositivedirection4);
3001  HEpositivedirection4->SetMarkerStyle(20);
3002  HEpositivedirection4->SetMarkerSize(0.4);
3003  HEpositivedirection4->GetYaxis()->SetLabelSize(0.04);
3004  HEpositivedirection4->SetXTitle("HEpositivedirection4 \b");
3005  HEpositivedirection4->SetMarkerColor(2);
3006  HEpositivedirection4->SetLineColor(0);
3007  gPad->SetGridy();
3008  gPad->SetGridx();
3009  // gPad->SetLogy();
3010  if (kcountHEpositivedirection4 == 1)
3011  HEpositivedirection4->SetXTitle("R for HE+ jeta = 16; depth = 4 \b");
3012  if (kcountHEpositivedirection4 == 2)
3013  HEpositivedirection4->SetXTitle("R for HE+ jeta = 18; depth = 4 \b");
3014  if (kcountHEpositivedirection4 == 3)
3015  HEpositivedirection4->SetXTitle("R for HE+ jeta = 19; depth = 4 \b");
3016  if (kcountHEpositivedirection4 == 4)
3017  HEpositivedirection4->SetXTitle("R for HE+ jeta = 20; depth = 4 \b");
3018  if (kcountHEpositivedirection4 == 5)
3019  HEpositivedirection4->SetXTitle("R for HE+ jeta = 21; depth = 4 \b");
3020  if (kcountHEpositivedirection4 == 6)
3021  HEpositivedirection4->SetXTitle("R for HE+ jeta = 22; depth = 4 \b");
3022  if (kcountHEpositivedirection4 == 7)
3023  HEpositivedirection4->SetXTitle("R for HE+ jeta = 23; depth = 4 \b");
3024  if (kcountHEpositivedirection4 == 8)
3025  HEpositivedirection4->SetXTitle("R for HE+ jeta = 24; depth = 4 \b");
3026  if (kcountHEpositivedirection4 == 9)
3027  HEpositivedirection4->SetXTitle("R for HE+ jeta = 25; depth = 4 \b");
3028  if (kcountHEpositivedirection4 == 10)
3029  HEpositivedirection4->SetXTitle("R for HE+ jeta = 26; depth = 4 \b");
3030  if (kcountHEpositivedirection4 == 11)
3031  HEpositivedirection4->SetXTitle("R for HE+ jeta = 27; depth = 4 \b");
3032  if (kcountHEpositivedirection4 == 12)
3033  HEpositivedirection4->SetXTitle("R for HE+ jeta = 28; depth = 4 \b");
3034  HEpositivedirection4->Draw("Error");
3035  kcountHEpositivedirection4++;
3036  if (kcountHEpositivedirection4 > 15)
3037  break; // 4x6 = 24
3038  } //ccctest>0
3039 
3040  } // for i
3041  } //if(jeta-41 > 0)
3042  } //for jeta
3044  c3x5->Update();
3045  c3x5->Print("Rhist1IterationMethodDepth4HE.png");
3046  c3x5->Clear();
3047  // clean-up
3048  if (h2CeffHEpositivedirection4)
3049  delete h2CeffHEpositivedirection4;
3050  //========================================================================================== 8
3051  //======================================================================
3052  //======================================================================1D plot: R vs phi , different eta, depth=5
3053  cout << " 1D plot: R vs phi , different eta, depth=5 *****" << endl;
3054  c3x5->Clear();
3056  c3x5->Divide(3, 5);
3057  c3x5->cd(1);
3058  int kcountHEpositivedirection5 = 1;
3059  TH1F *h2CeffHEpositivedirection5 = new TH1F("h2CeffHEpositivedirection5", "", nphi, 0., 72.);
3060 
3061  for (int jeta = 0; jeta < njeta; jeta++) {
3062  // positivedirection:
3063  if (jeta - 41 > 0) {
3064  // for (int i=0;i<ndepth;i++) {
3065  // depth=5
3066  for (int i = 4; i < 5; i++) {
3067  TH1F *HEpositivedirection5 = (TH1F *)h2CeffHEpositivedirection5->Clone("twod1");
3068 
3069  float ccctest = 0; // to avoid empty massive elements
3070  for (int jphi = 0; jphi < nphi; jphi++) {
3071  // cout<<"888 initial kcountHEpositivedirection5 = "<<kcountHEpositivedirection5 <<" jeta-41= "<< jeta-41 <<" jphi= "<< jphi <<" alexhe[i][jeta][jphi]= "<< alexhe[i][jeta][jphi] <<" depth= "<< i <<endl;
3072 
3073  double ccc1 = alexhe[i][jeta][jphi];
3074  if (ccc1 != 0.) {
3075  HEpositivedirection5->Fill(jphi, ccc1);
3076  ccctest = 1.; //HEpositivedirection5->SetBinError(i,0.01);
3077  }
3078  } // for jphi
3079  if (ccctest > 0.) {
3080  cout << "888 kcountHEpositivedirection5 = " << kcountHEpositivedirection5
3081  << " jeta-41= " << jeta - 41 << endl;
3082  c3x5->cd(kcountHEpositivedirection5);
3083  HEpositivedirection5->SetMarkerStyle(20);
3084  HEpositivedirection5->SetMarkerSize(0.4);
3085  HEpositivedirection5->GetYaxis()->SetLabelSize(0.04);
3086  HEpositivedirection5->SetXTitle("HEpositivedirection5 \b");
3087  HEpositivedirection5->SetMarkerColor(2);
3088  HEpositivedirection5->SetLineColor(0);
3089  gPad->SetGridy();
3090  gPad->SetGridx();
3091  // gPad->SetLogy();
3092  if (kcountHEpositivedirection5 == 1)
3093  HEpositivedirection5->SetXTitle("R for HE+ jeta = 18; depth = 5 \b");
3094  if (kcountHEpositivedirection5 == 2)
3095  HEpositivedirection5->SetXTitle("R for HE+ jeta = 19; depth = 5 \b");
3096  if (kcountHEpositivedirection5 == 3)
3097  HEpositivedirection5->SetXTitle("R for HE+ jeta = 20; depth = 5 \b");
3098  if (kcountHEpositivedirection5 == 4)
3099  HEpositivedirection5->SetXTitle("R for HE+ jeta = 21; depth = 5 \b");
3100  if (kcountHEpositivedirection5 == 5)
3101  HEpositivedirection5->SetXTitle("R for HE+ jeta = 22; depth = 5 \b");
3102  if (kcountHEpositivedirection5 == 6)
3103  HEpositivedirection5->SetXTitle("R for HE+ jeta = 23; depth = 5 \b");
3104  if (kcountHEpositivedirection5 == 7)
3105  HEpositivedirection5->SetXTitle("R for HE+ jeta = 24; depth = 5 \b");
3106  if (kcountHEpositivedirection5 == 8)
3107  HEpositivedirection5->SetXTitle("R for HE+ jeta = 25; depth = 5 \b");
3108  if (kcountHEpositivedirection5 == 9)
3109  HEpositivedirection5->SetXTitle("R for HE+ jeta = 26; depth = 5 \b");
3110  if (kcountHEpositivedirection5 == 10)
3111  HEpositivedirection5->SetXTitle("R for HE+ jeta = 27; depth = 5 \b");
3112  if (kcountHEpositivedirection5 == 11)
3113  HEpositivedirection5->SetXTitle("R for HE+ jeta = 28; depth = 5 \b");
3114  HEpositivedirection5->Draw("Error");
3115  kcountHEpositivedirection5++;
3116  if (kcountHEpositivedirection5 > 15)
3117  break; // 4x6 = 24
3118  } //ccctest>0
3119 
3120  } // for i
3121  } //if(jeta-41 > 0)
3122  } //for jeta
3124  c3x5->Update();
3125  c3x5->Print("Rhist1IterationMethodDepth5HE.png");
3126  c3x5->Clear();
3127  // clean-up
3128  if (h2CeffHEpositivedirection5)
3129  delete h2CeffHEpositivedirection5;
3130  //========================================================================================== 9
3131  //======================================================================
3132  //======================================================================1D plot: R vs phi , different eta, depth=6
3133  cout << " 1D plot: R vs phi , different eta, depth=6 *****" << endl;
3134  c3x5->Clear();
3136  c3x5->Divide(3, 5);
3137  c3x5->cd(1);
3138  int kcountHEpositivedirection6 = 1;
3139  TH1F *h2CeffHEpositivedirection6 = new TH1F("h2CeffHEpositivedirection6", "", nphi, 0., 72.);
3140 
3141  for (int jeta = 0; jeta < njeta; jeta++) {
3142  // positivedirection:
3143  if (jeta - 41 > 0) {
3144  // for (int i=0;i<ndepth;i++) {
3145  // depth=6
3146  for (int i = 5; i < 6; i++) {
3147  TH1F *HEpositivedirection6 = (TH1F *)h2CeffHEpositivedirection6->Clone("twod1");
3148 
3149  float ccctest = 0; // to avoid empty massive elements
3150  for (int jphi = 0; jphi < nphi; jphi++) {
3151  double ccc1 = alexhe[i][jeta][jphi];
3152  if (ccc1 != 0.) {
3153  HEpositivedirection6->Fill(jphi, ccc1);
3154  ccctest = 1.; //HEpositivedirection6->SetBinError(i,0.01);
3155  }
3156  } // for jphi
3157  if (ccctest > 0.) {
3158  cout << "999 kcountHEpositivedirection6 = " << kcountHEpositivedirection6
3159  << " jeta-41= " << jeta - 41 << endl;
3160  c3x5->cd(kcountHEpositivedirection6);
3161  HEpositivedirection6->SetMarkerStyle(20);
3162  HEpositivedirection6->SetMarkerSize(0.4);
3163  HEpositivedirection6->GetYaxis()->SetLabelSize(0.04);
3164  HEpositivedirection6->SetXTitle("HEpositivedirection6 \b");
3165  HEpositivedirection6->SetMarkerColor(2);
3166  HEpositivedirection6->SetLineColor(0);
3167  gPad->SetGridy();
3168  gPad->SetGridx();
3169  // gPad->SetLogy();
3170  if (kcountHEpositivedirection6 == 1)
3171  HEpositivedirection6->SetXTitle("R for HE+ jeta = 19; depth = 6 \b");
3172  if (kcountHEpositivedirection6 == 2)
3173  HEpositivedirection6->SetXTitle("R for HE+ jeta = 20; depth = 6 \b");
3174  if (kcountHEpositivedirection6 == 3)
3175  HEpositivedirection6->SetXTitle("R for HE+ jeta = 21; depth = 6 \b");
3176  if (kcountHEpositivedirection6 == 4)
3177  HEpositivedirection6->SetXTitle("R for HE+ jeta = 22; depth = 6 \b");
3178  if (kcountHEpositivedirection6 == 5)
3179  HEpositivedirection6->SetXTitle("R for HE+ jeta = 23; depth = 6 \b");
3180  if (kcountHEpositivedirection6 == 6)
3181  HEpositivedirection6->SetXTitle("R for HE+ jeta = 24; depth = 6 \b");
3182  if (kcountHEpositivedirection6 == 7)
3183  HEpositivedirection6->SetXTitle("R for HE+ jeta = 25; depth = 6 \b");
3184  if (kcountHEpositivedirection6 == 8)
3185  HEpositivedirection6->SetXTitle("R for HE+ jeta = 26; depth = 6 \b");
3186  if (kcountHEpositivedirection6 == 9)
3187  HEpositivedirection6->SetXTitle("R for HE+ jeta = 27; depth = 6 \b");
3188  if (kcountHEpositivedirection6 == 10)
3189  HEpositivedirection6->SetXTitle("R for HE+ jeta = 28; depth = 6 \b");
3190  HEpositivedirection6->Draw("Error");
3191  kcountHEpositivedirection6++;
3192  if (kcountHEpositivedirection6 > 15)
3193  break; // 4x6 = 24
3194  } //ccctest>0
3195 
3196  } // for i
3197  } //if(jeta-41 > 0)
3198  } //for jeta
3200  c3x5->Update();
3201  c3x5->Print("Rhist1IterationMethodDepth6HE.png");
3202  c3x5->Clear();
3203  // clean-up
3204  if (h2CeffHEpositivedirection6)
3205  delete h2CeffHEpositivedirection6;
3206  //========================================================================================== 10
3207  //======================================================================
3208  //======================================================================1D plot: R vs phi , different eta, depth=7
3209  cout << " 1D plot: R vs phi , different eta, depth=7 *****" << endl;
3210  c3x5->Clear();
3212  c3x5->Divide(3, 5);
3213  c3x5->cd(1);
3214  int kcountHEpositivedirection7 = 1;
3215  TH1F *h2CeffHEpositivedirection7 = new TH1F("h2CeffHEpositivedirection7", "", nphi, 0., 72.);
3216 
3217  for (int jeta = 0; jeta < njeta; jeta++) {
3218  // positivedirection:
3219  if (jeta - 41 > 0) {
3220  // for (int i=0;i<ndepth;i++) {
3221  // depth=7
3222  for (int i = 6; i < 7; i++) {
3223  TH1F *HEpositivedirection7 = (TH1F *)h2CeffHEpositivedirection7->Clone("twod1");
3224 
3225  float ccctest = 0; // to avoid empty massive elements
3226  for (int jphi = 0; jphi < nphi; jphi++) {
3227  double ccc1 = alexhe[i][jeta][jphi];
3228  if (ccc1 != 0.) {
3229  HEpositivedirection7->Fill(jphi, ccc1);
3230  ccctest = 1.; //HEpositivedirection7->SetBinError(i,0.01);
3231  }
3232  } // for jphi
3233  if (ccctest > 0.) {
3234  cout << "1010 kcountHEpositivedirection7 = " << kcountHEpositivedirection7
3235  << " jeta-41= " << jeta - 41 << endl;
3236  c3x5->cd(kcountHEpositivedirection7);
3237  HEpositivedirection7->SetMarkerStyle(20);
3238  HEpositivedirection7->SetMarkerSize(0.4);
3239  HEpositivedirection7->GetYaxis()->SetLabelSize(0.04);
3240  HEpositivedirection7->SetXTitle("HEpositivedirection7 \b");
3241  HEpositivedirection7->SetMarkerColor(2);
3242  HEpositivedirection7->SetLineColor(0);
3243  gPad->SetGridy();
3244  gPad->SetGridx();
3245  // gPad->SetLogy();
3246  if (kcountHEpositivedirection7 == 1)
3247  HEpositivedirection7->SetXTitle("R for HE+ jeta = 26; depth = 7 \b");
3248  if (kcountHEpositivedirection7 == 2)
3249  HEpositivedirection7->SetXTitle("R for HE+ jeta = 27; depth = 7 \b");
3250  if (kcountHEpositivedirection7 == 3)
3251  HEpositivedirection7->SetXTitle("R for HE+ jeta = 28; depth = 7 \b");
3252  HEpositivedirection7->Draw("Error");
3253  kcountHEpositivedirection7++;
3254  if (kcountHEpositivedirection7 > 15)
3255  break; // 4x6 = 24
3256  } //ccctest>0
3257 
3258  } // for i
3259  } //if(jeta-41 > 0)
3260  } //for jeta
3262  c3x5->Update();
3263  c3x5->Print("Rhist1IterationMethodDepth7HE.png");
3264  c3x5->Clear();
3265  // clean-up
3266  if (h2CeffHEpositivedirection7)
3267  delete h2CeffHEpositivedirection7;
3268 
3269  // DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD:
3270 
3271  cout << " Start Vaiance: preparation *****" << endl;
3272  TH2F *mapdphinorm1HE1 = (TH2F *)hfile->Get("h_maprphinorm2_HE1");
3273  TH2F *mapdphinorm0HE1 = (TH2F *)hfile->Get("h_maprphinorm0_HE1");
3274  TH2F *mapdphinormHE1 = (TH2F *)mapdphinorm1HE1->Clone("mapdphinormHE1");
3275  mapdphinormHE1->Divide(mapdphinorm1HE1, mapdphinorm0HE1, 1, 1, "B");
3276  TH2F *mapdphinorm1HE2 = (TH2F *)hfile->Get("h_maprphinorm2_HE2");
3277  TH2F *mapdphinorm0HE2 = (TH2F *)hfile->Get("h_maprphinorm0_HE2");
3278  TH2F *mapdphinormHE2 = (TH2F *)mapdphinorm1HE2->Clone("mapdphinormHE2");
3279  mapdphinormHE2->Divide(mapdphinorm1HE2, mapdphinorm0HE2, 1, 1, "B");
3280  TH2F *mapdphinorm1HE3 = (TH2F *)hfile->Get("h_maprphinorm2_HE3");
3281  TH2F *mapdphinorm0HE3 = (TH2F *)hfile->Get("h_maprphinorm0_HE3");
3282  TH2F *mapdphinormHE3 = (TH2F *)mapdphinorm1HE3->Clone("mapdphinormHE3");
3283  mapdphinormHE3->Divide(mapdphinorm1HE3, mapdphinorm0HE3, 1, 1, "B");
3284  TH2F *mapdphinorm1HE4 = (TH2F *)hfile->Get("h_maprphinorm2_HE4");
3285  TH2F *mapdphinorm0HE4 = (TH2F *)hfile->Get("h_maprphinorm0_HE4");
3286  TH2F *mapdphinormHE4 = (TH2F *)mapdphinorm1HE4->Clone("mapdphinormHE4");
3287  mapdphinormHE4->Divide(mapdphinorm1HE4, mapdphinorm0HE4, 1, 1, "B");
3288  TH2F *mapdphinorm1HE5 = (TH2F *)hfile->Get("h_maprphinorm2_HE5");
3289  TH2F *mapdphinorm0HE5 = (TH2F *)hfile->Get("h_maprphinorm0_HE5");
3290  TH2F *mapdphinormHE5 = (TH2F *)mapdphinorm1HE5->Clone("mapdphinormHE5");
3291  mapdphinormHE5->Divide(mapdphinorm1HE5, mapdphinorm0HE5, 1, 1, "B");
3292  TH2F *mapdphinorm1HE6 = (TH2F *)hfile->Get("h_maprphinorm2_HE6");
3293  TH2F *mapdphinorm0HE6 = (TH2F *)hfile->Get("h_maprphinorm0_HE6");
3294  TH2F *mapdphinormHE6 = (TH2F *)mapdphinorm1HE6->Clone("mapdphinormHE6");
3295  mapdphinormHE6->Divide(mapdphinorm1HE6, mapdphinorm0HE6, 1, 1, "B");
3296  TH2F *mapdphinorm1HE7 = (TH2F *)hfile->Get("h_maprphinorm2_HE7");
3297  TH2F *mapdphinorm0HE7 = (TH2F *)hfile->Get("h_maprphinorm0_HE7");
3298  TH2F *mapdphinormHE7 = (TH2F *)mapdphinorm1HE7->Clone("mapdphinormHE7");
3299  mapdphinormHE7->Divide(mapdphinorm1HE7, mapdphinorm0HE7, 1, 1, "B");
3300  cout << " Vaiance: preparation DONE *****" << endl;
3301  //====================================================================== put Vaiance=Dispersia = Sig**2=<R**2> - (<R>)**2
3302  // = sum(R*R)/N - (sum(R)/N)**2
3303  // = mapdphinormHE1,2,3..7 - alexhe*alexhe
3304  for (int jeta = 0; jeta < njeta; jeta++) {
3305  for (int jphi = 0; jphi < njphi; jphi++) {
3306  variance[0][jeta][jphi] =
3307  fabs(mapdphinormHE1->GetBinContent(jeta + 1, jphi + 1) - alexhe[0][jeta][jphi] * alexhe[0][jeta][jphi]);
3308  if (variance[0][jeta][jphi] < 0.00003)
3309  variance[0][jeta][jphi] = 0.000067;
3310  variance[1][jeta][jphi] =
3311  fabs(mapdphinormHE2->GetBinContent(jeta + 1, jphi + 1) - alexhe[1][jeta][jphi] * alexhe[1][jeta][jphi]);
3312  if (variance[1][jeta][jphi] < 0.00003)
3313  variance[1][jeta][jphi] = 0.000067;
3314  variance[2][jeta][jphi] =
3315  fabs(mapdphinormHE3->GetBinContent(jeta + 1, jphi + 1) - alexhe[2][jeta][jphi] * alexhe[2][jeta][jphi]);
3316  if (variance[2][jeta][jphi] < 0.00003)
3317  variance[2][jeta][jphi] = 0.000067;
3318  variance[3][jeta][jphi] =
3319  fabs(mapdphinormHE4->GetBinContent(jeta + 1, jphi + 1) - alexhe[3][jeta][jphi] * alexhe[3][jeta][jphi]);
3320  if (variance[3][jeta][jphi] < 0.00003)
3321  variance[3][jeta][jphi] = 0.000067;
3322  variance[4][jeta][jphi] =
3323  fabs(mapdphinormHE5->GetBinContent(jeta + 1, jphi + 1) - alexhe[4][jeta][jphi] * alexhe[4][jeta][jphi]);
3324  if (variance[4][jeta][jphi] < 0.00003)
3325  variance[4][jeta][jphi] = 0.000067;
3326  variance[5][jeta][jphi] =
3327  fabs(mapdphinormHE6->GetBinContent(jeta + 1, jphi + 1) - alexhe[5][jeta][jphi] * alexhe[5][jeta][jphi]);
3328  if (variance[5][jeta][jphi] < 0.00003)
3329  variance[5][jeta][jphi] = 0.000067;
3330  variance[6][jeta][jphi] =
3331  fabs(mapdphinormHE7->GetBinContent(jeta + 1, jphi + 1) - alexhe[6][jeta][jphi] * alexhe[6][jeta][jphi]);
3332  if (variance[6][jeta][jphi] < 0.00003)
3333  variance[6][jeta][jphi] = 0.000067;
3334  }
3335  }
3336  cout << " Vaiance: DONE*****" << endl;
3337 
3338  //------------------------ 2D-eta/phi-plot: D, averaged over depthes
3339  //======================================================================
3340  //======================================================================
3341  cout << " R2D-eta/phi-plot: D, averaged over depthes *****" << endl;
3342  c1x1->Clear();
3344  c1x0->Divide(1, 1);
3345  c1x0->cd(1);
3346  TH2F *Defz42D = new TH2F("Defz42D", "", neta, -41., 41., nphi, 0., 72.);
3347  TH2F *Defz42D0 = new TH2F("Defz42D0", "", neta, -41., 41., nphi, 0., 72.);
3348  TH2F *Defz42DF = (TH2F *)Defz42D0->Clone("Defz42DF");
3349  for (int i = 0; i < ndepth; i++) {
3350  for (int jeta = 0; jeta < neta; jeta++) {
3351  for (int jphi = 0; jphi < nphi; jphi++) {
3352  double ccc1 = variance[i][jeta][jphi];
3353  int k2plot = jeta - 41;
3354  int kkk = k2plot; //if(k2plot >0 kkk=k2plot+1; //-41 +41 !=0
3355  if (alexhe[i][jeta][jphi] > 0.) {
3356  Defz42D->Fill(kkk, jphi, ccc1);
3357  Defz42D0->Fill(kkk, jphi, 1.);
3358  }
3359  }
3360  }
3361  }
3362  Defz42DF->Divide(Defz42D, Defz42D0, 1, 1, "B"); // average A
3363  // Defz1->Sumw2();
3364  gPad->SetGridy();
3365  gPad->SetGridx(); // gPad->SetLogz();
3366  Defz42DF->SetMarkerStyle(20);
3367  Defz42DF->SetMarkerSize(0.4);
3368  Defz42DF->GetZaxis()->SetLabelSize(0.08);
3369  Defz42DF->SetXTitle("<D>_depth #eta \b");
3370  Defz42DF->SetYTitle(" #phi \b");
3371  Defz42DF->SetZTitle("<D>_depth \b");
3372  Defz42DF->SetMarkerColor(2);
3373  Defz42DF->SetLineColor(0); // Defz42DF->SetMaximum(1.000); // Defz42DF->SetMinimum(1.0);
3374  Defz42DF->Draw("COLZ");
3376  c1x0->Update();
3377  c1x0->Print("Dhist2IterationMethodHE.png");
3378  c1x0->Clear();
3379  // clean-up
3380  if (Defz42D)
3381  delete Defz42D;
3382  if (Defz42D0)
3383  delete Defz42D0;
3384  if (Defz42DF)
3385  delete Defz42DF;
3386 
3387  //====================================================================== 1D plot: D vs phi , averaged over depthes & eta
3388  //======================================================================
3389  cout << " 1D plot: D vs phi , averaged over depthes & eta *****" << endl;
3390  c1x1->Clear();
3392  c1x1->Divide(1, 1);
3393  c1x1->cd(1);
3394  TH1F *Defz41D = new TH1F("Defz41D", "", nphi, 0., 72.);
3395  TH1F *Defz41D0 = new TH1F("Defz41D0", "", nphi, 0., 72.);
3396  TH1F *Defz41DF = (TH1F *)Defz41D0->Clone("Defz41DF");
3397 
3398  for (int jeta = 0; jeta < neta; jeta++) {
3399  // positivedirectionD:
3400  for (int jphi = 0; jphi < nphi; jphi++) {
3401  if (jeta - 41 > 0) {
3402  for (int i = 0; i < ndepth; i++) {
3403  double ccc1 = variance[i][jeta][jphi];
3404  if (alexhe[i][jeta][jphi] > 0.) {
3405  Defz41D->Fill(jphi, ccc1);
3406  Defz41D0->Fill(jphi, 1.);
3407  }
3408  }
3409  }
3410  }
3411  }
3412  // Defz41D->Sumw2();Defz41D0->Sumw2();
3413 
3414  Defz41DF->Divide(Defz41D, Defz41D0, 1, 1, "B"); // R averaged over depthes & eta
3415  Defz41D0->Sumw2();
3416  // for (int jphi=1;jphi<73;jphi++) {Defz41DF->SetBinError(jphi,0.01);}
3417  gPad->SetGridy();
3418  gPad->SetGridx(); // gPad->SetLogz();
3419  Defz41DF->SetMarkerStyle(20);
3420  Defz41DF->SetMarkerSize(1.4);
3421  Defz41DF->GetZaxis()->SetLabelSize(0.08);
3422  Defz41DF->SetXTitle("#phi \b");
3423  Defz41DF->SetYTitle(" <D> \b");
3424  Defz41DF->SetZTitle("<D>_PHI - AllDepthes \b");
3425  Defz41DF->SetMarkerColor(4);
3426  Defz41DF->SetLineColor(4);
3427  Defz41DF->SetMinimum(0.8);
3428  Defz41DF->SetMinimum(-0.015);
3429  Defz41DF->Draw("Error");
3431  c1x1->Update();
3432  c1x1->Print("Dhist1IterationMethodHE.png");
3433  c1x1->Clear();
3434  // clean-up
3435  if (Defz41D)
3436  delete Defz41D;
3437  if (Defz41D0)
3438  delete Defz41D0;
3439  if (Defz41DF)
3440  delete Defz41DF;
3441 
3442  //========================================================================================== 14
3443  //======================================================================
3444  //======================================================================1D plot: D vs phi , different eta, depth=1
3445  cout << " 1D plot: D vs phi , different eta, depth=1 *****" << endl;
3446  c3x5->Clear();
3448  c3x5->Divide(3, 5);
3449  c3x5->cd(1);
3450 
3451  int kcountHEpositivedirectionD1 = 1;
3452  TH1F *h2CeffHEpositivedirectionD1 = new TH1F("h2CeffHEpositivedirectionD1", "", nphi, 0., 72.);
3453 
3454  for (int jeta = 0; jeta < njeta; jeta++) {
3455  // positivedirectionD:
3456  if (jeta - 41 > 0) {
3457  // for (int i=0;i<ndepth;i++) {
3458  // depth=1
3459  for (int i = 0; i < 1; i++) {
3460  TH1F *HEpositivedirectionD1 = (TH1F *)h2CeffHEpositivedirectionD1->Clone("twod1");
3461 
3462  float ccctest = 0; // to avoid empty massive elements
3463  for (int jphi = 0; jphi < nphi; jphi++) {
3464  double ccc1 = variance[i][jeta][jphi];
3465  if (alexhe[i][jeta][jphi] > 0.) {
3466  HEpositivedirectionD1->Fill(jphi, ccc1);
3467  ccctest = 1.; //HEpositivedirectionD1->SetBinError(i,0.01);
3468  }
3469  } // for jphi
3470  if (ccctest > 0.) {
3471  cout << "1414 kcountHEpositivedirectionD1 = " << kcountHEpositivedirectionD1
3472  << " jeta-41= " << jeta - 41 << endl;
3473  c3x5->cd(kcountHEpositivedirectionD1);
3474  HEpositivedirectionD1->SetMarkerStyle(20);
3475  HEpositivedirectionD1->SetMarkerSize(0.4);
3476  HEpositivedirectionD1->GetYaxis()->SetLabelSize(0.04);
3477  HEpositivedirectionD1->SetXTitle("HEpositivedirectionD1 \b");
3478  HEpositivedirectionD1->SetMarkerColor(2);
3479  HEpositivedirectionD1->SetLineColor(0);
3480  gPad->SetGridy();
3481  gPad->SetGridx();
3482  // gPad->SetLogy();
3483  if (kcountHEpositivedirectionD1 == 1)
3484  HEpositivedirectionD1->SetXTitle("D for HE+ jeta = 18; depth = 1 \b");
3485  if (kcountHEpositivedirectionD1 == 2)
3486  HEpositivedirectionD1->SetXTitle("D for HE+ jeta = 19; depth = 1 \b");
3487  if (kcountHEpositivedirectionD1 == 3)
3488  HEpositivedirectionD1->SetXTitle("D for HE+ jeta = 20; depth = 1 \b");
3489  if (kcountHEpositivedirectionD1 == 4)
3490  HEpositivedirectionD1->SetXTitle("D for HE+ jeta = 21; depth = 1 \b");
3491  if (kcountHEpositivedirectionD1 == 5)
3492  HEpositivedirectionD1->SetXTitle("D for HE+ jeta = 22; depth = 1 \b");
3493  if (kcountHEpositivedirectionD1 == 6)
3494  HEpositivedirectionD1->SetXTitle("D for HE+ jeta = 23; depth = 1 \b");
3495  if (kcountHEpositivedirectionD1 == 7)
3496  HEpositivedirectionD1->SetXTitle("D for HE+ jeta = 24; depth = 1 \b");
3497  if (kcountHEpositivedirectionD1 == 8)
3498  HEpositivedirectionD1->SetXTitle("D for HE+ jeta = 25; depth = 1 \b");
3499  if (kcountHEpositivedirectionD1 == 9)
3500  HEpositivedirectionD1->SetXTitle("D for HE+ jeta = 26; depth = 1 \b");
3501  if (kcountHEpositivedirectionD1 == 10)
3502  HEpositivedirectionD1->SetXTitle("D for HE+ jeta = 27; depth = 1 \b");
3503  if (kcountHEpositivedirectionD1 == 11)
3504  HEpositivedirectionD1->SetXTitle("D for HE+ jeta = 28; depth = 1 \b");
3505  if (kcountHEpositivedirectionD1 == 12)
3506  HEpositivedirectionD1->SetXTitle("D for HE+ jeta = 29; depth = 1 \b");
3507  HEpositivedirectionD1->Draw("Error");
3508  kcountHEpositivedirectionD1++;
3509  if (kcountHEpositivedirectionD1 > 15)
3510  break; // 4x6 = 24
3511  } //ccctest>0
3512 
3513  } // for i
3514  } //if(jeta-41 > 0)
3515  } //for jeta
3517  c3x5->Update();
3518  c3x5->Print("Dhist1IterationMethodDepth1HE.png");
3519  c3x5->Clear();
3520  // clean-up
3521  if (h2CeffHEpositivedirectionD1)
3522  delete h2CeffHEpositivedirectionD1;
3523 
3524  //========================================================================================== 15
3525  //======================================================================
3526  //======================================================================1D plot: D vs phi , different eta, depth=2
3527  cout << " 1D plot: D vs phi , different eta, depth=2 *****" << endl;
3528  c3x5->Clear();
3529  c3x5->Divide(3, 5);
3530  c3x5->cd(1);
3531  int kcountHEpositivedirectionD2 = 1;
3532  TH1F *h2CeffHEpositivedirectionD2 = new TH1F("h2CeffHEpositivedirectionD2", "", nphi, 0., 72.);
3533 
3534  for (int jeta = 0; jeta < njeta; jeta++) {
3535  // positivedirectionD:
3536  if (jeta - 41 > 0) {
3537  // for (int i=0;i<ndepth;i++) {
3538  // depth=2
3539  for (int i = 1; i < 2; i++) {
3540  TH1F *HEpositivedirectionD2 = (TH1F *)h2CeffHEpositivedirectionD2->Clone("twod1");
3541 
3542  float ccctest = 0; // to avoid empty massive elements
3543  for (int jphi = 0; jphi < nphi; jphi++) {
3544  double ccc1 = variance[i][jeta][jphi];
3545  if (alexhe[i][jeta][jphi] > 0.) {
3546  HEpositivedirectionD2->Fill(jphi, ccc1);
3547  ccctest = 1.; //HEpositivedirectionD2->SetBinError(i,0.01);
3548  }
3549  } // for jphi
3550  if (ccctest > 0.) {
3551  cout << "1515 kcountHEpositivedirectionD2 = " << kcountHEpositivedirectionD2
3552  << " jeta-41= " << jeta - 41 << endl;
3553  c3x5->cd(kcountHEpositivedirectionD2);
3554  HEpositivedirectionD2->SetMarkerStyle(20);
3555  HEpositivedirectionD2->SetMarkerSize(0.4);
3556  HEpositivedirectionD2->GetYaxis()->SetLabelSize(0.04);
3557  HEpositivedirectionD2->SetXTitle("HEpositivedirectionD2 \b");
3558  HEpositivedirectionD2->SetMarkerColor(2);
3559  HEpositivedirectionD2->SetLineColor(0);
3560  gPad->SetGridy();
3561  gPad->SetGridx();
3562  // gPad->SetLogy();
3563  if (kcountHEpositivedirectionD2 == 1)
3564  HEpositivedirectionD2->SetXTitle("D for HE+ jeta = 17; depth = 2 \b");
3565  if (kcountHEpositivedirectionD2 == 2)
3566  HEpositivedirectionD2->SetXTitle("D for HE+ jeta = 18; depth = 2 \b");
3567  if (kcountHEpositivedirectionD2 == 3)
3568  HEpositivedirectionD2->SetXTitle("D for HE+ jeta = 19; depth = 2 \b");
3569  if (kcountHEpositivedirectionD2 == 4)
3570  HEpositivedirectionD2->SetXTitle("D for HE+ jeta = 20; depth = 2 \b");
3571  if (kcountHEpositivedirectionD2 == 5)
3572  HEpositivedirectionD2->SetXTitle("D for HE+ jeta = 21; depth = 2 \b");
3573  if (kcountHEpositivedirectionD2 == 6)
3574  HEpositivedirectionD2->SetXTitle("D for HE+ jeta = 22; depth = 2 \b");
3575  if (kcountHEpositivedirectionD2 == 7)
3576  HEpositivedirectionD2->SetXTitle("D for HE+ jeta = 23; depth = 2 \b");
3577  if (kcountHEpositivedirectionD2 == 8)
3578  HEpositivedirectionD2->SetXTitle("D for HE+ jeta = 24; depth = 2 \b");
3579  if (kcountHEpositivedirectionD2 == 9)
3580  HEpositivedirectionD2->SetXTitle("D for HE+ jeta = 25; depth = 2 \b");
3581  if (kcountHEpositivedirectionD2 == 10)
3582  HEpositivedirectionD2->SetXTitle("D for HE+ jeta = 26; depth = 2 \b");
3583  if (kcountHEpositivedirectionD2 == 11)
3584  HEpositivedirectionD2->SetXTitle("D for HE+ jeta = 27; depth = 2 \b");
3585  if (kcountHEpositivedirectionD2 == 12)
3586  HEpositivedirectionD2->SetXTitle("D for HE+ jeta = 28; depth = 2 \b");
3587  if (kcountHEpositivedirectionD2 == 13)
3588  HEpositivedirectionD2->SetXTitle("D for HE+ jeta = 29; depth = 2 \b");
3589  HEpositivedirectionD2->Draw("Error");
3590  kcountHEpositivedirectionD2++;
3591  if (kcountHEpositivedirectionD2 > 15)
3592  break; // 4x6 = 24
3593  } //ccctest>0
3594 
3595  } // for i
3596  } //if(jeta-41 > 0)
3597  } //for jeta
3599  c3x5->Update();
3600  c3x5->Print("Dhist1IterationMethodDepth2HE.png");
3601  c3x5->Clear();
3602  // clean-up
3603  if (h2CeffHEpositivedirectionD2)
3604  delete h2CeffHEpositivedirectionD2;
3605 
3606  //========================================================================================== 16
3607  //======================================================================
3608  //======================================================================1D plot: D vs phi , different eta, depth=3
3609  cout << " 1D plot: D vs phi , different eta, depth=3 *****" << endl;
3610  c3x5->Clear();
3611  c3x5->Divide(3, 5);
3612  c3x5->cd(1);
3613  int kcountHEpositivedirectionD3 = 1;
3614  TH1F *h2CeffHEpositivedirectionD3 = new TH1F("h2CeffHEpositivedirectionD3", "", nphi, 0., 72.);
3615 
3616  for (int jeta = 0; jeta < njeta; jeta++) {
3617  // positivedirectionD:
3618  if (jeta - 41 > 0) {
3619  // for (int i=0;i<ndepth;i++) {
3620  // depth=3
3621  for (int i = 2; i < 3; i++) {
3622  TH1F *HEpositivedirectionD3 = (TH1F *)h2CeffHEpositivedirectionD3->Clone("twod1");
3623 
3624  float ccctest = 0; // to avoid empty massive elements
3625  for (int jphi = 0; jphi < nphi; jphi++) {
3626  double ccc1 = variance[i][jeta][jphi];
3627  if (alexhe[i][jeta][jphi] > 0.) {
3628  HEpositivedirectionD3->Fill(jphi, ccc1);
3629  ccctest = 1.; //HEpositivedirectionD3->SetBinError(i,0.01);
3630  }
3631  } // for jphi
3632  if (ccctest > 0.) {
3633  cout << "1616 kcountHEpositivedirectionD3 = " << kcountHEpositivedirectionD3
3634  << " jeta-41= " << jeta - 41 << endl;
3635  c3x5->cd(kcountHEpositivedirectionD3);
3636  HEpositivedirectionD3->SetMarkerStyle(20);
3637  HEpositivedirectionD3->SetMarkerSize(0.4);
3638  HEpositivedirectionD3->GetYaxis()->SetLabelSize(0.04);
3639  HEpositivedirectionD3->SetXTitle("HEpositivedirectionD3 \b");
3640  HEpositivedirectionD3->SetMarkerColor(2);
3641  HEpositivedirectionD3->SetLineColor(0);
3642  gPad->SetGridy();
3643  gPad->SetGridx();
3644  // gPad->SetLogy();
3645  if (kcountHEpositivedirectionD3 == 1)
3646  HEpositivedirectionD3->SetXTitle("D for HE+ jeta = 17; depth = 3 \b");
3647  if (kcountHEpositivedirectionD3 == 2)
3648  HEpositivedirectionD3->SetXTitle("D for HE+ jeta = 18; depth = 3 \b");
3649  if (kcountHEpositivedirectionD3 == 3)
3650  HEpositivedirectionD3->SetXTitle("D for HE+ jeta = 19; depth = 3 \b");
3651  if (kcountHEpositivedirectionD3 == 4)
3652  HEpositivedirectionD3->SetXTitle("D for HE+ jeta = 20; depth = 3 \b");
3653  if (kcountHEpositivedirectionD3 == 5)
3654  HEpositivedirectionD3->SetXTitle("D for HE+ jeta = 21; depth = 3 \b");
3655  if (kcountHEpositivedirectionD3 == 6)
3656  HEpositivedirectionD3->SetXTitle("D for HE+ jeta = 22; depth = 3 \b");
3657  if (kcountHEpositivedirectionD3 == 7)
3658  HEpositivedirectionD3->SetXTitle("D for HE+ jeta = 23; depth = 3 \b");
3659  if (kcountHEpositivedirectionD3 == 8)
3660  HEpositivedirectionD3->SetXTitle("D for HE+ jeta = 24; depth = 3 \b");
3661  if (kcountHEpositivedirectionD3 == 9)
3662  HEpositivedirectionD3->SetXTitle("D for HE+ jeta = 25; depth = 3 \b");
3663  if (kcountHEpositivedirectionD3 == 10)
3664  HEpositivedirectionD3->SetXTitle("D for HE+ jeta = 26; depth = 3 \b");
3665  if (kcountHEpositivedirectionD3 == 11)
3666  HEpositivedirectionD3->SetXTitle("D for HE+ jeta = 27; depth = 3 \b");
3667  if (kcountHEpositivedirectionD3 == 12)
3668  HEpositivedirectionD3->SetXTitle("D for HE+ jeta = 28; depth = 3 \b");
3669  if (kcountHEpositivedirectionD3 == 13)
3670  HEpositivedirectionD3->SetXTitle("D for HE+ jeta = 29; depth = 3 \b");
3671  HEpositivedirectionD3->Draw("Error");
3672  kcountHEpositivedirectionD3++;
3673  if (kcountHEpositivedirectionD3 > 15)
3674  break; // 4x6 = 24
3675  } //ccctest>0
3676 
3677  } // for i
3678  } //if(jeta-41 > 0)
3679  } //for jeta
3681  c3x5->Update();
3682  c3x5->Print("Dhist1IterationMethodDepth3HE.png");
3683  c3x5->Clear();
3684  // clean-up
3685  if (h2CeffHEpositivedirectionD3)
3686  delete h2CeffHEpositivedirectionD3;
3687 
3688  //========================================================================================== 17
3689  //======================================================================
3690  //======================================================================1D plot: D vs phi , different eta, depth=4
3691  cout << " 1D plot: D vs phi , different eta, depth=4 *****" << endl;
3692  c3x5->Clear();
3693  c3x5->Divide(3, 5);
3694  c3x5->cd(1);
3695  int kcountHEpositivedirectionD4 = 1;
3696  TH1F *h2CeffHEpositivedirectionD4 = new TH1F("h2CeffHEpositivedirectionD4", "", nphi, 0., 72.);
3697 
3698  for (int jeta = 0; jeta < njeta; jeta++) {
3699  // positivedirectionD:
3700  if (jeta - 41 > 0) {
3701  // for (int i=0;i<ndepth;i++) {
3702  // depth=4
3703  for (int i = 3; i < 4; i++) {
3704  TH1F *HEpositivedirectionD4 = (TH1F *)h2CeffHEpositivedirectionD4->Clone("twod1");
3705 
3706  float ccctest = 0; // to avoid empty massive elements
3707  for (int jphi = 0; jphi < nphi; jphi++) {
3708  double ccc1 = variance[i][jeta][jphi];
3709  if (alexhe[i][jeta][jphi] > 0.) {
3710  HEpositivedirectionD4->Fill(jphi, ccc1);
3711  ccctest = 1.; //HEpositivedirectionD4->SetBinError(i,0.01);
3712  }
3713  } // for jphi
3714  if (ccctest > 0.) {
3715  cout << "1717 kcountHEpositivedirectionD4 = " << kcountHEpositivedirectionD4
3716  << " jeta-41= " << jeta - 41 << endl;
3717  c3x5->cd(kcountHEpositivedirectionD4);
3718  HEpositivedirectionD4->SetMarkerStyle(20);
3719  HEpositivedirectionD4->SetMarkerSize(0.4);
3720  HEpositivedirectionD4->GetYaxis()->SetLabelSize(0.04);
3721  HEpositivedirectionD4->SetXTitle("HEpositivedirectionD4 \b");
3722  HEpositivedirectionD4->SetMarkerColor(2);
3723  HEpositivedirectionD4->SetLineColor(0);
3724  gPad->SetGridy();
3725  gPad->SetGridx();
3726  // gPad->SetLogy();
3727  if (kcountHEpositivedirectionD4 == 1)
3728  HEpositivedirectionD4->SetXTitle("D for HE+ jeta = 16; depth = 4 \b");
3729  if (kcountHEpositivedirectionD4 == 2)
3730  HEpositivedirectionD4->SetXTitle("D for HE+ jeta = 18; depth = 4 \b");
3731  if (kcountHEpositivedirectionD4 == 3)
3732  HEpositivedirectionD4->SetXTitle("D for HE+ jeta = 19; depth = 4 \b");
3733  if (kcountHEpositivedirectionD4 == 4)
3734  HEpositivedirectionD4->SetXTitle("D for HE+ jeta = 20; depth = 4 \b");
3735  if (kcountHEpositivedirectionD4 == 5)
3736  HEpositivedirectionD4->SetXTitle("D for HE+ jeta = 21; depth = 4 \b");
3737  if (kcountHEpositivedirectionD4 == 6)
3738  HEpositivedirectionD4->SetXTitle("D for HE+ jeta = 22; depth = 4 \b");
3739  if (kcountHEpositivedirectionD4 == 7)
3740  HEpositivedirectionD4->SetXTitle("D for HE+ jeta = 23; depth = 4 \b");
3741  if (kcountHEpositivedirectionD4 == 8)
3742  HEpositivedirectionD4->SetXTitle("D for HE+ jeta = 24; depth = 4 \b");
3743  if (kcountHEpositivedirectionD4 == 9)
3744  HEpositivedirectionD4->SetXTitle("D for HE+ jeta = 25; depth = 4 \b");
3745  if (kcountHEpositivedirectionD4 == 10)
3746  HEpositivedirectionD4->SetXTitle("D for HE+ jeta = 26; depth = 4 \b");
3747  if (kcountHEpositivedirectionD4 == 11)
3748  HEpositivedirectionD4->SetXTitle("D for HE+ jeta = 27; depth = 4 \b");
3749  if (kcountHEpositivedirectionD4 == 12)
3750  HEpositivedirectionD4->SetXTitle("D for HE+ jeta = 28; depth = 4 \b");
3751  HEpositivedirectionD4->Draw("Error");
3752  kcountHEpositivedirectionD4++;
3753  if (kcountHEpositivedirectionD4 > 15)
3754  break; // 4x6 = 24
3755  } //ccctest>0
3756 
3757  } // for i
3758  } //if(jeta-41 > 0)
3759  } //for jeta
3761  c3x5->Update();
3762  c3x5->Print("Dhist1IterationMethodDepth4HE.png");
3763  c3x5->Clear();
3764  // clean-up
3765  if (h2CeffHEpositivedirectionD4)
3766  delete h2CeffHEpositivedirectionD4;
3767 
3768  //========================================================================================== 18
3769  //======================================================================
3770  //======================================================================1D plot: D vs phi , different eta, depth=5
3771  cout << " 1D plot: D vs phi , different eta, depth=5 *****" << endl;
3772  c3x5->Clear();
3773  c3x5->Divide(3, 5);
3774  c3x5->cd(1);
3775  int kcountHEpositivedirectionD5 = 1;
3776  TH1F *h2CeffHEpositivedirectionD5 = new TH1F("h2CeffHEpositivedirectionD5", "", nphi, 0., 72.);
3777 
3778  for (int jeta = 0; jeta < njeta; jeta++) {
3779  // positivedirectionD:
3780  if (jeta - 41 > 0) {
3781  // for (int i=0;i<ndepth;i++) {
3782  // depth=5
3783  for (int i = 4; i < 5; i++) {
3784  TH1F *HEpositivedirectionD5 = (TH1F *)h2CeffHEpositivedirectionD5->Clone("twod1");
3785 
3786  float ccctest = 0; // to avoid empty massive elements
3787  for (int jphi = 0; jphi < nphi; jphi++) {
3788  double ccc1 = variance[i][jeta][jphi];
3789  if (alexhe[i][jeta][jphi] > 0.) {
3790  HEpositivedirectionD5->Fill(jphi, ccc1);
3791  ccctest = 1.; //HEpositivedirectionD5->SetBinError(i,0.01);
3792  }
3793  } // for jphi
3794  if (ccctest > 0.) {
3795  cout << "1818 kcountHEpositivedirectionD5 = " << kcountHEpositivedirectionD5
3796  << " jeta-41= " << jeta - 41 << endl;
3797  c3x5->cd(kcountHEpositivedirectionD5);
3798  HEpositivedirectionD5->SetMarkerStyle(20);
3799  HEpositivedirectionD5->SetMarkerSize(0.4);
3800  HEpositivedirectionD5->GetYaxis()->SetLabelSize(0.04);
3801  HEpositivedirectionD5->SetXTitle("HEpositivedirectionD5 \b");
3802  HEpositivedirectionD5->SetMarkerColor(2);
3803  HEpositivedirectionD5->SetLineColor(0);
3804  gPad->SetGridy();
3805  gPad->SetGridx();
3806  // gPad->SetLogy();
3807  if (kcountHEpositivedirectionD5 == 1)
3808  HEpositivedirectionD5->SetXTitle("D for HE+ jeta = 18; depth = 5 \b");
3809  if (kcountHEpositivedirectionD5 == 2)
3810  HEpositivedirectionD5->SetXTitle("D for HE+ jeta = 19; depth = 5 \b");
3811  if (kcountHEpositivedirectionD5 == 3)
3812  HEpositivedirectionD5->SetXTitle("D for HE+ jeta = 20; depth = 5 \b");
3813  if (kcountHEpositivedirectionD5 == 4)
3814  HEpositivedirectionD5->SetXTitle("D for HE+ jeta = 21; depth = 5 \b");
3815  if (kcountHEpositivedirectionD5 == 5)
3816  HEpositivedirectionD5->SetXTitle("D for HE+ jeta = 22; depth = 5 \b");
3817  if (kcountHEpositivedirectionD5 == 6)
3818  HEpositivedirectionD5->SetXTitle("D for HE+ jeta = 23; depth = 5 \b");
3819  if (kcountHEpositivedirectionD5 == 7)
3820  HEpositivedirectionD5->SetXTitle("D for HE+ jeta = 24; depth = 5 \b");
3821  if (kcountHEpositivedirectionD5 == 8)
3822  HEpositivedirectionD5->SetXTitle("D for HE+ jeta = 25; depth = 5 \b");
3823  if (kcountHEpositivedirectionD5 == 9)
3824  HEpositivedirectionD5->SetXTitle("D for HE+ jeta = 26; depth = 5 \b");
3825  if (kcountHEpositivedirectionD5 == 10)
3826  HEpositivedirectionD5->SetXTitle("D for HE+ jeta = 27; depth = 5 \b");
3827  if (kcountHEpositivedirectionD5 == 11)
3828  HEpositivedirectionD5->SetXTitle("D for HE+ jeta = 28; depth = 5 \b");
3829  HEpositivedirectionD5->Draw("Error");
3830  kcountHEpositivedirectionD5++;
3831  if (kcountHEpositivedirectionD5 > 15)
3832  break; // 4x6 = 24
3833  } //ccctest>0
3834 
3835  } // for i
3836  } //if(jeta-41 > 0)
3837  } //for jeta
3839  c3x5->Update();
3840  c3x5->Print("Dhist1IterationMethodDepth5HE.png");
3841  c3x5->Clear();
3842  // clean-up
3843  if (h2CeffHEpositivedirectionD5)
3844  delete h2CeffHEpositivedirectionD5;
3845 
3846  //========================================================================================== 19
3847  //======================================================================
3848  //======================================================================1D plot: D vs phi , different eta, depth=6
3849  cout << " 1D plot: D vs phi , different eta, depth=6 *****" << endl;
3850  c3x5->Clear();
3851  c3x5->Divide(3, 5);
3852  c3x5->cd(1);
3853  int kcountHEpositivedirectionD6 = 1;
3854  TH1F *h2CeffHEpositivedirectionD6 = new TH1F("h2CeffHEpositivedirectionD6", "", nphi, 0., 72.);
3855 
3856  for (int jeta = 0; jeta < njeta; jeta++) {
3857  // positivedirectionD:
3858  if (jeta - 41 > 0) {
3859  // for (int i=0;i<ndepth;i++) {
3860  // depth=6
3861  for (int i = 5; i < 6; i++) {
3862  TH1F *HEpositivedirectionD6 = (TH1F *)h2CeffHEpositivedirectionD6->Clone("twod1");
3863 
3864  float ccctest = 0; // to avoid empty massive elements
3865  for (int jphi = 0; jphi < nphi; jphi++) {
3866  double ccc1 = variance[i][jeta][jphi];
3867  if (alexhe[i][jeta][jphi] > 0.) {
3868  HEpositivedirectionD6->Fill(jphi, ccc1);
3869  ccctest = 1.; //HEpositivedirectionD6->SetBinError(i,0.01);
3870  }
3871  } // for jphi
3872  if (ccctest > 0.) {
3873  cout << "1919 kcountHEpositivedirectionD6 = " << kcountHEpositivedirectionD6
3874  << " jeta-41= " << jeta - 41 << endl;
3875  c3x5->cd(kcountHEpositivedirectionD6);
3876  HEpositivedirectionD6->SetMarkerStyle(20);
3877  HEpositivedirectionD6->SetMarkerSize(0.4);
3878  HEpositivedirectionD6->GetYaxis()->SetLabelSize(0.04);
3879  HEpositivedirectionD6->SetXTitle("HEpositivedirectionD6 \b");
3880  HEpositivedirectionD6->SetMarkerColor(2);
3881  HEpositivedirectionD6->SetLineColor(0);
3882  gPad->SetGridy();
3883  gPad->SetGridx();
3884  // gPad->SetLogy();
3885  if (kcountHEpositivedirectionD6 == 1)
3886  HEpositivedirectionD6->SetXTitle("D for HE+ jeta = 19; depth = 6 \b");
3887  if (kcountHEpositivedirectionD6 == 2)
3888  HEpositivedirectionD6->SetXTitle("D for HE+ jeta = 20; depth = 6 \b");
3889  if (kcountHEpositivedirectionD6 == 3)
3890  HEpositivedirectionD6->SetXTitle("D for HE+ jeta = 21; depth = 6 \b");
3891  if (kcountHEpositivedirectionD6 == 4)
3892  HEpositivedirectionD6->SetXTitle("D for HE+ jeta = 22; depth = 6 \b");
3893  if (kcountHEpositivedirectionD6 == 5)
3894  HEpositivedirectionD6->SetXTitle("D for HE+ jeta = 23; depth = 6 \b");
3895  if (kcountHEpositivedirectionD6 == 6)
3896  HEpositivedirectionD6->SetXTitle("D for HE+ jeta = 24; depth = 6 \b");
3897  if (kcountHEpositivedirectionD6 == 7)
3898  HEpositivedirectionD6->SetXTitle("D for HE+ jeta = 25; depth = 6 \b");
3899  if (kcountHEpositivedirectionD6 == 8)
3900  HEpositivedirectionD6->SetXTitle("D for HE+ jeta = 26; depth = 6 \b");
3901  if (kcountHEpositivedirectionD6 == 9)
3902  HEpositivedirectionD6->SetXTitle("D for HE+ jeta = 27; depth = 6 \b");
3903  if (kcountHEpositivedirectionD6 == 10)
3904  HEpositivedirectionD6->SetXTitle("D for HE+ jeta = 28; depth = 6 \b");
3905  HEpositivedirectionD6->Draw("Error");
3906  kcountHEpositivedirectionD6++;
3907  if (kcountHEpositivedirectionD6 > 15)
3908  break; // 4x6 = 24
3909  } //ccctest>0
3910 
3911  } // for i
3912  } //if(jeta-41 > 0)
3913  } //for jeta
3915  c3x5->Update();
3916  c3x5->Print("Dhist1IterationMethodDepth6HE.png");
3917  c3x5->Clear();
3918  // clean-up
3919  if (h2CeffHEpositivedirectionD6)
3920  delete h2CeffHEpositivedirectionD6;
3921 
3922  //========================================================================================== 20
3923  //======================================================================
3924  //======================================================================1D plot: D vs phi , different eta, depth=7
3925  cout << " 1D plot: D vs phi , different eta, depth=7 *****" << endl;
3926  c3x5->Clear();
3927  c3x5->Divide(3, 5);
3928  c3x5->cd(1);
3929  int kcountHEpositivedirectionD7 = 1;
3930  TH1F *h2CeffHEpositivedirectionD7 = new TH1F("h2CeffHEpositivedirectionD7", "", nphi, 0., 72.);
3931 
3932  for (int jeta = 0; jeta < njeta; jeta++) {
3933  // positivedirectionD:
3934  if (jeta - 41 > 0) {
3935  // for (int i=0;i<ndepth;i++) {
3936  // depth=7
3937  for (int i = 6; i < 7; i++) {
3938  TH1F *HEpositivedirectionD7 = (TH1F *)h2CeffHEpositivedirectionD7->Clone("twod1");
3939 
3940  float ccctest = 0; // to avoid empty massive elements
3941  for (int jphi = 0; jphi < nphi; jphi++) {
3942  double ccc1 = variance[i][jeta][jphi];
3943  if (alexhe[i][jeta][jphi] > 0.) {
3944  HEpositivedirectionD7->Fill(jphi, ccc1);
3945  ccctest = 1.; //HEpositivedirectionD7->SetBinError(i,0.01);
3946  }
3947  } // for jphi
3948  if (ccctest != 0.) {
3949  cout << "2020 kcountHEpositivedirectionD7 = " << kcountHEpositivedirectionD7
3950  << " jeta-41= " << jeta - 41 << endl;
3951  c3x5->cd(kcountHEpositivedirectionD7);
3952  HEpositivedirectionD7->SetMarkerStyle(20);
3953  HEpositivedirectionD7->SetMarkerSize(0.4);
3954  HEpositivedirectionD7->GetYaxis()->SetLabelSize(0.04);
3955  HEpositivedirectionD7->SetXTitle("HEpositivedirectionD7 \b");
3956  HEpositivedirectionD7->SetMarkerColor(2);
3957  HEpositivedirectionD7->SetLineColor(0);
3958  gPad->SetGridy();
3959  gPad->SetGridx();
3960  // gPad->SetLogy();
3961  if (kcountHEpositivedirectionD7 == 1)
3962  HEpositivedirectionD7->SetXTitle("D for HE+ jeta = 26; depth = 7 \b");
3963  if (kcountHEpositivedirectionD7 == 2)
3964  HEpositivedirectionD7->SetXTitle("D for HE+ jeta = 27; depth = 7 \b");
3965  if (kcountHEpositivedirectionD7 == 3)
3966  HEpositivedirectionD7->SetXTitle("D for HE+ jeta = 28; depth = 7 \b");
3967  HEpositivedirectionD7->Draw("Error");
3968  kcountHEpositivedirectionD7++;
3969  if (kcountHEpositivedirectionD7 > 15)
3970  break; // 4x6 = 24
3971  } //ccctest>0
3972 
3973  } // for i
3974  } //if(jeta-41 > 0)
3975  } //for jeta
3977  c3x5->Update();
3978  c3x5->Print("Dhist1IterationMethodDepth7HE.png");
3979  c3x5->Clear();
3980  // clean-up
3981  if (h2CeffHEpositivedirectionD7)
3982  delete h2CeffHEpositivedirectionD7;
3983 
3984  //=====================================================================
3985  //======================================================================
3986  //======================================================================
3987  //======================================================================
3988  //======================================================================
3989  //======================================================================
3990 
3991  std::cout << " We are here to print 2017 MAPs " << std::endl;
3992  //======================================================================
3993 
3994  //======================================================================
3996 
3997  TH2F *Map_ALL = new TH2F("Map_All", "Map_all", 82, -41, 40, 72, 0, 71);
3998  int nx = Map_ALL->GetXaxis()->GetNbins();
3999  int ny = Map_ALL->GetYaxis()->GetNbins();
4000  int NBad = 0;
4001  int NWarn = 0;
4002  int NCalib = 0;
4003  int NPed = 0;
4004  // int Eta[3][10000]={0};
4005  int Eta[4][10000] = {0};
4006  int Phi[4][10000] = {0};
4007  int Sub[4][10000] = {0};
4008  int Depth[4][10000] = {0};
4009  string Comment[4][10000] = {""};
4010  string Text[33] = {"", "Cm", "Am", "Wm", "Rm", "TNm", "TXm", "", "", "", "", "Cc", "Ac", "Wc", "Rc", "TNc", "TXc",
4011  "", "", "", "", "GS", "", "", "", "", "", "", "", "", "", "Pm", "pWm"};
4012  int flag_W = 0;
4013  int flag_B = 0;
4014  int flag_P = 0;
4015 
4016  for (int i = 1; i <= nx; i++) { //Eta
4017  for (int j = 1; j <= ny; j++) { // Phi
4018  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
4019  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
4020  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
4021  // int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
4022  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
4023  if (Map_SUB[sub][k]->GetBinContent(i, j) != 0) {
4024  Map_SUB[sub][k]->SetBinContent(i, j, 0.5);
4025  Map_ALL->SetBinContent(i, j, 0.5);
4026  }
4027  }
4028  }
4029  }
4030  }
4031 
4032  for (int i = 1; i <= nx; i++) { //Eta
4033  for (int j = 1; j <= ny; j++) { // Phi
4034  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
4035  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
4036  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
4037  // int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
4038  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
4039  flag_W = 0;
4040  flag_B = 0;
4041  flag_P = 0;
4042  for (int test = 1; test <= 6; test++) { //Test: 1-Wm, 2-Rm, etc
4043  //Bad
4044  if (Map_Ampl[test][sub][k]->GetBinContent(i, j) >
4045  0.1) { //Rate 0.1 for displaying on whole detector map and subdetector map
4046  Map_ALL->SetBinContent(i, j, 1.);
4047  Map_SUB[sub][k]->SetBinContent(i, j, 1.);
4048  if (flag_B == 0) {
4049  NBad += 1;
4050  Eta[2][NBad] = i - 41;
4051  Phi[2][NBad] = j - 1;
4052  Sub[2][NBad] = sub;
4053  Depth[2][NBad] = k;
4054  Comment[2][NBad] = Text[test];
4055  } else
4056  Comment[2][NBad] += ", " + Text[test];
4057  flag_B = 1;
4058  // cout<<"Map_Ampl["<<test<<"]["<<sub<<"]["<<k<<"]->GetBinContent("<<i<<","<<j<<")= "<<Map_Ampl[test][sub][k]->GetBinContent(i,j)<<endl;
4059  }
4060  //Warning
4061  /*
4062  if ((Map_Ampl[test][sub][k]->GetBinContent(i,j) != 0.)&&(Map_Ampl[test][sub][k]->GetBinContent(i,j) < 0.001) ) {
4063  if (Map_SUB[sub][k]->GetBinContent(i,j)!=1.) Map_SUB[sub][k]->SetBinContent(i,j,0.75);
4064  if (Map_ALL->GetBinContent(i,j)!=1.) Map_ALL->SetBinContent(i,j,0.75);
4065  if (flag_W == 0) {
4066  NWarn +=1;
4067  Eta[1][NWarn]=i-41;
4068  Phi[1][NWarn]=j-1;
4069  Sub[1][NWarn]=sub;
4070  Depth[1][NWarn]=k;
4071  Comment[1][NWarn]=Text[test];
4072  }
4073  else Comment[1][NWarn]+=", "+Text[test];
4074  flag_W = 1;
4075 // cout<<"Map_Ampl["<<test<<"]["<<sub<<"]["<<k<<"]->GetBinContent("<<i<<","<<j<<")= "<<Map_Ampl[test][sub][k]->GetBinContent(i,j)<<endl;
4076  }
4077 */
4078 
4079  } //end test
4080 
4081  //Calib
4082  /*
4083  for (int test=11;test<=16;test++) { //Test: 1-2.E, 2-2.F, etc
4084  if (Map_Ampl[test][sub][k]->GetBinContent(i,j) != 0.) {
4085 // if (Map_SUB[sub][k]->GetBinContent(i,j)!=1.0) Map_SUB[sub][k]->SetBinContent(i,j,0.3);
4086 // if (Map_ALL->GetBinContent(i,j)!=1.) Map_ALL->SetBinContent(i,j,0.3);
4087  if (flag_W == 0) {
4088  NWarn +=1;
4089  Eta[1][NWarn]=i-41;
4090  Phi[1][NWarn]=j-1;
4091  Sub[1][NWarn]=sub;
4092  Depth[1][NWarn]=k;
4093  Comment[1][NWarn]=Text[test];
4094  }
4095  else Comment[1][NWarn]+=", "+Text[test];
4096  flag_W = 1;
4097 // cout<<"Map_Ampl["<<test<<"]["<<sub<<"]["<<k<<"]->GetBinContent("<<i<<","<<j<<")= "<<Map_Ampl[test][sub][k]->GetBinContent(i,j)<<endl;
4098  }
4099  } //end test
4100 */
4101  //Gain stabil
4102  for (int test = 21; test <= 21; test++) {
4103  if (abs(Map_Ampl[test][sub][k]->GetBinContent(i, j)) > porog[sub]) {
4104  if (Map_SUB[sub][k]->GetBinContent(i, j) != 1.0)
4105  Map_SUB[sub][k]->SetBinContent(i, j, 0.75);
4106  if (Map_ALL->GetBinContent(i, j) != 1.) {
4107  Map_ALL->SetBinContent(i, j, 0.75);
4108  if (flag_W == 0) {
4109  NWarn += 1;
4110  Eta[1][NWarn] = i - 41;
4111  Phi[1][NWarn] = j - 1;
4112  Sub[1][NWarn] = sub;
4113  Depth[1][NWarn] = k;
4114  Comment[1][NWarn] = Text[test];
4115  } else
4116  Comment[1][NWarn] += ", " + Text[test];
4117  flag_W = 1;
4118 
4119  cout << "Map_Ampl[" << test << "][" << sub << "][" << k << "]->GetBinContent(" << i << "," << j
4120  << ")= " << Map_Ampl[test][sub][k]->GetBinContent(i, j) << endl;
4121  }
4122  }
4123  } //end test
4124 
4125  //Pedestals
4126  for (int test = 31; test <= 32; test++) {
4127  if (Map_Ampl[test][sub][k]->GetBinContent(i, j) > 0.1) {
4128  // if (Map_SUB[sub][k]->GetBinContent(i,j)!=1.0) Map_SUB[sub][k]->SetBinContent(i,j,0.75);
4129  // if (Map_ALL->GetBinContent(i,j)!=1.) Map_ALL->SetBinContent(i,j,0.75);
4130  if (flag_P == 0) {
4131  NPed += 1;
4132  Eta[3][NPed] = i - 41;
4133  Phi[3][NPed] = j - 1;
4134  Sub[3][NPed] = sub;
4135  Depth[3][NPed] = k;
4136  Comment[3][NPed] = Text[test];
4137  } else
4138  Comment[3][NPed] += ", " + Text[test];
4139  flag_P = 1;
4140 
4141  // cout<<"Map_Ampl["<<test<<"]["<<sub<<"]["<<k<<"]->GetBinContent("<<i<<","<<j<<")= "<<Map_Ampl[test][sub][k]->GetBinContent(i,j)<<endl;
4142  }
4143  } //end test
4144 
4145  } //end Depth
4146  } //end Sub
4147  } //end Phi
4148  } //end Eta
4149  // subdet maps
4150  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
4151 
4152  std::cout << " 2017 MAPS_SUB " << sub << std::endl;
4153  // if (sub==1) cHB->Divide(2,1);
4154  if (sub == 1)
4155  cHB->Divide(2, 2);
4156  // if (sub==2) cHE->Divide(3,1);
4157  if (sub == 2)
4158  cHE->Divide(3, 3);
4159  if (sub == 3)
4160  cONE->Divide(1, 1);
4161  // if (sub==4) cHB->Divide(2,1);
4162  if (sub == 4)
4163  cHF->Divide(2, 2);
4164  // int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
4165  // int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
4166  // int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
4167  for (int k = k_min[sub]; k <= k_max[sub]; k++) { //Depth
4168  if (sub == 1)
4169  cHB->cd(k);
4170  if (sub == 2)
4171  cHE->cd(k);
4172  if (sub == 3)
4173  cONE->cd(k - 3);
4174  if (sub == 4)
4175  cHF->cd(k);
4176  gPad->SetGridy();
4177  gPad->SetGridx();
4178  // gPad->SetLogz();
4179  // gStyle->SetTitleOffset(0.5, "Y");
4180  if (sub == 1)
4181  sprintf(str, "HB, Depth%d \b", k);
4182  if (sub == 2)
4183  sprintf(str, "HE, Depth%d \b", k);
4184  if (sub == 3)
4185  sprintf(str, "HO, Depth%d \b", k);
4186  if (sub == 4)
4187  sprintf(str, "HF, Depth%d \b", k);
4188  Map_SUB[sub][k]->SetTitle(str);
4189  Map_SUB[sub][k]->SetXTitle("#eta \b");
4190  Map_SUB[sub][k]->SetYTitle("#phi \b");
4191  Map_SUB[sub][k]->Draw("COL");
4192  Map_SUB[sub][k]->GetYaxis()->SetRangeUser(0, 72.);
4193  Map_SUB[sub][k]->GetZaxis()->SetRangeUser(0., 1.);
4194  if (sub == 1) {
4195  cHB->Modified();
4196  cHB->Update();
4197  }
4198  if (sub == 2) {
4199  cHE->Modified();
4200  cHE->Update();
4201  }
4202  if (sub == 3) {
4203  cONE->Modified();
4204  cONE->Update();
4205  }
4206  if (sub == 4) {
4207  cHF->Modified();
4208  cHF->Update();
4209  }
4210  } //end depth
4211  if (sub == 1) {
4212  cHB->Print("MAPHB.png");
4213  cHB->Clear();
4214  }
4215  if (sub == 2) {
4216  cHE->Print("MAPHE.png");
4217  cHE->Clear();
4218  }
4219  if (sub == 3) {
4220  cONE->Print("MAPHO.png");
4221  cONE->Clear();
4222  }
4223  if (sub == 4) {
4224  cHF->Print("MAPHF.png");
4225  cHF->Clear();
4226  }
4227  }
4228 
4230  // TCanvas *cmain1 = new TCanvas("cmain1","MAP",200,10,1400,1800);
4231  TCanvas *cmain1 = new TCanvas("cmain1", "MAP", 250, 10, 1450, 1410);
4232  cmain1->Divide(2, 2);
4233 
4234  cmain1->cd(1);
4235  TH1F *JDBEYESJ0 = (TH1F *)hfile->Get("h_totalAmplitudeHBperEvent");
4236  JDBEYESJ0->SetStats(0);
4237  JDBEYESJ0->SetMarkerStyle(20);
4238  JDBEYESJ0->SetMarkerSize(0.8);
4239  JDBEYESJ0->GetYaxis()->SetLabelSize(0.04);
4240  JDBEYESJ0->SetXTitle("iEvent \b");
4241  JDBEYESJ0->SetYTitle("totalAmplitude perEvent \b");
4242  JDBEYESJ0->SetTitle("HB \b");
4243  JDBEYESJ0->SetMarkerColor(2);
4244  JDBEYESJ0->SetLineColor(1);
4245  JDBEYESJ0->SetMinimum(0.8);
4246  JDBEYESJ0->Draw("HIST same P0");
4247 
4248  cmain1->cd(2);
4249  TH1F *JDBEYESJ1 = (TH1F *)hfile->Get("h_totalAmplitudeHEperEvent");
4250  JDBEYESJ1->SetStats(0);
4251  JDBEYESJ1->SetMarkerStyle(20);
4252  JDBEYESJ1->SetMarkerSize(0.8);
4253  JDBEYESJ1->GetYaxis()->SetLabelSize(0.04);
4254  JDBEYESJ1->SetXTitle("iEvent \b");
4255  JDBEYESJ1->SetYTitle("totalAmplitude perEvent \b");
4256  JDBEYESJ1->SetTitle("HE \b");
4257  JDBEYESJ1->SetMarkerColor(2);
4258  JDBEYESJ1->SetLineColor(1);
4259  JDBEYESJ1->SetMinimum(0.8);
4260  JDBEYESJ1->Draw("HIST same P0");
4261 
4262  cmain1->cd(3);
4263  TH1F *JDBEYESJ2 = (TH1F *)hfile->Get("h_totalAmplitudeHFperEvent");
4264  JDBEYESJ2->SetStats(0);
4265  JDBEYESJ2->SetMarkerStyle(20);
4266  JDBEYESJ2->SetMarkerSize(0.8);
4267  JDBEYESJ2->GetYaxis()->SetLabelSize(0.04);
4268  JDBEYESJ2->SetXTitle("iEvent \b");
4269  JDBEYESJ2->SetYTitle("totalAmplitude perEvent \b");
4270  JDBEYESJ2->SetTitle("HF \b");
4271  JDBEYESJ2->SetMarkerColor(2);
4272  JDBEYESJ2->SetLineColor(1);
4273  JDBEYESJ2->SetMinimum(0.8);
4274  JDBEYESJ2->Draw("HIST same P0");
4275 
4276  cmain1->cd(4);
4277  TH1F *JDBEYESJ3 = (TH1F *)hfile->Get("h_totalAmplitudeHOperEvent");
4278  JDBEYESJ3->SetStats(0);
4279  JDBEYESJ3->SetMarkerStyle(20);
4280  JDBEYESJ3->SetMarkerSize(0.8);
4281  JDBEYESJ3->GetYaxis()->SetLabelSize(0.04);
4282  JDBEYESJ3->SetXTitle("iEvent \b");
4283  JDBEYESJ3->SetYTitle("totalAmplitude perEvent \b");
4284  JDBEYESJ3->SetTitle("HO \b");
4285  JDBEYESJ3->SetMarkerColor(2);
4286  JDBEYESJ3->SetLineColor(1);
4287  JDBEYESJ3->SetMinimum(0.8);
4288  JDBEYESJ3->Draw("HIST same P0");
4289 
4290  cmain1->Modified();
4291  cmain1->Update();
4292  cmain1->Print("EVENTDEPENDENCE.png");
4293 
4294  std::cout << " EVENTDEPENDENCE " << std::endl;
4295 
4297  // ALL SubDet
4298  gStyle->SetOptTitle(0);
4299  TCanvas *cmain = new TCanvas("cmain", "MAP", 1000, 1000);
4300  //cmain->cd(1);
4301  gPad->SetGridy();
4302  gPad->SetGridx();
4303  // gPad->SetLogz();
4304  Map_ALL->SetTitleOffset(1.3, "Y");
4305  Map_ALL->SetXTitle("#eta \b");
4306  Map_ALL->SetYTitle("#phi \b");
4307  Map_ALL->Draw("COL");
4308  Map_ALL->GetYaxis()->SetRangeUser(0, 72.);
4309  Map_ALL->GetZaxis()->SetRangeUser(0, 1.);
4310  cmain->Modified();
4311  cmain->Update();
4312  cmain->Print("MAP.png");
4313 
4314  std::cout << "******** MAP_ALL done" << std::endl;
4315  std::cout << "********" << std::endl;
4316 
4317  std::cout << "********" << std::endl;
4318  std::cout << "************ Start creating each test kind for each subdet html pages:" << std::endl;
4319 
4320  //======================================================================
4321 
4322  //======================================================================
4323  // Creating each test kind for each subdet html pages:
4324  std::string raw_class, raw_class1, raw_class2, raw_class3;
4325  int ind = 0;
4326 
4327  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
4328  ofstream htmlFileT, htmlFileC, htmlFileD, htmlFileP, htmlFileS, htmlFileM;
4329  if (sub == 1) {
4330  htmlFileT.open("HB_Tile.html");
4331  htmlFileC.open("HB_Calib.html");
4332  htmlFileD.open("HB_Drift.html");
4333  htmlFileP.open("HB_Pedestals.html");
4334  htmlFileS.open("HB_Shapes.html");
4335  }
4336  if (sub == 2) {
4337  htmlFileT.open("HE_Tile.html");
4338  htmlFileC.open("HE_Calib.html");
4339  htmlFileD.open("HE_Drift.html");
4340  htmlFileP.open("HE_Pedestals.html");
4341  htmlFileS.open("HE_Shapes.html");
4342  htmlFileM.open("HE_IterationMethod.html");
4343  }
4344  if (sub == 3) {
4345  htmlFileT.open("HO_Tile.html");
4346  htmlFileC.open("HO_Calib.html");
4347  htmlFileD.open("HO_Drift.html");
4348  htmlFileP.open("HO_Pedestals.html");
4349  htmlFileS.open("HO_Shapes.html");
4350  }
4351  if (sub == 4) {
4352  htmlFileT.open("HF_Tile.html");
4353  htmlFileC.open("HF_Calib.html");
4354  htmlFileD.open("HF_Drift.html");
4355  htmlFileP.open("HF_Pedestals.html");
4356  htmlFileS.open("HF_Shapes.html");
4357  }
4358 
4359  // Megatile channels
4360  htmlFileT << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
4361  htmlFileT << "<head>" << std::endl;
4362  htmlFileT << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
4363  htmlFileT << "<title> Remote Monitoring Tool </title>" << std::endl;
4364  htmlFileT << "<style type=\"text/css\">" << std::endl;
4365  htmlFileT << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
4366  << std::endl;
4367  htmlFileT << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
4368  htmlFileT << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
4369  "text-align: center;}"
4370  << std::endl;
4371  htmlFileT << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
4372  htmlFileT << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
4373  htmlFileT << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
4374  htmlFileT << "</style>" << std::endl;
4375  htmlFileT << "<body>" << std::endl;
4376 
4377  if (sub == 1)
4378  htmlFileT << "<h1> Criteria for megatile channels for HB, RUN = " << runnumber << " </h1>" << std::endl;
4379  if (sub == 2)
4380  htmlFileT << "<h1> Criteria for megatile channels for HE, RUN = " << runnumber << " </h1>" << std::endl;
4381  if (sub == 3)
4382  htmlFileT << "<h1> Criteria for megatile channels for HO, RUN = " << runnumber << " </h1>" << std::endl;
4383  if (sub == 4)
4384  htmlFileT << "<h1> Criteria for megatile channels for HF, RUN = " << runnumber << " </h1>" << std::endl;
4385  htmlFileT << "<br>" << std::endl;
4386 
4387  // Test Entries
4388 
4389  htmlFileT << "<h2> 0. Entries for each channel.</h3>" << std::endl;
4390  htmlFileT << "<h3> 0.A. Entries in each channel for each depth.</h3>" << std::endl;
4391  htmlFileT << "<h4> Channel legend: color is rate of entries </h4>" << std::endl;
4392  if (sub == 1)
4393  htmlFileT << " <img src=\"MapRateEntryHB.png\" />" << std::endl;
4394  if (sub == 2)
4395  htmlFileT << " <img src=\"MapRateEntryHE.png\" />" << std::endl;
4396  if (sub == 3)
4397  htmlFileT << " <img src=\"MapRateEntryHO.png\" />" << std::endl;
4398  if (sub == 4)
4399  htmlFileT << " <img src=\"MapRateEntryHF.png\" />" << std::endl;
4400  htmlFileT << "<br>" << std::endl;
4401 
4402  // Test Cm
4403  htmlFileT << "<h2> 1. Cm criterion: CapID errors for each channel.</h3>" << std::endl;
4404  htmlFileT << "<h3> 1.A. Rate of CapId failures in each channel for each depth.</h3>" << std::endl;
4405  htmlFileT << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
4406  if (sub == 1)
4407  htmlFileT << " <img src=\"MapRateCapIDHB.png\" />" << std::endl;
4408  if (sub == 2)
4409  htmlFileT << " <img src=\"MapRateCapIDHE.png\" />" << std::endl;
4410  if (sub == 3)
4411  htmlFileT << " <img src=\"MapRateCapIDHO.png\" />" << std::endl;
4412  if (sub == 4)
4413  htmlFileT << " <img src=\"MapRateCapIDHF.png\" />" << std::endl;
4414  htmlFileT << "<br>" << std::endl;
4415 
4416  // Am
4417  htmlFileT << "<h2> 2. Am criterion: ADC amplitude collected over all TSs(Full Amplitude) for each channel. </h3>"
4418  << std::endl;
4419  htmlFileT << "<h3> 2.A. Full ADC amplitude distribution over all events, channels and depths.</h3>" << std::endl;
4420  htmlFileT << "<h4> Legend: Bins less " << MIN_M[2][sub] << " correpond to bad ADC amplitude </h4>" << std::endl;
4421  if (sub == 1)
4422  htmlFileT << " <img src=\"HistAmplHB.png\" />" << std::endl;
4423  if (sub == 2)
4424  htmlFileT << " <img src=\"HistAmplHE.png\" />" << std::endl;
4425  if (sub == 3)
4426  htmlFileT << " <img src=\"HistAmplHO.png\" />" << std::endl;
4427  if (sub == 4)
4428  htmlFileT << " <img src=\"HistAmplHF.png\" />" << std::endl;
4429  htmlFileT << "<br>" << std::endl;
4430  htmlFileT << "<h3> 2.B. Rate of bad ADC amplitude (<" << MIN_M[2][sub] << ") in each channel for each depth. </h3>"
4431  << std::endl;
4432  htmlFileT << "<h4> Channel legend: white - good, other colours - bad. </h4>" << std::endl;
4433  if (sub == 1)
4434  htmlFileT << " <img src=\"MapRateAmplHB.png\" />" << std::endl;
4435  if (sub == 2)
4436  htmlFileT << " <img src=\"MapRateAmplHE.png\" />" << std::endl;
4437  if (sub == 3)
4438  htmlFileT << " <img src=\"MapRateAmplHO.png\" />" << std::endl;
4439  if (sub == 4)
4440  htmlFileT << " <img src=\"MapRateAmplHF.png\" />" << std::endl;
4441  htmlFileT << "<br>" << std::endl;
4442 
4443  // Test Wm
4444  htmlFileT << "<h2> 3. Wm criterion: RMS (width) of ADC amplutude for each channel.</h3>" << std::endl;
4445  htmlFileT << "<h3> 3.A. RMS distribution over all events, channel and depth.</h3>" << std::endl;
4446  htmlFileT << "<h4> Legend: Bins less " << MIN_M[3][sub] << " and more " << MAX_M[3][sub]
4447  << " correpond to bad RMS </h4>" << std::endl;
4448  if (sub == 1)
4449  htmlFileT << " <img src=\"HistRMSHB.png\" />" << std::endl;
4450  if (sub == 2)
4451  htmlFileT << " <img src=\"HistRMSHE.png\" />" << std::endl;
4452  if (sub == 3)
4453  htmlFileT << " <img src=\"HistRMSHO.png\" />" << std::endl;
4454  if (sub == 4)
4455  htmlFileT << " <img src=\"HistRMSHF.png\" />" << std::endl;
4456  htmlFileT << "<br>" << std::endl;
4457  htmlFileT << "<h3> 3.B. Rate of bad RMS (<" << MIN_M[3][sub] << ",>" << MAX_M[3][sub]
4458  << ") in each channel for each depth.</h3>" << std::endl;
4459  htmlFileT << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
4460  if (sub == 1)
4461  htmlFileT << " <img src=\"MapRateRMSHB.png\" />" << std::endl;
4462  if (sub == 2)
4463  htmlFileT << " <img src=\"MapRateRMSHE.png\" />" << std::endl;
4464  if (sub == 3)
4465  htmlFileT << " <img src=\"MapRateRMSHO.png\" />" << std::endl;
4466  if (sub == 4)
4467  htmlFileT << " <img src=\"MapRateRMSHF.png\" />" << std::endl;
4468  htmlFileT << "<br>" << std::endl;
4469 
4470  // Rm
4471  htmlFileT << "<h2> 4. Rm criterion: Ratio ADC value sum over four near maximum (-2, -1, max, +1) TS to ADC value "
4472  "sum over all TS for each channel. </h3>"
4473  << std::endl;
4474  htmlFileT << "<h3> 4.A. Ratio distribution over all events, channels and depths.</h3>" << std::endl;
4475  htmlFileT << "<h4> Legend: Bins less " << MIN_M[4][sub] << " and more " << MAX_M[4][sub]
4476  << " correpond to bad ratio </h4>" << std::endl;
4477  if (sub == 1)
4478  htmlFileT << " <img src=\"Hist43TStoAllTSHB.png\" />" << std::endl;
4479  if (sub == 2)
4480  htmlFileT << " <img src=\"Hist43TStoAllTSHE.png\" />" << std::endl;
4481  if (sub == 3)
4482  htmlFileT << " <img src=\"Hist43TStoAllTSHO.png\" />" << std::endl;
4483  if (sub == 4)
4484  htmlFileT << " <img src=\"Hist43TStoAllTSHF.png\" />" << std::endl;
4485  htmlFileT << "<br>" << std::endl;
4486  htmlFileT << "<h3> 4.B. Rate of bad ratio (<" << MIN_M[4][sub] << ", >" << MAX_M[4][sub]
4487  << ") in each channel for each depth.</h3>" << std::endl;
4488  htmlFileT << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
4489  if (sub == 1)
4490  htmlFileT << " <img src=\"MapRate43TStoAllTSHB.png\" />" << std::endl;
4491  if (sub == 2)
4492  htmlFileT << " <img src=\"MapRate43TStoAllTSHE.png\" />" << std::endl;
4493  if (sub == 3)
4494  htmlFileT << " <img src=\"MapRate43TStoAllTSHO.png\" />" << std::endl;
4495  if (sub == 4)
4496  htmlFileT << " <img src=\"MapRate43TStoAllTSHF.png\" />" << std::endl;
4497  htmlFileT << "<br>" << std::endl;
4498 
4499  // TNm
4500  htmlFileT << "<h2> 5. TNm criterion: Mean TS position for each channel.</h3>" << std::endl;
4501  htmlFileT << "<h3> 5.A. TN position distribution over all events, channels and depths.</h3>" << std::endl;
4502  htmlFileT << "<h4> Legend: Bins less " << MIN_M[5][sub] << " and more " << MAX_M[5][sub]
4503  << " correpond to bad mean position </h4>" << std::endl;
4504  if (sub == 1)
4505  htmlFileT << " <img src=\"HistMeanPosHB.png\" />" << std::endl;
4506  if (sub == 2)
4507  htmlFileT << " <img src=\"HistMeanPosHE.png\" />" << std::endl;
4508  if (sub == 3)
4509  htmlFileT << " <img src=\"HistMeanPosHO.png\" />" << std::endl;
4510  if (sub == 4)
4511  htmlFileT << " <img src=\"HistMeanPosHF.png\" />" << std::endl;
4512  htmlFileT << "<br>" << std::endl;
4513  htmlFileT << "<h3> 5.B. Rate of bad TN position (<" << MIN_M[5][sub] << ", >" << MAX_M[5][sub]
4514  << ") in each channel for each depth. </h3>" << std::endl;
4515  htmlFileT << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
4516  if (sub == 1)
4517  htmlFileT << " <img src=\"MapRateMeanPosHB.png\" />" << std::endl;
4518  if (sub == 2)
4519  htmlFileT << " <img src=\"MapRateMeanPosHE.png\" />" << std::endl;
4520  if (sub == 3)
4521  htmlFileT << " <img src=\"MapRateMeanPosHO.png\" />" << std::endl;
4522  if (sub == 4)
4523  htmlFileT << " <img src=\"MapRateMeanPosHF.png\" />" << std::endl;
4524  htmlFileT << "<br>" << std::endl;
4525 
4526  // TXm
4527  htmlFileT << "<h2> 6.TXm criterion: Maximum TS position for each channel.</h3>" << std::endl;
4528  htmlFileT << "<h3> 6.A. TX position distribution over all events, channel and depth.</h3>" << std::endl;
4529  htmlFileT << "<h4> Legend: Bins less " << MIN_M[6][sub] << " and more " << MAX_M[6][sub]
4530  << " correpond to bad position </h4>" << std::endl;
4531  if (sub == 1)
4532  htmlFileT << " <img src=\"HistMaxPosHB.png\" />" << std::endl;
4533  if (sub == 2)
4534  htmlFileT << " <img src=\"HistMaxPosHE.png\" />" << std::endl;
4535  if (sub == 3)
4536  htmlFileT << " <img src=\"HistMaxPosHO.png\" />" << std::endl;
4537  if (sub == 4)
4538  htmlFileT << " <img src=\"HistMaxPosHF.png\" />" << std::endl;
4539  htmlFileT << "<br>" << std::endl;
4540  htmlFileT << "<h3> 6.B. Rate of bad TX position (<" << MIN_M[6][sub] << ", >" << MAX_M[6][sub]
4541  << ") in each channel for each depth. </h3>" << std::endl;
4542  htmlFileT << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
4543  if (sub == 1)
4544  htmlFileT << " <img src=\"MapRateMaxPosHB.png\" />" << std::endl;
4545  if (sub == 2)
4546  htmlFileT << " <img src=\"MapRateMaxPosHE.png\" />" << std::endl;
4547  if (sub == 3)
4548  htmlFileT << " <img src=\"MapRateMaxPosHO.png\" />" << std::endl;
4549  if (sub == 4)
4550  htmlFileT << " <img src=\"MapRateMaxPosHF.png\" />" << std::endl;
4551  htmlFileT << "<br>" << std::endl;
4552 
4553  htmlFileT << "</body> " << std::endl;
4554  htmlFileT << "</html> " << std::endl;
4555  htmlFileT.close();
4556 
4557  //Calibration channels
4558  htmlFileC << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
4559  htmlFileC << "<head>" << std::endl;
4560  htmlFileC << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
4561  htmlFileC << "<title> Raw Data Analyser </title>" << std::endl;
4562  htmlFileC << "<style type=\"text/css\">" << std::endl;
4563  htmlFileC << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
4564  << std::endl;
4565  htmlFileC << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
4566  htmlFileC << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
4567  "text-align: center;}"
4568  << std::endl;
4569  htmlFileC << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
4570  htmlFileC << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
4571  htmlFileC << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
4572  htmlFileC << "</style>" << std::endl;
4573  htmlFileC << "<body>" << std::endl;
4574 
4575  if (sub == 1)
4576  htmlFileC << "<h1> Criteria for calibration channels for HB, RUN = " << runnumber << " </h1>" << std::endl;
4577  if (sub == 2)
4578  htmlFileC << "<h1> Criteria for calibration channels for HE, RUN = " << runnumber << " </h1>" << std::endl;
4579  if (sub == 3)
4580  htmlFileC << "<h1> Criteria for calibration channels for HO, RUN = " << runnumber << " </h1>" << std::endl;
4581  if (sub == 4)
4582  htmlFileC << "<h1> Criteria for calibration channels for HF, RUN = " << runnumber << " </h1>" << std::endl;
4583  htmlFileC << "<br>" << std::endl;
4584 
4585  // Test Entries
4586 
4587  htmlFileC << "<h2> 0. Entries for each channel.</h3>" << std::endl;
4588  htmlFileC << "<h3> 0.A. Entries in each channel for each depth.</h3>" << std::endl;
4589  htmlFileC << "<h4> Channel legend: color is rate of entries </h4>" << std::endl;
4590  if (sub == 1)
4591  htmlFileC << " <img src=\"MapRateCalibEntryHB.png\" />" << std::endl;
4592  if (sub == 2)
4593  htmlFileC << " <img src=\"MapRateCalibEntryHE.png\" />" << std::endl;
4594  if (sub == 3)
4595  htmlFileC << " <img src=\"MapRateCalibEntryHO.png\" />" << std::endl;
4596  if (sub == 4)
4597  htmlFileC << " <img src=\"MapRateCalibEntryHF.png\" />" << std::endl;
4598  htmlFileC << "<br>" << std::endl;
4599 
4600  // Test Cc
4601  htmlFileC << "<h2> 1. Cc criterion: CapID errors for each channel.</h3>" << std::endl;
4602  htmlFileC << "<h3> 1.A. Rate of CapId failures in each channel for each depth.</h3>" << std::endl;
4603  htmlFileC << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
4604  if (sub == 1)
4605  htmlFileC << " <img src=\"MapRateCapCalibHB.png\" />" << std::endl;
4606  if (sub == 2)
4607  htmlFileC << " <img src=\"MapRateCapCalibHE.png\" />" << std::endl;
4608  if (sub == 3)
4609  htmlFileC << " <img src=\"MapRateCapCalibHO.png\" />" << std::endl;
4610  if (sub == 4)
4611  htmlFileC << " <img src=\"MapRateCapCalibHF.png\" />" << std::endl;
4612  htmlFileC << "<br>" << std::endl;
4613 
4614  // Ac
4615  htmlFileC << "<h2> 2. Ac criterion: ADC amplitude collected over all TSs(Full Amplitude) for each channel. </h3>"
4616  << std::endl;
4617  htmlFileC << "<h3> 2.A. Full ADC amplitude distribution over all events, channels and depths.</h3>" << std::endl;
4618  htmlFileC << "<h4> Legend: Bins less " << MIN_C[2][sub] << " correpond to bad ADC amplitude </h4>" << std::endl;
4619  if (sub == 1)
4620  htmlFileC << " <img src=\"HistAmplCalibHB.png\" />" << std::endl;
4621  if (sub == 2)
4622  htmlFileC << " <img src=\"HistAmplCalibHE.png\" />" << std::endl;
4623  if (sub == 3)
4624  htmlFileC << " <img src=\"HistAmplCalibHO.png\" />" << std::endl;
4625  if (sub == 4)
4626  htmlFileC << " <img src=\"HistAmplCalibHF.png\" />" << std::endl;
4627  htmlFileC << "<br>" << std::endl;
4628  htmlFileC << "<h3> 2.B. Rate of bad ADC amplitude (<" << MIN_C[2][sub] << ") in each channel for each depth. </h3>"
4629  << std::endl;
4630  htmlFileC << "<h4> Channel legend: white - good, other colours - bad. </h4>" << std::endl;
4631  if (sub == 1)
4632  htmlFileC << " <img src=\"MapRateAmplCalibHB.png\" />" << std::endl;
4633  if (sub == 2)
4634  htmlFileC << " <img src=\"MapRateAmplCalibHE.png\" />" << std::endl;
4635  if (sub == 3)
4636  htmlFileC << " <img src=\"MapRateAmplCalibHO.png\" />" << std::endl;
4637  if (sub == 4)
4638  htmlFileC << " <img src=\"MapRateAmplCalibHF.png\" />" << std::endl;
4639  htmlFileC << "<br>" << std::endl;
4640 
4641  // Test Wc
4642  htmlFileC << "<h2> 3. Wc criterion: RMS (width) of ADC amplutude for each channel.</h3>" << std::endl;
4643  htmlFileC << "<h3> 3.A. W distribution over all events, channel and depth.</h3>" << std::endl;
4644  htmlFileC << "<h4> Legend: Bins less " << MIN_C[3][sub] << " and more " << MAX_C[3][sub]
4645  << " correpond to bad RMS </h4>" << std::endl;
4646  if (sub == 1)
4647  htmlFileC << " <img src=\"HistRMSCalibHB.png\" />" << std::endl;
4648  if (sub == 2)
4649  htmlFileC << " <img src=\"HistRMSCalibHE.png\" />" << std::endl;
4650  if (sub == 3)
4651  htmlFileC << " <img src=\"HistRMSCalibHO.png\" />" << std::endl;
4652  if (sub == 4)
4653  htmlFileC << " <img src=\"HistRMSCalibHF.png\" />" << std::endl;
4654  htmlFileC << "<br>" << std::endl;
4655  htmlFileC << "<h3> 3.B. Rate of bad W (<" << MIN_C[3][sub] << ",>" << MAX_C[3][sub]
4656  << ") in each channel for each depth.</h3>" << std::endl;
4657  htmlFileC << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
4658  if (sub == 1)
4659  htmlFileC << " <img src=\"MapRateRMSCalibHB.png\" />" << std::endl;
4660  if (sub == 2)
4661  htmlFileC << " <img src=\"MapRateRMSCalibHE.png\" />" << std::endl;
4662  if (sub == 3)
4663  htmlFileC << " <img src=\"MapRateRMSCalibHO.png\" />" << std::endl;
4664  if (sub == 4)
4665  htmlFileC << " <img src=\"MapRateRMSCalibHF.png\" />" << std::endl;
4666  htmlFileC << "<br>" << std::endl;
4667 
4668  // Rc
4669  htmlFileC << "<h2> 4. Rc criterion: Ratio ADC value sum over five near maximum (-2, -1, max, +1, +2) TS to ADC "
4670  "value sum over all TS for each channel. </h3>"
4671  << std::endl;
4672  htmlFileC << "<h3> 4.A. Ratio distribution over all events, channels and depths.</h3>" << std::endl;
4673  htmlFileC << "<h4> Legend: Bins less " << MIN_C[4][sub] << " and more " << MAX_C[4][sub]
4674  << " correpond to bad ratio </h4>" << std::endl;
4675  if (sub == 1)
4676  htmlFileC << " <img src=\"Hist43TStoAllTSCalibHB.png\" />" << std::endl;
4677  if (sub == 2)
4678  htmlFileC << " <img src=\"Hist43TStoAllTSCalibHE.png\" />" << std::endl;
4679  if (sub == 3)
4680  htmlFileC << " <img src=\"Hist43TStoAllTSCalibHO.png\" />" << std::endl;
4681  if (sub == 4)
4682  htmlFileC << " <img src=\"Hist43TStoAllTSCalibHF.png\" />" << std::endl;
4683  htmlFileC << "<br>" << std::endl;
4684  htmlFileC << "<h3> 4.B. Rate of bad Ratio (<" << MIN_C[4][sub] << ", >" << MAX_C[4][sub]
4685  << ") in each channel for each depth.</h3>" << std::endl;
4686  htmlFileC << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
4687  if (sub == 1)
4688  htmlFileC << " <img src=\"MapRate43TStoAllTSCalibHB.png\" />" << std::endl;
4689  if (sub == 2)
4690  htmlFileC << " <img src=\"MapRate43TStoAllTSCalibHE.png\" />" << std::endl;
4691  if (sub == 3)
4692  htmlFileC << " <img src=\"MapRate43TStoAllTSCalibHO.png\" />" << std::endl;
4693  if (sub == 4)
4694  htmlFileC << " <img src=\"MapRate43TStoAllTSCalibHF.png\" />" << std::endl;
4695  htmlFileC << "<br>" << std::endl;
4696 
4697  // TNc
4698  htmlFileC << "<h2> 5. TNc criterion: Mean TS position for each channel.</h3>" << std::endl;
4699  htmlFileC << "<h3> 5.A. TN position distribution over all events, channels and depths.</h3>" << std::endl;
4700  htmlFileC << "<h4> Legend: Bins less " << MIN_C[5][sub] << " and more " << MAX_C[5][sub]
4701  << " correpond to bad position </h4>" << std::endl;
4702  if (sub == 1)
4703  htmlFileC << " <img src=\"HistMeanPosCalibHB.png\" />" << std::endl;
4704  if (sub == 2)
4705  htmlFileC << " <img src=\"HistMeanPosCalibHE.png\" />" << std::endl;
4706  if (sub == 3)
4707  htmlFileC << " <img src=\"HistMeanPosCalibHO.png\" />" << std::endl;
4708  if (sub == 4)
4709  htmlFileC << " <img src=\"HistMeanPosCalibHF.png\" />" << std::endl;
4710  htmlFileC << "<br>" << std::endl;
4711  htmlFileC << "<h3> 5.B. Rate of bad TN position (<" << MIN_C[5][sub] << ", >" << MAX_C[5][sub]
4712  << ") in each channel for each depth. </h3>" << std::endl;
4713  htmlFileC << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
4714  if (sub == 1)
4715  htmlFileC << " <img src=\"MapRateMeanPosCalibHB.png\" />" << std::endl;
4716  if (sub == 2)
4717  htmlFileC << " <img src=\"MapRateMeanPosCalibHE.png\" />" << std::endl;
4718  if (sub == 3)
4719  htmlFileC << " <img src=\"MapRateMeanPosCalibHO.png\" />" << std::endl;
4720  if (sub == 4)
4721  htmlFileC << " <img src=\"MapRateMeanPosCalibHF.png\" />" << std::endl;
4722  htmlFileC << "<br>" << std::endl;
4723 
4724  // TXm
4725  htmlFileC << "<h2> 6.TXc criterion: Maximum TS position for each channel.</h3>" << std::endl;
4726  htmlFileC << "<h3> 6.A. TX position distribution over all events, channel and depth.</h3>" << std::endl;
4727  htmlFileC << "<h4> Legend: Bins less " << MIN_C[6][sub] << " and more " << MAX_C[6][sub]
4728  << " correpond to bad position </h4>" << std::endl;
4729  if (sub == 1)
4730  htmlFileC << " <img src=\"HistMaxPosCalibHB.png\" />" << std::endl;
4731  if (sub == 2)
4732  htmlFileC << " <img src=\"HistMaxPosCalibHE.png\" />" << std::endl;
4733  if (sub == 3)
4734  htmlFileC << " <img src=\"HistMaxPosCalibHO.png\" />" << std::endl;
4735  if (sub == 4)
4736  htmlFileC << " <img src=\"HistMaxPosCalibHF.png\" />" << std::endl;
4737  htmlFileC << "<br>" << std::endl;
4738  htmlFileC << "<h3> 6.B. Rate of bad TX position (<" << MIN_C[6][sub] << ", >" << MAX_C[6][sub]
4739  << ") in each channel for each depth. </h3>" << std::endl;
4740  htmlFileC << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
4741  if (sub == 1)
4742  htmlFileC << " <img src=\"MapRateMaxPosCalibHB.png\" />" << std::endl;
4743  if (sub == 2)
4744  htmlFileC << " <img src=\"MapRateMaxPosCalibHE.png\" />" << std::endl;
4745  if (sub == 3)
4746  htmlFileC << " <img src=\"MapRateMaxPosCalibHO.png\" />" << std::endl;
4747  if (sub == 4)
4748  htmlFileC << " <img src=\"MapRateMaxPosCalibHF.png\" />" << std::endl;
4749  htmlFileC << "<br>" << std::endl;
4750 
4751  htmlFileC << "</body> " << std::endl;
4752  htmlFileC << "</html> " << std::endl;
4753  htmlFileC.close();
4754 
4755  //Response drift
4756  htmlFileD << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
4757  htmlFileD << "<head>" << std::endl;
4758  htmlFileD << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
4759  htmlFileD << "<title> Remore Monitoring Tool </title>" << std::endl;
4760  htmlFileD << "<style type=\"text/css\">" << std::endl;
4761  htmlFileD << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
4762  << std::endl;
4763  htmlFileD << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
4764  htmlFileD << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
4765  "text-align: center;}"
4766  << std::endl;
4767  htmlFileD << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
4768  htmlFileD << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
4769  htmlFileD << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
4770  htmlFileD << "</style>" << std::endl;
4771  htmlFileD << "<body>" << std::endl;
4772 
4773  if (sub == 1)
4774  htmlFileD << "<h1> Response drift for HB: Current RUN = " << runnumber << ", Reference RUN = " << refrunnumber
4775  << " </h1>" << std::endl;
4776  if (sub == 2)
4777  htmlFileD << "<h1> Response drift for HE: Current RUN = " << runnumber << ", Reference RUN = " << refrunnumber
4778  << " </h1>" << std::endl;
4779  if (sub == 3)
4780  htmlFileD << "<h1> Response drift for HO: Current RUN = " << runnumber << ", Reference RUN = " << refrunnumber
4781  << " </h1>" << std::endl;
4782  if (sub == 4)
4783  htmlFileD << "<h1> Response drift for HF: Current RUN = " << runnumber << ", Reference RUN = " << refrunnumber
4784  << " </h1>" << std::endl;
4785  htmlFileD << "<br>" << std::endl;
4786 
4787  // test GS
4788  htmlFileD << "<h2> 1. Gain Stability (GS) </h3>" << std::endl;
4789  htmlFileD << "<h3> 1.A. Averaged channel response, collected over all TS, for Current run in each channel for each "
4790  "depth.</h3>"
4791  << std::endl;
4792  htmlFileD << "<h4> Channel legend: colour means cooresponding value of mean response. </h4>" << std::endl;
4793  if (sub == 1)
4794  htmlFileD << " <img src=\"MapRateAmpl1HB.png\" />" << std::endl;
4795  if (sub == 2)
4796  htmlFileD << " <img src=\"MapRateAmpl1HE.png\" />" << std::endl;
4797  if (sub == 3)
4798  htmlFileD << " <img src=\"MapRateAmpl1HO.png\" />" << std::endl;
4799  if (sub == 4)
4800  htmlFileD << " <img src=\"MapRateAmpl1HF.png\" />" << std::endl;
4801  htmlFileD << "<br>" << std::endl;
4802  htmlFileD << "<h3> 1.B. Averaged channel response, collected over all TS, for Reference run in each channel for "
4803  "each depth.</h3>"
4804  << std::endl;
4805  htmlFileD << "<h4> Channel legend: colour means cooresponding value of mean response. </h4>" << std::endl;
4806  if (sub == 1)
4807  htmlFileD << " <img src=\"MapRateAmpl2HB.png\" />" << std::endl;
4808  if (sub == 2)
4809  htmlFileD << " <img src=\"MapRateAmpl2HE.png\" />" << std::endl;
4810  if (sub == 3)
4811  htmlFileD << " <img src=\"MapRateAmpl2HO.png\" />" << std::endl;
4812  if (sub == 4)
4813  htmlFileD << " <img src=\"MapRateAmpl2HF.png\" />" << std::endl;
4814  htmlFileD << "<br>" << std::endl;
4815  htmlFileD << "<h3> 1.C. Relative difference between Current and Reference run distribution over all events, "
4816  "channels for each depth.</h3>"
4817  << std::endl;
4818  htmlFileD << "<h4> Legend: Bins less -" << porog[sub] << "% and more +" << porog[sub]
4819  << "% correpond to bad relative difference position </h4>" << std::endl;
4820  if (sub == 1)
4821  htmlFileD << " <img src=\"HistAmplDriftDepthHB.png\" />" << std::endl;
4822  if (sub == 2)
4823  htmlFileD << " <img src=\"HistAmplDriftDepthHE.png\" />" << std::endl;
4824  if (sub == 3)
4825  htmlFileD << " <img src=\"HistAmplDriftDepthHO.png\" />" << std::endl;
4826  if (sub == 4)
4827  htmlFileD << " <img src=\"HistAmplDriftDepthHF.png\" />" << std::endl;
4828  htmlFileD << "<br>" << std::endl;
4829  htmlFileD << "<h3> 1.D. Rate of bad relative difference (<-" << porog[sub] << ", >+" << porog[sub]
4830  << ") in each channel for each depth.</h3>" << std::endl;
4831  htmlFileD << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
4832  if (sub == 1)
4833  htmlFileD << " <img src=\"MapRateAmplDriftHB.png\" />" << std::endl;
4834  if (sub == 2)
4835  htmlFileD << " <img src=\"MapRateAmplDriftHE.png\" />" << std::endl;
4836  if (sub == 3)
4837  htmlFileD << " <img src=\"MapRateAmplDriftHO.png\" />" << std::endl;
4838  if (sub == 4)
4839  htmlFileD << " <img src=\"MapRateAmplDriftHF.png\" />" << std::endl;
4840  htmlFileD << "<br>" << std::endl;
4841 
4842  htmlFileD << "</body> " << std::endl;
4843  htmlFileD << "</html> " << std::endl;
4844  htmlFileD.close();
4845 
4846  // Pedestals
4847  htmlFileP << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
4848  htmlFileP << "<head>" << std::endl;
4849  htmlFileP << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
4850  htmlFileP << "<title> Remote Monitoring Tool </title>" << std::endl;
4851  htmlFileP << "<style type=\"text/css\">" << std::endl;
4852  htmlFileP << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
4853  << std::endl;
4854  htmlFileP << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
4855  htmlFileP << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
4856  "text-align: center;}"
4857  << std::endl;
4858  htmlFileP << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
4859  htmlFileP << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
4860  htmlFileP << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
4861  htmlFileP << "</style>" << std::endl;
4862  htmlFileP << "<body>" << std::endl;
4863 
4864  if (sub == 1)
4865  htmlFileP << "<h1> Pedestals for HB, RUN = " << runnumber << " </h1>" << std::endl;
4866  if (sub == 2)
4867  htmlFileP << "<h1> Pedestals for HE, RUN = " << runnumber << " </h1>" << std::endl;
4868  if (sub == 3)
4869  htmlFileP << "<h1> Pedestals for HO, RUN = " << runnumber << " </h1>" << std::endl;
4870  if (sub == 4)
4871  htmlFileP << "<h1> Pedestals for HF, RUN = " << runnumber << " </h1>" << std::endl;
4872  htmlFileP << "<br>" << std::endl;
4873 
4874  // Pedestal:
4875  htmlFileP << "<h2> 1.Pm criterion: Pedestals for each CapID .</h3>" << std::endl;
4876  htmlFileP << "<h3> 1.A. Pedestal distribution over all events, channels for each CapID and all depths.</h3>"
4877  << std::endl;
4878  htmlFileP << "<h4> Legend: Bins less " << Pedest[0][sub] << " correpond to bad Pedestals </h4>" << std::endl;
4879  if (sub == 1)
4880  htmlFileP << " <img src=\"HistPedestalsHB.png\" />" << std::endl;
4881  if (sub == 2)
4882  htmlFileP << " <img src=\"HistPedestalsHE.png\" />" << std::endl;
4883  if (sub == 3)
4884  htmlFileP << " <img src=\"HistPedestalsHO.png\" />" << std::endl;
4885  if (sub == 4)
4886  htmlFileP << " <img src=\"HistPedestalsHF.png\" />" << std::endl;
4887  htmlFileP << "<br>" << std::endl;
4888  htmlFileP << "<h3> 1.B. Rate of channels at very low Pedestals at least in one CapID for each depth.</h3>"
4889  << std::endl;
4890  htmlFileP << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
4891  if (sub == 1)
4892  htmlFileP << " <img src=\"MapRatePedHB.png\" />" << std::endl;
4893  if (sub == 2)
4894  htmlFileP << " <img src=\"MapRatePedHE.png\" />" << std::endl;
4895  if (sub == 3)
4896  htmlFileP << " <img src=\"MapRatePedHO.png\" />" << std::endl;
4897  if (sub == 4)
4898  htmlFileP << " <img src=\"MapRatePedHF.png\" />" << std::endl;
4899 
4900  // PedestalWidth:
4901  htmlFileP << "<h2> 2.pWm criterion: Pedestal Widths for each CapID .</h3>" << std::endl;
4902  htmlFileP << "<h3> 2.A. Pedestal Widths distribution over all events, channels for each CapID and all depths.</h3>"
4903  << std::endl;
4904  htmlFileP << "<h4> Legend: Bins less " << Pedest[1][sub] << " correpond to bad Pedestal Widths </h4>" << std::endl;
4905  if (sub == 1)
4906  htmlFileP << " <img src=\"HistPedestalWidthsHB.png\" />" << std::endl;
4907  if (sub == 2)
4908  htmlFileP << " <img src=\"HistPedestalWidthsHE.png\" />" << std::endl;
4909  if (sub == 3)
4910  htmlFileP << " <img src=\"HistPedestalWidthsHO.png\" />" << std::endl;
4911  if (sub == 4)
4912  htmlFileP << " <img src=\"HistPedestalWidthsHF.png\" />" << std::endl;
4913  htmlFileP << "<br>" << std::endl;
4914  htmlFileP << "<h3> 2.B. Rate of channels at very low Pedestal Widths at least in one CapID for each depth.</h3>"
4915  << std::endl;
4916  htmlFileP << "<h4> Channel legend: white - good, other colour - bad. </h4>" << std::endl;
4917  if (sub == 1)
4918  htmlFileP << " <img src=\"MapRatePedWidthsHB.png\" />" << std::endl;
4919  if (sub == 2)
4920  htmlFileP << " <img src=\"MapRatePedWidthsHE.png\" />" << std::endl;
4921  if (sub == 3)
4922  htmlFileP << " <img src=\"MapRatePedWidthsHO.png\" />" << std::endl;
4923  if (sub == 4)
4924  htmlFileP << " <img src=\"MapRatePedWidthsHF.png\" />" << std::endl;
4925 
4926  // Correlations of Pedestal(Width) and fullAmplitude:
4927  htmlFileP << "<h2> 3.Pedestal and pedestalWidths vs Amplitude .</h3>" << std::endl;
4928  htmlFileP << "<h3> 3.A. Correlation of Pedestal(pedestalWidths) and Amplitude over all channels and events .</h3>"
4929  << std::endl;
4930  htmlFileP << "<h4> Legend: colour - entries </h4>" << std::endl;
4931  if (sub == 1)
4932  htmlFileP << "<img src=\"CorrelationsMapPedestalVsfullAmplitudeHB.png\" />" << std::endl;
4933  if (sub == 2)
4934  htmlFileP << "<img src=\"CorrelationsMapPedestalVsfullAmplitudeHE.png\" />" << std::endl;
4935  if (sub == 3)
4936  htmlFileP << "<img src=\"CorrelationsMapPedestalVsfullAmplitudeHO.png\" />" << std::endl;
4937  if (sub == 4)
4938  htmlFileP << "<img src=\"CorrelationsMapPedestalVsfullAmplitudeHF.png\" />" << std::endl;
4939  htmlFileP << "<br>" << std::endl;
4940  htmlFileP.close();
4941 
4942  // TSs Shapes:
4943 
4944  htmlFileS << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
4945  htmlFileS << "<head>" << std::endl;
4946  htmlFileS << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
4947  htmlFileS << "<title> Remote Monitoring Tool </title>" << std::endl;
4948  htmlFileS << "<style type=\"text/css\">" << std::endl;
4949  htmlFileS << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
4950  << std::endl;
4951  htmlFileS << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
4952  htmlFileS << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
4953  "text-align: center;}"
4954  << std::endl;
4955  htmlFileS << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
4956  htmlFileS << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
4957  htmlFileS << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
4958  htmlFileS << "</style>" << std::endl;
4959  htmlFileS << "<body>" << std::endl;
4960 
4961  if (sub == 1)
4962  htmlFileS << "<h1> ADC Shape for HB, RUN = " << runnumber << " </h1>" << std::endl;
4963  if (sub == 2)
4964  htmlFileS << "<h1> ADC Shape for HE, RUN = " << runnumber << " </h1>" << std::endl;
4965  if (sub == 3)
4966  htmlFileS << "<h1> ADC Shape for HO, RUN = " << runnumber << " </h1>" << std::endl;
4967  if (sub == 4)
4968  htmlFileS << "<h1> ADC Shape for HF, RUN = " << runnumber << " </h1>" << std::endl;
4969  htmlFileS << "<br>" << std::endl;
4970 
4971  htmlFileS << "<h2> 1.Mean ADC Shape.</h3>" << std::endl;
4972  htmlFileS << "<h3> 1.A. ADC shape averaged over all good channels, depth and events.</h3>" << std::endl;
4973  // htmlFileS << "<h4> Legend: Bins less "<<Pedest[0][sub]<<" correpond to bad Pedestals </h4>"<< std::endl;
4974  if (sub == 1)
4975  htmlFileS << " <img src=\"HistGoodTSshapesHB.png\" />" << std::endl;
4976  if (sub == 2)
4977  htmlFileS << " <img src=\"HistGoodTSshapesHE.png\" />" << std::endl;
4978  if (sub == 3)
4979  htmlFileS << " <img src=\"HistGoodTSshapesHO.png\" />" << std::endl;
4980  if (sub == 4)
4981  htmlFileS << " <img src=\"HistGoodTSshapesHF.png\" />" << std::endl;
4982  htmlFileS << "<br>" << std::endl;
4983  htmlFileS << "<h3> 1.B. ADC shape averaged over all bad channels, depth and events. Bad channels are selected by 5 "
4984  "criteria: CapId, A, W, P, Pw </h3>"
4985  << std::endl;
4986  // htmlFileS << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
4987  if (sub == 1)
4988  htmlFileS << " <img src=\"HistBadTSshapesHB.png\" />" << std::endl;
4989  if (sub == 2)
4990  htmlFileS << " <img src=\"HistBadTSshapesHE.png\" />" << std::endl;
4991  if (sub == 3)
4992  htmlFileS << " <img src=\"HistBadTSshapesHO.png\" />" << std::endl;
4993  if (sub == 4)
4994  htmlFileS << " <img src=\"HistBadTSshapesHF.png\" />" << std::endl;
4995  /*
4996  htmlFileS << "<h2> 2. ADC in Time Slice </h3>"<< std::endl;
4997  htmlFileS << "<h3> 2.A. ADC counts histogrammed over all channels, depth and events.</h3>"<< std::endl;
4998 // htmlFileS << "<h4> Legend: Bins less "<<Pedest[0][sub]<<" correpond to bad Pedestals </h4>"<< std::endl;
4999  if (sub==1) htmlFileS << " <img src=\"Hist_ADC_HB_All.png\" />" << std::endl;
5000  if (sub==2) htmlFileS << " <img src=\"Hist_ADC_HE_All.png\" />" << std::endl;
5001  if (sub==3) htmlFileS << " <img src=\"Hist_ADC_HO_All.png\" />" << std::endl;
5002  if (sub==4) htmlFileS << " <img src=\"Hist_ADC_HF_All.png\" />" << std::endl;
5003  htmlFileS << "<br>"<< std::endl;
5004  htmlFileS << "<h3> 2.B. ADC counts histogrammed over all channels and events for each depth separately. </h3>"<< std::endl;
5005 // htmlFileS << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5006  if (sub==1) htmlFileS << " <img src=\"Hist_ADC_HB_DS.png\" />" << std::endl;
5007  if (sub==2) htmlFileS << " <img src=\"Hist_ADC_HE_DS.png\" />" << std::endl;
5008  if (sub==3) htmlFileS << " <img src=\"Hist_ADC_HO_DS.png\" />" << std::endl;
5009  if (sub==4) htmlFileS << " <img src=\"Hist_ADC_HF_DS.png\" />" << std::endl;
5010 
5011  htmlFileS << "<h2> 3. ADC Sum in Time Slice </h3>"<< std::endl;
5012  htmlFileS << "<h3> 3.A. ADC Sum over all channels histogrammed over all events for each depth separately. </h3>"<< std::endl;
5013 // htmlFileS << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5014  if (sub==1) htmlFileS << " <img src=\"Hist_SumADC_HB.png\" />" << std::endl;
5015  if (sub==2) htmlFileS << " <img src=\"Hist_SumADC_HE.png\" />" << std::endl;
5016  if (sub==3) htmlFileS << " <img src=\"Hist_SumADC_HO.png\" />" << std::endl;
5017  if (sub==4) htmlFileS << " <img src=\"Hist_SumADC_HF.png\" />" << std::endl;
5018 
5019  htmlFileS << "<h3> 3.B. ADC Sum over all channels histogrammed over all events for each depth separately. </h3>"<< std::endl;
5020 // htmlFileS << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5021  if (sub==1) htmlFileS << " <img src=\"Hist_SumADC_HB0.png\" />" << std::endl;
5022  if (sub==2) htmlFileS << " <img src=\"Hist_SumADC_HE0.png\" />" << std::endl;
5023  if (sub==3) htmlFileS << " <img src=\"Hist_SumADC_HO0.png\" />" << std::endl;
5024  if (sub==4) htmlFileS << " <img src=\"Hist_SumADC_HF0.png\" />" << std::endl;
5025 
5026  htmlFileS << "<h3> 3.C. ADC Sum over all channels histogrammed over all events for each depth separately. </h3>"<< std::endl;
5027 // htmlFileS << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5028  if (sub==1) htmlFileS << " <img src=\"Hist_SumADC_HB1.png\" />" << std::endl;
5029  if (sub==2) htmlFileS << " <img src=\"Hist_SumADC_HE1.png\" />" << std::endl;
5030  if (sub==3) htmlFileS << " <img src=\"Hist_SumADC_HO1.png\" />" << std::endl;
5031  if (sub==4) htmlFileS << " <img src=\"Hist_SumADC_HF1.png\" />" << std::endl;
5032 */
5033  htmlFileS.close();
5034 
5036 
5037  // Iteration Method for Calibration Group:
5038 
5039  htmlFileM << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
5040  htmlFileM << "<head>" << std::endl;
5041  htmlFileM << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
5042  htmlFileM << "<title> Remote Monitoring Tool </title>" << std::endl;
5043  htmlFileM << "<style type=\"text/css\">" << std::endl;
5044  htmlFileM << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
5045  << std::endl;
5046  htmlFileM << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
5047  htmlFileM << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
5048  "text-align: center;}"
5049  << std::endl;
5050  htmlFileM << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
5051  htmlFileM << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
5052  htmlFileM << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
5053  htmlFileM << "</style>" << std::endl;
5054  htmlFileM << "<body>" << std::endl;
5055 
5056  if (sub == 1)
5057  htmlFileM << "<h1> Iteration Method for Calibration Group, HB, RUN = " << runnumber << " </h1>" << std::endl;
5058  if (sub == 2)
5059  htmlFileM << "<h1> Iteration Method for Calibration Group, HE, RUN = " << runnumber << " </h1>" << std::endl;
5060  if (sub == 3)
5061  htmlFileM << "<h1> Iteration Method for Calibration Group, HO, RUN = " << runnumber << " </h1>" << std::endl;
5062  if (sub == 4)
5063  htmlFileM << "<h1> Iteration Method for Calibration Group, HF, RUN = " << runnumber << " </h1>" << std::endl;
5064  htmlFileM << "<br>" << std::endl;
5065 
5066  htmlFileM << "<h2> 1: Positive direction, R = R_depth_ieta_iphi = E_depth_ieta_iphi/E_depth_ieta </h3>"
5067  << std::endl;
5068 
5069  htmlFileM << "<h3> 1.A. eta/phi-plot: R, averaged over depthes </h3>" << std::endl;
5070  // htmlFileM << "<h4> Legend: Bins less "<<Pedest[0][sub]<<" correpond to bad Pedestals </h4>"<< std::endl;
5071  if (sub == 1)
5072  htmlFileM << " <img src=\"Rhist2IterationMethodHB.png\" />" << std::endl;
5073  if (sub == 2)
5074  htmlFileM << " <img src=\"Rhist2IterationMethodHE.png\" />" << std::endl;
5075  if (sub == 3)
5076  htmlFileM << " <img src=\"Rhist2IterationMethodHO.png\" />" << std::endl;
5077  if (sub == 4)
5078  htmlFileM << " <img src=\"Rhist2IterationMethodHF.png\" />" << std::endl;
5079  htmlFileM << "<br>" << std::endl;
5080 
5081  htmlFileM << "<h3> 1B: R vs phi , averaged over depthes & eta </h3>" << std::endl;
5082  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5083  if (sub == 1)
5084  htmlFileM << " <img src=\"Rhist1IterationMethodHB.png\" />" << std::endl;
5085  if (sub == 2)
5086  htmlFileM << " <img src=\"Rhist1IterationMethodHE.png\" />" << std::endl;
5087  if (sub == 3)
5088  htmlFileM << " <img src=\"Rhist1IterationMethodHO.png\" />" << std::endl;
5089  if (sub == 4)
5090  htmlFileM << " <img src=\"Rhist1IterationMethodHF.png\" />" << std::endl;
5091  htmlFileM << "<br>" << std::endl;
5092 
5094 
5095  htmlFileM << "<h3> 1C: R vs phi , different eta, Depth1 </h3>" << std::endl;
5096  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5097  if (sub == 1)
5098  htmlFileM << " <img src=\"Rhist1IterationMethodDepth1HB.png\" />" << std::endl;
5099  if (sub == 2)
5100  htmlFileM << " <img src=\"Rhist1IterationMethodDepth1HE.png\" />" << std::endl;
5101  if (sub == 4)
5102  htmlFileM << " <img src=\"Rhist1IterationMethodDepth1HF.png\" />" << std::endl;
5103  htmlFileM << "<br>" << std::endl;
5104 
5105  htmlFileM << "<h3> 1D: R vs phi , different eta, Depth2 </h3>" << std::endl;
5106  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5107  if (sub == 1)
5108  htmlFileM << " <img src=\"Rhist1IterationMethodDepth2HB.png\" />" << std::endl;
5109  if (sub == 2)
5110  htmlFileM << " <img src=\"Rhist1IterationMethodDepth2HE.png\" />" << std::endl;
5111  if (sub == 4)
5112  htmlFileM << " <img src=\"Rhist1IterationMethodDepth2HF.png\" />" << std::endl;
5113  htmlFileM << "<br>" << std::endl;
5114 
5115  htmlFileM << "<h3> 1E: R vs phi , different eta, Depth3 </h3>" << std::endl;
5116  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5117  if (sub == 1)
5118  htmlFileM << " <img src=\"Rhist1IterationMethodDepth3HB.png\" />" << std::endl;
5119  if (sub == 2)
5120  htmlFileM << " <img src=\"Rhist1IterationMethodDepth3HE.png\" />" << std::endl;
5121  if (sub == 4)
5122  htmlFileM << " <img src=\"Rhist1IterationMethodDepth3HF.png\" />" << std::endl;
5123  htmlFileM << "<br>" << std::endl;
5124 
5125  htmlFileM << "<h3> 1F: R vs phi , different eta, Depth4 </h3>" << std::endl;
5126  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5127  if (sub == 1)
5128  htmlFileM << " <img src=\"Rhist1IterationMethodDepth4HB.png\" />" << std::endl;
5129  if (sub == 2)
5130  htmlFileM << " <img src=\"Rhist1IterationMethodDepth4HE.png\" />" << std::endl;
5131  if (sub == 3)
5132  htmlFileM << " <img src=\"Rhist1IterationMethodDepth4HO.png\" />" << std::endl;
5133  if (sub == 4)
5134  htmlFileM << " <img src=\"Rhist1IterationMethodDepth4HF.png\" />" << std::endl;
5135  htmlFileM << "<br>" << std::endl;
5136 
5137  htmlFileM << "<h3> 1G: R vs phi , different eta, Depth5 </h3>" << std::endl;
5138  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5139  if (sub == 2)
5140  htmlFileM << " <img src=\"Rhist1IterationMethodDepth5HE.png\" />" << std::endl;
5141  htmlFileM << "<br>" << std::endl;
5142 
5143  htmlFileM << "<h3> 1H: R vs phi , different eta, Depth6 </h3>" << std::endl;
5144  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5145  if (sub == 2)
5146  htmlFileM << " <img src=\"Rhist1IterationMethodDepth6HE.png\" />" << std::endl;
5147  htmlFileM << "<br>" << std::endl;
5148 
5149  htmlFileM << "<h3> 1I: R vs phi , different eta, Depth7 </h3>" << std::endl;
5150  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5151  if (sub == 2)
5152  htmlFileM << " <img src=\"Rhist1IterationMethodDepth7HE.png\" />" << std::endl;
5153  htmlFileM << "<br>" << std::endl;
5154 
5155  htmlFileM << "<h2> 2: Positive direction, D(variance) </h3>" << std::endl;
5156 
5157  htmlFileM << "<h3> 2A: eta/phi-plot: D(variance), averaged over depthes </h3>" << std::endl;
5158  // htmlFileM << "<h4> Legend: Bins less "<<Pedest[0][sub]<<" correpond to bad Pedestals </h4>"<< std::endl;
5159  if (sub == 1)
5160  htmlFileM << " <img src=\"Dhist2IterationMethodHB.png\" />" << std::endl;
5161  if (sub == 2)
5162  htmlFileM << " <img src=\"Dhist2IterationMethodHE.png\" />" << std::endl;
5163  if (sub == 3)
5164  htmlFileM << " <img src=\"Dhist2IterationMethodHO.png\" />" << std::endl;
5165  if (sub == 4)
5166  htmlFileM << " <img src=\"Dhist2IterationMethodHF.png\" />" << std::endl;
5167  htmlFileM << "<br>" << std::endl;
5168 
5169  htmlFileM << "<h3> 2B: D(variance) vs phi , averaged over depthes & eta </h3>" << std::endl;
5170  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5171  if (sub == 1)
5172  htmlFileM << " <img src=\"Dhist1IterationMethodHB.png\" />" << std::endl;
5173  if (sub == 2)
5174  htmlFileM << " <img src=\"Dhist1IterationMethodHE.png\" />" << std::endl;
5175  if (sub == 3)
5176  htmlFileM << " <img src=\"Dhist1IterationMethodHO.png\" />" << std::endl;
5177  if (sub == 4)
5178  htmlFileM << " <img src=\"Dhist1IterationMethodHF.png\" />" << std::endl;
5179  htmlFileM << "<br>" << std::endl;
5180 
5182 
5183  htmlFileM << "<h3> 2C: D(variance) vs phi , different eta, Depth1 </h3>" << std::endl;
5184  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5185  if (sub == 1)
5186  htmlFileM << " <img src=\"Dhist1IterationMethodDepth1HB.png\" />" << std::endl;
5187  if (sub == 2)
5188  htmlFileM << " <img src=\"Dhist1IterationMethodDepth1HE.png\" />" << std::endl;
5189  if (sub == 4)
5190  htmlFileM << " <img src=\"Dhist1IterationMethodDepth1HF.png\" />" << std::endl;
5191  htmlFileM << "<br>" << std::endl;
5192 
5193  htmlFileM << "<h3> 2.D. D(variance) vs phi , different eta, Depth2 </h3>" << std::endl;
5194  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5195  if (sub == 1)
5196  htmlFileM << " <img src=\"Dhist1IterationMethodDepth2HB.png\" />" << std::endl;
5197  if (sub == 2)
5198  htmlFileM << " <img src=\"Dhist1IterationMethodDepth2HE.png\" />" << std::endl;
5199  if (sub == 4)
5200  htmlFileM << " <img src=\"Dhist1IterationMethodDepth2HF.png\" />" << std::endl;
5201  htmlFileM << "<br>" << std::endl;
5202 
5203  htmlFileM << "<h3> 2E: D(variance) vs phi , different eta, Depth3 </h3>" << std::endl;
5204  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5205  if (sub == 1)
5206  htmlFileM << " <img src=\"Dhist1IterationMethodDepth3HB.png\" />" << std::endl;
5207  if (sub == 2)
5208  htmlFileM << " <img src=\"Dhist1IterationMethodDepth3HE.png\" />" << std::endl;
5209  if (sub == 4)
5210  htmlFileM << " <img src=\"Dhist1IterationMethodDepth3HF.png\" />" << std::endl;
5211  htmlFileM << "<br>" << std::endl;
5212 
5213  htmlFileM << "<h3> 2F: D(variance) vs phi , different eta, Depth4 </h3>" << std::endl;
5214  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5215  if (sub == 1)
5216  htmlFileM << " <img src=\"Dhist1IterationMethodDepth4HB.png\" />" << std::endl;
5217  if (sub == 2)
5218  htmlFileM << " <img src=\"Dhist1IterationMethodDepth4HE.png\" />" << std::endl;
5219  if (sub == 3)
5220  htmlFileM << " <img src=\"Dhist1IterationMethodDepth4HO.png\" />" << std::endl;
5221  if (sub == 4)
5222  htmlFileM << " <img src=\"Dhist1IterationMethodDepth4HF.png\" />" << std::endl;
5223  htmlFileM << "<br>" << std::endl;
5224 
5225  htmlFileM << "<h3> 2G: D(variance) vs phi , different eta, Depth5 </h3>" << std::endl;
5226  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5227  if (sub == 2)
5228  htmlFileM << " <img src=\"Dhist1IterationMethodDepth5HE.png\" />" << std::endl;
5229  htmlFileM << "<br>" << std::endl;
5230 
5231  htmlFileM << "<h3> 2H: D(variance) vs phi , different eta, Depth6 </h3>" << std::endl;
5232  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5233  if (sub == 2)
5234  htmlFileM << " <img src=\"Dhist1IterationMethodDepth6HE.png\" />" << std::endl;
5235  htmlFileM << "<br>" << std::endl;
5236 
5237  htmlFileM << "<h3> 2I: D(variance) vs phi , different eta, Depth7 </h3>" << std::endl;
5238  // htmlFileM << "<h4> Channel legend: white - good, other colour - bad. </h4>"<< std::endl;
5239  if (sub == 2)
5240  htmlFileM << " <img src=\"Dhist1IterationMethodDepth7HE.png\" />" << std::endl;
5241  htmlFileM << "<br>" << std::endl;
5242 
5243  htmlFileM.close();
5244 
5246  //
5247  //
5248  } // end sub //for (int sub=1;sub<=4;sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
5249 
5250  //======================================================================
5251 
5252  std::cout << "********" << std::endl;
5253  std::cout << "************ Start creating subdet html pages: - rather long time needed, waiting please"
5254  << std::endl;
5255  //======================================================================
5256  // Creating subdet html pages:
5257 
5258  for (int sub = 1; sub <= 4; sub++) { //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
5259  ofstream htmlFile;
5260  if (sub == 1)
5261  htmlFile.open("HB.html");
5262  if (sub == 2)
5263  htmlFile.open("HE.html");
5264  if (sub == 3)
5265  htmlFile.open("HO.html");
5266  if (sub == 4)
5267  htmlFile.open("HF.html");
5268 
5269  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
5270  htmlFile << "<head>" << std::endl;
5271  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
5272  htmlFile << "<title> Remote Monitoring Tool </title>" << std::endl;
5273  htmlFile << "<style type=\"text/css\">" << std::endl;
5274  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
5275  << std::endl;
5276  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
5277  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
5278  "text-align: center;}"
5279  << std::endl;
5280  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
5281  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
5282  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
5283  htmlFile << " td.s5 { font-family: arial, arial ce, helvetica; background-color: #FF00FF; }" << std::endl;
5284  htmlFile << " td.s6 { font-family: arial, arial ce, helvetica; background-color: #9ACD32; }" << std::endl;
5285  htmlFile << " td.s7 { font-family: arial, arial ce, helvetica; background-color: #32CD32; }" << std::endl;
5286  htmlFile << " td.s8 { font-family: arial, arial ce, helvetica; background-color: #00FFFF; }" << std::endl;
5287  htmlFile << " td.s9 { font-family: arial, arial ce, helvetica; background-color: #FFE4E1; }" << std::endl;
5288  htmlFile << " td.s10 { font-family: arial, arial ce, helvetica; background-color: #A0522D; }" << std::endl;
5289  htmlFile << " td.s11 { font-family: arial, arial ce, helvetica; background-color: #1E90FF; }" << std::endl;
5290  htmlFile << " td.s12 { font-family: arial, arial ce, helvetica; background-color: #00BFFF; }" << std::endl;
5291  htmlFile << " td.s13 { font-family: arial, arial ce, helvetica; background-color: #FFFF00; }" << std::endl;
5292  htmlFile << " td.s14 { font-family: arial, arial ce, helvetica; background-color: #B8860B; }" << std::endl;
5293  htmlFile << "</style>" << std::endl;
5294  htmlFile << "<body>" << std::endl;
5295  if (sub == 1)
5296  htmlFile << "<h1> HCAL BARREL, RUN = " << runnumber << " </h1>" << std::endl;
5297  if (sub == 2)
5298  htmlFile << "<h1> HCAL ENDCAP, RUN = " << runnumber << " </h1>" << std::endl;
5299  if (sub == 3)
5300  htmlFile << "<h1> HCAL OUTER, RUN = " << runnumber << " </h1>" << std::endl;
5301  if (sub == 4)
5302  htmlFile << "<h1> HCAL FORWARD, RUN = " << runnumber << " </h1>" << std::endl;
5303  htmlFile << "<br>" << std::endl;
5304  if (sub == 1)
5305  htmlFile << "<h2> 1. Analysis results for HB</h2>" << std::endl;
5306  if (sub == 2)
5307  htmlFile << "<h2> 1. Analysis results for HE</h2>" << std::endl;
5308  if (sub == 3)
5309  htmlFile << "<h2> 1. Analysis results for HO</h2>" << std::endl;
5310  if (sub == 4)
5311  htmlFile << "<h2> 1. Analysis results for HF</h2>" << std::endl;
5312  htmlFile << "<table width=\"600\">" << std::endl;
5313  htmlFile << "<tr>" << std::endl;
5314 
5315  if (sub == 1) {
5316  /*
5317  htmlFile << " <td><a href=\"HB_Tile.html\">Megatile Channels</a></td>"<< std::endl;
5318  htmlFile << " <td><a href=\"HB_Calib.html\">Calibration Channels</a></td>"<< std::endl;
5319  htmlFile << " <td><a href=\"HB_Drift.html\">Gain Stability</a></td>"<< std::endl;
5320  htmlFile << " <td><a href=\"HB_Pedestals.html\">Pedestals</a></td>"<< std::endl;
5321  htmlFile << " <td><a href=\"HB_Shapes.html\">ADC Shapes</a></td>"<< std::endl;
5322 */
5323 
5324  htmlFile << " <td><a "
5325  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5326  "HcalRemoteMonitoring/RMT/LED_"
5327  << runnumber << "/HB_Tile.html\">Megatile Channels</a></td>" << std::endl;
5328  htmlFile << " <td><a "
5329  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5330  "HcalRemoteMonitoring/RMT/LED_"
5331  << runnumber << "/HB_Calib.html\">Calibration Channels</a></td>" << std::endl;
5332  htmlFile << " <td><a "
5333  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5334  "HcalRemoteMonitoring/RMT/LED_"
5335  << runnumber << "/HB_Drift.html\">Gain Stability</a></td>" << std::endl;
5336  htmlFile << " <td><a "
5337  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5338  "HcalRemoteMonitoring/RMT/LED_"
5339  << runnumber << "/HB_Pedestals.html\">Pedestals</a></td>" << std::endl;
5340  htmlFile << " <td><a "
5341  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5342  "HcalRemoteMonitoring/RMT/LED_"
5343  << runnumber << "/HB_Shapes.html\">ADC Shapes</a></td>" << std::endl;
5344  }
5345  if (sub == 2) {
5346  /*
5347  htmlFile << " <td><a href=\"HE_Tile.html\">Megatile Channels</a></td>"<< std::endl;
5348  htmlFile << " <td><a href=\"HE_Calib.html\">Calibration Channels</a></td>"<< std::endl;
5349  htmlFile << " <td><a href=\"HE_Drift.html\">Gain Stability</a></td>"<< std::endl;
5350  htmlFile << " <td><a href=\"HE_Pedestals.html\">Pedestals</a></td>"<< std::endl;
5351  htmlFile << " <td><a href=\"HE_Shapes.html\">ADC Shapes</a></td>"<< std::endl;
5352  htmlFile << " <td><a href=\"HE_IterationMethod.html\">Iteration Method</a></td>"<< std::endl;
5353 */
5354 
5355  htmlFile << " <td><a "
5356  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5357  "HcalRemoteMonitoring/RMT/LED_"
5358  << runnumber << "/HE_Tile.html\">Megatile Channels</a></td>" << std::endl;
5359  htmlFile << " <td><a "
5360  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5361  "HcalRemoteMonitoring/RMT/LED_"
5362  << runnumber << "/HE_Calib.html\">Calibration Channels</a></td>" << std::endl;
5363  htmlFile << " <td><a "
5364  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5365  "HcalRemoteMonitoring/RMT/LED_"
5366  << runnumber << "/HE_Drift.html\">Gain Stability</a></td>" << std::endl;
5367  htmlFile << " <td><a "
5368  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5369  "HcalRemoteMonitoring/RMT/LED_"
5370  << runnumber << "/HE_Pedestals.html\">Pedestals</a></td>" << std::endl;
5371  htmlFile << " <td><a "
5372  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5373  "HcalRemoteMonitoring/RMT/LED_"
5374  << runnumber << "/HE_Shapes.html\">ADC Shapes</a></td>" << std::endl;
5375  htmlFile << " <td><a "
5376  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5377  "HcalRemoteMonitoring/RMT/LED_"
5378  << runnumber << "/HE_IterationMethod.html\">Iteration Method</a></td>" << std::endl;
5379  }
5380 
5381  if (sub == 3) {
5382  /*
5383  htmlFile << " <td><a href=\"HO_Tile.html\">Megatile Channels</a></td>"<< std::endl;
5384  htmlFile << " <td><a href=\"HO_Calib.html\">Calibration Channels</a></td>"<< std::endl;
5385  htmlFile << " <td><a href=\"HO_Drift.html\">Gain Stability</a></td>"<< std::endl;
5386  htmlFile << " <td><a href=\"HO_Pedestals.html\">Pedestals</a></td>"<< std::endl;
5387  htmlFile << " <td><a href=\"HO_Shapes.html\">ADC Shapes</a></td>"<< std::endl;
5388  */
5389  htmlFile << " <td><a "
5390  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5391  "HcalRemoteMonitoring/RMT/LED_"
5392  << runnumber << "/HO_Tile.html\">Megatile Channels</a></td>" << std::endl;
5393  htmlFile << " <td><a "
5394  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5395  "HcalRemoteMonitoring/RMT/LED_"
5396  << runnumber << "/HO_Calib.html\">Calibration Channels</a></td>" << std::endl;
5397  htmlFile << " <td><a "
5398  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5399  "HcalRemoteMonitoring/RMT/LED_"
5400  << runnumber << "/HO_Drift.html\">Gain Stability</a></td>" << std::endl;
5401  htmlFile << " <td><a "
5402  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5403  "HcalRemoteMonitoring/RMT/LED_"
5404  << runnumber << "/HO_Pedestals.html\">Pedestals</a></td>" << std::endl;
5405  htmlFile << " <td><a "
5406  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5407  "HcalRemoteMonitoring/RMT/LED_"
5408  << runnumber << "/HO_Shapes.html\">ADC Shapes</a></td>" << std::endl;
5409  }
5410  if (sub == 4) {
5411  /*
5412  htmlFile << " <td><a href=\"HF_Tile.html\">Megatile Channels</a></td>"<< std::endl;
5413  htmlFile << " <td><a href=\"HF_Calib.html\">Calibration Channels</a></td>"<< std::endl;
5414  htmlFile << " <td><a href=\"HF_Drift.html\">Gain Stability</a></td>"<< std::endl;
5415  htmlFile << " <td><a href=\"HF_Pedestals.html\">Pedestals</a></td>"<< std::endl;
5416  htmlFile << " <td><a href=\"HF_Shapes.html\">ADC Shapes</a></td>"<< std::endl;
5417  */
5418  htmlFile << " <td><a "
5419  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5420  "HcalRemoteMonitoring/RMT/LED_"
5421  << runnumber << "/HF_Tile.html\">Megatile Channels</a></td>" << std::endl;
5422  htmlFile << " <td><a "
5423  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5424  "HcalRemoteMonitoring/RMT/LED_"
5425  << runnumber << "/HF_Calib.html\">Calibration Channels</a></td>" << std::endl;
5426  htmlFile << " <td><a "
5427  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5428  "HcalRemoteMonitoring/RMT/LED_"
5429  << runnumber << "/HF_Drift.html\">Gain Stability</a></td>" << std::endl;
5430  htmlFile << " <td><a "
5431  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5432  "HcalRemoteMonitoring/RMT/LED_"
5433  << runnumber << "/HF_Pedestals.html\">Pedestals</a></td>" << std::endl;
5434  htmlFile << " <td><a "
5435  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5436  "HcalRemoteMonitoring/RMT/LED_"
5437  << runnumber << "/HF_Shapes.html\">ADC Shapes</a></td>" << std::endl;
5438  }
5439 
5440  htmlFile << "</tr>" << std::endl;
5441  htmlFile << "</table>" << std::endl;
5442  htmlFile << "<br>" << std::endl;
5443  if (sub == 1)
5444  htmlFile << "<h2> 2.Status HB over all criteria </h2>" << std::endl;
5445  if (sub == 2)
5446  htmlFile << "<h2> 2.Status HE over all criteria </h2>" << std::endl;
5447  if (sub == 3)
5448  htmlFile << "<h2> 2.Status HO over all criteria </h2>" << std::endl;
5449  if (sub == 4)
5450  htmlFile << "<h2> 2.Status HF over all criteria </h2>" << std::endl;
5451  htmlFile << "<h3> 2.A.Channel map for each Depth </h3>" << std::endl;
5452  htmlFile << "<h4> Channel legend: green - good, red - bad (rate of failures at least 0.1), yellow - at least 2% "
5453  "gain drift, white - not applicable or out of range </h4>"
5454  << std::endl;
5455  if (sub == 1)
5456  htmlFile << " <img src=\"MAPHB.png\" />" << std::endl;
5457  if (sub == 2)
5458  htmlFile << " <img src=\"MAPHE.png\" />" << std::endl;
5459  if (sub == 3)
5460  htmlFile << " <img src=\"MAPHO.png\" />" << std::endl;
5461  if (sub == 4)
5462  htmlFile << " <img src=\"MAPHF.png\" />" << std::endl;
5463  htmlFile << "<br>" << std::endl;
5464 
5465  htmlFile << "<h3> 2.B.List of Bad channels (rate > 0.1) and its rates for each RMT criteria (for GS - %) </h3>"
5466  << std::endl;
5467 
5468  // htmlFile << " <td><a href=\"HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
5469  htmlFile << " <td><a "
5470  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
5471  "HcalRemoteMonitoring/RMT/LED_"
5472  << runnumber << "/HELP.html\"> Description of criteria for bad channel selection</a></td>" << std::endl;
5473 
5474  htmlFile << "<table>" << std::endl;
5475  htmlFile << "<tr>";
5476  htmlFile << "<td class=\"s4\" align=\"center\">#</td>" << std::endl;
5477  htmlFile << "<td class=\"s1\" align=\"center\">ETA</td>" << std::endl;
5478  htmlFile << "<td class=\"s1\" align=\"center\">PHI</td>" << std::endl;
5479  htmlFile << "<td class=\"s1\" align=\"center\">DEPTH</td>" << std::endl;
5480  htmlFile << "<td class=\"s1\" align=\"center\">RBX</td>" << std::endl;
5481  htmlFile << "<td class=\"s1\" align=\"center\">RM</td>" << std::endl;
5482  htmlFile << "<td class=\"s1\" align=\"center\">PIXEL</td>" << std::endl;
5483  htmlFile << "<td class=\"s1\" align=\"center\">RM_FIBER</td>" << std::endl;
5484  htmlFile << "<td class=\"s1\" align=\"center\">FIBER_CH</td>" << std::endl;
5485  htmlFile << "<td class=\"s1\" align=\"center\">QIE</td>" << std::endl;
5486  htmlFile << "<td class=\"s1\" align=\"center\">ADC</td>" << std::endl;
5487  htmlFile << "<td class=\"s1\" align=\"center\">CRATE</td>" << std::endl;
5488  htmlFile << "<td class=\"s1\" align=\"center\">DCC</td>" << std::endl;
5489  htmlFile << "<td class=\"s1\" align=\"center\">SPIGOT</td>" << std::endl;
5490  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FIBER</td>" << std::endl;
5491  htmlFile << "<td class=\"s1\" align=\"center\">HTR_SLOT</td>" << std::endl;
5492  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FPGA</td>" << std::endl;
5493  htmlFile << "<td class=\"s5\" align=\"center\">Cm</td>" << std::endl;
5494  htmlFile << "<td class=\"s5\" align=\"center\">Am</td>" << std::endl;
5495  htmlFile << "<td class=\"s5\" align=\"center\">Wm</td>" << std::endl;
5496  htmlFile << "<td class=\"s5\" align=\"center\">Rm</td>" << std::endl;
5497  htmlFile << "<td class=\"s5\" align=\"center\">TNm</td>" << std::endl;
5498  htmlFile << "<td class=\"s5\" align=\"center\">TXm</td>" << std::endl;
5499  htmlFile << "<td class=\"s9\" align=\"center\">GS (%)</td>" << std::endl;
5500  htmlFile << "<td class=\"s4\" align=\"center\">Pm</td>" << std::endl;
5501  htmlFile << "<td class=\"s4\" align=\"center\">pWm</td>" << std::endl;
5502  htmlFile << "<td class=\"s8\" align=\"center\">Cc</td>" << std::endl;
5503  htmlFile << "<td class=\"s8\" align=\"center\">Ac</td>" << std::endl;
5504  htmlFile << "<td class=\"s8\" align=\"center\">Wc</td>" << std::endl;
5505  htmlFile << "<td class=\"s8\" align=\"center\">Rc</td>" << std::endl;
5506  htmlFile << "<td class=\"s8\" align=\"center\">TNc</td>" << std::endl;
5507  htmlFile << "<td class=\"s8\" align=\"center\">TXc</td>" << std::endl;
5508 
5509  htmlFile << "</tr>" << std::endl;
5510 
5511  for (int i = 1; i <= NBad; i++) {
5512  if ((ind % 2) == 1) {
5513  raw_class = "<td class=\"s2\" align=\"center\">";
5514  raw_class1 = "<td class=\"s6\" align=\"center\">";
5515  raw_class2 = "<td class=\"s11\" align=\"center\">";
5516  raw_class3 = "<td class=\"s13\" align=\"center\">";
5517 
5518  } else {
5519  raw_class = "<td class=\"s3\" align=\"center\">";
5520  raw_class1 = "<td class=\"s7\" align=\"center\">";
5521  raw_class2 = "<td class=\"s12\" align=\"center\">";
5522  raw_class3 = "<td class=\"s14\" align=\"center\">";
5523  }
5524  const CellDB db;
5525  CellDB ce;
5526  if ((ce.size() >= 1) && (Sub[2][i] == sub)) {
5527  if (Sub[2][i] == 1) {
5528  ce = db.find("subdet", "HB").find("Eta", Eta[2][i]).find("Phi", Phi[2][i]).find("Depth", Depth[2][i]);
5529  if (ce.size() == 0) {
5530  // cout<<"Error: No such HB, Eta="<< Eta[2][i] <<", Phi="<< Phi[2][i] <<", Depth="<< Depth[2][i] <<" in database"<<endl;
5531  continue;
5532  } else if (ce.size() > 1) {
5533  cout << "Warning: More than one line correspond to such HB, Eta=" << Eta[2][i] << ", Phi=" << Phi[2][i]
5534  << ", Depth=" << Depth[2][i] << " in database" << endl;
5535  }
5536  }
5537  if (Sub[2][i] == 2) {
5538  ce = db.find("subdet", "HE").find("Eta", Eta[2][i]).find("Phi", Phi[2][i]).find("Depth", Depth[2][i]);
5539  if (ce.size() == 0) {
5540  // cout<<"Error: No such HE, Eta="<< Eta[2][i] <<", Phi="<< Phi[2][i] <<", Depth="<< Depth[2][i] <<" in database"<<endl;
5541  continue;
5542  } else if (ce.size() > 1) {
5543  cout << "Warning: More than one line correspond to such HE, Eta=" << Eta[2][i] << ", Phi=" << Phi[2][i]
5544  << ", Depth=" << Depth[2][i] << " in database" << endl;
5545  }
5546  }
5547  if (Sub[2][i] == 3) {
5548  ce = db.find("subdet", "HO").find("Eta", Eta[2][i]).find("Phi", Phi[2][i]).find("Depth", Depth[2][i]);
5549  if (ce.size() == 0) {
5550  // cout<<"Error: No such HO, Eta="<< Eta[2][i] <<", Phi="<< Phi[2][i] <<", Depth="<< Depth[2][i] <<" in database"<<endl;
5551  continue;
5552  } else if (ce.size() > 1) {
5553  cout << "Warning: More than one line correspond to such HO, Eta=" << Eta[2][i] << ", Phi=" << Phi[2][i]
5554  << ", Depth=" << Depth[2][i] << " in database" << endl;
5555  }
5556  }
5557  if (Sub[2][i] == 4) {
5558  ce = db.find("subdet", "HF").find("Eta", Eta[2][i]).find("Phi", Phi[2][i]).find("Depth", Depth[2][i]);
5559  if (ce.size() == 0) {
5560  // cout<<"Error: No such HF, Eta="<< Eta[2][i] <<", Phi="<< Phi[2][i] <<", Depth="<< Depth[2][i] <<" in database"<<endl;
5561  continue;
5562  } else if (ce.size() > 1) {
5563  cout << "Warning: More than one line correspond to such HF, Eta=" << Eta[2][i] << ", Phi=" << Phi[2][i]
5564  << ", Depth=" << Depth[2][i] << " in database" << endl;
5565  }
5566  }
5567  htmlFile << "<tr>" << std::endl;
5568  htmlFile << "<td class=\"s4\" align=\"center\">" << ind + 1 << "</td>" << std::endl;
5569  htmlFile << raw_class << Eta[2][i] << "</td>" << std::endl;
5570  htmlFile << raw_class << Phi[2][i] << "</td>" << std::endl;
5571  htmlFile << raw_class << Depth[2][i] << "</td>" << std::endl;
5572  htmlFile << raw_class << ce[0].RBX << "</td>" << std::endl;
5573  htmlFile << raw_class << ce[0].RM << "</td>" << std::endl;
5574  htmlFile << raw_class << ce[0].Pixel << "</td>" << std::endl;
5575  htmlFile << raw_class << ce[0].RMfiber << "</td>" << std::endl;
5576  htmlFile << raw_class << ce[0].FiberCh << "</td>" << std::endl;
5577  htmlFile << raw_class << ce[0].QIE << "</td>" << std::endl;
5578  htmlFile << raw_class << ce[0].ADC << "</td>" << std::endl;
5579  htmlFile << raw_class << ce[0].VMECardID << "</td>" << std::endl;
5580  htmlFile << raw_class << ce[0].dccID << "</td>" << std::endl;
5581  htmlFile << raw_class << ce[0].Spigot << "</td>" << std::endl;
5582  htmlFile << raw_class << ce[0].FiberIndex << "</td>" << std::endl;
5583  htmlFile << raw_class << ce[0].HtrSlot << "</td>" << std::endl;
5584  htmlFile << raw_class << ce[0].HtrTB << "</td>" << std::endl;
5585  htmlFile << raw_class1 << Map_Ampl[1][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5586  << "</td>" << std::endl;
5587  htmlFile << raw_class1 << Map_Ampl[2][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5588  << "</td>" << std::endl;
5589  htmlFile << raw_class1 << Map_Ampl[3][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5590  << "</td>" << std::endl;
5591  htmlFile << raw_class1 << Map_Ampl[4][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5592  << "</td>" << std::endl;
5593  htmlFile << raw_class1 << Map_Ampl[5][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5594  << "</td>" << std::endl;
5595  htmlFile << raw_class1 << Map_Ampl[6][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5596  << "</td>" << std::endl;
5597  htmlFile << raw_class3 << Map_Ampl[21][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5598  << "</td>" << std::endl;
5599  htmlFile << raw_class << Map_Ampl[31][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5600  << "</td>" << std::endl;
5601  htmlFile << raw_class << Map_Ampl[32][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5602  << "</td>" << std::endl;
5603  htmlFile << raw_class2 << Map_Ampl[11][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5604  << "</td>" << std::endl;
5605  htmlFile << raw_class2 << Map_Ampl[12][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5606  << "</td>" << std::endl;
5607  htmlFile << raw_class2 << Map_Ampl[13][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5608  << "</td>" << std::endl;
5609  htmlFile << raw_class2 << Map_Ampl[14][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5610  << "</td>" << std::endl;
5611  htmlFile << raw_class2 << Map_Ampl[15][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5612  << "</td>" << std::endl;
5613  htmlFile << raw_class2 << Map_Ampl[16][Sub[2][i]][Depth[2][i]]->GetBinContent(Eta[2][i] + 41, Phi[2][i] + 1)
5614  << "</td>" << std::endl;
5615  htmlFile << "</tr>" << std::endl;
5616 
5617  ind += 1;
5618  }
5619  }
5620  htmlFile << "</table>" << std::endl;
5621  htmlFile << "<br>" << std::endl;
5622 
5623  htmlFile << "<h3> 2.C.List of Gain unstable channels and its value in % (for other criterias - rate)</h3>"
5624  << std::endl;
5625  htmlFile << "<table>" << std::endl;
5626  htmlFile << "<tr>";
5627  htmlFile << "<td class=\"s4\" align=\"center\">#</td>" << std::endl;
5628  htmlFile << "<td class=\"s1\" align=\"center\">ETA</td>" << std::endl;
5629  htmlFile << "<td class=\"s1\" align=\"center\">PHI</td>" << std::endl;
5630  htmlFile << "<td class=\"s1\" align=\"center\">DEPTH</td>" << std::endl;
5631  htmlFile << "<td class=\"s1\" align=\"center\">RBX</td>" << std::endl;
5632  htmlFile << "<td class=\"s1\" align=\"center\">RM</td>" << std::endl;
5633  htmlFile << "<td class=\"s1\" align=\"center\">PIXEL</td>" << std::endl;
5634  htmlFile << "<td class=\"s1\" align=\"center\">RM_FIBER</td>" << std::endl;
5635  htmlFile << "<td class=\"s1\" align=\"center\">FIBER_CH</td>" << std::endl;
5636  htmlFile << "<td class=\"s1\" align=\"center\">QIE</td>" << std::endl;
5637  htmlFile << "<td class=\"s1\" align=\"center\">ADC</td>" << std::endl;
5638  htmlFile << "<td class=\"s1\" align=\"center\">CRATE</td>" << std::endl;
5639  htmlFile << "<td class=\"s1\" align=\"center\">DCC</td>" << std::endl;
5640  htmlFile << "<td class=\"s1\" align=\"center\">SPIGOT</td>" << std::endl;
5641  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FIBER</td>" << std::endl;
5642  htmlFile << "<td class=\"s1\" align=\"center\">HTR_SLOT</td>" << std::endl;
5643  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FPGA</td>" << std::endl;
5644  htmlFile << "<td class=\"s5\" align=\"center\">Cm</td>" << std::endl;
5645  htmlFile << "<td class=\"s5\" align=\"center\">Am</td>" << std::endl;
5646  htmlFile << "<td class=\"s5\" align=\"center\">Wm</td>" << std::endl;
5647  htmlFile << "<td class=\"s5\" align=\"center\">Rm</td>" << std::endl;
5648  htmlFile << "<td class=\"s5\" align=\"center\">TNm</td>" << std::endl;
5649  htmlFile << "<td class=\"s5\" align=\"center\">TXm</td>" << std::endl;
5650  htmlFile << "<td class=\"s9\" align=\"center\">GS(%)</td>" << std::endl;
5651  htmlFile << "<td class=\"s4\" align=\"center\">Pm</td>" << std::endl;
5652  htmlFile << "<td class=\"s4\" align=\"center\">pWm</td>" << std::endl;
5653  htmlFile << "<td class=\"s8\" align=\"center\">Cc</td>" << std::endl;
5654  htmlFile << "<td class=\"s8\" align=\"center\">Ac</td>" << std::endl;
5655  htmlFile << "<td class=\"s8\" align=\"center\">Wc</td>" << std::endl;
5656  htmlFile << "<td class=\"s8\" align=\"center\">Rc</td>" << std::endl;
5657  htmlFile << "<td class=\"s8\" align=\"center\">TNc</td>" << std::endl;
5658  htmlFile << "<td class=\"s8\" align=\"center\">TXc</td>" << std::endl;
5659  htmlFile << "</tr>" << std::endl;
5660 
5661  for (int i = 1; i <= NWarn; i++) {
5662  if ((ind % 2) == 1) {
5663  raw_class = "<td class=\"s2\" align=\"center\">";
5664  raw_class1 = "<td class=\"s6\" align=\"center\">";
5665  raw_class2 = "<td class=\"s11\" align=\"center\">";
5666  raw_class3 = "<td class=\"s13\" align=\"center\">";
5667 
5668  } else {
5669  raw_class = "<td class=\"s3\" align=\"center\">";
5670  raw_class1 = "<td class=\"s7\" align=\"center\">";
5671  raw_class2 = "<td class=\"s12\" align=\"center\">";
5672  raw_class3 = "<td class=\"s14\" align=\"center\">";
5673  }
5674  const CellDB db;
5675  CellDB ce;
5676  if ((ce.size() >= 1) && (Sub[1][i] == sub)) {
5677  if (Sub[1][i] == 1) {
5678  ce = db.find("subdet", "HB").find("Eta", Eta[1][i]).find("Phi", Phi[1][i]).find("Depth", Depth[1][i]);
5679  if (ce.size() == 0) {
5680  // cout<<"Error: No such HB, Eta="<< Eta[1][i] <<", Phi="<< Phi[1][i] <<", Depth="<< Depth[1][i] <<" in database"<<endl;
5681  continue;
5682  } else if (ce.size() > 1) {
5683  cout << "Warning: More than one line correspond to such HB, Eta=" << Eta[1][i] << ", Phi=" << Phi[1][i]
5684  << ", Depth=" << Depth[1][i] << " in database" << endl;
5685  }
5686  }
5687  if (Sub[1][i] == 2) {
5688  ce = db.find("subdet", "HE").find("Eta", Eta[1][i]).find("Phi", Phi[1][i]).find("Depth", Depth[1][i]);
5689  if (ce.size() == 0) {
5690  // cout<<"Error: No such HE, Eta="<< Eta[1][i] <<", Phi="<< Phi[1][i] <<", Depth="<< Depth[1][i] <<" in database"<<endl;
5691  continue;
5692  } else if (ce.size() > 1) {
5693  cout << "Warning: More than one line correspond to such HE, Eta=" << Eta[1][i] << ", Phi=" << Phi[1][i]
5694  << ", Depth=" << Depth[1][i] << " in database" << endl;
5695  }
5696  }
5697  if (Sub[1][i] == 3) {
5698  ce = db.find("subdet", "HO").find("Eta", Eta[1][i]).find("Phi", Phi[1][i]).find("Depth", Depth[1][i]);
5699  if (ce.size() == 0) {
5700  // cout<<"Error: No such HO, Eta="<< Eta[1][i] <<", Phi="<< Phi[1][i] <<", Depth="<< Depth[1][i] <<" in database"<<endl;
5701  continue;
5702  } else if (ce.size() > 1) {
5703  cout << "Warning: More than one line correspond to such HO, Eta=" << Eta[1][i] << ", Phi=" << Phi[1][i]
5704  << ", Depth=" << Depth[1][i] << " in database" << endl;
5705  }
5706  }
5707  if (Sub[1][i] == 4) {
5708  ce = db.find("subdet", "HF").find("Eta", Eta[1][i]).find("Phi", Phi[1][i]).find("Depth", Depth[1][i]);
5709  if (ce.size() == 0) {
5710  // cout<<"Error: No such HF, Eta="<< Eta[1][i] <<", Phi="<< Phi[1][i] <<", Depth="<< Depth[1][i] <<" in database"<<endl;
5711  continue;
5712  } else if (ce.size() > 1) {
5713  cout << "Warning: More than one line correspond to such HF, Eta=" << Eta[1][i] << ", Phi=" << Phi[1][i]
5714  << ", Depth=" << Depth[1][i] << " in database" << endl;
5715  }
5716  }
5717  htmlFile << "<td class=\"s4\" align=\"center\">" << ind + 1 << "</td>" << std::endl;
5718  htmlFile << raw_class << Eta[1][i] << "</td>" << std::endl;
5719  htmlFile << raw_class << Phi[1][i] << "</td>" << std::endl;
5720  htmlFile << raw_class << Depth[1][i] << "</td>" << std::endl;
5721  htmlFile << raw_class << ce[0].RBX << "</td>" << std::endl;
5722  htmlFile << raw_class << ce[0].RM << "</td>" << std::endl;
5723  htmlFile << raw_class << ce[0].Pixel << "</td>" << std::endl;
5724  htmlFile << raw_class << ce[0].RMfiber << "</td>" << std::endl;
5725  htmlFile << raw_class << ce[0].FiberCh << "</td>" << std::endl;
5726  htmlFile << raw_class << ce[0].QIE << "</td>" << std::endl;
5727  htmlFile << raw_class << ce[0].ADC << "</td>" << std::endl;
5728  htmlFile << raw_class << ce[0].VMECardID << "</td>" << std::endl;
5729  htmlFile << raw_class << ce[0].dccID << "</td>" << std::endl;
5730  htmlFile << raw_class << ce[0].Spigot << "</td>" << std::endl;
5731  htmlFile << raw_class << ce[0].FiberIndex << "</td>" << std::endl;
5732  htmlFile << raw_class << ce[0].HtrSlot << "</td>" << std::endl;
5733  htmlFile << raw_class << ce[0].HtrTB << "</td>" << std::endl;
5734  htmlFile << raw_class1 << Map_Ampl[1][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5735  << "</td>" << std::endl;
5736  htmlFile << raw_class1 << Map_Ampl[2][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5737  << "</td>" << std::endl;
5738  htmlFile << raw_class1 << Map_Ampl[3][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5739  << "</td>" << std::endl;
5740  htmlFile << raw_class1 << Map_Ampl[4][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5741  << "</td>" << std::endl;
5742  htmlFile << raw_class1 << Map_Ampl[5][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5743  << "</td>" << std::endl;
5744  htmlFile << raw_class1 << Map_Ampl[6][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5745  << "</td>" << std::endl;
5746  htmlFile << raw_class3 << Map_Ampl[21][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5747  << "</td>" << std::endl;
5748  htmlFile << raw_class << Map_Ampl[31][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5749  << "</td>" << std::endl;
5750  htmlFile << raw_class << Map_Ampl[32][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5751  << "</td>" << std::endl;
5752  htmlFile << raw_class2 << Map_Ampl[11][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5753  << "</td>" << std::endl;
5754  htmlFile << raw_class2 << Map_Ampl[12][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5755  << "</td>" << std::endl;
5756  htmlFile << raw_class2 << Map_Ampl[13][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5757  << "</td>" << std::endl;
5758  htmlFile << raw_class2 << Map_Ampl[14][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5759  << "</td>" << std::endl;
5760  htmlFile << raw_class2 << Map_Ampl[15][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5761  << "</td>" << std::endl;
5762  htmlFile << raw_class2 << Map_Ampl[16][Sub[1][i]][Depth[1][i]]->GetBinContent(Eta[1][i] + 41, Phi[1][i] + 1)
5763  << "</td>" << std::endl;
5764  htmlFile << "</tr>" << std::endl;
5765  htmlFile << "</tr>" << std::endl;
5766  ind += 1;
5767  }
5768  }
5769  htmlFile << "</table>" << std::endl;
5770  htmlFile << "<br>" << std::endl;
5771 
5772  htmlFile << "<h3> 2.D.List of channels with Bad Pedestals (rate > 0.1) and its rates (for GS - %)</h3>"
5773  << std::endl;
5774  htmlFile << "<table>" << std::endl;
5775  htmlFile << "<tr>";
5776  htmlFile << "<td class=\"s4\" align=\"center\">#</td>" << std::endl;
5777  htmlFile << "<td class=\"s1\" align=\"center\">ETA</td>" << std::endl;
5778  htmlFile << "<td class=\"s1\" align=\"center\">PHI</td>" << std::endl;
5779  htmlFile << "<td class=\"s1\" align=\"center\">DEPTH</td>" << std::endl;
5780  htmlFile << "<td class=\"s1\" align=\"center\">RBX</td>" << std::endl;
5781  htmlFile << "<td class=\"s1\" align=\"center\">RM</td>" << std::endl;
5782  htmlFile << "<td class=\"s1\" align=\"center\">PIXEL</td>" << std::endl;
5783  htmlFile << "<td class=\"s1\" align=\"center\">RM_FIBER</td>" << std::endl;
5784  htmlFile << "<td class=\"s1\" align=\"center\">FIBER_CH</td>" << std::endl;
5785  htmlFile << "<td class=\"s1\" align=\"center\">QIE</td>" << std::endl;
5786  htmlFile << "<td class=\"s1\" align=\"center\">ADC</td>" << std::endl;
5787  htmlFile << "<td class=\"s1\" align=\"center\">CRATE</td>" << std::endl;
5788  htmlFile << "<td class=\"s1\" align=\"center\">DCC</td>" << std::endl;
5789  htmlFile << "<td class=\"s1\" align=\"center\">SPIGOT</td>" << std::endl;
5790  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FIBER</td>" << std::endl;
5791  htmlFile << "<td class=\"s1\" align=\"center\">HTR_SLOT</td>" << std::endl;
5792  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FPGA</td>" << std::endl;
5793  htmlFile << "<td class=\"s5\" align=\"center\">Cm</td>" << std::endl;
5794  htmlFile << "<td class=\"s5\" align=\"center\">Am</td>" << std::endl;
5795  htmlFile << "<td class=\"s5\" align=\"center\">Wm</td>" << std::endl;
5796  htmlFile << "<td class=\"s5\" align=\"center\">Rm</td>" << std::endl;
5797  htmlFile << "<td class=\"s5\" align=\"center\">TNm</td>" << std::endl;
5798  htmlFile << "<td class=\"s5\" align=\"center\">TXm</td>" << std::endl;
5799  htmlFile << "<td class=\"s9\" align=\"center\">GS(%)</td>" << std::endl;
5800  htmlFile << "<td class=\"s4\" align=\"center\">Pm</td>" << std::endl;
5801  htmlFile << "<td class=\"s4\" align=\"center\">pWm</td>" << std::endl;
5802  htmlFile << "<td class=\"s8\" align=\"center\">Cc</td>" << std::endl;
5803  htmlFile << "<td class=\"s8\" align=\"center\">Ac</td>" << std::endl;
5804  htmlFile << "<td class=\"s8\" align=\"center\">Wc</td>" << std::endl;
5805  htmlFile << "<td class=\"s8\" align=\"center\">Rc</td>" << std::endl;
5806  htmlFile << "<td class=\"s8\" align=\"center\">TNc</td>" << std::endl;
5807  htmlFile << "<td class=\"s8\" align=\"center\">TXc</td>" << std::endl;
5808  htmlFile << "</tr>" << std::endl;
5809 
5810  for (int i = 1; i <= NPed; i++) {
5811  if ((ind % 2) == 1) {
5812  raw_class = "<td class=\"s2\" align=\"center\">";
5813  raw_class1 = "<td class=\"s6\" align=\"center\">";
5814  raw_class2 = "<td class=\"s11\" align=\"center\">";
5815  raw_class3 = "<td class=\"s13\" align=\"center\">";
5816 
5817  } else {
5818  raw_class = "<td class=\"s3\" align=\"center\">";
5819  raw_class1 = "<td class=\"s7\" align=\"center\">";
5820  raw_class2 = "<td class=\"s12\" align=\"center\">";
5821  raw_class3 = "<td class=\"s14\" align=\"center\">";
5822  }
5823  const CellDB db;
5824  CellDB ce;
5825  if ((ce.size() >= 1) && (Sub[3][i] == sub)) {
5826  if (Sub[3][i] == 1) {
5827  ce = db.find("subdet", "HB").find("Eta", Eta[3][i]).find("Phi", Phi[3][i]).find("Depth", Depth[3][i]);
5828  if (ce.size() == 0) {
5829  // cout<<"Error: No such HB, Eta="<< Eta[3][i] <<", Phi="<< Phi[3][i] <<", Depth="<< Depth[3][i] <<" in database"<<endl;
5830  continue;
5831  } else if (ce.size() > 1) {
5832  cout << "Warning: More than one line correspond to such HB, Eta=" << Eta[3][i] << ", Phi=" << Phi[3][i]
5833  << ", Depth=" << Depth[3][i] << " in database" << endl;
5834  }
5835  }
5836  if (Sub[3][i] == 2) {
5837  ce = db.find("subdet", "HE").find("Eta", Eta[3][i]).find("Phi", Phi[3][i]).find("Depth", Depth[3][i]);
5838  if (ce.size() == 0) {
5839  // cout<<"Error: No such HE, Eta="<< Eta[3][i] <<", Phi="<< Phi[3][i] <<", Depth="<< Depth[3][i] <<" in database"<<endl;
5840  continue;
5841  } else if (ce.size() > 1) {
5842  cout << "Warning: More than one line correspond to such HE, Eta=" << Eta[3][i] << ", Phi=" << Phi[3][i]
5843  << ", Depth=" << Depth[3][i] << " in database" << endl;
5844  }
5845  }
5846  if (Sub[3][i] == 3) {
5847  ce = db.find("subdet", "HO").find("Eta", Eta[3][i]).find("Phi", Phi[3][i]).find("Depth", Depth[3][i]);
5848  if (ce.size() == 0) {
5849  // cout<<"Error: No such HO, Eta="<< Eta[3][i] <<", Phi="<< Phi[3][i] <<", Depth="<< Depth[3][i] <<" in database"<<endl;
5850  continue;
5851  } else if (ce.size() > 1) {
5852  cout << "Warning: More than one line correspond to such HO, Eta=" << Eta[3][i] << ", Phi=" << Phi[3][i]
5853  << ", Depth=" << Depth[3][i] << " in database" << endl;
5854  }
5855  }
5856  if (Sub[3][i] == 4) {
5857  ce = db.find("subdet", "HF").find("Eta", Eta[3][i]).find("Phi", Phi[3][i]).find("Depth", Depth[3][i]);
5858  if (ce.size() == 0) {
5859  // cout<<"Error: No such HF, Eta="<< Eta[3][i] <<", Phi="<< Phi[3][i] <<", Depth="<< Depth[3][i] <<" in database"<<endl;
5860  continue;
5861  } else if (ce.size() > 1) {
5862  cout << "Warning: More than one line correspond to such HF, Eta=" << Eta[3][i] << ", Phi=" << Phi[3][i]
5863  << ", Depth=" << Depth[3][i] << " in database" << endl;
5864  }
5865  }
5866  htmlFile << "<td class=\"s4\" align=\"center\">" << ind + 1 << "</td>" << std::endl;
5867  htmlFile << raw_class << Eta[3][i] << "</td>" << std::endl;
5868  htmlFile << raw_class << Phi[3][i] << "</td>" << std::endl;
5869  htmlFile << raw_class << Depth[3][i] << "</td>" << std::endl;
5870  htmlFile << raw_class << ce[0].RBX << "</td>" << std::endl;
5871  htmlFile << raw_class << ce[0].RM << "</td>" << std::endl;
5872  htmlFile << raw_class << ce[0].Pixel << "</td>" << std::endl;
5873  htmlFile << raw_class << ce[0].RMfiber << "</td>" << std::endl;
5874  htmlFile << raw_class << ce[0].FiberCh << "</td>" << std::endl;
5875  htmlFile << raw_class << ce[0].QIE << "</td>" << std::endl;
5876  htmlFile << raw_class << ce[0].ADC << "</td>" << std::endl;
5877  htmlFile << raw_class << ce[0].VMECardID << "</td>" << std::endl;
5878  htmlFile << raw_class << ce[0].dccID << "</td>" << std::endl;
5879  htmlFile << raw_class << ce[0].Spigot << "</td>" << std::endl;
5880  htmlFile << raw_class << ce[0].FiberIndex << "</td>" << std::endl;
5881  htmlFile << raw_class << ce[0].HtrSlot << "</td>" << std::endl;
5882  htmlFile << raw_class << ce[0].HtrTB << "</td>" << std::endl;
5883  htmlFile << raw_class1 << Map_Ampl[1][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5884  << "</td>" << std::endl;
5885  htmlFile << raw_class1 << Map_Ampl[2][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5886  << "</td>" << std::endl;
5887  htmlFile << raw_class1 << Map_Ampl[3][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5888  << "</td>" << std::endl;
5889  htmlFile << raw_class1 << Map_Ampl[4][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5890  << "</td>" << std::endl;
5891  htmlFile << raw_class1 << Map_Ampl[5][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5892  << "</td>" << std::endl;
5893  htmlFile << raw_class1 << Map_Ampl[6][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5894  << "</td>" << std::endl;
5895  htmlFile << raw_class3 << Map_Ampl[21][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5896  << "</td>" << std::endl;
5897  htmlFile << raw_class << Map_Ampl[31][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5898  << "</td>" << std::endl;
5899  htmlFile << raw_class << Map_Ampl[32][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5900  << "</td>" << std::endl;
5901  htmlFile << raw_class2 << Map_Ampl[11][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5902  << "</td>" << std::endl;
5903  htmlFile << raw_class2 << Map_Ampl[12][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5904  << "</td>" << std::endl;
5905  htmlFile << raw_class2 << Map_Ampl[13][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5906  << "</td>" << std::endl;
5907  htmlFile << raw_class2 << Map_Ampl[14][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5908  << "</td>" << std::endl;
5909  htmlFile << raw_class2 << Map_Ampl[15][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5910  << "</td>" << std::endl;
5911  htmlFile << raw_class2 << Map_Ampl[16][Sub[3][i]][Depth[3][i]]->GetBinContent(Eta[3][i] + 41, Phi[3][i] + 1)
5912  << "</td>" << std::endl;
5913  htmlFile << "</tr>" << std::endl;
5914  htmlFile << "</tr>" << std::endl;
5915  ind += 1;
5916  }
5917  }
5918  htmlFile << "</table>" << std::endl;
5919 
5920  htmlFile << "</body> " << std::endl;
5921  htmlFile << "</html> " << std::endl;
5922  htmlFile.close();
5923  }
5924 
5925  //======================================================================
5926 
5927  std::cout << "********" << std::endl;
5928  std::cout << "************ Start creating description HELP html file:" << std::endl;
5929  //======================================================================
5930  // Creating description html file:
5931  ofstream htmlFile;
5932  htmlFile.open("HELP.html");
5933  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
5934  htmlFile << "<head>" << std::endl;
5935  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
5936  htmlFile << "<title> Remote Monitoring Tool </title>" << std::endl;
5937  htmlFile << "<style type=\"text/css\">" << std::endl;
5938  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
5939  << std::endl;
5940  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
5941  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
5942  "text-align: center;}"
5943  << std::endl;
5944  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
5945  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
5946  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
5947  htmlFile << "</style>" << std::endl;
5948  htmlFile << "<body>" << std::endl;
5949  htmlFile << "<h1> Description of Remote Monitoring Tool criteria for bad channel selection</h1>" << std::endl;
5950  htmlFile << "<br>" << std::endl;
5951  htmlFile << "<h3> - C means CAPID Errors assuming we inspect CAPID non-rotation,error & validation bits, and for "
5952  "this criterion - no need to apply any cuts to select bcs.</h3> "
5953  << std::endl;
5954  htmlFile << "<br>" << std::endl;
5955  htmlFile << "<h3> - A means full amplitude, collected over all time slices </h3> " << std::endl;
5956  htmlFile << "<h3> - R means ratio criterion where we define as a bad, the channels, for which the signal portion in "
5957  "4 middle TSs(plus one, minus two around TS with maximal amplitude) is out of some range of reasonable "
5958  "values </h3> "
5959  << std::endl;
5960  htmlFile << "<br>" << std::endl;
5961  htmlFile << "<h3> - W means width of shape distribution. Width is defined as square root from dispersion. </h3> "
5962  << std::endl;
5963  htmlFile << "<br>" << std::endl;
5964  htmlFile << "<h3> - TN means mean time position of adc signal. </h3> " << std::endl;
5965  htmlFile << "<br>" << std::endl;
5966  htmlFile << "<h3> - TX means TS number of maximum signal </h3> " << std::endl;
5967  htmlFile << "<br>" << std::endl;
5968  htmlFile << "<h3> - m means megatile channels. For example Am means Amplitude criteria for megatile channels </h3> "
5969  << std::endl;
5970  htmlFile << "<br>" << std::endl;
5971  htmlFile
5972  << "<h3> - c means calibration channels. For example Ac means Amplitude criteria for calibration channels </h3> "
5973  << std::endl;
5974  htmlFile << "<br>" << std::endl;
5975  htmlFile << "<h3> - Pm means Pedestals. </h3> " << std::endl;
5976  htmlFile << "<br>" << std::endl;
5977  htmlFile << "<h3> - pWm means pedestal Width. </h3> " << std::endl;
5978  htmlFile << "<br>" << std::endl;
5979  htmlFile << "</body> " << std::endl;
5980  htmlFile << "</html> " << std::endl;
5981  htmlFile.close();
5982 
5983  //======================================================================
5984 
5985  std::cout << "********" << std::endl;
5986  std::cout << "************ Start creating MAP html file: - rather long time needed, waiting please" << std::endl;
5987  //======================================================================
5988  // Creating main html file:
5989  htmlFile.open("MAP.html");
5990  htmlFile << "</html><html xmlns=\"http://www.w3.org/1999/xhtml\">" << std::endl;
5991  htmlFile << "<head>" << std::endl;
5992  htmlFile << "<meta http-equiv=\"Content-Type\" content=\"text/html\"/>" << std::endl;
5993  htmlFile << "<title> Remote Monitoring Tool </title>" << std::endl;
5994  htmlFile << "<style type=\"text/css\">" << std::endl;
5995  htmlFile << " body,td{ background-color: #FFFFCC; font-family: arial, arial ce, helvetica; font-size: 12px; }"
5996  << std::endl;
5997  htmlFile << " td.s0 { font-family: arial, arial ce, helvetica; }" << std::endl;
5998  htmlFile << " td.s1 { font-family: arial, arial ce, helvetica; font-weight: bold; background-color: #FFC169; "
5999  "text-align: center;}"
6000  << std::endl;
6001  htmlFile << " td.s2 { font-family: arial, arial ce, helvetica; background-color: #eeeeee; }" << std::endl;
6002  htmlFile << " td.s3 { font-family: arial, arial ce, helvetica; background-color: #d0d0d0; }" << std::endl;
6003  htmlFile << " td.s4 { font-family: arial, arial ce, helvetica; background-color: #FFC169; }" << std::endl;
6004  htmlFile << " td.s5 { font-family: arial, arial ce, helvetica; background-color: #FF00FF; }" << std::endl;
6005  htmlFile << " td.s6 { font-family: arial, arial ce, helvetica; background-color: #9ACD32; }" << std::endl;
6006  htmlFile << " td.s7 { font-family: arial, arial ce, helvetica; background-color: #32CD32; }" << std::endl;
6007  htmlFile << "</style>" << std::endl;
6008  htmlFile << "<body>" << std::endl;
6009 
6010  htmlFile << "<h1> Remote Monitoring Tool, LED RUN = " << runnumber << ". </h1>" << std::endl;
6011  htmlFile << "<br>" << std::endl;
6012 
6013  htmlFile << "<h2> 1. Analysis results for subdetectors </h2>" << std::endl;
6014  htmlFile << "<table width=\"400\">" << std::endl;
6015  htmlFile << "<tr>" << std::endl;
6016 
6017  /*
6018  htmlFile << " <td><a href=\"HB.html\">HB</a></td>"<< std::endl;
6019  htmlFile << " <td><a href=\"HE.html\">HE</a></td>"<< std::endl;
6020  htmlFile << " <td><a href=\"HO.html\">HO</a></td>"<< std::endl;
6021  htmlFile << " <td><a href=\"HF.html\">HF</a></td>"<< std::endl;
6022 */
6023 
6024  htmlFile << " <td><a "
6025  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
6026  "HcalRemoteMonitoring/RMT/LED_"
6027  << runnumber << "/HB.html\">HB</a></td>" << std::endl;
6028  htmlFile << " <td><a "
6029  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
6030  "HcalRemoteMonitoring/RMT/LED_"
6031  << runnumber << "/HE.html\">HE</a></td>" << std::endl;
6032  htmlFile << " <td><a "
6033  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
6034  "HcalRemoteMonitoring/RMT/LED_"
6035  << runnumber << "/HO.html\">HO</a></td>" << std::endl;
6036  htmlFile << " <td><a "
6037  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
6038  "HcalRemoteMonitoring/RMT/LED_"
6039  << runnumber << "/HF.html\">HF</a></td>" << std::endl;
6040 
6041  htmlFile << "</tr>" << std::endl;
6042  htmlFile << "</table>" << std::endl;
6043  htmlFile << "<br>" << std::endl;
6044 
6045  htmlFile << "<h2> 2. Amplitude summed over all sub-detector channels vs first 1000 events of this Run </h2>"
6046  << std::endl;
6047  htmlFile << "<h3> 2.A. Total subdetector Amplitude vs iEvent </h3>" << std::endl;
6048  htmlFile << " <img src=\"EVENTDEPENDENCE.png\" />" << std::endl;
6049  htmlFile << "<br>" << std::endl;
6050  htmlFile << "<br>" << std::endl;
6051  htmlFile << "<br>" << std::endl;
6052 
6053  htmlFile << "<h2> 3. HCAL status over all criteria and subdetectors </h2>" << std::endl;
6054  htmlFile << "<h3> 3.A. Channels in detector space </h3>" << std::endl;
6055  htmlFile << "<h4> Legend for channel status: green - good, red - bad, yellow - at least 2% gain drift, white - not "
6056  "applicable or out of range </h4>"
6057  << std::endl;
6058  htmlFile << " <img src=\"MAP.png\" />" << std::endl;
6059  htmlFile << "<br>" << std::endl;
6060  htmlFile << "<br>" << std::endl;
6061 
6062  htmlFile << "<h3> 3.B. List of Bad channels </h3>" << std::endl;
6063 
6064  // htmlFile << " <td><a href=\"HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
6065  htmlFile << " <td><a "
6066  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
6067  "HcalRemoteMonitoring/RMT/LED_"
6068  << runnumber << "/HELP.html\"> Description of criteria for bad channel selection</a></td>" << std::endl;
6069  htmlFile << "<table>" << std::endl;
6070  htmlFile << "<tr>";
6071  htmlFile << "<td class=\"s4\" align=\"center\">#</td>" << std::endl;
6072  htmlFile << "<td class=\"s1\" align=\"center\">ETA</td>" << std::endl;
6073  htmlFile << "<td class=\"s1\" align=\"center\">PHI</td>" << std::endl;
6074  htmlFile << "<td class=\"s1\" align=\"center\">DEPTH</td>" << std::endl;
6075  htmlFile << "<td class=\"s1\" align=\"center\">RBX</td>" << std::endl;
6076  htmlFile << "<td class=\"s1\" align=\"center\">RM</td>" << std::endl;
6077  htmlFile << "<td class=\"s1\" align=\"center\">PIXEL</td>" << std::endl;
6078  htmlFile << "<td class=\"s1\" align=\"center\">RM_FIBER</td>" << std::endl;
6079  htmlFile << "<td class=\"s1\" align=\"center\">FIBER_CH</td>" << std::endl;
6080  htmlFile << "<td class=\"s1\" align=\"center\">QIE</td>" << std::endl;
6081  htmlFile << "<td class=\"s1\" align=\"center\">ADC</td>" << std::endl;
6082  htmlFile << "<td class=\"s1\" align=\"center\">CRATE</td>" << std::endl;
6083  htmlFile << "<td class=\"s1\" align=\"center\">DCC</td>" << std::endl;
6084  htmlFile << "<td class=\"s1\" align=\"center\">SPIGOT</td>" << std::endl;
6085  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FIBER</td>" << std::endl;
6086  htmlFile << "<td class=\"s1\" align=\"center\">HTR_SLOT</td>" << std::endl;
6087  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FPGA</td>" << std::endl;
6088  htmlFile << "<td class=\"s5\" align=\"center\">RMT-criteria</td>" << std::endl;
6089  htmlFile << "</tr>" << std::endl;
6090 
6091  ind = 0;
6092 
6093  for (int i = 1; i <= NBad; i++) {
6094  if ((ind % 2) == 1) {
6095  raw_class = "<td class=\"s2\" align=\"center\">";
6096  raw_class1 = "<td class=\"s6\" align=\"center\">";
6097  } else {
6098  raw_class = "<td class=\"s3\" align=\"center\">";
6099  raw_class1 = "<td class=\"s7\" align=\"center\">";
6100  }
6101  const CellDB db;
6102  const CellDB ce = db.find("Eta", Eta[2][i]).find("Phi", Phi[2][i]).find("Depth", Depth[2][i]);
6103  if (ce.size() == 0) {
6104  // cout<<"Error: No such Eta="<< Eta[2][i] <<", Phi="<< Phi[2][i] <<", Depth="<< Depth[2][i] <<" in database"<<endl;
6105  continue;
6106  }
6107  // 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;}
6108 
6109  if (ce.size() >= 1) {
6110  htmlFile << "<tr>" << std::endl;
6111  htmlFile << "<td class=\"s1\" align=\"center\">" << ind + 1 << "</td>" << std::endl;
6112  htmlFile << raw_class << Eta[2][i] << "</td>" << std::endl;
6113  htmlFile << raw_class << Phi[2][i] << "</td>" << std::endl;
6114  htmlFile << raw_class << Depth[2][i] << "</td>" << std::endl;
6115  htmlFile << raw_class << ce[0].RBX << "</td>" << std::endl;
6116  htmlFile << raw_class << ce[0].RM << "</td>" << std::endl;
6117  htmlFile << raw_class << ce[0].Pixel << "</td>" << std::endl;
6118  htmlFile << raw_class << ce[0].RMfiber << "</td>" << std::endl;
6119  htmlFile << raw_class << ce[0].FiberCh << "</td>" << std::endl;
6120  htmlFile << raw_class << ce[0].QIE << "</td>" << std::endl;
6121  htmlFile << raw_class << ce[0].ADC << "</td>" << std::endl;
6122  htmlFile << raw_class << ce[0].VMECardID << "</td>" << std::endl;
6123  htmlFile << raw_class << ce[0].dccID << "</td>" << std::endl;
6124  htmlFile << raw_class << ce[0].Spigot << "</td>" << std::endl;
6125  htmlFile << raw_class << ce[0].FiberIndex << "</td>" << std::endl;
6126  htmlFile << raw_class << ce[0].HtrSlot << "</td>" << std::endl;
6127  htmlFile << raw_class << ce[0].HtrTB << "</td>" << std::endl;
6128  htmlFile << raw_class1 << Comment[2][i] << "</td>" << std::endl;
6129  htmlFile << "</tr>" << std::endl;
6130 
6131  ind += 1;
6132  }
6133  }
6134  htmlFile << "</table>" << std::endl;
6135  htmlFile << "<br>" << std::endl;
6136 
6137  htmlFile << "<h3> 2.C.List of Gain unstable channels </h3>" << std::endl;
6138  // htmlFile << " <td><a href=\"HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
6139  htmlFile << " <td><a "
6140  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
6141  "HcalRemoteMonitoring/RMT/LED_"
6142  << runnumber << "/HELP.html\"> Description of criteria for bad channel selection</a></td>" << std::endl;
6143 
6144  htmlFile << "<table>" << std::endl;
6145  htmlFile << "<tr>";
6146  htmlFile << "<td class=\"s4\" align=\"center\">#</td>" << std::endl;
6147  htmlFile << "<td class=\"s1\" align=\"center\">ETA</td>" << std::endl;
6148  htmlFile << "<td class=\"s1\" align=\"center\">PHI</td>" << std::endl;
6149  htmlFile << "<td class=\"s1\" align=\"center\">DEPTH</td>" << std::endl;
6150  htmlFile << "<td class=\"s1\" align=\"center\">RBX</td>" << std::endl;
6151  htmlFile << "<td class=\"s1\" align=\"center\">RM</td>" << std::endl;
6152  htmlFile << "<td class=\"s1\" align=\"center\">PIXEL</td>" << std::endl;
6153  htmlFile << "<td class=\"s1\" align=\"center\">RM_FIBER</td>" << std::endl;
6154  htmlFile << "<td class=\"s1\" align=\"center\">FIBER_CH</td>" << std::endl;
6155  htmlFile << "<td class=\"s1\" align=\"center\">QIE</td>" << std::endl;
6156  htmlFile << "<td class=\"s1\" align=\"center\">ADC</td>" << std::endl;
6157  htmlFile << "<td class=\"s1\" align=\"center\">CRATE</td>" << std::endl;
6158  htmlFile << "<td class=\"s1\" align=\"center\">DCC</td>" << std::endl;
6159  htmlFile << "<td class=\"s1\" align=\"center\">SPIGOT</td>" << std::endl;
6160  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FIBER</td>" << std::endl;
6161  htmlFile << "<td class=\"s1\" align=\"center\">HTR_SLOT</td>" << std::endl;
6162  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FPGA</td>" << std::endl;
6163  htmlFile << "<td class=\"s5\" align=\"center\">Failed criteria</td>" << std::endl;
6164  htmlFile << "</tr>" << std::endl;
6165 
6166  for (int i = 1; i <= NWarn; i++) {
6167  if ((ind % 2) == 1) {
6168  raw_class = "<td class=\"s2\" align=\"center\">";
6169  raw_class1 = "<td class=\"s6\" align=\"center\">";
6170  } else {
6171  raw_class = "<td class=\"s3\" align=\"center\">";
6172  raw_class1 = "<td class=\"s7\" align=\"center\">";
6173  }
6174  const CellDB db;
6175  const CellDB ce = db.find("Eta", Eta[1][i]).find("Phi", Phi[1][i]).find("Depth", Depth[1][i]);
6176  if (ce.size() == 0) {
6177  // cout<<"Error: No such Eta="<< Eta[1][i] <<", Phi="<< Phi[1][i] <<", Depth="<< Depth[1][i] <<" in database"<<endl;
6178  continue;
6179  }
6180  // 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;}
6181 
6182  if (ce.size() >= 1) {
6183  htmlFile << "<tr>" << std::endl;
6184  htmlFile << "<td class=\"s1\" align=\"center\">" << ind + 1 << "</td>" << std::endl;
6185  htmlFile << raw_class << Eta[1][i] << "</td>" << std::endl;
6186  htmlFile << raw_class << Phi[1][i] << "</td>" << std::endl;
6187  htmlFile << raw_class << Depth[1][i] << "</td>" << std::endl;
6188  htmlFile << raw_class << ce[0].RBX << "</td>" << std::endl;
6189  htmlFile << raw_class << ce[0].RM << "</td>" << std::endl;
6190  htmlFile << raw_class << ce[0].Pixel << "</td>" << std::endl;
6191  htmlFile << raw_class << ce[0].RMfiber << "</td>" << std::endl;
6192  htmlFile << raw_class << ce[0].FiberCh << "</td>" << std::endl;
6193  htmlFile << raw_class << ce[0].QIE << "</td>" << std::endl;
6194  htmlFile << raw_class << ce[0].ADC << "</td>" << std::endl;
6195  htmlFile << raw_class << ce[0].VMECardID << "</td>" << std::endl;
6196  htmlFile << raw_class << ce[0].dccID << "</td>" << std::endl;
6197  htmlFile << raw_class << ce[0].Spigot << "</td>" << std::endl;
6198  htmlFile << raw_class << ce[0].FiberIndex << "</td>" << std::endl;
6199  htmlFile << raw_class << ce[0].HtrSlot << "</td>" << std::endl;
6200  htmlFile << raw_class << ce[0].HtrTB << "</td>" << std::endl;
6201  htmlFile << raw_class1 << Comment[1][i] << "</td>" << std::endl;
6202  htmlFile << "</tr>" << std::endl;
6203 
6204  ind += 1;
6205  }
6206  }
6207 
6208  htmlFile << "</table>" << std::endl;
6209  htmlFile << "<br>" << std::endl;
6210 
6211  htmlFile << "<h3> 2.D.List of channels with bad Pedestals </h3>" << std::endl;
6212  // htmlFile << " <td><a href=\"HELP.html\"> Description of criteria for bad channel selection</a></td>"<< std::endl;
6213  htmlFile << " <td><a "
6214  "href=\"https://cms-cpt-software.web.cern.ch/cms-cpt-software/General/Validation/SVSuite/"
6215  "HcalRemoteMonitoring/RMT/LED_"
6216  << runnumber << "/HELP.html\"> Description of criteria for bad channel selection</a></td>" << std::endl;
6217 
6218  htmlFile << "<table>" << std::endl;
6219  htmlFile << "<tr>";
6220  htmlFile << "<td class=\"s4\" align=\"center\">#</td>" << std::endl;
6221  htmlFile << "<td class=\"s1\" align=\"center\">ETA</td>" << std::endl;
6222  htmlFile << "<td class=\"s1\" align=\"center\">PHI</td>" << std::endl;
6223  htmlFile << "<td class=\"s1\" align=\"center\">DEPTH</td>" << std::endl;
6224  htmlFile << "<td class=\"s1\" align=\"center\">RBX</td>" << std::endl;
6225  htmlFile << "<td class=\"s1\" align=\"center\">RM</td>" << std::endl;
6226  htmlFile << "<td class=\"s1\" align=\"center\">PIXEL</td>" << std::endl;
6227  htmlFile << "<td class=\"s1\" align=\"center\">RM_FIBER</td>" << std::endl;
6228  htmlFile << "<td class=\"s1\" align=\"center\">FIBER_CH</td>" << std::endl;
6229  htmlFile << "<td class=\"s1\" align=\"center\">QIE</td>" << std::endl;
6230  htmlFile << "<td class=\"s1\" align=\"center\">ADC</td>" << std::endl;
6231  htmlFile << "<td class=\"s1\" align=\"center\">CRATE</td>" << std::endl;
6232  htmlFile << "<td class=\"s1\" align=\"center\">DCC</td>" << std::endl;
6233  htmlFile << "<td class=\"s1\" align=\"center\">SPIGOT</td>" << std::endl;
6234  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FIBER</td>" << std::endl;
6235  htmlFile << "<td class=\"s1\" align=\"center\">HTR_SLOT</td>" << std::endl;
6236  htmlFile << "<td class=\"s1\" align=\"center\">HTR_FPGA</td>" << std::endl;
6237  htmlFile << "<td class=\"s5\" align=\"center\">Failed criteria</td>" << std::endl;
6238  htmlFile << "</tr>" << std::endl;
6239 
6240  for (int i = 1; i <= NPed; i++) {
6241  if ((ind % 2) == 1) {
6242  raw_class = "<td class=\"s2\" align=\"center\">";
6243  raw_class1 = "<td class=\"s6\" align=\"center\">";
6244  } else {
6245  raw_class = "<td class=\"s3\" align=\"center\">";
6246  raw_class1 = "<td class=\"s7\" align=\"center\">";
6247  }
6248  const CellDB db;
6249  const CellDB ce = db.find("Eta", Eta[3][i]).find("Phi", Phi[3][i]).find("Depth", Depth[3][i]);
6250  if (ce.size() == 0) {
6251  // cout<<"Error: No such Eta="<< Eta[3][i] << ", Phi="<< Phi[3][i] <<", Depth="<< Depth[3][i] <<" in database"<<endl;
6252  continue;
6253  }
6254  // 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;}
6255 
6256  if (ce.size() >= 1) {
6257  htmlFile << "<tr>" << std::endl;
6258  htmlFile << "<td class=\"s1\" align=\"center\">" << ind + 1 << "</td>" << std::endl;
6259  htmlFile << raw_class << Eta[3][i] << "</td>" << std::endl;
6260  htmlFile << raw_class << Phi[3][i] << "</td>" << std::endl;
6261  htmlFile << raw_class << Depth[3][i] << "</td>" << std::endl;
6262  htmlFile << raw_class << ce[0].RBX << "</td>" << std::endl;
6263  htmlFile << raw_class << ce[0].RM << "</td>" << std::endl;
6264  htmlFile << raw_class << ce[0].Pixel << "</td>" << std::endl;
6265  htmlFile << raw_class << ce[0].RMfiber << "</td>" << std::endl;
6266  htmlFile << raw_class << ce[0].FiberCh << "</td>" << std::endl;
6267  htmlFile << raw_class << ce[0].QIE << "</td>" << std::endl;
6268  htmlFile << raw_class << ce[0].ADC << "</td>" << std::endl;
6269  htmlFile << raw_class << ce[0].VMECardID << "</td>" << std::endl;
6270  htmlFile << raw_class << ce[0].dccID << "</td>" << std::endl;
6271  htmlFile << raw_class << ce[0].Spigot << "</td>" << std::endl;
6272  htmlFile << raw_class << ce[0].FiberIndex << "</td>" << std::endl;
6273  htmlFile << raw_class << ce[0].HtrSlot << "</td>" << std::endl;
6274  htmlFile << raw_class << ce[0].HtrTB << "</td>" << std::endl;
6275  htmlFile << raw_class1 << Comment[3][i] << "</td>" << std::endl;
6276  htmlFile << "</tr>" << std::endl;
6277 
6278  ind += 1;
6279  }
6280  }
6281 
6282  htmlFile << "</table>" << std::endl;
6283 
6284  htmlFile << "</body> " << std::endl;
6285  htmlFile << "</html> " << std::endl;
6286  htmlFile.close();
6287  //======================================================================
6288 
6289  //======================================================================
6290  // Close and delete all possible things:
6291  hfile->Close();
6292  // hfile->Delete();
6293  // Exit Root
6294  gSystem->Exit(0);
6295  //======================================================================
6296 }
const int nphi
CellDB find(const std::string par, const T val) const
tuple db
Definition: EcalCondDB.py:153
int size() const
const int nsub
const int neta
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
uint16_t const *__restrict__ x
Definition: gpuClustering.h:39
tuple argc
Definition: dir2webdir.py:39
string fname
main script
tuple cout
Definition: gather_cfg.py:144
const int ndepth
#define str(s)