Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:49:04

0001 #include "TStyle.h"
0002 
0003 void setTDRStyle() {
0004   TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR");
0005 
0006 // For the canvas:
0007   tdrStyle->SetCanvasBorderMode(0);
0008   tdrStyle->SetCanvasColor(kWhite);
0009   tdrStyle->SetCanvasDefH(600); //Height of canvas
0010   tdrStyle->SetCanvasDefW(600); //Width of canvas
0011   tdrStyle->SetCanvasDefX(0);   //POsition on screen
0012   tdrStyle->SetCanvasDefY(0);
0013 
0014 // For the Pad:
0015   tdrStyle->SetPadBorderMode(0);
0016   // tdrStyle->SetPadBorderSize(Width_t size = 1);
0017   tdrStyle->SetPadColor(kWhite);
0018   tdrStyle->SetPadGridX(false);
0019   tdrStyle->SetPadGridY(false);
0020   tdrStyle->SetGridColor(0);
0021   tdrStyle->SetGridStyle(3);
0022   tdrStyle->SetGridWidth(1);
0023 
0024 // For the frame:
0025   tdrStyle->SetFrameBorderMode(0);
0026   tdrStyle->SetFrameBorderSize(1);
0027   tdrStyle->SetFrameFillColor(0);
0028   tdrStyle->SetFrameFillStyle(0);
0029   tdrStyle->SetFrameLineColor(1);
0030   tdrStyle->SetFrameLineStyle(1);
0031   tdrStyle->SetFrameLineWidth(1);
0032 
0033 
0034 //For the date:
0035   tdrStyle->SetOptDate(0);
0036   // tdrStyle->SetDateX(Float_t x = 0.01);
0037   // tdrStyle->SetDateY(Float_t y = 0.01);
0038 
0039 // For the statistics box:
0040   tdrStyle->SetOptFile(0);
0041   tdrStyle->SetOptStat(0); // To display the mean and RMS:   SetOptStat("mr");
0042 
0043 // For the Global title:
0044 
0045   tdrStyle->SetOptTitle(0);
0046   tdrStyle->SetTitleFont(42);
0047   tdrStyle->SetTitleColor(1);
0048   tdrStyle->SetTitleTextColor(1);
0049   tdrStyle->SetTitleFillColor(10);
0050   tdrStyle->SetTitleFontSize(0.05);
0051 
0052 // For the axis titles:
0053 
0054   tdrStyle->SetTitleColor(1, "XYZ");
0055   tdrStyle->SetTitleFont(42, "XYZ");
0056   tdrStyle->SetTitleSize(0.06, "XYZ");
0057   // tdrStyle->SetTitleXSize(Float_t size = 0.02); // Another way to set the size?
0058   // tdrStyle->SetTitleYSize(Float_t size = 0.02);
0059   tdrStyle->SetTitleXOffset(0.7);
0060   tdrStyle->SetTitleYOffset(0.7);
0061   // tdrStyle->SetTitleOffset(1.1, "Y"); // Another way to set the Offset
0062 
0063 // For the axis labels:
0064 
0065   tdrStyle->SetLabelColor(1, "XYZ");
0066   tdrStyle->SetLabelFont(42, "XYZ");
0067   tdrStyle->SetLabelOffset(0.007, "XYZ");
0068   tdrStyle->SetLabelSize(0.03, "XYZ");
0069 
0070 // For the axis:
0071 
0072   tdrStyle->SetAxisColor(1, "XYZ");
0073   tdrStyle->SetStripDecimals(kTRUE);
0074   tdrStyle->SetTickLength(0.03, "XYZ");
0075   tdrStyle->SetNdivisions(510, "XYZ");
0076   tdrStyle->SetPadTickX(1);  // To get tick marks on the opposite side of the frame
0077   tdrStyle->SetPadTickY(1);
0078 
0079   tdrStyle->cd();
0080 
0081 }