File indexing completed on 2025-02-23 09:20:50
0001
0002 {
0003 gROOT->Reset();
0004
0005
0006
0007
0008 TFile f1("./Ta_1000keV_opt3.root");
0009 TH1D* h1 = (TH1D*) f1.Get("8");
0010 h1->SetTitle("Depth dose distribution of 1000 keV e- in Ta");
0011 h1->GetXaxis()->SetTitle("Edep (Mev.cm2/g) along x/r0 x/r0");
0012 h1->GetYaxis()->SetTitle("MeV*cm2/g");
0013 h1->SetStats(kFALSE);
0014 h1->SetLineColor(kBlack);
0015 h1->Draw("HIST");
0016
0017
0018
0019
0020
0021 ifstream in;
0022
0023 in.open("./EGSnrc/Ta_1000keV_EGSnrc.ascii");
0024
0025 TMarker *pt;
0026 Double_t x, y;
0027
0028 int nbdata = 0;
0029 in >> nbdata;
0030 for ( int i = 0 ; i < nbdata ; i++ ) {
0031 in >> x >> y ;
0032 if (!in.good()) break;
0033 pt = new TMarker(x,y,22);
0034 pt->SetMarkerColor(kRed);
0035 pt->Draw();
0036 }
0037 in.close();
0038
0039
0040 TLegend* legend = new TLegend(0.6,0.5,0.8,0.70);
0041 legend->AddEntry(h1,"ref10 ","l");
0042 legend->AddEntry(pt,"EGSnrc","P");
0043 legend->Draw();
0044 }