Esempio n. 1
0
    def onePlotFunction(self, histos, individual = {}) :
        dimension = self.dimensionOfHisto(histos)
        self.prepareCanvas(histos, dimension)

        options = {"newSampleNames": {},
                   "legendCoords": (0.86, 0.60, 1.00, 0.10),
                   "reverseLegend": False,
                   "ignoreHistos": [],
                   "order" : [ss["name"] for ss in self.someOrganizer.samples],
                   "legendTitle" : ""
                   }
        options.update(individual)
        if not options["ignoreHistos"] : options["ignoreHistos"] = [False]*len(histos)
        
        if self.shiftUnderOverFlows : self.doShiftUnderAndOverflows(dimension, histos, self.dontShiftList)
        self.setRanges(histos, *self.getExtremes(dimension, histos, options["ignoreHistos"]))

        count,stuffToKeep,pads = self.plotEachHisto(dimension, histos, options)
            
        if self.plotRatios and dimension==1 :
            ratios = self.plotRatio(histos,dimension)
        self.canvas.cd(0)
        if count>0 and not individual :
            self.printCanvas()
        if individual :
            return stuffToKeep,pads
        if dimension==2 and self.dependence2D :
            depHistos = tuple(utils.dependence(h) for h in histos)
            self.prepareCanvas(depHistos, dimension)
            count,stuffToKeep,pads = self.plotEachHisto(dimension, depHistos, options)
            self.canvas.cd(0)
            if count>0 : self.printCanvas()
Esempio n. 2
0
    def onePlotFunction(self, histos, ignoreHistos = None, newSampleNames = None, legendCoords = None, individual = False) :
        dimension = dimensionOfHisto(histos)
        self.prepareCanvas(histos, dimension)

        if ignoreHistos==None : ignoreHistos = [False]*len(histos)
        if self.shiftUnderOverFlows : shiftUnderAndOverflows(dimension, histos, self.dontShiftList)
        self.setRanges(histos, *self.getExtremes(dimension, histos, ignoreHistos))

        kwargs = {"legendCoords":legendCoords, "newSampleNames":newSampleNames} if individual else {}
        count,stuffToKeep,pads = self.plotEachHisto(dimension, histos, ignoreHistos, **kwargs)
            
        if self.plotRatios and dimension==1 :
            ratios = self.plotRatio(histos,dimension)
        self.canvas.cd(0)
        if count>0 and not individual :
            self.printCanvas()
        if individual :
            return stuffToKeep,pads
        if dimension==2 and self.dependence2D :
            depHistos = tuple(utils.dependence(h) for h in histos)
            self.prepareCanvas(depHistos, dimension)
            count,stuffToKeep,pads = self.plotEachHisto(dimension, depHistos, ignoreHistos, **kwargs)
            self.canvas.cd(0)
            if count>0 : self.printCanvas()