Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:06:06

0001 // How to run: ./RemoteMonitoringPSM.cc.exe root_file1  root_file_ref Global
0002 
0003 #include "LogEleMapdb.h"
0004 
0005 #include <iostream>
0006 #include <fstream>
0007 
0008 #include "TH1.h"
0009 #include "TH2.h"
0010 #include "TCanvas.h"
0011 #include "TROOT.h"
0012 #include <TMath.h>
0013 #include "TStyle.h"
0014 #include "TSystem.h"
0015 #include "TLegend.h"
0016 #include "TText.h"
0017 #include "TAxis.h"
0018 #include "TFile.h"
0019 #include "TLine.h"
0020 #include "TGraph.h"
0021 
0022 using namespace std;
0023 int main(int argc, char* argv[]) {
0024   std::string dirnm = "Analyzer";
0025   gROOT->Reset();
0026   gROOT->SetStyle("Plain");
0027   gStyle->SetOptStat(0);
0028   gStyle->SetOptTitle(1);
0029   // ok change
0030   if (argc < 3)
0031     return 1;
0032   char fname[300];
0033   char refname[300];
0034   char runtypeC[300];
0035   sprintf(fname, "%s", argv[1]);
0036   sprintf(refname, "%s", argv[2]);
0037   sprintf(runtypeC, "%s", argv[3]);
0038   //               std::cout<<fname<<" "<<refname<<" "<<runtypeC<<std::endl;
0039   std::cout << " We are here to print fname refname runtypeC " << fname << " " << refname << " " << runtypeC
0040             << std::endl;
0041   // ok change
0042 
0043   //======================================================================
0044   // Connect the input files, parameters and get the 2-d histogram in memory
0045   string promt = (string)fname;
0046   string runtype = (string)runtypeC;
0047   string runnumber = "";
0048   for (unsigned int i = promt.size() - 11; i < promt.size() - 5; i++)
0049     runnumber += fname[i];
0050   string refrunnumber = "";
0051   promt = (string)refname;
0052   for (unsigned int i = promt.size() - 11; i < promt.size() - 5; i++)
0053     refrunnumber += refname[i];
0054 
0055   TFile* hfile = new TFile(fname, "READ");
0056   hfile->ls();
0057   TDirectory* dir = (TDirectory*)hfile->FindObjectAny(dirnm.c_str());
0058 
0059   TFile* hreffile = new TFile(refname, "READ");
0060   hreffile->ls();
0061   TDirectory* refdir = (TDirectory*)hreffile->FindObjectAny(dirnm.c_str());
0062 
0063   // with TfileService implementation, change everywhere below:     hreffile->Get     to     refdir->FindObjectAny
0064   // with TfileService implementation, change everywhere below:     hfile->Get     to     dir->FindObjectAny
0065 
0066   double MIN_M[7][5];
0067   double MAX_M[7][5];
0068   double MIN_C[7][5];
0069   double MAX_C[7][5];
0070   double porog[5];
0071   double Pedest[2][5];
0072 
0073   if (runtype == "LED") {
0074     //CUTS:    [test][subdetector]                                       ADC amplitude  Am      Width  for Wm             Ratio cut for Rm             TS mean for TNm           TS max  for TXm
0075     double MIN_M_LED[7][5] = {{0., 0., 0., 0., 0.},
0076                               {0., 0., 0., 0., 0.},
0077                               {0, 100., 70., 40., 40.},
0078                               {0, 0.7, 0.7, 0.1, 0.1},
0079                               {0, 0.7, 0.6, 0.40, 0.45},
0080                               {0, 2.5, 1.0, 1.0, 1.0},
0081                               {0, 1.5, 1.5, 0.5, 0.5}};
0082     double MAX_M_LED[7][5] = {{0., 0., 0., 0., 0.},
0083                               {0., 0., 0., 0., 0.},
0084                               {0, 3000, 500000, 3000, 150000},
0085                               {0, 2.5, 2.5, 2.8, 2.6},
0086                               {0, 0.94, 0.95, 1.04, 1.02},
0087                               {0, 5.5, 5.2, 4.8, 4.2},
0088                               {0, 6.5, 6.5, 8.5, 8.5}};
0089     double MIN_C_LED[7][5] = {{0., 0., 0., 0., 0.},
0090                               {0., 0., 0., 0., 0.},
0091                               {0, 1000., 1000., 1000., 100.},
0092                               {0, 1.3, 1.3, 0.7, 0.3},
0093                               {0, 0.76, 0.76, 0.85, 0.5},
0094                               {0, 2.4, 2.4, 1.5, 3.5},
0095                               {0, 1.5, 1.5, 1.5, 3.5}};
0096     double MAX_C_LED[7][5] = {{0., 0., 0., 0., 0.},
0097                               {0., 0., 0., 0., 0.},
0098                               {0, 1E20, 1E20, 1E20, 1E20},
0099                               {0, 1.9, 1.9, 1.65, 1.5},
0100                               {0, 0.94, 0.94, 0.99, 0.8},
0101                               {0, 3.7, 3.7, 2.7, 4.5},
0102                               {0, 2.5, 2.5, 2.5, 4.5}};
0103     double porog_LED[5] = {0., 2., 2., 2., 2.};  // Cut for GS test in pro cents
0104     double Pedest_LED[2][5] = {{0., 0.1, 0.6, 0.1, 0.8},
0105                                {0., 0.1, 0.1, 0.1, 0.4}};  //Cuts for Pedestal  and pedestal  Width
0106     for (int i = 0; i <= 6; i++)
0107       for (int j = 0; j <= 4; j++) {
0108         MIN_M[i][j] = MIN_M_LED[i][j];
0109         MAX_M[i][j] = MAX_M_LED[i][j];
0110         MIN_C[i][j] = MIN_C_LED[i][j];
0111         MAX_C[i][j] = MAX_C_LED[i][j];
0112       }
0113     for (int i = 0; i <= 4; i++) {
0114       porog[i] = porog_LED[i];
0115       Pedest[0][i] = Pedest_LED[0][i];
0116       Pedest[1][i] = Pedest_LED[1][i];
0117     }
0118   }
0119 
0120   if (runtype == "LASER") {
0121     //CUTS:    [test][subdetector]                                  ADC amplitude  Am      Width  for Wm             Ratio cut for Rm             TS mean for TNm           TS max  for TXm
0122     double MIN_M_LASER[7][5] = {{0., 0., 0., 0., 0.},
0123                                 {0., 0., 0., 0., 0.},
0124                                 {0, 40., 40., 100., 40.},
0125                                 {0, 0.3, 0.9, 0.2, 0.2},
0126                                 {0, 0.5, 0.55, 0.55, 0.60},
0127                                 {0, 5.0, 2.5, 1.1, 5.5},
0128                                 {0, 1.5, 1.5, 1.5, 1.5}};
0129     double MAX_M_LASER[7][5] = {{0., 0., 0., 0., 0.},
0130                                 {0., 0., 0., 0., 0.},
0131                                 {0, 3500, 350000, 3500, 150000},
0132                                 {0, 2.5, 3.6, 2.6, 2.1},
0133                                 {0, 1.00, 1.00, 1.04, 1.02},
0134                                 {0, 7.5, 6.5, 4.4, 8.5},
0135                                 {0, 8.5, 8.5, 6.5, 8.5}};
0136     double MIN_C_LASER[7][5] = {{0., 0., 0., 0., 0.},
0137                                 {0., 0., 0., 0., 0.},
0138                                 {0, 1000., 1000., 1000., 100.},
0139                                 {0, 1.3, 1.3, 0.7, 0.3},
0140                                 {0, 0.76, 0.76, 0.85, 0.5},
0141                                 {0, 2.4, 2.4, 1.5, 3.5},
0142                                 {0, 1.5, 1.5, 1.5, 3.5}};
0143     double MAX_C_LASER[7][5] = {{0., 0., 0., 0., 0.},
0144                                 {0., 0., 0., 0., 0.},
0145                                 {0, 1E20, 1E20, 1E20, 1E20},
0146                                 {0, 1.9, 1.9, 1.65, 1.5},
0147                                 {0, 0.94, 0.94, 1.0, 0.8},
0148                                 {0, 3.7, 3.7, 2.7, 4.5},
0149                                 {0, 2.5, 2.5, 2.5, 4.5}};
0150     double porog_LASER[5] = {0., 2., 2., 2., 2.};  // Cut for GS test in pro cents
0151     //     double porog_LASER[5] = {0., 200., 200., 100., 100.}; // Cut for GS test in pro cents
0152     double Pedest_LASER[2][5] = {{0., 0.1, 0.6, 0.1, 0.8},
0153                                  {0., 0.1, 0.1, 0.1, 0.4}};  //Cuts for Pedestal  and pedestal  Width
0154     for (int i = 0; i <= 6; i++)
0155       for (int j = 0; j <= 4; j++) {
0156         MIN_M[i][j] = MIN_M_LASER[i][j];
0157         MAX_M[i][j] = MAX_M_LASER[i][j];
0158         MIN_C[i][j] = MIN_C_LASER[i][j];
0159         MAX_C[i][j] = MAX_C_LASER[i][j];
0160       }
0161     for (int i = 0; i <= 4; i++) {
0162       porog[i] = porog_LASER[i];
0163       Pedest[0][i] = Pedest_LASER[0][i];
0164       Pedest[1][i] = Pedest_LASER[1][i];
0165     }
0166   }
0167 
0168   if (runtype == "PEDESTAL") {
0169     //CUTS:    [test][subdetector]                                  ADC amplitude  Am      Width  for Wm             Ratio cut for Rm             TS mean for TNm           TS max  for TXm
0170     double MIN_M_PEDESTAL[7][5] = {{0., 0., 0., 0., 0.},
0171                                    {0., 0., 0., 0., 0.},
0172                                    {0, 10., 10., 200., 5.},
0173                                    {0, 2.7, 2.7, 2.7, 0.2},
0174                                    {0, 0.31, 0.31, 0.05, 0.15},
0175                                    {0, 4.5, 4.5, 4.5, 2.0},
0176                                    {0, 0.5, 0.5, 0.5, 0.5}};
0177     double MAX_M_PEDESTAL[7][5] = {{0., 0., 0., 0., 0.},
0178                                    {0., 0., 0., 0., 0.},
0179                                    {0, 2500., 250000., 2500., 150000.},
0180                                    {0, 3.0, 3.0, 5.0, 3.0},
0181                                    {0, 0.95, 0.95, 1.00, 0.98},
0182                                    {0, 4.6, 4.6, 4.6, 7.0},
0183                                    {0, 9.5, 9.5, 8.5, 8.5}};
0184     double MIN_C_PEDESTAL[7][5] = {{0., 0., 0., 0., 0.},
0185                                    {0., 0., 0., 0., 0.},
0186                                    {0, 1000., 1000., 1000., 100.},
0187                                    {0, 1.3, 1.3, 0.7, 0.3},
0188                                    {0, 0.76, 0.76, 0.85, 0.5},
0189                                    {0, 2.4, 2.4, 1.5, 3.5},
0190                                    {0, 1.5, 1.5, 1.5, 3.5}};
0191     double MAX_C_PEDESTAL[7][5] = {{0., 0., 0., 0., 0.},
0192                                    {0., 0., 0., 0., 0.},
0193                                    {0, 1E20, 1E20, 1E20, 1E20},
0194                                    {0, 1.9, 1.9, 1.65, 1.5},
0195                                    {0, 0.94, 0.94, 1.0, 0.8},
0196                                    {0, 3.7, 3.7, 2.7, 4.5},
0197                                    {0, 2.5, 2.5, 2.5, 4.5}};
0198     double porog_PEDESTAL[5] = {0., 2., 2., 2., 2.};  // Cut for GS test in pro cents
0199     //     double porog_PEDESTAL[5] = {0., 200., 200., 100., 100.}; // Cut for GS test in pro cents
0200     double Pedest_PEDESTAL[2][5] = {{0., 0.1, 0.6, 0.1, 0.8},
0201                                     {0., 0.1, 0.1, 0.1, 0.4}};  //Cuts for Pedestal  and pedestal  Width
0202     for (int i = 0; i <= 6; i++)
0203       for (int j = 0; j <= 4; j++) {
0204         MIN_M[i][j] = MIN_M_PEDESTAL[i][j];
0205         MAX_M[i][j] = MAX_M_PEDESTAL[i][j];
0206         MIN_C[i][j] = MIN_C_PEDESTAL[i][j];
0207         MAX_C[i][j] = MAX_C_PEDESTAL[i][j];
0208       }
0209     for (int i = 0; i <= 4; i++) {
0210       porog[i] = porog_PEDESTAL[i];
0211       Pedest[0][i] = Pedest_PEDESTAL[0][i];
0212       Pedest[1][i] = Pedest_PEDESTAL[1][i];
0213     }
0214   }
0215 
0216   if (runtype == "Global") {
0217     //CUTS:    [test][subdetector]                                  ADC amplitude  Am      Width  for Wm             Ratio cut for Rm             TS mean for TNm           TS max  for TXm
0218     double MIN_M_PEDESTAL[7][5] = {{0., 0., 0., 0., 0.},
0219                                    {0., 0., 0., 0., 0.},
0220                                    {0, 10., 10., 200., 5.},
0221                                    {0, 2.7, 2.7, 2.7, 0.2},
0222                                    {0, 0.31, 0.31, 0.05, 0.15},
0223                                    {0, 4.5, 4.5, 4.5, 2.0},
0224                                    {0, 0.5, 0.5, 0.5, 0.5}};
0225     double MAX_M_PEDESTAL[7][5] = {{0., 0., 0., 0., 0.},
0226                                    {0., 0., 0., 0., 0.},
0227                                    {0, 2500., 250000., 2500., 150000.},
0228                                    {0, 3.0, 3.0, 5.0, 3.0},
0229                                    {0, 0.95, 0.95, 1.00, 0.98},
0230                                    {0, 4.6, 4.6, 4.6, 7.0},
0231                                    {0, 9.5, 9.5, 8.5, 8.5}};
0232     double MIN_C_PEDESTAL[7][5] = {{0., 0., 0., 0., 0.},
0233                                    {0., 0., 0., 0., 0.},
0234                                    {0, 1000., 1000., 1000., 100.},
0235                                    {0, 1.3, 1.3, 0.7, 0.3},
0236                                    {0, 0.76, 0.76, 0.85, 0.5},
0237                                    {0, 2.4, 2.4, 1.5, 3.5},
0238                                    {0, 1.5, 1.5, 1.5, 3.5}};
0239     double MAX_C_PEDESTAL[7][5] = {{0., 0., 0., 0., 0.},
0240                                    {0., 0., 0., 0., 0.},
0241                                    {0, 1E20, 1E20, 1E20, 1E20},
0242                                    {0, 1.9, 1.9, 1.65, 1.5},
0243                                    {0, 0.94, 0.94, 1.0, 0.8},
0244                                    {0, 3.7, 3.7, 2.7, 4.5},
0245                                    {0, 2.5, 2.5, 2.5, 4.5}};
0246     double porog_PEDESTAL[5] = {0., 2., 2., 2., 2.};  // Cut for GS test in pro cents
0247     //     double porog_PEDESTAL[5] = {0., 200., 200., 100., 100.}; // Cut for GS test in pro cents
0248     double Pedest_PEDESTAL[2][5] = {{0., 0.1, 0.6, 0.1, 0.8},
0249                                     {0., 0.1, 0.1, 0.1, 0.4}};  //Cuts for Pedestal  and pedestal  Width
0250     for (int i = 0; i <= 6; i++)
0251       for (int j = 0; j <= 4; j++) {
0252         MIN_M[i][j] = MIN_M_PEDESTAL[i][j];
0253         MAX_M[i][j] = MAX_M_PEDESTAL[i][j];
0254         MIN_C[i][j] = MIN_C_PEDESTAL[i][j];
0255         MAX_C[i][j] = MAX_C_PEDESTAL[i][j];
0256       }
0257     for (int i = 0; i <= 4; i++) {
0258       porog[i] = porog_PEDESTAL[i];
0259       Pedest[0][i] = Pedest_PEDESTAL[0][i];
0260       Pedest[1][i] = Pedest_PEDESTAL[1][i];
0261     }
0262   }
0263 
0264   //======================================================================
0265   // Prepare histograms and plot them to .png files
0266 
0267   //TCanvas *cHB = new TCanvas("cHB","cHB",1000,500);
0268   TCanvas* cHB = new TCanvas("cHB", "cHB", 1000, 1000);
0269   //TCanvas *cHE = new TCanvas("cHE","cHE",1500,500);
0270   TCanvas* cHE = new TCanvas("cHE", "cHE", 1500, 1500);
0271   //TCanvas *cONE = new TCanvas("cONE","cONE",500,500);
0272   TCanvas* cONE = new TCanvas("cONE", "cONE", 1500, 500);
0273   TCanvas* cPED = new TCanvas("cPED", "cPED", 1000, 500);
0274   //TCanvas *cHF = new TCanvas("cHF","cHF",1000,1000);
0275   TCanvas* cHF = new TCanvas("cHF", "cHF", 1000, 1000);
0276 
0277   // Phi-symmetry for Calibration Group:
0278 
0279   TCanvas* c1x0 = new TCanvas("c1x0", "c1x0", 300, 10, 800, 700);
0280 
0281   TCanvas* c1x1 = new TCanvas("c1x1", "c1x1", 100, 10, 600, 700);
0282 
0283   TCanvas* c2x1 = new TCanvas("c2x1", "c2x1", 200, 300, 1600, 800);
0284 
0285   TCanvas* c3x5 = new TCanvas("c3x5", "c3x5", 1000, 1500);
0286   //
0287 
0288   char* str = (char*)alloca(10000);
0289 
0290   // before upgrade 2017:
0291   // depth: HB depth1,2; HE depth1,2,3; HO depth4; HF depth1,2
0292   // 5 depthes:  0(empty),   1,2,3,4
0293 
0294   // upgrade 2017:
0295   // depth: HB depth1,2; HE depth1,2,3,4,5,6,7; HO depth4; HF depth1,2,3,4
0296   // 8 depthes:  0(empty),   1,2,3,4,5,6,7
0297 
0298   // upgrade 2021:
0299   // depth: HB depth1,2,3,4; HE depth1,2,3,4,5,6,7; HO depth4; HF depth1,2,3,4
0300   // 10 depthes:  0(empty),   1,2,3,4,5,6,7,8,9
0301 
0302   //  Int_t ALLDEPTH = 5;
0303   //  Int_t ALLDEPTH = 8;
0304   Int_t ALLDEPTH = 10;
0305 
0306   int k_min[5] = {0, 1, 1, 4, 1};  // minimum depth for each subdet
0307   //     int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
0308   //       int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
0309   int k_max[5] = {0, 4, 7, 4, 4};  // maximum depth for each subdet
0310 
0311   TH2F* Map_Ampl[33][5][ALLDEPTH];       // 2D histogramm for test,subdet,depth
0312   TH2F* Map_SUB[5][ALLDEPTH];            // 2d histogramm for subdet, depth
0313   TH1F* HistAmplDepth[22][5][ALLDEPTH];  // 1d histogramm for test,subdet, depth
0314   TH1F* HistAmpl[22][5];                 // 1d histogramm for test,subdet
0315 
0316   TH1F* HistPed[3][5][4];           // 1d  histogramm for test,subdet, CapID
0317   TH2F* Map_Ped[3][5];              // 2d  histogramm for test,subdet -> test 33
0318   TH1F* hist_GoodTSshape[5];        // 1d  histogramm for TS shape subdet -> test 41
0319   TH1F* hist_GoodTSshape0[5];       // 1d  histogramm for TS shape subdet -> test 41
0320   TH1F* hist_BadTSshape[5];         // 1d  histogramm for TS shape subdet -> test 41
0321   TH1F* hist_BadTSshape0[5];        // 1d  histogramm for TS shape subdet -> test 41
0322   TH1F* hist_ADC_All[5];            // 1d  histogramm for TS shape subdet -> test 42
0323   TH1F* hist_ADC_DS[5][ALLDEPTH];   // 1d  histogramm for TS shape subdet, depth -> test 42
0324   TH1F* hist_SumADC[5][ALLDEPTH];   // 1d  histogramm for TS shape subdet, depth -> test 43
0325   TH1F* hist_SumADC0[5][ALLDEPTH];  // 1d  histogramm for TS shape subdet, depth -> test 43
0326   TH1F* hist_SumADC1[5][ALLDEPTH];  // 1d  histogramm for TS shape subdet, depth -> test 43
0327 
0328   Map_SUB[1][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1_HB");
0329   Map_SUB[1][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2_HB");
0330   Map_SUB[2][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1_HE");
0331   Map_SUB[2][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2_HE");
0332   Map_SUB[2][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3_HE");
0333   Map_SUB[3][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4_HO");
0334   Map_SUB[4][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1_HF");
0335   Map_SUB[4][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2_HF");
0336 
0337   Map_SUB[1][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3_HB");
0338   Map_SUB[1][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4_HB");
0339   Map_SUB[2][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4_HE");
0340   Map_SUB[2][5] = (TH2F*)dir->FindObjectAny("h_mapDepth5_HE");
0341   Map_SUB[2][6] = (TH2F*)dir->FindObjectAny("h_mapDepth6_HE");
0342   Map_SUB[2][7] = (TH2F*)dir->FindObjectAny("h_mapDepth7_HE");
0343   Map_SUB[4][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3_HF");
0344   Map_SUB[4][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4_HF");
0345 
0346   //+++++++++++++++++++++++++++++
0347   //Test 0 Entries
0348   //+++++++++++++++++++++++++++++
0349 
0350   for (int sub = 1; sub <= 4; sub++) {  //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
0351                                         //       if (sub==1) cHB->Divide(2,1);
0352     if (sub == 1)
0353       cHB->Divide(2, 2);
0354     //     if (sub==2) cHE->Divide(3,1);
0355     if (sub == 2)
0356       cHE->Divide(3, 3);
0357     if (sub == 3)
0358       cONE->Divide(1, 1);
0359     //     if (sub==4) cHF->Divide(2,1);
0360     if (sub == 4)
0361       cHF->Divide(2, 2);
0362     //       int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
0363     //     int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
0364     //       int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
0365     for (int k = k_min[sub]; k <= k_max[sub]; k++) {  //Depth
0366       if (sub == 1)
0367         cHB->cd(k);
0368       if (sub == 2)
0369         cHE->cd(k);
0370       if (sub == 3)
0371         cONE->cd(k - 3);
0372       if (sub == 4)
0373         cHF->cd(k);
0374       gPad->SetGridy();
0375       gPad->SetGridx();
0376       gPad->SetLogz();
0377       if (sub == 1)
0378         sprintf(str, "HB, Depth%d \b", k);
0379       if (sub == 2)
0380         sprintf(str, "HE, Depth%d \b", k);
0381       if (sub == 3)
0382         sprintf(str, "HO, Depth%d \b", k);
0383       if (sub == 4)
0384         sprintf(str, "HF, Depth%d \b", k);
0385       Map_SUB[sub][k]->SetTitle(str);
0386       Map_SUB[sub][k]->SetXTitle("#eta \b");
0387       Map_SUB[sub][k]->SetYTitle("#phi \b");
0388       Map_SUB[sub][k]->SetZTitle("Number of events \b");
0389       if (sub == 3)
0390         Map_SUB[sub][k]->SetTitleOffset(0.8, "Z");
0391       Map_SUB[sub][k]->Draw("COLZ");
0392       Map_SUB[sub][k]->GetYaxis()->SetRangeUser(0, 72.);
0393       //            Map_SUB[sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
0394       if (sub == 1) {
0395         cHB->Modified();
0396         cHB->Update();
0397       }
0398       if (sub == 2) {
0399         cHE->Modified();
0400         cHE->Update();
0401       }
0402       if (sub == 3) {
0403         cONE->Modified();
0404         cONE->Update();
0405       }
0406       if (sub == 4) {
0407         cHF->Modified();
0408         cHF->Update();
0409       }
0410     }  //end depth
0411 
0412     if (sub == 1) {
0413       cHB->Print("MapRateEntryHB.png");
0414       cHB->Clear();
0415     }
0416     if (sub == 2) {
0417       cHE->Print("MapRateEntryHE.png");
0418       cHE->Clear();
0419     }
0420     if (sub == 3) {
0421       cONE->Print("MapRateEntryHO.png");
0422       cONE->Clear();
0423     }
0424     if (sub == 4) {
0425       cHF->Print("MapRateEntryHF.png");
0426       cHF->Clear();
0427     }
0428   }  // end sub
0429 
0430   //+++++++++++++++++++++++++++++
0431   //Test 1 (Cm) Rate of Cap ID errors
0432   //+++++++++++++++++++++++++++++
0433 
0434   Map_Ampl[1][1][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1Error_HB");
0435   Map_Ampl[1][1][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2Error_HB");
0436   Map_Ampl[1][2][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1Error_HE");
0437   Map_Ampl[1][2][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2Error_HE");
0438   Map_Ampl[1][2][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3Error_HE");
0439   Map_Ampl[1][3][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4Error_HO");
0440   Map_Ampl[1][4][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1Error_HF");
0441   Map_Ampl[1][4][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2Error_HF");
0442 
0443   Map_Ampl[1][1][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3Error_HB");
0444   Map_Ampl[1][1][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4Error_HB");
0445   Map_Ampl[1][2][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4Error_HE");
0446   Map_Ampl[1][2][5] = (TH2F*)dir->FindObjectAny("h_mapDepth5Error_HE");
0447   Map_Ampl[1][2][6] = (TH2F*)dir->FindObjectAny("h_mapDepth6Error_HE");
0448   Map_Ampl[1][2][7] = (TH2F*)dir->FindObjectAny("h_mapDepth7Error_HE");
0449   Map_Ampl[1][4][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3Error_HF");
0450   Map_Ampl[1][4][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4Error_HF");
0451 
0452   for (int sub = 1; sub <= 4; sub++) {  //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
0453                                         //     if (sub==1) cHB->Divide(2,1);
0454     if (sub == 1)
0455       cHB->Divide(2, 2);
0456     //     if (sub==2) cHE->Divide(3,1);
0457     if (sub == 2)
0458       cHE->Divide(3, 3);
0459     if (sub == 3)
0460       cONE->Divide(1, 1);
0461     //     if (sub==4) cHF->Divide(2,1);
0462     if (sub == 4)
0463       cHF->Divide(2, 2);
0464     //       int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
0465     //     int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
0466     //       int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
0467     for (int k = k_min[sub]; k <= k_max[sub]; k++) {  //Depth
0468       if (sub == 1)
0469         cHB->cd(k);
0470       if (sub == 2)
0471         cHE->cd(k);
0472       if (sub == 3)
0473         cONE->cd(k - 3);
0474       if (sub == 4)
0475         cHF->cd(k);
0476       Map_Ampl[1][sub][k]->Divide(Map_Ampl[1][sub][k], Map_SUB[sub][k], 1, 1, "B");
0477       gPad->SetGridy();
0478       gPad->SetGridx();
0479       gPad->SetLogz();
0480       if (sub == 1)
0481         sprintf(str, "HB, Depth%d \b", k);
0482       if (sub == 2)
0483         sprintf(str, "HE, Depth%d \b", k);
0484       if (sub == 3)
0485         sprintf(str, "HO, Depth%d \b", k);
0486       if (sub == 4)
0487         sprintf(str, "HF, Depth%d \b", k);
0488       Map_Ampl[1][sub][k]->SetTitle(str);
0489       Map_Ampl[1][sub][k]->SetXTitle("#eta \b");
0490       Map_Ampl[1][sub][k]->SetYTitle("#phi \b");
0491       Map_Ampl[1][sub][k]->SetZTitle("Rate \b");
0492       if (sub == 3)
0493         Map_Ampl[1][sub][k]->SetTitleOffset(0.8, "Z");
0494       Map_Ampl[1][sub][k]->Draw("COLZ");
0495       Map_Ampl[1][sub][k]->GetYaxis()->SetRangeUser(0, 72.);
0496       Map_Ampl[1][sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
0497       if (sub == 1) {
0498         cHB->Modified();
0499         cHB->Update();
0500       }
0501       if (sub == 2) {
0502         cHE->Modified();
0503         cHE->Update();
0504       }
0505       if (sub == 3) {
0506         cONE->Modified();
0507         cONE->Update();
0508       }
0509       if (sub == 4) {
0510         cHF->Modified();
0511         cHF->Update();
0512       }
0513     }  //end depth
0514 
0515     if (sub == 1) {
0516       cHB->Print("MapRateCapIDHB.png");
0517       cHB->Clear();
0518     }
0519     if (sub == 2) {
0520       cHE->Print("MapRateCapIDHE.png");
0521       cHE->Clear();
0522     }
0523     if (sub == 3) {
0524       cONE->Print("MapRateCapIDHO.png");
0525       cONE->Clear();
0526     }
0527     if (sub == 4) {
0528       cHF->Print("MapRateCapIDHF.png");
0529       cHF->Clear();
0530     }
0531   }  // end sub
0532 
0533   //+++++++++++++++++++++++++++++
0534   //Test 2 (Am) ADC amplitude
0535   //+++++++++++++++++++++++++++++
0536 
0537   Map_Ampl[2][1][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1ADCAmpl225_HB");
0538   Map_Ampl[2][1][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2ADCAmpl225_HB");
0539   Map_Ampl[2][2][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1ADCAmpl225_HE");
0540   Map_Ampl[2][2][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2ADCAmpl225_HE");
0541   Map_Ampl[2][2][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3ADCAmpl225_HE");
0542   Map_Ampl[2][3][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4ADCAmpl225_HO");
0543   Map_Ampl[2][4][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1ADCAmpl225_HF");
0544   Map_Ampl[2][4][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2ADCAmpl225_HF");
0545 
0546   Map_Ampl[2][1][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3ADCAmpl225_HB");
0547   Map_Ampl[2][1][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4ADCAmpl225_HB");
0548   Map_Ampl[2][2][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4ADCAmpl225_HE");
0549   Map_Ampl[2][2][5] = (TH2F*)dir->FindObjectAny("h_mapDepth5ADCAmpl225_HE");
0550   Map_Ampl[2][2][6] = (TH2F*)dir->FindObjectAny("h_mapDepth6ADCAmpl225_HE");
0551   Map_Ampl[2][2][7] = (TH2F*)dir->FindObjectAny("h_mapDepth7ADCAmpl225_HE");
0552   Map_Ampl[2][4][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3ADCAmpl225_HF");
0553   Map_Ampl[2][4][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4ADCAmpl225_HF");
0554 
0555   HistAmpl[2][1] = (TH1F*)dir->FindObjectAny("h_ADCAmpl_HB");
0556   HistAmpl[2][2] = (TH1F*)dir->FindObjectAny("h_ADCAmpl_HE");
0557   HistAmpl[2][3] = (TH1F*)dir->FindObjectAny("h_ADCAmpl_HO");
0558   HistAmpl[2][4] = (TH1F*)dir->FindObjectAny("h_ADCAmpl_HF");
0559 
0560   //+++++++++++++++++++++++++++++
0561   //Test 3 (Wm) Rate of RMS
0562   //+++++++++++++++++++++++++++++
0563 
0564   Map_Ampl[3][1][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1Amplitude225_HB");
0565   Map_Ampl[3][1][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2Amplitude225_HB");
0566   Map_Ampl[3][2][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1Amplitude225_HE");
0567   Map_Ampl[3][2][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2Amplitude225_HE");
0568   Map_Ampl[3][2][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3Amplitude225_HE");
0569   Map_Ampl[3][3][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4Amplitude225_HO");
0570   Map_Ampl[3][4][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1Amplitude225_HF");
0571   Map_Ampl[3][4][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2Amplitude225_HF");
0572 
0573   Map_Ampl[3][1][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3Amplitude225_HB");
0574   Map_Ampl[3][1][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4Amplitude225_HB");
0575   Map_Ampl[3][2][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4Amplitude225_HE");
0576   Map_Ampl[3][2][5] = (TH2F*)dir->FindObjectAny("h_mapDepth5Amplitude225_HE");
0577   Map_Ampl[3][2][6] = (TH2F*)dir->FindObjectAny("h_mapDepth6Amplitude225_HE");
0578   Map_Ampl[3][2][7] = (TH2F*)dir->FindObjectAny("h_mapDepth7Amplitude225_HE");
0579   Map_Ampl[3][4][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3Amplitude225_HF");
0580   Map_Ampl[3][4][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4Amplitude225_HF");
0581 
0582   HistAmpl[3][1] = (TH1F*)dir->FindObjectAny("h_Amplitude_HB");
0583   HistAmpl[3][2] = (TH1F*)dir->FindObjectAny("h_Amplitude_HE");
0584   HistAmpl[3][3] = (TH1F*)dir->FindObjectAny("h_Amplitude_HO");
0585   HistAmpl[3][4] = (TH1F*)dir->FindObjectAny("h_Amplitude_HF");
0586 
0587   //+++++++++++++++++++++++++++++
0588   //Test 4 (Rm) Rate of ratio 4 near max TS/ All TS
0589   //+++++++++++++++++++++++++++++
0590 
0591   Map_Ampl[4][1][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1Ampl047_HB");
0592   Map_Ampl[4][1][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2Ampl047_HB");
0593   Map_Ampl[4][2][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1Ampl047_HE");
0594   Map_Ampl[4][2][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2Ampl047_HE");
0595   Map_Ampl[4][2][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3Ampl047_HE");
0596   Map_Ampl[4][3][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4Ampl047_HO");
0597   Map_Ampl[4][4][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1Ampl047_HF");
0598   Map_Ampl[4][4][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2Ampl047_HF");
0599 
0600   Map_Ampl[4][1][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3Ampl047_HB");
0601   Map_Ampl[4][1][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4Ampl047_HB");
0602   Map_Ampl[4][2][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4Ampl047_HE");
0603   Map_Ampl[4][2][5] = (TH2F*)dir->FindObjectAny("h_mapDepth5Ampl047_HE");
0604   Map_Ampl[4][2][6] = (TH2F*)dir->FindObjectAny("h_mapDepth6Ampl047_HE");
0605   Map_Ampl[4][2][7] = (TH2F*)dir->FindObjectAny("h_mapDepth7Ampl047_HE");
0606   Map_Ampl[4][4][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3Ampl047_HF");
0607   Map_Ampl[4][4][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4Ampl047_HF");
0608 
0609   HistAmpl[4][1] = (TH1F*)dir->FindObjectAny("h_Ampl_HB");
0610   HistAmpl[4][2] = (TH1F*)dir->FindObjectAny("h_Ampl_HE");
0611   HistAmpl[4][3] = (TH1F*)dir->FindObjectAny("h_Ampl_HO");
0612   HistAmpl[4][4] = (TH1F*)dir->FindObjectAny("h_Ampl_HF");
0613 
0614   //+++++++++++++++++++++++++++++
0615   //Test 5 (TNm) Mean position in 1-8 TS range
0616   //+++++++++++++++++++++++++++++
0617 
0618   Map_Ampl[5][1][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1TSmeanA225_HB");
0619   Map_Ampl[5][1][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2TSmeanA225_HB");
0620   Map_Ampl[5][2][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1TSmeanA225_HE");
0621   Map_Ampl[5][2][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2TSmeanA225_HE");
0622   Map_Ampl[5][2][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3TSmeanA225_HE");
0623   Map_Ampl[5][3][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4TSmeanA225_HO");
0624   Map_Ampl[5][4][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1TSmeanA225_HF");
0625   Map_Ampl[5][4][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2TSmeanA225_HF");
0626 
0627   Map_Ampl[5][1][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3TSmeanA225_HB");
0628   Map_Ampl[5][1][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4TSmeanA225_HB");
0629   Map_Ampl[5][2][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4TSmeanA225_HE");
0630   Map_Ampl[5][2][5] = (TH2F*)dir->FindObjectAny("h_mapDepth5TSmeanA225_HE");
0631   Map_Ampl[5][2][6] = (TH2F*)dir->FindObjectAny("h_mapDepth6TSmeanA225_HE");
0632   Map_Ampl[5][2][7] = (TH2F*)dir->FindObjectAny("h_mapDepth7TSmeanA225_HE");
0633   Map_Ampl[5][4][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3TSmeanA225_HF");
0634   Map_Ampl[5][4][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4TSmeanA225_HF");
0635 
0636   HistAmpl[5][1] = (TH1F*)dir->FindObjectAny("h_TSmeanA_HB");
0637   HistAmpl[5][2] = (TH1F*)dir->FindObjectAny("h_TSmeanA_HE");
0638   HistAmpl[5][3] = (TH1F*)dir->FindObjectAny("h_TSmeanA_HO");
0639   HistAmpl[5][4] = (TH1F*)dir->FindObjectAny("h_TSmeanA_HF");
0640 
0641   //+++++++++++++++++++++++++++++
0642   //Test 6 (TXm) Maximum position in 1-8 TS range
0643   //+++++++++++++++++++++++++++++
0644 
0645   Map_Ampl[6][1][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1TSmaxA225_HB");
0646   Map_Ampl[6][1][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2TSmaxA225_HB");
0647   Map_Ampl[6][2][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1TSmaxA225_HE");
0648   Map_Ampl[6][2][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2TSmaxA225_HE");
0649   Map_Ampl[6][2][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3TSmaxA225_HE");
0650   Map_Ampl[6][3][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4TSmaxA225_HO");
0651   Map_Ampl[6][4][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1TSmaxA225_HF");
0652   Map_Ampl[6][4][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2TSmaxA225_HF");
0653 
0654   Map_Ampl[6][1][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3TSmaxA225_HB");
0655   Map_Ampl[6][1][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4TSmaxA225_HB");
0656   Map_Ampl[6][2][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4TSmaxA225_HE");
0657   Map_Ampl[6][2][5] = (TH2F*)dir->FindObjectAny("h_mapDepth5TSmaxA225_HE");
0658   Map_Ampl[6][2][6] = (TH2F*)dir->FindObjectAny("h_mapDepth6TSmaxA225_HE");
0659   Map_Ampl[6][2][7] = (TH2F*)dir->FindObjectAny("h_mapDepth7TSmaxA225_HE");
0660   Map_Ampl[6][4][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3TSmaxA225_HF");
0661   Map_Ampl[6][4][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4TSmaxA225_HF");
0662 
0663   HistAmpl[6][1] = (TH1F*)dir->FindObjectAny("h_TSmaxA_HB");
0664   HistAmpl[6][2] = (TH1F*)dir->FindObjectAny("h_TSmaxA_HE");
0665   HistAmpl[6][3] = (TH1F*)dir->FindObjectAny("h_TSmaxA_HO");
0666   HistAmpl[6][4] = (TH1F*)dir->FindObjectAny("h_TSmaxA_HF");
0667 
0668   for (int test = 2; test <= 6; test++) {  //Test: 2-Am, 3-Wm, 4-Rm, 5-TNm, 6-TXm,
0669     for (int sub = 1; sub <= 4; sub++) {   //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
0670                                            //        if (sub==1) cHB->Divide(2,1);
0671       if (sub == 1)
0672         cHB->Divide(2, 2);
0673       //        if (sub==2) cHE->Divide(3,1);
0674       if (sub == 2)
0675         cHE->Divide(3, 3);
0676       if (sub == 3)
0677         cONE->Divide(1, 1);
0678       //        if (sub==4) cHF->Divide(2,1);
0679       if (sub == 4)
0680         cHF->Divide(2, 2);
0681       //          int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
0682       //        int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
0683       //          int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
0684       for (int k = k_min[sub]; k <= k_max[sub]; k++) {  //Depth
0685         if (sub == 1)
0686           cHB->cd(k);
0687         if (sub == 2)
0688           cHE->cd(k);
0689         if (sub == 3)
0690           cONE->cd(k - 3);
0691         if (sub == 4)
0692           cHF->cd(k);
0693         Map_Ampl[test][sub][k]->Divide(Map_Ampl[test][sub][k], Map_SUB[sub][k], 1, 1, "B");
0694         gPad->SetGridy();
0695         gPad->SetGridx();
0696         gPad->SetLogz();
0697         if (sub == 1)
0698           sprintf(str, "HB, Depth%d \b", k);
0699         if (sub == 2)
0700           sprintf(str, "HE, Depth%d \b", k);
0701         if (sub == 3)
0702           sprintf(str, "HO, Depth%d \b", k);
0703         if (sub == 4)
0704           sprintf(str, "HF, Depth%d \b", k);
0705         Map_Ampl[test][sub][k]->SetTitle(str);
0706         Map_Ampl[test][sub][k]->SetXTitle("#eta \b");
0707         Map_Ampl[test][sub][k]->SetYTitle("#phi \b");
0708         Map_Ampl[test][sub][k]->SetZTitle("Rate \b");
0709         if (sub == 3)
0710           Map_Ampl[test][sub][k]->SetTitleOffset(0.8, "Z");
0711         Map_Ampl[test][sub][k]->Draw("COLZ");
0712         Map_Ampl[test][sub][k]->GetYaxis()->SetRangeUser(0, 72.);
0713         Map_Ampl[test][sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
0714         if (sub == 1) {
0715           cHB->Modified();
0716           cHB->Update();
0717         }
0718         if (sub == 2) {
0719           cHE->Modified();
0720           cHE->Update();
0721         }
0722         if (sub == 3) {
0723           cONE->Modified();
0724           cONE->Update();
0725         }
0726         if (sub == 4) {
0727           cHF->Modified();
0728           cHF->Update();
0729         }
0730       }  //end depth
0731       if (test == 2) {
0732         if (sub == 1) {
0733           cHB->Print("MapRateAmplHB.png");
0734           cHB->Clear();
0735         }
0736         if (sub == 2) {
0737           cHE->Print("MapRateAmplHE.png");
0738           cHE->Clear();
0739         }
0740         if (sub == 3) {
0741           cONE->Print("MapRateAmplHO.png");
0742           cONE->Clear();
0743         }
0744         if (sub == 4) {
0745           cHF->Print("MapRateAmplHF.png");
0746           cHF->Clear();
0747         }
0748       }
0749       if (test == 3) {
0750         if (sub == 1) {
0751           cHB->Print("MapRateRMSHB.png");
0752           cHB->Clear();
0753         }
0754         if (sub == 2) {
0755           cHE->Print("MapRateRMSHE.png");
0756           cHE->Clear();
0757         }
0758         if (sub == 3) {
0759           cONE->Print("MapRateRMSHO.png");
0760           cONE->Clear();
0761         }
0762         if (sub == 4) {
0763           cHF->Print("MapRateRMSHF.png");
0764           cHF->Clear();
0765         }
0766       }
0767       if (test == 4) {
0768         if (sub == 1) {
0769           cHB->Print("MapRate43TStoAllTSHB.png");
0770           cHB->Clear();
0771         }
0772         if (sub == 2) {
0773           cHE->Print("MapRate43TStoAllTSHE.png");
0774           cHE->Clear();
0775         }
0776         if (sub == 3) {
0777           cONE->Print("MapRate43TStoAllTSHO.png");
0778           cONE->Clear();
0779         }
0780         if (sub == 4) {
0781           cHF->Print("MapRate43TStoAllTSHF.png");
0782           cHF->Clear();
0783         }
0784       }
0785       if (test == 5) {
0786         if (sub == 1) {
0787           cHB->Print("MapRateMeanPosHB.png");
0788           cHB->Clear();
0789         }
0790         if (sub == 2) {
0791           cHE->Print("MapRateMeanPosHE.png");
0792           cHE->Clear();
0793         }
0794         if (sub == 3) {
0795           cONE->Print("MapRateMeanPosHO.png");
0796           cONE->Clear();
0797         }
0798         if (sub == 4) {
0799           cHF->Print("MapRateMeanPosHF.png");
0800           cHF->Clear();
0801         }
0802       }
0803       if (test == 6) {
0804         if (sub == 1) {
0805           cHB->Print("MapRateMaxPosHB.png");
0806           cHB->Clear();
0807         }
0808         if (sub == 2) {
0809           cHE->Print("MapRateMaxPosHE.png");
0810           cHE->Clear();
0811         }
0812         if (sub == 3) {
0813           cONE->Print("MapRateMaxPosHO.png");
0814           cONE->Clear();
0815         }
0816         if (sub == 4) {
0817           cHF->Print("MapRateMaxPosHF.png");
0818           cHF->Clear();
0819         }
0820       }
0821 
0822       //          cONE->Divide(1,1);
0823       cONE->Divide(3, 1);
0824       if (test == 2 && sub == 2) {
0825         cONE->cd(2);
0826         TH1F* kjkjkhj2 = (TH1F*)dir->FindObjectAny("h_AmplitudeHEtest1");
0827         kjkjkhj2->Draw("");
0828         kjkjkhj2->SetTitle("HE, All Depth: shunt1");
0829         cONE->cd(3);
0830         TH1F* kjkjkhj3 = (TH1F*)dir->FindObjectAny("h_AmplitudeHEtest6");
0831         kjkjkhj3->Draw("");
0832         kjkjkhj3->SetTitle("HE, All Depth: shunt6");
0833       }
0834       if (test == 2 && sub == 1) {
0835         cONE->cd(2);
0836         TH1F* kjkjkhb2 = (TH1F*)dir->FindObjectAny("h_AmplitudeHBtest1");
0837         kjkjkhb2->Draw("");
0838         kjkjkhb2->SetTitle("HB, All Depth: shunt1");
0839         cONE->cd(3);
0840         TH1F* kjkjkhb3 = (TH1F*)dir->FindObjectAny("h_AmplitudeHBtest6");
0841         kjkjkhb3->Draw("");
0842         kjkjkhb3->SetTitle("HB, All Depth: shunt6");
0843       }
0844       cONE->cd(1);
0845       gPad->SetGridy();
0846       gPad->SetGridx();
0847       gPad->SetLogy();
0848       if (sub == 1)
0849         HistAmpl[test][sub]->SetTitle("HB, All Depth: shunt6");
0850       if (sub == 2)
0851         HistAmpl[test][sub]->SetTitle("HE, All Depth: shunt6");
0852       if (sub == 3)
0853         HistAmpl[test][sub]->SetTitle("HO, All Depth");
0854       if (sub == 4)
0855         HistAmpl[test][sub]->SetTitle("HF, All Depth");
0856       if (test == 2)
0857         HistAmpl[test][sub]->SetXTitle("ADC Amlitude in each event & cell \b");
0858       if (test == 3)
0859         HistAmpl[test][sub]->SetXTitle("RMS in each event & cell \b");
0860       if (test == 4)
0861         HistAmpl[test][sub]->SetXTitle("Ratio in each event & cell \b");
0862       if (test == 5)
0863         HistAmpl[test][sub]->SetXTitle("Mean TS position in each event & cell \b");
0864       if (test == 6)
0865         HistAmpl[test][sub]->SetXTitle("Max TS position in each event & cell \b");
0866       HistAmpl[test][sub]->SetYTitle("Number of cell-events \b");
0867       HistAmpl[test][sub]->SetLineColor(4);
0868       HistAmpl[test][sub]->SetLineWidth(2);
0869       HistAmpl[test][sub]->SetTitleOffset(1.4, "Y");
0870       HistAmpl[test][sub]->Draw("");
0871       // //        HistAmpl[test][sub]->GetYaxis()->SetRangeUser(1., 100.);
0872       //          if (test==2) {gPad->SetLogx(); HistAmpl[test][sub]->GetXaxis()->SetRangeUser(1., 10000.);}
0873       if (test == 2) {
0874         gPad->SetLogx();
0875       }
0876       if (test == 3)
0877         HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 5.);  // width
0878       if (test == 4)
0879         HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 1.);  // R
0880       if (test == 5)
0881         HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 9.);  //Tn
0882       if (test == 6)
0883         HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 9.);  //Tx
0884       cONE->Modified();
0885       cONE->Update();
0886       double min_x[] = {MIN_M[test][sub], MIN_M[test][sub]};
0887       double min_y[] = {0., 100000000.};
0888       TGraph* MIN = new TGraph(2, min_x, min_y);
0889       MIN->SetLineStyle(2);
0890       MIN->SetLineColor(2);
0891       MIN->SetLineWidth(2 + 100 * 100);
0892       MIN->SetFillStyle(3005);
0893       MIN->SetFillColor(2);
0894       MIN->Draw("L");
0895       double max_x[] = {MAX_M[test][sub], MAX_M[test][sub]};
0896       double max_y[] = {0., 100000000.};
0897       TGraph* MAX = new TGraph(2, max_x, max_y);
0898       MAX->SetLineStyle(2);
0899       MAX->SetLineColor(2);
0900       MAX->SetLineWidth(-2 - 100 * 100);
0901       MAX->SetFillStyle(3004);
0902       MAX->SetFillColor(2);
0903       MAX->Draw("L");
0904       if (test == 2) {
0905         if (sub == 1) {
0906           cONE->Print("HistAmplHB.png");
0907           cONE->Clear();
0908         }
0909         if (sub == 2) {
0910           cONE->Print("HistAmplHE.png");
0911           cONE->Clear();
0912         }
0913         if (sub == 3) {
0914           cONE->Print("HistAmplHO.png");
0915           cONE->Clear();
0916         }
0917         if (sub == 4) {
0918           cONE->Print("HistAmplHF.png");
0919           cONE->Clear();
0920         }
0921       }
0922       if (test == 3) {
0923         if (sub == 1) {
0924           cONE->Print("HistRMSHB.png");
0925           cONE->Clear();
0926         }
0927         if (sub == 2) {
0928           cONE->Print("HistRMSHE.png");
0929           cONE->Clear();
0930         }
0931         if (sub == 3) {
0932           cONE->Print("HistRMSHO.png");
0933           cONE->Clear();
0934         }
0935         if (sub == 4) {
0936           cONE->Print("HistRMSHF.png");
0937           cONE->Clear();
0938         }
0939       }
0940       if (test == 4) {
0941         if (sub == 1) {
0942           cONE->Print("Hist43TStoAllTSHB.png");
0943           cONE->Clear();
0944         }
0945         if (sub == 2) {
0946           cONE->Print("Hist43TStoAllTSHE.png");
0947           cONE->Clear();
0948         }
0949         if (sub == 3) {
0950           cONE->Print("Hist43TStoAllTSHO.png");
0951           cONE->Clear();
0952         }
0953         if (sub == 4) {
0954           cONE->Print("Hist43TStoAllTSHF.png");
0955           cONE->Clear();
0956         }
0957       }
0958       if (test == 5) {
0959         if (sub == 1) {
0960           cONE->Print("HistMeanPosHB.png");
0961           cONE->Clear();
0962         }
0963         if (sub == 2) {
0964           cONE->Print("HistMeanPosHE.png");
0965           cONE->Clear();
0966         }
0967         if (sub == 3) {
0968           cONE->Print("HistMeanPosHO.png");
0969           cONE->Clear();
0970         }
0971         if (sub == 4) {
0972           cONE->Print("HistMeanPosHF.png");
0973           cONE->Clear();
0974         }
0975       }
0976       if (test == 6) {
0977         if (sub == 1) {
0978           cONE->Print("HistMaxPosHB.png");
0979           cONE->Clear();
0980         }
0981         if (sub == 2) {
0982           cONE->Print("HistMaxPosHE.png");
0983           cONE->Clear();
0984         }
0985         if (sub == 3) {
0986           cONE->Print("HistMaxPosHO.png");
0987           cONE->Clear();
0988         }
0989         if (sub == 4) {
0990           cONE->Print("HistMaxPosHF.png");
0991           cONE->Clear();
0992         }
0993       }
0994     }  // end sub
0995   }    //end test
0996 
0997   TH2F* Map_Calib[5][5];  // 2d histogramm for subdet, depth
0998 
0999   Map_Calib[1][1] = (TH2F*)dir->FindObjectAny("h_map_HB");
1000   Map_Calib[1][2] = (TH2F*)dir->FindObjectAny("h_map_HB");
1001   Map_Calib[2][1] = (TH2F*)dir->FindObjectAny("h_map_HE");
1002   Map_Calib[2][2] = (TH2F*)dir->FindObjectAny("h_map_HE");
1003   Map_Calib[2][3] = (TH2F*)dir->FindObjectAny("h_map_HE");
1004   Map_Calib[3][4] = (TH2F*)dir->FindObjectAny("h_map_HO");
1005   Map_Calib[4][1] = (TH2F*)dir->FindObjectAny("h_map_HF");
1006   Map_Calib[4][2] = (TH2F*)dir->FindObjectAny("h_map_HF");
1007 
1008   //+++++++++++++++++++++++++++++
1009   //Test 0 Entries
1010   //+++++++++++++++++++++++++++++
1011 
1012   for (int sub = 1; sub <= 4; sub++) {  //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
1013                                         //       if (sub==1) cHB->Divide(2,1);
1014                                         //       if (sub==2) cHE->Divide(3,1);
1015     cONE->Divide(1, 1);
1016     //      if (sub==4) cHB->Divide(2,1);
1017     //       int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
1018     //       int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
1019     //       for (int k=k_min[sub];k<=k_max[sub];k++) {  //Depth
1020     int k = 1;
1021     cONE->cd(k);
1022     //          if (sub==1) cHB->cd(k);
1023     //          if (sub==2) cHE->cd(k);
1024     if (sub == 3)
1025       k = 4;
1026     //      if (sub==4) cHB->cd(k);
1027     gPad->SetGridy();
1028     gPad->SetGridx();
1029     gPad->SetLogz();
1030     if (sub == 1)
1031       sprintf(str, "HB");
1032     if (sub == 2)
1033       sprintf(str, "HE");
1034     if (sub == 3)
1035       sprintf(str, "HO");
1036     if (sub == 4)
1037       sprintf(str, "HF");
1038     Map_Calib[sub][k]->SetTitle(str);
1039     Map_Calib[sub][k]->SetXTitle("#eta \b");
1040     Map_Calib[sub][k]->SetYTitle("#phi \b");
1041     Map_Calib[sub][k]->SetZTitle("Number of events\b");
1042     if (sub == 3)
1043       Map_Calib[sub][k]->SetTitleOffset(0.8, "Z");
1044     Map_Calib[sub][k]->Draw("COLZ");
1045     Map_Calib[sub][k]->GetYaxis()->SetRangeUser(0, 72.);
1046     //            Map_Calib[sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
1047     //            if (sub==1) {cHB->Modified(); cHB->Update();}
1048     //            if (sub==2) {cHE->Modified(); cHE->Update();}
1049     cONE->Modified();
1050     cONE->Update();
1051     //            if (sub==4) {cHB->Modified(); cHB->Update();}
1052     //       }//end depth
1053 
1054     if (sub == 1) {
1055       cONE->Print("MapRateCalibEntryHB.png");
1056       cONE->Clear();
1057     }
1058     if (sub == 2) {
1059       cONE->Print("MapRateCalibEntryHE.png");
1060       cONE->Clear();
1061     }
1062     if (sub == 3) {
1063       cONE->Print("MapRateCalibEntryHO.png");
1064       cONE->Clear();
1065     }
1066     if (sub == 4) {
1067       cONE->Print("MapRateCalibEntryHF.png");
1068       cONE->Clear();
1069     }
1070   }  // end sub
1071 
1072   //+++++++++++++++++++++++++++++
1073   //Test 11 (Cc) Rate of Cap ID errors for calibration channels
1074   //+++++++++++++++++++++++++++++
1075 
1076   Map_Ampl[11][1][1] = (TH2F*)dir->FindObjectAny("h_mapCapCalib047_HB");
1077   Map_Ampl[11][1][2] = (TH2F*)dir->FindObjectAny("h_mapCapCalib047_HB");
1078   Map_Ampl[11][2][1] = (TH2F*)dir->FindObjectAny("h_mapCapCalib047_HE");
1079   Map_Ampl[11][2][2] = (TH2F*)dir->FindObjectAny("h_mapCapCalib047_HE");
1080   Map_Ampl[11][2][3] = (TH2F*)dir->FindObjectAny("h_mapCapCalib047_HE");
1081   Map_Ampl[11][3][4] = (TH2F*)dir->FindObjectAny("h_mapCapCalib047_HO");
1082   Map_Ampl[11][4][1] = (TH2F*)dir->FindObjectAny("h_mapCapCalib047_HF");
1083   Map_Ampl[11][4][2] = (TH2F*)dir->FindObjectAny("h_mapCapCalib047_HF");
1084 
1085   for (int sub = 1; sub <= 4; sub++) {  //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
1086                                         //       if (sub==1) cHB->Divide(2,1);
1087                                         //       if (sub==2) cHE->Divide(3,1);
1088     cONE->Divide(1, 1);
1089     //      if (sub==4) cHB->Divide(2,1);
1090     //       int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
1091     //       int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
1092     //       for (int k=k_min[sub];k<=k_max[sub];k++) {  //Depth
1093     int k = 1;
1094     cONE->cd(k);
1095     //          if (sub==1) cHB->cd(k);
1096     //          if (sub==2) cHE->cd(k);
1097     if (sub == 3)
1098       k = 4;
1099     //      if (sub==4) cHB->cd(k);
1100     Map_Ampl[11][sub][k]->Divide(Map_Ampl[11][sub][k], Map_Calib[sub][k], 1, 1, "B");
1101     gPad->SetGridy();
1102     gPad->SetGridx();
1103     gPad->SetLogz();
1104     if (sub == 1)
1105       sprintf(str, "HB");
1106     if (sub == 2)
1107       sprintf(str, "HE");
1108     if (sub == 3)
1109       sprintf(str, "HO");
1110     if (sub == 4)
1111       sprintf(str, "HF");
1112     Map_Ampl[11][sub][k]->SetTitle(str);
1113     Map_Ampl[11][sub][k]->SetXTitle("#eta \b");
1114     Map_Ampl[11][sub][k]->SetYTitle("#phi \b");
1115     Map_Ampl[11][sub][k]->SetZTitle("Rate \b");
1116     Map_Ampl[11][sub][k]->SetTitleOffset(0.75, "Z");
1117     Map_Ampl[11][sub][k]->Draw("COLZ");
1118     Map_Ampl[11][sub][k]->GetYaxis()->SetRangeUser(0, 72.);
1119     Map_Ampl[11][sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
1120     //            if (sub==1) {cHB->Modified(); cHB->Update();}
1121     //            if (sub==2) {cHE->Modified(); cHE->Update();}
1122     cONE->Modified();
1123     cONE->Update();
1124     //            if (sub==4) {cHB->Modified(); cHB->Update();}
1125     //       }//end depth
1126 
1127     if (sub == 1) {
1128       cONE->Print("MapRateCapCalibHB.png");
1129       cONE->Clear();
1130     }
1131     if (sub == 2) {
1132       cONE->Print("MapRateCapCalibHE.png");
1133       cONE->Clear();
1134     }
1135     if (sub == 3) {
1136       cONE->Print("MapRateCapCalibHO.png");
1137       cONE->Clear();
1138     }
1139     if (sub == 4) {
1140       cONE->Print("MapRateCapCalibHF.png");
1141       cONE->Clear();
1142     }
1143   }  // end sub
1144 
1145   //+++++++++++++++++++++++++++++
1146   //Test 12 (Ac) ADC amplitude for calibration chanels
1147   //+++++++++++++++++++++++++++++
1148 
1149   Map_Ampl[12][1][1] = (TH2F*)dir->FindObjectAny("h_mapADCCalib047_HB");
1150   Map_Ampl[12][1][2] = (TH2F*)dir->FindObjectAny("h_mapADCCalib047_HB");
1151   Map_Ampl[12][2][1] = (TH2F*)dir->FindObjectAny("h_mapADCCalib047_HE");
1152   Map_Ampl[12][2][2] = (TH2F*)dir->FindObjectAny("h_mapADCCalib047_HE");
1153   Map_Ampl[12][2][3] = (TH2F*)dir->FindObjectAny("h_mapADCCalib047_HE");
1154   Map_Ampl[12][3][4] = (TH2F*)dir->FindObjectAny("h_mapADCCalib047_HO");
1155   Map_Ampl[12][4][1] = (TH2F*)dir->FindObjectAny("h_mapADCCalib047_HF");
1156   Map_Ampl[12][4][2] = (TH2F*)dir->FindObjectAny("h_mapADCCalib047_HF");
1157 
1158   HistAmpl[12][1] = (TH1F*)dir->FindObjectAny("h_ADCCalib_HB");
1159   HistAmpl[12][2] = (TH1F*)dir->FindObjectAny("h_ADCCalib_HE");
1160   HistAmpl[12][3] = (TH1F*)dir->FindObjectAny("h_ADCCalib_HO");
1161   HistAmpl[12][4] = (TH1F*)dir->FindObjectAny("h_ADCCalib_HF");
1162 
1163   //+++++++++++++++++++++++++++++
1164   //Test 13 (Wc) Rate of RMS
1165   //+++++++++++++++++++++++++++++
1166 
1167   Map_Ampl[13][1][1] = (TH2F*)dir->FindObjectAny("h_mapWidthCalib047_HB");
1168   Map_Ampl[13][1][2] = (TH2F*)dir->FindObjectAny("h_mapWidthCalib047_HB");
1169   Map_Ampl[13][2][1] = (TH2F*)dir->FindObjectAny("h_mapWidthCalib047_HE");
1170   Map_Ampl[13][2][2] = (TH2F*)dir->FindObjectAny("h_mapWidthCalib047_HE");
1171   Map_Ampl[13][2][3] = (TH2F*)dir->FindObjectAny("h_mapWidthCalib047_HE");
1172   Map_Ampl[13][3][4] = (TH2F*)dir->FindObjectAny("h_mapWidthCalib047_HO");
1173   Map_Ampl[13][4][1] = (TH2F*)dir->FindObjectAny("h_mapWidthCalib047_HF");
1174   Map_Ampl[13][4][2] = (TH2F*)dir->FindObjectAny("h_mapWidthCalib047_HF");
1175 
1176   HistAmpl[13][1] = (TH1F*)dir->FindObjectAny("h_WidthCalib_HB");
1177   HistAmpl[13][2] = (TH1F*)dir->FindObjectAny("h_WidthCalib_HE");
1178   HistAmpl[13][3] = (TH1F*)dir->FindObjectAny("h_WidthCalib_HO");
1179   HistAmpl[13][4] = (TH1F*)dir->FindObjectAny("h_WidthCalib_HF");
1180 
1181   //+++++++++++++++++++++++++++++
1182   //Test 14 (Rc) Rate of ratio 4 near max TS/ All TS
1183   //+++++++++++++++++++++++++++++
1184 
1185   Map_Ampl[14][1][1] = (TH2F*)dir->FindObjectAny("h_mapRatioCalib047_HB");
1186   Map_Ampl[14][1][2] = (TH2F*)dir->FindObjectAny("h_mapRatioCalib047_HB");
1187   Map_Ampl[14][2][1] = (TH2F*)dir->FindObjectAny("h_mapRatioCalib047_HE");
1188   Map_Ampl[14][2][2] = (TH2F*)dir->FindObjectAny("h_mapRatioCalib047_HE");
1189   Map_Ampl[14][2][3] = (TH2F*)dir->FindObjectAny("h_mapRatioCalib047_HE");
1190   Map_Ampl[14][3][4] = (TH2F*)dir->FindObjectAny("h_mapRatioCalib047_HO");
1191   Map_Ampl[14][4][1] = (TH2F*)dir->FindObjectAny("h_mapRatioCalib047_HF");
1192   Map_Ampl[14][4][2] = (TH2F*)dir->FindObjectAny("h_mapRatioCalib047_HF");
1193 
1194   HistAmpl[14][1] = (TH1F*)dir->FindObjectAny("h_RatioCalib_HB");
1195   HistAmpl[14][2] = (TH1F*)dir->FindObjectAny("h_RatioCalib_HE");
1196   HistAmpl[14][3] = (TH1F*)dir->FindObjectAny("h_RatioCalib_HO");
1197   HistAmpl[14][4] = (TH1F*)dir->FindObjectAny("h_RatioCalib_HF");
1198 
1199   //+++++++++++++++++++++++++++++
1200   //Test 15 (TNc) Mean position in 1-8 TS range
1201   //+++++++++++++++++++++++++++++
1202 
1203   Map_Ampl[15][1][1] = (TH2F*)dir->FindObjectAny("h_mapTSmeanCalib047_HB");
1204   Map_Ampl[15][1][2] = (TH2F*)dir->FindObjectAny("h_mapTSmeanCalib047_HB");
1205   Map_Ampl[15][2][1] = (TH2F*)dir->FindObjectAny("h_mapTSmeanCalib047_HE");
1206   Map_Ampl[15][2][2] = (TH2F*)dir->FindObjectAny("h_mapTSmeanCalib047_HE");
1207   Map_Ampl[15][2][3] = (TH2F*)dir->FindObjectAny("h_mapTSmeanCalib047_HE");
1208   Map_Ampl[15][3][4] = (TH2F*)dir->FindObjectAny("h_mapTSmeanCalib047_HO");
1209   Map_Ampl[15][4][1] = (TH2F*)dir->FindObjectAny("h_mapTSmeanCalib047_HF");
1210   Map_Ampl[15][4][2] = (TH2F*)dir->FindObjectAny("h_mapTSmeanCalib047_HF");
1211 
1212   HistAmpl[15][1] = (TH1F*)dir->FindObjectAny("h_TSmeanCalib_HB");
1213   HistAmpl[15][2] = (TH1F*)dir->FindObjectAny("h_TSmeanCalib_HE");
1214   HistAmpl[15][3] = (TH1F*)dir->FindObjectAny("h_TSmeanCalib_HO");
1215   HistAmpl[15][4] = (TH1F*)dir->FindObjectAny("h_TSmeanCalib_HF");
1216 
1217   //+++++++++++++++++++++++++++++
1218   //Test 16 (TXc) Maximum position in 1-8 TS range
1219   //+++++++++++++++++++++++++++++
1220 
1221   Map_Ampl[16][1][1] = (TH2F*)dir->FindObjectAny("h_mapTSmaxCalib047_HB");
1222   Map_Ampl[16][1][2] = (TH2F*)dir->FindObjectAny("h_mapTSmaxCalib047_HB");
1223   Map_Ampl[16][2][1] = (TH2F*)dir->FindObjectAny("h_mapTSmaxCalib047_HE");
1224   Map_Ampl[16][2][2] = (TH2F*)dir->FindObjectAny("h_mapTSmaxCalib047_HE");
1225   Map_Ampl[16][2][3] = (TH2F*)dir->FindObjectAny("h_mapTSmaxCalib047_HE");
1226   Map_Ampl[16][3][4] = (TH2F*)dir->FindObjectAny("h_mapTSmaxCalib047_HO");
1227   Map_Ampl[16][4][1] = (TH2F*)dir->FindObjectAny("h_mapTSmaxCalib047_HF");
1228   Map_Ampl[16][4][2] = (TH2F*)dir->FindObjectAny("h_mapTSmaxCalib047_HF");
1229 
1230   HistAmpl[16][1] = (TH1F*)dir->FindObjectAny("h_TSmaxCalib_HB");
1231   HistAmpl[16][2] = (TH1F*)dir->FindObjectAny("h_TSmaxCalib_HE");
1232   HistAmpl[16][3] = (TH1F*)dir->FindObjectAny("h_TSmaxCalib_HO");
1233   HistAmpl[16][4] = (TH1F*)dir->FindObjectAny("h_TSmaxCalib_HF");
1234 
1235   for (int test = 12; test <= 16; test++) {  //Test: 2-Am, 3-Wm, 4-Rm, 5-TNm, 6-TXm,
1236     for (int sub = 1; sub <= 4; sub++) {     //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
1237       if (sub == 1)
1238         cONE->Divide(1, 1);  //cHB->Divide(2,1);
1239       if (sub == 2)
1240         cONE->Divide(1, 1);  //cHE->Divide(3,1);
1241       if (sub == 3)
1242         cONE->Divide(1, 1);
1243       if (sub == 4)
1244         cONE->Divide(1, 1);  //cHB->Divide(2,1);
1245                              //          int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
1246                              //          int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
1247                              //          for (int k=k_min[sub];k<=k_max[sub];k++) {  //Depth
1248       int k = 1;
1249       if (sub == 1) {
1250         k = 1;
1251         cONE->cd(k);
1252       }  //cHB->cd(k); }
1253       if (sub == 2) {
1254         k = 1;
1255         cONE->cd(k);
1256       }  //cHE->cd(k); }
1257       if (sub == 3) {
1258         k = 4;
1259         cONE->cd(k - 3);
1260       }
1261       if (sub == 4) {
1262         k = 1;
1263         cONE->cd(k);
1264       }  //cHB->cd(k); }
1265       Map_Ampl[test][sub][k]->Divide(Map_Ampl[test][sub][k], Map_Calib[sub][k], 1, 1, "B");
1266       gPad->SetGridy();
1267       gPad->SetGridx();
1268       gPad->SetLogz();
1269       if (sub == 1)
1270         sprintf(str, "HB");
1271       if (sub == 2)
1272         sprintf(str, "HE");
1273       if (sub == 3)
1274         sprintf(str, "HO");
1275       if (sub == 4)
1276         sprintf(str, "HF");
1277       Map_Ampl[test][sub][k]->SetTitle(str);
1278       Map_Ampl[test][sub][k]->SetXTitle("#eta \b");
1279       Map_Ampl[test][sub][k]->SetYTitle("#phi \b");
1280       Map_Ampl[test][sub][k]->SetZTitle("Rate \b");
1281       Map_Ampl[test][sub][k]->SetTitleOffset(0.8, "Z");
1282       Map_Ampl[test][sub][k]->Draw("COLZ");
1283       Map_Ampl[test][sub][k]->GetYaxis()->SetRangeUser(0, 72.);
1284       Map_Ampl[test][sub][k]->GetZaxis()->SetRangeUser(0.00001, 1.);
1285       //              if (sub==1) {cHB->Modified(); cHB->Update();}
1286       //              if (sub==2) {cHE->Modified(); cHE->Update();}
1287       cONE->Modified();
1288       cONE->Update();
1289       //              if (sub==4) {cHB->Modified(); cHB->Update();}
1290       //          }//end depth
1291       if (test == 12) {
1292         if (sub == 1) {
1293           cONE->Print("MapRateAmplCalibHB.png");
1294           cONE->Clear();
1295         }
1296         if (sub == 2) {
1297           cONE->Print("MapRateAmplCalibHE.png");
1298           cONE->Clear();
1299         }
1300         if (sub == 3) {
1301           cONE->Print("MapRateAmplCalibHO.png");
1302           cONE->Clear();
1303         }
1304         if (sub == 4) {
1305           cONE->Print("MapRateAmplCalibHF.png");
1306           cONE->Clear();
1307         }
1308       }
1309       if (test == 13) {
1310         if (sub == 1) {
1311           cONE->Print("MapRateRMSCalibHB.png");
1312           cONE->Clear();
1313         }
1314         if (sub == 2) {
1315           cONE->Print("MapRateRMSCalibHE.png");
1316           cONE->Clear();
1317         }
1318         if (sub == 3) {
1319           cONE->Print("MapRateRMSCalibHO.png");
1320           cONE->Clear();
1321         }
1322         if (sub == 4) {
1323           cONE->Print("MapRateRMSCalibHF.png");
1324           cONE->Clear();
1325         }
1326       }
1327       if (test == 14) {
1328         if (sub == 1) {
1329           cONE->Print("MapRate43TStoAllTSCalibHB.png");
1330           cONE->Clear();
1331         }
1332         if (sub == 2) {
1333           cONE->Print("MapRate43TStoAllTSCalibHE.png");
1334           cONE->Clear();
1335         }
1336         if (sub == 3) {
1337           cONE->Print("MapRate43TStoAllTSCalibHO.png");
1338           cONE->Clear();
1339         }
1340         if (sub == 4) {
1341           cONE->Print("MapRate43TStoAllTSCalibHF.png");
1342           cONE->Clear();
1343         }
1344       }
1345       if (test == 15) {
1346         if (sub == 1) {
1347           cONE->Print("MapRateMeanPosCalibHB.png");
1348           cONE->Clear();
1349         }
1350         if (sub == 2) {
1351           cONE->Print("MapRateMeanPosCalibHE.png");
1352           cONE->Clear();
1353         }
1354         if (sub == 3) {
1355           cONE->Print("MapRateMeanPosCalibHO.png");
1356           cONE->Clear();
1357         }
1358         if (sub == 4) {
1359           cONE->Print("MapRateMeanPosCalibHF.png");
1360           cONE->Clear();
1361         }
1362       }
1363       if (test == 16) {
1364         if (sub == 1) {
1365           cONE->Print("MapRateMaxPosCalibHB.png");
1366           cONE->Clear();
1367         }
1368         if (sub == 2) {
1369           cONE->Print("MapRateMaxPosCalibHE.png");
1370           cONE->Clear();
1371         }
1372         if (sub == 3) {
1373           cONE->Print("MapRateMaxPosCalibHO.png");
1374           cONE->Clear();
1375         }
1376         if (sub == 4) {
1377           cONE->Print("MapRateMaxPosCalibHF.png");
1378           cONE->Clear();
1379         }
1380       }
1381 
1382       cONE->Divide(1, 1);
1383       cONE->cd(1);
1384       gPad->SetGridy();
1385       gPad->SetGridx();
1386       gPad->SetLogy();
1387       if (sub == 1)
1388         HistAmpl[test][sub]->SetTitle("HB, All Depth");
1389       if (sub == 2)
1390         HistAmpl[test][sub]->SetTitle("HE, All Depth");
1391       if (sub == 3)
1392         HistAmpl[test][sub]->SetTitle("HO, All Depth");
1393       if (sub == 4)
1394         HistAmpl[test][sub]->SetTitle("HF, All Depth");
1395       if (test == 12)
1396         HistAmpl[test][sub]->SetXTitle("ADC Amlitude in each event & cell \b");
1397       if (test == 13)
1398         HistAmpl[test][sub]->SetXTitle("Amplitude RMS in each event & cell \b");
1399       if (test == 14)
1400         HistAmpl[test][sub]->SetXTitle("Ratio in each event & cell \b");
1401       if (test == 15)
1402         HistAmpl[test][sub]->SetXTitle("Mean TS position in each event & cell \b");
1403       if (test == 16)
1404         HistAmpl[test][sub]->SetXTitle("Max TS position in each event & cell \b");
1405       HistAmpl[test][sub]->SetYTitle("Number of cell-events \b");
1406       HistAmpl[test][sub]->SetLineColor(4);
1407       HistAmpl[test][sub]->SetLineWidth(2);
1408       HistAmpl[test][sub]->SetTitleOffset(1.4, "Y");
1409       HistAmpl[test][sub]->Draw("");
1410       //        HistAmpl[test][sub]->GetYaxis()->SetRangeUser(1., 100.);
1411       if (test == 12) {
1412         gPad->SetLogx();
1413         HistAmpl[test][sub]->GetXaxis()->SetRangeUser(1., 10000.);
1414       }
1415       if (test == 13)
1416         HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 5.);
1417       if (test == 14)
1418         HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 1.);
1419       if (test == 15)
1420         HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 9.);
1421       if (test == 16)
1422         HistAmpl[test][sub]->GetXaxis()->SetRangeUser(0., 9.);
1423       cONE->Modified();
1424       cONE->Update();
1425       double min_x[] = {MIN_C[test - 10][sub], MIN_C[test - 10][sub]};
1426       double min_y[] = {0., 100000000.};
1427       TGraph* MIN = new TGraph(2, min_x, min_y);
1428       MIN->SetLineStyle(2);
1429       MIN->SetLineColor(2);
1430       MIN->SetLineWidth(2 + 100 * 100);
1431       MIN->SetFillStyle(3005);
1432       MIN->SetFillColor(2);
1433       MIN->Draw("L");
1434       double max_x[] = {MAX_C[test - 10][sub], MAX_C[test - 10][sub]};
1435       double max_y[] = {0., 100000000.};
1436       TGraph* MAX = new TGraph(2, max_x, max_y);
1437       MAX->SetLineStyle(2);
1438       MAX->SetLineColor(2);
1439       MAX->SetLineWidth(-2 - 100 * 100);
1440       MAX->SetFillStyle(3004);
1441       MAX->SetFillColor(2);
1442       MAX->Draw("L");
1443       if (test == 12) {
1444         if (sub == 1) {
1445           cONE->Print("HistAmplCalibHB.png");
1446           cONE->Clear();
1447         }
1448         if (sub == 2) {
1449           cONE->Print("HistAmplCalibHE.png");
1450           cONE->Clear();
1451         }
1452         if (sub == 3) {
1453           cONE->Print("HistAmplCalibHO.png");
1454           cONE->Clear();
1455         }
1456         if (sub == 4) {
1457           cONE->Print("HistAmplCalibHF.png");
1458           cONE->Clear();
1459         }
1460       }
1461       if (test == 13) {
1462         if (sub == 1) {
1463           cONE->Print("HistRMSCalibHB.png");
1464           cONE->Clear();
1465         }
1466         if (sub == 2) {
1467           cONE->Print("HistRMSCalibHE.png");
1468           cONE->Clear();
1469         }
1470         if (sub == 3) {
1471           cONE->Print("HistRMSCalibHO.png");
1472           cONE->Clear();
1473         }
1474         if (sub == 4) {
1475           cONE->Print("HistRMSCalibHF.png");
1476           cONE->Clear();
1477         }
1478       }
1479       if (test == 14) {
1480         if (sub == 1) {
1481           cONE->Print("Hist43TStoAllTSCalibHB.png");
1482           cONE->Clear();
1483         }
1484         if (sub == 2) {
1485           cONE->Print("Hist43TStoAllTSCalibHE.png");
1486           cONE->Clear();
1487         }
1488         if (sub == 3) {
1489           cONE->Print("Hist43TStoAllTSCalibHO.png");
1490           cONE->Clear();
1491         }
1492         if (sub == 4) {
1493           cONE->Print("Hist43TStoAllTSCalibHF.png");
1494           cONE->Clear();
1495         }
1496       }
1497       if (test == 15) {
1498         if (sub == 1) {
1499           cONE->Print("HistMeanPosCalibHB.png");
1500           cONE->Clear();
1501         }
1502         if (sub == 2) {
1503           cONE->Print("HistMeanPosCalibHE.png");
1504           cONE->Clear();
1505         }
1506         if (sub == 3) {
1507           cONE->Print("HistMeanPosCalibHO.png");
1508           cONE->Clear();
1509         }
1510         if (sub == 4) {
1511           cONE->Print("HistMeanPosCalibHF.png");
1512           cONE->Clear();
1513         }
1514       }
1515       if (test == 16) {
1516         if (sub == 1) {
1517           cONE->Print("HistMaxPosCalibHB.png");
1518           cONE->Clear();
1519         }
1520         if (sub == 2) {
1521           cONE->Print("HistMaxPosCalibHE.png");
1522           cONE->Clear();
1523         }
1524         if (sub == 3) {
1525           cONE->Print("HistMaxPosCalibHO.png");
1526           cONE->Clear();
1527         }
1528         if (sub == 4) {
1529           cONE->Print("HistMaxPosCalibHF.png");
1530           cONE->Clear();
1531         }
1532       }
1533     }  // end sub
1534   }    //end test
1535 
1536   //+++++++++++++++++++++++++++++
1537   //Test 21 (GS) Amplitude drift
1538   //+++++++++++++++++++++++++++++
1539 
1540   Map_Ampl[21][1][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1AmplE34_HB");
1541   Map_Ampl[21][1][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2AmplE34_HB");
1542   Map_Ampl[21][1][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3AmplE34_HB");
1543   Map_Ampl[21][1][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4AmplE34_HB");
1544   Map_Ampl[21][2][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1AmplE34_HE");
1545   Map_Ampl[21][2][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2AmplE34_HE");
1546   Map_Ampl[21][2][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3AmplE34_HE");
1547   Map_Ampl[21][2][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4AmplE34_HE");
1548   Map_Ampl[21][2][5] = (TH2F*)dir->FindObjectAny("h_mapDepth5AmplE34_HE");
1549   Map_Ampl[21][2][6] = (TH2F*)dir->FindObjectAny("h_mapDepth6AmplE34_HE");
1550   Map_Ampl[21][2][7] = (TH2F*)dir->FindObjectAny("h_mapDepth7AmplE34_HE");
1551   Map_Ampl[21][3][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4AmplE34_HO");
1552   Map_Ampl[21][4][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1AmplE34_HF");
1553   Map_Ampl[21][4][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2AmplE34_HF");
1554   Map_Ampl[21][4][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3AmplE34_HF");
1555   Map_Ampl[21][4][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4AmplE34_HF");
1556 
1557   TH2F* Map_RefAmpl[5][ALLDEPTH];  // 2D histogramm for subdet, depth
1558   TH2F* Map_RefSUB[5][ALLDEPTH];   // 2d histogramm for subdet, depth
1559 
1560   Map_RefAmpl[1][1] = (TH2F*)refdir->FindObjectAny("h_mapDepth1AmplE34_HB");
1561   Map_RefAmpl[1][2] = (TH2F*)refdir->FindObjectAny("h_mapDepth2AmplE34_HB");
1562   Map_RefAmpl[1][3] = (TH2F*)refdir->FindObjectAny("h_mapDepth3AmplE34_HB");
1563   Map_RefAmpl[1][4] = (TH2F*)refdir->FindObjectAny("h_mapDepth4AmplE34_HB");
1564   Map_RefAmpl[2][1] = (TH2F*)refdir->FindObjectAny("h_mapDepth1AmplE34_HE");
1565   Map_RefAmpl[2][2] = (TH2F*)refdir->FindObjectAny("h_mapDepth2AmplE34_HE");
1566   Map_RefAmpl[2][3] = (TH2F*)refdir->FindObjectAny("h_mapDepth3AmplE34_HE");
1567   Map_RefAmpl[2][4] = (TH2F*)refdir->FindObjectAny("h_mapDepth4AmplE34_HE");
1568   Map_RefAmpl[2][5] = (TH2F*)refdir->FindObjectAny("h_mapDepth5AmplE34_HE");
1569   Map_RefAmpl[2][6] = (TH2F*)refdir->FindObjectAny("h_mapDepth6AmplE34_HE");
1570   Map_RefAmpl[2][7] = (TH2F*)refdir->FindObjectAny("h_mapDepth7AmplE34_HE");
1571   Map_RefAmpl[3][4] = (TH2F*)refdir->FindObjectAny("h_mapDepth4AmplE34_HO");
1572   Map_RefAmpl[4][1] = (TH2F*)refdir->FindObjectAny("h_mapDepth1AmplE34_HF");
1573   Map_RefAmpl[4][2] = (TH2F*)refdir->FindObjectAny("h_mapDepth2AmplE34_HF");
1574   Map_RefAmpl[4][3] = (TH2F*)refdir->FindObjectAny("h_mapDepth3AmplE34_HF");
1575   Map_RefAmpl[4][4] = (TH2F*)refdir->FindObjectAny("h_mapDepth4AmplE34_HF");
1576 
1577   Map_RefSUB[1][1] = (TH2F*)refdir->FindObjectAny("h_mapDepth1_HB");
1578   Map_RefSUB[1][2] = (TH2F*)refdir->FindObjectAny("h_mapDepth2_HB");
1579   Map_RefSUB[1][3] = (TH2F*)refdir->FindObjectAny("h_mapDepth3_HB");
1580   Map_RefSUB[1][4] = (TH2F*)refdir->FindObjectAny("h_mapDepth4_HB");
1581   Map_RefSUB[2][1] = (TH2F*)refdir->FindObjectAny("h_mapDepth1_HE");
1582   Map_RefSUB[2][2] = (TH2F*)refdir->FindObjectAny("h_mapDepth2_HE");
1583   Map_RefSUB[2][3] = (TH2F*)refdir->FindObjectAny("h_mapDepth3_HE");
1584   Map_RefSUB[2][4] = (TH2F*)refdir->FindObjectAny("h_mapDepth4_HE");
1585   Map_RefSUB[2][5] = (TH2F*)refdir->FindObjectAny("h_mapDepth5_HE");
1586   Map_RefSUB[2][6] = (TH2F*)refdir->FindObjectAny("h_mapDepth6_HE");
1587   Map_RefSUB[2][7] = (TH2F*)refdir->FindObjectAny("h_mapDepth7_HE");
1588   Map_RefSUB[3][4] = (TH2F*)refdir->FindObjectAny("h_mapDepth4_HO");
1589   Map_RefSUB[4][1] = (TH2F*)refdir->FindObjectAny("h_mapDepth1_HF");
1590   Map_RefSUB[4][2] = (TH2F*)refdir->FindObjectAny("h_mapDepth2_HF");
1591   Map_RefSUB[4][3] = (TH2F*)refdir->FindObjectAny("h_mapDepth3_HF");
1592   Map_RefSUB[4][4] = (TH2F*)refdir->FindObjectAny("h_mapDepth4_HF");
1593 
1594   HistAmplDepth[21][1][1] = new TH1F("diffAmpl_Depth1_HB", "", 100, -10., 10.);
1595   HistAmplDepth[21][1][2] = new TH1F("diffAmpl_Depth2_HB", "", 100, -10., 10.);
1596   HistAmplDepth[21][1][3] = new TH1F("diffAmpl_Depth3_HB", "", 100, -10., 10.);
1597   HistAmplDepth[21][1][4] = new TH1F("diffAmpl_Depth4_HB", "", 100, -10., 10.);
1598   HistAmplDepth[21][2][1] = new TH1F("diffAmpl_Depth1_HE", "", 100, -10., 10.);
1599   HistAmplDepth[21][2][2] = new TH1F("diffAmpl_Depth2_HE", "", 100, -10., 10.);
1600   HistAmplDepth[21][2][3] = new TH1F("diffAmpl_Depth3_HE", "", 100, -10., 10.);
1601   HistAmplDepth[21][2][4] = new TH1F("diffAmpl_Depth4_HE", "", 100, -10., 10.);
1602   HistAmplDepth[21][2][5] = new TH1F("diffAmpl_Depth5_HE", "", 100, -10., 10.);
1603   HistAmplDepth[21][2][6] = new TH1F("diffAmpl_Depth6_HE", "", 100, -10., 10.);
1604   HistAmplDepth[21][2][7] = new TH1F("diffAmpl_Depth7_HE", "", 100, -10., 10.);
1605   HistAmplDepth[21][3][4] = new TH1F("diffAmpl_Depth4_HO", "", 100, -10., 10.);
1606   HistAmplDepth[21][4][1] = new TH1F("diffAmpl_Depth1_HF", "", 100, -10., 10.);
1607   HistAmplDepth[21][4][2] = new TH1F("diffAmpl_Depth2_HF", "", 100, -10., 10.);
1608   HistAmplDepth[21][4][3] = new TH1F("diffAmpl_Depth3_HF", "", 100, -10., 10.);
1609   HistAmplDepth[21][4][4] = new TH1F("diffAmpl_Depth4_HF", "", 100, -10., 10.);
1610 
1611   for (int sub = 1; sub <= 4; sub++) {  //Subdetector: 1-HB, 2-HE, 3-HF, 4-HO
1612                                         //     if (sub==1) cHB->Divide(2,1);
1613     if (sub == 1)
1614       cHB->Divide(2, 2);
1615     //     if (sub==2) cHE->Divide(3,1);
1616     if (sub == 2)
1617       cHE->Divide(3, 3);
1618     if (sub == 3)
1619       cONE->Divide(1, 1);
1620     //     if (sub==4) cHF->Divide(2,1);
1621     if (sub == 4)
1622       cHF->Divide(2, 2);
1623     //       int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
1624     //     int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
1625     //       int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
1626     for (int k = k_min[sub]; k <= k_max[sub]; k++) {  //Depth
1627       if (sub == 1)
1628         cHB->cd(k);
1629       if (sub == 2)
1630         cHE->cd(k);
1631       if (sub == 3)
1632         cONE->cd(k - 3);
1633       if (sub == 4)
1634         cHF->cd(k);
1635       Map_Ampl[21][sub][k]->Divide(Map_Ampl[21][sub][k], Map_SUB[sub][k], 1, 1, "B");
1636       gPad->SetGridy();
1637       gPad->SetGridx();
1638       gPad->SetLogz();
1639       if (sub == 1)
1640         sprintf(str, "HB, Depth%d \b", k);
1641       if (sub == 2)
1642         sprintf(str, "HE, Depth%d \b", k);
1643       if (sub == 3)
1644         sprintf(str, "HO, Depth%d \b", k);
1645       if (sub == 4)
1646         sprintf(str, "HF, Depth%d \b", k);
1647       Map_Ampl[21][sub][k]->SetTitle(str);
1648       Map_Ampl[21][sub][k]->SetXTitle("#eta \b");
1649       Map_Ampl[21][sub][k]->SetYTitle("#phi \b");
1650       Map_Ampl[21][sub][k]->SetZTitle("Response \b");
1651       Map_Ampl[21][sub][k]->SetTitleOffset(1.1, "Z");
1652       Map_Ampl[21][sub][k]->Draw("COLZ");
1653       Map_Ampl[21][sub][k]->GetYaxis()->SetRangeUser(0, 71.);
1654       //            Map_Ampl[21][sub][k]->GetZaxis()->SetRangeUser(1., 10.);
1655       if (sub == 1) {
1656         cHB->Modified();
1657         cHB->Update();
1658       }
1659       if (sub == 2) {
1660         cHE->Modified();
1661         cHE->Update();
1662       }
1663       if (sub == 3) {
1664         cONE->Modified();
1665         cONE->Update();
1666       }
1667       if (sub == 4) {
1668         cHF->Modified();
1669         cHF->Update();
1670       }
1671     }  //end depth
1672     if (sub == 1) {
1673       cHB->Print("MapRateAmpl1HB.png");
1674       cHB->Clear();
1675     }
1676     if (sub == 2) {
1677       cHE->Print("MapRateAmpl1HE.png");
1678       cHE->Clear();
1679     }
1680     if (sub == 3) {
1681       cONE->Print("MapRateAmpl1HO.png");
1682       cONE->Clear();
1683     }
1684     if (sub == 4) {
1685       cHF->Print("MapRateAmpl1HF.png");
1686       cHF->Clear();
1687     }
1688 
1689     //     if (sub==1) cHB->Divide(2,1);
1690     if (sub == 1)
1691       cHB->Divide(2, 2);
1692     //     if (sub==2) cHE->Divide(3,1);
1693     if (sub == 2)
1694       cHE->Divide(3, 3);
1695     if (sub == 3)
1696       cONE->Divide(1, 1);
1697     //     if (sub==4) cHF->Divide(2,1);
1698     if (sub == 4)
1699       cHF->Divide(2, 2);
1700 
1701     for (int k = k_min[sub]; k <= k_max[sub]; k++) {  //Depth
1702       if (sub == 1)
1703         cHB->cd(k);
1704       if (sub == 2)
1705         cHE->cd(k);
1706       if (sub == 3)
1707         cONE->cd(k - 3);
1708       if (sub == 4)
1709         cHF->cd(k);
1710       Map_RefAmpl[sub][k]->Divide(Map_RefAmpl[sub][k], Map_RefSUB[sub][k], 1, 1, "B");
1711       gPad->SetGridy();
1712       gPad->SetGridx();
1713       gPad->SetLogz();
1714       if (sub == 1)
1715         sprintf(str, "HB, Depth%d \b", k);
1716       if (sub == 2)
1717         sprintf(str, "HE, Depth%d \b", k);
1718       if (sub == 3)
1719         sprintf(str, "HO, Depth%d \b", k);
1720       if (sub == 4)
1721         sprintf(str, "HF, Depth%d \b", k);
1722       Map_RefAmpl[sub][k]->SetTitle(str);
1723       Map_RefAmpl[sub][k]->SetXTitle("#eta \b");
1724       Map_RefAmpl[sub][k]->SetYTitle("#phi \b");
1725       Map_RefAmpl[sub][k]->SetZTitle("Response\b");
1726       Map_RefAmpl[sub][k]->SetTitleOffset(1.1, "Z");
1727       Map_RefAmpl[sub][k]->Draw("COLZ");
1728       Map_RefAmpl[sub][k]->GetYaxis()->SetRangeUser(0, 71.);
1729       //            Map_RefAmpl[21][sub][k]->GetZaxis()->SetRangeUser(1., 10.);
1730       if (sub == 1) {
1731         cHB->Modified();
1732         cHB->Update();
1733       }
1734       if (sub == 2) {
1735         cHE->Modified();
1736         cHE->Update();
1737       }
1738       if (sub == 3) {
1739         cONE->Modified();
1740         cONE->Update();
1741       }
1742       if (sub == 4) {
1743         cHF->Modified();
1744         cHF->Update();
1745       }
1746     }  //end depth
1747     if (sub == 1) {
1748       cHB->Print("MapRateAmpl2HB.png");
1749       cHB->Clear();
1750     }
1751     if (sub == 2) {
1752       cHE->Print("MapRateAmpl2HE.png");
1753       cHE->Clear();
1754     }
1755     if (sub == 3) {
1756       cONE->Print("MapRateAmpl2HO.png");
1757       cONE->Clear();
1758     }
1759     if (sub == 4) {
1760       cHF->Print("MapRateAmpl2HF.png");
1761       cHF->Clear();
1762     }
1763 
1764     //     if (sub==1) cHB->Divide(2,1);
1765     if (sub == 1)
1766       cHB->Divide(2, 2);
1767     //     if (sub==2) cHE->Divide(3,1);
1768     if (sub == 2)
1769       cHE->Divide(3, 3);
1770     if (sub == 3)
1771       cONE->Divide(1, 1);
1772     //     if (sub==4) cHF->Divide(2,1);
1773     if (sub == 4)
1774       cHF->Divide(2, 2);
1775 
1776     for (int k = k_min[sub]; k <= k_max[sub]; k++) {  //Depth
1777       if (sub == 1)
1778         cHB->cd(k);
1779       if (sub == 2)
1780         cHE->cd(k);
1781       if (sub == 3)
1782         cONE->cd(k - 3);
1783       if (sub == 4)
1784         cHF->cd(k);
1785       TH2F* TTT = new TH2F("Map", "Map", 82, -41, 40, 72, 0, 71);
1786       for (int x = 1; x <= Map_Ampl[21][sub][k]->GetXaxis()->GetNbins(); x++) {
1787         for (int y = 1; y <= Map_Ampl[21][sub][k]->GetYaxis()->GetNbins(); y++) {
1788           if (Map_Ampl[21][sub][k]->GetBinContent(x, y) != 0 && Map_RefAmpl[sub][k]->GetBinContent(x, y) != 0) {
1789             double ccc1 = Map_Ampl[21][sub][k]->GetBinContent(x, y) - Map_RefAmpl[sub][k]->GetBinContent(x, y);
1790             ccc1 = 100. * ccc1 / Map_Ampl[21][sub][k]->GetBinContent(x, y);  // in %
1791             HistAmplDepth[21][sub][k]->Fill(ccc1);
1792             Map_Ampl[21][sub][k]->SetBinContent(x, y, fabs(ccc1));
1793             if (fabs(ccc1) > porog[sub])
1794               TTT->SetBinContent(x, y, fabs(ccc1));
1795             else
1796               TTT->SetBinContent(x, y, 0);
1797           }
1798         }  //end y
1799       }    //esnd x
1800       gPad->SetGridy();
1801       gPad->SetGridx();
1802       //            gPad->SetLogz();
1803       if (sub == 1)
1804         sprintf(str, "HB, Depth%d \b", k);
1805       if (sub == 2)
1806         sprintf(str, "HE, Depth%d \b", k);
1807       if (sub == 3)
1808         sprintf(str, "HO, Depth%d \b", k);
1809       if (sub == 4)
1810         sprintf(str, "HF, Depth%d \b", k);
1811       TTT->SetTitle(str);
1812       TTT->SetXTitle("#eta \b");
1813       TTT->SetYTitle("#phi \b");
1814       TTT->SetZTitle("Relative difference, % \b");
1815       TTT->SetTitleOffset(0.9, "Z");
1816       TTT->Draw("COLZ");
1817       TTT->GetYaxis()->SetRangeUser(0, 71.);
1818       TTT->GetZaxis()->SetRangeUser(0, 10.);
1819       if (sub == 1) {
1820         cHB->Modified();
1821         cHB->Update();
1822       }
1823       if (sub == 2) {
1824         cHE->Modified();
1825         cHE->Update();
1826       }
1827       if (sub == 3) {
1828         cONE->Modified();
1829         cONE->Update();
1830       }
1831       if (sub == 4) {
1832         cHF->Modified();
1833         cHF->Update();
1834       }
1835     }  //end depth
1836 
1837     if (sub == 1) {
1838       cHB->Print("MapRateAmplDriftHB.png");
1839       cHB->Clear();
1840     }
1841     if (sub == 2) {
1842       cHE->Print("MapRateAmplDriftHE.png");
1843       cHE->Clear();
1844     }
1845     if (sub == 3) {
1846       cONE->Print("MapRateAmplDriftHO.png");
1847       cONE->Clear();
1848     }
1849     if (sub == 4) {
1850       cHF->Print("MapRateAmplDriftHF.png");
1851       cHF->Clear();
1852     }
1853     ////////////////////////////////////////////////////////////////////////////////////
1854 
1855     //     if (sub==1) cHB->Divide(2,1);
1856     if (sub == 1)
1857       cHB->Divide(2, 2);
1858     //     if (sub==2) cHE->Divide(3,1);
1859     if (sub == 2)
1860       cHE->Divide(3, 3);
1861     if (sub == 3)
1862       cONE->Divide(1, 1);
1863     //     if (sub==4) cHF->Divide(2,1);
1864     if (sub == 4)
1865       cHF->Divide(2, 2);
1866 
1867     for (int k = k_min[sub]; k <= k_max[sub]; k++) {  //Depth
1868       if (sub == 1)
1869         cHB->cd(k);
1870       if (sub == 2)
1871         cHE->cd(k);
1872       if (sub == 3)
1873         cONE->cd(k - 3);
1874       if (sub == 4)
1875         cHF->cd(k);
1876       gPad->SetGridy();
1877       gPad->SetGridx();
1878       gPad->SetLogy();
1879       if (sub == 1)
1880         sprintf(str, "HB, Depth%d \b", k);
1881       if (sub == 2)
1882         sprintf(str, "HE, Depth%d \b", k);
1883       if (sub == 3)
1884         sprintf(str, "HO, Depth%d \b", k);
1885       if (sub == 4)
1886         sprintf(str, "HF, Depth%d \b", k);
1887       HistAmplDepth[21][sub][k]->SetTitle(str);
1888       HistAmplDepth[21][sub][k]->SetYTitle("Number of cell-events \b");
1889       HistAmplDepth[21][sub][k]->SetXTitle("Per cent \b");
1890       HistAmplDepth[21][sub][k]->SetLineColor(4);
1891       HistAmplDepth[21][sub][k]->SetLineWidth(2);
1892       HistAmplDepth[21][sub][k]->SetTitleOffset(1.4, "Y");
1893       HistAmplDepth[21][sub][k]->Draw();
1894       //          HistAmplDepth[21][sub][k]->GetYaxis()->SetRangeUser(0, 72.);
1895       HistAmplDepth[21][sub][k]->GetXaxis()->SetRangeUser(-10., 10.);
1896       if (sub == 1) {
1897         cHB->Modified();
1898         cHB->Update();
1899       }
1900       if (sub == 2) {
1901         cHE->Modified();
1902         cHE->Update();
1903       }
1904       if (sub == 3) {
1905         cONE->Modified();
1906         cONE->Update();
1907       }
1908       if (sub == 4) {
1909         cHF->Modified();
1910         cHF->Update();
1911       }
1912       double min_x[] = {-1 * porog[sub], -1 * porog[sub]};
1913       double min_y[] = {0., 100000000.};
1914       TGraph* MIN = new TGraph(2, min_x, min_y);
1915       MIN->SetLineStyle(2);
1916       MIN->SetLineColor(2);
1917       MIN->SetLineWidth(2 + 100 * 100);
1918       MIN->SetFillStyle(3005);
1919       MIN->SetFillColor(2);
1920       MIN->Draw("L");
1921       double max_x[] = {porog[sub], porog[sub]};
1922       double max_y[] = {0., 100000000.};
1923       TGraph* MAX = new TGraph(2, max_x, max_y);
1924       MAX->SetLineStyle(2);
1925       MAX->SetLineColor(2);
1926       MAX->SetLineWidth(-2 - 100 * 100);
1927       MAX->SetFillStyle(3004);
1928       MAX->SetFillColor(2);
1929       MAX->Draw("L");
1930     }  // end depth
1931     if (sub == 1) {
1932       cHB->Print("HistAmplDriftDepthHB.png");
1933       cHB->Clear();
1934     }
1935     if (sub == 2) {
1936       cHE->Print("HistAmplDriftDepthHE.png");
1937       cHE->Clear();
1938     }
1939     if (sub == 3) {
1940       cONE->Print("HistAmplDriftDepthHO.png");
1941       cONE->Clear();
1942     }
1943     if (sub == 4) {
1944       cHF->Print("HistAmplDriftDepthHF.png");
1945       cHF->Clear();
1946     }
1947   }  //end sub
1948 
1949   //+++++++++++++++++++++++++++++++++++
1950   //Test 31, 32 Pedestal, pedestalWidths
1951   //++++++++++++++++++++++++++++++++++++
1952 
1953   Map_Ampl[31][1][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1pedestal_HB");
1954   Map_Ampl[31][1][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2pedestal_HB");
1955   Map_Ampl[31][1][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3pedestal_HB");
1956   Map_Ampl[31][1][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4pedestal_HB");
1957   Map_Ampl[31][2][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1pedestal_HE");
1958   Map_Ampl[31][2][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2pedestal_HE");
1959   Map_Ampl[31][2][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3pedestal_HE");
1960   Map_Ampl[31][2][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4pedestal_HE");
1961   Map_Ampl[31][2][5] = (TH2F*)dir->FindObjectAny("h_mapDepth5pedestal_HE");
1962   Map_Ampl[31][2][6] = (TH2F*)dir->FindObjectAny("h_mapDepth6pedestal_HE");
1963   Map_Ampl[31][2][7] = (TH2F*)dir->FindObjectAny("h_mapDepth7pedestal_HE");
1964   Map_Ampl[31][3][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4pedestal_HO");
1965   Map_Ampl[31][4][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1pedestal_HF");
1966   Map_Ampl[31][4][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2pedestal_HF");
1967   Map_Ampl[31][4][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3pedestal_HF");
1968   Map_Ampl[31][4][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4pedestal_HF");
1969 
1970   Map_Ampl[32][1][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1pedestalw_HB");
1971   Map_Ampl[32][1][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2pedestalw_HB");
1972   Map_Ampl[32][1][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3pedestalw_HB");
1973   Map_Ampl[32][1][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4pedestalw_HB");
1974   Map_Ampl[32][2][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1pedestalw_HE");
1975   Map_Ampl[32][2][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2pedestalw_HE");
1976   Map_Ampl[32][2][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3pedestalw_HE");
1977   Map_Ampl[32][2][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4pedestalw_HE");
1978   Map_Ampl[32][2][5] = (TH2F*)dir->FindObjectAny("h_mapDepth5pedestalw_HE");
1979   Map_Ampl[32][2][6] = (TH2F*)dir->FindObjectAny("h_mapDepth6pedestalw_HE");
1980   Map_Ampl[32][2][7] = (TH2F*)dir->FindObjectAny("h_mapDepth7pedestalw_HE");
1981   Map_Ampl[32][3][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4pedestalw_HO");
1982   Map_Ampl[32][4][1] = (TH2F*)dir->FindObjectAny("h_mapDepth1pedestalw_HF");
1983   Map_Ampl[32][4][2] = (TH2F*)dir->FindObjectAny("h_mapDepth2pedestalw_HF");
1984   Map_Ampl[32][4][3] = (TH2F*)dir->FindObjectAny("h_mapDepth3pedestalw_HF");
1985   Map_Ampl[32][4][4] = (TH2F*)dir->FindObjectAny("h_mapDepth4pedestalw_HF");
1986 
1987   HistPed[1][1][0] = (TH1F*)dir->FindObjectAny("h_pedestal0_HB");
1988   HistPed[1][1][1] = (TH1F*)dir->FindObjectAny("h_pedestal1_HB");
1989   HistPed[1][1][2] = (TH1F*)dir->FindObjectAny("h_pedestal2_HB");
1990   HistPed[1][1][3] = (TH1F*)dir->FindObjectAny("h_pedestal3_HB");
1991   HistPed[2][1][0] = (TH1F*)dir->FindObjectAny("h_pedestalw0_HB");
1992   HistPed[2][1][1] = (TH1F*)dir->FindObjectAny("h_pedestalw1_HB");
1993   HistPed[2][1][2] = (TH1F*)dir->FindObjectAny("h_pedestalw2_HB");
1994   HistPed[2][1][3] = (TH1F*)dir->FindObjectAny("h_pedestalw3_HB");
1995 
1996   HistPed[1][2][0] = (TH1F*)dir->FindObjectAny("h_pedestal0_HE");
1997   HistPed[1][2][1] = (TH1F*)dir->FindObjectAny("h_pedestal1_HE");
1998   HistPed[1][2][2] = (TH1F*)dir->FindObjectAny("h_pedestal2_HE");
1999   HistPed[1][2][3] = (TH1F*)dir->FindObjectAny("h_pedestal3_HE");
2000   HistPed[2][2][0] = (TH1F*)dir->FindObjectAny("h_pedestalw0_HE");
2001   HistPed[2][2][1] = (TH1F*)dir->FindObjectAny("h_pedestalw1_HE");
2002   HistPed[2][2][2] = (TH1F*)dir->FindObjectAny("h_pedestalw2_HE");
2003   HistPed[2][2][3] = (TH1F*)dir->FindObjectAny("h_pedestalw3_HE");
2004 
2005   HistPed[1][3][0] = (TH1F*)dir->FindObjectAny("h_pedestal0_HO");
2006   HistPed[1][3][1] = (TH1F*)dir->FindObjectAny("h_pedestal1_HO");
2007   HistPed[1][3][2] = (TH1F*)dir->FindObjectAny("h_pedestal2_HO");
2008   HistPed[1][3][3] = (TH1F*)dir->FindObjectAny("h_pedestal3_HO");
2009   HistPed[2][3][0] = (TH1F*)dir->FindObjectAny("h_pedestalw0_HO");
2010   HistPed[2][3][1] = (TH1F*)dir->FindObjectAny("h_pedestalw1_HO");
2011   HistPed[2][3][2] = (TH1F*)dir->FindObjectAny("h_pedestalw2_HO");
2012   HistPed[2][3][3] = (TH1F*)dir->FindObjectAny("h_pedestalw3_HO");
2013 
2014   HistPed[1][4][0] = (TH1F*)dir->FindObjectAny("h_pedestal0_HF");
2015   HistPed[1][4][1] = (TH1F*)dir->FindObjectAny("h_pedestal1_HF");
2016   HistPed[1][4][2] = (TH1F*)dir->FindObjectAny("h_pedestal2_HF");
2017   HistPed[1][4][3] = (TH1F*)dir->FindObjectAny("h_pedestal3_HF");
2018   HistPed[2][4][0] = (TH1F*)dir->FindObjectAny("h_pedestalw0_HF");
2019   HistPed[2][4][1] = (TH1F*)dir->FindObjectAny("h_pedestalw1_HF");
2020   HistPed[2][4][2] = (TH1F*)dir->FindObjectAny("h_pedestalw2_HF");
2021   HistPed[2][4][3] = (TH1F*)dir->FindObjectAny("h_pedestalw3_HF");
2022 
2023   for (int test = 31; test <= 32; test++) {  //Test: 31-Pedestals, 32-pedestal Widths,
2024     for (int sub = 1; sub <= 4; sub++) {     //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
2025                                              //        if (sub==1) cHB->Divide(2,1);
2026       if (sub == 1)
2027         cHB->Divide(2, 2);
2028       //        if (sub==2) cHE->Divide(3,1);
2029       if (sub == 2)
2030         cHE->Divide(3, 3);
2031       if (sub == 3)
2032         cONE->Divide(1, 1);
2033       //        if (sub==4) cHF->Divide(2,1);
2034       if (sub == 4)
2035         cHF->Divide(2, 2);
2036       //          int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
2037       //        int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet
2038       //          int k_max[5]={0,2,7,4,4}; // maximum depth for each subdet
2039       for (int k = k_min[sub]; k <= k_max[sub]; k++) {  //Depths
2040         if (sub == 1)
2041           cHB->cd(k);
2042         if (sub == 2)
2043           cHE->cd(k);
2044         if (sub == 3)
2045           cONE->cd(k - 3);
2046         if (sub == 4)
2047           cHF->cd(k);
2048         Map_Ampl[test][sub][k]->Divide(Map_Ampl[test][sub][k], Map_SUB[sub][k], 1, 1, "B");
2049         gPad->SetGridy();
2050         gPad->SetGridx();
2051         gPad->SetLogz();
2052         if (sub == 1)
2053           sprintf(str, "HB, Depth%d \b", k);
2054         if (sub == 2)
2055           sprintf(str, "HE, Depth%d \b", k);
2056         if (sub == 3)
2057           sprintf(str, "HO, Depth%d \b", k);
2058         if (sub == 4)
2059           sprintf(str, "HF, Depth%d \b", k);
2060         Map_Ampl[test][sub][k]->SetTitle(str);
2061         Map_Ampl[test][sub][k]->SetXTitle("#eta \b");
2062         Map_Ampl[test][sub][k]->SetYTitle("#phi \b");
2063         Map_Ampl[test][sub][k]->SetZTitle("Rate \b");
2064         if (sub == 3)
2065           Map_Ampl[test][sub][k]->SetTitleOffset(0.8, "Z");
2066         Map_Ampl[test][sub][k]->Draw("COLZ");
2067         Map_Ampl[test][sub][k]->GetYaxis()->SetRangeUser(0, 72.);
2068         Map_Ampl[test][sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
2069         if (sub == 1) {
2070           cHB->Modified();
2071           cHB->Update();
2072         }
2073         if (sub == 2) {
2074           cHE->Modified();
2075           cHE->Update();
2076         }
2077         if (sub == 3) {
2078           cONE->Modified();
2079           cONE->Update();
2080         }
2081         if (sub == 4) {
2082           cHF->Modified();
2083           cHF->Update();
2084         }
2085       }  //end depth
2086       if (test == 31) {
2087         if (sub == 1) {
2088           cHB->Print("MapRatePedHB.png");
2089           cHB->Clear();
2090         }
2091         if (sub == 2) {
2092           cHE->Print("MapRatePedHE.png");
2093           cHE->Clear();
2094         }
2095         if (sub == 3) {
2096           cONE->Print("MapRatePedHO.png");
2097           cONE->Clear();
2098         }
2099         if (sub == 4) {
2100           cHF->Print("MapRatePedHF.png");
2101           cHF->Clear();
2102         }
2103       }
2104       if (test == 32) {
2105         if (sub == 1) {
2106           cHB->Print("MapRatePedWidthsHB.png");
2107           cHB->Clear();
2108         }
2109         if (sub == 2) {
2110           cHE->Print("MapRatePedWidthsHE.png");
2111           cHE->Clear();
2112         }
2113         if (sub == 3) {
2114           cONE->Print("MapRatePedWidthsHO.png");
2115           cONE->Clear();
2116         }
2117         if (sub == 4) {
2118           cHF->Print("MapRatePedWidthsHF.png");
2119           cHF->Clear();
2120         }
2121       }
2122 
2123       ///////////////////////////////////////////////
2124 
2125       cPED->Divide(2, 2);
2126       for (int cap = 0; cap <= 3; cap++) {
2127         cPED->cd(cap + 1);
2128         gPad->SetGridy();
2129         gPad->SetGridx();
2130         gPad->SetLogy();
2131 
2132         if (sub == 1)
2133           sprintf(str, "HB, Cap%d, all depth\b", cap);
2134         if (sub == 2)
2135           sprintf(str, "HE, Cap%d, all depth\b", cap);
2136         if (sub == 3)
2137           sprintf(str, "HO, Cap%d, all depth\b", cap);
2138         if (sub == 4)
2139           sprintf(str, "HF, Cap%d, all depth\b", cap);
2140 
2141         HistPed[test - 30][sub][cap]->SetTitle(str);
2142 
2143         if (test == 31)
2144           HistPed[test - 30][sub][cap]->SetXTitle("Pedestals in each event & cell \b");
2145         if (test == 32)
2146           HistPed[test - 30][sub][cap]->SetXTitle("Pedestal Widths in each event & cell \b");
2147 
2148         HistPed[test - 30][sub][cap]->SetYTitle("Number of channel-events \b");
2149         HistPed[test - 30][sub][cap]->SetLineColor(4);
2150         HistPed[test - 30][sub][cap]->SetLineWidth(2);
2151         HistPed[test - 30][sub][cap]->SetTitleOffset(1.4, "Y");
2152         HistPed[test - 30][sub][cap]->Draw("");
2153         //            HistPed[test-30][sub][cap]->GetYaxis()->SetRangeUser(1., 100.);
2154         //            if (test==31) {gPad->SetLogx(); HistPed[test-30][sub][cap]->GetXaxis()->SetRangeUser(1., 10000.);}
2155         //            if (test==32) HistPed[test-30][sub][cap]->GetXaxis()->SetRangeUser(0., 5.);
2156 
2157         cPED->Modified();
2158         cPED->Update();
2159         double min_x[] = {Pedest[test - 31][sub], Pedest[test - 31][sub]};
2160         double min_y[] = {0., 100000000.};
2161         TGraph* MIN = new TGraph(2, min_x, min_y);
2162         MIN->SetLineStyle(2);
2163         MIN->SetLineColor(2);
2164         MIN->SetLineWidth(2 + 100 * 100);
2165         MIN->SetFillStyle(3005);
2166         MIN->SetFillColor(2);
2167         MIN->Draw("L");
2168       }
2169       if (test == 31) {
2170         if (sub == 1) {
2171           cPED->Print("HistPedestalsHB.png");
2172           cPED->Clear();
2173         }
2174         if (sub == 2) {
2175           cPED->Print("HistPedestalsHE.png");
2176           cPED->Clear();
2177         }
2178         if (sub == 3) {
2179           cPED->Print("HistPedestalsHO.png");
2180           cPED->Clear();
2181         }
2182         if (sub == 4) {
2183           cPED->Print("HistPedestalsHF.png");
2184           cPED->Clear();
2185         }
2186       }
2187       if (test == 32) {
2188         if (sub == 1) {
2189           cPED->Print("HistPedestalWidthsHB.png");
2190           cPED->Clear();
2191         }
2192         if (sub == 2) {
2193           cPED->Print("HistPedestalWidthsHE.png");
2194           cPED->Clear();
2195         }
2196         if (sub == 3) {
2197           cPED->Print("HistPedestalWidthsHO.png");
2198           cPED->Clear();
2199         }
2200         if (sub == 4) {
2201           cPED->Print("HistPedestalWidthsHF.png");
2202           cPED->Clear();
2203         }
2204       }
2205     }  // end sub
2206   }    //end test 31,32
2207 
2208   //+++++++++++++++++++++++++++++++++++
2209   //Test 33 Correlation of Pedestal, pedestalWidths Vs fullAmplitude
2210   //++++++++++++++++++++++++++++++++++++
2211 
2212   cPED->Clear();
2213   Map_Ped[1][1] = (TH2F*)dir->FindObjectAny("h2_pedvsampl_HB");
2214   Map_Ped[1][2] = (TH2F*)dir->FindObjectAny("h2_pedvsampl_HE");
2215   Map_Ped[1][3] = (TH2F*)dir->FindObjectAny("h2_pedvsampl_HO");
2216   Map_Ped[1][4] = (TH2F*)dir->FindObjectAny("h2_pedvsampl_HF");
2217   Map_Ped[2][1] = (TH2F*)dir->FindObjectAny("h2_pedwvsampl_HB");
2218   Map_Ped[2][2] = (TH2F*)dir->FindObjectAny("h2_pedwvsampl_HE");
2219   Map_Ped[2][3] = (TH2F*)dir->FindObjectAny("h2_pedwvsampl_HO");
2220   Map_Ped[2][4] = (TH2F*)dir->FindObjectAny("h2_pedwvsampl_HF");
2221   for (int sub = 1; sub <= 4; sub++) {  //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
2222     cPED->Divide(2, 1);
2223     for (int test = 1; test <= 2; test++) {
2224       cPED->cd(test);
2225       gPad->SetGridy();
2226       gPad->SetGridx();
2227       gPad->SetLogz();
2228       if (test == 1)
2229         Map_Ped[test][sub]->SetXTitle("Pedestal, fC \b");
2230       if (test == 2)
2231         Map_Ped[test][sub]->SetXTitle("pedestal Width, fC \b");
2232       Map_Ped[test][sub]->SetYTitle("Amplitude, fC \b");
2233       Map_Ped[test][sub]->SetZTitle("entries  \b");
2234       if (test == 1)
2235         sprintf(str, "Cap0 Pedestal vs Amplitude \b");
2236       if (test == 2)
2237         sprintf(str, "Cap0 pedestalWidth vs Amplitude \b");
2238       Map_Ped[test][sub]->SetTitle(str);
2239       Map_Ped[test][sub]->Draw("COLZ");
2240       // Map_Ped[test][sub]->GetYaxis()->SetRangeUser(0, 72.);
2241       //      Map_Ped[test][sub]->GetZaxis()->SetRangeUser(0.0001, 1.);
2242       cPED->Modified();
2243       cPED->Update();
2244     }  // test 1,2
2245     if (sub == 1) {
2246       cPED->Print("CorrelationsMapPedestalVsfullAmplitudeHB.png");
2247       cPED->Clear();
2248     }
2249     if (sub == 2) {
2250       cPED->Print("CorrelationsMapPedestalVsfullAmplitudeHE.png");
2251       cPED->Clear();
2252     }
2253     if (sub == 3) {
2254       cPED->Print("CorrelationsMapPedestalVsfullAmplitudeHO.png");
2255       cPED->Clear();
2256     }
2257     if (sub == 4) {
2258       cPED->Print("CorrelationsMapPedestalVsfullAmplitudeHF.png");
2259       cPED->Clear();
2260     }
2261   }  // end sub
2262 
2263   //+++++++++++++++++++++++++++++++++++
2264   //Test 41 Time Slices shape for good and bad channels
2265   //++++++++++++++++++++++++++++++++++++
2266 
2267   cONE->Clear();
2268   hist_GoodTSshape[1] = (TH1F*)dir->FindObjectAny("h_shape_good_channels_HB");
2269   hist_GoodTSshape[2] = (TH1F*)dir->FindObjectAny("h_shape_good_channels_HE");
2270   hist_GoodTSshape[3] = (TH1F*)dir->FindObjectAny("h_shape_good_channels_HO");
2271   hist_GoodTSshape[4] = (TH1F*)dir->FindObjectAny("h_shape_good_channels_HF");
2272 
2273   hist_GoodTSshape0[1] = (TH1F*)dir->FindObjectAny("h_shape0_good_channels_HB");
2274   hist_GoodTSshape0[2] = (TH1F*)dir->FindObjectAny("h_shape0_good_channels_HE");
2275   hist_GoodTSshape0[3] = (TH1F*)dir->FindObjectAny("h_shape0_good_channels_HO");
2276   hist_GoodTSshape0[4] = (TH1F*)dir->FindObjectAny("h_shape0_good_channels_HF");
2277 
2278   hist_BadTSshape[1] = (TH1F*)dir->FindObjectAny("h_shape_bad_channels_HB");
2279   hist_BadTSshape[2] = (TH1F*)dir->FindObjectAny("h_shape_bad_channels_HE");
2280   hist_BadTSshape[3] = (TH1F*)dir->FindObjectAny("h_shape_bad_channels_HO");
2281   hist_BadTSshape[4] = (TH1F*)dir->FindObjectAny("h_shape_bad_channels_HF");
2282 
2283   hist_BadTSshape0[1] = (TH1F*)dir->FindObjectAny("h_shape0_bad_channels_HB");
2284   hist_BadTSshape0[2] = (TH1F*)dir->FindObjectAny("h_shape0_bad_channels_HE");
2285   hist_BadTSshape0[3] = (TH1F*)dir->FindObjectAny("h_shape0_bad_channels_HO");
2286   hist_BadTSshape0[4] = (TH1F*)dir->FindObjectAny("h_shape0_bad_channels_HF");
2287 
2288   cONE->cd(1);
2289 
2290   for (int sub = 1; sub <= 4; sub++) {  //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
2291 
2292     gPad->SetGridy();
2293     gPad->SetGridx();
2294     gPad->SetLogz();
2295     hist_GoodTSshape[sub]->Divide(hist_GoodTSshape[sub], hist_GoodTSshape0[sub], 1, 1, "B");
2296     hist_GoodTSshape[sub]->SetXTitle("Time slice \b");
2297     hist_GoodTSshape[sub]->SetYTitle("ADC counts \b");
2298     sprintf(str, "Mean ADC Shape \b");
2299     hist_GoodTSshape[sub]->SetTitle(str);
2300     hist_GoodTSshape[sub]->Draw("");
2301     // hist_GoodTSshape[sub]->GetYaxis()->SetRangeUser(0, 72.);
2302     // hist_GoodTSshape[sub]->GetZaxis()->SetRangeUser(0.0001, 1.);
2303     cONE->Modified();
2304     cONE->Update();
2305     if (sub == 1) {
2306       cONE->Print("HistGoodTSshapesHB.png");
2307       cONE->Clear();
2308     }
2309     if (sub == 2) {
2310       cONE->Print("HistGoodTSshapesHE.png");
2311       cONE->Clear();
2312     }
2313     if (sub == 3) {
2314       cONE->Print("HistGoodTSshapesHO.png");
2315       cONE->Clear();
2316     }
2317     if (sub == 4) {
2318       cONE->Print("HistGoodTSshapesHF.png");
2319       cONE->Clear();
2320     }
2321   }  // end sub
2322 
2323   for (int sub = 1; sub <= 4; sub++) {  //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
2324 
2325     gPad->SetGridy();
2326     gPad->SetGridx();
2327     gPad->SetLogz();
2328     hist_BadTSshape[sub]->Divide(hist_BadTSshape[sub], hist_BadTSshape0[sub], 1, 1, "B");
2329     hist_BadTSshape[sub]->SetXTitle("Time slice \b");
2330     hist_BadTSshape[sub]->SetYTitle("ADC counts \b");
2331     sprintf(str, "Mean ADC Shape \b");
2332     hist_BadTSshape[sub]->SetTitle(str);
2333     hist_BadTSshape[sub]->Draw("");
2334     // hist_BadTSshape[sub]->GetYaxis()->SetRangeUser(0, 72.);
2335     // hist_BadTSshape[sub]->GetZaxis()->SetRangeUser(0.0001, 1.);
2336     cONE->Modified();
2337     cONE->Update();
2338     if (sub == 1) {
2339       cONE->Print("HistBadTSshapesHB.png");
2340       cONE->Clear();
2341     }
2342     if (sub == 2) {
2343       cONE->Print("HistBadTSshapesHE.png");
2344       cONE->Clear();
2345     }
2346     if (sub == 3) {
2347       cONE->Print("HistBadTSshapesHO.png");
2348       cONE->Clear();
2349     }
2350     if (sub == 4) {
2351       cONE->Print("HistBadTSshapesHF.png");
2352       cONE->Clear();
2353     }
2354   }  // end sub
2355 
2356   /*
2357  //+++++++++++++++++++++++++++++++++++  
2358 //Test 42 ADC in TS distributions   
2359 //++++++++++++++++++++++++++++++++++++
2360  
2361 std::cout<<" We are here to print ADC "<<std::endl; 
2362 
2363   hist_ADC_All[1] = (TH1F*)dir->FindObjectAny("h_ADC_HB");
2364   hist_ADC_All[2] = (TH1F*)dir->FindObjectAny("h_ADC_HE");
2365   hist_ADC_All[3] = (TH1F*)dir->FindObjectAny("h_ADC_HO");
2366   hist_ADC_All[4] = (TH1F*)dir->FindObjectAny("h_ADC_HF");
2367 
2368 
2369   hist_ADC_DS[1][1] = (TH1F*)dir->FindObjectAny("h_ADC_HBdepth1");
2370   hist_ADC_DS[1][2] = (TH1F*)dir->FindObjectAny("h_ADC_HBdepth2");
2371   hist_ADC_DS[2][1] = (TH1F*)dir->FindObjectAny("h_ADC_HEdepth1");
2372   hist_ADC_DS[2][2] = (TH1F*)dir->FindObjectAny("h_ADC_HEdepth2");
2373   hist_ADC_DS[2][3] = (TH1F*)dir->FindObjectAny("h_ADC_HEdepth3");
2374   hist_ADC_DS[3][4] = (TH1F*)dir->FindObjectAny("h_ADC_HOdepth4");
2375   hist_ADC_DS[4][1] = (TH1F*)dir->FindObjectAny("h_ADC_HFdepth1");
2376   hist_ADC_DS[4][2] = (TH1F*)dir->FindObjectAny("h_ADC_HFdepth2");
2377 
2378 
2379   cONE->Clear();   
2380   cONE->Divide(1,1);
2381   cONE->cd(1);
2382 
2383   for (int sub=1;sub<=4;sub++) {  //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF         
2384       gPad->SetGridy();
2385       gPad->SetGridx();
2386       gPad->SetLogy();
2387       hist_ADC_All[sub]->SetXTitle("ADC counts \b");
2388       hist_ADC_All[sub]->SetYTitle("Number of channels-events \b");
2389       if (sub==1) sprintf(str,"ADC counts Distribution HB\b");
2390       if (sub==2) sprintf(str,"ADC counts Distribution HE\b");
2391       if (sub==3) sprintf(str,"ADC counts Distribution HO\b");
2392       if (sub==4) sprintf(str,"ADC counts Distribution HF\b");
2393       hist_ADC_All[sub]->SetTitle(str);
2394       hist_ADC_All[sub]->Draw("");
2395       // hist_ADC_All[sub]->GetYaxis()->SetRangeUser(0, 72.);
2396       hist_ADC_All[sub]->GetXaxis()->SetRangeUser(0.000, 1000.);
2397       cONE->Modified(); cONE->Update();
2398       if (sub==1) {cONE->Print("Hist_ADC_HB_All.png"); cONE->Clear();} 
2399       if (sub==2) {cONE->Print("Hist_ADC_HE_All.png"); cONE->Clear();}
2400       if (sub==3) {cONE->Print("Hist_ADC_HO_All.png"); cONE->Clear();}
2401       if (sub==4) {cONE->Print("Hist_ADC_HF_All.png"); cONE->Clear();} 
2402   }// end sub      
2403   
2404 
2405   for (int sub=1;sub<=4;sub++) {  //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
2406           if (sub==1) cHB->Divide(2,1);
2407           if (sub==2) cHE->Divide(3,1);
2408           if (sub==3) cONE->Divide(1,1);
2409           if (sub==4) cHB->Divide(2,1);
2410           int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
2411           int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet    
2412           for (int k=k_min[sub];k<=k_max[sub];k++) {  //Depths 
2413               if (sub==1) cHB->cd(k); 
2414               if (sub==2) cHE->cd(k);
2415           if (sub==3) cONE->cd(k-3);
2416           if (sub==4) cHB->cd(k); 
2417               gPad->SetGridy();
2418               gPad->SetGridx();
2419               gPad->SetLogy();
2420               hist_ADC_DS[sub][k]->SetXTitle("ADC counts \b");
2421               hist_ADC_DS[sub][k]->SetYTitle("Number of channels-events \b");
2422               if (sub==1) sprintf(str,"HB, Depth%d \b", k);
2423               if (sub==2) sprintf(str,"HE, Depth%d \b", k);
2424               if (sub==3) sprintf(str,"HO, Depth%d \b", k);
2425               if (sub==4) sprintf(str,"HF, Depth%d \b", k); 
2426               hist_ADC_DS[sub][k]->SetTitle(str);
2427               hist_ADC_DS[sub][k]->Draw("");
2428            // hist_ADC_DS[sub][k]->GetYaxis()->SetRangeUser(0, 72.);
2429               hist_ADC_DS[sub][k]->GetXaxis()->SetRangeUser(0.000, 1000.);
2430               if (sub==1) {cHB->Modified(); cHB->Update();} 
2431               if (sub==2) {cHE->Modified(); cHE->Update();}
2432               if (sub==3) {cONE->Modified();cONE->Update();}
2433               if (sub==4) {cHB->Modified(); cHB->Update();} 
2434           }//end depth    
2435       if (sub==1) {cHB->Print("Hist_ADC_HB_DS.png"); cHB->Clear();} 
2436           if (sub==2) {cHE->Print("Hist_ADC_HE_DS.png"); cHE->Clear();}
2437           if (sub==3) {cONE->Print("Hist_ADC_HO_DS.png"); cONE->Clear();}
2438           if (sub==4) {cHB->Print("Hist_ADC_HF_DS.png"); cHB->Clear();} 
2439   }// end sub
2440 
2441 
2442  //+++++++++++++++++++++++++++++++++++  
2443 //Test 43 Sum ADC in TS distributions   
2444 //++++++++++++++++++++++++++++++++++++
2445 
2446   hist_SumADC[1][1] = (TH1F*)dir->FindObjectAny("h_sumamplitude_depth1_HB");
2447   hist_SumADC[1][2] = (TH1F*)dir->FindObjectAny("h_sumamplitude_depth2_HB");
2448   hist_SumADC[2][1] = (TH1F*)dir->FindObjectAny("h_sumamplitude_depth1_HE");
2449   hist_SumADC[2][2] = (TH1F*)dir->FindObjectAny("h_sumamplitude_depth2_HE");
2450   hist_SumADC[2][3] = (TH1F*)dir->FindObjectAny("h_sumamplitude_depth3_HE");
2451   hist_SumADC[3][4] = (TH1F*)dir->FindObjectAny("h_sumamplitude_depth4_HO");
2452   hist_SumADC[4][1] = (TH1F*)dir->FindObjectAny("h_sumamplitude_depth1_HF");
2453   hist_SumADC[4][2] = (TH1F*)dir->FindObjectAny("h_sumamplitude_depth2_HF");
2454 
2455   hist_SumADC0[1][1] = (TH1F*)dir->FindObjectAny("h_sumamplitude_depth1_HB0");
2456   hist_SumADC0[1][2] = (TH1F*)dir->FindObjectAny("h_sumamplitude_depth2_HB0");
2457   hist_SumADC0[2][1] = (TH1F*)dir->FindObjectAny("h_sumamplitude_depth1_HE0");
2458   hist_SumADC0[2][2] = (TH1F*)dir->FindObjectAny("h_sumamplitude_depth2_HE0");
2459   hist_SumADC0[2][3] = (TH1F*)dir->FindObjectAny("h_sumamplitude_depth3_HE0");
2460   hist_SumADC0[3][4] = (TH1F*)dir->FindObjectAny("h_sumamplitude_depth4_HO0");
2461   hist_SumADC0[4][1] = (TH1F*)dir->FindObjectAny("h_sumamplitude_depth1_HF0");
2462   hist_SumADC0[4][2] = (TH1F*)dir->FindObjectAny("h_sumamplitude_depth2_HF0");
2463 
2464   hist_SumADC1[1][1] = (TH1F*)dir->FindObjectAny("h_sumamplitude_depth1_HB1");
2465   hist_SumADC1[1][2] = (TH1F*)dir->FindObjectAny("h_sumamplitude_depth2_HB1");
2466   hist_SumADC1[2][1] = (TH1F*)dir->FindObjectAny("h_sumamplitude_depth1_HE1");
2467   hist_SumADC1[2][2] = (TH1F*)dir->FindObjectAny("h_sumamplitude_depth2_HE1");
2468   hist_SumADC1[2][3] = (TH1F*)dir->FindObjectAny("h_sumamplitude_depth3_HE1");
2469   hist_SumADC1[3][4] = (TH1F*)dir->FindObjectAny("h_sumamplitude_depth4_HO1");
2470   hist_SumADC1[4][1] = (TH1F*)dir->FindObjectAny("h_sumamplitude_depth1_HF1");
2471   hist_SumADC1[4][2] = (TH1F*)dir->FindObjectAny("h_sumamplitude_depth2_HF1");
2472 
2473   for (int sub=1;sub<=4;sub++) {  //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
2474           if (sub==1) cHB->Divide(2,1);
2475           if (sub==2) cHE->Divide(3,1);
2476           if (sub==3) cONE->Divide(1,1);
2477           if (sub==4) cHB->Divide(2,1);
2478           int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
2479           int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet    
2480           for (int k=k_min[sub];k<=k_max[sub];k++) {  //Depths 
2481               if (sub==1) cHB->cd(k); 
2482               if (sub==2) cHE->cd(k);
2483           if (sub==3) cONE->cd(k-3);
2484           if (sub==4) cHB->cd(k); 
2485               gPad->SetGridy();
2486               gPad->SetGridx();
2487               gPad->SetLogy();
2488               hist_SumADC[sub][k]->SetXTitle("ADC sum \b");
2489               hist_SumADC[sub][k]->SetYTitle("Number of channels-events \b");
2490               if (sub==1) sprintf(str,"HB, Depth%d \b", k);
2491               if (sub==2) sprintf(str,"HE, Depth%d \b", k);
2492               if (sub==3) sprintf(str,"HO, Depth%d \b", k);
2493               if (sub==4) sprintf(str,"HF, Depth%d \b", k); 
2494               hist_SumADC[sub][k]->SetTitle(str);
2495               hist_SumADC[sub][k]->Draw("");
2496            // hist_SumADC[sub][k]->GetYaxis()->SetRangeUser(0, 72.);
2497            // hist_SumADC[sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
2498               if (sub==1) {cHB->Modified(); cHB->Update();} 
2499               if (sub==2) {cHE->Modified(); cHE->Update();}
2500               if (sub==3) {cONE->Modified();cONE->Update();}
2501               if (sub==4) {cHB->Modified(); cHB->Update();} 
2502           }//end depth    
2503       if (sub==1) {cHB->Print("Hist_SumADC_HB.png"); cHB->Clear();} 
2504           if (sub==2) {cHE->Print("Hist_SumADC_HE.png"); cHE->Clear();}
2505           if (sub==3) {cONE->Print("Hist_SumADC_HO.png"); cONE->Clear();}
2506           if (sub==4) {cHB->Print("Hist_SumADC_HF.png"); cHB->Clear();} 
2507   }// end sub
2508 
2509 
2510   for (int sub=1;sub<=4;sub++) {  //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
2511           if (sub==1) cHB->Divide(2,1);
2512           if (sub==2) cHE->Divide(3,1);
2513           if (sub==3) cONE->Divide(1,1);
2514           if (sub==4) cHB->Divide(2,1);
2515           int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
2516           int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet    
2517           for (int k=k_min[sub];k<=k_max[sub];k++) {  //Depths 
2518               if (sub==1) cHB->cd(k); 
2519               if (sub==2) cHE->cd(k);
2520           if (sub==3) cONE->cd(k-3);
2521           if (sub==4) cHB->cd(k); 
2522               gPad->SetGridy();
2523               gPad->SetGridx();
2524               gPad->SetLogy();
2525               hist_SumADC0[sub][k]->SetXTitle("ADC sum \b");
2526               hist_SumADC0[sub][k]->SetYTitle("Number of channels-events \b");
2527               if (sub==1) sprintf(str,"HB, Depth%d \b", k);
2528               if (sub==2) sprintf(str,"HE, Depth%d \b", k);
2529               if (sub==3) sprintf(str,"HO, Depth%d \b", k);
2530               if (sub==4) sprintf(str,"HF, Depth%d \b", k); 
2531               hist_SumADC0[sub][k]->SetTitle(str);
2532               hist_SumADC0[sub][k]->Draw("");
2533            // hist_SumADC0[sub][k]->GetYaxis()->SetRangeUser(0, 72.);
2534            // hist_SumADC0[sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
2535               if (sub==1) {cHB->Modified(); cHB->Update();} 
2536               if (sub==2) {cHE->Modified(); cHE->Update();}
2537               if (sub==3) {cONE->Modified();cONE->Update();}
2538               if (sub==4) {cHB->Modified(); cHB->Update();} 
2539           }//end depth    
2540       if (sub==1) {cHB->Print("Hist_SumADC_HB0.png"); cHB->Clear();} 
2541           if (sub==2) {cHE->Print("Hist_SumADC_HE0.png"); cHE->Clear();}
2542           if (sub==3) {cONE->Print("Hist_SumADC_HO0.png"); cONE->Clear();}
2543           if (sub==4) {cHB->Print("Hist_SumADC_HF0.png"); cHB->Clear();} 
2544   }// end sub
2545 
2546   for (int sub=1;sub<=4;sub++) {  //Subdetector: 1-HB, 2-HE, 3-HO, 4-HF
2547           if (sub==1) cHB->Divide(2,1);
2548           if (sub==2) cHE->Divide(3,1);
2549           if (sub==3) cONE->Divide(1,1);
2550           if (sub==4) cHB->Divide(2,1);
2551           int k_min[5]={0,1,1,4,1}; // minimum depth for each subdet
2552           int k_max[5]={0,2,3,4,2}; // maximum depth for each subdet    
2553           for (int k=k_min[sub];k<=k_max[sub];k++) {  //Depths 
2554               if (sub==1) cHB->cd(k); 
2555               if (sub==2) cHE->cd(k);
2556           if (sub==3) cONE->cd(k-3);
2557           if (sub==4) cHB->cd(k); 
2558               gPad->SetGridy();
2559               gPad->SetGridx();
2560               gPad->SetLogy();
2561               hist_SumADC1[sub][k]->SetXTitle("ADC sum \b");
2562               hist_SumADC1[sub][k]->SetYTitle("Number of channels-events \b");
2563               if (sub==1) sprintf(str,"HB, Depth%d \b", k);
2564               if (sub==2) sprintf(str,"HE, Depth%d \b", k);
2565               if (sub==3) sprintf(str,"HO, Depth%d \b", k);
2566               if (sub==4) sprintf(str,"HF, Depth%d \b", k); 
2567               hist_SumADC1[sub][k]->SetTitle(str);
2568               hist_SumADC1[sub][k]->Draw("");
2569            // hist_SumADC1[sub][k]->GetYaxis()->SetRangeUser(0, 72.);
2570            // hist_SumADC1[sub][k]->GetZaxis()->SetRangeUser(0.0001, 1.);
2571               if (sub==1) {cHB->Modified(); cHB->Update();} 
2572               if (sub==2) {cHE->Modified(); cHE->Update();}
2573               if (sub==3) {cONE->Modified();cONE->Update();}
2574               if (sub==4) {cHB->Modified(); cHB->Update();} 
2575           }//end depth    
2576       if (sub==1) {cHB->Print("Hist_SumADC_HB1.png"); cHB->Clear();} 
2577           if (sub==2) {cHE->Print("Hist_SumADC_HE1.png"); cHE->Clear();}
2578           if (sub==3) {cONE->Print("Hist_SumADC_HO1.png"); cONE->Clear();}
2579           if (sub==4) {cHB->Print("Hist_SumADC_HF1.png"); cHB->Clear();} 
2580   }// end sub
2581 
2582 */
2583 
2584   /////////////  /////////////  /////////////  /////////////  /////////////  ////////////////////         phi-symmetry for Calibration Group:
2585   /////////////  /////////////  /////////////  ////////////  /////////////  /////////////////////         Phi-symmetry for Calibration Group:
2586   /////////////  /////////////  /////////////  ////////////  /////////////  /////////////////////         Phi-symmetry for Calibration Group:
2587   /////////////  /////////////  /////////////  ///////////  /////////////  //////////////////////         Phi-symmetry for Calibration Group:
2588   /////////////  /////////////  /////////////  ///////////  /////////////  //////////////////////         Phi-symmetry for Calibration Group:
2589 
2590   /*
2591     depth=5                    all
2592     i=1-82 in initial histo
2593     j=i-1 in massives
2594     
2595     j= 13   23 (11)           12    25 (!!!)
2596     j-41 in histo
2597     -28  -18 (11)          -29    -16
2598     
2599     j= 59   69 (11)           57    70 (!!!)
2600     j-41 in histo
2601     18   28 (11)           16    29
2602   */
2603 
2604   const int nsub = 4;
2605   const int neta = 82;
2606   const int nphi = 72;
2607   int njeta = neta;
2608   int njphi = nphi;
2609   //const int ndepth = 7;
2610   int ndepth;
2611   /////////////   ///////////// //////////////////////////  /////////////  /////////////  /////////////  /////////////  /////////////  ////////////////////         Phi-symmetry for Calibration Group:
2612   /////////////  /////////////  //////////////////////////  /////////////  /////////////  /////////////  /////////////  ////////////////////         Phi-symmetry for Calibration Group:
2613   /////////////  /////////////  /////////////  /////////////  /////////////  /////////////  /////////////  ////////////////////         Phi-symmetry for Calibration Group:
2614 
2615   //////////////////////////////////////////////////////////////////////////////////////////////////// Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi
2616   //////////////////////////////////////////////////////////////////////////////////////////////////// Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi
2617   //////////////////////////////////////////////////////////////////////////////////////////////////// Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi
2618   //////////////////////////////////////////////////////////////////////////////////////////////////// Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi  Digi
2619   ////////////////////////////////////////////////////////////////////////////////////////////////////     Digi HB
2620   ////////////////////////////////////////////////////////////////////////////////////////////////////     Digi HB
2621   ////////////////////////////////////////////////////////////////////////////////////////////////////     Digi HB
2622   //  int k_max[5]={0,4,7,4,4}; // maximum depth for each subdet
2623   //ndepth = k_max[5];
2624   ndepth = 4;
2625   double adigiHB[ndepth][njeta][njphi];
2626   double digivarianceHB[ndepth][njeta][njphi];
2627   //                                   RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR:   Digi HB
2628   TH2F* amplitudechannel1HB1 = (TH2F*)dir->FindObjectAny("h_amplitudechannel1_HB1");
2629   TH2F* amplitudechannel0HB1 = (TH2F*)dir->FindObjectAny("h_amplitudechannel0_HB1");
2630   TH2F* amplitudechannelHB1 = (TH2F*)amplitudechannel1HB1->Clone("amplitudechannelHB1");
2631   amplitudechannelHB1->Divide(amplitudechannel1HB1, amplitudechannel0HB1, 1, 1, "B");
2632   TH2F* amplitudechannel1HB2 = (TH2F*)dir->FindObjectAny("h_amplitudechannel1_HB2");
2633   TH2F* amplitudechannel0HB2 = (TH2F*)dir->FindObjectAny("h_amplitudechannel0_HB2");
2634   TH2F* amplitudechannelHB2 = (TH2F*)amplitudechannel1HB2->Clone("amplitudechannelHB2");
2635   amplitudechannelHB2->Divide(amplitudechannel1HB2, amplitudechannel0HB2, 1, 1, "B");
2636   TH2F* amplitudechannel1HB3 = (TH2F*)dir->FindObjectAny("h_amplitudechannel1_HB3");
2637   TH2F* amplitudechannel0HB3 = (TH2F*)dir->FindObjectAny("h_amplitudechannel0_HB3");
2638   TH2F* amplitudechannelHB3 = (TH2F*)amplitudechannel1HB3->Clone("amplitudechannelHB3");
2639   amplitudechannelHB3->Divide(amplitudechannel1HB3, amplitudechannel0HB3, 1, 1, "B");
2640   TH2F* amplitudechannel1HB4 = (TH2F*)dir->FindObjectAny("h_amplitudechannel1_HB4");
2641   TH2F* amplitudechannel0HB4 = (TH2F*)dir->FindObjectAny("h_amplitudechannel0_HB4");
2642   TH2F* amplitudechannelHB4 = (TH2F*)amplitudechannel1HB4->Clone("amplitudechannelHB4");
2643   amplitudechannelHB4->Divide(amplitudechannel1HB4, amplitudechannel0HB4, 1, 1, "B");
2644   for (int jeta = 0; jeta < njeta; jeta++) {
2645     //====================================================================== PHI normalization & put R into massive adigiHB
2646     //preparation for PHI normalization:
2647     double sumdigiHB0 = 0;
2648     int nsumdigiHB0 = 0;
2649     double sumdigiHB1 = 0;
2650     int nsumdigiHB1 = 0;
2651     double sumdigiHB2 = 0;
2652     int nsumdigiHB2 = 0;
2653     double sumdigiHB3 = 0;
2654     int nsumdigiHB3 = 0;
2655     for (int jphi = 0; jphi < njphi; jphi++) {
2656       adigiHB[0][jeta][jphi] = amplitudechannelHB1->GetBinContent(jeta + 1, jphi + 1);
2657       adigiHB[1][jeta][jphi] = amplitudechannelHB2->GetBinContent(jeta + 1, jphi + 1);
2658       adigiHB[2][jeta][jphi] = amplitudechannelHB3->GetBinContent(jeta + 1, jphi + 1);
2659       adigiHB[3][jeta][jphi] = amplitudechannelHB4->GetBinContent(jeta + 1, jphi + 1);
2660       if (adigiHB[0][jeta][jphi] > 0.) {
2661         sumdigiHB0 += adigiHB[0][jeta][jphi];
2662         ++nsumdigiHB0;
2663       }
2664       if (adigiHB[1][jeta][jphi] > 0.) {
2665         sumdigiHB1 += adigiHB[1][jeta][jphi];
2666         ++nsumdigiHB1;
2667       }
2668       if (adigiHB[2][jeta][jphi] > 0.) {
2669         sumdigiHB2 += adigiHB[2][jeta][jphi];
2670         ++nsumdigiHB2;
2671       }
2672       if (adigiHB[3][jeta][jphi] > 0.) {
2673         sumdigiHB3 += adigiHB[3][jeta][jphi];
2674         ++nsumdigiHB3;
2675       }
2676     }  // phi
2677     // PHI normalization:
2678     for (int jphi = 0; jphi < njphi; jphi++) {
2679       if (adigiHB[0][jeta][jphi] > 0.)
2680         adigiHB[0][jeta][jphi] /= (sumdigiHB0 / nsumdigiHB0);
2681       if (adigiHB[1][jeta][jphi] > 0.)
2682         adigiHB[1][jeta][jphi] /= (sumdigiHB1 / nsumdigiHB1);
2683       if (adigiHB[2][jeta][jphi] > 0.)
2684         adigiHB[2][jeta][jphi] /= (sumdigiHB2 / nsumdigiHB2);
2685       if (adigiHB[3][jeta][jphi] > 0.)
2686         adigiHB[3][jeta][jphi] /= (sumdigiHB3 / nsumdigiHB3);
2687     }  // phi
2688   }    //eta
2689   //------------------------  2D-eta/phi-plot: R, averaged over depthfs
2690   //======================================================================
2691   //======================================================================
2692   //cout<<"      R2D-eta/phi-plot: R, averaged over depthfs *****" <<endl;
2693   c1x0->Clear();
2694   /////////////////
2695   c1x0->Divide(1, 1);
2696   c1x0->cd(1);
2697   TH2F* GefzRdigiHB42D = new TH2F("GefzRdigiHB42D", "", neta, -41., 41., nphi, 0., 72.);
2698   TH2F* GefzRdigiHB42D0 = new TH2F("GefzRdigiHB42D0", "", neta, -41., 41., nphi, 0., 72.);
2699   TH2F* GefzRdigiHB42DF = (TH2F*)GefzRdigiHB42D0->Clone("GefzRdigiHB42DF");
2700   for (int i = 0; i < ndepth; i++) {
2701     for (int jeta = 0; jeta < neta; jeta++) {
2702       for (int jphi = 0; jphi < nphi; jphi++) {
2703         double ccc1 = adigiHB[i][jeta][jphi];
2704         int k2plot = jeta - 41;
2705         int kkk = k2plot;  //if(k2plot >0 ) kkk=k2plot+1; //-41 +41 !=0
2706         if (ccc1 != 0.) {
2707           GefzRdigiHB42D->Fill(kkk, jphi, ccc1);
2708           GefzRdigiHB42D0->Fill(kkk, jphi, 1.);
2709         }
2710       }
2711     }
2712   }
2713   GefzRdigiHB42DF->Divide(GefzRdigiHB42D, GefzRdigiHB42D0, 1, 1, "B");  // average A
2714   gPad->SetGridy();
2715   gPad->SetGridx();  //      gPad->SetLogz();
2716   GefzRdigiHB42DF->SetMarkerStyle(20);
2717   GefzRdigiHB42DF->SetMarkerSize(0.4);
2718   GefzRdigiHB42DF->GetZaxis()->SetLabelSize(0.08);
2719   GefzRdigiHB42DF->SetXTitle("<R>_depth       #eta  \b");
2720   GefzRdigiHB42DF->SetYTitle("      #phi \b");
2721   GefzRdigiHB42DF->SetZTitle("<R>_depth \b");
2722   GefzRdigiHB42DF->SetMarkerColor(2);
2723   GefzRdigiHB42DF->SetLineColor(
2724       0);  //      GefzRdigiHB42DF->SetMaximum(1.000);  //      GefzRdigiHB42DF->SetMinimum(1.0);
2725   GefzRdigiHB42DF->Draw("COLZ");
2726   /////////////////
2727   c1x0->Update();
2728   c1x0->Print("RdigiGeneralD2PhiSymmetryHB.png");
2729   c1x0->Clear();
2730   // clean-up
2731   if (GefzRdigiHB42D)
2732     delete GefzRdigiHB42D;
2733   if (GefzRdigiHB42D0)
2734     delete GefzRdigiHB42D0;
2735   if (GefzRdigiHB42DF)
2736     delete GefzRdigiHB42DF;
2737   //====================================================================== 1D plot: R vs phi , averaged over depthfs & eta
2738   //======================================================================
2739   //cout<<"      1D plot: R vs phi , averaged over depthfs & eta *****" <<endl;
2740   c1x1->Clear();
2741   /////////////////
2742   c1x1->Divide(1, 1);
2743   c1x1->cd(1);
2744   TH1F* GefzRdigiHB41D = new TH1F("GefzRdigiHB41D", "", nphi, 0., 72.);
2745   TH1F* GefzRdigiHB41D0 = new TH1F("GefzRdigiHB41D0", "", nphi, 0., 72.);
2746   TH1F* GefzRdigiHB41DF = (TH1F*)GefzRdigiHB41D0->Clone("GefzRdigiHB41DF");
2747   for (int jphi = 0; jphi < nphi; jphi++) {
2748     for (int jeta = 0; jeta < neta; jeta++) {
2749       for (int i = 0; i < ndepth; i++) {
2750         double ccc1 = adigiHB[i][jeta][jphi];
2751         if (ccc1 != 0.) {
2752           GefzRdigiHB41D->Fill(jphi, ccc1);
2753           GefzRdigiHB41D0->Fill(jphi, 1.);
2754         }
2755       }
2756     }
2757   }
2758   GefzRdigiHB41DF->Divide(GefzRdigiHB41D, GefzRdigiHB41D0, 1, 1, "B");  // R averaged over depthfs & eta
2759   GefzRdigiHB41D0->Sumw2();
2760   //    for (int jphi=1;jphi<73;jphi++) {GefzRdigiHB41DF->SetBinError(jphi,0.01);}
2761   gPad->SetGridy();
2762   gPad->SetGridx();  //      gPad->SetLogz();
2763   GefzRdigiHB41DF->SetMarkerStyle(20);
2764   GefzRdigiHB41DF->SetMarkerSize(1.4);
2765   GefzRdigiHB41DF->GetZaxis()->SetLabelSize(0.08);
2766   GefzRdigiHB41DF->SetXTitle("#phi  \b");
2767   GefzRdigiHB41DF->SetYTitle("  <R> \b");
2768   GefzRdigiHB41DF->SetZTitle("<R>_PHI  - AllDepthfs \b");
2769   GefzRdigiHB41DF->SetMarkerColor(4);
2770   GefzRdigiHB41DF->SetLineColor(
2771       4);  //  GefzRdigiHB41DF->SetMinimum(0.8);     //      GefzRdigiHB41DF->SetMaximum(1.000);
2772   GefzRdigiHB41DF->Draw("Error");
2773   /////////////////
2774   c1x1->Update();
2775   c1x1->Print("RdigiGeneralD1PhiSymmetryHB.png");
2776   c1x1->Clear();
2777   // clean-up
2778   if (GefzRdigiHB41D)
2779     delete GefzRdigiHB41D;
2780   if (GefzRdigiHB41D0)
2781     delete GefzRdigiHB41D0;
2782   if (GefzRdigiHB41DF)
2783     delete GefzRdigiHB41DF;
2784   //========================================================================================== 4
2785   //======================================================================
2786   //======================================================================1D plot: R vs phi , different eta,  depth=1
2787   //cout<<"      1D plot: R vs phi , different eta,  depth=1 *****" <<endl;
2788   c3x5->Clear();
2789   /////////////////
2790   c3x5->Divide(4, 4);
2791   c3x5->cd(1);
2792   int kcountHBpositivedirectionDigi1 = 1;
2793   TH1F* h2CeffHBpositivedirectionDigi1 = new TH1F("h2CeffHBpositivedirectionDigi1", "", nphi, 0., 72.);
2794   for (int jeta = 0; jeta < njeta; jeta++) {
2795     // positivedirectionDigi:
2796     if (jeta - 41 >= 0) {
2797       //         for (int i=0;i<ndepth;i++) {
2798       // depth=1
2799       for (int i = 0; i < 1; i++) {
2800         TH1F* HBpositivedirectionDigi1 = (TH1F*)h2CeffHBpositivedirectionDigi1->Clone("twod1");
2801         float ccctest = 0;  // to avoid empty massive elements
2802         for (int jphi = 0; jphi < nphi; jphi++) {
2803           double ccc1 = adigiHB[i][jeta][jphi];
2804           if (ccc1 != 0.) {
2805             HBpositivedirectionDigi1->Fill(jphi, ccc1);
2806             ccctest = 1.;  //HBpositivedirectionDigi1->SetBinError(i,0.01);
2807           }
2808         }  // for jphi
2809         if (ccctest > 0.) {
2810           //      cout<<"444        kcountHBpositivedirectionDigi1   =     "<<kcountHBpositivedirectionDigi1  <<"   jeta-41=     "<< jeta-41 <<endl;
2811           c3x5->cd(kcountHBpositivedirectionDigi1);
2812           HBpositivedirectionDigi1->SetMarkerStyle(20);
2813           HBpositivedirectionDigi1->SetMarkerSize(0.4);
2814           HBpositivedirectionDigi1->GetYaxis()->SetLabelSize(0.04);
2815           HBpositivedirectionDigi1->SetXTitle("HBpositivedirectionDigi1 \b");
2816           HBpositivedirectionDigi1->SetMarkerColor(2);
2817           HBpositivedirectionDigi1->SetLineColor(0);
2818           gPad->SetGridy();
2819           gPad->SetGridx();
2820           //       gPad->SetLogy();
2821           if (kcountHBpositivedirectionDigi1 == 1)
2822             HBpositivedirectionDigi1->SetXTitle("R for HB+ jeta =  0; depth = 1 \b");
2823           if (kcountHBpositivedirectionDigi1 == 2)
2824             HBpositivedirectionDigi1->SetXTitle("R for HB+ jeta =  1; depth = 1 \b");
2825           if (kcountHBpositivedirectionDigi1 == 3)
2826             HBpositivedirectionDigi1->SetXTitle("R for HB+ jeta =  2; depth = 1 \b");
2827           if (kcountHBpositivedirectionDigi1 == 4)
2828             HBpositivedirectionDigi1->SetXTitle("R for HB+ jeta =  3; depth = 1 \b");
2829           if (kcountHBpositivedirectionDigi1 == 5)
2830             HBpositivedirectionDigi1->SetXTitle("R for HB+ jeta =  4; depth = 1 \b");
2831           if (kcountHBpositivedirectionDigi1 == 6)
2832             HBpositivedirectionDigi1->SetXTitle("R for HB+ jeta =  5; depth = 1 \b");
2833           if (kcountHBpositivedirectionDigi1 == 7)
2834             HBpositivedirectionDigi1->SetXTitle("R for HB+ jeta =  6; depth = 1 \b");
2835           if (kcountHBpositivedirectionDigi1 == 8)
2836             HBpositivedirectionDigi1->SetXTitle("R for HB+ jeta =  7; depth = 1 \b");
2837           if (kcountHBpositivedirectionDigi1 == 9)
2838             HBpositivedirectionDigi1->SetXTitle("R for HB+ jeta =  8; depth = 1 \b");
2839           if (kcountHBpositivedirectionDigi1 == 10)
2840             HBpositivedirectionDigi1->SetXTitle("R for HB+ jeta =  9; depth = 1 \b");
2841           if (kcountHBpositivedirectionDigi1 == 11)
2842             HBpositivedirectionDigi1->SetXTitle("R for HB+ jeta = 10; depth = 1 \b");
2843           if (kcountHBpositivedirectionDigi1 == 12)
2844             HBpositivedirectionDigi1->SetXTitle("R for HB+ jeta = 11; depth = 1 \b");
2845           if (kcountHBpositivedirectionDigi1 == 13)
2846             HBpositivedirectionDigi1->SetXTitle("R for HB+ jeta = 12; depth = 1 \b");
2847           if (kcountHBpositivedirectionDigi1 == 14)
2848             HBpositivedirectionDigi1->SetXTitle("R for HB+ jeta = 13; depth = 1 \b");
2849           if (kcountHBpositivedirectionDigi1 == 15)
2850             HBpositivedirectionDigi1->SetXTitle("R for HB+ jeta = 14; depth = 1 \b");
2851           if (kcountHBpositivedirectionDigi1 == 16)
2852             HBpositivedirectionDigi1->SetXTitle("R for HB+ jeta = 15; depth = 1 \b");
2853           HBpositivedirectionDigi1->Draw("Error");
2854           kcountHBpositivedirectionDigi1++;
2855           if (kcountHBpositivedirectionDigi1 > 16)
2856             break;  //
2857         }           //ccctest>0
2858 
2859       }  // for i
2860     }    //if(jeta-41 >= 0)
2861   }      //for jeta
2862   /////////////////
2863   c3x5->Update();
2864   c3x5->Print("RdigiPositiveDirectionhistD1PhiSymmetryDepth1HB.png");
2865   c3x5->Clear();
2866   // clean-up
2867   if (h2CeffHBpositivedirectionDigi1)
2868     delete h2CeffHBpositivedirectionDigi1;
2869 
2870   //========================================================================================== 5
2871   //======================================================================
2872   //======================================================================1D plot: R vs phi , different eta,  depth=2
2873   //  cout<<"      1D plot: R vs phi , different eta,  depth=2 *****" <<endl;
2874   c3x5->Clear();
2875   /////////////////
2876   c3x5->Divide(4, 4);
2877   c3x5->cd(1);
2878   int kcountHBpositivedirectionDigi2 = 1;
2879   TH1F* h2CeffHBpositivedirectionDigi2 = new TH1F("h2CeffHBpositivedirectionDigi2", "", nphi, 0., 72.);
2880   for (int jeta = 0; jeta < njeta; jeta++) {
2881     // positivedirectionDigi:
2882     if (jeta - 41 >= 0) {
2883       //         for (int i=0;i<ndepth;i++) {
2884       // depth=2
2885       for (int i = 1; i < 2; i++) {
2886         TH1F* HBpositivedirectionDigi2 = (TH1F*)h2CeffHBpositivedirectionDigi2->Clone("twod1");
2887         float ccctest = 0;  // to avoid empty massive elements
2888         for (int jphi = 0; jphi < nphi; jphi++) {
2889           double ccc1 = adigiHB[i][jeta][jphi];
2890           if (ccc1 != 0.) {
2891             HBpositivedirectionDigi2->Fill(jphi, ccc1);
2892             ccctest = 1.;  //HBpositivedirectionDigi2->SetBinError(i,0.01);
2893           }
2894         }  // for jphi
2895         if (ccctest > 0.) {
2896           //cout<<"555        kcountHBpositivedirectionDigi2   =     "<<kcountHBpositivedirectionDigi2  <<"   jeta-41=     "<< jeta-41 <<endl;
2897           c3x5->cd(kcountHBpositivedirectionDigi2);
2898           HBpositivedirectionDigi2->SetMarkerStyle(20);
2899           HBpositivedirectionDigi2->SetMarkerSize(0.4);
2900           HBpositivedirectionDigi2->GetYaxis()->SetLabelSize(0.04);
2901           HBpositivedirectionDigi2->SetXTitle("HBpositivedirectionDigi2 \b");
2902           HBpositivedirectionDigi2->SetMarkerColor(2);
2903           HBpositivedirectionDigi2->SetLineColor(0);
2904           gPad->SetGridy();
2905           gPad->SetGridx();
2906           //       gPad->SetLogy();
2907           if (kcountHBpositivedirectionDigi2 == 1)
2908             HBpositivedirectionDigi2->SetXTitle("R for HB+ jeta =  0; depth = 2 \b");
2909           if (kcountHBpositivedirectionDigi2 == 2)
2910             HBpositivedirectionDigi2->SetXTitle("R for HB+ jeta =  1; depth = 2 \b");
2911           if (kcountHBpositivedirectionDigi2 == 3)
2912             HBpositivedirectionDigi2->SetXTitle("R for HB+ jeta =  2; depth = 2 \b");
2913           if (kcountHBpositivedirectionDigi2 == 4)
2914             HBpositivedirectionDigi2->SetXTitle("R for HB+ jeta =  3; depth = 2 \b");
2915           if (kcountHBpositivedirectionDigi2 == 5)
2916             HBpositivedirectionDigi2->SetXTitle("R for HB+ jeta =  4; depth = 2 \b");
2917           if (kcountHBpositivedirectionDigi2 == 6)
2918             HBpositivedirectionDigi2->SetXTitle("R for HB+ jeta =  5; depth = 2 \b");
2919           if (kcountHBpositivedirectionDigi2 == 7)
2920             HBpositivedirectionDigi2->SetXTitle("R for HB+ jeta =  6; depth = 2 \b");
2921           if (kcountHBpositivedirectionDigi2 == 8)
2922             HBpositivedirectionDigi2->SetXTitle("R for HB+ jeta =  7; depth = 2 \b");
2923           if (kcountHBpositivedirectionDigi2 == 9)
2924             HBpositivedirectionDigi2->SetXTitle("R for HB+ jeta =  8; depth = 2 \b");
2925           if (kcountHBpositivedirectionDigi2 == 10)
2926             HBpositivedirectionDigi2->SetXTitle("R for HB+ jeta =  9; depth = 2 \b");
2927           if (kcountHBpositivedirectionDigi2 == 11)
2928             HBpositivedirectionDigi2->SetXTitle("R for HB+ jeta = 10; depth = 2 \b");
2929           if (kcountHBpositivedirectionDigi2 == 12)
2930             HBpositivedirectionDigi2->SetXTitle("R for HB+ jeta = 11; depth = 2 \b");
2931           if (kcountHBpositivedirectionDigi2 == 13)
2932             HBpositivedirectionDigi2->SetXTitle("R for HB+ jeta = 12; depth = 2 \b");
2933           if (kcountHBpositivedirectionDigi2 == 14)
2934             HBpositivedirectionDigi2->SetXTitle("R for HB+ jeta = 13; depth = 2 \b");
2935           if (kcountHBpositivedirectionDigi2 == 15)
2936             HBpositivedirectionDigi2->SetXTitle("R for HB+ jeta = 14; depth = 2 \b");
2937           if (kcountHBpositivedirectionDigi2 == 16)
2938             HBpositivedirectionDigi2->SetXTitle("R for HB+ jeta = 15; depth = 2 \b");
2939           HBpositivedirectionDigi2->Draw("Error");
2940           kcountHBpositivedirectionDigi2++;
2941           if (kcountHBpositivedirectionDigi2 > 16)
2942             break;  // 4x6 = 24
2943         }           //ccctest>0
2944 
2945       }  // for i
2946     }    //if(jeta-41 >= 0)
2947   }      //for jeta
2948   /////////////////
2949   c3x5->Update();
2950   c3x5->Print("RdigiPositiveDirectionhistD1PhiSymmetryDepth2HB.png");
2951   c3x5->Clear();
2952   // clean-up
2953   if (h2CeffHBpositivedirectionDigi2)
2954     delete h2CeffHBpositivedirectionDigi2;
2955   //========================================================================================== 6
2956   //======================================================================
2957   //======================================================================1D plot: R vs phi , different eta,  depth=3
2958   //cout<<"      1D plot: R vs phi , different eta,  depth=3 *****" <<endl;
2959   c3x5->Clear();
2960   /////////////////
2961   c3x5->Divide(4, 4);
2962   c3x5->cd(1);
2963   int kcountHBpositivedirectionDigi3 = 1;
2964   TH1F* h2CeffHBpositivedirectionDigi3 = new TH1F("h2CeffHBpositivedirectionDigi3", "", nphi, 0., 72.);
2965   for (int jeta = 0; jeta < njeta; jeta++) {
2966     // positivedirectionDigi:
2967     if (jeta - 41 >= 0) {
2968       //         for (int i=0;i<ndepth;i++) {
2969       // depth=3
2970       for (int i = 2; i < 3; i++) {
2971         TH1F* HBpositivedirectionDigi3 = (TH1F*)h2CeffHBpositivedirectionDigi3->Clone("twod1");
2972         float ccctest = 0;  // to avoid empty massive elements
2973         for (int jphi = 0; jphi < nphi; jphi++) {
2974           double ccc1 = adigiHB[i][jeta][jphi];
2975           if (ccc1 != 0.) {
2976             HBpositivedirectionDigi3->Fill(jphi, ccc1);
2977             ccctest = 1.;  //HBpositivedirectionDigi3->SetBinError(i,0.01);
2978           }
2979         }  // for jphi
2980         if (ccctest > 0.) {
2981           //cout<<"666        kcountHBpositivedirectionDigi3   =     "<<kcountHBpositivedirectionDigi3  <<"   jeta-41=     "<< jeta-41 <<endl;
2982           c3x5->cd(kcountHBpositivedirectionDigi3);
2983           HBpositivedirectionDigi3->SetMarkerStyle(20);
2984           HBpositivedirectionDigi3->SetMarkerSize(0.4);
2985           HBpositivedirectionDigi3->GetYaxis()->SetLabelSize(0.04);
2986           HBpositivedirectionDigi3->SetXTitle("HBpositivedirectionDigi3 \b");
2987           HBpositivedirectionDigi3->SetMarkerColor(2);
2988           HBpositivedirectionDigi3->SetLineColor(0);
2989           gPad->SetGridy();
2990           gPad->SetGridx();
2991           //       gPad->SetLogy();
2992           if (kcountHBpositivedirectionDigi3 == 1)
2993             HBpositivedirectionDigi3->SetXTitle("R for HB+ jeta =  0; depth = 3 \b");
2994           if (kcountHBpositivedirectionDigi3 == 2)
2995             HBpositivedirectionDigi3->SetXTitle("R for HB+ jeta =  1; depth = 3 \b");
2996           if (kcountHBpositivedirectionDigi3 == 3)
2997             HBpositivedirectionDigi3->SetXTitle("R for HB+ jeta =  2; depth = 3 \b");
2998           if (kcountHBpositivedirectionDigi3 == 4)
2999             HBpositivedirectionDigi3->SetXTitle("R for HB+ jeta =  3; depth = 3 \b");
3000           if (kcountHBpositivedirectionDigi3 == 5)
3001             HBpositivedirectionDigi3->SetXTitle("R for HB+ jeta =  4; depth = 3 \b");
3002           if (kcountHBpositivedirectionDigi3 == 6)
3003             HBpositivedirectionDigi3->SetXTitle("R for HB+ jeta =  5; depth = 3 \b");
3004           if (kcountHBpositivedirectionDigi3 == 7)
3005             HBpositivedirectionDigi3->SetXTitle("R for HB+ jeta =  6; depth = 3 \b");
3006           if (kcountHBpositivedirectionDigi3 == 8)
3007             HBpositivedirectionDigi3->SetXTitle("R for HB+ jeta =  7; depth = 3 \b");
3008           if (kcountHBpositivedirectionDigi3 == 9)
3009             HBpositivedirectionDigi3->SetXTitle("R for HB+ jeta =  8; depth = 3 \b");
3010           if (kcountHBpositivedirectionDigi3 == 10)
3011             HBpositivedirectionDigi3->SetXTitle("R for HB+ jeta =  9; depth = 3 \b");
3012           if (kcountHBpositivedirectionDigi3 == 11)
3013             HBpositivedirectionDigi3->SetXTitle("R for HB+ jeta =  0; depth = 3 \b");
3014           if (kcountHBpositivedirectionDigi3 == 12)
3015             HBpositivedirectionDigi3->SetXTitle("R for HB+ jeta = 11; depth = 3 \b");
3016           if (kcountHBpositivedirectionDigi3 == 13)
3017             HBpositivedirectionDigi3->SetXTitle("R for HB+ jeta = 12; depth = 3 \b");
3018           if (kcountHBpositivedirectionDigi3 == 14)
3019             HBpositivedirectionDigi3->SetXTitle("R for HB+ jeta = 13; depth = 3 \b");
3020           if (kcountHBpositivedirectionDigi3 == 15)
3021             HBpositivedirectionDigi3->SetXTitle("R for HB+ jeta = 14; depth = 3 \b");
3022           if (kcountHBpositivedirectionDigi3 == 16)
3023             HBpositivedirectionDigi3->SetXTitle("R for HB+ jeta = 15; depth = 3 \b");
3024           HBpositivedirectionDigi3->Draw("Error");
3025           kcountHBpositivedirectionDigi3++;
3026           if (kcountHBpositivedirectionDigi3 > 16)
3027             break;  // 4x6 = 24
3028         }           //ccctest>0
3029 
3030       }  // for i
3031     }    //if(jeta-41 >= 0)
3032   }      //for jeta
3033   /////////////////
3034   c3x5->Update();
3035   c3x5->Print("RdigiPositiveDirectionhistD1PhiSymmetryDepth3HB.png");
3036   c3x5->Clear();
3037   // clean-up
3038   if (h2CeffHBpositivedirectionDigi3)
3039     delete h2CeffHBpositivedirectionDigi3;
3040   //========================================================================================== 7
3041   //======================================================================
3042   //======================================================================1D plot: R vs phi , different eta,  depth=4
3043   //cout<<"      1D plot: R vs phi , different eta,  depth=4 *****" <<endl;
3044   c3x5->Clear();
3045   /////////////////
3046   c3x5->Divide(4, 4);
3047   c3x5->cd(1);
3048   int kcountHBpositivedirectionDigi4 = 1;
3049   TH1F* h2CeffHBpositivedirectionDigi4 = new TH1F("h2CeffHBpositivedirectionDigi4", "", nphi, 0., 72.);
3050 
3051   for (int jeta = 0; jeta < njeta; jeta++) {
3052     // positivedirectionDigi:
3053     if (jeta - 41 >= 0) {
3054       //         for (int i=0;i<ndepth;i++) {
3055       // depth=4
3056       for (int i = 3; i < 4; i++) {
3057         TH1F* HBpositivedirectionDigi4 = (TH1F*)h2CeffHBpositivedirectionDigi4->Clone("twod1");
3058 
3059         float ccctest = 0;  // to avoid empty massive elements
3060         for (int jphi = 0; jphi < nphi; jphi++) {
3061           double ccc1 = adigiHB[i][jeta][jphi];
3062           if (ccc1 != 0.) {
3063             HBpositivedirectionDigi4->Fill(jphi, ccc1);
3064             ccctest = 1.;  //HBpositivedirectionDigi4->SetBinError(i,0.01);
3065           }
3066         }  // for jphi
3067         if (ccctest > 0.) {
3068           //cout<<"777        kcountHBpositivedirectionDigi4   =     "<<kcountHBpositivedirectionDigi4  <<"   jeta-41=     "<< jeta-41 <<endl;
3069           c3x5->cd(kcountHBpositivedirectionDigi4);
3070           HBpositivedirectionDigi4->SetMarkerStyle(20);
3071           HBpositivedirectionDigi4->SetMarkerSize(0.4);
3072           HBpositivedirectionDigi4->GetYaxis()->SetLabelSize(0.04);
3073           HBpositivedirectionDigi4->SetXTitle("HBpositivedirectionDigi4 \b");
3074           HBpositivedirectionDigi4->SetMarkerColor(2);
3075           HBpositivedirectionDigi4->SetLineColor(0);
3076           gPad->SetGridy();
3077           gPad->SetGridx();
3078           //       gPad->SetLogy();
3079           if (kcountHBpositivedirectionDigi4 == 1)
3080             HBpositivedirectionDigi4->SetXTitle("R for HB+ jeta =  0; depth = 4 \b");
3081           if (kcountHBpositivedirectionDigi4 == 2)
3082             HBpositivedirectionDigi4->SetXTitle("R for HB+ jeta =  1; depth = 4 \b");
3083           if (kcountHBpositivedirectionDigi4 == 3)
3084             HBpositivedirectionDigi4->SetXTitle("R for HB+ jeta =  2; depth = 4 \b");
3085           if (kcountHBpositivedirectionDigi4 == 4)
3086             HBpositivedirectionDigi4->SetXTitle("R for HB+ jeta =  3; depth = 4 \b");
3087           if (kcountHBpositivedirectionDigi4 == 5)
3088             HBpositivedirectionDigi4->SetXTitle("R for HB+ jeta =  4; depth = 4 \b");
3089           if (kcountHBpositivedirectionDigi4 == 6)
3090             HBpositivedirectionDigi4->SetXTitle("R for HB+ jeta =  5; depth = 4 \b");
3091           if (kcountHBpositivedirectionDigi4 == 7)
3092             HBpositivedirectionDigi4->SetXTitle("R for HB+ jeta =  6; depth = 4 \b");
3093           if (kcountHBpositivedirectionDigi4 == 8)
3094             HBpositivedirectionDigi4->SetXTitle("R for HB+ jeta =  7; depth = 4 \b");
3095           if (kcountHBpositivedirectionDigi4 == 9)
3096             HBpositivedirectionDigi4->SetXTitle("R for HB+ jeta =  8; depth = 4 \b");
3097           if (kcountHBpositivedirectionDigi4 == 10)
3098             HBpositivedirectionDigi4->SetXTitle("R for HB+ jeta =  9; depth = 4 \b");
3099           if (kcountHBpositivedirectionDigi4 == 11)
3100             HBpositivedirectionDigi4->SetXTitle("R for HB+ jeta = 10; depth = 4 \b");
3101           if (kcountHBpositivedirectionDigi4 == 12)
3102             HBpositivedirectionDigi4->SetXTitle("R for HB+ jeta = 11; depth = 4 \b");
3103           if (kcountHBpositivedirectionDigi4 == 13)
3104             HBpositivedirectionDigi4->SetXTitle("R for HB+ jeta = 12; depth = 4 \b");
3105           if (kcountHBpositivedirectionDigi4 == 14)
3106             HBpositivedirectionDigi4->SetXTitle("R for HB+ jeta = 13; depth = 4 \b");
3107           if (kcountHBpositivedirectionDigi4 == 15)
3108             HBpositivedirectionDigi4->SetXTitle("R for HB+ jeta = 14; depth = 4 \b");
3109           if (kcountHBpositivedirectionDigi4 == 16)
3110             HBpositivedirectionDigi4->SetXTitle("R for HB+ jeta = 15; depth = 4 \b");
3111           HBpositivedirectionDigi4->Draw("Error");
3112           kcountHBpositivedirectionDigi4++;
3113           if (kcountHBpositivedirectionDigi4 > 16)
3114             break;  // 4x6 = 24
3115         }           //ccctest>0
3116 
3117       }  // for i
3118     }    //if(jeta-41 >= 0)
3119   }      //for jeta
3120   /////////////////
3121   c3x5->Update();
3122   c3x5->Print("RdigiPositiveDirectionhistD1PhiSymmetryDepth4HB.png");
3123   c3x5->Clear();
3124   // clean-up
3125   if (h2CeffHBpositivedirectionDigi4)
3126     delete h2CeffHBpositivedirectionDigi4;
3127 
3128   //========================================================================================== 1114
3129   //======================================================================
3130   //======================================================================1D plot: R vs phi , different eta,  depth=1
3131   //cout<<"      1D plot: R vs phi , different eta,  depth=1 *****" <<endl;
3132   c3x5->Clear();
3133   /////////////////
3134   c3x5->Divide(4, 4);
3135   c3x5->cd(1);
3136   int kcountHBnegativedirectionDigi1 = 1;
3137   TH1F* h2CeffHBnegativedirectionDigi1 = new TH1F("h2CeffHBnegativedirectionDigi1", "", nphi, 0., 72.);
3138   for (int jeta = 0; jeta < njeta; jeta++) {
3139     // negativedirectionDigi:
3140     if (jeta - 41 < 0) {
3141       //         for (int i=0;i<ndepth;i++) {
3142       // depth=1
3143       for (int i = 0; i < 1; i++) {
3144         TH1F* HBnegativedirectionDigi1 = (TH1F*)h2CeffHBnegativedirectionDigi1->Clone("twod1");
3145         float ccctest = 0;  // to avoid empty massive elements
3146         for (int jphi = 0; jphi < nphi; jphi++) {
3147           double ccc1 = adigiHB[i][jeta][jphi];
3148           if (ccc1 != 0.) {
3149             HBnegativedirectionDigi1->Fill(jphi, ccc1);
3150             ccctest = 1.;  //HBnegativedirectionDigi1->SetBinError(i,0.01);
3151           }
3152         }  // for jphi
3153         if (ccctest > 0.) {
3154           //      cout<<"444        kcountHBnegativedirectionDigi1   =     "<<kcountHBnegativedirectionDigi1  <<"   jeta-41=     "<< jeta-41 <<endl;
3155           c3x5->cd(kcountHBnegativedirectionDigi1);
3156           HBnegativedirectionDigi1->SetMarkerStyle(20);
3157           HBnegativedirectionDigi1->SetMarkerSize(0.4);
3158           HBnegativedirectionDigi1->GetYaxis()->SetLabelSize(0.04);
3159           HBnegativedirectionDigi1->SetXTitle("HBnegativedirectionDigi1 \b");
3160           HBnegativedirectionDigi1->SetMarkerColor(2);
3161           HBnegativedirectionDigi1->SetLineColor(0);
3162           gPad->SetGridy();
3163           gPad->SetGridx();
3164           //       gPad->SetLogy();
3165           if (kcountHBnegativedirectionDigi1 == 1)
3166             HBnegativedirectionDigi1->SetXTitle("R for HB- jeta = -16; depth = 1 \b");
3167           if (kcountHBnegativedirectionDigi1 == 2)
3168             HBnegativedirectionDigi1->SetXTitle("R for HB- jeta = -15; depth = 1 \b");
3169           if (kcountHBnegativedirectionDigi1 == 3)
3170             HBnegativedirectionDigi1->SetXTitle("R for HB- jeta = -14; depth = 1 \b");
3171           if (kcountHBnegativedirectionDigi1 == 4)
3172             HBnegativedirectionDigi1->SetXTitle("R for HB- jeta = -13; depth = 1 \b");
3173           if (kcountHBnegativedirectionDigi1 == 5)
3174             HBnegativedirectionDigi1->SetXTitle("R for HB- jeta = -12; depth = 1 \b");
3175           if (kcountHBnegativedirectionDigi1 == 6)
3176             HBnegativedirectionDigi1->SetXTitle("R for HB- jeta = -11; depth = 1 \b");
3177           if (kcountHBnegativedirectionDigi1 == 7)
3178             HBnegativedirectionDigi1->SetXTitle("R for HB- jeta = -10; depth = 1 \b");
3179           if (kcountHBnegativedirectionDigi1 == 8)
3180             HBnegativedirectionDigi1->SetXTitle("R for HB- jeta =  -9; depth = 1 \b");
3181           if (kcountHBnegativedirectionDigi1 == 9)
3182             HBnegativedirectionDigi1->SetXTitle("R for HB- jeta =  -8; depth = 1 \b");
3183           if (kcountHBnegativedirectionDigi1 == 10)
3184             HBnegativedirectionDigi1->SetXTitle("R for HB- jeta =  -7; depth = 1 \b");
3185           if (kcountHBnegativedirectionDigi1 == 11)
3186             HBnegativedirectionDigi1->SetXTitle("R for HB- jeta =  -6; depth = 1 \b");
3187           if (kcountHBnegativedirectionDigi1 == 12)
3188             HBnegativedirectionDigi1->SetXTitle("R for HB- jeta =  -5; depth = 1 \b");
3189           if (kcountHBnegativedirectionDigi1 == 13)
3190             HBnegativedirectionDigi1->SetXTitle("R for HB- jeta =  -4; depth = 1 \b");
3191           if (kcountHBnegativedirectionDigi1 == 14)
3192             HBnegativedirectionDigi1->SetXTitle("R for HB- jeta =  -3; depth = 1 \b");
3193           if (kcountHBnegativedirectionDigi1 == 15)
3194             HBnegativedirectionDigi1->SetXTitle("R for HB- jeta =  -2; depth = 1 \b");
3195           if (kcountHBnegativedirectionDigi1 == 16)
3196             HBnegativedirectionDigi1->SetXTitle("R for HB- jeta =  -1; depth = 1 \b");
3197           HBnegativedirectionDigi1->Draw("Error");
3198           kcountHBnegativedirectionDigi1++;
3199           if (kcountHBnegativedirectionDigi1 > 16)
3200             break;  //
3201         }           //ccctest>0
3202 
3203       }  // for i
3204     }    //if(jeta-41 < 0 )
3205   }      //for jeta
3206   /////////////////
3207   c3x5->Update();
3208   c3x5->Print("RdigiNegativeDirectionhistD1PhiSymmetryDepth1HB.png");
3209   c3x5->Clear();
3210   // clean-up
3211   if (h2CeffHBnegativedirectionDigi1)
3212     delete h2CeffHBnegativedirectionDigi1;
3213 
3214   //========================================================================================== 1115
3215   //======================================================================
3216   //======================================================================1D plot: R vs phi , different eta,  depth=2
3217   //  cout<<"      1D plot: R vs phi , different eta,  depth=2 *****" <<endl;
3218   c3x5->Clear();
3219   /////////////////
3220   c3x5->Divide(4, 4);
3221   c3x5->cd(1);
3222   int kcountHBnegativedirectionDigi2 = 1;
3223   TH1F* h2CeffHBnegativedirectionDigi2 = new TH1F("h2CeffHBnegativedirectionDigi2", "", nphi, 0., 72.);
3224   for (int jeta = 0; jeta < njeta; jeta++) {
3225     // negativedirectionDigi:
3226     if (jeta - 41 < 0) {
3227       //         for (int i=0;i<ndepth;i++) {
3228       // depth=2
3229       for (int i = 1; i < 2; i++) {
3230         TH1F* HBnegativedirectionDigi2 = (TH1F*)h2CeffHBnegativedirectionDigi2->Clone("twod1");
3231         float ccctest = 0;  // to avoid empty massive elements
3232         for (int jphi = 0; jphi < nphi; jphi++) {
3233           double ccc1 = adigiHB[i][jeta][jphi];
3234           if (ccc1 != 0.) {
3235             HBnegativedirectionDigi2->Fill(jphi, ccc1);
3236             ccctest = 1.;  //HBnegativedirectionDigi2->SetBinError(i,0.01);
3237           }
3238         }  // for jphi
3239         if (ccctest > 0.) {
3240           //cout<<"555        kcountHBnegativedirectionDigi2   =     "<<kcountHBnegativedirectionDigi2  <<"   jeta-41=     "<< jeta-41 <<endl;
3241           c3x5->cd(kcountHBnegativedirectionDigi2);
3242           HBnegativedirectionDigi2->SetMarkerStyle(20);
3243           HBnegativedirectionDigi2->SetMarkerSize(0.4);
3244           HBnegativedirectionDigi2->GetYaxis()->SetLabelSize(0.04);
3245           HBnegativedirectionDigi2->SetXTitle("HBnegativedirectionDigi2 \b");
3246           HBnegativedirectionDigi2->SetMarkerColor(2);
3247           HBnegativedirectionDigi2->SetLineColor(0);
3248           gPad->SetGridy();
3249           gPad->SetGridx();
3250           //       gPad->SetLogy();
3251           if (kcountHBnegativedirectionDigi2 == 1)
3252             HBnegativedirectionDigi2->SetXTitle("R for HB- jeta = -16; depth = 2 \b");
3253           if (kcountHBnegativedirectionDigi2 == 2)
3254             HBnegativedirectionDigi2->SetXTitle("R for HB- jeta = -15; depth = 2 \b");
3255           if (kcountHBnegativedirectionDigi2 == 3)
3256             HBnegativedirectionDigi2->SetXTitle("R for HB- jeta = -14; depth = 2 \b");
3257           if (kcountHBnegativedirectionDigi2 == 4)
3258             HBnegativedirectionDigi2->SetXTitle("R for HB- jeta = -13; depth = 2 \b");
3259           if (kcountHBnegativedirectionDigi2 == 5)
3260             HBnegativedirectionDigi2->SetXTitle("R for HB- jeta = -12; depth = 2 \b");
3261           if (kcountHBnegativedirectionDigi2 == 6)
3262             HBnegativedirectionDigi2->SetXTitle("R for HB- jeta = -11; depth = 2 \b");
3263           if (kcountHBnegativedirectionDigi2 == 7)
3264             HBnegativedirectionDigi2->SetXTitle("R for HB- jeta = -10; depth = 2 \b");
3265           if (kcountHBnegativedirectionDigi2 == 8)
3266             HBnegativedirectionDigi2->SetXTitle("R for HB- jeta =  -9; depth = 2 \b");
3267           if (kcountHBnegativedirectionDigi2 == 9)
3268             HBnegativedirectionDigi2->SetXTitle("R for HB- jeta =  -8; depth = 2 \b");
3269           if (kcountHBnegativedirectionDigi2 == 10)
3270             HBnegativedirectionDigi2->SetXTitle("R for HB- jeta =  -7; depth = 2 \b");
3271           if (kcountHBnegativedirectionDigi2 == 11)
3272             HBnegativedirectionDigi2->SetXTitle("R for HB- jeta =  -6; depth = 2 \b");
3273           if (kcountHBnegativedirectionDigi2 == 12)
3274             HBnegativedirectionDigi2->SetXTitle("R for HB- jeta =  -5; depth = 2 \b");
3275           if (kcountHBnegativedirectionDigi2 == 13)
3276             HBnegativedirectionDigi2->SetXTitle("R for HB- jeta =  -4; depth = 2 \b");
3277           if (kcountHBnegativedirectionDigi2 == 14)
3278             HBnegativedirectionDigi2->SetXTitle("R for HB- jeta =  -3; depth = 2 \b");
3279           if (kcountHBnegativedirectionDigi2 == 15)
3280             HBnegativedirectionDigi2->SetXTitle("R for HB- jeta =  -2; depth = 2 \b");
3281           if (kcountHBnegativedirectionDigi2 == 16)
3282             HBnegativedirectionDigi2->SetXTitle("R for HB- jeta =  -1; depth = 2 \b");
3283           HBnegativedirectionDigi2->Draw("Error");
3284           kcountHBnegativedirectionDigi2++;
3285           if (kcountHBnegativedirectionDigi2 > 16)
3286             break;  // 4x6 = 24
3287         }           //ccctest>0
3288 
3289       }  // for i
3290     }    //if(jeta-41 < 0 )
3291   }      //for jeta
3292   /////////////////
3293   c3x5->Update();
3294   c3x5->Print("RdigiNegativeDirectionhistD1PhiSymmetryDepth2HB.png");
3295   c3x5->Clear();
3296   // clean-up
3297   if (h2CeffHBnegativedirectionDigi2)
3298     delete h2CeffHBnegativedirectionDigi2;
3299   //========================================================================================== 1116
3300   //======================================================================
3301   //======================================================================1D plot: R vs phi , different eta,  depth=3
3302   //cout<<"      1D plot: R vs phi , different eta,  depth=3 *****" <<endl;
3303   c3x5->Clear();
3304   /////////////////
3305   c3x5->Divide(4, 4);
3306   c3x5->cd(1);
3307   int kcountHBnegativedirectionDigi3 = 1;
3308   TH1F* h2CeffHBnegativedirectionDigi3 = new TH1F("h2CeffHBnegativedirectionDigi3", "", nphi, 0., 72.);
3309   for (int jeta = 0; jeta < njeta; jeta++) {
3310     // negativedirectionDigi:
3311     if (jeta - 41 < 0) {
3312       //         for (int i=0;i<ndepth;i++) {
3313       // depth=3
3314       for (int i = 2; i < 3; i++) {
3315         TH1F* HBnegativedirectionDigi3 = (TH1F*)h2CeffHBnegativedirectionDigi3->Clone("twod1");
3316         float ccctest = 0;  // to avoid empty massive elements
3317         for (int jphi = 0; jphi < nphi; jphi++) {
3318           double ccc1 = adigiHB[i][jeta][jphi];
3319           if (ccc1 != 0.) {
3320             HBnegativedirectionDigi3->Fill(jphi, ccc1);
3321             ccctest = 1.;  //HBnegativedirectionDigi3->SetBinError(i,0.01);
3322           }
3323         }  // for jphi
3324         if (ccctest > 0.) {
3325           //cout<<"666        kcountHBnegativedirectionDigi3   =     "<<kcountHBnegativedirectionDigi3  <<"   jeta-41=     "<< jeta-41 <<endl;
3326           c3x5->cd(kcountHBnegativedirectionDigi3);
3327           HBnegativedirectionDigi3->SetMarkerStyle(20);
3328           HBnegativedirectionDigi3->SetMarkerSize(0.4);
3329           HBnegativedirectionDigi3->GetYaxis()->SetLabelSize(0.04);
3330           HBnegativedirectionDigi3->SetXTitle("HBnegativedirectionDigi3 \b");
3331           HBnegativedirectionDigi3->SetMarkerColor(2);
3332           HBnegativedirectionDigi3->SetLineColor(0);
3333           gPad->SetGridy();
3334           gPad->SetGridx();
3335           //       gPad->SetLogy();
3336           if (kcountHBnegativedirectionDigi3 == 1)
3337             HBnegativedirectionDigi3->SetXTitle("R for HB- jeta = -16; depth = 3 \b");
3338           if (kcountHBnegativedirectionDigi3 == 2)
3339             HBnegativedirectionDigi3->SetXTitle("R for HB- jeta = -15; depth = 3 \b");
3340           if (kcountHBnegativedirectionDigi3 == 3)
3341             HBnegativedirectionDigi3->SetXTitle("R for HB- jeta = -14; depth = 3 \b");
3342           if (kcountHBnegativedirectionDigi3 == 4)
3343             HBnegativedirectionDigi3->SetXTitle("R for HB- jeta = -13; depth = 3 \b");
3344           if (kcountHBnegativedirectionDigi3 == 5)
3345             HBnegativedirectionDigi3->SetXTitle("R for HB- jeta = -12; depth = 3 \b");
3346           if (kcountHBnegativedirectionDigi3 == 6)
3347             HBnegativedirectionDigi3->SetXTitle("R for HB- jeta = -11; depth = 3 \b");
3348           if (kcountHBnegativedirectionDigi3 == 7)
3349             HBnegativedirectionDigi3->SetXTitle("R for HB- jeta = -10; depth = 3 \b");
3350           if (kcountHBnegativedirectionDigi3 == 8)
3351             HBnegativedirectionDigi3->SetXTitle("R for HB- jeta =  -9; depth = 3 \b");
3352           if (kcountHBnegativedirectionDigi3 == 9)
3353             HBnegativedirectionDigi3->SetXTitle("R for HB- jeta =  -8; depth = 3 \b");
3354           if (kcountHBnegativedirectionDigi3 == 10)
3355             HBnegativedirectionDigi3->SetXTitle("R for HB- jeta =  -7; depth = 3 \b");
3356           if (kcountHBnegativedirectionDigi3 == 11)
3357             HBnegativedirectionDigi3->SetXTitle("R for HB- jeta =  -6; depth = 3 \b");
3358           if (kcountHBnegativedirectionDigi3 == 12)
3359             HBnegativedirectionDigi3->SetXTitle("R for HB- jeta =  -5; depth = 3 \b");
3360           if (kcountHBnegativedirectionDigi3 == 13)
3361             HBnegativedirectionDigi3->SetXTitle("R for HB- jeta =  -4; depth = 3 \b");
3362           if (kcountHBnegativedirectionDigi3 == 14)
3363             HBnegativedirectionDigi3->SetXTitle("R for HB- jeta =  -3; depth = 3 \b");
3364           if (kcountHBnegativedirectionDigi3 == 15)
3365             HBnegativedirectionDigi3->SetXTitle("R for HB- jeta =  -2; depth = 3 \b");
3366           if (kcountHBnegativedirectionDigi3 == 16)
3367             HBnegativedirectionDigi3->SetXTitle("R for HB- jeta =  -1; depth = 3 \b");
3368 
3369           HBnegativedirectionDigi3->Draw("Error");
3370           kcountHBnegativedirectionDigi3++;
3371           if (kcountHBnegativedirectionDigi3 > 16)
3372             break;  // 4x6 = 24
3373         }           //ccctest>0
3374 
3375       }  // for i
3376     }    //if(jeta-41 < 0 )
3377   }      //for jeta
3378   /////////////////
3379   c3x5->Update();
3380   c3x5->Print("RdigiNegativeDirectionhistD1PhiSymmetryDepth3HB.png");
3381   c3x5->Clear();
3382   // clean-up
3383   if (h2CeffHBnegativedirectionDigi3)
3384     delete h2CeffHBnegativedirectionDigi3;
3385   //========================================================================================== 1117
3386   //======================================================================
3387   //======================================================================1D plot: R vs phi , different eta,  depth=4
3388   //cout<<"      1D plot: R vs phi , different eta,  depth=4 *****" <<endl;
3389   c3x5->Clear();
3390   /////////////////
3391   c3x5->Divide(4, 4);
3392   c3x5->cd(1);
3393   int kcountHBnegativedirectionDigi4 = 1;
3394   TH1F* h2CeffHBnegativedirectionDigi4 = new TH1F("h2CeffHBnegativedirectionDigi4", "", nphi, 0., 72.);
3395 
3396   for (int jeta = 0; jeta < njeta; jeta++) {
3397     // negativedirectionDigi:
3398     if (jeta - 41 < 0) {
3399       //         for (int i=0;i<ndepth;i++) {
3400       // depth=4
3401       for (int i = 3; i < 4; i++) {
3402         TH1F* HBnegativedirectionDigi4 = (TH1F*)h2CeffHBnegativedirectionDigi4->Clone("twod1");
3403 
3404         float ccctest = 0;  // to avoid empty massive elements
3405         for (int jphi = 0; jphi < nphi; jphi++) {
3406           double ccc1 = adigiHB[i][jeta][jphi];
3407           if (ccc1 != 0.) {
3408             HBnegativedirectionDigi4->Fill(jphi, ccc1);
3409             ccctest = 1.;  //HBnegativedirectionDigi4->SetBinError(i,0.01);
3410           }
3411         }  // for jphi
3412         if (ccctest > 0.) {
3413           //cout<<"777        kcountHBnegativedirectionDigi4   =     "<<kcountHBnegativedirectionDigi4  <<"   jeta-41=     "<< jeta-41 <<endl;
3414           c3x5->cd(kcountHBnegativedirectionDigi4);
3415           HBnegativedirectionDigi4->SetMarkerStyle(20);
3416           HBnegativedirectionDigi4->SetMarkerSize(0.4);
3417           HBnegativedirectionDigi4->GetYaxis()->SetLabelSize(0.04);
3418           HBnegativedirectionDigi4->SetXTitle("HBnegativedirectionDigi4 \b");
3419           HBnegativedirectionDigi4->SetMarkerColor(2);
3420           HBnegativedirectionDigi4->SetLineColor(0);
3421           gPad->SetGridy();
3422           gPad->SetGridx();
3423           //       gPad->SetLogy();
3424           if (kcountHBnegativedirectionDigi4 == 1)
3425             HBnegativedirectionDigi4->SetXTitle("R for HB- jeta = -16; depth = 4 \b");
3426           if (kcountHBnegativedirectionDigi4 == 2)
3427             HBnegativedirectionDigi4->SetXTitle("R for HB- jeta = -15; depth = 4 \b");
3428           if (kcountHBnegativedirectionDigi4 == 3)
3429             HBnegativedirectionDigi4->SetXTitle("R for HB- jeta = -14; depth = 4 \b");
3430           if (kcountHBnegativedirectionDigi4 == 4)
3431             HBnegativedirectionDigi4->SetXTitle("R for HB- jeta = -13; depth = 4 \b");
3432           if (kcountHBnegativedirectionDigi4 == 5)
3433             HBnegativedirectionDigi4->SetXTitle("R for HB- jeta = -12; depth = 4 \b");
3434           if (kcountHBnegativedirectionDigi4 == 6)
3435             HBnegativedirectionDigi4->SetXTitle("R for HB- jeta = -11; depth = 4 \b");
3436           if (kcountHBnegativedirectionDigi4 == 7)
3437             HBnegativedirectionDigi4->SetXTitle("R for HB- jeta = -10; depth = 4 \b");
3438           if (kcountHBnegativedirectionDigi4 == 8)
3439             HBnegativedirectionDigi4->SetXTitle("R for HB- jeta =  -9; depth = 4 \b");
3440           if (kcountHBnegativedirectionDigi4 == 9)
3441             HBnegativedirectionDigi4->SetXTitle("R for HB- jeta =  -8; depth = 4 \b");
3442           if (kcountHBnegativedirectionDigi4 == 10)
3443             HBnegativedirectionDigi4->SetXTitle("R for HB- jeta =  -7; depth = 4 \b");
3444           if (kcountHBnegativedirectionDigi4 == 11)
3445             HBnegativedirectionDigi4->SetXTitle("R for HB- jeta =  -6; depth = 4 \b");
3446           if (kcountHBnegativedirectionDigi4 == 12)
3447             HBnegativedirectionDigi4->SetXTitle("R for HB- jeta =  -5; depth = 4 \b");
3448           if (kcountHBnegativedirectionDigi4 == 13)
3449             HBnegativedirectionDigi4->SetXTitle("R for HB- jeta =  -4; depth = 4 \b");
3450           if (kcountHBnegativedirectionDigi4 == 14)
3451             HBnegativedirectionDigi4->SetXTitle("R for HB- jeta =  -3; depth = 4 \b");
3452           if (kcountHBnegativedirectionDigi4 == 15)
3453             HBnegativedirectionDigi4->SetXTitle("R for HB- jeta =  -2; depth = 4 \b");
3454           if (kcountHBnegativedirectionDigi4 == 16)
3455             HBnegativedirectionDigi4->SetXTitle("R for HB- jeta =  -1; depth = 4 \b");
3456           HBnegativedirectionDigi4->Draw("Error");
3457           kcountHBnegativedirectionDigi4++;
3458           if (kcountHBnegativedirectionDigi4 > 16)
3459             break;  // 4x6 = 24
3460         }           //ccctest>0
3461 
3462       }  // for i
3463     }    //if(jeta-41 < 0 )
3464   }      //for jeta
3465   /////////////////
3466   c3x5->Update();
3467   c3x5->Print("RdigiNegativeDirectionhistD1PhiSymmetryDepth4HB.png");
3468   c3x5->Clear();
3469   // clean-up
3470   if (h2CeffHBnegativedirectionDigi4)
3471     delete h2CeffHBnegativedirectionDigi4;
3472 
3473   //======================================================================================================================
3474   //======================================================================================================================
3475   //======================================================================================================================
3476   //                            DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD:
3477 
3478   //cout<<"    Start Vaiance: preparation  *****" <<endl;
3479   TH2F* digiVariance1HB1 = (TH2F*)dir->FindObjectAny("h_amplitudechannel2_HB1");
3480   TH2F* digiVariance0HB1 = (TH2F*)dir->FindObjectAny("h_amplitudechannel0_HB1");
3481   TH2F* digiVarianceHB1 = (TH2F*)digiVariance1HB1->Clone("digiVarianceHB1");
3482   digiVarianceHB1->Divide(digiVariance1HB1, digiVariance0HB1, 1, 1, "B");
3483   TH2F* digiVariance1HB2 = (TH2F*)dir->FindObjectAny("h_amplitudechannel2_HB2");
3484   TH2F* digiVariance0HB2 = (TH2F*)dir->FindObjectAny("h_amplitudechannel0_HB2");
3485   TH2F* digiVarianceHB2 = (TH2F*)digiVariance1HB2->Clone("digiVarianceHB2");
3486   digiVarianceHB2->Divide(digiVariance1HB2, digiVariance0HB2, 1, 1, "B");
3487   TH2F* digiVariance1HB3 = (TH2F*)dir->FindObjectAny("h_amplitudechannel2_HB3");
3488   TH2F* digiVariance0HB3 = (TH2F*)dir->FindObjectAny("h_amplitudechannel0_HB3");
3489   TH2F* digiVarianceHB3 = (TH2F*)digiVariance1HB3->Clone("digiVarianceHB3");
3490   digiVarianceHB3->Divide(digiVariance1HB3, digiVariance0HB3, 1, 1, "B");
3491   TH2F* digiVariance1HB4 = (TH2F*)dir->FindObjectAny("h_amplitudechannel2_HB4");
3492   TH2F* digiVariance0HB4 = (TH2F*)dir->FindObjectAny("h_amplitudechannel0_HB4");
3493   TH2F* digiVarianceHB4 = (TH2F*)digiVariance1HB4->Clone("digiVarianceHB4");
3494   digiVarianceHB4->Divide(digiVariance1HB4, digiVariance0HB4, 1, 1, "B");
3495   //cout<<"      Vaiance: preparation DONE *****" <<endl;
3496   //====================================================================== put Vaiance=Dispersia = Sig**2=<R**2> - (<R>)**2 into massive digivarianceHB
3497   //                                                                                           = sum(R*R)/N - (sum(R)/N)**2
3498   for (int jeta = 0; jeta < njeta; jeta++) {
3499     //preparation for PHI normalization:
3500     double sumdigiHB0 = 0;
3501     int nsumdigiHB0 = 0;
3502     double sumdigiHB1 = 0;
3503     int nsumdigiHB1 = 0;
3504     double sumdigiHB2 = 0;
3505     int nsumdigiHB2 = 0;
3506     double sumdigiHB3 = 0;
3507     int nsumdigiHB3 = 0;
3508     for (int jphi = 0; jphi < njphi; jphi++) {
3509       digivarianceHB[0][jeta][jphi] = digiVarianceHB1->GetBinContent(jeta + 1, jphi + 1);
3510       digivarianceHB[1][jeta][jphi] = digiVarianceHB2->GetBinContent(jeta + 1, jphi + 1);
3511       digivarianceHB[2][jeta][jphi] = digiVarianceHB3->GetBinContent(jeta + 1, jphi + 1);
3512       digivarianceHB[3][jeta][jphi] = digiVarianceHB4->GetBinContent(jeta + 1, jphi + 1);
3513       if (digivarianceHB[0][jeta][jphi] > 0.) {
3514         sumdigiHB0 += digivarianceHB[0][jeta][jphi];
3515         ++nsumdigiHB0;
3516       }
3517       if (digivarianceHB[1][jeta][jphi] > 0.) {
3518         sumdigiHB1 += digivarianceHB[1][jeta][jphi];
3519         ++nsumdigiHB1;
3520       }
3521       if (digivarianceHB[2][jeta][jphi] > 0.) {
3522         sumdigiHB2 += digivarianceHB[2][jeta][jphi];
3523         ++nsumdigiHB2;
3524       }
3525       if (digivarianceHB[3][jeta][jphi] > 0.) {
3526         sumdigiHB3 += digivarianceHB[3][jeta][jphi];
3527         ++nsumdigiHB3;
3528       }
3529     }  // phi
3530     // PHI normalization :
3531     for (int jphi = 0; jphi < njphi; jphi++) {
3532       if (digivarianceHB[0][jeta][jphi] > 0.)
3533         digivarianceHB[0][jeta][jphi] /= (sumdigiHB0 / nsumdigiHB0);
3534       if (digivarianceHB[1][jeta][jphi] > 0.)
3535         digivarianceHB[1][jeta][jphi] /= (sumdigiHB1 / nsumdigiHB1);
3536       if (digivarianceHB[2][jeta][jphi] > 0.)
3537         digivarianceHB[2][jeta][jphi] /= (sumdigiHB2 / nsumdigiHB2);
3538       if (digivarianceHB[3][jeta][jphi] > 0.)
3539         digivarianceHB[3][jeta][jphi] /= (sumdigiHB3 / nsumdigiHB3);
3540     }  // phi
3541     //       digivarianceHB (D)           = sum(R*R)/N - (sum(R)/N)**2
3542     for (int jphi = 0; jphi < njphi; jphi++) {
3543       //       cout<<"12 12 12   jeta=     "<< jeta <<"   jphi   =     "<<jphi  <<endl;
3544       digivarianceHB[0][jeta][jphi] -= adigiHB[0][jeta][jphi] * adigiHB[0][jeta][jphi];
3545       digivarianceHB[0][jeta][jphi] = fabs(digivarianceHB[0][jeta][jphi]);
3546       digivarianceHB[1][jeta][jphi] -= adigiHB[1][jeta][jphi] * adigiHB[1][jeta][jphi];
3547       digivarianceHB[1][jeta][jphi] = fabs(digivarianceHB[1][jeta][jphi]);
3548       digivarianceHB[2][jeta][jphi] -= adigiHB[2][jeta][jphi] * adigiHB[2][jeta][jphi];
3549       digivarianceHB[2][jeta][jphi] = fabs(digivarianceHB[2][jeta][jphi]);
3550       digivarianceHB[3][jeta][jphi] -= adigiHB[3][jeta][jphi] * adigiHB[3][jeta][jphi];
3551       digivarianceHB[3][jeta][jphi] = fabs(digivarianceHB[3][jeta][jphi]);
3552     }
3553   }
3554   //cout<<"      Vaiance: DONE*****" <<endl;
3555   //------------------------  2D-eta/phi-plot: D, averaged over depthfs
3556   //======================================================================
3557   //======================================================================
3558   //cout<<"      R2D-eta/phi-plot: D, averaged over depthfs *****" <<endl;
3559   c1x1->Clear();
3560   /////////////////
3561   c1x0->Divide(1, 1);
3562   c1x0->cd(1);
3563   TH2F* DefzDdigiHB42D = new TH2F("DefzDdigiHB42D", "", neta, -41., 41., nphi, 0., 72.);
3564   TH2F* DefzDdigiHB42D0 = new TH2F("DefzDdigiHB42D0", "", neta, -41., 41., nphi, 0., 72.);
3565   TH2F* DefzDdigiHB42DF = (TH2F*)DefzDdigiHB42D0->Clone("DefzDdigiHB42DF");
3566   for (int i = 0; i < ndepth; i++) {
3567     for (int jeta = 0; jeta < neta; jeta++) {
3568       for (int jphi = 0; jphi < nphi; jphi++) {
3569         double ccc1 = digivarianceHB[i][jeta][jphi];
3570         int k2plot = jeta - 41;
3571         int kkk = k2plot;  //if(k2plot >0   kkk=k2plot+1; //-41 +41 !=0
3572         if (adigiHB[i][jeta][jphi] > 0.) {
3573           DefzDdigiHB42D->Fill(kkk, jphi, ccc1);
3574           DefzDdigiHB42D0->Fill(kkk, jphi, 1.);
3575         }
3576       }
3577     }
3578   }
3579   DefzDdigiHB42DF->Divide(DefzDdigiHB42D, DefzDdigiHB42D0, 1, 1, "B");  // average A
3580   //    DefzDdigiHB1->Sumw2();
3581   gPad->SetGridy();
3582   gPad->SetGridx();  //      gPad->SetLogz();
3583   DefzDdigiHB42DF->SetMarkerStyle(20);
3584   DefzDdigiHB42DF->SetMarkerSize(0.4);
3585   DefzDdigiHB42DF->GetZaxis()->SetLabelSize(0.08);
3586   DefzDdigiHB42DF->SetXTitle("<D>_depth       #eta  \b");
3587   DefzDdigiHB42DF->SetYTitle("      #phi \b");
3588   DefzDdigiHB42DF->SetZTitle("<D>_depth \b");
3589   DefzDdigiHB42DF->SetMarkerColor(2);
3590   DefzDdigiHB42DF->SetLineColor(
3591       0);  //      DefzDdigiHB42DF->SetMaximum(1.000);  //      DefzDdigiHB42DF->SetMinimum(1.0);
3592   DefzDdigiHB42DF->Draw("COLZ");
3593   /////////////////
3594   c1x0->Update();
3595   c1x0->Print("DdigiGeneralD2PhiSymmetryHB.png");
3596   c1x0->Clear();
3597   // clean-up
3598   if (DefzDdigiHB42D)
3599     delete DefzDdigiHB42D;
3600   if (DefzDdigiHB42D0)
3601     delete DefzDdigiHB42D0;
3602   if (DefzDdigiHB42DF)
3603     delete DefzDdigiHB42DF;
3604   //====================================================================== 1D plot: D vs phi , averaged over depthfs & eta
3605   //======================================================================
3606   //cout<<"      1D plot: D vs phi , averaged over depthfs & eta *****" <<endl;
3607   c1x1->Clear();
3608   /////////////////
3609   c1x1->Divide(1, 1);
3610   c1x1->cd(1);
3611   TH1F* DefzDdigiHB41D = new TH1F("DefzDdigiHB41D", "", nphi, 0., 72.);
3612   TH1F* DefzDdigiHB41D0 = new TH1F("DefzDdigiHB41D0", "", nphi, 0., 72.);
3613   TH1F* DefzDdigiHB41DF = (TH1F*)DefzDdigiHB41D0->Clone("DefzDdigiHB41DF");
3614 
3615   for (int jphi = 0; jphi < nphi; jphi++) {
3616     for (int jeta = 0; jeta < neta; jeta++) {
3617       for (int i = 0; i < ndepth; i++) {
3618         double ccc1 = digivarianceHB[i][jeta][jphi];
3619         if (adigiHB[i][jeta][jphi] > 0.) {
3620           DefzDdigiHB41D->Fill(jphi, ccc1);
3621           DefzDdigiHB41D0->Fill(jphi, 1.);
3622         }
3623       }
3624     }
3625   }
3626   //     DefzDdigiHB41D->Sumw2();DefzDdigiHB41D0->Sumw2();
3627 
3628   DefzDdigiHB41DF->Divide(DefzDdigiHB41D, DefzDdigiHB41D0, 1, 1, "B");  // R averaged over depthfs & eta
3629   DefzDdigiHB41D0->Sumw2();
3630   //    for (int jphi=1;jphi<73;jphi++) {DefzDdigiHB41DF->SetBinError(jphi,0.01);}
3631   gPad->SetGridy();
3632   gPad->SetGridx();  //      gPad->SetLogz();
3633   DefzDdigiHB41DF->SetMarkerStyle(20);
3634   DefzDdigiHB41DF->SetMarkerSize(1.4);
3635   DefzDdigiHB41DF->GetZaxis()->SetLabelSize(0.08);
3636   DefzDdigiHB41DF->SetXTitle("#phi  \b");
3637   DefzDdigiHB41DF->SetYTitle("  <D> \b");
3638   DefzDdigiHB41DF->SetZTitle("<D>_PHI  - AllDepthfs \b");
3639   DefzDdigiHB41DF->SetMarkerColor(4);
3640   DefzDdigiHB41DF->SetLineColor(4);  //  DefzDdigiHB41DF->SetMinimum(0.8);     DefzDdigiHB41DF->SetMinimum(-0.015);
3641   DefzDdigiHB41DF->Draw("Error");
3642   /////////////////
3643   c1x1->Update();
3644   c1x1->Print("DdigiGeneralD1PhiSymmetryHB.png");
3645   c1x1->Clear();
3646   // clean-up
3647   if (DefzDdigiHB41D)
3648     delete DefzDdigiHB41D;
3649   if (DefzDdigiHB41D0)
3650     delete DefzDdigiHB41D0;
3651   if (DefzDdigiHB41DF)
3652     delete DefzDdigiHB41DF;
3653 
3654   //========================================================================================== 14
3655   //======================================================================
3656   //======================================================================1D plot: D vs phi , different eta,  depth=1
3657   //cout<<"      1D plot: D vs phi , different eta,  depth=1 *****" <<endl;
3658   c3x5->Clear();
3659   /////////////////
3660   c3x5->Divide(4, 4);
3661   c3x5->cd(1);
3662   int kcountHBpositivedirectionDigiD1 = 1;
3663   TH1F* h2CeffHBpositivedirectionDigiD1 = new TH1F("h2CeffHBpositivedirectionDigiD1", "", nphi, 0., 72.);
3664 
3665   for (int jeta = 0; jeta < njeta; jeta++) {
3666     // positivedirectionDigiD:
3667     if (jeta - 41 >= 0) {
3668       //         for (int i=0;i<ndepth;i++) {
3669       // depth=1
3670       for (int i = 0; i < 1; i++) {
3671         TH1F* HBpositivedirectionDigiD1 = (TH1F*)h2CeffHBpositivedirectionDigiD1->Clone("twod1");
3672 
3673         float ccctest = 0;  // to avoid empty massive elements
3674         for (int jphi = 0; jphi < nphi; jphi++) {
3675           double ccc1 = digivarianceHB[i][jeta][jphi];
3676           if (adigiHB[i][jeta][jphi] > 0.) {
3677             HBpositivedirectionDigiD1->Fill(jphi, ccc1);
3678             ccctest = 1.;  //HBpositivedirectionDigiD1->SetBinError(i,0.01);
3679           }
3680         }  // for jphi
3681         if (ccctest > 0.) {
3682           //cout<<"1414       kcountHBpositivedirectionDigiD1   =     "<<kcountHBpositivedirectionDigiD1  <<"   jeta-41=     "<< jeta-41 <<endl;
3683           c3x5->cd(kcountHBpositivedirectionDigiD1);
3684           HBpositivedirectionDigiD1->SetMarkerStyle(20);
3685           HBpositivedirectionDigiD1->SetMarkerSize(0.4);
3686           HBpositivedirectionDigiD1->GetYaxis()->SetLabelSize(0.04);
3687           HBpositivedirectionDigiD1->SetXTitle("HBpositivedirectionDigiD1 \b");
3688           HBpositivedirectionDigiD1->SetMarkerColor(2);
3689           HBpositivedirectionDigiD1->SetLineColor(0);
3690           gPad->SetGridy();
3691           gPad->SetGridx();
3692           //       gPad->SetLogy();
3693           if (kcountHBpositivedirectionDigiD1 == 1)
3694             HBpositivedirectionDigiD1->SetXTitle("D for HB+ jeta =  0; depth = 1 \b");
3695           if (kcountHBpositivedirectionDigiD1 == 2)
3696             HBpositivedirectionDigiD1->SetXTitle("D for HB+ jeta =  1; depth = 1 \b");
3697           if (kcountHBpositivedirectionDigiD1 == 3)
3698             HBpositivedirectionDigiD1->SetXTitle("D for HB+ jeta =  2; depth = 1 \b");
3699           if (kcountHBpositivedirectionDigiD1 == 4)
3700             HBpositivedirectionDigiD1->SetXTitle("D for HB+ jeta =  3; depth = 1 \b");
3701           if (kcountHBpositivedirectionDigiD1 == 5)
3702             HBpositivedirectionDigiD1->SetXTitle("D for HB+ jeta =  4; depth = 1 \b");
3703           if (kcountHBpositivedirectionDigiD1 == 6)
3704             HBpositivedirectionDigiD1->SetXTitle("D for HB+ jeta =  5; depth = 1 \b");
3705           if (kcountHBpositivedirectionDigiD1 == 7)
3706             HBpositivedirectionDigiD1->SetXTitle("D for HB+ jeta =  6; depth = 1 \b");
3707           if (kcountHBpositivedirectionDigiD1 == 8)
3708             HBpositivedirectionDigiD1->SetXTitle("D for HB+ jeta =  7; depth = 1 \b");
3709           if (kcountHBpositivedirectionDigiD1 == 9)
3710             HBpositivedirectionDigiD1->SetXTitle("D for HB+ jeta =  8; depth = 1 \b");
3711           if (kcountHBpositivedirectionDigiD1 == 10)
3712             HBpositivedirectionDigiD1->SetXTitle("D for HB+ jeta =  9; depth = 1 \b");
3713           if (kcountHBpositivedirectionDigiD1 == 11)
3714             HBpositivedirectionDigiD1->SetXTitle("D for HB+ jeta = 10; depth = 1 \b");
3715           if (kcountHBpositivedirectionDigiD1 == 12)
3716             HBpositivedirectionDigiD1->SetXTitle("D for HB+ jeta = 11; depth = 1 \b");
3717           if (kcountHBpositivedirectionDigiD1 == 13)
3718             HBpositivedirectionDigiD1->SetXTitle("D for HB+ jeta = 12; depth = 1 \b");
3719           if (kcountHBpositivedirectionDigiD1 == 14)
3720             HBpositivedirectionDigiD1->SetXTitle("D for HB+ jeta = 13; depth = 1 \b");
3721           if (kcountHBpositivedirectionDigiD1 == 15)
3722             HBpositivedirectionDigiD1->SetXTitle("D for HB+ jeta = 14; depth = 1 \b");
3723           if (kcountHBpositivedirectionDigiD1 == 16)
3724             HBpositivedirectionDigiD1->SetXTitle("D for HB+ jeta = 15; depth = 1 \b");
3725           HBpositivedirectionDigiD1->Draw("Error");
3726           kcountHBpositivedirectionDigiD1++;
3727           if (kcountHBpositivedirectionDigiD1 > 16)
3728             break;  // 4x6 = 24
3729         }           //ccctest>0
3730 
3731       }  // for i
3732     }    //if(jeta-41 >= 0)
3733   }      //for jeta
3734   /////////////////
3735   c3x5->Update();
3736   c3x5->Print("DdigiPositiveDirectionhistD1PhiSymmetryDepth1HB.png");
3737   c3x5->Clear();
3738   // clean-up
3739   if (h2CeffHBpositivedirectionDigiD1)
3740     delete h2CeffHBpositivedirectionDigiD1;
3741   //========================================================================================== 15
3742   //======================================================================
3743   //======================================================================1D plot: D vs phi , different eta,  depth=2
3744   //cout<<"      1D plot: D vs phi , different eta,  depth=2 *****" <<endl;
3745   c3x5->Clear();
3746   c3x5->Divide(4, 4);
3747   c3x5->cd(1);
3748   int kcountHBpositivedirectionDigiD2 = 1;
3749   TH1F* h2CeffHBpositivedirectionDigiD2 = new TH1F("h2CeffHBpositivedirectionDigiD2", "", nphi, 0., 72.);
3750 
3751   for (int jeta = 0; jeta < njeta; jeta++) {
3752     // positivedirectionDigiD:
3753     if (jeta - 41 >= 0) {
3754       //         for (int i=0;i<ndepth;i++) {
3755       // depth=2
3756       for (int i = 1; i < 2; i++) {
3757         TH1F* HBpositivedirectionDigiD2 = (TH1F*)h2CeffHBpositivedirectionDigiD2->Clone("twod1");
3758 
3759         float ccctest = 0;  // to avoid empty massive elements
3760         for (int jphi = 0; jphi < nphi; jphi++) {
3761           double ccc1 = digivarianceHB[i][jeta][jphi];
3762           if (adigiHB[i][jeta][jphi] > 0.) {
3763             HBpositivedirectionDigiD2->Fill(jphi, ccc1);
3764             ccctest = 1.;  //HBpositivedirectionDigiD2->SetBinError(i,0.01);
3765           }
3766         }  // for jphi
3767         if (ccctest > 0.) {
3768           //cout<<"1515       kcountHBpositivedirectionDigiD2   =     "<<kcountHBpositivedirectionDigiD2  <<"   jeta-41=     "<< jeta-41 <<endl;
3769           c3x5->cd(kcountHBpositivedirectionDigiD2);
3770           HBpositivedirectionDigiD2->SetMarkerStyle(20);
3771           HBpositivedirectionDigiD2->SetMarkerSize(0.4);
3772           HBpositivedirectionDigiD2->GetYaxis()->SetLabelSize(0.04);
3773           HBpositivedirectionDigiD2->SetXTitle("HBpositivedirectionDigiD2 \b");
3774           HBpositivedirectionDigiD2->SetMarkerColor(2);
3775           HBpositivedirectionDigiD2->SetLineColor(0);
3776           gPad->SetGridy();
3777           gPad->SetGridx();
3778           //       gPad->SetLogy();
3779           if (kcountHBpositivedirectionDigiD2 == 1)
3780             HBpositivedirectionDigiD2->SetXTitle("D for HB+ jeta =  0; depth = 2 \b");
3781           if (kcountHBpositivedirectionDigiD2 == 2)
3782             HBpositivedirectionDigiD2->SetXTitle("D for HB+ jeta =  1; depth = 2 \b");
3783           if (kcountHBpositivedirectionDigiD2 == 3)
3784             HBpositivedirectionDigiD2->SetXTitle("D for HB+ jeta =  2; depth = 2 \b");
3785           if (kcountHBpositivedirectionDigiD2 == 4)
3786             HBpositivedirectionDigiD2->SetXTitle("D for HB+ jeta =  3; depth = 2 \b");
3787           if (kcountHBpositivedirectionDigiD2 == 5)
3788             HBpositivedirectionDigiD2->SetXTitle("D for HB+ jeta =  4; depth = 2 \b");
3789           if (kcountHBpositivedirectionDigiD2 == 6)
3790             HBpositivedirectionDigiD2->SetXTitle("D for HB+ jeta =  5; depth = 2 \b");
3791           if (kcountHBpositivedirectionDigiD2 == 7)
3792             HBpositivedirectionDigiD2->SetXTitle("D for HB+ jeta =  6; depth = 2 \b");
3793           if (kcountHBpositivedirectionDigiD2 == 8)
3794             HBpositivedirectionDigiD2->SetXTitle("D for HB+ jeta =  7; depth = 2 \b");
3795           if (kcountHBpositivedirectionDigiD2 == 9)
3796             HBpositivedirectionDigiD2->SetXTitle("D for HB+ jeta =  8; depth = 2 \b");
3797           if (kcountHBpositivedirectionDigiD2 == 10)
3798             HBpositivedirectionDigiD2->SetXTitle("D for HB+ jeta =  9; depth = 2 \b");
3799           if (kcountHBpositivedirectionDigiD2 == 11)
3800             HBpositivedirectionDigiD2->SetXTitle("D for HB+ jeta = 10; depth = 2 \b");
3801           if (kcountHBpositivedirectionDigiD2 == 12)
3802             HBpositivedirectionDigiD2->SetXTitle("D for HB+ jeta = 11; depth = 2 \b");
3803           if (kcountHBpositivedirectionDigiD2 == 13)
3804             HBpositivedirectionDigiD2->SetXTitle("D for HB+ jeta = 12; depth = 2 \b");
3805           if (kcountHBpositivedirectionDigiD2 == 14)
3806             HBpositivedirectionDigiD2->SetXTitle("D for HB+ jeta = 13; depth = 2 \b");
3807           if (kcountHBpositivedirectionDigiD2 == 15)
3808             HBpositivedirectionDigiD2->SetXTitle("D for HB+ jeta = 14; depth = 2 \b");
3809           if (kcountHBpositivedirectionDigiD2 == 16)
3810             HBpositivedirectionDigiD2->SetXTitle("D for HB+ jeta = 15; depth = 2 \b");
3811           HBpositivedirectionDigiD2->Draw("Error");
3812           kcountHBpositivedirectionDigiD2++;
3813           if (kcountHBpositivedirectionDigiD2 > 16)
3814             break;  // 4x6 = 24
3815         }           //ccctest>0
3816 
3817       }  // for i
3818     }    //if(jeta-41 >= 0)
3819   }      //for jeta
3820   /////////////////
3821   c3x5->Update();
3822   c3x5->Print("DdigiPositiveDirectionhistD1PhiSymmetryDepth2HB.png");
3823   c3x5->Clear();
3824   // clean-up
3825   if (h2CeffHBpositivedirectionDigiD2)
3826     delete h2CeffHBpositivedirectionDigiD2;
3827   //========================================================================================== 16
3828   //======================================================================
3829   //======================================================================1D plot: D vs phi , different eta,  depth=3
3830   //cout<<"      1D plot: D vs phi , different eta,  depth=3 *****" <<endl;
3831   c3x5->Clear();
3832   c3x5->Divide(4, 4);
3833   c3x5->cd(1);
3834   int kcountHBpositivedirectionDigiD3 = 1;
3835   TH1F* h2CeffHBpositivedirectionDigiD3 = new TH1F("h2CeffHBpositivedirectionDigiD3", "", nphi, 0., 72.);
3836 
3837   for (int jeta = 0; jeta < njeta; jeta++) {
3838     // positivedirectionDigiD:
3839     if (jeta - 41 >= 0) {
3840       //         for (int i=0;i<ndepth;i++) {
3841       // depth=3
3842       for (int i = 2; i < 3; i++) {
3843         TH1F* HBpositivedirectionDigiD3 = (TH1F*)h2CeffHBpositivedirectionDigiD3->Clone("twod1");
3844 
3845         float ccctest = 0;  // to avoid empty massive elements
3846         for (int jphi = 0; jphi < nphi; jphi++) {
3847           double ccc1 = digivarianceHB[i][jeta][jphi];
3848           if (adigiHB[i][jeta][jphi] > 0.) {
3849             HBpositivedirectionDigiD3->Fill(jphi, ccc1);
3850             ccctest = 1.;  //HBpositivedirectionDigiD3->SetBinError(i,0.01);
3851           }
3852         }  // for jphi
3853         if (ccctest > 0.) {
3854           //cout<<"1616       kcountHBpositivedirectionDigiD3   =     "<<kcountHBpositivedirectionDigiD3  <<"   jeta-41=     "<< jeta-41 <<endl;
3855           c3x5->cd(kcountHBpositivedirectionDigiD3);
3856           HBpositivedirectionDigiD3->SetMarkerStyle(20);
3857           HBpositivedirectionDigiD3->SetMarkerSize(0.4);
3858           HBpositivedirectionDigiD3->GetYaxis()->SetLabelSize(0.04);
3859           HBpositivedirectionDigiD3->SetXTitle("HBpositivedirectionDigiD3 \b");
3860           HBpositivedirectionDigiD3->SetMarkerColor(2);
3861           HBpositivedirectionDigiD3->SetLineColor(0);
3862           gPad->SetGridy();
3863           gPad->SetGridx();
3864           //       gPad->SetLogy();
3865           if (kcountHBpositivedirectionDigiD3 == 1)
3866             HBpositivedirectionDigiD3->SetXTitle("D for HB+ jeta =  0; depth = 3 \b");
3867           if (kcountHBpositivedirectionDigiD3 == 2)
3868             HBpositivedirectionDigiD3->SetXTitle("D for HB+ jeta =  1; depth = 3 \b");
3869           if (kcountHBpositivedirectionDigiD3 == 3)
3870             HBpositivedirectionDigiD3->SetXTitle("D for HB+ jeta =  2; depth = 3 \b");
3871           if (kcountHBpositivedirectionDigiD3 == 4)
3872             HBpositivedirectionDigiD3->SetXTitle("D for HB+ jeta =  3; depth = 3 \b");
3873           if (kcountHBpositivedirectionDigiD3 == 5)
3874             HBpositivedirectionDigiD3->SetXTitle("D for HB+ jeta =  4; depth = 3 \b");
3875           if (kcountHBpositivedirectionDigiD3 == 6)
3876             HBpositivedirectionDigiD3->SetXTitle("D for HB+ jeta =  5; depth = 3 \b");
3877           if (kcountHBpositivedirectionDigiD3 == 7)
3878             HBpositivedirectionDigiD3->SetXTitle("D for HB+ jeta =  6; depth = 3 \b");
3879           if (kcountHBpositivedirectionDigiD3 == 8)
3880             HBpositivedirectionDigiD3->SetXTitle("D for HB+ jeta =  7; depth = 3 \b");
3881           if (kcountHBpositivedirectionDigiD3 == 9)
3882             HBpositivedirectionDigiD3->SetXTitle("D for HB+ jeta =  8; depth = 3 \b");
3883           if (kcountHBpositivedirectionDigiD3 == 10)
3884             HBpositivedirectionDigiD3->SetXTitle("D for HB+ jeta =  9; depth = 3 \b");
3885           if (kcountHBpositivedirectionDigiD3 == 11)
3886             HBpositivedirectionDigiD3->SetXTitle("D for HB+ jeta = 10; depth = 3 \b");
3887           if (kcountHBpositivedirectionDigiD3 == 12)
3888             HBpositivedirectionDigiD3->SetXTitle("D for HB+ jeta = 11; depth = 3 \b");
3889           if (kcountHBpositivedirectionDigiD3 == 13)
3890             HBpositivedirectionDigiD3->SetXTitle("D for HB+ jeta = 12; depth = 3 \b");
3891           if (kcountHBpositivedirectionDigiD3 == 14)
3892             HBpositivedirectionDigiD3->SetXTitle("D for HB+ jeta = 13; depth = 3 \b");
3893           if (kcountHBpositivedirectionDigiD3 == 15)
3894             HBpositivedirectionDigiD3->SetXTitle("D for HB+ jeta = 14; depth = 3 \b");
3895           if (kcountHBpositivedirectionDigiD3 == 16)
3896             HBpositivedirectionDigiD3->SetXTitle("D for HB+ jeta = 15; depth = 3 \b");
3897           HBpositivedirectionDigiD3->Draw("Error");
3898           kcountHBpositivedirectionDigiD3++;
3899           if (kcountHBpositivedirectionDigiD3 > 16)
3900             break;  // 4x6 = 24
3901         }           //ccctest>0
3902 
3903       }  // for i
3904     }    //if(jeta-41 >= 0)
3905   }      //for jeta
3906   /////////////////
3907   c3x5->Update();
3908   c3x5->Print("DdigiPositiveDirectionhistD1PhiSymmetryDepth3HB.png");
3909   c3x5->Clear();
3910   // clean-up
3911   if (h2CeffHBpositivedirectionDigiD3)
3912     delete h2CeffHBpositivedirectionDigiD3;
3913   //========================================================================================== 17
3914   //======================================================================
3915   //======================================================================1D plot: D vs phi , different eta,  depth=4
3916   //cout<<"      1D plot: D vs phi , different eta,  depth=4 *****" <<endl;
3917   c3x5->Clear();
3918   c3x5->Divide(4, 4);
3919   c3x5->cd(1);
3920   int kcountHBpositivedirectionDigiD4 = 1;
3921   TH1F* h2CeffHBpositivedirectionDigiD4 = new TH1F("h2CeffHBpositivedirectionDigiD4", "", nphi, 0., 72.);
3922 
3923   for (int jeta = 0; jeta < njeta; jeta++) {
3924     // positivedirectionDigiD:
3925     if (jeta - 41 >= 0) {
3926       //         for (int i=0;i<ndepth;i++) {
3927       // depth=4
3928       for (int i = 3; i < 4; i++) {
3929         TH1F* HBpositivedirectionDigiD4 = (TH1F*)h2CeffHBpositivedirectionDigiD4->Clone("twod1");
3930 
3931         float ccctest = 0;  // to avoid empty massive elements
3932         for (int jphi = 0; jphi < nphi; jphi++) {
3933           double ccc1 = digivarianceHB[i][jeta][jphi];
3934           if (adigiHB[i][jeta][jphi] > 0.) {
3935             HBpositivedirectionDigiD4->Fill(jphi, ccc1);
3936             ccctest = 1.;  //HBpositivedirectionDigiD4->SetBinError(i,0.01);
3937           }
3938         }  // for jphi
3939         if (ccctest > 0.) {
3940           //cout<<"1717       kcountHBpositivedirectionDigiD4   =     "<<kcountHBpositivedirectionDigiD4  <<"   jeta-41=     "<< jeta-41 <<endl;
3941           c3x5->cd(kcountHBpositivedirectionDigiD4);
3942           HBpositivedirectionDigiD4->SetMarkerStyle(20);
3943           HBpositivedirectionDigiD4->SetMarkerSize(0.4);
3944           HBpositivedirectionDigiD4->GetYaxis()->SetLabelSize(0.04);
3945           HBpositivedirectionDigiD4->SetXTitle("HBpositivedirectionDigiD4 \b");
3946           HBpositivedirectionDigiD4->SetMarkerColor(2);
3947           HBpositivedirectionDigiD4->SetLineColor(0);
3948           gPad->SetGridy();
3949           gPad->SetGridx();
3950           //       gPad->SetLogy();
3951           if (kcountHBpositivedirectionDigiD4 == 1)
3952             HBpositivedirectionDigiD4->SetXTitle("D for HB+ jeta =  0; depth = 4 \b");
3953           if (kcountHBpositivedirectionDigiD4 == 2)
3954             HBpositivedirectionDigiD4->SetXTitle("D for HB+ jeta =  1; depth = 4 \b");
3955           if (kcountHBpositivedirectionDigiD4 == 3)
3956             HBpositivedirectionDigiD4->SetXTitle("D for HB+ jeta =  2; depth = 4 \b");
3957           if (kcountHBpositivedirectionDigiD4 == 4)
3958             HBpositivedirectionDigiD4->SetXTitle("D for HB+ jeta =  3; depth = 4 \b");
3959           if (kcountHBpositivedirectionDigiD4 == 5)
3960             HBpositivedirectionDigiD4->SetXTitle("D for HB+ jeta =  4; depth = 4 \b");
3961           if (kcountHBpositivedirectionDigiD4 == 6)
3962             HBpositivedirectionDigiD4->SetXTitle("D for HB+ jeta =  5; depth = 4 \b");
3963           if (kcountHBpositivedirectionDigiD4 == 7)
3964             HBpositivedirectionDigiD4->SetXTitle("D for HB+ jeta =  6; depth = 4 \b");
3965           if (kcountHBpositivedirectionDigiD4 == 8)
3966             HBpositivedirectionDigiD4->SetXTitle("D for HB+ jeta =  7; depth = 4 \b");
3967           if (kcountHBpositivedirectionDigiD4 == 9)
3968             HBpositivedirectionDigiD4->SetXTitle("D for HB+ jeta =  8; depth = 4 \b");
3969           if (kcountHBpositivedirectionDigiD4 == 10)
3970             HBpositivedirectionDigiD4->SetXTitle("D for HB+ jeta =  9; depth = 4 \b");
3971           if (kcountHBpositivedirectionDigiD4 == 11)
3972             HBpositivedirectionDigiD4->SetXTitle("D for HB+ jeta = 10; depth = 4 \b");
3973           if (kcountHBpositivedirectionDigiD4 == 12)
3974             HBpositivedirectionDigiD4->SetXTitle("D for HB+ jeta = 11; depth = 4 \b");
3975           if (kcountHBpositivedirectionDigiD4 == 13)
3976             HBpositivedirectionDigiD4->SetXTitle("D for HB+ jeta = 12; depth = 4 \b");
3977           if (kcountHBpositivedirectionDigiD4 == 14)
3978             HBpositivedirectionDigiD4->SetXTitle("D for HB+ jeta = 13; depth = 4 \b");
3979           if (kcountHBpositivedirectionDigiD4 == 15)
3980             HBpositivedirectionDigiD4->SetXTitle("D for HB+ jeta = 14; depth = 4 \b");
3981           if (kcountHBpositivedirectionDigiD4 == 16)
3982             HBpositivedirectionDigiD4->SetXTitle("D for HB+ jeta = 15; depth = 4 \b");
3983           HBpositivedirectionDigiD4->Draw("Error");
3984           kcountHBpositivedirectionDigiD4++;
3985           if (kcountHBpositivedirectionDigiD4 > 16)
3986             break;  // 4x6 = 24
3987         }           //ccctest>0
3988 
3989       }  // for i
3990     }    //if(jeta-41 >= 0)
3991   }      //for jeta
3992   /////////////////
3993   c3x5->Update();
3994   c3x5->Print("DdigiPositiveDirectionhistD1PhiSymmetryDepth4HB.png");
3995   c3x5->Clear();
3996   // clean-up
3997   if (h2CeffHBpositivedirectionDigiD4)
3998     delete h2CeffHBpositivedirectionDigiD4;
3999 
4000   //========================================================================================== 22214
4001   //======================================================================
4002   //======================================================================1D plot: D vs phi , different eta,  depth=1
4003   //cout<<"      1D plot: D vs phi , different eta,  depth=1 *****" <<endl;
4004   c3x5->Clear();
4005   /////////////////
4006   c3x5->Divide(4, 4);
4007   c3x5->cd(1);
4008   int kcountHBnegativedirectionDigiD1 = 1;
4009   TH1F* h2CeffHBnegativedirectionDigiD1 = new TH1F("h2CeffHBnegativedirectionDigiD1", "", nphi, 0., 72.);
4010 
4011   for (int jeta = 0; jeta < njeta; jeta++) {
4012     // negativedirectionDigiD:
4013     if (jeta - 41 < 0) {
4014       //         for (int i=0;i<ndepth;i++) {
4015       // depth=1
4016       for (int i = 0; i < 1; i++) {
4017         TH1F* HBnegativedirectionDigiD1 = (TH1F*)h2CeffHBnegativedirectionDigiD1->Clone("twod1");
4018 
4019         float ccctest = 0;  // to avoid empty massive elements
4020         for (int jphi = 0; jphi < nphi; jphi++) {
4021           double ccc1 = digivarianceHB[i][jeta][jphi];
4022           if (adigiHB[i][jeta][jphi] > 0.) {
4023             HBnegativedirectionDigiD1->Fill(jphi, ccc1);
4024             ccctest = 1.;  //HBnegativedirectionDigiD1->SetBinError(i,0.01);
4025           }
4026         }  // for jphi
4027         if (ccctest > 0.) {
4028           //cout<<"1414       kcountHBnegativedirectionDigiD1   =     "<<kcountHBnegativedirectionDigiD1  <<"   jeta-41=     "<< jeta-41 <<endl;
4029           c3x5->cd(kcountHBnegativedirectionDigiD1);
4030           HBnegativedirectionDigiD1->SetMarkerStyle(20);
4031           HBnegativedirectionDigiD1->SetMarkerSize(0.4);
4032           HBnegativedirectionDigiD1->GetYaxis()->SetLabelSize(0.04);
4033           HBnegativedirectionDigiD1->SetXTitle("HBnegativedirectionDigiD1 \b");
4034           HBnegativedirectionDigiD1->SetMarkerColor(2);
4035           HBnegativedirectionDigiD1->SetLineColor(0);
4036           gPad->SetGridy();
4037           gPad->SetGridx();
4038           //       gPad->SetLogy();
4039           if (kcountHBnegativedirectionDigiD1 == 1)
4040             HBnegativedirectionDigiD1->SetXTitle("D for HB- jeta =-16; depth = 1 \b");
4041           if (kcountHBnegativedirectionDigiD1 == 2)
4042             HBnegativedirectionDigiD1->SetXTitle("D for HB- jeta =-15; depth = 1 \b");
4043           if (kcountHBnegativedirectionDigiD1 == 3)
4044             HBnegativedirectionDigiD1->SetXTitle("D for HB- jeta =-14; depth = 1 \b");
4045           if (kcountHBnegativedirectionDigiD1 == 4)
4046             HBnegativedirectionDigiD1->SetXTitle("D for HB- jeta =-13; depth = 1 \b");
4047           if (kcountHBnegativedirectionDigiD1 == 5)
4048             HBnegativedirectionDigiD1->SetXTitle("D for HB- jeta =-12; depth = 1 \b");
4049           if (kcountHBnegativedirectionDigiD1 == 6)
4050             HBnegativedirectionDigiD1->SetXTitle("D for HB- jeta =-11; depth = 1 \b");
4051           if (kcountHBnegativedirectionDigiD1 == 7)
4052             HBnegativedirectionDigiD1->SetXTitle("D for HB- jeta =-10; depth = 1 \b");
4053           if (kcountHBnegativedirectionDigiD1 == 8)
4054             HBnegativedirectionDigiD1->SetXTitle("D for HB- jeta =-9; depth = 1 \b");
4055           if (kcountHBnegativedirectionDigiD1 == 9)
4056             HBnegativedirectionDigiD1->SetXTitle("D for HB- jeta =-8; depth = 1 \b");
4057           if (kcountHBnegativedirectionDigiD1 == 10)
4058             HBnegativedirectionDigiD1->SetXTitle("D for HB- jeta =-7; depth = 1 \b");
4059           if (kcountHBnegativedirectionDigiD1 == 11)
4060             HBnegativedirectionDigiD1->SetXTitle("D for HB- jeta =-6; depth = 1 \b");
4061           if (kcountHBnegativedirectionDigiD1 == 12)
4062             HBnegativedirectionDigiD1->SetXTitle("D for HB- jeta =-5; depth = 1 \b");
4063           if (kcountHBnegativedirectionDigiD1 == 13)
4064             HBnegativedirectionDigiD1->SetXTitle("D for HB- jeta =-4; depth = 1 \b");
4065           if (kcountHBnegativedirectionDigiD1 == 14)
4066             HBnegativedirectionDigiD1->SetXTitle("D for HB- jeta =-3; depth = 1 \b");
4067           if (kcountHBnegativedirectionDigiD1 == 15)
4068             HBnegativedirectionDigiD1->SetXTitle("D for HB- jeta =-2; depth = 1 \b");
4069           if (kcountHBnegativedirectionDigiD1 == 16)
4070             HBnegativedirectionDigiD1->SetXTitle("D for HB- jeta =-1; depth = 1 \b");
4071           HBnegativedirectionDigiD1->Draw("Error");
4072           kcountHBnegativedirectionDigiD1++;
4073           if (kcountHBnegativedirectionDigiD1 > 16)
4074             break;  // 4x6 = 24
4075         }           //ccctest>0
4076 
4077       }  // for i
4078     }    //if(jeta-41 < 0)
4079   }      //for jeta
4080   /////////////////
4081   c3x5->Update();
4082   c3x5->Print("DdigiNegativeDirectionhistD1PhiSymmetryDepth1HB.png");
4083   c3x5->Clear();
4084   // clean-up
4085   if (h2CeffHBnegativedirectionDigiD1)
4086     delete h2CeffHBnegativedirectionDigiD1;
4087   //========================================================================================== 22215
4088   //======================================================================
4089   //======================================================================1D plot: D vs phi , different eta,  depth=2
4090   //cout<<"      1D plot: D vs phi , different eta,  depth=2 *****" <<endl;
4091   c3x5->Clear();
4092   c3x5->Divide(4, 4);
4093   c3x5->cd(1);
4094   int kcountHBnegativedirectionDigiD2 = 1;
4095   TH1F* h2CeffHBnegativedirectionDigiD2 = new TH1F("h2CeffHBnegativedirectionDigiD2", "", nphi, 0., 72.);
4096 
4097   for (int jeta = 0; jeta < njeta; jeta++) {
4098     // negativedirectionDigiD:
4099     if (jeta - 41 < 0) {
4100       //         for (int i=0;i<ndepth;i++) {
4101       // depth=2
4102       for (int i = 1; i < 2; i++) {
4103         TH1F* HBnegativedirectionDigiD2 = (TH1F*)h2CeffHBnegativedirectionDigiD2->Clone("twod1");
4104 
4105         float ccctest = 0;  // to avoid empty massive elements
4106         for (int jphi = 0; jphi < nphi; jphi++) {
4107           double ccc1 = digivarianceHB[i][jeta][jphi];
4108           if (adigiHB[i][jeta][jphi] > 0.) {
4109             HBnegativedirectionDigiD2->Fill(jphi, ccc1);
4110             ccctest = 1.;  //HBnegativedirectionDigiD2->SetBinError(i,0.01);
4111           }
4112         }  // for jphi
4113         if (ccctest > 0.) {
4114           //cout<<"1515       kcountHBnegativedirectionDigiD2   =     "<<kcountHBnegativedirectionDigiD2  <<"   jeta-41=     "<< jeta-41 <<endl;
4115           c3x5->cd(kcountHBnegativedirectionDigiD2);
4116           HBnegativedirectionDigiD2->SetMarkerStyle(20);
4117           HBnegativedirectionDigiD2->SetMarkerSize(0.4);
4118           HBnegativedirectionDigiD2->GetYaxis()->SetLabelSize(0.04);
4119           HBnegativedirectionDigiD2->SetXTitle("HBnegativedirectionDigiD2 \b");
4120           HBnegativedirectionDigiD2->SetMarkerColor(2);
4121           HBnegativedirectionDigiD2->SetLineColor(0);
4122           gPad->SetGridy();
4123           gPad->SetGridx();
4124           //       gPad->SetLogy();
4125           if (kcountHBnegativedirectionDigiD2 == 1)
4126             HBnegativedirectionDigiD2->SetXTitle("D for HB- jeta =-16; depth = 2 \b");
4127           if (kcountHBnegativedirectionDigiD2 == 2)
4128             HBnegativedirectionDigiD2->SetXTitle("D for HB- jeta =-15; depth = 2 \b");
4129           if (kcountHBnegativedirectionDigiD2 == 3)
4130             HBnegativedirectionDigiD2->SetXTitle("D for HB- jeta =-14; depth = 2 \b");
4131           if (kcountHBnegativedirectionDigiD2 == 4)
4132             HBnegativedirectionDigiD2->SetXTitle("D for HB- jeta =-13; depth = 2 \b");
4133           if (kcountHBnegativedirectionDigiD2 == 5)
4134             HBnegativedirectionDigiD2->SetXTitle("D for HB- jeta =-12; depth = 2 \b");
4135           if (kcountHBnegativedirectionDigiD2 == 6)
4136             HBnegativedirectionDigiD2->SetXTitle("D for HB- jeta =-11; depth = 2 \b");
4137           if (kcountHBnegativedirectionDigiD2 == 7)
4138             HBnegativedirectionDigiD2->SetXTitle("D for HB- jeta =-10; depth = 2 \b");
4139           if (kcountHBnegativedirectionDigiD2 == 8)
4140             HBnegativedirectionDigiD2->SetXTitle("D for HB- jeta =-9; depth = 2 \b");
4141           if (kcountHBnegativedirectionDigiD2 == 9)
4142             HBnegativedirectionDigiD2->SetXTitle("D for HB- jeta =-8; depth = 2 \b");
4143           if (kcountHBnegativedirectionDigiD2 == 10)
4144             HBnegativedirectionDigiD2->SetXTitle("D for HB- jeta =-7; depth = 2 \b");
4145           if (kcountHBnegativedirectionDigiD2 == 11)
4146             HBnegativedirectionDigiD2->SetXTitle("D for HB- jeta =-6; depth = 2 \b");
4147           if (kcountHBnegativedirectionDigiD2 == 12)
4148             HBnegativedirectionDigiD2->SetXTitle("D for HB- jeta =-5; depth = 2 \b");
4149           if (kcountHBnegativedirectionDigiD2 == 13)
4150             HBnegativedirectionDigiD2->SetXTitle("D for HB- jeta =-4; depth = 2 \b");
4151           if (kcountHBnegativedirectionDigiD2 == 14)
4152             HBnegativedirectionDigiD2->SetXTitle("D for HB- jeta =-3; depth = 2 \b");
4153           if (kcountHBnegativedirectionDigiD2 == 15)
4154             HBnegativedirectionDigiD2->SetXTitle("D for HB- jeta =-2; depth = 2 \b");
4155           if (kcountHBnegativedirectionDigiD2 == 16)
4156             HBnegativedirectionDigiD2->SetXTitle("D for HB- jeta =-1; depth = 2 \b");
4157           HBnegativedirectionDigiD2->Draw("Error");
4158           kcountHBnegativedirectionDigiD2++;
4159           if (kcountHBnegativedirectionDigiD2 > 16)
4160             break;  // 4x6 = 24
4161         }           //ccctest>0
4162 
4163       }  // for i
4164     }    //if(jeta-41 < 0)
4165   }      //for jeta
4166   /////////////////
4167   c3x5->Update();
4168   c3x5->Print("DdigiNegativeDirectionhistD1PhiSymmetryDepth2HB.png");
4169   c3x5->Clear();
4170   // clean-up
4171   if (h2CeffHBnegativedirectionDigiD2)
4172     delete h2CeffHBnegativedirectionDigiD2;
4173   //========================================================================================== 22216
4174   //======================================================================
4175   //======================================================================1D plot: D vs phi , different eta,  depth=3
4176   //cout<<"      1D plot: D vs phi , different eta,  depth=3 *****" <<endl;
4177   c3x5->Clear();
4178   c3x5->Divide(4, 4);
4179   c3x5->cd(1);
4180   int kcountHBnegativedirectionDigiD3 = 1;
4181   TH1F* h2CeffHBnegativedirectionDigiD3 = new TH1F("h2CeffHBnegativedirectionDigiD3", "", nphi, 0., 72.);
4182 
4183   for (int jeta = 0; jeta < njeta; jeta++) {
4184     // negativedirectionDigiD:
4185     if (jeta - 41 < 0) {
4186       //         for (int i=0;i<ndepth;i++) {
4187       // depth=3
4188       for (int i = 2; i < 3; i++) {
4189         TH1F* HBnegativedirectionDigiD3 = (TH1F*)h2CeffHBnegativedirectionDigiD3->Clone("twod1");
4190 
4191         float ccctest = 0;  // to avoid empty massive elements
4192         for (int jphi = 0; jphi < nphi; jphi++) {
4193           double ccc1 = digivarianceHB[i][jeta][jphi];
4194           if (adigiHB[i][jeta][jphi] > 0.) {
4195             HBnegativedirectionDigiD3->Fill(jphi, ccc1);
4196             ccctest = 1.;  //HBnegativedirectionDigiD3->SetBinError(i,0.01);
4197           }
4198         }  // for jphi
4199         if (ccctest > 0.) {
4200           //cout<<"1616       kcountHBnegativedirectionDigiD3   =     "<<kcountHBnegativedirectionDigiD3  <<"   jeta-41=     "<< jeta-41 <<endl;
4201           c3x5->cd(kcountHBnegativedirectionDigiD3);
4202           HBnegativedirectionDigiD3->SetMarkerStyle(20);
4203           HBnegativedirectionDigiD3->SetMarkerSize(0.4);
4204           HBnegativedirectionDigiD3->GetYaxis()->SetLabelSize(0.04);
4205           HBnegativedirectionDigiD3->SetXTitle("HBnegativedirectionDigiD3 \b");
4206           HBnegativedirectionDigiD3->SetMarkerColor(2);
4207           HBnegativedirectionDigiD3->SetLineColor(0);
4208           gPad->SetGridy();
4209           gPad->SetGridx();
4210           //       gPad->SetLogy();
4211           if (kcountHBnegativedirectionDigiD3 == 1)
4212             HBnegativedirectionDigiD3->SetXTitle("D for HB- jeta =-16; depth = 3 \b");
4213           if (kcountHBnegativedirectionDigiD3 == 2)
4214             HBnegativedirectionDigiD3->SetXTitle("D for HB- jeta =-15; depth = 3 \b");
4215           if (kcountHBnegativedirectionDigiD3 == 3)
4216             HBnegativedirectionDigiD3->SetXTitle("D for HB- jeta =-14; depth = 3 \b");
4217           if (kcountHBnegativedirectionDigiD3 == 4)
4218             HBnegativedirectionDigiD3->SetXTitle("D for HB- jeta =-13; depth = 3 \b");
4219           if (kcountHBnegativedirectionDigiD3 == 5)
4220             HBnegativedirectionDigiD3->SetXTitle("D for HB- jeta =-12; depth = 3 \b");
4221           if (kcountHBnegativedirectionDigiD3 == 6)
4222             HBnegativedirectionDigiD3->SetXTitle("D for HB- jeta =-11; depth = 3 \b");
4223           if (kcountHBnegativedirectionDigiD3 == 7)
4224             HBnegativedirectionDigiD3->SetXTitle("D for HB- jeta =-10; depth = 3 \b");
4225           if (kcountHBnegativedirectionDigiD3 == 8)
4226             HBnegativedirectionDigiD3->SetXTitle("D for HB- jeta =-9; depth = 3 \b");
4227           if (kcountHBnegativedirectionDigiD3 == 9)
4228             HBnegativedirectionDigiD3->SetXTitle("D for HB- jeta =-8; depth = 3 \b");
4229           if (kcountHBnegativedirectionDigiD3 == 10)
4230             HBnegativedirectionDigiD3->SetXTitle("D for HB- jeta =-7; depth = 3 \b");
4231           if (kcountHBnegativedirectionDigiD3 == 11)
4232             HBnegativedirectionDigiD3->SetXTitle("D for HB- jeta =-6; depth = 3 \b");
4233           if (kcountHBnegativedirectionDigiD3 == 12)
4234             HBnegativedirectionDigiD3->SetXTitle("D for HB- jeta =-5; depth = 3 \b");
4235           if (kcountHBnegativedirectionDigiD3 == 13)
4236             HBnegativedirectionDigiD3->SetXTitle("D for HB- jeta =-4; depth = 3 \b");
4237           if (kcountHBnegativedirectionDigiD3 == 14)
4238             HBnegativedirectionDigiD3->SetXTitle("D for HB- jeta =-3; depth = 3 \b");
4239           if (kcountHBnegativedirectionDigiD3 == 15)
4240             HBnegativedirectionDigiD3->SetXTitle("D for HB- jeta =-2; depth = 3 \b");
4241           if (kcountHBnegativedirectionDigiD3 == 16)
4242             HBnegativedirectionDigiD3->SetXTitle("D for HB- jeta =-1; depth = 3 \b");
4243           HBnegativedirectionDigiD3->Draw("Error");
4244           kcountHBnegativedirectionDigiD3++;
4245           if (kcountHBnegativedirectionDigiD3 > 16)
4246             break;  // 4x6 = 24
4247         }           //ccctest>0
4248 
4249       }  // for i
4250     }    //if(jeta-41 < 0)
4251   }      //for jeta
4252   /////////////////
4253   c3x5->Update();
4254   c3x5->Print("DdigiNegativeDirectionhistD1PhiSymmetryDepth3HB.png");
4255   c3x5->Clear();
4256   // clean-up
4257   if (h2CeffHBnegativedirectionDigiD3)
4258     delete h2CeffHBnegativedirectionDigiD3;
4259   //========================================================================================== 22217
4260   //======================================================================
4261   //======================================================================1D plot: D vs phi , different eta,  depth=4
4262   //cout<<"      1D plot: D vs phi , different eta,  depth=4 *****" <<endl;
4263   c3x5->Clear();
4264   c3x5->Divide(4, 4);
4265   c3x5->cd(1);
4266   int kcountHBnegativedirectionDigiD4 = 1;
4267   TH1F* h2CeffHBnegativedirectionDigiD4 = new TH1F("h2CeffHBnegativedirectionDigiD4", "", nphi, 0., 72.);
4268 
4269   for (int jeta = 0; jeta < njeta; jeta++) {
4270     // negativedirectionDigiD:
4271     if (jeta - 41 < 0) {
4272       //         for (int i=0;i<ndepth;i++) {
4273       // depth=4
4274       for (int i = 3; i < 4; i++) {
4275         TH1F* HBnegativedirectionDigiD4 = (TH1F*)h2CeffHBnegativedirectionDigiD4->Clone("twod1");
4276 
4277         float ccctest = 0;  // to avoid empty massive elements
4278         for (int jphi = 0; jphi < nphi; jphi++) {
4279           double ccc1 = digivarianceHB[i][jeta][jphi];
4280           if (adigiHB[i][jeta][jphi] > 0.) {
4281             HBnegativedirectionDigiD4->Fill(jphi, ccc1);
4282             ccctest = 1.;  //HBnegativedirectionDigiD4->SetBinError(i,0.01);
4283           }
4284         }  // for jphi
4285         if (ccctest > 0.) {
4286           //cout<<"1717       kcountHBnegativedirectionDigiD4   =     "<<kcountHBnegativedirectionDigiD4  <<"   jeta-41=     "<< jeta-41 <<endl;
4287           c3x5->cd(kcountHBnegativedirectionDigiD4);
4288           HBnegativedirectionDigiD4->SetMarkerStyle(20);
4289           HBnegativedirectionDigiD4->SetMarkerSize(0.4);
4290           HBnegativedirectionDigiD4->GetYaxis()->SetLabelSize(0.04);
4291           HBnegativedirectionDigiD4->SetXTitle("HBnegativedirectionDigiD4 \b");
4292           HBnegativedirectionDigiD4->SetMarkerColor(2);
4293           HBnegativedirectionDigiD4->SetLineColor(0);
4294           gPad->SetGridy();
4295           gPad->SetGridx();
4296           //       gPad->SetLogy();
4297           if (kcountHBnegativedirectionDigiD4 == 1)
4298             HBnegativedirectionDigiD4->SetXTitle("D for HB- jeta =-16; depth = 4 \b");
4299           if (kcountHBnegativedirectionDigiD4 == 2)
4300             HBnegativedirectionDigiD4->SetXTitle("D for HB- jeta =-15; depth = 4 \b");
4301           if (kcountHBnegativedirectionDigiD4 == 3)
4302             HBnegativedirectionDigiD4->SetXTitle("D for HB- jeta =-14; depth = 4 \b");
4303           if (kcountHBnegativedirectionDigiD4 == 4)
4304             HBnegativedirectionDigiD4->SetXTitle("D for HB- jeta =-13; depth = 4 \b");
4305           if (kcountHBnegativedirectionDigiD4 == 5)
4306             HBnegativedirectionDigiD4->SetXTitle("D for HB- jeta =-12; depth = 4 \b");
4307           if (kcountHBnegativedirectionDigiD4 == 6)
4308             HBnegativedirectionDigiD4->SetXTitle("D for HB- jeta =-11; depth = 4 \b");
4309           if (kcountHBnegativedirectionDigiD4 == 7)
4310             HBnegativedirectionDigiD4->SetXTitle("D for HB- jeta =-10; depth = 4 \b");
4311           if (kcountHBnegativedirectionDigiD4 == 8)
4312             HBnegativedirectionDigiD4->SetXTitle("D for HB- jeta =-9; depth = 4 \b");
4313           if (kcountHBnegativedirectionDigiD4 == 9)
4314             HBnegativedirectionDigiD4->SetXTitle("D for HB- jeta =-8; depth = 4 \b");
4315           if (kcountHBnegativedirectionDigiD4 == 10)
4316             HBnegativedirectionDigiD4->SetXTitle("D for HB- jeta =-7; depth = 4 \b");
4317           if (kcountHBnegativedirectionDigiD4 == 11)
4318             HBnegativedirectionDigiD4->SetXTitle("D for HB- jeta =-6; depth = 4 \b");
4319           if (kcountHBnegativedirectionDigiD4 == 12)
4320             HBnegativedirectionDigiD4->SetXTitle("D for HB- jeta =-5; depth = 4 \b");
4321           if (kcountHBnegativedirectionDigiD4 == 13)
4322             HBnegativedirectionDigiD4->SetXTitle("D for HB- jeta =-4; depth = 4 \b");
4323           if (kcountHBnegativedirectionDigiD4 == 14)
4324             HBnegativedirectionDigiD4->SetXTitle("D for HB- jeta =-3; depth = 4 \b");
4325           if (kcountHBnegativedirectionDigiD4 == 15)
4326             HBnegativedirectionDigiD4->SetXTitle("D for HB- jeta =-2; depth = 4 \b");
4327           if (kcountHBnegativedirectionDigiD4 == 16)
4328             HBnegativedirectionDigiD4->SetXTitle("D for HB- jeta =-1; depth = 4 \b");
4329           HBnegativedirectionDigiD4->Draw("Error");
4330           kcountHBnegativedirectionDigiD4++;
4331           if (kcountHBnegativedirectionDigiD4 > 16)
4332             break;  // 4x6 = 24
4333         }           //ccctest>0
4334 
4335       }  // for i
4336     }    //if(jeta-41 < 0)
4337   }      //for jeta
4338   /////////////////
4339   c3x5->Update();
4340   c3x5->Print("DdigiNegativeDirectionhistD1PhiSymmetryDepth4HB.png");
4341   c3x5->Clear();
4342   // clean-up
4343   if (h2CeffHBnegativedirectionDigiD4)
4344     delete h2CeffHBnegativedirectionDigiD4;
4345 
4346   //=====================================================================       END of Digi HB for phi-symmetry
4347   //=====================================================================       END of Digi HB for phi-symmetry
4348   //=====================================================================       END of Digi HB for phi-symmetry
4349 
4350   ////////////////////////////////////////////////////////////////////////////////////////////////////         Phi-symmetry for Calibration Group:    Digi HE
4351   ////////////////////////////////////////////////////////////////////////////////////////////////////         Phi-symmetry for Calibration Group:    Digi HE
4352   ////////////////////////////////////////////////////////////////////////////////////////////////////         Phi-symmetry for Calibration Group:    Digi HE
4353   //  int k_max[5]={0,4,7,4,4}; // maximum depth for each subdet
4354   //ndepth = k_max[3];
4355   ndepth = 7;
4356   //  const int ndepth = 7;
4357   double adigihe[ndepth][njeta][njphi];
4358   double digivariancehe[ndepth][njeta][njphi];
4359   //                                   RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR:   Digi HE
4360   TH2F* amplitudechannel1HE1 = (TH2F*)dir->FindObjectAny("h_amplitudechannel1_HE1");
4361   TH2F* amplitudechannel0HE1 = (TH2F*)dir->FindObjectAny("h_amplitudechannel0_HE1");
4362   TH2F* amplitudechannelHE1 = (TH2F*)amplitudechannel1HE1->Clone("amplitudechannelHE1");
4363   amplitudechannelHE1->Divide(amplitudechannel1HE1, amplitudechannel0HE1, 1, 1, "B");
4364   TH2F* amplitudechannel1HE2 = (TH2F*)dir->FindObjectAny("h_amplitudechannel1_HE2");
4365   TH2F* amplitudechannel0HE2 = (TH2F*)dir->FindObjectAny("h_amplitudechannel0_HE2");
4366   TH2F* amplitudechannelHE2 = (TH2F*)amplitudechannel1HE2->Clone("amplitudechannelHE2");
4367   amplitudechannelHE2->Divide(amplitudechannel1HE2, amplitudechannel0HE2, 1, 1, "B");
4368   TH2F* amplitudechannel1HE3 = (TH2F*)dir->FindObjectAny("h_amplitudechannel1_HE3");
4369   TH2F* amplitudechannel0HE3 = (TH2F*)dir->FindObjectAny("h_amplitudechannel0_HE3");
4370   TH2F* amplitudechannelHE3 = (TH2F*)amplitudechannel1HE3->Clone("amplitudechannelHE3");
4371   amplitudechannelHE3->Divide(amplitudechannel1HE3, amplitudechannel0HE3, 1, 1, "B");
4372   TH2F* amplitudechannel1HE4 = (TH2F*)dir->FindObjectAny("h_amplitudechannel1_HE4");
4373   TH2F* amplitudechannel0HE4 = (TH2F*)dir->FindObjectAny("h_amplitudechannel0_HE4");
4374   TH2F* amplitudechannelHE4 = (TH2F*)amplitudechannel1HE4->Clone("amplitudechannelHE4");
4375   amplitudechannelHE4->Divide(amplitudechannel1HE4, amplitudechannel0HE4, 1, 1, "B");
4376   TH2F* amplitudechannel1HE5 = (TH2F*)dir->FindObjectAny("h_amplitudechannel1_HE5");
4377   TH2F* amplitudechannel0HE5 = (TH2F*)dir->FindObjectAny("h_amplitudechannel0_HE5");
4378   TH2F* amplitudechannelHE5 = (TH2F*)amplitudechannel1HE5->Clone("amplitudechannelHE5");
4379   amplitudechannelHE5->Divide(amplitudechannel1HE5, amplitudechannel0HE5, 1, 1, "B");
4380   TH2F* amplitudechannel1HE6 = (TH2F*)dir->FindObjectAny("h_amplitudechannel1_HE6");
4381   TH2F* amplitudechannel0HE6 = (TH2F*)dir->FindObjectAny("h_amplitudechannel0_HE6");
4382   TH2F* amplitudechannelHE6 = (TH2F*)amplitudechannel1HE6->Clone("amplitudechannelHE6");
4383   amplitudechannelHE6->Divide(amplitudechannel1HE6, amplitudechannel0HE6, 1, 1, "B");
4384   TH2F* amplitudechannel1HE7 = (TH2F*)dir->FindObjectAny("h_amplitudechannel1_HE7");
4385   TH2F* amplitudechannel0HE7 = (TH2F*)dir->FindObjectAny("h_amplitudechannel0_HE7");
4386   TH2F* amplitudechannelHE7 = (TH2F*)amplitudechannel1HE7->Clone("amplitudechannelHE7");
4387   amplitudechannelHE7->Divide(amplitudechannel1HE7, amplitudechannel0HE7, 1, 1, "B");
4388   for (int jeta = 0; jeta < njeta; jeta++) {
4389     //====================================================================== PHI normalization & put R into massive adigihe
4390     //preparation for PHI normalization:
4391     double sumdigiHE0 = 0;
4392     int nsumdigiHE0 = 0;
4393     double sumdigiHE1 = 0;
4394     int nsumdigiHE1 = 0;
4395     double sumdigiHE2 = 0;
4396     int nsumdigiHE2 = 0;
4397     double sumdigiHE3 = 0;
4398     int nsumdigiHE3 = 0;
4399     double sumdigiHE4 = 0;
4400     int nsumdigiHE4 = 0;
4401     double sumdigiHE5 = 0;
4402     int nsumdigiHE5 = 0;
4403     double sumdigiHE6 = 0;
4404     int nsumdigiHE6 = 0;
4405     for (int jphi = 0; jphi < njphi; jphi++) {
4406       adigihe[0][jeta][jphi] = amplitudechannelHE1->GetBinContent(jeta + 1, jphi + 1);
4407       adigihe[1][jeta][jphi] = amplitudechannelHE2->GetBinContent(jeta + 1, jphi + 1);
4408       adigihe[2][jeta][jphi] = amplitudechannelHE3->GetBinContent(jeta + 1, jphi + 1);
4409       adigihe[3][jeta][jphi] = amplitudechannelHE4->GetBinContent(jeta + 1, jphi + 1);
4410       adigihe[4][jeta][jphi] = amplitudechannelHE5->GetBinContent(jeta + 1, jphi + 1);
4411       adigihe[5][jeta][jphi] = amplitudechannelHE6->GetBinContent(jeta + 1, jphi + 1);
4412       adigihe[6][jeta][jphi] = amplitudechannelHE7->GetBinContent(jeta + 1, jphi + 1);
4413       if (adigihe[0][jeta][jphi] > 0.) {
4414         sumdigiHE0 += adigihe[0][jeta][jphi];
4415         ++nsumdigiHE0;
4416       }
4417       if (adigihe[1][jeta][jphi] > 0.) {
4418         sumdigiHE1 += adigihe[1][jeta][jphi];
4419         ++nsumdigiHE1;
4420       }
4421       if (adigihe[2][jeta][jphi] > 0.) {
4422         sumdigiHE2 += adigihe[2][jeta][jphi];
4423         ++nsumdigiHE2;
4424       }
4425       if (adigihe[3][jeta][jphi] > 0.) {
4426         sumdigiHE3 += adigihe[3][jeta][jphi];
4427         ++nsumdigiHE3;
4428       }
4429       if (adigihe[4][jeta][jphi] > 0.) {
4430         sumdigiHE4 += adigihe[4][jeta][jphi];
4431         ++nsumdigiHE4;
4432       }
4433       if (adigihe[5][jeta][jphi] > 0.) {
4434         sumdigiHE5 += adigihe[5][jeta][jphi];
4435         ++nsumdigiHE5;
4436       }
4437       if (adigihe[6][jeta][jphi] > 0.) {
4438         sumdigiHE6 += adigihe[6][jeta][jphi];
4439         ++nsumdigiHE6;
4440       }
4441     }  // phi
4442     // PHI normalization:
4443     for (int jphi = 0; jphi < njphi; jphi++) {
4444       if (adigihe[0][jeta][jphi] > 0.)
4445         adigihe[0][jeta][jphi] /= (sumdigiHE0 / nsumdigiHE0);
4446       if (adigihe[1][jeta][jphi] > 0.)
4447         adigihe[1][jeta][jphi] /= (sumdigiHE1 / nsumdigiHE1);
4448       if (adigihe[2][jeta][jphi] > 0.)
4449         adigihe[2][jeta][jphi] /= (sumdigiHE2 / nsumdigiHE2);
4450       if (adigihe[3][jeta][jphi] > 0.)
4451         adigihe[3][jeta][jphi] /= (sumdigiHE3 / nsumdigiHE3);
4452       if (adigihe[4][jeta][jphi] > 0.)
4453         adigihe[4][jeta][jphi] /= (sumdigiHE4 / nsumdigiHE4);
4454       if (adigihe[5][jeta][jphi] > 0.)
4455         adigihe[5][jeta][jphi] /= (sumdigiHE5 / nsumdigiHE5);
4456       if (adigihe[6][jeta][jphi] > 0.)
4457         adigihe[6][jeta][jphi] /= (sumdigiHE6 / nsumdigiHE6);
4458     }  // phi
4459   }    //eta
4460   //------------------------  2D-eta/phi-plot: R, averaged over depthes
4461   //======================================================================
4462   //======================================================================
4463   //cout<<"      R2D-eta/phi-plot: R, averaged over depthes *****" <<endl;
4464   c1x0->Clear();
4465   /////////////////
4466   c1x0->Divide(1, 1);
4467   c1x0->cd(1);
4468   TH2F* GefzRdigiHE42D = new TH2F("GefzRdigiHE42D", "", neta, -41., 41., nphi, 0., 72.);
4469   TH2F* GefzRdigiHE42D0 = new TH2F("GefzRdigiHE42D0", "", neta, -41., 41., nphi, 0., 72.);
4470   TH2F* GefzRdigiHE42DF = (TH2F*)GefzRdigiHE42D0->Clone("GefzRdigiHE42DF");
4471   for (int i = 0; i < ndepth; i++) {
4472     for (int jeta = 0; jeta < neta; jeta++) {
4473       for (int jphi = 0; jphi < nphi; jphi++) {
4474         double ccc1 = adigihe[i][jeta][jphi];
4475         int k2plot = jeta - 41;
4476         int kkk = k2plot;  //if(k2plot >0 ) kkk=k2plot+1; //-41 +41 !=0
4477         if (ccc1 != 0.) {
4478           GefzRdigiHE42D->Fill(kkk, jphi, ccc1);
4479           GefzRdigiHE42D0->Fill(kkk, jphi, 1.);
4480         }
4481       }
4482     }
4483   }
4484   GefzRdigiHE42DF->Divide(GefzRdigiHE42D, GefzRdigiHE42D0, 1, 1, "B");  // average A
4485   gPad->SetGridy();
4486   gPad->SetGridx();  //      gPad->SetLogz();
4487   GefzRdigiHE42DF->SetMarkerStyle(20);
4488   GefzRdigiHE42DF->SetMarkerSize(0.4);
4489   GefzRdigiHE42DF->GetZaxis()->SetLabelSize(0.08);
4490   GefzRdigiHE42DF->SetXTitle("<R>_depth       #eta  \b");
4491   GefzRdigiHE42DF->SetYTitle("      #phi \b");
4492   GefzRdigiHE42DF->SetZTitle("<R>_depth \b");
4493   GefzRdigiHE42DF->SetMarkerColor(2);
4494   GefzRdigiHE42DF->SetLineColor(
4495       0);  //      GefzRdigiHE42DF->SetMaximum(1.000);  //      GefzRdigiHE42DF->SetMinimum(1.0);
4496   GefzRdigiHE42DF->Draw("COLZ");
4497   /////////////////
4498   c1x0->Update();
4499   c1x0->Print("RdigiGeneralD2PhiSymmetryHE.png");
4500   c1x0->Clear();
4501   // clean-up
4502   if (GefzRdigiHE42D)
4503     delete GefzRdigiHE42D;
4504   if (GefzRdigiHE42D0)
4505     delete GefzRdigiHE42D0;
4506   if (GefzRdigiHE42DF)
4507     delete GefzRdigiHE42DF;
4508   //====================================================================== 1D plot: R vs phi , averaged over depthes & eta
4509   //======================================================================
4510   //cout<<"      1D plot: R vs phi , averaged over depthes & eta *****" <<endl;
4511   c1x1->Clear();
4512   /////////////////
4513   c1x1->Divide(1, 1);
4514   c1x1->cd(1);
4515   TH1F* GefzRdigiHE41D = new TH1F("GefzRdigiHE41D", "", nphi, 0., 72.);
4516   TH1F* GefzRdigiHE41D0 = new TH1F("GefzRdigiHE41D0", "", nphi, 0., 72.);
4517   TH1F* GefzRdigiHE41DF = (TH1F*)GefzRdigiHE41D0->Clone("GefzRdigiHE41DF");
4518   for (int jphi = 0; jphi < nphi; jphi++) {
4519     for (int jeta = 0; jeta < neta; jeta++) {
4520       for (int i = 0; i < ndepth; i++) {
4521         double ccc1 = adigihe[i][jeta][jphi];
4522         if (ccc1 != 0.) {
4523           GefzRdigiHE41D->Fill(jphi, ccc1);
4524           GefzRdigiHE41D0->Fill(jphi, 1.);
4525         }
4526       }
4527     }
4528   }
4529   GefzRdigiHE41DF->Divide(GefzRdigiHE41D, GefzRdigiHE41D0, 1, 1, "B");  // R averaged over depthes & eta
4530   GefzRdigiHE41D0->Sumw2();
4531   //    for (int jphi=1;jphi<73;jphi++) {GefzRdigiHE41DF->SetBinError(jphi,0.01);}
4532   gPad->SetGridy();
4533   gPad->SetGridx();  //      gPad->SetLogz();
4534   GefzRdigiHE41DF->SetMarkerStyle(20);
4535   GefzRdigiHE41DF->SetMarkerSize(1.4);
4536   GefzRdigiHE41DF->GetZaxis()->SetLabelSize(0.08);
4537   GefzRdigiHE41DF->SetXTitle("#phi  \b");
4538   GefzRdigiHE41DF->SetYTitle("  <R> \b");
4539   GefzRdigiHE41DF->SetZTitle("<R>_PHI  - AllDepthes \b");
4540   GefzRdigiHE41DF->SetMarkerColor(4);
4541   GefzRdigiHE41DF->SetLineColor(
4542       4);  //  GefzRdigiHE41DF->SetMinimum(0.8);     //      GefzRdigiHE41DF->SetMaximum(1.000);
4543   GefzRdigiHE41DF->Draw("Error");
4544   /////////////////
4545   c1x1->Update();
4546   c1x1->Print("RdigiGeneralD1PhiSymmetryHE.png");
4547   c1x1->Clear();
4548   // clean-up
4549   if (GefzRdigiHE41D)
4550     delete GefzRdigiHE41D;
4551   if (GefzRdigiHE41D0)
4552     delete GefzRdigiHE41D0;
4553   if (GefzRdigiHE41DF)
4554     delete GefzRdigiHE41DF;
4555 
4556   //========================================================================================== 4
4557   //======================================================================
4558   //======================================================================1D plot: R vs phi , different eta,  depth=1
4559   //cout<<"      1D plot: R vs phi , different eta,  depth=1 *****" <<endl;
4560   c3x5->Clear();
4561   /////////////////
4562   c3x5->Divide(3, 5);
4563   c3x5->cd(1);
4564   int kcountHEpositivedirectionDigi1 = 1;
4565   TH1F* h2CeffHEpositivedirectionDigi1 = new TH1F("h2CeffHEpositivedirectionDigi1", "", nphi, 0., 72.);
4566   for (int jeta = 0; jeta < njeta; jeta++) {
4567     // positivedirectionDigi:
4568     if (jeta - 41 >= 0) {
4569       //         for (int i=0;i<ndepth;i++) {
4570       // depth=1
4571       for (int i = 0; i < 1; i++) {
4572         TH1F* HEpositivedirectionDigi1 = (TH1F*)h2CeffHEpositivedirectionDigi1->Clone("twod1");
4573         float ccctest = 0;  // to avoid empty massive elements
4574         for (int jphi = 0; jphi < nphi; jphi++) {
4575           double ccc1 = adigihe[i][jeta][jphi];
4576           if (ccc1 != 0.) {
4577             HEpositivedirectionDigi1->Fill(jphi, ccc1);
4578             ccctest = 1.;  //HEpositivedirectionDigi1->SetBinError(i,0.01);
4579           }
4580         }  // for jphi
4581         if (ccctest > 0.) {
4582           //      cout<<"444        kcountHEpositivedirectionDigi1   =     "<<kcountHEpositivedirectionDigi1  <<"   jeta-41=     "<< jeta-41 <<endl;
4583           c3x5->cd(kcountHEpositivedirectionDigi1);
4584           HEpositivedirectionDigi1->SetMarkerStyle(20);
4585           HEpositivedirectionDigi1->SetMarkerSize(0.4);
4586           HEpositivedirectionDigi1->GetYaxis()->SetLabelSize(0.04);
4587           HEpositivedirectionDigi1->SetXTitle("HEpositivedirectionDigi1 \b");
4588           HEpositivedirectionDigi1->SetMarkerColor(2);
4589           HEpositivedirectionDigi1->SetLineColor(0);
4590           gPad->SetGridy();
4591           gPad->SetGridx();
4592           //       gPad->SetLogy();
4593           if (kcountHEpositivedirectionDigi1 == 1)
4594             HEpositivedirectionDigi1->SetXTitle("R for HE+ jeta = 17; depth = 1 \b");
4595           if (kcountHEpositivedirectionDigi1 == 2)
4596             HEpositivedirectionDigi1->SetXTitle("R for HE+ jeta = 18; depth = 1 \b");
4597           if (kcountHEpositivedirectionDigi1 == 3)
4598             HEpositivedirectionDigi1->SetXTitle("R for HE+ jeta = 19; depth = 1 \b");
4599           if (kcountHEpositivedirectionDigi1 == 4)
4600             HEpositivedirectionDigi1->SetXTitle("R for HE+ jeta = 20; depth = 1 \b");
4601           if (kcountHEpositivedirectionDigi1 == 5)
4602             HEpositivedirectionDigi1->SetXTitle("R for HE+ jeta = 21; depth = 1 \b");
4603           if (kcountHEpositivedirectionDigi1 == 6)
4604             HEpositivedirectionDigi1->SetXTitle("R for HE+ jeta = 22; depth = 1 \b");
4605           if (kcountHEpositivedirectionDigi1 == 7)
4606             HEpositivedirectionDigi1->SetXTitle("R for HE+ jeta = 23; depth = 1 \b");
4607           if (kcountHEpositivedirectionDigi1 == 8)
4608             HEpositivedirectionDigi1->SetXTitle("R for HE+ jeta = 24; depth = 1 \b");
4609           if (kcountHEpositivedirectionDigi1 == 9)
4610             HEpositivedirectionDigi1->SetXTitle("R for HE+ jeta = 25; depth = 1 \b");
4611           if (kcountHEpositivedirectionDigi1 == 10)
4612             HEpositivedirectionDigi1->SetXTitle("R for HE+ jeta = 26; depth = 1 \b");
4613           if (kcountHEpositivedirectionDigi1 == 11)
4614             HEpositivedirectionDigi1->SetXTitle("R for HE+ jeta = 27; depth = 1 \b");
4615           if (kcountHEpositivedirectionDigi1 == 12)
4616             HEpositivedirectionDigi1->SetXTitle("R for HE+ jeta = 28; depth = 1 \b");
4617           HEpositivedirectionDigi1->Draw("Error");
4618           kcountHEpositivedirectionDigi1++;
4619           if (kcountHEpositivedirectionDigi1 > 12)
4620             break;  // 4x6 = 24
4621         }           //ccctest>0
4622 
4623       }  // for i
4624     }    //if(jeta-41 >= 0)
4625   }      //for jeta
4626   /////////////////
4627   c3x5->Update();
4628   c3x5->Print("RdigiPositiveDirectionhistD1PhiSymmetryDepth1HE.png");
4629   c3x5->Clear();
4630   // clean-up
4631   if (h2CeffHEpositivedirectionDigi1)
4632     delete h2CeffHEpositivedirectionDigi1;
4633 
4634   //========================================================================================== 5
4635   //======================================================================
4636   //======================================================================1D plot: R vs phi , different eta,  depth=2
4637   //  cout<<"      1D plot: R vs phi , different eta,  depth=2 *****" <<endl;
4638   c3x5->Clear();
4639   /////////////////
4640   c3x5->Divide(3, 5);
4641   c3x5->cd(1);
4642   int kcountHEpositivedirectionDigi2 = 1;
4643   TH1F* h2CeffHEpositivedirectionDigi2 = new TH1F("h2CeffHEpositivedirectionDigi2", "", nphi, 0., 72.);
4644   for (int jeta = 0; jeta < njeta; jeta++) {
4645     // positivedirectionDigi:
4646     if (jeta - 41 >= 0) {
4647       //         for (int i=0;i<ndepth;i++) {
4648       // depth=2
4649       for (int i = 1; i < 2; i++) {
4650         TH1F* HEpositivedirectionDigi2 = (TH1F*)h2CeffHEpositivedirectionDigi2->Clone("twod1");
4651         float ccctest = 0;  // to avoid empty massive elements
4652         for (int jphi = 0; jphi < nphi; jphi++) {
4653           double ccc1 = adigihe[i][jeta][jphi];
4654           if (ccc1 != 0.) {
4655             HEpositivedirectionDigi2->Fill(jphi, ccc1);
4656             ccctest = 1.;  //HEpositivedirectionDigi2->SetBinError(i,0.01);
4657           }
4658         }  // for jphi
4659         if (ccctest > 0.) {
4660           //cout<<"555        kcountHEpositivedirectionDigi2   =     "<<kcountHEpositivedirectionDigi2  <<"   jeta-41=     "<< jeta-41 <<endl;
4661           c3x5->cd(kcountHEpositivedirectionDigi2);
4662           HEpositivedirectionDigi2->SetMarkerStyle(20);
4663           HEpositivedirectionDigi2->SetMarkerSize(0.4);
4664           HEpositivedirectionDigi2->GetYaxis()->SetLabelSize(0.04);
4665           HEpositivedirectionDigi2->SetXTitle("HEpositivedirectionDigi2 \b");
4666           HEpositivedirectionDigi2->SetMarkerColor(2);
4667           HEpositivedirectionDigi2->SetLineColor(0);
4668           gPad->SetGridy();
4669           gPad->SetGridx();
4670           //       gPad->SetLogy();
4671           if (kcountHEpositivedirectionDigi2 == 1)
4672             HEpositivedirectionDigi2->SetXTitle("R for HE+ jeta = 16; depth = 2 \b");
4673           if (kcountHEpositivedirectionDigi2 == 2)
4674             HEpositivedirectionDigi2->SetXTitle("R for HE+ jeta = 17; depth = 2 \b");
4675           if (kcountHEpositivedirectionDigi2 == 3)
4676             HEpositivedirectionDigi2->SetXTitle("R for HE+ jeta = 18; depth = 2 \b");
4677           if (kcountHEpositivedirectionDigi2 == 4)
4678             HEpositivedirectionDigi2->SetXTitle("R for HE+ jeta = 19; depth = 2 \b");
4679           if (kcountHEpositivedirectionDigi2 == 5)
4680             HEpositivedirectionDigi2->SetXTitle("R for HE+ jeta = 20; depth = 2 \b");
4681           if (kcountHEpositivedirectionDigi2 == 6)
4682             HEpositivedirectionDigi2->SetXTitle("R for HE+ jeta = 21; depth = 2 \b");
4683           if (kcountHEpositivedirectionDigi2 == 7)
4684             HEpositivedirectionDigi2->SetXTitle("R for HE+ jeta = 22; depth = 2 \b");
4685           if (kcountHEpositivedirectionDigi2 == 8)
4686             HEpositivedirectionDigi2->SetXTitle("R for HE+ jeta = 23; depth = 2 \b");
4687           if (kcountHEpositivedirectionDigi2 == 9)
4688             HEpositivedirectionDigi2->SetXTitle("R for HE+ jeta = 24; depth = 2 \b");
4689           if (kcountHEpositivedirectionDigi2 == 10)
4690             HEpositivedirectionDigi2->SetXTitle("R for HE+ jeta = 25; depth = 2 \b");
4691           if (kcountHEpositivedirectionDigi2 == 11)
4692             HEpositivedirectionDigi2->SetXTitle("R for HE+ jeta = 26; depth = 2 \b");
4693           if (kcountHEpositivedirectionDigi2 == 12)
4694             HEpositivedirectionDigi2->SetXTitle("R for HE+ jeta = 27; depth = 2 \b");
4695           if (kcountHEpositivedirectionDigi2 == 13)
4696             HEpositivedirectionDigi2->SetXTitle("R for HE+ jeta = 28; depth = 2 \b");
4697           HEpositivedirectionDigi2->Draw("Error");
4698           kcountHEpositivedirectionDigi2++;
4699           if (kcountHEpositivedirectionDigi2 > 13)
4700             break;  // 4x6 = 24
4701         }           //ccctest>0
4702 
4703       }  // for i
4704     }    //if(jeta-41 >= 0)
4705   }      //for jeta
4706   /////////////////
4707   c3x5->Update();
4708   c3x5->Print("RdigiPositiveDirectionhistD1PhiSymmetryDepth2HE.png");
4709   c3x5->Clear();
4710   // clean-up
4711   if (h2CeffHEpositivedirectionDigi2)
4712     delete h2CeffHEpositivedirectionDigi2;
4713   //========================================================================================== 6
4714   //======================================================================
4715   //======================================================================1D plot: R vs phi , different eta,  depth=3
4716   //cout<<"      1D plot: R vs phi , different eta,  depth=3 *****" <<endl;
4717   c3x5->Clear();
4718   /////////////////
4719   c3x5->Divide(3, 5);
4720   c3x5->cd(1);
4721   int kcountHEpositivedirectionDigi3 = 1;
4722   TH1F* h2CeffHEpositivedirectionDigi3 = new TH1F("h2CeffHEpositivedirectionDigi3", "", nphi, 0., 72.);
4723   for (int jeta = 0; jeta < njeta; jeta++) {
4724     // positivedirectionDigi:
4725     if (jeta - 41 >= 0) {
4726       //         for (int i=0;i<ndepth;i++) {
4727       // depth=3
4728       for (int i = 2; i < 3; i++) {
4729         TH1F* HEpositivedirectionDigi3 = (TH1F*)h2CeffHEpositivedirectionDigi3->Clone("twod1");
4730         float ccctest = 0;  // to avoid empty massive elements
4731         for (int jphi = 0; jphi < nphi; jphi++) {
4732           double ccc1 = adigihe[i][jeta][jphi];
4733           if (ccc1 != 0.) {
4734             HEpositivedirectionDigi3->Fill(jphi, ccc1);
4735             ccctest = 1.;  //HEpositivedirectionDigi3->SetBinError(i,0.01);
4736           }
4737         }  // for jphi
4738         if (ccctest > 0.) {
4739           //cout<<"666        kcountHEpositivedirectionDigi3   =     "<<kcountHEpositivedirectionDigi3  <<"   jeta-41=     "<< jeta-41 <<endl;
4740           c3x5->cd(kcountHEpositivedirectionDigi3);
4741           HEpositivedirectionDigi3->SetMarkerStyle(20);
4742           HEpositivedirectionDigi3->SetMarkerSize(0.4);
4743           HEpositivedirectionDigi3->GetYaxis()->SetLabelSize(0.04);
4744           HEpositivedirectionDigi3->SetXTitle("HEpositivedirectionDigi3 \b");
4745           HEpositivedirectionDigi3->SetMarkerColor(2);
4746           HEpositivedirectionDigi3->SetLineColor(0);
4747           gPad->SetGridy();
4748           gPad->SetGridx();
4749           //       gPad->SetLogy();
4750           if (kcountHEpositivedirectionDigi3 == 1)
4751             HEpositivedirectionDigi3->SetXTitle("R for HE+ jeta = 16; depth = 3 \b");
4752           if (kcountHEpositivedirectionDigi3 == 2)
4753             HEpositivedirectionDigi3->SetXTitle("R for HE+ jeta = 17; depth = 3 \b");
4754           if (kcountHEpositivedirectionDigi3 == 3)
4755             HEpositivedirectionDigi3->SetXTitle("R for HE+ jeta = 18; depth = 3 \b");
4756           if (kcountHEpositivedirectionDigi3 == 4)
4757             HEpositivedirectionDigi3->SetXTitle("R for HE+ jeta = 19; depth = 3 \b");
4758           if (kcountHEpositivedirectionDigi3 == 5)
4759             HEpositivedirectionDigi3->SetXTitle("R for HE+ jeta = 20; depth = 3 \b");
4760           if (kcountHEpositivedirectionDigi3 == 6)
4761             HEpositivedirectionDigi3->SetXTitle("R for HE+ jeta = 21; depth = 3 \b");
4762           if (kcountHEpositivedirectionDigi3 == 7)
4763             HEpositivedirectionDigi3->SetXTitle("R for HE+ jeta = 22; depth = 3 \b");
4764           if (kcountHEpositivedirectionDigi3 == 8)
4765             HEpositivedirectionDigi3->SetXTitle("R for HE+ jeta = 23; depth = 3 \b");
4766           if (kcountHEpositivedirectionDigi3 == 9)
4767             HEpositivedirectionDigi3->SetXTitle("R for HE+ jeta = 24; depth = 3 \b");
4768           if (kcountHEpositivedirectionDigi3 == 10)
4769             HEpositivedirectionDigi3->SetXTitle("R for HE+ jeta = 25; depth = 3 \b");
4770           if (kcountHEpositivedirectionDigi3 == 11)
4771             HEpositivedirectionDigi3->SetXTitle("R for HE+ jeta = 26; depth = 3 \b");
4772           if (kcountHEpositivedirectionDigi3 == 12)
4773             HEpositivedirectionDigi3->SetXTitle("R for HE+ jeta = 27; depth = 3 \b");
4774           if (kcountHEpositivedirectionDigi3 == 13)
4775             HEpositivedirectionDigi3->SetXTitle("R for HE+ jeta = 28; depth = 3 \b");
4776           HEpositivedirectionDigi3->Draw("Error");
4777           kcountHEpositivedirectionDigi3++;
4778           if (kcountHEpositivedirectionDigi3 > 13)
4779             break;  // 4x6 = 24
4780         }           //ccctest>0
4781 
4782       }  // for i
4783     }    //if(jeta-41 >= 0)
4784   }      //for jeta
4785   /////////////////
4786   c3x5->Update();
4787   c3x5->Print("RdigiPositiveDirectionhistD1PhiSymmetryDepth3HE.png");
4788   c3x5->Clear();
4789   // clean-up
4790   if (h2CeffHEpositivedirectionDigi3)
4791     delete h2CeffHEpositivedirectionDigi3;
4792   //========================================================================================== 7
4793   //======================================================================
4794   //======================================================================1D plot: R vs phi , different eta,  depth=4
4795   //cout<<"      1D plot: R vs phi , different eta,  depth=4 *****" <<endl;
4796   c3x5->Clear();
4797   /////////////////
4798   c3x5->Divide(3, 5);
4799   c3x5->cd(1);
4800   int kcountHEpositivedirectionDigi4 = 1;
4801   TH1F* h2CeffHEpositivedirectionDigi4 = new TH1F("h2CeffHEpositivedirectionDigi4", "", nphi, 0., 72.);
4802 
4803   for (int jeta = 0; jeta < njeta; jeta++) {
4804     // positivedirectionDigi:
4805     if (jeta - 41 >= 0) {
4806       //         for (int i=0;i<ndepth;i++) {
4807       // depth=4
4808       for (int i = 3; i < 4; i++) {
4809         TH1F* HEpositivedirectionDigi4 = (TH1F*)h2CeffHEpositivedirectionDigi4->Clone("twod1");
4810 
4811         float ccctest = 0;  // to avoid empty massive elements
4812         for (int jphi = 0; jphi < nphi; jphi++) {
4813           double ccc1 = adigihe[i][jeta][jphi];
4814           if (ccc1 != 0.) {
4815             HEpositivedirectionDigi4->Fill(jphi, ccc1);
4816             ccctest = 1.;  //HEpositivedirectionDigi4->SetBinError(i,0.01);
4817           }
4818         }  // for jphi
4819         if (ccctest > 0.) {
4820           //cout<<"777        kcountHEpositivedirectionDigi4   =     "<<kcountHEpositivedirectionDigi4  <<"   jeta-41=     "<< jeta-41 <<endl;
4821           c3x5->cd(kcountHEpositivedirectionDigi4);
4822           HEpositivedirectionDigi4->SetMarkerStyle(20);
4823           HEpositivedirectionDigi4->SetMarkerSize(0.4);
4824           HEpositivedirectionDigi4->GetYaxis()->SetLabelSize(0.04);
4825           HEpositivedirectionDigi4->SetXTitle("HEpositivedirectionDigi4 \b");
4826           HEpositivedirectionDigi4->SetMarkerColor(2);
4827           HEpositivedirectionDigi4->SetLineColor(0);
4828           gPad->SetGridy();
4829           gPad->SetGridx();
4830           //       gPad->SetLogy();
4831           if (kcountHEpositivedirectionDigi4 == 1)
4832             HEpositivedirectionDigi4->SetXTitle("R for HE+ jeta = 15; depth = 4 \b");
4833           if (kcountHEpositivedirectionDigi4 == 2)
4834             HEpositivedirectionDigi4->SetXTitle("R for HE+ jeta = 17; depth = 4 \b");
4835           if (kcountHEpositivedirectionDigi4 == 3)
4836             HEpositivedirectionDigi4->SetXTitle("R for HE+ jeta = 18; depth = 4 \b");
4837           if (kcountHEpositivedirectionDigi4 == 4)
4838             HEpositivedirectionDigi4->SetXTitle("R for HE+ jeta = 19; depth = 4 \b");
4839           if (kcountHEpositivedirectionDigi4 == 5)
4840             HEpositivedirectionDigi4->SetXTitle("R for HE+ jeta = 20; depth = 4 \b");
4841           if (kcountHEpositivedirectionDigi4 == 6)
4842             HEpositivedirectionDigi4->SetXTitle("R for HE+ jeta = 21; depth = 4 \b");
4843           if (kcountHEpositivedirectionDigi4 == 7)
4844             HEpositivedirectionDigi4->SetXTitle("R for HE+ jeta = 22; depth = 4 \b");
4845           if (kcountHEpositivedirectionDigi4 == 8)
4846             HEpositivedirectionDigi4->SetXTitle("R for HE+ jeta = 23; depth = 4 \b");
4847           if (kcountHEpositivedirectionDigi4 == 9)
4848             HEpositivedirectionDigi4->SetXTitle("R for HE+ jeta = 24; depth = 4 \b");
4849           if (kcountHEpositivedirectionDigi4 == 10)
4850             HEpositivedirectionDigi4->SetXTitle("R for HE+ jeta = 25; depth = 4 \b");
4851           if (kcountHEpositivedirectionDigi4 == 11)
4852             HEpositivedirectionDigi4->SetXTitle("R for HE+ jeta = 26; depth = 4 \b");
4853           if (kcountHEpositivedirectionDigi4 == 12)
4854             HEpositivedirectionDigi4->SetXTitle("R for HE+ jeta = 27; depth = 4 \b");
4855           HEpositivedirectionDigi4->Draw("Error");
4856           kcountHEpositivedirectionDigi4++;
4857           if (kcountHEpositivedirectionDigi4 > 12)
4858             break;  // 4x6 = 24
4859         }           //ccctest>0
4860 
4861       }  // for i
4862     }    //if(jeta-41 >= 0)
4863   }      //for jeta
4864   /////////////////
4865   c3x5->Update();
4866   c3x5->Print("RdigiPositiveDirectionhistD1PhiSymmetryDepth4HE.png");
4867   c3x5->Clear();
4868   // clean-up
4869   if (h2CeffHEpositivedirectionDigi4)
4870     delete h2CeffHEpositivedirectionDigi4;
4871   //========================================================================================== 8
4872   //======================================================================
4873   //======================================================================1D plot: R vs phi , different eta,  depth=5
4874   //cout<<"      1D plot: R vs phi , different eta,  depth=5 *****" <<endl;
4875   c3x5->Clear();
4876   /////////////////
4877   c3x5->Divide(3, 5);
4878   c3x5->cd(1);
4879   int kcountHEpositivedirectionDigi5 = 1;
4880   TH1F* h2CeffHEpositivedirectionDigi5 = new TH1F("h2CeffHEpositivedirectionDigi5", "", nphi, 0., 72.);
4881 
4882   for (int jeta = 0; jeta < njeta; jeta++) {
4883     // positivedirectionDigi:
4884     if (jeta - 41 >= 0) {
4885       //         for (int i=0;i<ndepth;i++) {
4886       // depth=5
4887       for (int i = 4; i < 5; i++) {
4888         TH1F* HEpositivedirectionDigi5 = (TH1F*)h2CeffHEpositivedirectionDigi5->Clone("twod1");
4889 
4890         float ccctest = 0;  // to avoid empty massive elements
4891         for (int jphi = 0; jphi < nphi; jphi++) {
4892           //           cout<<"888  initial      kcountHEpositivedirectionDigi5   =     "<<kcountHEpositivedirectionDigi5  <<"   jeta-41=     "<< jeta-41 <<"   jphi=     "<< jphi <<"   adigihe[i][jeta][jphi]=     "<< adigihe[i][jeta][jphi] <<"  depth=     "<< i <<endl;
4893 
4894           double ccc1 = adigihe[i][jeta][jphi];
4895           if (ccc1 != 0.) {
4896             HEpositivedirectionDigi5->Fill(jphi, ccc1);
4897             ccctest = 1.;  //HEpositivedirectionDigi5->SetBinError(i,0.01);
4898           }
4899         }  // for jphi
4900         if (ccctest > 0.) {
4901           //cout<<"888        kcountHEpositivedirectionDigi5   =     "<<kcountHEpositivedirectionDigi5  <<"   jeta-41=     "<< jeta-41 <<endl;
4902           c3x5->cd(kcountHEpositivedirectionDigi5);
4903           HEpositivedirectionDigi5->SetMarkerStyle(20);
4904           HEpositivedirectionDigi5->SetMarkerSize(0.4);
4905           HEpositivedirectionDigi5->GetYaxis()->SetLabelSize(0.04);
4906           HEpositivedirectionDigi5->SetXTitle("HEpositivedirectionDigi5 \b");
4907           HEpositivedirectionDigi5->SetMarkerColor(2);
4908           HEpositivedirectionDigi5->SetLineColor(0);
4909           gPad->SetGridy();
4910           gPad->SetGridx();
4911           //       gPad->SetLogy();
4912           if (kcountHEpositivedirectionDigi5 == 1)
4913             HEpositivedirectionDigi5->SetXTitle("R for HE+ jeta = 17; depth = 5 \b");
4914           if (kcountHEpositivedirectionDigi5 == 2)
4915             HEpositivedirectionDigi5->SetXTitle("R for HE+ jeta = 18; depth = 5 \b");
4916           if (kcountHEpositivedirectionDigi5 == 3)
4917             HEpositivedirectionDigi5->SetXTitle("R for HE+ jeta = 19; depth = 5 \b");
4918           if (kcountHEpositivedirectionDigi5 == 4)
4919             HEpositivedirectionDigi5->SetXTitle("R for HE+ jeta = 20; depth = 5 \b");
4920           if (kcountHEpositivedirectionDigi5 == 5)
4921             HEpositivedirectionDigi5->SetXTitle("R for HE+ jeta = 21; depth = 5 \b");
4922           if (kcountHEpositivedirectionDigi5 == 6)
4923             HEpositivedirectionDigi5->SetXTitle("R for HE+ jeta = 22; depth = 5 \b");
4924           if (kcountHEpositivedirectionDigi5 == 7)
4925             HEpositivedirectionDigi5->SetXTitle("R for HE+ jeta = 23; depth = 5 \b");
4926           if (kcountHEpositivedirectionDigi5 == 8)
4927             HEpositivedirectionDigi5->SetXTitle("R for HE+ jeta = 24; depth = 5 \b");
4928           if (kcountHEpositivedirectionDigi5 == 9)
4929             HEpositivedirectionDigi5->SetXTitle("R for HE+ jeta = 25; depth = 5 \b");
4930           if (kcountHEpositivedirectionDigi5 == 10)
4931             HEpositivedirectionDigi5->SetXTitle("R for HE+ jeta = 26; depth = 5 \b");
4932           if (kcountHEpositivedirectionDigi5 == 11)
4933             HEpositivedirectionDigi5->SetXTitle("R for HE+ jeta = 27; depth = 5 \b");
4934           HEpositivedirectionDigi5->Draw("Error");
4935           kcountHEpositivedirectionDigi5++;
4936           if (kcountHEpositivedirectionDigi5 > 11)
4937             break;  // 4x6 = 24
4938         }           //ccctest>0
4939 
4940       }  // for i
4941     }    //if(jeta-41 >= 0)
4942   }      //for jeta
4943   /////////////////
4944   c3x5->Update();
4945   c3x5->Print("RdigiPositiveDirectionhistD1PhiSymmetryDepth5HE.png");
4946   c3x5->Clear();
4947   // clean-up
4948   if (h2CeffHEpositivedirectionDigi5)
4949     delete h2CeffHEpositivedirectionDigi5;
4950   //========================================================================================== 9
4951   //======================================================================
4952   //======================================================================1D plot: R vs phi , different eta,  depth=6
4953   //cout<<"      1D plot: R vs phi , different eta,  depth=6 *****" <<endl;
4954   c3x5->Clear();
4955   /////////////////
4956   c3x5->Divide(3, 5);
4957   c3x5->cd(1);
4958   int kcountHEpositivedirectionDigi6 = 1;
4959   TH1F* h2CeffHEpositivedirectionDigi6 = new TH1F("h2CeffHEpositivedirectionDigi6", "", nphi, 0., 72.);
4960 
4961   for (int jeta = 0; jeta < njeta; jeta++) {
4962     // positivedirectionDigi:
4963     if (jeta - 41 >= 0) {
4964       //         for (int i=0;i<ndepth;i++) {
4965       // depth=6
4966       for (int i = 5; i < 6; i++) {
4967         TH1F* HEpositivedirectionDigi6 = (TH1F*)h2CeffHEpositivedirectionDigi6->Clone("twod1");
4968 
4969         float ccctest = 0;  // to avoid empty massive elements
4970         for (int jphi = 0; jphi < nphi; jphi++) {
4971           double ccc1 = adigihe[i][jeta][jphi];
4972           if (ccc1 != 0.) {
4973             HEpositivedirectionDigi6->Fill(jphi, ccc1);
4974             ccctest = 1.;  //HEpositivedirectionDigi6->SetBinError(i,0.01);
4975           }
4976         }  // for jphi
4977         if (ccctest > 0.) {
4978           //cout<<"999        kcountHEpositivedirectionDigi6   =     "<<kcountHEpositivedirectionDigi6  <<"   jeta-41=     "<< jeta-41 <<endl;
4979           c3x5->cd(kcountHEpositivedirectionDigi6);
4980           HEpositivedirectionDigi6->SetMarkerStyle(20);
4981           HEpositivedirectionDigi6->SetMarkerSize(0.4);
4982           HEpositivedirectionDigi6->GetYaxis()->SetLabelSize(0.04);
4983           HEpositivedirectionDigi6->SetXTitle("HEpositivedirectionDigi6 \b");
4984           HEpositivedirectionDigi6->SetMarkerColor(2);
4985           HEpositivedirectionDigi6->SetLineColor(0);
4986           gPad->SetGridy();
4987           gPad->SetGridx();
4988           //       gPad->SetLogy();
4989           if (kcountHEpositivedirectionDigi6 == 1)
4990             HEpositivedirectionDigi6->SetXTitle("R for HE+ jeta = 18; depth = 6 \b");
4991           if (kcountHEpositivedirectionDigi6 == 2)
4992             HEpositivedirectionDigi6->SetXTitle("R for HE+ jeta = 19; depth = 6 \b");
4993           if (kcountHEpositivedirectionDigi6 == 3)
4994             HEpositivedirectionDigi6->SetXTitle("R for HE+ jeta = 20; depth = 6 \b");
4995           if (kcountHEpositivedirectionDigi6 == 4)
4996             HEpositivedirectionDigi6->SetXTitle("R for HE+ jeta = 21; depth = 6 \b");
4997           if (kcountHEpositivedirectionDigi6 == 5)
4998             HEpositivedirectionDigi6->SetXTitle("R for HE+ jeta = 22; depth = 6 \b");
4999           if (kcountHEpositivedirectionDigi6 == 6)
5000             HEpositivedirectionDigi6->SetXTitle("R for HE+ jeta = 23; depth = 6 \b");
5001           if (kcountHEpositivedirectionDigi6 == 7)
5002             HEpositivedirectionDigi6->SetXTitle("R for HE+ jeta = 24; depth = 6 \b");
5003           if (kcountHEpositivedirectionDigi6 == 8)
5004             HEpositivedirectionDigi6->SetXTitle("R for HE+ jeta = 25; depth = 6 \b");
5005           if (kcountHEpositivedirectionDigi6 == 9)
5006             HEpositivedirectionDigi6->SetXTitle("R for HE+ jeta = 26; depth = 6 \b");
5007           if (kcountHEpositivedirectionDigi6 == 10)
5008             HEpositivedirectionDigi6->SetXTitle("R for HE+ jeta = 27; depth = 6 \b");
5009           HEpositivedirectionDigi6->Draw("Error");
5010           kcountHEpositivedirectionDigi6++;
5011           if (kcountHEpositivedirectionDigi6 > 10)
5012             break;  // 4x6 = 24
5013         }           //ccctest>0
5014 
5015       }  // for i
5016     }    //if(jeta-41 >= 0)
5017   }      //for jeta
5018   /////////////////
5019   c3x5->Update();
5020   c3x5->Print("RdigiPositiveDirectionhistD1PhiSymmetryDepth6HE.png");
5021   c3x5->Clear();
5022   // clean-up
5023   if (h2CeffHEpositivedirectionDigi6)
5024     delete h2CeffHEpositivedirectionDigi6;
5025   //========================================================================================== 10
5026   //======================================================================
5027   //======================================================================1D plot: R vs phi , different eta,  depth=7
5028   //cout<<"      1D plot: R vs phi , different eta,  depth=7 *****" <<endl;
5029   c3x5->Clear();
5030   /////////////////
5031   c3x5->Divide(3, 5);
5032   c3x5->cd(1);
5033   int kcountHEpositivedirectionDigi7 = 1;
5034   TH1F* h2CeffHEpositivedirectionDigi7 = new TH1F("h2CeffHEpositivedirectionDigi7", "", nphi, 0., 72.);
5035 
5036   for (int jeta = 0; jeta < njeta; jeta++) {
5037     // positivedirectionDigi:
5038     if (jeta - 41 >= 0) {
5039       //         for (int i=0;i<ndepth;i++) {
5040       // depth=7
5041       for (int i = 6; i < 7; i++) {
5042         TH1F* HEpositivedirectionDigi7 = (TH1F*)h2CeffHEpositivedirectionDigi7->Clone("twod1");
5043 
5044         float ccctest = 0;  // to avoid empty massive elements
5045         for (int jphi = 0; jphi < nphi; jphi++) {
5046           double ccc1 = adigihe[i][jeta][jphi];
5047           if (ccc1 != 0.) {
5048             HEpositivedirectionDigi7->Fill(jphi, ccc1);
5049             ccctest = 1.;  //HEpositivedirectionDigi7->SetBinError(i,0.01);
5050           }
5051         }  // for jphi
5052         if (ccctest > 0.) {
5053           //cout<<"1010       kcountHEpositivedirectionDigi7   =     "<<kcountHEpositivedirectionDigi7  <<"   jeta-41=     "<< jeta-41 <<endl;
5054           c3x5->cd(kcountHEpositivedirectionDigi7);
5055           HEpositivedirectionDigi7->SetMarkerStyle(20);
5056           HEpositivedirectionDigi7->SetMarkerSize(0.4);
5057           HEpositivedirectionDigi7->GetYaxis()->SetLabelSize(0.04);
5058           HEpositivedirectionDigi7->SetXTitle("HEpositivedirectionDigi7 \b");
5059           HEpositivedirectionDigi7->SetMarkerColor(2);
5060           HEpositivedirectionDigi7->SetLineColor(0);
5061           gPad->SetGridy();
5062           gPad->SetGridx();
5063           //       gPad->SetLogy();
5064           if (kcountHEpositivedirectionDigi7 == 1)
5065             HEpositivedirectionDigi7->SetXTitle("R for HE+ jeta = 25; depth = 7 \b");
5066           if (kcountHEpositivedirectionDigi7 == 2)
5067             HEpositivedirectionDigi7->SetXTitle("R for HE+ jeta = 26; depth = 7 \b");
5068           if (kcountHEpositivedirectionDigi7 == 3)
5069             HEpositivedirectionDigi7->SetXTitle("R for HE+ jeta = 27; depth = 7 \b");
5070           HEpositivedirectionDigi7->Draw("Error");
5071           kcountHEpositivedirectionDigi7++;
5072           if (kcountHEpositivedirectionDigi7 > 3)
5073             break;  //
5074         }           //ccctest>0
5075 
5076       }  // for i
5077     }    //if(jeta-41 >= 0)
5078   }      //for jeta
5079   /////////////////
5080   c3x5->Update();
5081   c3x5->Print("RdigiPositiveDirectionhistD1PhiSymmetryDepth7HE.png");
5082   c3x5->Clear();
5083   // clean-up
5084   if (h2CeffHEpositivedirectionDigi7)
5085     delete h2CeffHEpositivedirectionDigi7;
5086 
5087   //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
5088   //========================================================================================== 1114
5089   //======================================================================
5090   //======================================================================1D plot: R vs phi , different eta,  depth=1
5091   //cout<<"      1D plot: R vs phi , different eta,  depth=1 *****" <<endl;
5092   c3x5->Clear();
5093   /////////////////
5094   c3x5->Divide(3, 5);
5095   c3x5->cd(1);
5096   int kcountHEnegativedirectionDigi1 = 1;
5097   TH1F* h2CeffHEnegativedirectionDigi1 = new TH1F("h2CeffHEnegativedirectionDigi1", "", nphi, 0., 72.);
5098   for (int jeta = 0; jeta < njeta; jeta++) {
5099     // negativedirectionDigi:
5100     if (jeta - 41 < 0) {
5101       //         for (int i=0;i<ndepth;i++) {
5102       // depth=1
5103       for (int i = 0; i < 1; i++) {
5104         TH1F* HEnegativedirectionDigi1 = (TH1F*)h2CeffHEnegativedirectionDigi1->Clone("twod1");
5105         float ccctest = 0;  // to avoid empty massive elements
5106         for (int jphi = 0; jphi < nphi; jphi++) {
5107           double ccc1 = adigihe[i][jeta][jphi];
5108           if (ccc1 != 0.) {
5109             HEnegativedirectionDigi1->Fill(jphi, ccc1);
5110             ccctest = 1.;  //HEnegativedirectionDigi1->SetBinError(i,0.01);
5111           }
5112         }  // for jphi
5113         if (ccctest > 0.) {
5114           //      cout<<"444        kcountHEnegativedirectionDigi1   =     "<<kcountHEnegativedirectionDigi1  <<"   jeta-41=     "<< jeta-41 <<endl;
5115           c3x5->cd(kcountHEnegativedirectionDigi1);
5116           HEnegativedirectionDigi1->SetMarkerStyle(20);
5117           HEnegativedirectionDigi1->SetMarkerSize(0.4);
5118           HEnegativedirectionDigi1->GetYaxis()->SetLabelSize(0.04);
5119           HEnegativedirectionDigi1->SetXTitle("HEnegativedirectionDigi1 \b");
5120           HEnegativedirectionDigi1->SetMarkerColor(2);
5121           HEnegativedirectionDigi1->SetLineColor(0);
5122           gPad->SetGridy();
5123           gPad->SetGridx();
5124           //       gPad->SetLogy();
5125           if (kcountHEnegativedirectionDigi1 == 1)
5126             HEnegativedirectionDigi1->SetXTitle("R for HE- jeta =-29; depth = 1 \b");
5127           if (kcountHEnegativedirectionDigi1 == 2)
5128             HEnegativedirectionDigi1->SetXTitle("R for HE- jeta =-28; depth = 1 \b");
5129           if (kcountHEnegativedirectionDigi1 == 3)
5130             HEnegativedirectionDigi1->SetXTitle("R for HE- jeta =-27; depth = 1 \b");
5131           if (kcountHEnegativedirectionDigi1 == 4)
5132             HEnegativedirectionDigi1->SetXTitle("R for HE- jeta =-26; depth = 1 \b");
5133           if (kcountHEnegativedirectionDigi1 == 5)
5134             HEnegativedirectionDigi1->SetXTitle("R for HE- jeta =-25; depth = 1 \b");
5135           if (kcountHEnegativedirectionDigi1 == 6)
5136             HEnegativedirectionDigi1->SetXTitle("R for HE- jeta =-24; depth = 1 \b");
5137           if (kcountHEnegativedirectionDigi1 == 7)
5138             HEnegativedirectionDigi1->SetXTitle("R for HE- jeta =-23; depth = 1 \b");
5139           if (kcountHEnegativedirectionDigi1 == 8)
5140             HEnegativedirectionDigi1->SetXTitle("R for HE- jeta =-22; depth = 1 \b");
5141           if (kcountHEnegativedirectionDigi1 == 9)
5142             HEnegativedirectionDigi1->SetXTitle("R for HE- jeta =-21; depth = 1 \b");
5143           if (kcountHEnegativedirectionDigi1 == 10)
5144             HEnegativedirectionDigi1->SetXTitle("R for HE- jeta =-20; depth = 1 \b");
5145           if (kcountHEnegativedirectionDigi1 == 11)
5146             HEnegativedirectionDigi1->SetXTitle("R for HE- jeta =-19; depth = 1 \b");
5147           if (kcountHEnegativedirectionDigi1 == 12)
5148             HEnegativedirectionDigi1->SetXTitle("R for HE- jeta =-18; depth = 1 \b");
5149           HEnegativedirectionDigi1->Draw("Error");
5150           kcountHEnegativedirectionDigi1++;
5151           if (kcountHEnegativedirectionDigi1 > 12)
5152             break;  // 4x6 = 24
5153         }           //ccctest>0
5154 
5155       }  // for i
5156     }    //if(jeta-41 < 0)
5157   }      //for jeta
5158   /////////////////
5159   c3x5->Update();
5160   c3x5->Print("RdigiNegativeDirectionhistD1PhiSymmetryDepth1HE.png");
5161   c3x5->Clear();
5162   // clean-up
5163   if (h2CeffHEnegativedirectionDigi1)
5164     delete h2CeffHEnegativedirectionDigi1;
5165 
5166   //========================================================================================== 1115
5167   //======================================================================
5168   //======================================================================1D plot: R vs phi , different eta,  depth=2
5169   //  cout<<"      1D plot: R vs phi , different eta,  depth=2 *****" <<endl;
5170   c3x5->Clear();
5171   /////////////////
5172   c3x5->Divide(3, 5);
5173   c3x5->cd(1);
5174   int kcountHEnegativedirectionDigi2 = 1;
5175   TH1F* h2CeffHEnegativedirectionDigi2 = new TH1F("h2CeffHEnegativedirectionDigi2", "", nphi, 0., 72.);
5176   for (int jeta = 0; jeta < njeta; jeta++) {
5177     // negativedirectionDigi:
5178     if (jeta - 41 < 0) {
5179       //         for (int i=0;i<ndepth;i++) {
5180       // depth=2
5181       for (int i = 1; i < 2; i++) {
5182         TH1F* HEnegativedirectionDigi2 = (TH1F*)h2CeffHEnegativedirectionDigi2->Clone("twod1");
5183         float ccctest = 0;  // to avoid empty massive elements
5184         for (int jphi = 0; jphi < nphi; jphi++) {
5185           double ccc1 = adigihe[i][jeta][jphi];
5186           if (ccc1 != 0.) {
5187             HEnegativedirectionDigi2->Fill(jphi, ccc1);
5188             ccctest = 1.;  //HEnegativedirectionDigi2->SetBinError(i,0.01);
5189           }
5190         }  // for jphi
5191         if (ccctest > 0.) {
5192           //cout<<"555        kcountHEnegativedirectionDigi2   =     "<<kcountHEnegativedirectionDigi2  <<"   jeta-41=     "<< jeta-41 <<endl;
5193           c3x5->cd(kcountHEnegativedirectionDigi2);
5194           HEnegativedirectionDigi2->SetMarkerStyle(20);
5195           HEnegativedirectionDigi2->SetMarkerSize(0.4);
5196           HEnegativedirectionDigi2->GetYaxis()->SetLabelSize(0.04);
5197           HEnegativedirectionDigi2->SetXTitle("HEnegativedirectionDigi2 \b");
5198           HEnegativedirectionDigi2->SetMarkerColor(2);
5199           HEnegativedirectionDigi2->SetLineColor(0);
5200           gPad->SetGridy();
5201           gPad->SetGridx();
5202           //       gPad->SetLogy();
5203           if (kcountHEnegativedirectionDigi2 == 1)
5204             HEnegativedirectionDigi2->SetXTitle("R for HE- jeta =-29; depth = 2 \b");
5205           if (kcountHEnegativedirectionDigi2 == 2)
5206             HEnegativedirectionDigi2->SetXTitle("R for HE- jeta =-28; depth = 2 \b");
5207           if (kcountHEnegativedirectionDigi2 == 3)
5208             HEnegativedirectionDigi2->SetXTitle("R for HE- jeta =-27; depth = 2 \b");
5209           if (kcountHEnegativedirectionDigi2 == 4)
5210             HEnegativedirectionDigi2->SetXTitle("R for HE- jeta =-26; depth = 2 \b");
5211           if (kcountHEnegativedirectionDigi2 == 5)
5212             HEnegativedirectionDigi2->SetXTitle("R for HE- jeta =-25; depth = 2 \b");
5213           if (kcountHEnegativedirectionDigi2 == 6)
5214             HEnegativedirectionDigi2->SetXTitle("R for HE- jeta =-24; depth = 2 \b");
5215           if (kcountHEnegativedirectionDigi2 == 7)
5216             HEnegativedirectionDigi2->SetXTitle("R for HE- jeta =-23; depth = 2 \b");
5217           if (kcountHEnegativedirectionDigi2 == 8)
5218             HEnegativedirectionDigi2->SetXTitle("R for HE- jeta =-22; depth = 2 \b");
5219           if (kcountHEnegativedirectionDigi2 == 9)
5220             HEnegativedirectionDigi2->SetXTitle("R for HE- jeta =-21; depth = 2 \b");
5221           if (kcountHEnegativedirectionDigi2 == 10)
5222             HEnegativedirectionDigi2->SetXTitle("R for HE- jeta =-20; depth = 2 \b");
5223           if (kcountHEnegativedirectionDigi2 == 11)
5224             HEnegativedirectionDigi2->SetXTitle("R for HE- jeta =-19; depth = 2 \b");
5225           if (kcountHEnegativedirectionDigi2 == 12)
5226             HEnegativedirectionDigi2->SetXTitle("R for HE- jeta =-18; depth = 2 \b");
5227           if (kcountHEnegativedirectionDigi2 == 13)
5228             HEnegativedirectionDigi2->SetXTitle("R for HE- jeta =-17; depth = 2 \b");
5229           HEnegativedirectionDigi2->Draw("Error");
5230           kcountHEnegativedirectionDigi2++;
5231           if (kcountHEnegativedirectionDigi2 > 13)
5232             break;  // 4x6 = 24
5233         }           //ccctest>0
5234 
5235       }  // for i
5236     }    //if(jeta-41 < 0)
5237   }      //for jeta
5238   /////////////////
5239   c3x5->Update();
5240   c3x5->Print("RdigiNegativeDirectionhistD1PhiSymmetryDepth2HE.png");
5241   c3x5->Clear();
5242   // clean-up
5243   if (h2CeffHEnegativedirectionDigi2)
5244     delete h2CeffHEnegativedirectionDigi2;
5245   //========================================================================================== 1116
5246   //======================================================================
5247   //======================================================================1D plot: R vs phi , different eta,  depth=3
5248   //cout<<"      1D plot: R vs phi , different eta,  depth=3 *****" <<endl;
5249   c3x5->Clear();
5250   /////////////////
5251   c3x5->Divide(3, 5);
5252   c3x5->cd(1);
5253   int kcountHEnegativedirectionDigi3 = 1;
5254   TH1F* h2CeffHEnegativedirectionDigi3 = new TH1F("h2CeffHEnegativedirectionDigi3", "", nphi, 0., 72.);
5255   for (int jeta = 0; jeta < njeta; jeta++) {
5256     // negativedirectionDigi:
5257     if (jeta - 41 < 0) {
5258       //         for (int i=0;i<ndepth;i++) {
5259       // depth=3
5260       for (int i = 2; i < 3; i++) {
5261         TH1F* HEnegativedirectionDigi3 = (TH1F*)h2CeffHEnegativedirectionDigi3->Clone("twod1");
5262         float ccctest = 0;  // to avoid empty massive elements
5263         for (int jphi = 0; jphi < nphi; jphi++) {
5264           double ccc1 = adigihe[i][jeta][jphi];
5265           if (ccc1 != 0.) {
5266             HEnegativedirectionDigi3->Fill(jphi, ccc1);
5267             ccctest = 1.;  //HEnegativedirectionDigi3->SetBinError(i,0.01);
5268           }
5269         }  // for jphi
5270         if (ccctest > 0.) {
5271           //cout<<"666        kcountHEnegativedirectionDigi3   =     "<<kcountHEnegativedirectionDigi3  <<"   jeta-41=     "<< jeta-41 <<endl;
5272           c3x5->cd(kcountHEnegativedirectionDigi3);
5273           HEnegativedirectionDigi3->SetMarkerStyle(20);
5274           HEnegativedirectionDigi3->SetMarkerSize(0.4);
5275           HEnegativedirectionDigi3->GetYaxis()->SetLabelSize(0.04);
5276           HEnegativedirectionDigi3->SetXTitle("HEnegativedirectionDigi3 \b");
5277           HEnegativedirectionDigi3->SetMarkerColor(2);
5278           HEnegativedirectionDigi3->SetLineColor(0);
5279           gPad->SetGridy();
5280           gPad->SetGridx();
5281           //       gPad->SetLogy();
5282           if (kcountHEnegativedirectionDigi3 == 1)
5283             HEnegativedirectionDigi3->SetXTitle("R for HE- jeta =-29; depth = 3 \b");
5284           if (kcountHEnegativedirectionDigi3 == 2)
5285             HEnegativedirectionDigi3->SetXTitle("R for HE- jeta =-28; depth = 3 \b");
5286           if (kcountHEnegativedirectionDigi3 == 3)
5287             HEnegativedirectionDigi3->SetXTitle("R for HE- jeta =-27; depth = 3 \b");
5288           if (kcountHEnegativedirectionDigi3 == 4)
5289             HEnegativedirectionDigi3->SetXTitle("R for HE- jeta =-26; depth = 3 \b");
5290           if (kcountHEnegativedirectionDigi3 == 5)
5291             HEnegativedirectionDigi3->SetXTitle("R for HE- jeta =-25; depth = 3 \b");
5292           if (kcountHEnegativedirectionDigi3 == 6)
5293             HEnegativedirectionDigi3->SetXTitle("R for HE- jeta =-24; depth = 3 \b");
5294           if (kcountHEnegativedirectionDigi3 == 7)
5295             HEnegativedirectionDigi3->SetXTitle("R for HE- jeta =-23; depth = 3 \b");
5296           if (kcountHEnegativedirectionDigi3 == 8)
5297             HEnegativedirectionDigi3->SetXTitle("R for HE- jeta =-22; depth = 3 \b");
5298           if (kcountHEnegativedirectionDigi3 == 9)
5299             HEnegativedirectionDigi3->SetXTitle("R for HE- jeta =-21; depth = 3 \b");
5300           if (kcountHEnegativedirectionDigi3 == 10)
5301             HEnegativedirectionDigi3->SetXTitle("R for HE- jeta =-20; depth = 3 \b");
5302           if (kcountHEnegativedirectionDigi3 == 11)
5303             HEnegativedirectionDigi3->SetXTitle("R for HE- jeta =-19; depth = 3 \b");
5304           if (kcountHEnegativedirectionDigi3 == 12)
5305             HEnegativedirectionDigi3->SetXTitle("R for HE- jeta =-18; depth = 3 \b");
5306           if (kcountHEnegativedirectionDigi3 == 13)
5307             HEnegativedirectionDigi3->SetXTitle("R for HE- jeta =-17; depth = 3 \b");
5308           HEnegativedirectionDigi3->Draw("Error");
5309           kcountHEnegativedirectionDigi3++;
5310           if (kcountHEnegativedirectionDigi3 > 13)
5311             break;  // 4x6 = 24
5312         }           //ccctest>0
5313 
5314       }  // for i
5315     }    //if(jeta-41 < 0)
5316   }      //for jeta
5317   /////////////////
5318   c3x5->Update();
5319   c3x5->Print("RdigiNegativeDirectionhistD1PhiSymmetryDepth3HE.png");
5320   c3x5->Clear();
5321   // clean-up
5322   if (h2CeffHEnegativedirectionDigi3)
5323     delete h2CeffHEnegativedirectionDigi3;
5324   //========================================================================================== 1117
5325   //======================================================================
5326   //======================================================================1D plot: R vs phi , different eta,  depth=4
5327   //cout<<"      1D plot: R vs phi , different eta,  depth=4 *****" <<endl;
5328   c3x5->Clear();
5329   /////////////////
5330   c3x5->Divide(3, 5);
5331   c3x5->cd(1);
5332   int kcountHEnegativedirectionDigi4 = 1;
5333   TH1F* h2CeffHEnegativedirectionDigi4 = new TH1F("h2CeffHEnegativedirectionDigi4", "", nphi, 0., 72.);
5334 
5335   for (int jeta = 0; jeta < njeta; jeta++) {
5336     // negativedirectionDigi:
5337     if (jeta - 41 < 0) {
5338       //         for (int i=0;i<ndepth;i++) {
5339       // depth=4
5340       for (int i = 3; i < 4; i++) {
5341         TH1F* HEnegativedirectionDigi4 = (TH1F*)h2CeffHEnegativedirectionDigi4->Clone("twod1");
5342 
5343         float ccctest = 0;  // to avoid empty massive elements
5344         for (int jphi = 0; jphi < nphi; jphi++) {
5345           double ccc1 = adigihe[i][jeta][jphi];
5346           if (ccc1 != 0.) {
5347             HEnegativedirectionDigi4->Fill(jphi, ccc1);
5348             ccctest = 1.;  //HEnegativedirectionDigi4->SetBinError(i,0.01);
5349           }
5350         }  // for jphi
5351         if (ccctest > 0.) {
5352           //cout<<"777        kcountHEnegativedirectionDigi4   =     "<<kcountHEnegativedirectionDigi4  <<"   jeta-41=     "<< jeta-41 <<endl;
5353           c3x5->cd(kcountHEnegativedirectionDigi4);
5354           HEnegativedirectionDigi4->SetMarkerStyle(20);
5355           HEnegativedirectionDigi4->SetMarkerSize(0.4);
5356           HEnegativedirectionDigi4->GetYaxis()->SetLabelSize(0.04);
5357           HEnegativedirectionDigi4->SetXTitle("HEnegativedirectionDigi4 \b");
5358           HEnegativedirectionDigi4->SetMarkerColor(2);
5359           HEnegativedirectionDigi4->SetLineColor(0);
5360           gPad->SetGridy();
5361           gPad->SetGridx();
5362           //       gPad->SetLogy();
5363           if (kcountHEnegativedirectionDigi4 == 1)
5364             HEnegativedirectionDigi4->SetXTitle("R for HE- jeta =-28; depth = 4 \b");
5365           if (kcountHEnegativedirectionDigi4 == 2)
5366             HEnegativedirectionDigi4->SetXTitle("R for HE- jeta =-27; depth = 4 \b");
5367           if (kcountHEnegativedirectionDigi4 == 3)
5368             HEnegativedirectionDigi4->SetXTitle("R for HE- jeta =-26; depth = 4 \b");
5369           if (kcountHEnegativedirectionDigi4 == 4)
5370             HEnegativedirectionDigi4->SetXTitle("R for HE- jeta =-25; depth = 4 \b");
5371           if (kcountHEnegativedirectionDigi4 == 5)
5372             HEnegativedirectionDigi4->SetXTitle("R for HE- jeta =-24; depth = 4 \b");
5373           if (kcountHEnegativedirectionDigi4 == 6)
5374             HEnegativedirectionDigi4->SetXTitle("R for HE- jeta =-23; depth = 4 \b");
5375           if (kcountHEnegativedirectionDigi4 == 7)
5376             HEnegativedirectionDigi4->SetXTitle("R for HE- jeta =-22; depth = 4 \b");
5377           if (kcountHEnegativedirectionDigi4 == 8)
5378             HEnegativedirectionDigi4->SetXTitle("R for HE- jeta =-21; depth = 4 \b");
5379           if (kcountHEnegativedirectionDigi4 == 9)
5380             HEnegativedirectionDigi4->SetXTitle("R for HE- jeta =-20; depth = 4 \b");
5381           if (kcountHEnegativedirectionDigi4 == 10)
5382             HEnegativedirectionDigi4->SetXTitle("R for HE- jeta =-19; depth = 4 \b");
5383           if (kcountHEnegativedirectionDigi4 == 11)
5384             HEnegativedirectionDigi4->SetXTitle("R for HE- jeta =-18; depth = 4 \b");
5385           if (kcountHEnegativedirectionDigi4 == 12)
5386             HEnegativedirectionDigi4->SetXTitle("R for HE- jeta =-16; depth = 4 \b");
5387           HEnegativedirectionDigi4->Draw("Error");
5388           kcountHEnegativedirectionDigi4++;
5389           if (kcountHEnegativedirectionDigi4 > 12)
5390             break;  // 4x6 = 24
5391         }           //ccctest>0
5392 
5393       }  // for i
5394     }    //if(jeta-41 < 0)
5395   }      //for jeta
5396   /////////////////
5397   c3x5->Update();
5398   c3x5->Print("RdigiNegativeDirectionhistD1PhiSymmetryDepth4HE.png");
5399   c3x5->Clear();
5400   // clean-up
5401   if (h2CeffHEnegativedirectionDigi4)
5402     delete h2CeffHEnegativedirectionDigi4;
5403   //========================================================================================== 1118
5404   //======================================================================
5405   //======================================================================1D plot: R vs phi , different eta,  depth=5
5406   //cout<<"      1D plot: R vs phi , different eta,  depth=5 *****" <<endl;
5407   c3x5->Clear();
5408   /////////////////
5409   c3x5->Divide(3, 5);
5410   c3x5->cd(1);
5411   int kcountHEnegativedirectionDigi5 = 1;
5412   TH1F* h2CeffHEnegativedirectionDigi5 = new TH1F("h2CeffHEnegativedirectionDigi5", "", nphi, 0., 72.);
5413 
5414   for (int jeta = 0; jeta < njeta; jeta++) {
5415     // negativedirectionDigi:
5416     if (jeta - 41 < 0) {
5417       //         for (int i=0;i<ndepth;i++) {
5418       // depth=5
5419       for (int i = 4; i < 5; i++) {
5420         TH1F* HEnegativedirectionDigi5 = (TH1F*)h2CeffHEnegativedirectionDigi5->Clone("twod1");
5421 
5422         float ccctest = 0;  // to avoid empty massive elements
5423         for (int jphi = 0; jphi < nphi; jphi++) {
5424           //           cout<<"888  initial      kcountHEnegativedirectionDigi5   =     "<<kcountHEnegativedirectionDigi5  <<"   jeta-41=     "<< jeta-41 <<"   jphi=     "<< jphi <<"   adigihe[i][jeta][jphi]=     "<< adigihe[i][jeta][jphi] <<"  depth=     "<< i <<endl;
5425 
5426           double ccc1 = adigihe[i][jeta][jphi];
5427           if (ccc1 != 0.) {
5428             HEnegativedirectionDigi5->Fill(jphi, ccc1);
5429             ccctest = 1.;  //HEnegativedirectionDigi5->SetBinError(i,0.01);
5430           }
5431         }  // for jphi
5432         if (ccctest > 0.) {
5433           //cout<<"888        kcountHEnegativedirectionDigi5   =     "<<kcountHEnegativedirectionDigi5  <<"   jeta-41=     "<< jeta-41 <<endl;
5434           c3x5->cd(kcountHEnegativedirectionDigi5);
5435           HEnegativedirectionDigi5->SetMarkerStyle(20);
5436           HEnegativedirectionDigi5->SetMarkerSize(0.4);
5437           HEnegativedirectionDigi5->GetYaxis()->SetLabelSize(0.04);
5438           HEnegativedirectionDigi5->SetXTitle("HEnegativedirectionDigi5 \b");
5439           HEnegativedirectionDigi5->SetMarkerColor(2);
5440           HEnegativedirectionDigi5->SetLineColor(0);
5441           gPad->SetGridy();
5442           gPad->SetGridx();
5443           //       gPad->SetLogy();
5444           if (kcountHEnegativedirectionDigi5 == 1)
5445             HEnegativedirectionDigi5->SetXTitle("R for HE- jeta =-28; depth = 5 \b");
5446           if (kcountHEnegativedirectionDigi5 == 2)
5447             HEnegativedirectionDigi5->SetXTitle("R for HE- jeta =-27; depth = 5 \b");
5448           if (kcountHEnegativedirectionDigi5 == 3)
5449             HEnegativedirectionDigi5->SetXTitle("R for HE- jeta =-26; depth = 5 \b");
5450           if (kcountHEnegativedirectionDigi5 == 4)
5451             HEnegativedirectionDigi5->SetXTitle("R for HE- jeta =-25; depth = 5 \b");
5452           if (kcountHEnegativedirectionDigi5 == 5)
5453             HEnegativedirectionDigi5->SetXTitle("R for HE- jeta =-24; depth = 5 \b");
5454           if (kcountHEnegativedirectionDigi5 == 6)
5455             HEnegativedirectionDigi5->SetXTitle("R for HE- jeta =-23; depth = 5 \b");
5456           if (kcountHEnegativedirectionDigi5 == 7)
5457             HEnegativedirectionDigi5->SetXTitle("R for HE- jeta =-22; depth = 5 \b");
5458           if (kcountHEnegativedirectionDigi5 == 8)
5459             HEnegativedirectionDigi5->SetXTitle("R for HE- jeta =-21; depth = 5 \b");
5460           if (kcountHEnegativedirectionDigi5 == 9)
5461             HEnegativedirectionDigi5->SetXTitle("R for HE- jeta =-20; depth = 5 \b");
5462           if (kcountHEnegativedirectionDigi5 == 10)
5463             HEnegativedirectionDigi5->SetXTitle("R for HE- jeta =-19; depth = 5 \b");
5464           if (kcountHEnegativedirectionDigi5 == 11)
5465             HEnegativedirectionDigi5->SetXTitle("R for HE- jeta =-18; depth = 5 \b");
5466           HEnegativedirectionDigi5->Draw("Error");
5467           kcountHEnegativedirectionDigi5++;
5468           if (kcountHEnegativedirectionDigi5 > 11)
5469             break;  // 4x6 = 24
5470         }           //ccctest>0
5471 
5472       }  // for i
5473     }    //if(jeta-41 < 0)
5474   }      //for jeta
5475   /////////////////
5476   c3x5->Update();
5477   c3x5->Print("RdigiNegativeDirectionhistD1PhiSymmetryDepth5HE.png");
5478   c3x5->Clear();
5479   // clean-up
5480   if (h2CeffHEnegativedirectionDigi5)
5481     delete h2CeffHEnegativedirectionDigi5;
5482   //========================================================================================== 1119
5483   //======================================================================
5484   //======================================================================1D plot: R vs phi , different eta,  depth=6
5485   //cout<<"      1D plot: R vs phi , different eta,  depth=6 *****" <<endl;
5486   c3x5->Clear();
5487   /////////////////
5488   c3x5->Divide(3, 5);
5489   c3x5->cd(1);
5490   int kcountHEnegativedirectionDigi6 = 1;
5491   TH1F* h2CeffHEnegativedirectionDigi6 = new TH1F("h2CeffHEnegativedirectionDigi6", "", nphi, 0., 72.);
5492 
5493   for (int jeta = 0; jeta < njeta; jeta++) {
5494     // negativedirectionDigi:
5495     if (jeta - 41 < 0) {
5496       //         for (int i=0;i<ndepth;i++) {
5497       // depth=6
5498       for (int i = 5; i < 6; i++) {
5499         TH1F* HEnegativedirectionDigi6 = (TH1F*)h2CeffHEnegativedirectionDigi6->Clone("twod1");
5500 
5501         float ccctest = 0;  // to avoid empty massive elements
5502         for (int jphi = 0; jphi < nphi; jphi++) {
5503           double ccc1 = adigihe[i][jeta][jphi];
5504           if (ccc1 != 0.) {
5505             HEnegativedirectionDigi6->Fill(jphi, ccc1);
5506             ccctest = 1.;  //HEnegativedirectionDigi6->SetBinError(i,0.01);
5507           }
5508         }  // for jphi
5509         if (ccctest > 0.) {
5510           //cout<<"999        kcountHEnegativedirectionDigi6   =     "<<kcountHEnegativedirectionDigi6  <<"   jeta-41=     "<< jeta-41 <<endl;
5511           c3x5->cd(kcountHEnegativedirectionDigi6);
5512           HEnegativedirectionDigi6->SetMarkerStyle(20);
5513           HEnegativedirectionDigi6->SetMarkerSize(0.4);
5514           HEnegativedirectionDigi6->GetYaxis()->SetLabelSize(0.04);
5515           HEnegativedirectionDigi6->SetXTitle("HEnegativedirectionDigi6 \b");
5516           HEnegativedirectionDigi6->SetMarkerColor(2);
5517           HEnegativedirectionDigi6->SetLineColor(0);
5518           gPad->SetGridy();
5519           gPad->SetGridx();
5520           //       gPad->SetLogy();
5521           if (kcountHEnegativedirectionDigi6 == 1)
5522             HEnegativedirectionDigi6->SetXTitle("R for HE- jeta =-28; depth = 6 \b");
5523           if (kcountHEnegativedirectionDigi6 == 2)
5524             HEnegativedirectionDigi6->SetXTitle("R for HE- jeta =-27; depth = 6 \b");
5525           if (kcountHEnegativedirectionDigi6 == 3)
5526             HEnegativedirectionDigi6->SetXTitle("R for HE- jeta =-26; depth = 6 \b");
5527           if (kcountHEnegativedirectionDigi6 == 4)
5528             HEnegativedirectionDigi6->SetXTitle("R for HE- jeta =-25; depth = 6 \b");
5529           if (kcountHEnegativedirectionDigi6 == 5)
5530             HEnegativedirectionDigi6->SetXTitle("R for HE- jeta =-24; depth = 6 \b");
5531           if (kcountHEnegativedirectionDigi6 == 6)
5532             HEnegativedirectionDigi6->SetXTitle("R for HE- jeta =-23; depth = 6 \b");
5533           if (kcountHEnegativedirectionDigi6 == 7)
5534             HEnegativedirectionDigi6->SetXTitle("R for HE- jeta =-22; depth = 6 \b");
5535           if (kcountHEnegativedirectionDigi6 == 8)
5536             HEnegativedirectionDigi6->SetXTitle("R for HE- jeta =-21; depth = 6 \b");
5537           if (kcountHEnegativedirectionDigi6 == 9)
5538             HEnegativedirectionDigi6->SetXTitle("R for HE- jeta =-20; depth = 6 \b");
5539           if (kcountHEnegativedirectionDigi6 == 10)
5540             HEnegativedirectionDigi6->SetXTitle("R for HE- jeta =-19; depth = 6 \b");
5541           HEnegativedirectionDigi6->Draw("Error");
5542           kcountHEnegativedirectionDigi6++;
5543           if (kcountHEnegativedirectionDigi6 > 10)
5544             break;  // 4x6 = 24
5545         }           //ccctest>0
5546 
5547       }  // for i
5548     }    //if(jeta-41 < 0)
5549   }      //for jeta
5550   /////////////////
5551   c3x5->Update();
5552   c3x5->Print("RdigiNegativeDirectionhistD1PhiSymmetryDepth6HE.png");
5553   c3x5->Clear();
5554   // clean-up
5555   if (h2CeffHEnegativedirectionDigi6)
5556     delete h2CeffHEnegativedirectionDigi6;
5557   //========================================================================================== 11110
5558   //======================================================================
5559   //======================================================================1D plot: R vs phi , different eta,  depth=7
5560   //cout<<"      1D plot: R vs phi , different eta,  depth=7 *****" <<endl;
5561   c3x5->Clear();
5562   /////////////////
5563   c3x5->Divide(3, 5);
5564   c3x5->cd(1);
5565   int kcountHEnegativedirectionDigi7 = 1;
5566   TH1F* h2CeffHEnegativedirectionDigi7 = new TH1F("h2CeffHEnegativedirectionDigi7", "", nphi, 0., 72.);
5567 
5568   for (int jeta = 0; jeta < njeta; jeta++) {
5569     // negativedirectionDigi:
5570     if (jeta - 41 < 0) {
5571       //         for (int i=0;i<ndepth;i++) {
5572       // depth=7
5573       for (int i = 6; i < 7; i++) {
5574         TH1F* HEnegativedirectionDigi7 = (TH1F*)h2CeffHEnegativedirectionDigi7->Clone("twod1");
5575 
5576         float ccctest = 0;  // to avoid empty massive elements
5577         for (int jphi = 0; jphi < nphi; jphi++) {
5578           double ccc1 = adigihe[i][jeta][jphi];
5579           if (ccc1 != 0.) {
5580             HEnegativedirectionDigi7->Fill(jphi, ccc1);
5581             ccctest = 1.;  //HEnegativedirectionDigi7->SetBinError(i,0.01);
5582           }
5583         }  // for jphi
5584         if (ccctest > 0.) {
5585           //cout<<"1010       kcountHEnegativedirectionDigi7   =     "<<kcountHEnegativedirectionDigi7  <<"   jeta-41=     "<< jeta-41 <<endl;
5586           c3x5->cd(kcountHEnegativedirectionDigi7);
5587           HEnegativedirectionDigi7->SetMarkerStyle(20);
5588           HEnegativedirectionDigi7->SetMarkerSize(0.4);
5589           HEnegativedirectionDigi7->GetYaxis()->SetLabelSize(0.04);
5590           HEnegativedirectionDigi7->SetXTitle("HEnegativedirectionDigi7 \b");
5591           HEnegativedirectionDigi7->SetMarkerColor(2);
5592           HEnegativedirectionDigi7->SetLineColor(0);
5593           gPad->SetGridy();
5594           gPad->SetGridx();
5595           //       gPad->SetLogy();
5596           if (kcountHEnegativedirectionDigi7 == 1)
5597             HEnegativedirectionDigi7->SetXTitle("R for HE- jeta =-28; depth = 7 \b");
5598           if (kcountHEnegativedirectionDigi7 == 2)
5599             HEnegativedirectionDigi7->SetXTitle("R for HE- jeta =-27; depth = 7 \b");
5600           if (kcountHEnegativedirectionDigi7 == 3)
5601             HEnegativedirectionDigi7->SetXTitle("R for HE- jeta =-26; depth = 7 \b");
5602           HEnegativedirectionDigi7->Draw("Error");
5603           kcountHEnegativedirectionDigi7++;
5604           if (kcountHEnegativedirectionDigi7 >