Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:45:12

0001 #include "TStyle.h"
0002 
0003 void setGStyle() {
0004   // Zero horizontal error bars
0005   gStyle->SetErrorX(0);
0006   
0007   //  For the canvas
0008   gStyle->SetCanvasBorderMode(0);
0009   gStyle->SetCanvasColor(kWhite);
0010   gStyle->SetCanvasDefH(800); //Height of canvas
0011   gStyle->SetCanvasDefW(800); //Width of canvas
0012   gStyle->SetCanvasDefX(0);   //Position on screen
0013   gStyle->SetCanvasDefY(0);
0014   
0015   //  For the frame
0016   gStyle->SetFrameBorderMode(0);
0017   gStyle->SetFrameBorderSize(1);
0018   gStyle->SetFrameFillColor(kBlack);
0019   gStyle->SetFrameFillStyle(0);
0020   gStyle->SetFrameLineColor(kBlack);
0021   gStyle->SetFrameLineStyle(0);
0022   gStyle->SetFrameLineWidth(1);
0023   
0024   //  For the Pad
0025   gStyle->SetPadBorderMode(0);
0026   gStyle->SetPadColor(kWhite);
0027   gStyle->SetPadGridX(false);
0028   gStyle->SetPadGridY(false);
0029   gStyle->SetGridColor(0);
0030   gStyle->SetGridStyle(3);
0031   gStyle->SetGridWidth(1);
0032   
0033   //  Margins
0034   gStyle->SetPadTopMargin(0.08);
0035   gStyle->SetPadBottomMargin(0.15);
0036   gStyle->SetPadLeftMargin(0.19);
0037   gStyle->SetPadRightMargin(0.04);
0038   
0039   //  For the histo:
0040   gStyle->SetHistLineColor(kBlack);
0041   gStyle->SetHistLineStyle(0);
0042   gStyle->SetHistLineWidth(2);
0043   gStyle->SetMarkerSize(1.4);
0044   gStyle->SetEndErrorSize(4);
0045   
0046   gStyle->SetOptStat("MR");
0047   gStyle->SetStatColor(kWhite);
0048   gStyle->SetStatFont(42);
0049   gStyle->SetStatFontSize(0.03);
0050   gStyle->SetStatTextColor(1);
0051   gStyle->SetStatFormat("6.4g");
0052   gStyle->SetStatBorderSize(1);
0053   gStyle->SetStatX(0.94);              
0054   gStyle->SetStatY(0.90);              
0055   gStyle->SetStatH(0.10);
0056   gStyle->SetStatW(0.22);
0057   
0058   //  For the Global title:
0059   gStyle->SetOptTitle(1);
0060   gStyle->SetTitleFont(42,"");
0061   gStyle->SetTitleColor(1);
0062   gStyle->SetTitleTextColor(1);
0063   gStyle->SetTitleFillColor(0);
0064   gStyle->SetTitleFontSize(0.1);
0065   gStyle->SetTitleAlign(13);
0066   gStyle->SetTitleX(0.00);
0067   gStyle->SetTitleH(0.05);
0068   gStyle->SetTitleBorderSize(0);
0069   gStyle->SetTitleX(0.23);
0070   
0071   //  For the axis
0072   gStyle->SetAxisColor(1,"XYZ");
0073   gStyle->SetTickLength(0.03,"XYZ");
0074   gStyle->SetNdivisions(510,"XYZ");
0075   gStyle->SetPadTickX(1);
0076   gStyle->SetPadTickY(1);
0077   gStyle->SetStripDecimals(kFALSE);
0078   
0079   //  For the axis labels and titles
0080   gStyle->SetTitleColor(1,"XYZ");
0081   gStyle->SetLabelColor(1,"XYZ");
0082   // For the axis labels:
0083   gStyle->SetLabelFont(42,"XYZ");
0084   gStyle->SetLabelOffset(0.007,"XYZ");
0085   gStyle->SetLabelSize(0.045,"XYZ");
0086   // For the axis titles:
0087   gStyle->SetTitleFont(42,"XYZ");
0088   gStyle->SetTitleSize(0.06,"XYZ");
0089   gStyle->SetTitleXOffset(1.0);
0090   gStyle->SetTitleYOffset(1.5);
0091   
0092   //  For the legend
0093   gStyle->SetLegendBorderSize(0);
0094   
0095   //  For the statistics box
0096   gStyle->SetStatFontSize(0.04);
0097   gStyle->SetStatX(0.92);              
0098   gStyle->SetStatY(0.86);              
0099   gStyle->SetStatH(0.2);
0100   gStyle->SetStatW(0.3);
0101 }