Geant4 Cross Reference |
1 1 2 { 2 { 3 gROOT->Reset(); 3 gROOT->Reset(); 4 4 5 // Draw histograms fill by Geant4 TestEm11 5 // Draw histograms fill by Geant4 TestEm11 simulation 6 // 6 // 7 ///TFile f1("./Al_1033keV_opt3.root"); 7 ///TFile f1("./Al_1033keV_opt3.root"); 8 TFile f1("./Ta_1000keV_opt3.root"); 8 TFile f1("./Ta_1000keV_opt3.root"); 9 TH1D* h1 = (TH1D*) f1.Get("8"); 9 TH1D* h1 = (TH1D*) f1.Get("8"); 10 h1->SetTitle("Depth dose distribution of 10 10 h1->SetTitle("Depth dose distribution of 1000 keV e- in Ta"); 11 h1->GetXaxis()->SetTitle("Edep (Mev.cm2/g) 11 h1->GetXaxis()->SetTitle("Edep (Mev.cm2/g) along x/r0 x/r0"); 12 h1->GetYaxis()->SetTitle("MeV*cm2/g"); 12 h1->GetYaxis()->SetTitle("MeV*cm2/g"); 13 h1->SetStats(kFALSE); // Eliminate statist 13 h1->SetStats(kFALSE); // Eliminate statistics box 14 h1->SetLineColor(kBlack); 14 h1->SetLineColor(kBlack); 15 h1->Draw("HIST"); 15 h1->Draw("HIST"); 16 16 17 /* EGSnrc 17 /* EGSnrc 18 * Yann Perrot 18 * Yann Perrot 19 */ 19 */ 20 20 21 ifstream in; 21 ifstream in; 22 ///in.open("./EGSnrc/Al_1033keV_EGSnrc.asci 22 ///in.open("./EGSnrc/Al_1033keV_EGSnrc.ascii"); 23 in.open("./EGSnrc/Ta_1000keV_EGSnrc.ascii") 23 in.open("./EGSnrc/Ta_1000keV_EGSnrc.ascii"); 24 24 25 TMarker *pt; 25 TMarker *pt; 26 Double_t x, y; 26 Double_t x, y; 27 // First indicate number of data 27 // First indicate number of data 28 int nbdata = 0; 28 int nbdata = 0; 29 in >> nbdata; 29 in >> nbdata; 30 for ( int i = 0 ; i < nbdata ; i++ ) { 30 for ( int i = 0 ; i < nbdata ; i++ ) { 31 in >> x >> y ; 31 in >> x >> y ; 32 if (!in.good()) break; 32 if (!in.good()) break; 33 pt = new TMarker(x,y,22); // 22 for tria 33 pt = new TMarker(x,y,22); // 22 for triangle TMatker 34 pt->SetMarkerColor(kRed); 34 pt->SetMarkerColor(kRed); 35 pt->Draw(); 35 pt->Draw(); 36 } 36 } 37 in.close(); 37 in.close(); 38 38 39 // Print the histograms legend 39 // Print the histograms legend 40 TLegend* legend = new TLegend(0.6,0.5,0.8,0 40 TLegend* legend = new TLegend(0.6,0.5,0.8,0.70); 41 legend->AddEntry(h1,"ref10 ","l"); 41 legend->AddEntry(h1,"ref10 ","l"); 42 legend->AddEntry(pt,"EGSnrc","P"); 42 legend->AddEntry(pt,"EGSnrc","P"); 43 legend->Draw(); 43 legend->Draw(); 44 } 44 } 45 45