Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:32:55

0001 #include "TStyle.h"
0002 
0003 void setTDRStyle() {
0004 
0005    return;
0006    TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR");
0007 
0008 // For the canvas:

0009    tdrStyle->SetCanvasBorderMode(0);
0010    tdrStyle->SetCanvasColor(kWhite);
0011    tdrStyle->SetCanvasDefH(600); //Height of canvas

0012    tdrStyle->SetCanvasDefW(600); //Width of canvas

0013    tdrStyle->SetCanvasDefX(0);   //POsition on screen

0014    tdrStyle->SetCanvasDefY(0);
0015 
0016 // For the Pad:

0017    tdrStyle->SetPadBorderMode(0);
0018   // tdrStyle->SetPadBorderSize(Width_t size = 1);

0019    tdrStyle->SetPadColor(kWhite);
0020    tdrStyle->SetPadGridX(false);
0021    tdrStyle->SetPadGridY(false);
0022    tdrStyle->SetGridColor(0);
0023    tdrStyle->SetGridStyle(3);
0024    tdrStyle->SetGridWidth(1);
0025 
0026 // For the frame:

0027    tdrStyle->SetFrameBorderMode(0);
0028    tdrStyle->SetFrameBorderSize(1);
0029    tdrStyle->SetFrameFillColor(0);
0030    tdrStyle->SetFrameFillStyle(0);
0031    tdrStyle->SetFrameLineColor(1);
0032    tdrStyle->SetFrameLineStyle(1);
0033    tdrStyle->SetFrameLineWidth(1);
0034 
0035 // For the histo:

0036   // tdrStyle->SetHistFillColor(1);

0037   // tdrStyle->SetHistFillStyle(0);

0038   // tdrStyle->SetHistLineColor(2); //xxx 1

0039    tdrStyle->SetHistLineColor(0); //xxx 1

0040    tdrStyle->SetHistLineStyle(0);
0041    tdrStyle->SetHistLineWidth(2); // xxx 1

0042   // tdrStyle->SetLegoInnerR(Float_t rad = 0.5);

0043   // tdrStyle->SetNumberContours(Int_t number = 20);

0044 
0045    tdrStyle->SetEndErrorSize(2);
0046 //XXX   tdrStyle->SetErrorMarker(20);

0047    tdrStyle->SetErrorX(0.);
0048   
0049    tdrStyle->SetMarkerStyle(20);
0050 
0051 //For the fit/function:

0052    tdrStyle->SetOptFit(1);
0053    tdrStyle->SetFitFormat("5.4g");
0054    tdrStyle->SetFuncColor(2);
0055    tdrStyle->SetFuncStyle(1);
0056    tdrStyle->SetFuncWidth(1);
0057 
0058 //For the date:

0059    tdrStyle->SetOptDate(0);
0060   // tdrStyle->SetDateX(Float_t x = 0.01);

0061   // tdrStyle->SetDateY(Float_t y = 0.01);

0062 
0063 // For the statistics box:

0064    tdrStyle->SetOptFile(0);
0065    tdrStyle->SetOptStat(0); // To display the mean and RMS:   SetOptStat("mr");

0066    tdrStyle->SetStatColor(kWhite);
0067    tdrStyle->SetStatFont(42);
0068    tdrStyle->SetStatFontSize(0.025);
0069    tdrStyle->SetStatTextColor(1);
0070    tdrStyle->SetStatFormat("6.4g");
0071    tdrStyle->SetStatBorderSize(1);
0072    tdrStyle->SetStatH(0.1);
0073    tdrStyle->SetStatW(0.15);
0074   // tdrStyle->SetStatStyle(Style_t style = 1001);

0075   // tdrStyle->SetStatX(Float_t x = 0);

0076   // tdrStyle->SetStatY(Float_t y = 0);

0077 
0078 // Margins:

0079    tdrStyle->SetPadTopMargin(0.05);
0080    tdrStyle->SetPadBottomMargin(0.13);
0081    tdrStyle->SetPadLeftMargin(0.16);
0082    tdrStyle->SetPadRightMargin(0.02);
0083 
0084 
0085 // For the Global title:

0086 
0087    //* xxx

0088    tdrStyle->SetOptTitle(0);
0089    tdrStyle->SetTitleFont(42);
0090    tdrStyle->SetTitleColor(1);
0091    tdrStyle->SetTitleTextColor(1);
0092    tdrStyle->SetTitleFillColor(10);
0093    tdrStyle->SetTitleFontSize(0.05);
0094    //*/

0095   // tdrStyle->SetTitleH(0); // Set the height of the title box

0096   // tdrStyle->SetTitleW(0); // Set the width of the title box

0097   // tdrStyle->SetTitleX(0); // Set the position of the title box

0098   // tdrStyle->SetTitleY(0.985); // Set the position of the title box

0099   // tdrStyle->SetTitleStyle(Style_t style = 1001);

0100   // tdrStyle->SetTitleBorderSize(2);

0101 
0102 // For the axis titles:

0103    //* xxx 

0104    tdrStyle->SetTitleColor(1, "XYZ");
0105    tdrStyle->SetTitleFont(42, "XYZ");
0106    tdrStyle->SetTitleSize(0.06, "XYZ");
0107   // tdrStyle->SetTitleXSize(Float_t size = 0.02); // Another way to set the size?

0108   // tdrStyle->SetTitleYSize(Float_t size = 0.02);

0109    tdrStyle->SetTitleXOffset(0.9);
0110    tdrStyle->SetTitleYOffset(1.25);
0111   // tdrStyle->SetTitleOffset(1.1, "Y"); // Another way to set the Offset

0112    //*/

0113 // For the axis labels:

0114 
0115    tdrStyle->SetLabelColor(1, "XYZ");
0116    tdrStyle->SetLabelFont(42, "XYZ");
0117    tdrStyle->SetLabelOffset(0.007, "XYZ");
0118    tdrStyle->SetLabelSize(0.05, "XYZ");
0119 
0120 // For the axis:

0121 
0122    tdrStyle->SetAxisColor(1, "XYZ");
0123    tdrStyle->SetStripDecimals(kTRUE);
0124    tdrStyle->SetTickLength(0.03, "XYZ");
0125    tdrStyle->SetNdivisions(510, "XYZ");
0126    tdrStyle->SetPadTickX(1);  // To get tick marks on the opposite side of the frame

0127    tdrStyle->SetPadTickY(1);
0128 
0129 // Change for log plots:

0130    tdrStyle->SetOptLogx(0);
0131    tdrStyle->SetOptLogy(0);
0132    tdrStyle->SetOptLogz(0);
0133 
0134 // Postscript options:

0135    //tdrStyle->SetPaperSize(20.,20.);

0136   // tdrStyle->SetLineScalePS(Float_t scale = 3);

0137   // tdrStyle->SetLineStyleString(Int_t i, const char* text);

0138   // tdrStyle->SetHeaderPS(const char* header);

0139   // tdrStyle->SetTitlePS(const char* pstitle);

0140 
0141   // tdrStyle->SetBarOffset(Float_t baroff = 0.5);

0142   // tdrStyle->SetBarWidth(Float_t barwidth = 0.5);

0143   // tdrStyle->SetPaintTextFormat(const char* format = "g");

0144   // tdrStyle->SetPalette(Int_t ncolors = 0, Int_t* colors = 0);

0145   // tdrStyle->SetTimeOffset(Double_t toffset);

0146   // tdrStyle->SetHistMinimumZero(kTRUE);

0147    tdrStyle->SetPaintTextFormat("3.2g");
0148    //tdrStyle->SetPaintTextFormat("4.2f");

0149    tdrStyle->cd();
0150 
0151 }