Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:33:00

0001 #include "Rtypes.h"
0002 #include "TROOT.h"
0003 #include "TRint.h"
0004 #include "TObject.h"
0005 #include "TFile.h"
0006 #include "TTree.h"
0007 #include "TH1F.h"
0008 #include "TCanvas.h"
0009 #include "TApplication.h"
0010 #include "TRefArray.h"
0011 #include "TStyle.h"
0012 #include "TGraph.h"
0013 
0014 #include <string>
0015 #include <iostream>
0016 #include <fstream>
0017 #include <iomanip>
0018 
0019 void setTDRStyle();
0020 
0021 void plotValid(char name[10]="Hit34", int logy=0, int mode=0, 
0022            float xoff=0.55, float yoff=0.15, int save=0, int bin=1) {
0023 
0024   char title[80];
0025   if      (name == "Hit01") sprintf (title, "Number of Hits in HCal");
0026   else if (name == "Hit02") sprintf (title, "Hits with wrong Detector ID"); 
0027   else if (name == "Hit03") sprintf (title, "Hits with wrong Subdet");
0028   else if (name == "Hit04") sprintf (title, "Hits with wrong ID");
0029   else if (name == "Hit05") sprintf (title, "Number of Hits in HB");
0030   else if (name == "Hit06") sprintf (title, "Number of Hits in HE");
0031   else if (name == "Hit07") sprintf (title, "Number of Hits in HO");
0032   else if (name == "Hit08") sprintf (title, "Number of Hits in HF");
0033   else if (name == "Hit09") sprintf (title, "Detector ID");
0034   else if (name == "Hit10") sprintf (title, "Subdetectors in HCal");
0035   else if (name == "Hit11") sprintf (title, "Depths in HCal");
0036   else if (name == "Hit12") sprintf (title, "#eta in HCal");
0037   else if (name == "Hit13") sprintf (title, "#phi in HCal");
0038   else if (name == "Hit14") sprintf (title, "Energy in HCal");
0039   else if (name == "Hit15") sprintf (title, "Time in HCal");
0040   else if (name == "Hit16") sprintf (title, "Time in HCal (E wtd)");
0041   else if (name == "Hit17") sprintf (title, "Depths in HB");
0042   else if (name == "Hit18") sprintf (title, "Depths in HE");
0043   else if (name == "Hit19") sprintf (title, "Depths in HO");
0044   else if (name == "Hit20") sprintf (title, "Depths in HF");
0045   else if (name == "Hit21") sprintf (title, "#eta in HB");
0046   else if (name == "Hit22") sprintf (title, "#eta in HE");
0047   else if (name == "Hit23") sprintf (title, "#eta in HO");
0048   else if (name == "Hit24") sprintf (title, "#eta in HF");
0049   else if (name == "Hit25") sprintf (title, "#phi in HB");
0050   else if (name == "Hit26") sprintf (title, "#phi in HE");
0051   else if (name == "Hit27") sprintf (title, "#phi in HO");
0052   else if (name == "Hit28") sprintf (title, "#phi in HF");
0053   else if (name == "Hit29") sprintf (title, "Energy in HB");
0054   else if (name == "Hit30") sprintf (title, "Energy in HE");
0055   else if (name == "Hit31") sprintf (title, "Energy in HO");
0056   else if (name == "Hit32") sprintf (title, "Energy in HF");
0057   else if (name == "Hit33") sprintf (title, "Time in HB");
0058   else if (name == "Hit34") sprintf (title, "Time in HE");
0059   else if (name == "Hit35") sprintf (title, "Time in HO");
0060   else if (name == "Hit36") sprintf (title, "Time in HF");
0061   else if (name == "Lay01") sprintf (title, "Layer number of the Hits");
0062   else if (name == "Lay02") sprintf (title, "#eta of the Hits");
0063   else if (name == "Lay03") sprintf (title, "#phi of the Hits");
0064   else if (name == "Lay04") sprintf (title, "Energy of the Hits");
0065   else if (name == "Lay05") sprintf (title, "Depth  of the Hits");
0066   else if (name == "Lay06") sprintf (title, "Time of the Hits");
0067   else if (name == "Lay07") sprintf (title, "Time (wtd) of Hits");
0068   else if (name == "Lay08") sprintf (title, "#phi vs. #eta of the Hits");
0069   else if (name == "Lay09") sprintf (title, "Hit in Ecal");
0070   else if (name == "Lay10") sprintf (title, "Hit in Hcal");
0071   else if (name == "Lay11") sprintf (title, "Total Hits");
0072   else if (name == "Lay12") sprintf (title, "Energy per layer");
0073   else if (name == "Lay13") sprintf (title, "Lonitudinal Shower Profile");
0074   else if (name == "Lay14") sprintf (title, "Energy per depth");
0075   else if (name == "Lay15") sprintf (title, "Total Energy");
0076   else if (name == "Lay16") sprintf (title, "Energy in HO");
0077   else if (name == "Lay17") sprintf (title, "Energy in HB/HE");
0078   else if (name == "Lay18") sprintf (title, "Energy in HF (Long)");
0079   else if (name == "Lay19") sprintf (title, "Energy in HF (Short)");
0080   else if (name == "Lay20") sprintf (title, "EM   energy in HF");
0081   else if (name == "Lay21") sprintf (title, "Had. energy in HF");
0082   else if (name == "Layl0") sprintf (title, "Energy deposit in Layer 1");
0083   else if (name == "Layl1") sprintf (title, "Energy deposit in Layer 2");
0084   else if (name == "Layl2") sprintf (title, "Energy deposit in Layer 3");
0085   else if (name == "Layl3") sprintf (title, "Energy deposit in Layer 4");
0086   else if (name == "Layl4") sprintf (title, "Energy deposit in Layer 5");
0087   else if (name == "Layl5") sprintf (title, "Energy deposit in Layer 6");
0088   else if (name == "Layl6") sprintf (title, "Energy deposit in Layer 7");
0089   else if (name == "Layl7") sprintf (title, "Energy deposit in Layer 8");
0090   else if (name == "Layl8") sprintf (title, "Energy deposit in Layer 9");
0091   else if (name == "Layl9") sprintf (title, "Energy deposit in Layer 10");
0092   else if (name == "Layl10")sprintf (title, "Energy deposit in Layer 11");
0093   else if (name == "Layl11")sprintf (title, "Energy deposit in Layer 12");
0094   else if (name == "Layl12")sprintf (title, "Energy deposit in Layer 13");
0095   else if (name == "Layl13")sprintf (title, "Energy deposit in Layer 14");
0096   else if (name == "Layl14")sprintf (title, "Energy deposit in Layer 15");
0097   else if (name == "Layl15")sprintf (title, "Energy deposit in Layer 16");
0098   else if (name == "Layl16")sprintf (title, "Energy deposit in Layer 17");
0099   else if (name == "Layl17")sprintf (title, "Energy deposit in Layer 18");
0100   else if (name == "Layl18")sprintf (title, "Energy deposit in Layer 19");
0101   else if (name == "Layl19")sprintf (title, "Energy deposit in Layer 20");
0102   else if (name == "Layl20")sprintf (title, "Energy deposit in Depth 1");
0103   else if (name == "Layl21")sprintf (title, "Energy deposit in Depth 2");
0104   else if (name == "Layl22")sprintf (title, "Energy deposit in Depth 3");
0105   else if (name == "Layl23")sprintf (title, "Energy deposit in Depth 4");
0106   else if (name == "Layl24")sprintf (title, "Energy deposit in Depth 5");
0107   else if (name == "NxN01") sprintf (title, "Energy in ECal (NxN)r");
0108   else if (name == "NxN02") sprintf (title, "Energy in HCal (NxN)r");
0109   else if (name == "NxN03") sprintf (title, "Energy in HO (NxN)r");
0110   else if (name == "NxN04") sprintf (title, "Energy Total (NxN)r");
0111   else if (name == "NxN05") sprintf (title, "Energy in ECal (NxN)");
0112   else if (name == "NxN06") sprintf (title, "Energy in HCal (NxN)");
0113   else if (name == "NxN07") sprintf (title, "Energy in HO (NxN)");
0114   else if (name == "NxN08") sprintf (title, "Energy Total (NxN)");
0115   else if (name == "NxN09") sprintf (title, "Energy of Hits in (NxN)");
0116   else if (name == "NxN10") sprintf (title, "Time   of Hits in (NxN)");
0117   else if (name == "NxN11") sprintf (title, "Dist.  of Hits in (NxN)");
0118   else if (name == "Jet01") sprintf (title, "R of Hits");
0119   else if (name == "Jet02") sprintf (title, "T of Hits");
0120   else if (name == "Jet03") sprintf (title, "E of Hits");
0121   else if (name == "Jet04") sprintf (title, "Ecal Energy (First Jet)");
0122   else if (name == "Jet05") sprintf (title, "Hcal Energy (First Jet)");
0123   else if (name == "Jet06") sprintf (title, "Ho   Energy (First Jet)");
0124   else if (name == "Jet07") sprintf (title, "Total Energy(First Jet)");
0125   else if (name == "Jet08") sprintf (title, "Energy in Hcal vs  Ecal");
0126   else if (name == "Jet09") sprintf (title, "Delta #eta");
0127   else if (name == "Jet10") sprintf (title, "Delta #phi");
0128   else if (name == "Jet11") sprintf (title, "Delta R");
0129   else if (name == "Jet12") sprintf (title, "Di-jet mass");
0130   else if (name == "Jet13") sprintf (title, "Jet Energy");
0131   else if (name == "Jet14") sprintf (title, "Jet #eta");
0132   else if (name == "Jet15") sprintf (title, "Jet #phi");
0133   else                      sprintf (title, "Unknown");
0134 
0135   cout << name << " Title " << title << "\n";
0136   if (title != "Unknown") {
0137     char file1[50], file2[50], file3[50], file4[50], file5[50], file6[50];
0138     char lego1[32], lego2[32], lego3[32], lego4[32], lego5[32], lego6[32];
0139     sprintf (file1, "valid_HB1.root"); sprintf (lego1, "Old default");
0140     sprintf (file2, "valid_HB3.root"); sprintf (lego2, "t^{n} > 1 #mus");
0141     sprintf (file3, "valid_HB4.root"); sprintf (lego3, "E_{Kin}^{n} < 100 keV");
0142     sprintf (file4, "valid_HB5.root"); sprintf (lego4, "E_{Kin}^{n} < 1 MeV");
0143     sprintf (file5, "valid_HB6.root"); sprintf (lego5, "E_{Kin}^{n} < 10 MeV");
0144     sprintf (file6, "valid_HB7.root"); sprintf (lego6, "E_{Kin}^{n} < 100 MeV");
0145     char fileps[50];
0146     sprintf (fileps, "%s.eps", name);
0147     cout << fileps << "\n";
0148 
0149     setTDRStyle();
0150     TCanvas *myc = new TCanvas("myc","",800,600);
0151     if (logy > 0) gPad->SetLogy(1);
0152 
0153     cout << "Open " << file1 << "\n";
0154     TFile* File1 = new TFile(file1);
0155     TDirectory *d1 = (TDirectory*)File1->Get("DQMData/HcalHitValidation");
0156     TH1F* hist1 = (TH1F*) d1->Get(name);
0157     hist1->Rebin(bin);
0158     hist1->SetLineStyle(1);
0159     hist1->SetLineWidth(3);
0160     hist1->SetLineColor(2);
0161     cout << "Open " << file2 << "\n";
0162     TFile* File2 = new TFile(file2);
0163     TDirectory *d2 = (TDirectory*)File2->Get("DQMData/HcalHitValidation");
0164     TH1F* hist2 = (TH1F*) d2->Get(name);
0165     hist2->Rebin(bin);
0166     hist2->SetLineStyle(2);
0167     hist2->SetLineWidth(3);
0168     hist2->SetLineColor(4);
0169     cout << "Open " << file3 << "\n";
0170     TFile* File3 = new TFile(file3);
0171     TDirectory *d3 = (TDirectory*)File3->Get("DQMData/HcalHitValidation");
0172     TH1F* hist3 = (TH1F*) d3->Get(name);
0173     hist3->Rebin(bin);
0174     hist3->SetLineStyle(3);
0175     hist3->SetLineWidth(3);
0176     hist3->SetLineColor(8);
0177     cout << "Open " << file4 << "\n";
0178     TFile* File4 = new TFile(file4);
0179     TDirectory *d4 = (TDirectory*)File4->Get("DQMData/HcalHitValidation");
0180     TH1F* hist4 = (TH1F*) d4->Get(name);
0181     hist4->Rebin(bin);
0182     hist4->SetLineStyle(4);
0183     hist4->SetLineWidth(3);
0184     hist4->SetLineColor(1);
0185     cout << "Open " << file5 << "\n";
0186     TFile* File5 = new TFile(file5);
0187     TDirectory *d5 = (TDirectory*)File5->Get("DQMData/HcalHitValidation");
0188     TH1F* hist5 = (TH1F*) d5->Get(name);
0189     hist5->Rebin(bin);
0190     hist5->SetLineStyle(5);
0191     hist5->SetLineWidth(3);
0192     hist5->SetLineColor(6);
0193     cout << "Open " << file6 << "\n";
0194     TFile* File6 = new TFile(file6);
0195     TDirectory *d6 = (TDirectory*)File6->Get("DQMData/HcalHitValidation");
0196     TH1F* hist6 = (TH1F*) d6->Get(name);
0197     hist6->Rebin(bin);
0198     hist6->SetLineStyle(6);
0199     hist6->SetLineWidth(3);
0200     hist6->SetLineColor(3);
0201 
0202     if (mode == 1) {
0203       hist1->GetXaxis()->SetTitle(title);
0204       hist1->Draw();
0205       hist2->Draw("same");
0206       hist3->Draw("same");
0207       hist4->Draw("same");
0208       hist5->Draw("same");
0209       hist6->Draw("same");
0210     } else if (mode == 2) {
0211       hist2->GetXaxis()->SetTitle(title);
0212       hist2->Draw();
0213       hist1->Draw("same");
0214       hist3->Draw("same");
0215       hist4->Draw("same");
0216       hist5->Draw("same");
0217       hist6->Draw("same");
0218     } else if (mode == 3) {
0219       hist3->GetXaxis()->SetTitle(title);
0220       hist3->Draw();
0221       hist1->Draw("same");
0222       hist2->Draw("same");
0223       hist4->Draw("same");
0224       hist5->Draw("same");
0225       hist6->Draw("same");
0226     } else if (mode == 5) {
0227       hist5->GetXaxis()->SetTitle(title);
0228       hist5->Draw();
0229       hist1->Draw("same");
0230       hist2->Draw("same");
0231       hist3->Draw("same");
0232       hist4->Draw("same");
0233       hist6->Draw("same");
0234     } else if (mode == 6) {
0235       hist6->GetXaxis()->SetTitle(title);
0236       hist6->Draw();
0237       hist1->Draw("same");
0238       hist2->Draw("same");
0239       hist3->Draw("same");
0240       hist4->Draw("same");
0241       hist5->Draw("same");
0242     } else if (mode < 1) {
0243       hist4->GetXaxis()->SetTitle(title);
0244       hist4->Draw();
0245       hist1->Draw("same");
0246       hist2->Draw("same");
0247       hist3->Draw("same");
0248     } else {
0249       hist4->GetXaxis()->SetTitle(title);
0250       hist4->Draw();
0251       hist1->Draw("same");
0252       hist2->Draw("same");
0253       hist3->Draw("same");
0254       hist5->Draw("same");
0255       hist6->Draw("same");
0256     }
0257 
0258     float xmax = xoff+0.3;
0259     float ymax = yoff+0.2;
0260     leg1 = new TLegend(xoff,yoff,xmax,ymax);
0261     leg1->AddEntry(hist1,lego1,"F");
0262     leg1->AddEntry(hist2,lego2,"F");
0263     leg1->AddEntry(hist3,lego3,"F");
0264     leg1->AddEntry(hist4,lego4,"F");
0265     if (mode > 0) {
0266       leg1->AddEntry(hist5,lego5,"F");
0267       leg1->AddEntry(hist6,lego6,"F");
0268     }
0269     leg1->Draw();
0270 
0271     if (save > 0) myc->SaveAs(fileps);
0272 
0273   }
0274 }
0275 void plotHFPosition(char file[100]="hf.out", int save=0) {
0276 
0277   setTDRStyle();
0278   std::ifstream theFile(file);
0279   static const int NPMAX=20000;
0280   int    etaIndex[NPMAX], phiIndex[NPMAX], depths[NPMAX], np=0;
0281   float  radiusH[NPMAX], phiH[NPMAX];
0282   double deg=3.1415926/180.;
0283   while (theFile) {
0284     int   ieta, iphi, idep;
0285     float rr, phideg;
0286     theFile >> ieta >> iphi >> idep >> rr >> phideg;
0287     if (np < NPMAX) {
0288       etaIndex[np] = ieta;
0289       phiIndex[np] = iphi;
0290       depths[np]   = idep;
0291       radiusH[np]  = rr;
0292       if (phideg < 0) phideg += 360;
0293       int iphi = (int)(phideg/20);
0294       float phi = (phideg - iphi*20.0);
0295       if (phi > 10) phi -= 20;
0296       phiH[np] = phi*deg;
0297       np++;
0298     }
0299   }
0300   std::cout << np << " points found\n";
0301   //  for (int i=0; i<np; i++) std::cout << std::setw(4) << i << " " << std::setw(3) << etaIndex[i] << " " << std::setw(3) << phiIndex[i] << " " << depths[i] << " " << std::setw(6) << radiusH[i] << " " << std::setw(6) << phiH[i] << "\n";
0302 
0303   int symbol[14] = {20,21,22,23,24,25,26,27,28,29,30,3,5,2};
0304   int colr[3]    = {2,4,1};
0305   TGraph *gr[3][14];
0306   float x1[NPMAX], y1[NPMAX], x2[NPMAX], y2[NPMAX], x3[NPMAX], y3[NPMAX];
0307   int np1, np2, np3;
0308   for (int i=0; i<13; i++) {
0309     np1 = np2 = np3 = 0;
0310     for (int j=0; j<np; j++) {
0311       if (etaIndex[j] == (i+29)) {
0312     int k = 2;
0313     if (depths[j] == 3) k = 0;
0314     else if (depths[j] == 4) k = 1;
0315     if (k == 0) {
0316       x1[np1] = radiusH[j]*cos(phiH[j]);
0317       y1[np1] = radiusH[j]*sin(phiH[j]);
0318       np1++;
0319       //      if (np1 == 1) std::cout << i << " 0 " <<x1[0] << " " <<y1[0] << "\n";
0320     } else if (k==1) {
0321       x2[np2] = radiusH[j]*cos(phiH[j]);
0322       y2[np2] = radiusH[j]*sin(phiH[j]);
0323       np2++;
0324       //      if (np2 == 1) std::cout << i << " 1 " <<x2[0] << " " <<y2[0] << "\n";
0325     } else {
0326       x3[np3] = radiusH[j]*cos(phiH[j]);
0327       y3[np3] = radiusH[j]*sin(phiH[j]);
0328       np3++;
0329     }
0330       }
0331     }
0332     //    std::cout << "i " << i << " " <<np1 << " " <<np2 << " " <<np3 <<"\n";
0333     if (np1 > 0) {
0334       gr[0][i] = new TGraph(np1,x1,y1); gr[0][i]->SetTitle(""); 
0335       gr[0][i]->SetMarkerStyle(symbol[i]);  gr[0][i]->SetMarkerColor(colr[0]);
0336     } else 
0337       gr[0][i] = 0;
0338     if (np2 > 0) {
0339       gr[1][i] = new TGraph(np2,x2,y2); gr[1][i]->SetTitle(""); 
0340       gr[1][i]->SetMarkerStyle(symbol[i]);  gr[1][i]->SetMarkerColor(colr[1]);
0341     } else 
0342       gr[1][i] = 0;
0343     if (np3 > 0) {
0344       gr[2][i] = new TGraph(np3,x3,y3); gr[2][i]->SetTitle(""); 
0345       gr[2][i]->SetMarkerStyle(symbol[i]);  gr[2][i]->SetMarkerColor(colr[2]);
0346     } else 
0347       gr[2][i] = 0;
0348   }
0349   np1 = np2 = np3 = 0;
0350   for (int j=0; j<np; j++) {
0351     if (etaIndex[j] < 29 || etaIndex[j] > 41) {
0352       int k = 2;
0353       if (depths[j] == 3) k = 0;
0354       else if (depths[j] == 4) k = 1;
0355       if (k == 0) {
0356     x1[np1] = radiusH[j]*cos(phiH[j]);
0357     y1[np1] = radiusH[j]*sin(phiH[j]);
0358     np1++;
0359     if (np1 == 1) std::cout << i << " 0 " <<x1[0] << " " <<y1[0] << "\n";
0360       } else if (k==1) {
0361     x2[np2] = radiusH[j]*cos(phiH[j]);
0362     y2[np2] = radiusH[j]*sin(phiH[j]);
0363     np2++;
0364     if (np2 == 1) std::cout << i << " 1 " <<x2[0] << " " <<y2[0] << "\n";
0365       } else {
0366     x3[np3] = radiusH[j]*cos(phiH[j]);
0367     y3[np3] = radiusH[j]*sin(phiH[j]);
0368     np3++;
0369       }
0370     }
0371   }
0372   //    std::cout << "i " << i << " " <<np1 << " " <<np2 << " " <<np3 <<"\n";
0373   if (np1 > 0) {
0374     gr[0][13] = new TGraph(np1,x1,y1); gr[0][13]->SetTitle(""); 
0375     gr[0][13]->SetMarkerStyle(symbol[13]);  gr[0][13]->SetMarkerColor(colr[0]);
0376   } else 
0377     gr[0][13] = 0;
0378   if (np2 > 0) {
0379     gr[1][13] = new TGraph(np2,x2,y2); gr[1][13]->SetTitle(""); 
0380     gr[1][13]->SetMarkerStyle(symbol[13]);  gr[1][13]->SetMarkerColor(colr[1]);
0381   } else 
0382     gr[1][13] = 0;
0383   if (np3 > 0) {
0384     gr[2][13] = new TGraph(np3,x3,y3); gr[2][13]->SetTitle(""); 
0385     gr[2][13]->SetMarkerStyle(symbol[13]);  gr[2][13]->SetMarkerColor(colr[2]);
0386   } else 
0387     gr[2][13] = 0;
0388 
0389   TCanvas *c0  = new TCanvas("c0","PMT Hits",800,600); 
0390   TH1F *vFrame = c0->DrawFrame(1000.0,-250.0,1500.0,250.0);
0391   vFrame->SetXTitle("x (mm)");
0392   vFrame->SetYTitle("y (mm)");
0393   for (int i=0; i<=13; i++) {
0394     for (int j=0; j<3; j++) {
0395       if (gr[j][i] != 0) {
0396     gr[j][i]->Draw("p");
0397     gr[j][i]->SetLineColor(colr[j]); gr[j][i]->SetLineWidth(2);
0398     //  std::cout << "Next " << i << " " << j << "\n";
0399       }
0400     }
0401   }
0402   TLegend *leg1 = new TLegend(0.75,0.55,0.90,0.90);
0403   char list[40];
0404   for (i=0; i<= 13; i++) {
0405     if (i < 13) sprintf (list, "#eta = %d", i+29);
0406     else        sprintf (list, "Unknown #eta");
0407     if      (gr[0][i] != 0) leg1->AddEntry(gr[0][i], list, "P");
0408     else if (gr[1][i] != 0) leg1->AddEntry(gr[1][i], list, "P");
0409   }
0410   for (i=0; i<2; i++) {
0411     if (i == 0) sprintf (list, "Long Fibre");
0412     else        sprintf (list, "Short Fibre");
0413     if      (gr[i][0] != 0) leg1->AddEntry(gr[i][0], list, "L");
0414     else if (gr[i][1] != 0) leg1->AddEntry(gr[i][1], list, "L");
0415     else if (gr[i][2] != 0) leg1->AddEntry(gr[i][2], list, "L");
0416   }
0417   leg1->SetFillColor(0); leg1->SetTextSize(0.03); 
0418   leg1->SetBorderSize(1); leg1->Draw();
0419 
0420   if (save != 0) {
0421     if (save > 0) c0->SaveAs("PMTHits.eps");
0422     else          c0->SaveAs("PMTHits.gif");
0423   }
0424 }
0425 
0426 void setTDRStyle() {
0427   TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR");
0428 
0429 // For the canvas:
0430   tdrStyle->SetCanvasBorderMode(0);
0431   tdrStyle->SetCanvasColor(kWhite);
0432   tdrStyle->SetCanvasDefH(600); //Height of canvas
0433   tdrStyle->SetCanvasDefW(600); //Width of canvas
0434   tdrStyle->SetCanvasDefX(0);   //POsition on screen
0435   tdrStyle->SetCanvasDefY(0);
0436 
0437 // For the Pad:
0438   tdrStyle->SetPadBorderMode(0);
0439   // tdrStyle->SetPadBorderSize(Width_t size = 1);
0440   tdrStyle->SetPadColor(kWhite);
0441   tdrStyle->SetPadGridX(false);
0442   tdrStyle->SetPadGridY(false);
0443   tdrStyle->SetGridColor(0);
0444   tdrStyle->SetGridStyle(3);
0445   tdrStyle->SetGridWidth(1);
0446 
0447 // For the frame:
0448   tdrStyle->SetFrameBorderMode(0);
0449   tdrStyle->SetFrameBorderSize(1);
0450   tdrStyle->SetFrameFillColor(0);
0451   tdrStyle->SetFrameFillStyle(0);
0452   tdrStyle->SetFrameLineColor(1);
0453   tdrStyle->SetFrameLineStyle(1);
0454   tdrStyle->SetFrameLineWidth(1);
0455 
0456 
0457 //For the date:
0458   tdrStyle->SetOptDate(0);
0459   // tdrStyle->SetDateX(Float_t x = 0.01);
0460   // tdrStyle->SetDateY(Float_t y = 0.01);
0461 
0462 // For the statistics box:
0463   tdrStyle->SetOptFile(0);
0464   tdrStyle->SetOptStat(0); // To display the mean and RMS:   SetOptStat("mr");
0465 
0466 // For the Global title:
0467 
0468   tdrStyle->SetOptTitle(0);
0469   tdrStyle->SetTitleFont(42);
0470   tdrStyle->SetTitleColor(1);
0471   tdrStyle->SetTitleTextColor(1);
0472   tdrStyle->SetTitleFillColor(10);
0473   tdrStyle->SetTitleFontSize(0.05);
0474 
0475 // For the axis titles:
0476 
0477   tdrStyle->SetTitleColor(1, "XYZ");
0478   tdrStyle->SetTitleFont(42, "XYZ");
0479   tdrStyle->SetTitleSize(0.06, "XYZ");
0480   // tdrStyle->SetTitleXSize(Float_t size = 0.02); // Another way to set the size?
0481   // tdrStyle->SetTitleYSize(Float_t size = 0.02);
0482   tdrStyle->SetTitleXOffset(0.7);
0483   tdrStyle->SetTitleYOffset(0.7);
0484   // tdrStyle->SetTitleOffset(1.1, "Y"); // Another way to set the Offset
0485 
0486 // For the axis labels:
0487 
0488   tdrStyle->SetLabelColor(1, "XYZ");
0489   tdrStyle->SetLabelFont(42, "XYZ");
0490   tdrStyle->SetLabelOffset(0.007, "XYZ");
0491   tdrStyle->SetLabelSize(0.03, "XYZ");
0492 
0493 // For the axis:
0494 
0495   tdrStyle->SetAxisColor(1, "XYZ");
0496   tdrStyle->SetStripDecimals(kTRUE);
0497   tdrStyle->SetTickLength(0.03, "XYZ");
0498   tdrStyle->SetNdivisions(510, "XYZ");
0499   tdrStyle->SetPadTickX(1);  // To get tick marks on the opposite side of the frame
0500   tdrStyle->SetPadTickY(1);
0501 
0502   tdrStyle->cd();
0503 
0504 }