plot_lowE_sig_spread_genie.C
Go to the documentation of this file.
1 {
2 TFile favg ("./ccqe_avg_defkF.root", "read");
3 TFile fnoavg ("./ccqe_noavg_defkF.root", "read");
4 TFile favgkFlo("./ccqe_avg_kF200.root", "read");
5 TFile favgkFhi("./ccqe_avg_kF250.root", "read");
6 TFile favgMalo("./ccqe_avg_Mam15pct.root", "read");
7 TFile favgMahi("./ccqe_avg_Map15pct.root", "read");
8 
9 TDirectory * davg = (TDirectory *) favg -> Get("nu_mu_O16");
10 TDirectory * dnoavg = (TDirectory *) fnoavg -> Get("nu_mu_O16");
11 TDirectory * davgkFlo = (TDirectory *) favgkFlo -> Get("nu_mu_O16");
12 TDirectory * davgkFhi = (TDirectory *) favgkFhi -> Get("nu_mu_O16");
13 TDirectory * davgMalo = (TDirectory *) favgMalo -> Get("nu_mu_O16");
14 TDirectory * davgMahi = (TDirectory *) favgMahi -> Get("nu_mu_O16");
15 
16 TGraph * xsavg = (TGraph*) davg -> Get("qel_cc_n");
17 TGraph * xsnoavg = (TGraph*) dnoavg -> Get("qel_cc_n");
18 TGraph * xsavgkFlo = (TGraph*) davgkFlo -> Get("qel_cc_n");
19 TGraph * xsavgkFhi = (TGraph*) davgkFhi -> Get("qel_cc_n");
20 TGraph * xsavgMalo = (TGraph*) davgMalo -> Get("qel_cc_n");
21 TGraph * xsavgMahi = (TGraph*) davgMahi -> Get("qel_cc_n");
22 
23 TCanvas * c1 = new TCanvas();
24 TH1F * hframe1 = (TH1F*)c1->DrawFrame(0,0,1.8,10);
25 
26 xsavg->SetLineWidth(3);
27 xsavgkFlo->SetLineColor(kGreen);
28 xsavgkFhi->SetLineColor(kRed);
29 
30 xsavg->Draw("L");
31 xsnoavg->Draw("LSAME");
32 xsavgkFlo->Draw("LSAME");
33 xsavgkFhi->Draw("LSAME");
34 
35 const int nsteps = 100;
36 const double emin = 0.20;
37 const double emax = 0.70;
38 const double step = (emax-emin)/(nsteps-1);
39 
40 double errp [nsteps];
41 double errn [nsteps];
42 double errp_pF[nsteps];
43 double errn_pF[nsteps];
44 double errp_kF[nsteps];
45 double errn_kF[nsteps];
46 double errp_Ma[nsteps];
47 double errn_Ma[nsteps];
48 double enu [nsteps];
49 
50 for(int i=0; i<nsteps; i++) {
51 
52  double x = emin + i*step;
53  double yavg = xsavg->Eval(x);
54  double ynoavg = xsnoavg->Eval(x);
55  double yavgnoavgc = 0.5*(yavg+ynoavg);
56  double yavgkFlo = xsavgkFlo->Eval(x);
57  double yavgkFhi = xsavgkFhi->Eval(x);
58  double yavgMalo = xsavgMalo->Eval(x);
59  double yavgMahi = xsavgMahi->Eval(x);
60 
61  enu [i] = x;
62 
63  errp_pF[i] = 100*( TMath::Max(yavg,ynoavg) - yavgnoavgc)/yavgnoavgc;
64  errn_pF[i] = 100*( TMath::Min(yavg,ynoavg) - yavgnoavgc)/yavgnoavgc;
65  errp_kF[i] = 100*( TMath::Max(yavgkFhi,yavgkFlo) - yavg)/yavg;
66  errn_kF[i] = 100*( TMath::Min(yavgkFhi,yavgkFlo) - yavg)/yavg;
67  errp_Ma[i] = 100*( TMath::Max(yavgMahi,yavgMalo) - yavg)/yavg;
68  errn_Ma[i] = 100*( TMath::Min(yavgMahi,yavgMalo) - yavg)/yavg;
69  errp [i] = TMath::Sqrt(errp_pF[i]*errp_pF[i] + errp_kF[i]*errp_kF[i] + errp_Ma[i]*errp_Ma[i]);
70  errn [i] = -TMath::Sqrt(errn_pF[i]*errn_pF[i] + errn_kF[i]*errn_kF[i] + errn_Ma[i]*errn_Ma[i]);
71 }
72 
73 TGraph * grerrp_pF = new TGraph(nsteps, enu, errp_pF);
74 TGraph * grerrn_pF = new TGraph(nsteps, enu, errn_pF);
75 TGraph * grerrp_kF = new TGraph(nsteps, enu, errp_kF);
76 TGraph * grerrn_kF = new TGraph(nsteps, enu, errn_kF);
77 TGraph * grerrp_Ma = new TGraph(nsteps, enu, errp_Ma);
78 TGraph * grerrn_Ma = new TGraph(nsteps, enu, errn_Ma);
79 TGraph * grerrp = new TGraph(nsteps, enu, errp);
80 TGraph * grerrn = new TGraph(nsteps, enu, errn);
81 
82 TCanvas * c2 = new TCanvas();
83 TH1F * hframe2 = (TH1F*)c2->DrawFrame(0.2,-50,0.7,50);
84 hframe2->GetXaxis()->SetTitle("E_{#nu} (GeV)");
85 hframe2->GetYaxis()->SetTitle("#sigma spread %");
86 hframe2->Draw();
87 
88 grerrp ->SetLineWidth(3);
89 grerrn ->SetLineWidth(3);
90 grerrp_pF->SetLineStyle(kDotted);
91 grerrn_pF->SetLineStyle(kDotted);
92 grerrp_kF->SetLineStyle(kDashed);
93 grerrn_kF->SetLineStyle(kDashed);
94 
95 grerrp ->Draw("L");
96 grerrn ->Draw("L");
97 grerrp_pF->Draw("L");
98 grerrn_pF->Draw("L");
99 grerrp_kF->Draw("L");
100 grerrn_kF->Draw("L");
101 grerrp_Ma->Draw("L");
102 grerrn_Ma->Draw("L");
103 
104 TLegend * legend = new TLegend(0.6, 0.6, 0.9, 0.9);
105 legend->SetFillColor(0);
106 legend->SetBorderSize(0);
107 legend->AddEntry( grerrp, "Combined error for #nu_{#mu} O^{16} CCQE", "L");
108 legend->AddEntry( grerrp_pF, "Effect of E_{#nu} smearing from the nucleon momentum distribution", "L");
109 legend->AddEntry( grerrp_kF, "k_{F} #pm 25 MeV (~10%) (effect of modifying Pauli-blocking term)", "L");
110 legend->AddEntry( grerrp_Ma, "M_{A} #pm 15%", "L");
111 legend->Draw();
112 }
TGraph * xsavg
TFile favgMalo("./ccqe_avg_Mam15pct.root","read")
PYTHON x
Definition: diff.txt:3
double enu[nsteps]
size_t i(0)
const int nsteps
TGraph * grerrp_kF
TFile fnoavg("./ccqe_noavg_defkF.root","read")
double errp_Ma[nsteps]
TH1F * hframe1
TDirectory * dnoavg
TGraph * xsavgkFhi
TGraph * grerrp_Ma
const double emin
TDirectory * davg
double errp_pF[nsteps]
TCanvas * c2
TLegend * legend
TGraph * grerrn_kF
TGraph * grerrn_Ma
const double emax
TFile favgkFhi("./ccqe_avg_kF250.root","read")
TH1F * hframe2
TDirectory * davgMahi
double errn[nsteps]
TDirectory * davgkFlo
const double step
TGraph * xsnoavg
TCanvas * c1
TDirectory * davgMalo
TFile favgMahi("./ccqe_avg_Map15pct.root","read")
TGraph * grerrn
TDirectory * davgkFhi
double errp_kF[nsteps]
TGraph * xsavgMahi
TGraph * xsavgMalo
TGraph * xsavgkFlo
double errp[nsteps]
double errn_kF[nsteps]
TGraph * grerrp
TGraph * grerrp_pF
TFile favgkFlo("./ccqe_avg_kF200.root","read")
double errn_Ma[nsteps]
double errn_pF[nsteps]
TGraph * grerrn_pF