fit_toy_tree.Branch('mr0',rt.AddressOf(struct,'mr0'),'mr0/F') fit_toy_tree.Branch('n',rt.AddressOf(struct,'n'),'n/F') fit_toy_tree.Branch('b',rt.AddressOf(struct,'b'),'b/F') fit_toy_tree.Branch('ntot',rt.AddressOf(struct,'ntot'),'ntot/F') mr0_list = fit_toy_summary.get_mr0() n_list = fit_toy_summary.get_n() b_list = fit_toy_summary.get_b() ntot_list = fit_toy_summary.get_ntot() # Fill tree for toy in range(fit_toy_summary.get_ntoys()): struct.mr0 = mr0_list[toy] struct.n = n_list[toy] struct.b = b_list[toy] struct.ntot = ntot_list[toy] fit_toy_tree.Fill() fit_toy_tree.Write() #draw the toy canvses and get the distributions bin_dists_high = get_canvases_and_68win(hists_high, "high") bin_dists_low = get_canvases_and_68win(hists_low, "low") #build an object containing a collpased list of the information from the bin distirbutions error_sum_high = error_summary(bin_dists_high) error_sum_low = error_summary(bin_dists_low) #build the pull distribution hist_pull_high = rt.TH1F("pull_hist_high","pull distirbution of high bins",20,-3,3) hist_pull_low = rt.TH1F("pull_hist_low","pull distirbution of low bins",20,-3,3)