plot_lowE_sig_spread_martinez10102329v1.C
Go to the documentation of this file.
1 {
2 
3 double xlo[12] = {
4 0.18142,
5 0.21958,
6 0.25929,
7 0.30509,
8 0.35853,
9 0.39975,
10 0.46386,
11 0.51727,
12 0.57220,
13 0.63170,
14 0.68813,
15 0.74914
16 };
17 
18 double ylo[12] = {
19 0.16782,
20 0.63281,
21 1.30182,
22 1.99975,
23 2.78485,
24 3.39549,
25 4.18018,
26 4.70288,
27 5.19638,
28 5.60223,
29 5.92074,
30 6.20991
31 };
32 
33 double xhi[18] = {
34 0.17535,
35 0.20894,
36 0.23644,
37 0.26394,
38 0.29449,
39 0.32961,
40 0.36474,
41 0.41209,
42 0.44112,
43 0.47626,
44 0.51139,
45 0.54651,
46 0.58315,
47 0.61672,
48 0.65487,
49 0.68996,
50 0.71894,
51 0.75097
52 };
53 
54 double yhi[18] = {
55 0.40129,
56 0.92477,
57 1.50679,
58 2.08881,
59 2.61241,
60 3.22329,
61 3.80502,
62 4.70697,
63 5.37640,
64 6.13306,
65 6.71478,
66 7.29651,
67 7.76156,
68 8.11011,
69 8.48764,
70 8.77782,
71 8.95162,
72 9.12531
73 };
74 
75 
76 double xlo_no2p2h[17] = {
77 0.15701,
78 0.18445,
79 0.20884,
80 0.24238,
81 0.28049,
82 0.31707,
83 0.35213,
84 0.39482,
85 0.42835,
86 0.46646,
87 0.51677,
88 0.56555,
89 0.60823,
90 0.65091,
91 0.69207,
92 0.72409,
93 0.74695,
94 };
95 double ylo_no2p2h[17] = {
96 0.02907,
97 0.26163,
98 0.55233,
99 1.04651,
100 1.62791,
101 2.20930,
102 2.70349,
103 3.28488,
104 3.77907,
105 4.15698,
106 4.70930,
107 5.17442,
108 5.49419,
109 5.72674,
110 5.95930,
111 6.10465,
112 6.25000,
113 };
114 double xhi_no2p2h[20] = {
115 0.14024,
116 0.17683,
117 0.19817,
118 0.21646,
119 0.24238,
120 0.26677,
121 0.29421,
122 0.32622,
123 0.35823,
124 0.38720,
125 0.42073,
126 0.45427,
127 0.49238,
128 0.52287,
129 0.55945,
130 0.60671,
131 0.64329,
132 0.68445,
133 0.71646,
134 0.74848,
135 };
136 double yhi_no2p2h[20] = {
137 0.08721,
138 0.46512,
139 0.75581,
140 1.19186,
141 1.65698,
142 2.09302,
143 2.67442,
144 3.28488,
145 3.72093,
146 4.21512,
147 4.65116,
148 5.11628,
149 5.52326,
150 5.78488,
151 6.13372,
152 6.45349,
153 6.68605,
154 6.88953,
155 7.03488,
156 7.12209,
157 };
158 
159 TSpline3 lo ("lo",xlo,ylo,12,"0");
160 TSpline3 hi ("hi",xhi,yhi,18,"0");
161 TSpline3 lo_no2("lo",xlo_no2p2h,ylo_no2p2h,17,"0");
162 TSpline3 hi_no2("hi",xhi_no2p2h,yhi_no2p2h,20,"0");
163 
164 const int nsteps = 100;
165 const double emin = 0.20;
166 const double emax = 0.70;
167 const double step = (emax-emin)/(nsteps-1);
168 
169 double errp [nsteps];
170 double errn [nsteps];
171 double errp_no2[nsteps];
172 double errn_no2[nsteps];
173 double enu [nsteps];
174 
175 for(int i=0; i<nsteps; i++) {
176 
177  double x = emin + i*step;
178  double yh = hi->Eval(x);
179  double yl = lo->Eval(x);
180  double yc = 0.5*(yh+yl);
181  double yh_no2 = hi_no2->Eval(x);
182  double yl_no2 = lo_no2->Eval(x);
183  double yc_no2 = 0.5*(yh_no2+yl_no2);
184 
185  errp [i] = 100*(yh-yc)/yc;
186  errn [i] = 100*(yl-yc)/yc;
187  errp_no2[i] = 100*(yh_no2-yc_no2)/yc_no2;
188  errn_no2[i] = 100*(yl_no2-yc_no2)/yc_no2;
189  enu [i] = x;
190 }
191 
192 TGraph * grerrp = new TGraph(nsteps, enu, errp);
193 TGraph * grerrn = new TGraph(nsteps, enu, errn);
194 TGraph * grerrp_no2 = new TGraph(nsteps, enu, errp_no2);
195 TGraph * grerrn_no2 = new TGraph(nsteps, enu, errn_no2);
196 
197 grerrp->SetLineStyle(kDashed);
198 grerrn->SetLineStyle(kDashed);
199 
200 TCanvas * c = new TCanvas();
201 TH1F * hframe = (TH1F*)c->DrawFrame(0.2,-50,0.7,50);
202 hframe->GetXaxis()->SetTitle("E_{#nu} (GeV)");
203 hframe->GetYaxis()->SetTitle("#sigma spread %");
204 hframe->Draw();
205 
206 grerrp->Draw("L");
207 grerrn->Draw("L");
208 grerrp_no2->Draw("L");
209 grerrn_no2->Draw("L");
210 
211 TLegend * legend = new TLegend(0.6, 0.6, 0.9, 0.9);
212 legend->SetFillColor(0);
213 legend->SetBorderSize(0);
214 legend->AddEntry( grerrp, "Model spread (from Fig.1 in Martini arXiv:1010.2329v1", "L");
215 legend->AddEntry( grerrp_no2, "Model spread (as above but excluding RPA-2p2h)", "L");
216 legend->Draw();
217 
218 }
TSpline3 lo("lo", xlo, ylo, 12,"0")
TSpline3 hi("hi", xhi, yhi, 18,"0")
TSpline3 lo_no2("lo", xlo_no2p2h, ylo_no2p2h, 17,"0")
TSpline3 hi_no2("hi", xhi_no2p2h, yhi_no2p2h, 20,"0")