def Save(chan, year=None, ms=None, ml=None, var='dnn'): if isinstance(chan, list): if len(chan) == 4: chan, year, ms, ml = chan elif len(chan) == 5: chan, year, ms, ml, var = chan for b in bkg: AddHistosFromFile(GetPath(chan, year, ms, ml), b) AddHistosFromFile(GetPath(chan, year, msin, mlin), 'stop_test') processes = bkg + ['stop_test'] processes.pop(processes.index('data')) hm = HistoManager(processes, path='', processDic=processDic[year], lumi=GetLumi(year) * 1000., indic=out) hm.SetHisto(var) os.system("mkdir -p %s" % outpath(chan, year, ms, ml)) hm.Save(outname=outpath(chan, year, ms, ml) + '/' + var, htag='')
'hist', "Semileptonic t#bar{t} OS", color=kAzure + 2) s.AddHisto(hSS, 'hist', 'hist', "Semileptonic t#bar{t} SS", color=kOrange + 1) s.SetLegendPos(0.65, 0.80, 0.88, 0.90, ncol=1) s.SetRatioMin(0.) s.SetRatioMax(10) s.SetXtitle(vardic[hname]) s.SetOutName(hname) s.Draw() for v in vardic.keys(): save(v, hmSS, prSS, 'SS') for v in vardic.keys(): save(v, hmOS, prOS, 'OS') for v in vardic.keys(): hmOS.SetHisto(v) hmSS.SetHisto(v) hOS = hmOS.GetHisto(prOS[0], v) hSS = hmSS.GetHisto(prOS[0], v) for pr in prOS[1:]: hOS.Add(hmOS.GetHisto(pr, v)) hSS.Add(hmSS.GetHisto(pr, v)) #saveOSSS(v, hOS, hSS ) #for v in vardic.keys(): saveOSSS(v, nonpromptOS['Semileptonictt'][v], ss['Semileptonictt'][v])