[8] | 1 | #ifndef __TDRSTYLE__
|
---|
| 2 | #define __TDRSTYLE__
|
---|
| 3 |
|
---|
| 4 | #include "TStyle.h"
|
---|
| 5 |
|
---|
| 6 | void setTDRStyle() {
|
---|
| 7 | TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR");
|
---|
| 8 |
|
---|
| 9 | // For the canvas:
|
---|
| 10 | tdrStyle->SetCanvasBorderMode(0);
|
---|
| 11 | tdrStyle->SetCanvasColor(kWhite);
|
---|
| 12 | tdrStyle->SetCanvasDefH(600); //Height of canvas
|
---|
| 13 | tdrStyle->SetCanvasDefW(600); //Width of canvas
|
---|
| 14 | tdrStyle->SetCanvasDefX(0); //POsition on screen
|
---|
| 15 | tdrStyle->SetCanvasDefY(0);
|
---|
| 16 |
|
---|
| 17 | // For the Pad:
|
---|
| 18 | tdrStyle->SetPadBorderMode(0);
|
---|
| 19 | tdrStyle->SetPadColor(kWhite);
|
---|
| 20 | tdrStyle->SetPadGridX(false);
|
---|
| 21 | tdrStyle->SetPadGridY(false);
|
---|
| 22 | tdrStyle->SetGridColor(0);
|
---|
| 23 | tdrStyle->SetGridStyle(3);
|
---|
| 24 | tdrStyle->SetGridWidth(1);
|
---|
| 25 |
|
---|
| 26 | // For the frame:
|
---|
| 27 | tdrStyle->SetFrameBorderMode(0);
|
---|
| 28 | tdrStyle->SetFrameBorderSize(1);
|
---|
| 29 | tdrStyle->SetFrameFillColor(0);
|
---|
| 30 | tdrStyle->SetFrameFillStyle(0);
|
---|
| 31 | tdrStyle->SetFrameLineColor(1);
|
---|
| 32 | tdrStyle->SetFrameLineStyle(1);
|
---|
| 33 | tdrStyle->SetFrameLineWidth(1);
|
---|
| 34 |
|
---|
| 35 | // For the histo:
|
---|
| 36 | tdrStyle->SetHistLineColor(1);
|
---|
| 37 | tdrStyle->SetHistLineStyle(0);
|
---|
| 38 | tdrStyle->SetHistLineWidth(1);
|
---|
| 39 |
|
---|
| 40 | tdrStyle->SetEndErrorSize(2);
|
---|
| 41 | tdrStyle->SetErrorX(0.);
|
---|
| 42 |
|
---|
| 43 | tdrStyle->SetMarkerStyle(20);
|
---|
| 44 |
|
---|
| 45 | //For the fit/function:
|
---|
| 46 | tdrStyle->SetOptFit(1);
|
---|
| 47 | tdrStyle->SetFitFormat("5.4g");
|
---|
| 48 | tdrStyle->SetFuncColor(2);
|
---|
| 49 | tdrStyle->SetFuncStyle(1);
|
---|
| 50 | tdrStyle->SetFuncWidth(1);
|
---|
| 51 |
|
---|
| 52 | //For the date:
|
---|
| 53 | tdrStyle->SetOptDate(0);
|
---|
| 54 |
|
---|
| 55 | // For the statistics box:
|
---|
| 56 | tdrStyle->SetOptFile(0);
|
---|
| 57 | tdrStyle->SetOptStat(0); // To display the mean and RMS: SetOptStat("mr");
|
---|
| 58 | tdrStyle->SetStatColor(kWhite);
|
---|
| 59 | tdrStyle->SetStatFont(42);
|
---|
| 60 | tdrStyle->SetStatFontSize(0.025);
|
---|
| 61 | tdrStyle->SetStatTextColor(1);
|
---|
| 62 | tdrStyle->SetStatFormat("6.4g");
|
---|
| 63 | tdrStyle->SetStatBorderSize(1);
|
---|
| 64 | tdrStyle->SetStatH(0.1);
|
---|
| 65 | tdrStyle->SetStatW(0.15);
|
---|
| 66 |
|
---|
| 67 | // Margins:
|
---|
| 68 | tdrStyle->SetPadTopMargin(0.05);
|
---|
| 69 | tdrStyle->SetPadBottomMargin(0.13);
|
---|
| 70 | tdrStyle->SetPadLeftMargin(0.13);
|
---|
| 71 | tdrStyle->SetPadRightMargin(0.05);
|
---|
| 72 |
|
---|
| 73 | // For the Global title:
|
---|
| 74 |
|
---|
| 75 | tdrStyle->SetTitleFont(42);
|
---|
| 76 | tdrStyle->SetTitleColor(1);
|
---|
| 77 | tdrStyle->SetTitleTextColor(1);
|
---|
| 78 | tdrStyle->SetTitleFillColor(10);
|
---|
| 79 | tdrStyle->SetTitleFontSize(0.04);
|
---|
| 80 |
|
---|
| 81 | // For the axis titles:
|
---|
| 82 |
|
---|
| 83 | tdrStyle->SetTitleColor(1, "XYZ");
|
---|
| 84 | tdrStyle->SetTitleFont(42, "XYZ");
|
---|
| 85 | tdrStyle->SetTitleSize(0.05, "XYZ");
|
---|
| 86 | tdrStyle->SetTitleXOffset(0.9);
|
---|
| 87 | tdrStyle->SetTitleYOffset(1.05);
|
---|
| 88 |
|
---|
| 89 | // For the axis labels:
|
---|
| 90 |
|
---|
| 91 | tdrStyle->SetLabelColor(1, "XYZ");
|
---|
| 92 | tdrStyle->SetLabelFont(42, "XYZ");
|
---|
| 93 | tdrStyle->SetLabelOffset(0.007, "XYZ");
|
---|
| 94 | tdrStyle->SetLabelSize(0.04, "XYZ");
|
---|
| 95 |
|
---|
| 96 | // For the axis:
|
---|
| 97 |
|
---|
| 98 | tdrStyle->SetAxisColor(1, "XYZ");
|
---|
| 99 | tdrStyle->SetStripDecimals(kTRUE);
|
---|
| 100 | tdrStyle->SetTickLength(0.03, "XYZ");
|
---|
| 101 | tdrStyle->SetNdivisions(510, "XYZ");
|
---|
| 102 | tdrStyle->SetPadTickX(1); // To get tick marks on the opposite side of the frame
|
---|
| 103 | tdrStyle->SetPadTickY(1);
|
---|
| 104 |
|
---|
| 105 | // Change for log plots:
|
---|
| 106 | tdrStyle->SetOptLogx(0);
|
---|
| 107 | tdrStyle->SetOptLogy(0);
|
---|
| 108 | tdrStyle->SetOptLogz(0);
|
---|
| 109 |
|
---|
| 110 | tdrStyle->cd();
|
---|
| 111 |
|
---|
| 112 | }
|
---|
| 113 |
|
---|
| 114 | #endif
|
---|