File indexing completed on 2024-04-06 12:31:48
0001 #include "TStyle.h"
0002 #include "TROOT.h"
0003 #include "TLatex.h"
0004
0005
0006
0007 void tdrGrid(bool gridOn) {
0008 TStyle *tdrStyle = (TStyle*)gROOT->FindObject("tdrStyle"); assert(tdrStyle);
0009 tdrStyle->SetPadGridX(gridOn);
0010 tdrStyle->SetPadGridY(gridOn);
0011 }
0012
0013
0014 void fixOverlay() {
0015 gPad->RedrawAxis();
0016 }
0017
0018 void setTDRStyle() {
0019 TStyle *tdrStyle = new TStyle("tdrStyle","Style for P-TDR");
0020
0021
0022 tdrStyle->SetCanvasBorderMode(0);
0023 tdrStyle->SetCanvasColor(kWhite);
0024 tdrStyle->SetCanvasDefH(600);
0025 tdrStyle->SetCanvasDefW(600);
0026 tdrStyle->SetCanvasDefX(0);
0027 tdrStyle->SetCanvasDefY(0);
0028
0029
0030 tdrStyle->SetPadBorderMode(0);
0031
0032 tdrStyle->SetPadColor(kWhite);
0033 tdrStyle->SetPadGridX(false);
0034 tdrStyle->SetPadGridY(false);
0035 tdrStyle->SetGridColor(0);
0036 tdrStyle->SetGridStyle(3);
0037 tdrStyle->SetGridWidth(1);
0038
0039
0040 tdrStyle->SetFrameBorderMode(0);
0041 tdrStyle->SetFrameBorderSize(1);
0042 tdrStyle->SetFrameFillColor(0);
0043 tdrStyle->SetFrameFillStyle(0);
0044 tdrStyle->SetFrameLineColor(1);
0045 tdrStyle->SetFrameLineStyle(1);
0046 tdrStyle->SetFrameLineWidth(1);
0047
0048
0049
0050
0051 tdrStyle->SetHistLineColor(1);
0052 tdrStyle->SetHistLineStyle(0);
0053 tdrStyle->SetHistLineWidth(1);
0054
0055
0056
0057 tdrStyle->SetEndErrorSize(2);
0058
0059 tdrStyle->SetErrorX(0.);
0060
0061 tdrStyle->SetMarkerStyle(20);
0062
0063
0064 tdrStyle->SetOptFit(1);
0065 tdrStyle->SetFitFormat("5.4g");
0066 tdrStyle->SetFuncColor(2);
0067 tdrStyle->SetFuncStyle(1);
0068 tdrStyle->SetFuncWidth(1);
0069
0070
0071 tdrStyle->SetOptDate(0);
0072
0073
0074
0075
0076 tdrStyle->SetOptFile(0);
0077 tdrStyle->SetOptStat(000001111);
0078 tdrStyle->SetStatColor(kWhite);
0079 tdrStyle->SetStatFont(42);
0080 tdrStyle->SetStatFontSize(0.025);
0081 tdrStyle->SetStatTextColor(1);
0082 tdrStyle->SetStatFormat("6.4g");
0083 tdrStyle->SetStatBorderSize(1);
0084 tdrStyle->SetStatH(0.1);
0085 tdrStyle->SetStatW(0.15);
0086
0087
0088
0089
0090
0091 tdrStyle->SetPadTopMargin(0.10);
0092 tdrStyle->SetPadBottomMargin(0.15);
0093 tdrStyle->SetPadLeftMargin(0.15);
0094 tdrStyle->SetPadRightMargin(0.13);
0095
0096
0097
0098 tdrStyle->SetOptTitle(1);
0099 tdrStyle->SetTitleFont(42);
0100 tdrStyle->SetTitleColor(1);
0101 tdrStyle->SetTitleTextColor(1);
0102 tdrStyle->SetTitleFillColor(10);
0103 tdrStyle->SetTitleFontSize(0.05);
0104
0105
0106 tdrStyle->SetTitleX(.15);
0107
0108
0109 tdrStyle->SetTitleBorderSize(0);
0110
0111
0112
0113 tdrStyle->SetTitleColor(1, "XYZ");
0114 tdrStyle->SetTitleFont(42, "XYZ");
0115 tdrStyle->SetTitleSize(0.06, "XYZ");
0116
0117
0118 tdrStyle->SetTitleXOffset(1.1);
0119 tdrStyle->SetTitleYOffset(1.25);
0120
0121
0122
0123
0124 tdrStyle->SetLabelColor(1, "XYZ");
0125 tdrStyle->SetLabelFont(42, "XYZ");
0126 tdrStyle->SetLabelOffset(0.007, "XYZ");
0127 tdrStyle->SetLabelSize(0.05, "XYZ");
0128
0129
0130
0131 tdrStyle->SetAxisColor(1, "XYZ");
0132 tdrStyle->SetStripDecimals(kTRUE);
0133 tdrStyle->SetTickLength(0.03, "XYZ");
0134 tdrStyle->SetNdivisions(510, "XYZ");
0135 tdrStyle->SetPadTickX(1);
0136 tdrStyle->SetPadTickY(1);
0137
0138
0139 tdrStyle->SetOptLogx(0);
0140 tdrStyle->SetOptLogy(0);
0141 tdrStyle->SetOptLogz(0);
0142
0143
0144 tdrStyle->SetPaperSize(20.,20.);
0145
0146
0147
0148
0149
0150
0151
0152
0153 tdrStyle->SetPalette(1);
0154
0155
0156
0157
0158 tdrStyle->SetLegendBorderSize(0);
0159
0160 tdrStyle->cd();
0161
0162 }
0163
0164
0165 void cmsPrel(double intLumi=-1, bool wide = false) {
0166
0167 TLatex *latex = new TLatex();
0168 latex->SetNDC();
0169 latex->SetTextSize(0.045);
0170
0171 latex->SetTextAlign(31);
0172 latex->DrawLatex(wide ? 0.98 : 0.95, 0.96, "#sqrt{s} = 7 TeV");
0173 if (intLumi > 0.) {
0174 latex->SetTextAlign(11);
0175
0176 latex->DrawLatex(wide ? 0.06 : 0.15, 0.96,
0177 Form("CMS preliminary, %.2g pb^{-1}",intLumi));
0178 }
0179 else if (intLumi==0) {
0180 latex->SetTextAlign(11);
0181 latex->DrawLatex(wide ? 0.06 : 0.15, 0.96, "CMS simulation (Fall10 QCD)");
0182 }
0183 else {
0184 latex->SetTextAlign(11);
0185 latex->DrawLatex(0.15,0.96,"CMS preliminary 2010");
0186 }
0187 }
0188
0189
0190