Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-03-08 02:26:49

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