Ejemplo n.º 1
0
    def nomSystUncert(self, combFunc=add_hist_quad, systNames=None):

        if systNames == None:
            systNames = self._systs.keys()

        hnom = self._nom.Clone()
        set_hist_uncert(hnom, self.systUncert(combFunc=combFunc, systNames=systNames))

        return hnom
Ejemplo n.º 2
0
    def nomStatSystUncert(self, systCombFunc=add_hist_quad, statSystCombFunc=add_hist_quad, systNames=None):

        if systNames == None:
            systNames = self._systs.keys()
        hnom = self._nom.Clone()
        hsystuncert = self.systUncert(combFunc=systCombFunc, systNames=systNames)
        hstatuncert = self.statUncert()
        set_hist_uncert(hnom, statSystCombFunc(hsystuncert, hstatuncert))

        return hnom
Ejemplo n.º 3
0
    def nomHistStatSystUncert(self, statCombFunc=add_hist_quad,
            systCombFunc=add_hist_quad,
            statSystCombFunc=add_hist_quad,
            systNames=None):

        if systNames == None:
            systNames = self._systs.keys()

        hnom = self.nomHist()
        huncert = self.statSystUncert(statCombFunc=statCombFunc,
                systCombFunc=systCombFunc,
                statSystCombFunc=statSystCombFunc,
                systNames=systNames)

        set_hist_uncert(hnom, huncert)

        return hnom
Ejemplo n.º 4
0
    def nomHistStatUncert(self, combFunc=add_hist_quad):
        hnom = sum_hists(self.nominal().GetHists())
        set_hist_uncert(hnom, self.statUncert(combFunc=combFunc))

        return hnom
Ejemplo n.º 5
0
        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:]:
            hdata.Add(h)
            hdataerr = add_hist_quad(hdataerr, get_hist_uncert(h))


    if ssig:
        for h in ssig.GetHists():