3 FILE *fg1=fopen(
"granero.txt",
"r");
12 ncols_granero = fscanf(fg1,
"%f %f",&x, &y);
13 if (ncols_granero<0)
break;
24 FILE *
fg2=fopen(
"geant4_dose_Flexi_livermore.txt",
"r");
32 ncols_geant4_liv = fscanf(fg2,
"%f %f",&x, &y);
33 if (ncols_geant4_liv<0)
break;
40 if (x1[i]==x2[nlines2])
42 ratio_liv[i]= y2[
nlines2]/y1[i];
55 FILE *
fg3=fopen(
"geant4_dose_Flexi_penelope.txt",
"r");
62 ncols_geant4_penelope = fscanf(fg3,
"%f %f",&x, &y);
63 if (ncols_geant4_penelope<0)
break;
69 if (x1[i]==x3[nlines3])
71 ratio_pen[i]= y3[
nlines3]/y1[i];
83 FILE *
fg4=fopen(
"geant4_dose_Flexi_opt0.txt",
"r");
90 ncols_geant4_opt0 = fscanf(fg4,
"%f %f",&x, &y);
91 if (ncols_geant4_opt0<0)
break;
97 if (x1[i]==x4[nlines4])
99 ratio_opt0[i]= y4[
nlines4]/y1[i];
111 FILE *
fg5=fopen(
"geant4_dose_Flexi_opt3.txt",
"r");
118 ncols_geant4_opt3 = fscanf(fg5,
"%f %f",&x, &y);
119 if (ncols_geant4_opt3<0)
break;
126 if (x1[i]==x5[nlines5])
128 ratio_opt3[i]= y5[
nlines5]/y1[i];
140 FILE *
fg6=fopen(
"geant4_dose_Flexi_opt4.txt",
"r");
147 ncols_geant4_opt4 = fscanf(fg6,
"%f %f",&x, &y);
148 if (ncols_geant4_opt4<0)
break;
154 if (x1[i]==x6[nlines6])
156 ratio_opt4[i]= y6[
nlines6]/y1[i];
167 TGraph *
gr1 =
new TGraph (nlines1, x1, y1);
168 TGraph *
gr2 =
new TGraph (nlines2, x2, y2);
169 TGraph *
gr3 =
new TGraph (nlines3, x3, y3);
170 TGraph *
gr4 =
new TGraph (nlines4, x4, y4);
171 TGraph *
gr5 =
new TGraph (nlines5, x5, y5);
172 TGraph *
gr6 =
new TGraph (nlines6, x6, y6);
174 std::cout<<
"Livermore" << std::endl;
178 if ((ratio_liv[j] > 1.03) || (ratio_liv[j] < 0.97)) std::cout<<
"Difference above 3% :"<< x1[j] <<
", " << ratio_liv[j] << std::endl;
180 std::cout<<
"penelope" << std::endl;
183 if ((ratio_pen[j] > 1.03) || (ratio_pen[j] < 0.97)) std::cout<<
"Difference above 3% :" << x1[j] <<
", " << ratio_pen[j] << std::endl;
186 std::cout<<
"opt0" << std::endl;
189 if ((ratio_opt0[j] > 1.03) || (ratio_opt0[j] < 0.97)) std::cout<<
"Difference above 3% :" << x1[j] <<
", " << ratio_opt0[j] << std::endl;
192 std::cout<<
"opt3" << std::endl;
195 if ((ratio_opt3[j] > 1.03) || (ratio_opt3[j] < 0.97)) std::cout<<
"Difference above 3% :" << x1[j] <<
", " << ratio_opt3[j] << std::endl;
197 std::cout<<
"opt4" << std::endl;
200 if ((ratio_opt4[j] > 1.03) || (ratio_opt4[j] < 0.97)) std::cout<<
"Difference above 3% :" << x1[j] <<
", " << ratio_opt4[j] << std::endl;
203 TGraph *gr1_ratio =
new TGraph (nlines1, x1, ratio_liv);
204 TGraph *gr2_ratio =
new TGraph (nlines1, x1, ratio_pen);
205 TGraph *gr3_ratio =
new TGraph (nlines1, x1, ratio_opt0);
206 TGraph *gr4_ratio =
new TGraph (nlines1, x1, ratio_opt3);
207 TGraph *gr5_ratio =
new TGraph (nlines1, x1, ratio_opt4);
211 gr1->SetTitle(
"Dose rate distribution");
212 gr1->
GetXaxis()->SetTitle(
"Distance from the centre (cm)");
213 gr1->GetYaxis()->SetTitle(
"Normalised dose rate distribution");
214 gr1->SetLineWidth(1);
215 gr1->SetMarkerColor(1);
216 gr1->SetMarkerStyle(20);
219 gr2->SetLineWidth(0.3);
220 gr2->SetMarkerColor(2);
221 gr2->SetMarkerStyle(21);
222 gr2->SetMarkerSize(0.2);
223 gr2->SetLineColor(2);
226 gr3->SetLineWidth(0.3);
227 gr3->SetMarkerColor(3);
228 gr3->SetMarkerStyle(21);
229 gr3->SetMarkerSize(0.2);
230 gr3->SetLineColor(3);
233 gr4->SetLineWidth(0.3);
234 gr4->SetMarkerColor(4);
235 gr4->SetMarkerStyle(21);
236 gr4->SetMarkerSize(0.2);
237 gr4->SetLineColor(4);
240 gr5->SetLineWidth(0.3);
241 gr5->SetMarkerColor(6);
242 gr5->SetMarkerStyle(21);
243 gr5->SetMarkerSize(0.2);
244 gr5->SetLineColor(6);
247 gr6->SetLineWidth(0.3);
248 gr6->SetMarkerColor(9);
249 gr6->SetMarkerStyle(21);
250 gr6->SetMarkerSize(0.2);
251 gr6->SetLineColor(9);
254 TLegend *
leg =
new TLegend(0.3, 0.5, 0.6, 0.8);
255 leg->SetFillColor(0);
256 leg->AddEntry(gr1,
"Reference data",
"lp");
257 leg->AddEntry(gr2,
"Geant4 - Livermore",
"lp");
258 leg->AddEntry(gr3,
"Geant4 - Penelope",
"lp");
259 leg->AddEntry(gr4,
"Geant4 - opt0",
"lp");
260 leg->AddEntry(gr5,
"Geant4 - opt3",
"lp");
261 leg->AddEntry(gr6,
"Geant4 - opt4",
"lp");
264 c1 ->
Print(
"Flexi_dose_rate_distribution.jpg");
267 gr1_ratio->SetTitle(
"Dose rate distribution - RATIO");
268 gr1_ratio->
GetXaxis()->SetTitle(
"Distance from the centre (cm)");
269 gr1_ratio->GetYaxis()->SetTitle(
"Ratio");
270 gr1_ratio->SetLineWidth(1);
271 gr2_ratio->SetMarkerSize(0.8);
272 gr1_ratio->SetMarkerColor(1);
273 gr1_ratio->SetMarkerStyle(20);
274 gr1_ratio->Draw(
"AP");
276 gr2_ratio->SetLineWidth(0.3);
277 gr2_ratio->SetMarkerColor(2);
278 gr2_ratio->SetMarkerStyle(20);
279 gr2_ratio->SetMarkerSize(0.8);
280 gr2_ratio->SetLineColor(2);
281 gr2_ratio->Draw(
"P");
283 gr3_ratio->SetLineWidth(0.3);
284 gr3_ratio->SetMarkerColor(3);
285 gr3_ratio->SetMarkerStyle(20);
286 gr3_ratio->SetMarkerSize(0.8);
287 gr3_ratio->SetLineColor(3);
288 gr3_ratio->Draw(
"P");
290 gr4_ratio->SetLineWidth(0.3);
291 gr4_ratio->SetMarkerColor(4);
292 gr4_ratio->SetMarkerStyle(20);
293 gr4_ratio->SetMarkerSize(0.8);
294 gr4_ratio->SetLineColor(4);
295 gr4_ratio->Draw(
"P");
297 gr5_ratio->SetLineWidth(0.3);
298 gr5_ratio->SetMarkerColor(6);
299 gr5_ratio->SetMarkerStyle(21);
300 gr5_ratio->SetMarkerSize(1);
301 gr5_ratio->SetLineColor(6);
302 gr5_ratio->Draw(
"P");
304 TLegend *leg =
new TLegend(0.3, 0.5, 0.6, 0.8);
305 leg->SetFillColor(0);
306 leg->AddEntry(gr1_ratio,
"Geant4 - Livermore",
"lp");
307 leg->AddEntry(gr2_ratio,
"Geant4 - Penelope",
"lp");
308 leg->AddEntry(gr3_ratio,
"Geant4 - opt0",
"lp");
309 leg->AddEntry(gr4_ratio,
"Geant4 - opt3",
"lp");
310 leg->AddEntry(gr5_ratio,
"Geant4 - opt4",
"lp");
313 c1 ->
Print(
"Flexi_dose_rate_distribution_ratio.jpg");