Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:11:10

0001 
0002 #ifndef SetOKStyle_C
0003 #define SetOKStyle_C
0004 
0005 
0006 void
0007 SetOKStyle()
0008 {
0009   TStyle* OKStyle = new TStyle("OKStyle", "OK Default Style");
0010 
0011   // Colors
0012 
0013   //set the background color to white
0014   OKStyle->SetFillColor(10);
0015   OKStyle->SetFrameFillColor(kWhite);
0016   OKStyle->SetFrameFillStyle(0);
0017   OKStyle->SetFillStyle(0);
0018   OKStyle->SetCanvasColor(kWhite);
0019   OKStyle->SetPadColor(kWhite);
0020   OKStyle->SetTitleFillColor(0);
0021   OKStyle->SetStatColor(kWhite);
0022 
0023   // Get rid of drop shadow on legends
0024   // This doesn't seem to work.  Call SetBorderSize(1) directly on your TLegends
0025   OKStyle->SetLegendBorderSize(1);
0026 
0027   //don't put a colored frame around the plots
0028   OKStyle->SetFrameBorderMode(0);
0029   OKStyle->SetCanvasBorderMode(0);
0030   OKStyle->SetPadBorderMode(0);
0031 
0032   //use the primary color palette
0033   OKStyle->SetPalette(1, 0);
0034 
0035   //set the default line color for a histogram to be black
0036   OKStyle->SetHistLineColor(kBlack);
0037 
0038   //set the default line color for a fit function to be red
0039   OKStyle->SetFuncColor(kBlue);
0040 
0041   //make the axis labels black
0042   OKStyle->SetLabelColor(kBlack, "xyz");
0043 
0044   //set the default title color to be black
0045   OKStyle->SetTitleColor(kBlack);
0046 
0047   //set the margins
0048   OKStyle->SetPadBottomMargin(0.15);
0049   OKStyle->SetPadLeftMargin(0.1);
0050   OKStyle->SetPadTopMargin(0.075);
0051   OKStyle->SetPadRightMargin(0.1);
0052 
0053   //set axis label and title text sizes
0054   OKStyle->SetLabelSize(0.035, "xyz");
0055   OKStyle->SetTitleSize(0.05, "xyz");
0056   OKStyle->SetTitleOffset(0.9, "xyz");
0057   OKStyle->SetStatFontSize(0.035);
0058   OKStyle->SetTextSize(0.05);
0059   OKStyle->SetTitleBorderSize(0);
0060   OKStyle->SetTitleStyle(0);
0061 
0062   OKStyle->SetLegendBorderSize(0);
0063 
0064   //set line widths
0065   OKStyle->SetHistLineWidth(1);
0066   OKStyle->SetFrameLineWidth(2);
0067   OKStyle->SetFuncWidth(2);
0068 
0069   // Misc
0070 
0071   //align the titles to be centered
0072   //OKStyle->SetTextAlign(22);
0073 
0074   //turn off xy grids
0075   OKStyle->SetPadGridX(1);
0076   OKStyle->SetPadGridY(1);
0077 
0078   //set the tick mark style
0079   OKStyle->SetPadTickX(1);
0080   OKStyle->SetPadTickY(1);
0081 
0082   //don't show the fit parameters in a box
0083   OKStyle->SetOptFit(0);
0084 
0085   //set the default stats shown
0086   OKStyle->SetOptStat(1);
0087 
0088   //marker settings
0089 //  OKStyle->SetMarkerStyle(8);
0090 //  OKStyle->SetMarkerSize(0.7);
0091 
0092   // Fonts
0093   OKStyle->SetStatFont(42);
0094   OKStyle->SetLabelFont(42, "xyz");
0095   OKStyle->SetTitleFont(42, "xyz");
0096   OKStyle->SetTextFont(42);
0097 
0098   // Set the paper size for output
0099   OKStyle->SetPaperSize(TStyle::kUSLetter);
0100 
0101   //done
0102   OKStyle->cd();
0103 
0104   cout << "Using Jin's Style" << endl;
0105 }
0106 
0107 #endif