def statUncert(self, combFunc=add_hist_quad): # TODO # this will fail for stacks with no histograms. hstatuncert = self.nominal().GetHists().At(0).Clone() hstatuncert.Reset() for h in self._nom.GetHists(): huncert = get_hist_uncert(h) hstatuncert = combFunc(hstatuncert, huncert) continue return hstatuncert
def statUncert(self): return get_hist_uncert(self._nom)
ndata += hdata.Integral() nbkg = 0 for hbkg in sbkg.GetHists(): nbkg += hbkg.Integral() if not ndata or not nbkg: print "cannot determine scale factor for plot %s: there are no data events! continuing." % n continue sf = float(ndata)/float(nbkg) sbkg.GetHists()[0].Scale(sf) hbkg = sbkg.GetHists()[0].Clone() hbkgerr = get_hist_uncert(hbkg) for h in sbkg.GetHists()[1:]: h.Scale(sf) hbkg.Add(h) hbkgerr = add_hist_quad(hbkgerr, get_hist_uncert(h)) set_hist_uncert(hbkg, hbkgerr) hbkg.SetMarkerStyle(0) hbkg.SetLineStyle(0) hbkg.SetFillColor(kBlack) hbkg.SetFillStyle(3004) if sdata: hdata = sdata.GetHists()[0].Clone() hdataerr = get_hist_uncert(hdata) for h in sdata.GetHists()[1:]: