#!/usr/bin/python import os,sys if len(sys.argv)!=3: print 'usage: make_sexy_pact_plot.py treesum.root treesum.config' sys.exit(-1) #line_limits_x1 = (50.,200.) #set84a6s1 #line_limits_x2 = (100.,147.) #set84a6s1 line_limits_x1 = (60.,300.) #gen584a1_2s1 line_limits_x2 = (125,215.) #gen584a1_2s1 fl = file(sys.argv[2],'r').readlines() for l in fl: ls = l.split() if len(ls)<1: continue else: if ls[0]=='PACTCut/region_11': def pr(q): return float(q.replace(',','')) slopea, slopeb = pr(ls[2]), pr(ls[3]) ia, ib = pr(ls[4]), pr(ls[5]) from ROOT import * from clean_canvas import * from nice_colours import * gStyle = makegstyle(gStyle) gStyle = nice_colours(gStyle) f = TFile(sys.argv[1]) h_before = f.Get('PACT/pc6vs5_11_before') h_after = f.Get('PACT/pc6vs5_11_after') c1 = TCanvas('c1','c1') c1.SetRightMargin(.15) l1 = TLine(line_limits_x1[0], slopea*line_limits_x1[0]+ia, line_limits_x1[1], slopea*line_limits_x1[1]+ia) l2 = TLine(line_limits_x2[0], slopeb*line_limits_x2[0]+ib, line_limits_x2[1], slopeb*line_limits_x2[1]+ib) l1.SetLineWidth(3) l2.SetLineWidth(3) h_before.Draw('colz') l1.Draw() l2.Draw() c2 = TCanvas('c2','c2') c2.SetRightMargin(.15) h_after.Draw('colz') au = raw_input('>')