CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/Validation/RecoMET/bin/include/tdrstyle.h

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