{ // Read reference data in dolan.txt FILE * fg1=fopen("dolan.txt", "r"); Int_t n_points_dolan = 8; Float_t x1[n_points_dolan], y1[n_points_dolan]; Float_t x, y; Int_t ncols_dolan; Int_t nlines1 = 0; while(1) { ncols_dolan = fscanf(fg1, "%f %f", &x, &y); if (ncols_dolan<0) break; x1[nlines1]= x; y1[nlines1] = y; nlines1++; } fclose(fg1); FILE *fg2=fopen("geant4_dose_Oncura_livermore.txt", "r"); Int_t n_points_geant4 = 398; Float_t x2[n_points_geant4], y2[n_points_geant4], ratio_liv[n_points_dolan]; Int_t ncols_geant4; Int_t nlines2 = 0; while(1) { ncols_geant4 = fscanf(fg2, "%f %f", &x, &y); if (ncols_geant4<0) break; x2[nlines2] = x; y2[nlines2] = y; for (int i=0; iSetLogy(); // Draw the graph with axis, continuous line, and put a '*' at each point gr1->SetTitle("Dose rate distribution"); gr1->GetXaxis()->SetTitle("Distance from the centre (cm)"); gr1->GetYaxis()->SetTitle("Normalised dose rate distribution"); gr1->SetLineWidth(1); gr1->SetMarkerColor(1); gr1->SetMarkerStyle(20); gr1->Draw("AP"); gr2->SetLineWidth(1); gr2->SetMarkerColor(2); gr2->SetMarkerStyle(21); gr2->SetMarkerSize(0.5); gr2->SetLineColor(2); gr2->Draw("CP"); gr3->SetLineWidth(0.3); gr3->SetMarkerColor(3); gr3->SetMarkerStyle(21); gr3->SetMarkerSize(0.2); gr3->SetLineColor(3); gr3->Draw("CP"); gr4->SetLineWidth(0.3); gr4->SetMarkerColor(4); gr4->SetMarkerStyle(21); gr4->SetMarkerSize(0.2); gr4->SetLineColor(4); gr4->Draw("CP"); gr5->SetLineWidth(0.3); gr5->SetMarkerColor(6); gr5->SetMarkerStyle(21); gr5->SetMarkerSize(0.2); gr5->SetLineColor(6); gr5->Draw("CP"); gr6->SetLineWidth(0.3); gr6->SetMarkerColor(8); gr6->SetMarkerStyle(21); gr6->SetMarkerSize(0.2); gr6->SetLineColor(8); gr6->Draw("CP"); TLegend *leg = new TLegend(0.3, 0.5, 0.6, 0.8); leg->SetFillColor(0); leg->AddEntry(gr1, "Reference data", "lp"); leg->AddEntry(gr2, "Geant4 - Oncura - Livermore", "lp"); leg->AddEntry(gr3, "Geant4 - Penelope", "lp"); leg->AddEntry(gr4, "Geant4 - Standard opt0", "lp"); leg->AddEntry(gr5, "Geant4 - Standard opt3", "lp"); leg->AddEntry(gr6, "Geant4 - Standard opt4", "lp"); leg->Draw(); }