Ejemplo n.º 1
0
    def addCurve(self, name, label):
        def getHisto(dataset):
            tmp = self.datasets.getDataset(dataset).getDatasetRootHisto(name)
            #tmp.normalizeToLuminosity(46)
            tmp.normalizeByCrossSection()
            return tmp.getHistogram()

        signalRootHisto = getHisto("Signal")
        signalEff = muonAnalysis.dist2eff(signalRootHisto)
        signalEffValues = dataset.histoToList(signalEff)

        tmpHistoManager = histograms.HistoManager(self.datasets, name)
        tmpHistoManager.normalizeMCByCrossSection()
        #tmpHistoManager.normalizeMCByLuminosity()
        mcSum = histograms.sumRootHistos([
            muonAnalysis.getSumOrRootHisto(histo) for histo in filter(
                lambda h: h.isMC(), tmpHistoManager.getHistos())
        ])
        mcSum = muonAnalysis.dist2pass(mcSum)

        bkgHisto = tmpHistoManager.getHisto("Background")
        bkg = muonAnalysis.getSumOrRootHisto(bkgHisto).Clone(name +
                                                             "_bkgfraction")
        bkg = muonAnalysis.dist2pass(bkg)
        bkg.Divide(mcSum)
        bkgValues = dataset.histoToList(bkg)

        curve = ROOT.TGraph(len(signalEffValues),
                            array.array("d", signalEffValues),
                            array.array("d", bkgValues))
        self.histoMgr.appendHisto(histograms.HistoGraph(curve, label))
    def __init__(self, datasets, dname, names, labels):
        plots.PlotBase.__init__(self, [])

        self.name = dname
        self.ylabel = "Efficiency"

        for hname, label in zip(names, labels):
            dh = datasets.getDataset(dname).getDatasetRootHisto(hname)
            dh.normalizeByCrossSection()
            dh = dataset.DatasetRootHisto(muonAnalysis.dist2eff(dh.getHistogram()), dh.getDataset())
            dh.setName(label)
            self.histoMgr.append(dh)

        self.histoMgr.forEachHisto(styles.generator2(styles.StyleMarker(markerSize=1.5), plotStyles))
        self.histoMgr.setHistoLegendStyleAll("l")
Ejemplo n.º 3
0
    def __init__(self, datasets, dname, names, labels):
        plots.PlotBase.__init__(self, [])

        self.name = dname
        self.ylabel = "Efficiency"

        for hname, label in zip(names, labels):
            dh = datasets.getDataset(dname).getDatasetRootHisto(hname)
            dh.normalizeByCrossSection()
            dh = dataset.DatasetRootHisto(
                muonAnalysis.dist2eff(dh.getHistogram()), dh.getDataset())
            dh.setName(label)
            self.histoMgr.append(dh)

        self.histoMgr.forEachHisto(
            styles.generator2(styles.StyleMarker(markerSize=1.5), plotStyles))
        self.histoMgr.setHistoLegendStyleAll("l")
    def addCurve(self, name, label):
        def getHisto(dataset):
            tmp = self.datasets.getDataset(dataset).getDatasetRootHisto(name)
            tmp.normalizeByCrossSection()
            return tmp.getHistogram()
        signalRootHisto = getHisto("Signal")
        bkgRootHisto = getHisto("Background")

        signalEff = muonAnalysis.dist2eff(signalRootHisto)
        bkgRej = muonAnalysis.dist2rej(bkgRootHisto)
#        bkgRej = muonAnalysis.dist2eff(bkgRootHisto)

        signalEffValues = dataset.histoToList(signalEff)
        bkgRejValues = dataset.histoToList(bkgRej)

        roc = ROOT.TGraph(len(signalEffValues), array.array("d", signalEffValues), array.array("d", bkgRejValues))
        self.histoMgr.appendHisto(histograms.HistoGraph(roc, label))
Ejemplo n.º 5
0
    def addCurve(self, name, label):
        def getHisto(dataset):
            tmp = self.datasets.getDataset(dataset).getDatasetRootHisto(name)
            tmp.normalizeByCrossSection()
            return tmp.getHistogram()

        signalRootHisto = getHisto("Signal")
        bkgRootHisto = getHisto("Background")

        signalEff = muonAnalysis.dist2eff(signalRootHisto)
        bkgRej = muonAnalysis.dist2rej(bkgRootHisto)
        #        bkgRej = muonAnalysis.dist2eff(bkgRootHisto)

        signalEffValues = dataset.histoToList(signalEff)
        bkgRejValues = dataset.histoToList(bkgRej)

        roc = ROOT.TGraph(len(signalEffValues),
                          array.array("d", signalEffValues),
                          array.array("d", bkgRejValues))
        self.histoMgr.appendHisto(histograms.HistoGraph(roc, label))
    def addCurve(self, name, label):
        def getHisto(dataset):
            tmp = self.datasets.getDataset(dataset).getDatasetRootHisto(name)
            #tmp.normalizeToLuminosity(46)
            tmp.normalizeByCrossSection()
            return tmp.getHistogram()
        signalRootHisto = getHisto("Signal")
        signalEff = muonAnalysis.dist2eff(signalRootHisto)
        signalEffValues = dataset.histoToList(signalEff)

        tmpHistoManager = histograms.HistoManager(self.datasets, name)
        tmpHistoManager.normalizeMCByCrossSection()
        #tmpHistoManager.normalizeMCByLuminosity()
        mcSum = histograms.sumRootHistos([muonAnalysis.getSumOrRootHisto(histo) for histo in filter(lambda h: h.isMC(), tmpHistoManager.getHistos())])
        mcSum = muonAnalysis.dist2pass(mcSum)

        bkgHisto = tmpHistoManager.getHisto("Background")
        bkg = muonAnalysis.getSumOrRootHisto(bkgHisto).Clone(name+"_bkgfraction")
        bkg = muonAnalysis.dist2pass(bkg)
        bkg.Divide(mcSum)
        bkgValues = dataset.histoToList(bkg)

        curve = ROOT.TGraph(len(signalEffValues), array.array("d", signalEffValues), array.array("d", bkgValues))
        self.histoMgr.appendHisto(histograms.HistoGraph(curve, label))