def getSignal(signal_info, plot_info): plot_info["folder"] = signal_info["bkgd_wgt"] plot_info["file_name"] = signal_info["bkgd_file"] bkgd_hist = plotter.getHistFromFile(plot_info) plotter.setHistAttributes(bkgd_hist, plot_info, ROOT.kOrange - 8, 0) plot_info["folder"] = signal_info["comb_wgt"] plot_info["file_name"] = signal_info["comb_file"] combined_hist = plotter.getHistFromFile(plot_info) plotter.setHistAttributes(combined_hist, plot_info, ROOT.kOrange - 8, 0) combined_hist.Add(bkgd_hist, -1.0) return combined_hist
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)