def print_all(self, label = "", plotText = False):
        '''print syst output plots'''

        if plotText:
            if self._model not in ["T2cc", "T2_4body"]:
                print ">>> Warning: systMap: print_all: Text plot will look shit for this model,"
                print "    so it will be turned off. Remember, looks are everything in HEP."
                self._plotString = "colz"
            else:
                self._plotString = "colztext"
                r.gStyle.SetPaintTextFormat("0.7f");

        # create instance of a multi page PDF
        pdf0 = multiPagePDF(outFileName = "out/%s_%s_%s.pdf" % (self._model, self._test, label),
                            title = "Systematics - %s - %s" % (self._test, label))

        # setup fine grain z-axis
        sutils.set_palette()

        # draw each variation
        for key in ["central", "up", "up_change", "down", "down_change"]:
            if "down" not in key or self._effs['down']:
                self.draw_plot(self._effs[key],
                                pdf0,
                                "Efficiency %s %s - %s" % (self._test, key, label),
                                "Acceptance",
                                1. if "change" in key else 0.)
                self.draw_plot(self._effs[key],
                              pdf0,
                              "Efficiency %s %s Error - %s" % (self._test, key, label),
                              "Acceptance",
                              1. if "change" in key else 0., err=True)


        if not self._cutSyst:
            # draw total systematic (don't plot for cut systematics)
            self.draw_plot(self._syst,
                            pdf0,
                            "%s Systematic - %s" % (self._test, label), 
                            "Systematic Value",
                            0.)
            # self.draw_plot(self._syst,
            #                 pdf0,
            #                 "%s Systematic Error - %s" % (self._test, label), 
            #                 "Systematic Value",
            #                 0., err=True)

        pdf0.close()
Beispiel #2
0
    def print_all(self, label="", plotText=False):
        '''print syst output plots'''

        if plotText:
            if self._model not in ["T2cc", "T2_4body"]:
                print ">>> Warning: systMap: print_all: Text plot will look shit for this model,"
                print "    so it will be turned off. Remember, looks are everything in HEP."
                self._plotString = "colz"
            else:
                self._plotString = "colztext"
                r.gStyle.SetPaintTextFormat("0.7f")

        # create instance of a multi page PDF
        pdf0 = multiPagePDF(
            outFileName="out/%s_%s_%s.pdf" % (self._model, self._test, label),
            title="Systematics - %s - %s" % (self._test, label))

        # setup fine grain z-axis
        sutils.set_palette()

        # draw each variation
        for key in ["central", "up", "up_change", "down", "down_change"]:
            if "down" not in key or self._effs['down']:
                self.draw_plot(
                    self._effs[key], pdf0,
                    "Efficiency %s %s - %s" % (self._test, key, label),
                    "Acceptance", 1. if "change" in key else 0.)
                self.draw_plot(self._effs[key],
                               pdf0,
                               "Efficiency %s %s Error - %s" %
                               (self._test, key, label),
                               "Acceptance",
                               1. if "change" in key else 0.,
                               err=True)

        if not self._cutSyst:
            # draw total systematic (don't plot for cut systematics)
            self.draw_plot(self._syst, pdf0,
                           "%s Systematic - %s" % (self._test, label),
                           "Systematic Value", 0.)
            # self.draw_plot(self._syst,
            #                 pdf0,
            #                 "%s Systematic Error - %s" % (self._test, label),
            #                 "Systematic Value",
            #                 0., err=True)

        pdf0.close()
        continue

    stop_mass = float(line_split[0])
    boost = float(line_split[1])
    weight = float(line_split[2])

    if stop_mass not in weights.keys():
        weights[stop_mass] = {}

    weights[stop_mass][boost] = weight

# print the weights dict
# sutils.dict_printer(weights)

r.gStyle.SetOptStat(0)

weight_distro = r.TH2D("Weights Summary", "Weights Summary", 12, 87.5, 387.5, 9, -50., 850.)
c1 = r.TCanvas()

for mass in weights:
    for boost in weights[mass]:
        weight_distro.Fill(mass, boost, weights[mass][boost])

sutils.set_palette(ncontours=100)
r.gStyle.SetPaintTextFormat("0.3f")
weight_distro.GetXaxis().SetTitle("m_{stop} (GeV)")
weight_distro.GetYaxis().SetTitle("Boost p_{T} (GeV)")
weight_distro.Draw("colztext")

c1.Print("out/stop_lut_weights.pdf")