def looks(): gROOT.ProcessLine('TGaxis::SetMaxDigits(3)') gStyle.SetFrameBorderMode(0) gStyle.SetFrameFillColor(0) gStyle.SetCanvasBorderMode(0) gStyle.SetCanvasColor(0) gStyle.SetPadBorderMode(0) gStyle.SetPadColor(0) gStyle.SetStatColor(0) gStyle.SetTitleFont(42, '') gStyle.SetLabelFont(42, 'x') gStyle.SetTitleFont(42, 'x') gStyle.SetLabelFont(42, 'y') gStyle.SetTitleFont(42, 'y') gStyle.SetLabelFont(42, 'z') gStyle.SetTitleFont(42, 'z') gStyle.SetLabelSize(0.048, 'x') gStyle.SetTitleSize(0.048, 'x') gStyle.SetLabelSize(0.048, 'y') gStyle.SetTitleSize(0.048, 'y') gStyle.SetLabelSize(0.048, 'z') gStyle.SetTitleSize(0.048, 'z') gStyle.SetTitleSize(0.048, '') gStyle.SetTitleAlign(23) gStyle.SetTitleX(0.5) gStyle.SetTitleBorderSize(0) gStyle.SetTitleFillColor(0) gStyle.SetTitleStyle(0) gStyle.SetOptStat('emr') gStyle.SetOptStat(0) gStyle.SetStatBorderSize(0) gStyle.SetStatFont(42) gStyle.SetStatFontSize(0.048) gStyle.SetStatY(0.9) gStyle.SetStatX(0.86) gStyle.SetHistLineColor(ROOT.kBlue + 2) gStyle.SetLegendBorderSize(0) gStyle.SetLegendFillColor(0) gStyle.SetFuncWidth(2) gStyle.SetFuncColor(2) gStyle.SetPadTopMargin(0.08) gStyle.SetPadBottomMargin(0.12) gStyle.SetPadLeftMargin(0.12) gStyle.SetPadRightMargin(0.06) gStyle.SetCanvasDefX(400) gStyle.SetCanvasDefY(20) gStyle.SetCanvasDefH(420) gStyle.SetCanvasDefW(610) gStyle.SetFrameBorderMode(0) gStyle.SetFrameLineWidth(2) gStyle.SetHistLineWidth(2) gStyle.SetTitleOffset(1.16, 'y') gStyle.SetTitleOffset(1.20, 'x')
def __init__(self): ''' Set up PlotStyle, set gStyle for things we always want no matter what. ''' # CMS-approved everything tdrstyle.setTDRStyle() ### Differences from TDR standard: # Big canvas (can always shrink later) gStyle.SetCanvasDefH(1200) gStyle.SetCanvasDefW(1200) # Tick marks on all sides gStyle.SetPadTickX(1) gStyle.SetPadTickY(1) # Everything has white backgrounds gStyle.SetLegendFillColor(0) # Colors that don't suck gStyle.SetPalette(1) # Make axis title and labels just a little smaller and (for Y) closer to the axis gStyle.SetTitleSize(0.044, "XYZ") gStyle.SetLabelSize(0.033, "XYZ") gStyle.SetTitleYOffset(1.15) gStyle.SetTitleXOffset(0.95) gStyle.SetPadLeftMargin(0.1) gStyle.SetPadRightMargin(0.025) gStyle.SetPadBottomMargin(0.095) gStyle.SetTitleAlign(12) # Apply changes gROOT.ForceStyle() # Force exponentials when axes are over 3 digits TGaxis.SetMaxDigits(3) TGaxis.SetExponentOffset(-0.060, 0.008, "y") TGaxis.SetExponentOffset( -0.055, -0.062, "x") # will overlap with title unless title is centered
def setStyle(): gStyle.SetCanvasColor(0) gStyle.SetCanvasBorderSize(10) gStyle.SetCanvasBorderMode(0) gStyle.SetCanvasDefH(700) gStyle.SetCanvasDefW(700) gStyle.SetPadColor(0) gStyle.SetPadBorderSize(10) gStyle.SetPadBorderMode(0) gStyle.SetPadBottomMargin(0.13) gStyle.SetPadTopMargin(0.08) gStyle.SetPadLeftMargin(0.15) gStyle.SetPadRightMargin(0.05) gStyle.SetPadGridX(0) gStyle.SetPadGridY(0) gStyle.SetPadTickX(1) gStyle.SetPadTickY(1) gStyle.SetFrameFillStyle(0) gStyle.SetFrameFillColor(0) gStyle.SetFrameLineColor(1) gStyle.SetFrameLineStyle(0) gStyle.SetFrameLineWidth(1) gStyle.SetFrameBorderSize(10) gStyle.SetFrameBorderMode(0) gStyle.SetNdivisions(505) gStyle.SetLineWidth(2) gStyle.SetHistLineWidth(2) gStyle.SetFrameLineWidth(2) gStyle.SetLegendFillColor(root.kWhite) gStyle.SetLegendFont(42) gStyle.SetMarkerSize(1.2) gStyle.SetMarkerStyle(20) gStyle.SetLabelSize(0.040, "X") gStyle.SetLabelSize(0.040, "Y") gStyle.SetLabelOffset(0.010, "X") gStyle.SetLabelOffset(0.010, "Y") gStyle.SetLabelFont(42, "X") gStyle.SetLabelFont(42, "Y") gStyle.SetTitleBorderSize(0) gStyle.SetTitleFont(42) gStyle.SetTitleFont(42, "X") gStyle.SetTitleFont(42, "Y") gStyle.SetTitleSize(0.045, "X") gStyle.SetTitleSize(0.045, "Y") gStyle.SetTitleOffset(1.4, "X") gStyle.SetTitleOffset(1.4, "Y") gStyle.SetTextSize(0.055) gStyle.SetTextFont(42) gStyle.SetOptStat(0)
from CMGTools.H2TauTau.proto.plotter.binning import * from ROOT import gROOT, gStyle # old mva > 0.795, 0.884, 0.921 # mva2 > 0.85 , 0.90 , 0.94 # 3hit < 2 , 1 , 0.8 ### style parameters gROOT.SetStyle("Plain") gROOT.SetBatch(True) gStyle.SetLegendFillColor(0) gStyle.SetLegendBorderSize(0) gStyle.SetStatBorderSize(0) gStyle.SetTitleBorderSize(0) gStyle.SetPadTickX(1) gStyle.SetPadTickY(1) gStyle.SetTitleX(0.125) gStyle.SetTitleY(0.96) gStyle.SetTitleW(0.8) gStyle.SetTextFont(42) gStyle.SetLegendFont(42) #gStyle.SetLabelFont(42, 'xy') #gStyle.SetTitleFont(42, 'xy') tauScale = '0.03' shiftedMet = 'sqrt(pow(mex+' + tauScale + '*l1Px+' + tauScale + '*l2Px,2)+pow(mey+' + tauScale + '*l1Py+' + tauScale + '*l2Py,2))' baseline = ' l1Pt>35 && l2Pt>35 && abs(l1Eta)<2.1 && abs(l2Eta)<2.1 && diTauCharge==0 ' #### should be redundant once skimmed baseline += ' && l2againstElectronLooseMVA3>0.5 '
def tdrstyle(): gROOT.SetStyle("Plain") gStyle.SetAxisColor(1, "XYZ") gStyle.SetCanvasColor(0) #gStyle.SetCanvasBorderSize(10) gStyle.SetCanvasBorderMode(0) gStyle.SetCanvasDefH(700) gStyle.SetCanvasDefW(700) gStyle.SetCanvasDefX(0) gStyle.SetCanvasDefY(0) gStyle.SetFitFormat("5.4g") gStyle.SetFuncColor(2) gStyle.SetFuncStyle(1) gStyle.SetFuncWidth(1) gStyle.SetFrameBorderMode(0) gStyle.SetFrameBorderSize(1) gStyle.SetFrameFillStyle(0) gStyle.SetFrameFillColor(0) gStyle.SetFrameLineColor(1) gStyle.SetFrameLineStyle(1) # 0? gStyle.SetFrameLineWidth(1) # 1? gStyle.SetGridColor(0) gStyle.SetGridStyle(3) gStyle.SetGridWidth(1) #gStyle.SetHistFillColor(1) #gStyle.SetHistFillStyle(0) gStyle.SetHistLineColor(1) gStyle.SetHistLineStyle(0) gStyle.SetHistLineWidth(1) gStyle.SetLabelColor(1, "XYZ") gStyle.SetLabelFont(42,"XYZ") gStyle.SetLabelOffset(0.007,"XYZ") # 0.010? gStyle.SetLabelSize(0.05,"XYZ") # 0.04? gStyle.SetLegendBorderSize(0) gStyle.SetLegendFillColor(0) gStyle.SetLegendFont(42) gStyle.SetMarkerSize(1.0) gStyle.SetMarkerStyle(20) gStyle.SetLineColor(1) gStyle.SetLineWidth(2) #gStyle.SetLineScalePS(2) gStyle.SetOptDate(0) gStyle.SetOptFile(0) gStyle.SetOptFit(1) gStyle.SetOptStat(0) gStyle.SetOptTitle(0) #gStyle.SetOptLogx(0) #gStyle.SetOptLogy(0) #gStyle.SetOptLogz(0) gStyle.SetPadColor(0) gStyle.SetPadBorderMode(0) gStyle.SetPadBorderSize(10) gStyle.SetPadTopMargin(0.05) # 0.08? gStyle.SetPadBottomMargin(0.13) gStyle.SetPadLeftMargin(0.16) gStyle.SetPadRightMargin(0.03) # 0.05? gStyle.SetPadGridX(0) gStyle.SetPadGridY(0) gStyle.SetPadTickX(1) gStyle.SetPadTickY(1) gStyle.SetStatColor(0) gStyle.SetStatFont(42) gStyle.SetStatFontSize(0.025) gStyle.SetStatTextColor(1) gStyle.SetStatFormat("6.4g") gStyle.SetStatBorderSize(1) gStyle.SetStatH(0.1) gStyle.SetStatW(0.15) #gStyle.SetStatX(0) #gStyle.SetStatY(0) #gStyle.SetTextSize(0.055) gStyle.SetTextFont(42) gStyle.SetTitleBorderSize(0) gStyle.SetTitleColor(1) gStyle.SetTitleFont(42) gStyle.SetTitleColor(1,"XYZ") gStyle.SetTitleFont(42,"XYZ") gStyle.SetTitleSize(0.06,"XYZ") # 0.05? #gStyle.SetTitleOffset(1.4,"XYZ") gStyle.SetTitleOffset(0.9,"X") gStyle.SetTitleOffset(1.20,"Y") gStyle.SetTitleFillColor(10) gStyle.SetTitleFontSize(0.05) gStyle.SetTitleTextColor(1) #gStyle.SetTitleH(0) #gStyle.SetTitleW(0) #gStyle.SetTitleX(0) #gStyle.SetTitleY(0.985) #gStyle.SetTitleStyle(1001) gStyle.SetPalette(1) #gStyle.SetNdivisions(510, "XYZ") # 505? gStyle.SetNdivisions(505, "XYZ") gStyle.SetEndErrorSize(2) # 2? #gStyle.SetErrorMarker(20) #gStyle.SetErrorX(0.) #gStyle.SetPaperSize(20.,20.) gStyle.SetStripDecimals(1) gStyle.SetTickLength(0.03, "XYZ") return 1