4 x_title =
"Beam Options" 5 macros = [
"Nominal",
"CP_run5_9116_80GeV",
"CP_run15_12388",
"CP_run17_6432",
"CP_run18_3849"]
7 energies = [120.0,80.0,62.4,111.4,108.8]
8 versions = [
"v3r4p2",
"v3r4p2",
"v3r4p2",
"v3r4p2",
"v3r4p2"]
9 users = [
"ljf26",
"ljf26",
"ljf26",
"ljf26",
"ljf26"]
10 locs = [
"data",
"data",
"data",
"data",
"data"]
16 axis_labels = [
"Nominal",
"2Horn",
"3HornNuMI",
"3HornSphere",
"3HornCyl"]
19 x_title = "Horn A Downstream Endcap Thickness (mm)" 20 macros = ["CP_run15_12388_NoWater","CP_run15_12388_Horn1DE4mm_NoWater","CP_run15_12388_Horn1DE6mm_NoWater","CP_run15_12388_Horn1DE8mm_NoWater","CP_run15_12388_Horn1DE10mm_NoWater","CP_run15_12388_Horn1DE15mm_NoWater","CP_run15_12388_Horn1DE20mm_NoWater"] 21 xs = [2.0,4.0,6.0,8.0,10.0,15.0,20.0] 22 locs = ["data","data","data","data","data","data","data"] 23 energies = [62.4,62.4,62.4,62.4,62.4,62.4,62.4] 24 versions = ["v3r4p2","v3r4p2","v3r4p2","v3r4p2","v3r4p2","v3r4p2","v3r4p2"] 36 y_array = array.array(
'd',y)
37 percentiles = array.array(
'd',[0.0]);
38 probs = array.array(
'd',[1-float(X)/100.0])
40 ROOT.TMath.Quantiles(n,1,y_array,percentiles,probs,
False);
44 cp_75th_percentiles = []
50 for i
in range(len(xs)):
56 fhc_file =
"/dune/"+locs[i]+
"/users/"+user+
"/fluxfiles/g4lbne/"+version+
"/QGSP_BERT/"+macros[i]+
"/neutrino/flux/histos_g4lbne_"+version+
"_QGSP_BERT_"+macros[i]+
"_neutrino_LBNEFD_fastmc.root" 57 rhc_file =
"/dune/"+locs[i]+
"/users/"+user+
"/fluxfiles/g4lbne/"+version+
"/QGSP_BERT/"+macros[i]+
"/antineutrino/flux/histos_g4lbne_"+version+
"_QGSP_BERT_"+macros[i]+
"_antineutrino_LBNEFD_fastmc.root" 58 fhc_tfile = ROOT.TFile(fhc_file)
59 rhc_tfile = ROOT.TFile(rhc_file)
63 sensitivity_file =
open(
"/dune/data/users/"+os.getenv(
"USER")+
"/sensitivities/"+macro+
"_cpsens.dat")
64 lines = sensitivity_file.readlines()
65 sensitivity_file.close()
68 splitline = line.split()
69 deltacp = float(splitline[0])
70 delta_chi2 = float(splitline[1])
71 if delta_chi2 <0: delta_chi2 = 0
72 cp_sens.append(ROOT.TMath.Sqrt(delta_chi2))
75 dcps.append(deltacp/ROOT.TMath.Pi())
78 sens_v_dcp.append(cp_sens)
82 ROOT.gStyle.SetPadBottomMargin(0.25);
85 g1 = ROOT.TGraph(len(xs),array.array(
'd',xs),array.array(
'd',cp_75th_percentiles))
86 g1.GetXaxis().SetTitle(x_title)
87 g1.GetYaxis().SetTitle(
"GLoBES 75% CP Sensitivity (NH)")
89 g1.GetXaxis().SetTitle(
"")
90 for i
in range(len(xs)):
91 g1.GetXaxis().SetBinLabel(g1.GetXaxis().FindBin(i+1),axis_labels[i])
95 g1.SetMinimum(sens_min)
96 g1.SetMaximum(sens_max)
100 c1.Print(x_title.replace(
" ",
"")+
"_Sensitivity.eps")
101 c1.Print(x_title.replace(
" ",
"")+
"_Sensitivity.png")
105 ROOT.gStyle.SetTitleY(0.978);
106 ROOT.gStyle.SetOptStat(
False);
109 n = len(sens_v_dcp[0])
111 c = ROOT.TCanvas(
"c",
"c",500,500);
113 frame = ROOT.TH2D(
"frame",
"frame",100,-1,1,100,0,height);
114 frame.SetTitle(
"CP violation sensitivity");
115 frame.GetXaxis().SetTitle(
"#delta_{cp}/#pi");
116 frame.GetXaxis().SetTitleSize(0.05);
117 frame.GetXaxis().CenterTitle()
118 frame.GetXaxis().SetTitleOffset(1.1);
119 frame.GetXaxis().SetLabelSize(0.035);
121 frame.GetYaxis().SetTitle(
"#sigma = #sqrt{#Delta#chi^{2}}");
122 frame.GetYaxis().SetTitleSize(0.05);
123 frame.GetYaxis().CenterTitle()
124 frame.GetYaxis().SetTitleOffset(1.1);
125 frame.GetYaxis().SetLabelSize(0.035);
131 colors = [2,4,6,8,ROOT.kOrange]
132 legend = ROOT.TLegend(0.2,0.7,0.8,0.9);
133 legend.SetFillStyle(0);
134 legend.SetBorderSize(0);
135 for k
in range(len(macros)):
137 temp_graph = ROOT.TGraph(n,array.array(
'd',dcps),array.array(
'd',sens_v_dcp[k]))
138 temp_graph.SetLineWidth(3);
139 temp_graph.SetLineColor(colors[k])
141 temp_graph.Draw(
"lsame")
143 graphs.append(temp_graph)
145 legend.AddEntry(temp_graph,axis_labels[k],
"l");
151 c.SetBottomMargin(0.15);
152 c.SetLeftMargin(0.15);
155 c.Print(
"CP_sens.eps");
156 c.Print(
"CP_sens.png");
int open(const char *, int)
Opens a file descriptor.