def launch_plot(inputFile, outputDirPlots, variables, cuts, samples, plot, nuisances, legend, groupPlot): factory = PlotFactory() factory._tag = opt.tag factory._energy = opt.energy factory._lumi = opt.lumi factory._plotNormalizedDistributions = opt.plotNormalizedDistributions factory._plotNormalizedIncludeData = opt.plotNormalizedIncludeData factory._plotNormalizedDistributionsTHstack = opt.plotNormalizedDistributionsTHstack factory._showIntegralLegend = opt.showIntegralLegend if opt.onlyPlot is not None: factory._plotsToWrite = opt.onlyPlot.split(',') factory._plotLinear = opt.linearOnly or not opt.logOnly factory._plotLog = opt.logOnly or not opt.linearOnly factory._scaleToPlot = opt.scaleToPlot factory._minLogC = opt.minLogC factory._maxLogC = opt.maxLogC factory._minLogCratio = opt.minLogCratio factory._maxLogCratio = opt.maxLogCratio factory._maxLinearScale = opt.maxLinearScale factory._minLogCdifference = opt.minLogCratio factory._maxLogCdifference = opt.maxLogCratio factory._showRelativeRatio = opt.showRelativeRatio factory._showDataMinusBkgOnly = opt.showDataMinusBkgOnly factory._removeWeight = opt.removeWeight factory._invertXY = opt.invertXY factory._fileFormats = opt.fileFormats.split(',') factory._postFit = opt.postFit factory._removeMCStat = opt.removeMCStat factory._plotFancy = opt.plotFancy factory._SkipMissingNuisance = opt.skipMissingNuisance factory._extraLegend = opt.extraLegend factory._preliminary = not opt.NoPreliminary factory._removeAllMC = opt.RemoveAllMC factory.makePlot(inputFile, outputDirPlots, variables, cuts, samples, plot, nuisances, legend, groupPlot)
factory._maxLogCratio = opt.maxLogCratio factory._maxLinearScale = opt.maxLinearScale factory._minLogCdifference = opt.minLogCratio factory._maxLogCdifference = opt.maxLogCratio factory._showRelativeRatio = opt.showRelativeRatio factory._showDataMinusBkgOnly = opt.showDataMinusBkgOnly factory._removeWeight = opt.removeWeight factory._invertXY = opt.invertXY factory._fileFormats = opt.fileFormats.split(',') factory._postFit = opt.postFit #samples = {} samples = OrderedDict() if opt.samplesFile == None: print " Please provide the samples structure (not strictly needed in mkPlot, since list of samples read from plot.py) " elif os.path.exists(opt.samplesFile): handle = open(opt.samplesFile, 'r') exec(handle) handle.close() cuts = {} if os.path.exists(opt.cutsFile): handle = open(opt.cutsFile, 'r') exec(handle) handle.close()
factory._maxLogC = opt.maxLogC factory._minLogCratio = opt.minLogCratio factory._maxLogCratio = opt.maxLogCratio factory._maxLinearScale = opt.maxLinearScale factory._minLogCdifference = opt.minLogCratio factory._maxLogCdifference = opt.maxLogCratio factory._showRelativeRatio = opt.showRelativeRatio factory._showDataMinusBkgOnly = opt.showDataMinusBkgOnly factory._removeWeight = opt.removeWeight factory._invertXY = opt.invertXY factory._postFit = opt.postFit #samples = {} samples = OrderedDict() if os.path.exists(opt.samplesFile) : handle = open(opt.samplesFile,'r') exec(handle) handle.close() cuts = {} if os.path.exists(opt.cutsFile) : handle = open(opt.cutsFile,'r') exec(handle) handle.close()