Package madgraph :: Package various :: Module plot_djrs
[hide private]
[frames] | no frames]

Module plot_djrs

source code

Example code to plot custom curves based on djrs.dat with matplotlib

Variables [hide private]
  input_file = './Events/run_01/tag_1_djrs.dat'
  hwu_list = HwUList(input_file, raw_labels= True)
  names = hwu_list.get_hist_names()
  weights_name = hwu_list.get_wgt_names()
  selected_hist = [hwu_list.get(n) for n in names if 'd01' in n]
  gs1 = gridspec.GridSpec(2, 1, height_ratios= [5, 1])
  main_frame = plt.subplot(gs1 [0])
  ratio_frame = plt.subplot(gs1 [1])
  qcut = [l for l in weights_name if l.startswith('MUF=1_MUR=1_P...
  h_0j = [h for h in selected_hist if 'Jet sample 0' in h.get_Hw...
  h_1j = [h for h in selected_hist if 'Jet sample 1' in h.get_Hw...
  y_0j = h_0j.get(min_qcut)
  y_1j = h_1j.get(max_qcut)
  ratio = [y_0j [i]/ y_1j [i] if y_1j [i] else 0 for i in xrange...
  ax_c = main_frame.twinx()
Variables Details [hide private]

qcut

Value:
[l for l in weights_name if l.startswith('MUF=1_MUR=1_PDF=247000_MERGI\
NG=')]

h_0j

Value:
[h for h in selected_hist if 'Jet sample 0' in h.get_HwU_histogram_nam\
e()] [0]

h_1j

Value:
[h for h in selected_hist if 'Jet sample 1' in h.get_HwU_histogram_nam\
e()] [0]

ratio

Value:
[y_0j [i]/ y_1j [i] if y_1j [i] else 0 for i in xrange(len(y_0j))]