Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-06-17 02:28:48

0001 #ifndef STYLE__H
0002 #define STYLE__H
0003 
0004 #include "TStyle.h"
0005 
0006 // tdrGrid: Turns the grid lines on (true) or off (false)
0007 inline TStyle genStyle() {
0008   TStyle myStyle("myStyle", "Style similar to P-TDR");
0009 
0010   // For the canvas:
0011   myStyle.SetCanvasBorderMode(0);
0012   myStyle.SetCanvasColor(kWhite);
0013   myStyle.SetCanvasDefH(600);  // Height of canvas
0014   myStyle.SetCanvasDefW(600);  // Width of canvas
0015   myStyle.SetCanvasDefX(0);    // POsition on screen
0016   myStyle.SetCanvasDefY(0);
0017 
0018   // For the Pad:
0019   myStyle.SetPadBorderMode(0);
0020   // myStyle.SetPadBorderSize(Width_t size = 1);
0021   myStyle.SetPadColor(kWhite);
0022   myStyle.SetPadGridX(false);
0023   myStyle.SetPadGridY(false);
0024   myStyle.SetGridColor(0);
0025   myStyle.SetGridStyle(3);
0026   myStyle.SetGridWidth(1);
0027 
0028   // For the frame:
0029   myStyle.SetFrameBorderMode(0);
0030   myStyle.SetFrameBorderSize(1);
0031   myStyle.SetFrameFillColor(0);
0032   myStyle.SetFrameFillStyle(0);
0033   myStyle.SetFrameLineColor(1);
0034   myStyle.SetFrameLineStyle(1);
0035   myStyle.SetFrameLineWidth(1);
0036 
0037   // For the histo:
0038   // myStyle.SetHistFillColor(1);
0039   // myStyle.SetHistFillStyle(0);
0040   myStyle.SetHistLineColor(1);
0041   myStyle.SetHistLineStyle(0);
0042   myStyle.SetHistLineWidth(1);
0043   // myStyle.SetLegoInnerR(Float_t rad = 0.5);
0044   // myStyle.SetNumberContours(Int_t number = 20);
0045 
0046   myStyle.SetEndErrorSize(2);
0047   // myStyle.SetErrorMarker(20);
0048   myStyle.SetErrorX(0.);
0049 
0050   myStyle.SetMarkerStyle(20);
0051 
0052   // For the fit/function:
0053   myStyle.SetOptFit(1);
0054   myStyle.SetFitFormat("5.4g");
0055   myStyle.SetFuncColor(1);
0056   myStyle.SetFuncStyle(0);
0057   myStyle.SetFuncWidth(0);
0058 
0059   // For the date:
0060   myStyle.SetOptDate(0);
0061   // myStyle.SetDateX(Float_t x = 0.01);
0062   // myStyle.SetDateY(Float_t y = 0.01);
0063 
0064   // For the statistics box:
0065   myStyle.SetOptFile(1);
0066   myStyle.SetOptStat("mre");  // To display the mean and RMS:   SetOptStat("mr");
0067   myStyle.SetStatColor(kWhite);
0068   myStyle.SetStatFont(42);
0069   myStyle.SetStatFontSize(0.025);
0070   myStyle.SetStatTextColor(1);
0071   myStyle.SetStatFormat("6.4g");
0072   myStyle.SetStatBorderSize(1);
0073   myStyle.SetStatH(0.1);
0074   myStyle.SetStatW(0.15);
0075   // myStyle.SetStatStyle(Style_t style = 1001);
0076   // myStyle.SetStatX(Float_t x = 0);
0077   // myStyle.SetStatY(Float_t y = 0);
0078 
0079   // Margins:
0080   //  myStyle.SetPadTopMargin(0.05);
0081   //  myStyle.SetPadBottomMargin(0.13);
0082   //  myStyle.SetPadLeftMargin(0.16);
0083   //  myStyle.SetPadRightMargin(/*0.02*/0.1);
0084 
0085   // For the Global title:
0086 
0087   myStyle.SetOptTitle(0);
0088   myStyle.SetTitleFont(42);
0089   myStyle.SetTitleColor(1);
0090   myStyle.SetTitleTextColor(1);
0091   myStyle.SetTitleFillColor(10);
0092   myStyle.SetTitleFontSize(0.05);
0093   // myStyle.SetTitleH(0); // Set the height of the title box
0094   // myStyle.SetTitleW(0); // Set the width of the title box
0095   // myStyle.SetTitleX(0); // Set the position of the title box
0096   // myStyle.SetTitleY(0.985); // Set the position of the title box
0097   // myStyle.SetTitleStyle(Style_t style = 1001);
0098   // myStyle.SetTitleBorderSize(2);
0099 
0100   // For the axis titles:
0101 
0102   myStyle.SetTitleColor(1, "XYZ");
0103   myStyle.SetTitleFont(42, "XYZ");
0104   myStyle.SetTitleSize(0.06, "XYZ");
0105   // myStyle.SetTitleXSize(Float_t size = 0.02); // Another way to set the size?
0106   // myStyle.SetTitleYSize(Float_t size = 0.02);
0107   //  myStyle.SetTitleXOffset(0.9);
0108   //  myStyle.SetTitleYOffset(1.25);
0109   // myStyle.SetTitleOffset(1.1, "Y"); // Another way to set the Offset
0110 
0111   // For the axis labels:
0112 
0113   myStyle.SetLabelColor(1, "XYZ");
0114   myStyle.SetLabelFont(42, "XYZ");
0115   //  myStyle.SetLabelOffset(0.01, "XYZ");
0116   //  myStyle.SetLabelSize(0.03/*0.05*/, "XYZ");
0117 
0118   // For the axis:
0119 
0120   myStyle.SetAxisColor(1, "XYZ");
0121   myStyle.SetStripDecimals(kTRUE);
0122   myStyle.SetTickLength(0.03, "XYZ");
0123   myStyle.SetNdivisions(510, "XYZ");
0124   myStyle.SetPadTickX(1);  // To get tick marks on the opposite side of the frame
0125   myStyle.SetPadTickY(1);
0126 
0127   // Change for log plots:
0128   myStyle.SetOptLogx(0);
0129   myStyle.SetOptLogy(0);
0130   myStyle.SetOptLogz(0);
0131 
0132   // Postscript options:
0133   myStyle.SetPaperSize(20., 20.);
0134   // myStyle.SetLineScalePS(Float_t scale = 3);
0135   // myStyle.SetLineStyleString(Int_t i, const char* text);
0136   // myStyle.SetHeaderPS(const char* header);
0137   // myStyle.SetTitlePS(const char* pstitle);
0138 
0139   // myStyle.SetBarOffset(Float_t baroff = 0.5);
0140   // myStyle.SetBarWidth(Float_t barwidth = 0.5);
0141   // myStyle.SetPaintTextFormat(const char* format = "g");
0142   // myStyle.SetPalette(Int_t ncolors = 0, Int_t* colors = 0);
0143   // myStyle.SetTimeOffset(Double_t toffset);
0144   // myStyle.SetHistMinimumZero(kTRUE);
0145 
0146   return myStyle;
0147 }
0148 
0149 #endif  // STYLE__H