W_ss_Data_ratio = W_ss_Data.Clone ('W_ss_Data_ratio') W_ss_WJets_ratio = W_ss_WJets.Clone ('W_ss_WJets_ratio') W_ss_Data_ratio.Divide (W_ss_WJets) W_ss_WJets_ratio.Divide (W_ss_WJets) p_ratio.DrawFrame(W_ss_WJets_ratio.GetXaxis().GetXmin(), 0.5, W_ss_WJets_ratio.GetXaxis().GetXmax(), 2) W_ss_Data_ratio.Draw ('same') W_ss_WJets_ratio.SetFillStyle (4001) W_ss_WJets_ratio.SetFillColor (2) W_ss_WJets_ratio.SetMarkerStyle (9) W_ss_WJets_ratio.Draw ('samehist') W_ss_WJets_ratio.Draw ('sameE3') can0.Print ('compare_W_ss.png','png') FULL_mt_ss.Group('EWK', ['WJets', 'Ztt_ZJ','VV']) FULL_mt_ss.Group('Higgs 125', ['HiggsVBF125', 'HiggsGGH125', 'HiggsVH125']) draw(FULL_mt_ss, False, 'TauEle', plotprefix = 'MT_ss') #PG (TEST) remake the WJets plots over the full range for OS #PG ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- #PG with the binning I want cut_os = '{cut} && diTau_charge==0'.format( cut = cutw ) FULL_mt_os = H2TauTauDataMC('mt', anaDir, selComps, weights, #PG prepare the plot 30, 0, 200, cut = cut_os, weight = weight, embed = options.embed, treeName = 'H2TauTauTreeProducerTauEle') FULL_mt_os.Hist('WJets').Scale( fw_os )
NBINS = int(options.nbins) XMIN = float(options.xmin) XMAX = float(options.xmax) # TH1.AddDirectory(False) dataName = 'Data' weight='weight' anaDir = args[0] cfgFileName = args[1] file = open( cfgFileName, 'r' ) cfg = imp.load_source( 'cfg', cfgFileName, file) embed = options.embed selComps, weights, zComps = prepareComponents(anaDir, cfg.config) can, pad, padr = buildCanvas() fwss, fwos, ss, os = plot_W_inclusive( options.hist, anaDir, selComps, weights, 30, 60, 300, 'isSignal', weight=weight, embed=options.embed) ssign, osign, ssQCD, osQCD = makePlot( options.hist, weights, fwss, fwos, NBINS, XMIN, XMAX, weight=weight, embed=options.embed); draw(osQCD) # from CMGTools.H2TauTau.proto.plotter.plot_H2TauTauDataMC_TauMu_Inclusive import makePlot as makePlotInclusive # ssign, osign, ssQCD, osQCD = makePlotInclusive( options.hist, anaDir, selComps, weights, fwss, fwos, NBINS, XMIN, XMAX, cat_Inc + ' && mt<40', weight=weight, embed=options.embed); draw(osQCD) # factor_QCD_nonIsoToIso()
aliases = {'DYJets':'Ztt', 'W3Jets':'WJets', 'TTJets11':'TTJets' } # import pdb; pdb.set_trace() selComps, weights, zComps = prepareComponents(anaDir, cfg.config, aliases) can, pad, padr = buildCanvas() # WJets normalization. relaxing tau iso to get more stat fwss, fwos, ss, os = plot_W( options.hist, anaDir, selComps, weights, 15, 60, 120, cutw, weight=weight, embed=options.embed) # import pdb; pdb.set_trace() antiso, osign, antisoQCD, osQCD = makePlot( options.hist, weights, fwss, fwos, NBINS, XMIN, XMAX, weight=weight, embed=options.embed); draw(osQCD) ## # from CMGTools.H2TauTau.proto.plotter.plot_H2TauTauDataMC_TauMu_Inclusive import makePlot as makePlotInclusive ## # ssign, osign, ssQCD, osQCD = makePlotInclusive( options.hist, anaDir, selComps, weights, fwss, fwos, NBINS, XMIN, XMAX, cat_Inc + ' && mt<40', weight=weight, embed=options.embed); draw(osQCD) ## # factor_QCD_nonIsoToIso()
W_ss_WJets_ratio = W_ss_WJets.Clone('W_ss_WJets_ratio') W_ss_Data_ratio.Divide(W_ss_WJets) W_ss_WJets_ratio.Divide(W_ss_WJets) p_ratio.DrawFrame(W_ss_WJets_ratio.GetXaxis().GetXmin(), 0.5, W_ss_WJets_ratio.GetXaxis().GetXmax(), 2) W_ss_Data_ratio.Draw('same') W_ss_WJets_ratio.SetFillStyle(4001) W_ss_WJets_ratio.SetFillColor(2) W_ss_WJets_ratio.SetMarkerStyle(9) W_ss_WJets_ratio.Draw('samehist') W_ss_WJets_ratio.Draw('sameE3') can0.Print('compare_W_ss.png', 'png') FULL_mt_ss.Group('EWK', ['WJets', 'Ztt_ZJ', 'VV']) FULL_mt_ss.Group('Higgs 125', ['HiggsVBF125', 'HiggsGGH125', 'HiggsVH125']) draw(FULL_mt_ss, False, 'TauEle', plotprefix='MT_ss') #PG (TEST) remake the WJets plots over the full range for OS #PG ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- #PG with the binning I want cut_os = '{cut} && diTau_charge==0'.format(cut=cutw) FULL_mt_os = H2TauTauDataMC( 'mt', anaDir, selComps, weights, #PG prepare the plot 30, 0, 200, cut=cut_os,
can, pad, padr = buildCanvas() fwss, fwos, ss, os = plot_W_inclusive(options.hist, anaDir, selComps, weights, 30, 60, 300, 'isSignal', weight=weight, embed=options.embed) antiso, osign, antisoQCD, osQCD = makePlot(options.hist, weights, fwss, fwos, NBINS, XMIN, XMAX, weight=weight, embed=options.embed) draw(osQCD) # from CMGTools.H2TauTau.proto.plotter.plot_H2TauTauDataMC_TauMu_Inclusive import makePlot as makePlotInclusive # ssign, osign, ssQCD, osQCD = makePlotInclusive( options.hist, anaDir, selComps, weights, fwss, fwos, NBINS, XMIN, XMAX, cat_Inc + ' && mt<40', weight=weight, embed=options.embed); draw(osQCD) # factor_QCD_nonIsoToIso()