CMS 3D CMS Logo

Style.h

Go to the documentation of this file.
00001 #ifndef STYLE__H
00002 #define STYLE__H
00003 
00004 #include "TStyle.h"
00005 
00006 // tdrGrid: Turns the grid lines on (true) or off (false)
00007 TStyle genStyle() {
00008 
00009   TStyle myStyle("myStyle","Style similar to P-TDR");
00010 
00011 // For the canvas:
00012   myStyle.SetCanvasBorderMode(0);
00013   myStyle.SetCanvasColor(kWhite);
00014   myStyle.SetCanvasDefH(600); //Height of canvas
00015   myStyle.SetCanvasDefW(600); //Width of canvas
00016   myStyle.SetCanvasDefX(0);   //POsition on screen
00017   myStyle.SetCanvasDefY(0);
00018 
00019 // For the Pad:
00020   myStyle.SetPadBorderMode(0);
00021   // myStyle.SetPadBorderSize(Width_t size = 1);
00022   myStyle.SetPadColor(kWhite);
00023   myStyle.SetPadGridX(false);
00024   myStyle.SetPadGridY(false);
00025   myStyle.SetGridColor(0);
00026   myStyle.SetGridStyle(3);
00027   myStyle.SetGridWidth(1);
00028 
00029 // For the frame:
00030   myStyle.SetFrameBorderMode(0);
00031   myStyle.SetFrameBorderSize(1);
00032   myStyle.SetFrameFillColor(0);
00033   myStyle.SetFrameFillStyle(0);
00034   myStyle.SetFrameLineColor(1);
00035   myStyle.SetFrameLineStyle(1);
00036   myStyle.SetFrameLineWidth(1);
00037 
00038 // For the histo:
00039   // myStyle.SetHistFillColor(1);
00040   // myStyle.SetHistFillStyle(0);
00041   myStyle.SetHistLineColor(1);
00042   myStyle.SetHistLineStyle(0);
00043   myStyle.SetHistLineWidth(1);
00044   // myStyle.SetLegoInnerR(Float_t rad = 0.5);
00045   // myStyle.SetNumberContours(Int_t number = 20);
00046 
00047   myStyle.SetEndErrorSize(2);
00048   //myStyle.SetErrorMarker(20);
00049   myStyle.SetErrorX(0.);
00050   
00051   myStyle.SetMarkerStyle(20);
00052 
00053 //For the fit/function:
00054   myStyle.SetOptFit(1);
00055   myStyle.SetFitFormat("5.4g");
00056   myStyle.SetFuncColor(1);
00057   myStyle.SetFuncStyle(0);
00058   myStyle.SetFuncWidth(0);
00059 
00060 //For the date:
00061   myStyle.SetOptDate(0);
00062   // myStyle.SetDateX(Float_t x = 0.01);
00063   // myStyle.SetDateY(Float_t y = 0.01);
00064 
00065 // For the statistics box:
00066   myStyle.SetOptFile(1);
00067   myStyle.SetOptStat("mre"); // To display the mean and RMS:   SetOptStat("mr");
00068   myStyle.SetStatColor(kWhite);
00069   myStyle.SetStatFont(42);
00070   myStyle.SetStatFontSize(0.025);
00071   myStyle.SetStatTextColor(1);
00072   myStyle.SetStatFormat("6.4g");
00073   myStyle.SetStatBorderSize(1);
00074   myStyle.SetStatH(0.1);
00075   myStyle.SetStatW(0.15);
00076   // myStyle.SetStatStyle(Style_t style = 1001);
00077   // myStyle.SetStatX(Float_t x = 0);
00078   // myStyle.SetStatY(Float_t y = 0);
00079 
00080 // Margins:
00081 //  myStyle.SetPadTopMargin(0.05);
00082 //  myStyle.SetPadBottomMargin(0.13);
00083 //  myStyle.SetPadLeftMargin(0.16);
00084 //  myStyle.SetPadRightMargin(/*0.02*/0.1);
00085 
00086 // For the Global title:
00087 
00088   myStyle.SetOptTitle(0);
00089   myStyle.SetTitleFont(42);
00090   myStyle.SetTitleColor(1);
00091   myStyle.SetTitleTextColor(1);
00092   myStyle.SetTitleFillColor(10);
00093   myStyle.SetTitleFontSize(0.05);
00094   // myStyle.SetTitleH(0); // Set the height of the title box
00095   // myStyle.SetTitleW(0); // Set the width of the title box
00096   // myStyle.SetTitleX(0); // Set the position of the title box
00097   // myStyle.SetTitleY(0.985); // Set the position of the title box
00098   // myStyle.SetTitleStyle(Style_t style = 1001);
00099   // myStyle.SetTitleBorderSize(2);
00100 
00101 // For the axis titles:
00102 
00103   myStyle.SetTitleColor(1, "XYZ");
00104   myStyle.SetTitleFont(42, "XYZ");
00105   myStyle.SetTitleSize(0.06, "XYZ");
00106   // myStyle.SetTitleXSize(Float_t size = 0.02); // Another way to set the size?
00107   // myStyle.SetTitleYSize(Float_t size = 0.02);
00108 //  myStyle.SetTitleXOffset(0.9);
00109 //  myStyle.SetTitleYOffset(1.25);
00110   // myStyle.SetTitleOffset(1.1, "Y"); // Another way to set the Offset
00111 
00112 // For the axis labels:
00113 
00114   myStyle.SetLabelColor(1, "XYZ");
00115   myStyle.SetLabelFont(42, "XYZ");
00116 //  myStyle.SetLabelOffset(0.01, "XYZ");
00117 //  myStyle.SetLabelSize(0.03/*0.05*/, "XYZ");
00118 
00119 // For the axis:
00120 
00121   myStyle.SetAxisColor(1, "XYZ");
00122   myStyle.SetStripDecimals(kTRUE);
00123   myStyle.SetTickLength(0.03, "XYZ");
00124   myStyle.SetNdivisions(510, "XYZ");
00125   myStyle.SetPadTickX(1);  // To get tick marks on the opposite side of the frame
00126   myStyle.SetPadTickY(1);
00127 
00128 // Change for log plots:
00129   myStyle.SetOptLogx(0);
00130   myStyle.SetOptLogy(0);
00131   myStyle.SetOptLogz(0);
00132 
00133 // Postscript options:
00134   myStyle.SetPaperSize(20.,20.);
00135   // myStyle.SetLineScalePS(Float_t scale = 3);
00136   // myStyle.SetLineStyleString(Int_t i, const char* text);
00137   // myStyle.SetHeaderPS(const char* header);
00138   // myStyle.SetTitlePS(const char* pstitle);
00139 
00140   // myStyle.SetBarOffset(Float_t baroff = 0.5);
00141   // myStyle.SetBarWidth(Float_t barwidth = 0.5);
00142   // myStyle.SetPaintTextFormat(const char* format = "g");
00143   // myStyle.SetPalette(Int_t ncolors = 0, Int_t* colors = 0);
00144   // myStyle.SetTimeOffset(Double_t toffset);
00145   // myStyle.SetHistMinimumZero(kTRUE);
00146 
00147   return myStyle;
00148 
00149 }
00150 
00151 #endif // STYLE__H

Generated on Tue Jun 9 17:49:36 2009 for CMSSW by  doxygen 1.5.4