for category in categoryNames: if category == 'inclusive': continue #yieldTable._rowList = ['Initial', '.', '.', '.', '.'] yieldTable._rowList = ['.', '.', '.', '.', '.'] if category[:2] == '3l' and do3l: yieldTable._rowList.extend(['3 lepton', 'Z removal', 'MET \& HT ', 'b-jet']) #, '1 jet']) #yieldTable._rowList.extend(['.', '.', '.', '.', '.', '.', 'BDT > -0.3']) elif category[:2] == 'ss' and doSS: yieldTable._rowList.extend(['ss lepton', '.', 'MET \& HT', '1 b-jet']) #, '1 jet']) elif category[:2] == 'os' and doOS: yieldTable._rowList.extend(['2 os leptons', 'MET cut', '1 b-jet/1 jet', 'Z removal']) yieldTable._category = category histDict = yieldTable.get_hist_dict('YieldByCut') if category[:2] == 'os': continue #yieldTable.print_table(histDict, doErrors = False, doEff = False, startBin = 1) else: yieldTable.print_table(histDict, doErrors = False, doEff = False, startBin = 1) outFile.close() subprocess.call('pdflatex -output-dir=yields yields/yields.tex', shell = True) subprocess.call('cp yields/yields.pdf plots/{0}/{1}_{2}/.'.format(currentDate, selection, suffix), shell = True) subprocess.call('cp yields/.yields_tmp.tex plots/{0}/{1}_{2}/yields.tex'.format(currentDate, selection, suffix), shell = True)
#yieldTable._columnList = ['BG', 'DATA', 'FCNHWW', 'FCNHZZ', 'FCNHTauTau'] #yieldTable._columnList = ['BG', 'DATA', 'FCNH']#, 'Significance'] yieldTable.add_datasets(samples['3l_inclusive'], Clear = True) #yieldTable.add_datasets('TTH_M-125') yieldTable.add_datasets('FCNH') #yieldTable.add_datasets('FCNHWW') #yieldTable.add_datasets('FCNHZZ') #yieldTable.add_datasets('FCNHTauTau') yieldTable.add_datasets('DATA') yieldTable._rowList = 5*['.'] + ['ss dilepton', 'Z removal', '2+ jets', 'MET/jet'] for category in cat3l: yieldTable._category = category histDict = yieldTable.get_hist_dict('YieldByCut') yieldTable.print_table(histDict, doErrors = True, doEff = False, startBin = 1) if doSS: #yieldTable.add_datasets(['Irreducible', 'Fakes', 'QFlips'], Clear = True) yieldTable._rowList = 5*['.'] + ['ss dilepton', 'Z removal', '2+ jets', 'MET'] yieldTable._columnList = ['Rare', 'WZJets3LNu', 'QFlips', 'Fakes', 'BG', 'DATA', 'FCNH'] #yieldTable._columnList = ['Rare', 'WZJets3LNu', 'QFlips', 'Fakes', 'BG', 'DATA', 'FCNHWW', 'FCNHTauTau', 'FCNHZZ']#, 'Significance'] #yieldTable._columnList = ['Rare', 'WZJets3LNu', 'QFlips', 'Fakes', 'BG', 'DATA', 'TTH_M-125'] #yieldTable._columnList = ['Rare', 'WZJets3LNu', 'QFlips', 'Fakes', 'BG', 'DATA', 'FCNHUp', 'FCNH'] for category in catSS: yieldTable.add_datasets(samples[category], Clear = True)