sensitivity_comps.py
Go to the documentation of this file.
1 import ROOT, os, array, sys
2 
3 variations = ["ProtonP120GeV","Optimizations_CP_run3_7862","Optimizations_CP_run3_8186"]
4 var_names = ["Nom v3r2p4","7862","8186"]
5 var_colors = [8,4,2]
6 
7 var_histos = []
8 
9 c1 = ROOT.TCanvas("c1");
10 
11 leg = ROOT.TLegend(0.4,0.6,0.6,0.8);
12 leg.SetFillStyle(0);
13 leg.SetBorderSize(0);
14 
15 i=0
16 for variation in variations:
17  print variation
18  nh_cp_file = ROOT.TFile("/lbne/data/users/lblpwg_tools/FastMC_Data/outputs/ljf26/Sensitivity_Plots/"+variation+"_nh_cp_histos.root");
19  var_histos.append(nh_cp_file.Get("h2"))
20  var_histos[i].SetDirectory(0)
21  var_histos[i].SetLineWidth(3)
22  var_histos[i].SetFillStyle(0)
23  var_histos[i].GetYaxis().SetTitleOffset(0.95)
24  var_histos[i].SetLineColor(var_colors[i])
25  if i==0:
26  var_histos[i].SetMaximum(var_histos[i].GetMaximum()*2)
27  var_histos[i].DrawCopy("")
28  else:
29  var_histos[i].DrawCopy("same")
30  leg.AddEntry(var_histos[i],var_names[i],"l")
31  i = i+1
32 
33 leg.Draw()
34 c1.Print("sensitivity_comps.eps")
35 c1.Print("sensitivity_comps.png")