def RooFitInclude():
    print "adding RooFit ...",
    scramCmd = ['scram','tool','info','roofitcore']
    grepCmd = ['grep', 'INCLUDE']
    pscram = subprocess.Popen(scramCmd, stdout = subprocess.PIPE)
    pgrep = subprocess.Popen(grepCmd, stdin=pscram.stdout,
                             stdout=subprocess.PIPE)
    pscram.stdout.close()
    output = pgrep.communicate()[0]
    if (pgrep.returncode == 0):
        print "done"
        roofitinc = output.split("=")[1].rstrip()
        # print roofitinc
        gROOT.GetInterpreter().AddIncludePath(roofitinc)
        roofitinc = '-I"' + roofitinc + '"'
        # print roofitinc
        gSystem.AddIncludePath(roofitinc)
        return True
    else:
        print "failed"
        print 'scram returned:',pscram.returncode,'grep:',pgrep.returncode
        return False
示例#2
0
gStyle.SetPadRightMargin(0.06)  ## was 0.02

gStyle.SetTitleColor(1, "XYZ")
gStyle.SetTitleFont(42, "XYZ")
gStyle.SetTitleSize(0.07, "XYZ")
gStyle.SetTitleXOffset(0.9)
gStyle.SetTitleYOffset(1.4)  ## was 1.25

##  For the axis labels:
gStyle.SetLabelColor(1, "XYZ")
gStyle.SetLabelFont(42, "XYZ")
gStyle.SetLabelOffset(0.007, "XYZ")
gStyle.SetLabelSize(0.06, "XYZ")
gStyle.SetNdivisions(505, "XYZ")

if (gSystem.DynamicPathName("libFWCoreFWLite.so", True)):
    gROOT.GetInterpreter().AddIncludePath(cmssw_base + '/src')
    gSystem.AddIncludePath('-I"' + cmssw_base + '/src"')
    if not RooFitInclude():
        workingdir = os.getcwd()
        print 'changing to', cmssw_base, 'directory'
        os.chdir(cmssw_base)
        RooFitInclude()
        print 'returning to working directory', workingdir
        os.chdir(workingdir)

print 'end of pyroot_logon'

if __name__ == '__main__':
    from ROOT import *