def main(): weight_plot_info = getWeightArgs() weights = {"f_{T1} = 7.5e-12", "f_{T1} = 1.5e-12", "f_{T1} = 5e-13"} plotSameCanvas = True hist_opts = "hist" hist_stack = rt.THStack() cols = [rt.kOrange-8, rt.kBlue-4, rt.kBlue+8] i = 0 for weight in weights: weight_plot_info["folder"] = weight print cols[i] if plotSameCanvas: plots.addHistToStack(hist_stack, weight_plot_info, hist_opts, cols[i], 0) else: hist = plots.getHistFromFile(weight_plot_info) plots.setHistAttributes(hist, weight_plot_info, rt.kYellow-i, rt.kYellow+i) plot_info["output_file"] = "~/public_html/test/test%s.pdf" % i plots.makePlot(hist, hist_opts, plot_info) i += 1 if plotSameCanvas: plots.makePlot(hist_stack, "hist nostack", plot_info)
def main(): plot_info = getPlotArgs() canvas = ROOT.TCanvas("canvas", "canvas", 800, 600) hist = plotter.getHistFromFile(plot_info) plotter.setHistAttributes(hist, plot_info, ROOT.kRed+4, ROOT.kOrange-8) if type(hist) == "<class '__main__.TH2F'>": hist_opts = "colz" else: hist_opts = "hist" plotter.makePlot(hist, hist_opts, plot_info)
def main(): plot_info = getSignalArgs() signal_info = { "comb_file": plot_info.pop("comb_file"), "bkgd_file": plot_info.pop("bkgd_file"), "bkgd_wgt": plot_info.pop("bkgd_wgt"), "comb_wgt": plot_info.pop("comb_wgt"), } plot_info["folder"] = "" signal_hist = getSignal(signal_info, plot_info) if "compare_file" in plot_info and "compare_wgt" in plot_info: plot_info["file_name"] = plot_info["compare_file"] plot_info["folder"] = plot_info["compare_wgt"] hist_stack = ROOT.THStack() hist_stack.Add(signal_hist) plotter.addHistToStack(hist_stack, plot_info, "hist", ROOT.kBlue - 8, 0) plotter.makePlot(hist_stack, "hist nostack", plot_info) else: plotter.makePlot(signal_hist, "hist", plot_info)