ROOTTricks

ROOT

Boilerplate

import ROOT  
ROOT.gROOT.SetBatch(True)
ROOT.gErrorIgnoreLevel = ROOT.kWarning
ROOT.gStyle.SetOptStat(0)

iPlot

from iUtils import parseOpts, getPM, setBatch, plot

setBatch()
(o,a) = parseOpts()
pm = getPM(o)

ROOT Tree Codes

The list of currently supported types is given below:

C : a character string terminated by the 0 character B : an 8 bit signed integer (Chart) b : an 8 bit unsigned integer (UChart) S : a 16 bit signed integer (Shortt) s : a 16 bit unsigned integer (UShortt) I : a 32 bit signed integer (Intt) i : a 32 bit unsigned integer (UIntt) F : a 32 bit floating point (Floatt) f : a 24 bit floating point with truncated mantissa (Float16t) D : a 64 bit floating point (Doublet) d : a 24 bit truncated floating point (Double32t) L : a 64 bit signed integer (Long64t) l : a 64 bit unsigned integer (ULong64t) O : [the letter o, not a zero] a boolean (Boolt)

Fix Ratio

Following should fix it:

ratio.Draw("PE same")
oldSize = ratio.GetMarkerSize()
ratio.SetMarkerSize(0)
ratio.DrawCopy("same e0")
ratio.SetMarkerSize(oldSize)
ratio.Draw("PE same")

Optparsee

import optparse
parser = optparse.OptionParser()
parser.add_option('-o', '--outputDir',           help="OutputDir")
o, a = parser.parse_args()

if not os.path.isdir(o.outputDir):
    os.mkdir(o.outputDir)