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