print("Total events in output histogram N_ele: %.2f" % output['N_ele'].sum('dataset').sum('multiplicity').values( overflow='all')[()]) my_hists = {} #my_hists['N_ele'] = scale_and_merge(output['N_ele'], samples, fileset, nano_mapping) my_hists['N_ele'] = scale_and_merge(output['N_ele'], meta, fileset, nano_mapping) print("Total scaled events in merged histogram N_ele: %.2f" % my_hists['N_ele'].sum('dataset').sum('multiplicity').values( overflow='all')[()]) # Now make a nice plot of the electron multiplicity. # You can have a look at all the "magic" (and hard coded monstrosities) that happens in makePlot # in plots/helpers.py makePlot( my_hists, 'N_ele', 'multiplicity', data=[], bins=N_bins_red, log=True, normalize=False, axis_label=r'$N_{electron}$', new_colors=my_colors, new_labels=my_labels, #order=[nano_mapping['DY'][0], nano_mapping['TTZ'][0]], save=os.path.expandvars(cfg['meta']['plots']) + '/nano_analysis/N_ele_test.png')
my_colors = { 'topW_v3': '#FF595E', 'topW_EFT_cp8': '#000000', 'topW_EFT_mix': '#0F7173', 'TTZ': '#FFCA3A', 'TTW': '#8AC926', 'TTH': '#34623F', 'diboson': '#525B76', 'ttbar': '#1982C4', } makePlot(output, 'node', 'multiplicity', data=['DoubleMuon', 'MuonEG', 'EGamma'], bins=N_bins_red, log=False, normalize=False, axis_label=r'node', new_colors=my_colors, new_labels=my_labels, order=['diboson', 'TTW', 'TTH', 'TTZ', 'ttbar'], signals=['topW_v3', 'topW_EFT_cp8', 'topW_EFT_mix'], save=os.path.expandvars('$TWHOME/dump/ML_node'), ) makePlot(output, 'node0_score', 'score', data=[], bins=score_bins, log=False, normalize=False, axis_label=r'score', new_colors=my_colors, new_labels=my_labels, order=['diboson', 'TTW', 'TTH', 'TTZ', 'ttbar'], signals=['topW_v3', 'topW_EFT_cp8', 'topW_EFT_mix'], omit=['DoubleMuon', 'MuonEG', 'EGamma'], save=os.path.expandvars('$TWHOME/dump/ML_node0_score'), )
'TTW': '#8AC926', 'TTH': '#34623F', 'diboson': '#525B76', 'ttbar': '#1982C4', 'DY': '#6A4C93', 'WW': '#34623F', 'WZ': '#525B76', } makePlot( output, 'lead_lep', 'pt', data=['DoubleMuon', 'MuonEG', 'EGamma'], bins=pt_bins, log=True, normalize=True, axis_label=r'$p_{T}\ lead \ lep\ (GeV)$', new_colors=my_colors, new_labels=my_labels, order=['topW_v3', 'diboson', 'TTW', 'TTXnoW', 'DY', 'ttbar'], save=os.path.expandvars(plot_dir + '/OS_fwd_v1/lead_lep_pt'), ) makePlot( output, 'lead_lep', 'eta', data=['DoubleMuon', 'MuonEG', 'EGamma'], bins=eta_bins, log=True, normalize=True,
'rare': 'rare', } my_colors = { 'topW_v2': '#FF595E', 'TTZ': '#FFCA3A', 'TTW': '#8AC926', 'TTH': '#34623F', 'rare': '#525B76', 'ttbar': '#1982C4', } makePlot(output, 'score_topW_pos', 'score', log=False, normalize=False, axis_label=r'$top-W\ score$', new_colors=my_colors, new_labels=my_labels, save=plot_dir+'/score_topW_pos', order=['rare', 'TTH', 'ttbar', 'TTZ', 'TTW', 'topW_v2'], lumi=137, ) makePlot(output, 'score_topW_pos', 'score', log=False, normalize=False, shape=True, axis_label=r'$top-W\ score$', new_colors=my_colors, new_labels=my_labels, order=['rare', 'TTH', 'TTZ', 'TTW', 'topW_v2'], omit=['ttbar', 'rare'], save=plot_dir+'/score_topW_pos_shape', ymax=0.5, ) makePlot(output, 'score_topW_neg', 'score', log=False, normalize=False, axis_label=r'$top-W\ score$', new_colors=my_colors, new_labels=my_labels,
'cf_est_data', 'topW_v3' ] signals = [] omit = [ x for x in all_processes if (x not in signals and x not in order and x not in data) ] makePlot( output, 'MET', 'pt', data=data, bins=pt_bins_coarse, log=False, normalize=True, axis_label=r'$p_{T}^{miss}$', new_colors=my_colors, new_labels=my_labels, order=order, signals=signals, omit=omit, save=os.path.expandvars(plot_dir + sub_dir + 'MET_pt'), ) makePlot( output, 'fwd_jet', 'pt', data=data, bins=pt_bins_coarse, log=False,
'TTZ': '#FFCA3A', 'TTXnoW': '#FFCA3A', 'TTW': '#8AC926', 'TTH': '#34623F', 'diboson': '#525B76', 'ttbar': '#1982C4', 'DY': '#6A4C93', 'WW': '#34623F', 'WZ': '#525B76', } TFnormalize = True version_dir = '/2018_Nb_weights/' makePlot( output, 'N_b', 'multiplicity', data=['DoubleMuon', 'MuonEG', 'EGamma'], bins=N_bins_red, log=False, normalize=TFnormalize, axis_label=r'$N_{b-tag}$', new_colors=my_colors, new_labels=my_labels, order=['topW_v3', 'diboson', 'TTW', 'TTXnoW', 'DY', 'ttbar'], upHists=['centralUp', 'upCentral'], downHists=['centralDown', 'downCentral'], shape=False, save=os.path.expandvars(plot_dir + version_dir + 'N_b'), )
'rare': 'rare', } my_colors = { 'topW_v2': '#FF595E', 'TTZ': '#FFCA3A', 'TTW': '#8AC926', 'TTH': '#34623F', 'rare': '#525B76', 'ttbar': '#1982C4', } makePlot( output, 'sm_opt', 'e', log=False, normalize=False, axis_label=r'$top-W\ score$', new_colors=my_colors, new_labels=my_labels, save=plot_dir + '/' + variable, order=['rare', 'TTH', 'ttbar', 'TTZ', 'TTW'], signals=['topW_v2'], lumi=137, binwnorm=True, ymax=30, ) print(results)