def remove_name_entry(dictionary): return dict([i for i in dictionary.iteritems() if i[0] != 'name']) #sign = ['ss','os'] sign = ['os'] tauiso = ['tNoCuts', 'tSuperSuperLoose', 'tSuperLoose', 'tLoose', 'tTigh'] #sign = ['os'] #tauiso=['tTigh'] outputdir = 'plots/%s/TauFakeRateAnalyzerMVA/%s/' % (jobid, channel) if not os.path.exists(outputdir): os.makedirs(outputdir) plotter = Plotter(files, lumifiles, outputdir) EWKDiboson = views.StyleView( views.SumView( *[ plotter.get_view(regex) for regex in \ filter(lambda x : x.startswith('WW') or x.startswith('WZ') or x.startswith('ZZ') or x.startswith('WG'), mc_samples )] # filter(lambda x : x.startswith('WZ') , mc_samples )] ), **remove_name_entry(data_styles['WW*'#,'WZ*', 'WG*', 'ZZ*' ]) ) Wplus = views.StyleView( views.SumView(*[ plotter.get_view(regex)
'WZ*', 'WW*', 'ZZ*', 'TT*', 'WplusJets*', "data_MuEG*", ] files = [] lumifiles = [] for x in samples: files.extend(glob.glob('results/%s/ControlEM/%s.root' % (jobid, x))) lumifiles.extend(glob.glob('inputs/%s/%s.lumicalc.sum' % (jobid, x))) plotter = Plotter(files, lumifiles, output_dir) # Define how we estimate QCD - just take SS data. import rootpy.plotting.views as views def get_ss(x): return x.replace('em/', 'em/ss/') mc_view = views.SumView( *[views.PathModifierView(plotter.get_view(x), get_ss) for x in [ 'WZJetsTo3LNu*', 'ZZJetsTo4L*', 'WW*', 'WplusJets_madgraph', 'TTplusJets_madgraph', 'Zjets_M50', ]]
'WZ*', 'ZZ*', 'WW*', 'TT*', 'WplusJets*', "data_DoubleMu*", ] files = [] lumifiles = [] for x in samples: files.extend(glob.glob('results/%s/ControlZMM/%s.root' % (jobid, x))) lumifiles.extend(glob.glob('inputs/%s/%s.lumicalc.sum' % (jobid, x))) plotter = Plotter(files, lumifiles, output_dir) plotter.plot_mc_vs_data('zmm', 'm1m2Mass', rebin=4) plotter.save('mass') plotter.plot_mc_vs_data('zmm', 'm1Pt') plotter.save('m1Pt') plotter.plot_mc_vs_data('zmm', 'm2Pt') plotter.save('m2Pt') plotter.plot_mc_vs_data('zmm', 'm1AbsEta') plotter.save('m1AbsEta') plotter.plot_mc_vs_data('zmm', 'm2AbsEta') plotter.save('m2AbsEta') plotter.plot_mc_vs_data('zmm', 'nvtx')
'WZ*', 'WW*', 'ZZ*', 'TT*', 'WplusJets*', "data_MuEG*", ] files = [] lumifiles = [] for x in samples: files.extend(glob.glob('results/%s/AnalyzeEM/%s.root' % (jobid, x))) lumifiles.extend(glob.glob('inputs/%s/%s.lumicalc.sum' % (jobid, x))) plotter = Plotter(files, lumifiles, output_dir) # Override ordering plotter.mc_samples = [ 'TTplusJets_madgraph', 'WplusJets_madgraph', 'Zjets_M50', 'WZJetsTo3LNu*', 'WW*', 'ZZJetsTo4L*', ] sqrts = 7 if '7TeV' in jobid else 8 plotter.plot_mc_vs_data('em', 'emMass', rebin=10, leftside=False, xaxis='m_{e#mu} (GeV)')
#'WZ*', #'ZZ*', #'WW*', 'TT*', #'WplusJets*', "data_DoubleMu*", ] files = [] lumifiles = [] for x in samples: files.extend(glob.glob('results/%s/ControlZMM/%s.root' % (jobid, x))) lumifiles.extend(glob.glob('inputs/%s/%s.lumicalc.sum' % (jobid, x))) plotter = Plotter(files, lumifiles, output_dir) plotter.mc_samples = ['Zjets_M50'] sqrts = 7 if '7TeV' in jobid else 8 plotter.plot_mc_vs_data('zmm', 'm1m2Mass', rebin=2, xaxis='m_{#mu#mu} (GeV)') plotter.add_cms_blurb(sqrts) plotter.save('mass') plotter.plot_mc_vs_data('zmm', 'm1m2Mass', rebin=6, xaxis='m_{#mu#mu} (GeV)') plotter.add_cms_blurb(sqrts) plotter.save('mass_rebin') plotter.plot_mc_vs_data('zmm', 'm1Pt') plotter.save('m1Pt') plotter.plot_mc_vs_data('zmm', 'm1Pt', 5)
period = '13TeV' #sqrts = 7 if '7TeV' in jobid else 8 def remove_name_entry(dictionary): return dict([i for i in dictionary.iteritems() if i[0] != 'name']) sign = ['os', 'ss'] outputdir = 'plots/%s/MuMuAnalyzer/%s/' % (jobid, channel) if not os.path.exists(outputdir): os.makedirs(outputdir) plotter = Plotter(files, lumifiles, outputdir) EWKDiboson = views.StyleView( views.SumView( *[ plotter.get_view(regex) for regex in \ filter(lambda x : x.startswith('WW') or x.startswith('WZ') or x.startswith('ZZ') or x.startswith('WG'), mc_samples )] ), **remove_name_entry(data_styles['WW*'#,'WZ*', 'WG*', 'ZZ*' ]) ) Wplus = views.StyleView( views.SumView(*[ plotter.get_view(regex) for regex in filter(lambda x: x.startswith('Wplus'), mc_samples)
channel = 'mm' for x in mc_samples: # print x files.extend(glob.glob('results/%s/MuMuAnalyserGen/%s' % (jobid, x))) lumifiles.extend(glob.glob('inputs/%s/%s.lumicalc.sum' % (jobid, x))) period = '13TeV' sqrts = 13 outputdir = 'plots/%s/MuMuAnalyserGen/' % (jobid) if not os.path.exists(outputdir): os.makedirs(outputdir) #print "outputdir", outputdir #print "files", files #print lumifiles #plotter = BasePlotter(files, lumifiles, outputdir, None, 1000.) plotter = Plotter(files, lumifiles, outputdir) WSMH = views.StyleView( views.SumView( *[ plotter.get_view(regex) for regex in \ filter(lambda x : x.startswith('WminusHToTauTau_M125') or x.startswith('WplusHToTauTau_M125') , mc_samples )] ), **remove_name_entry(data_styles['WH*']) ) #EWK = views.StyleView( # views.SumView( # *[ plotter.get_view(regex) for regex in \ # filter(lambda x : x.startswith('EWKZ2Jets_ZToLL') or x.startswith('EWKZ2Jets_ZToNuNu') , mc_samples )] # ), **remove_name_entry(data_styles['EWK*']) #)
channel = 'Iso0p15' for x in mc_samples: # if x!='data*': files.extend(glob.glob('results/%s/MuMuAnalyser/%s' % (jobid, x))) lumifiles.extend(glob.glob('inputs/%s/%s.lumicalc.sum' % (jobid, x))) # else: # files.extend(glob.glob('results/lpairs_data_Oct9/MuMuAnalyser/%s' % (x))) # lumifiles.extend(glob.glob('inputs/lpairs_data_Oct9/%s.lumicalc.sum' % (x))) period = '13TeV' sqrts = 13 outputdir = 'plots/%s/MuMuAnalyser/' % (jobid) if not os.path.exists(outputdir): os.makedirs(outputdir) #plotter = BasePlotter(files, lumifiles, outputdir, None, 1000.) plotter = Plotter(files, lumifiles, outputdir) WSMH = views.StyleView( views.SumView( *[ plotter.get_view(regex) for regex in \ filter(lambda x : x.startswith('WminusHToTauTau_M125') or x.startswith('WplusHToTauTau_M125') , mc_samples )] ), **remove_name_entry(data_styles['WH*']) ) EWKDiboson = views.StyleView( views.SumView( *[ plotter.get_view(regex) for regex in \ filter(lambda x : x.startswith('WW') or x.startswith('WZ') or x.startswith('ZZ') or x.startswith('WG'), mc_samples )] ), **remove_name_entry(data_styles['WW*'#,'WZ*', 'WG*', 'ZZ*' ])
'WZ*', 'ZZ*', 'WW*', 'TT*', 'WplusJets*', "data_DoubleMu*", ] files = [] lumifiles = [] for x in samples: files.extend(glob.glob('results/%s/ControlZMM/%s.root' % (jobid, x))) lumifiles.extend(glob.glob('inputs/%s/%s.lumicalc.sum' % (jobid, x))) plotter = Plotter(files, lumifiles, output_dir) plotter.mc_samples = filter(lambda x: 'data' not in x.lower(), samples) #['Zjets_M50'] sqrts = 7 if '7TeV' in jobid else 8 plotter.plot_mc_vs_data('zmm', 'm1m2Mass', rebin=2, xaxis='m_{#mu#mu} (GeV)')#, show_ratio=True) plotter.add_cms_blurb(sqrts) plotter.save('mass') plotter.plot_mc_vs_data('zmm', 'm1m2Mass', rebin=6, xaxis='m_{#mu#mu} (GeV)')#, show_ratio=True) plotter.add_cms_blurb(sqrts) plotter.save('mass_rebin') plotter.plot_mc_vs_data('zmm', 'm1Pt', show_ratio=True) plotter.save('m1Pt') plotter.plot_mc_vs_data('zmm', 'm1Pt', 5, show_ratio=True)
'WZ*', 'WW*', 'ZZ*', 'TT*', 'WplusJets*', "data_MuEG*", ] files = [] lumifiles = [] for x in samples: files.extend(glob.glob('results/%s/ControlEM/%s.root' % (jobid, x))) lumifiles.extend(glob.glob('inputs/%s/%s.lumicalc.sum' % (jobid, x))) plotter = Plotter(files, lumifiles, output_dir) # Define how we estimate QCD - just take SS data. import rootpy.plotting.views as views def get_ss(x): return x.replace('em/', 'em/ss/') mc_view = views.SumView( *[views.PathModifierView(plotter.get_view(x), get_ss) for x in [ 'WZJetsTo3LNu*', 'ZZJetsTo4L*', 'WW*', 'WplusJets_madgraph', 'TTplusJets_madgraph',
return dict([i for i in dictionary.iteritems() if i[0] != 'name']) #sign = ['os', 'ss'] process = ['gg'] #ptcut = [0, 40] njets = [0, 1, 2, 3] sign = ['os'] ptcut = [0] #was 0 outputdir = 'plots/%s/LFVHETauAnalyzer/%s/' % (jobid, channel) if not os.path.exists(outputdir): os.makedirs(outputdir) plotter = Plotter(files, lumifiles, outputdir, None, forceLumi=19800) #plotter = SimplePlotter(files, lumifiles, outputdir) EWKDiboson = views.StyleView( views.SumView( *[ plotter.get_view(regex) for regex in \ filter(lambda x : x.startswith('WW') or x.startswith('WZ') or x.startswith('ZZ') or x.startswith('WG'), mc_samples )] ), **remove_name_entry(data_styles['WW*'#,'WZ*', 'WG*', 'ZZ*' ]) ) Wplus = views.StyleView( views.SumView(*[ plotter.get_view(regex)
period = '8TeV' sqrts = 7 if '7TeV' in jobid else 8 def remove_name_entry(dictionary): return dict( [ i for i in dictionary.iteritems() if i[0] != 'name'] ) sign = ['os', 'ss'] outputdir = 'plots/%s/EEAnalyzer/%s/' % (jobid, channel) if not os.path.exists(outputdir): os.makedirs(outputdir) plotter = Plotter(files, lumifiles, outputdir) EWKDiboson = views.StyleView( views.SumView( *[ plotter.get_view(regex) for regex in \ filter(lambda x : x.startswith('WW') or x.startswith('WZ') or x.startswith('ZZ') or x.startswith('WG'), mc_samples )] ), **remove_name_entry(data_styles['WW*'#,'WZ*', 'WG*', 'ZZ*' ]) ) Wplus = views.StyleView(views.SumView( *[ plotter.get_view(regex) for regex in filter(lambda x : x.startswith('Wplus'), mc_samples )]), **remove_name_entry(data_styles['Wplus*Jets*'])) DYLL = views.StyleView(views.SumView( *[ plotter.get_view(regex) for regex in filter(lambda x : x.endswith('skimmedLL'), mc_samples )]), **remove_name_entry(data_styles['Z*jets*LL'])) DYTT = views.StyleView(views.SumView( *[ plotter.get_view(regex) for regex in filter(lambda x : x.endswith('jets_M50_skimmedTT'), mc_samples )]), **remove_name_entry(data_styles['Z*jets*TT'])) TT = views.StyleView(views.SumView( *[ plotter.get_view(regex) for regex in filter(lambda x : x.startswith('TT') , mc_samples)]), **remove_name_entry(data_styles['TTJets*']))