File indexing completed on 2025-02-23 09:20:51
0001 {
0002 gROOT->Reset();
0003
0004
0005
0006
0007
0008
0009
0010 ifstream in;
0011 in.open("./EGSnrc/100keV-DPK.ascii");
0012
0013
0014
0015 double x_min = 0;
0016 double x_max = 1.2;
0017
0018 int nbdata = 0;
0019 in >> nbdata;
0020
0021 TH1D* h1d = new TH1D("h1d","",nbdata,x_min,x_max);
0022
0023 Double_t x, y;
0024 for ( int i = 0 ; i < nbdata ; i++ ) {
0025 in >> x >> y ;
0026 if (!in.good()) break;
0027 h1d->Fill(x,y);
0028 }
0029 in.close();
0030
0031
0032 h1d->SetTitle("Dose point kernel : energy deposition profile, e- 100 keV");
0033 h1d->GetXaxis()->SetTitle("d(E/E0)/d(r/r0) along r/r0 r/r0");
0034 h1d->GetYaxis()->SetTitle("DPK");
0035 h1d->SetStats(kFALSE);
0036 h1d->SetLineColor(kRed);
0037 h1d->Draw("L");
0038
0039
0040
0041 TFile f1("./100keV_local.root");
0042 TH1D* h1 = (TH1D*) f1.Get("8");
0043 h1->SetLineColor(kBlack);
0044 h1->Draw("SAME HIST");
0045
0046
0047
0048
0049
0050
0051
0052
0053
0054
0055
0056
0057 TLegend *legend = new TLegend(0.7,0.6,0.86,0.78);
0058 legend->AddEntry(h1,"local ","l");
0059
0060
0061 legend->AddEntry(h1d,"EGSnrc","l");
0062 legend->Draw();
0063
0064 }