Geant4 Cross Reference |
1 { 1 { 2 gROOT->Reset(); 2 gROOT->Reset(); 3 3 4 /* 4 /* 5 * Mainegra et al. Med. Phys. 32, 685-699 (2 5 * Mainegra et al. Med. Phys. 32, 685-699 (2005) 6 * Seltzer, Appl. Radiat. Isot. 42 (1991) pa 6 * Seltzer, Appl. Radiat. Isot. 42 (1991) page 917 7 * L. Ferrer et al. Cancer Bio. Rad. 22-1 (2 7 * L. Ferrer et al. Cancer Bio. Rad. 22-1 (2007) 8 */ 8 */ 9 9 10 ifstream in; 10 ifstream in; 11 in.open("./EGSnrc/100keV-DPK.ascii"); << 11 in.open("./EGSnrc/10keV-DPK.ascii"); 12 //in.open("./Etran/100keV-DPK.ascii"); 12 //in.open("./Etran/100keV-DPK.ascii"); 13 13 14 // Create a new histogram 14 // Create a new histogram 15 double x_min = 0; 15 double x_min = 0; 16 double x_max = 1.2; 16 double x_max = 1.2; 17 17 18 int nbdata = 0; 18 int nbdata = 0; 19 in >> nbdata; 19 in >> nbdata; 20 20 21 TH1D* h1d = new TH1D("h1d","",nbdata,x_min, 21 TH1D* h1d = new TH1D("h1d","",nbdata,x_min,x_max); 22 22 23 Double_t x, y; 23 Double_t x, y; 24 for ( int i = 0 ; i < nbdata ; i++ ) { 24 for ( int i = 0 ; i < nbdata ; i++ ) { 25 in >> x >> y ; 25 in >> x >> y ; 26 if (!in.good()) break; 26 if (!in.good()) break; 27 h1d->Fill(x,y); 27 h1d->Fill(x,y); 28 } 28 } 29 in.close(); 29 in.close(); 30 30 31 // Draw histogram 31 // Draw histogram 32 h1d->SetTitle("Dose point kernel : energy d << 32 h1d->SetTitle("Dose point kernel : energy deposition profile, e- 10 keV"); 33 h1d->GetXaxis()->SetTitle("d(E/E0)/d(r/r0) 33 h1d->GetXaxis()->SetTitle("d(E/E0)/d(r/r0) along r/r0 r/r0"); 34 h1d->GetYaxis()->SetTitle("DPK"); 34 h1d->GetYaxis()->SetTitle("DPK"); 35 h1d->SetStats(kFALSE); // Eliminate statis 35 h1d->SetStats(kFALSE); // Eliminate statistics box 36 h1d->SetLineColor(kRed); 36 h1d->SetLineColor(kRed); 37 h1d->Draw("L"); 37 h1d->Draw("L"); 38 38 39 39 40 // Draw histograms fill by Geant4 TestEm12 40 // Draw histograms fill by Geant4 TestEm12 simulation 41 TFile f1("./100keV_local.root"); << 41 TFile f1("./10keV.opt3.root"); 42 TH1D* h1 = (TH1D*) f1.Get("8"); 42 TH1D* h1 = (TH1D*) f1.Get("8"); 43 h1->SetLineColor(kBlack); 43 h1->SetLineColor(kBlack); 44 h1->Draw("SAME HIST"); 44 h1->Draw("SAME HIST"); 45 /* 45 /* 46 TFile f2("./10keV.liver.root"); 46 TFile f2("./10keV.liver.root"); 47 TH1D* h2 = (TH1D*) f2.Get("8"); 47 TH1D* h2 = (TH1D*) f2.Get("8"); 48 h2->SetLineColor(kBlue); 48 h2->SetLineColor(kBlue); 49 h2->Draw("SAME HIST"); 49 h2->Draw("SAME HIST"); 50 50 51 TFile f3("./10keV.penel.root"); 51 TFile f3("./10keV.penel.root"); 52 TH1D* h3 = (TH1D*) f3.Get("8"); 52 TH1D* h3 = (TH1D*) f3.Get("8"); 53 h3->SetLineColor(kGreen); 53 h3->SetLineColor(kGreen); 54 h3->Draw("SAME HIST"); 54 h3->Draw("SAME HIST"); 55 */ 55 */ 56 // Print the histograms legend 56 // Print the histograms legend 57 TLegend *legend = new TLegend(0.7,0.6,0.86, 57 TLegend *legend = new TLegend(0.7,0.6,0.86,0.78); 58 legend->AddEntry(h1,"local ","l"); << 58 legend->AddEntry(h1,"opt3 ","l"); 59 ///legend->AddEntry(h2,"liver ","l"); 59 ///legend->AddEntry(h2,"liver ","l"); 60 ///legend->AddEntry(h3,"penel","l"); 60 ///legend->AddEntry(h3,"penel","l"); 61 legend->AddEntry(h1d,"EGSnrc","l"); 61 legend->AddEntry(h1d,"EGSnrc","l"); 62 legend->Draw(); 62 legend->Draw(); 63 63 64 } 64 } 65 65