Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:20:51

0001 {
0002    gROOT->Reset();
0003 
0004   /*
0005    * Mainegra et al. Med. Phys. 32, 685-699 (2005)    
0006    * Seltzer, Appl. Radiat. Isot. 42 (1991) page 917  
0007    * L. Ferrer et al. Cancer Bio. Rad. 22-1 (2007)
0008    */   
0009 
0010    ifstream in;
0011    in.open("./EGSnrc/100keV-DPK.ascii");
0012    //in.open("./Etran/100keV-DPK.ascii");
0013    
0014    // Create a new histogram
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    // Draw histogram
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);  // Eliminate statistics box      
0036    h1d->SetLineColor(kRed);
0037    h1d->Draw("L");
0038 
0039 
0040    // Draw histograms fill by Geant4 TestEm12 simulation
0041    TFile f1("./100keV_local.root");
0042    TH1D* h1 = (TH1D*) f1.Get("8");
0043    h1->SetLineColor(kBlack);      
0044    h1->Draw("SAME HIST");
0045 /*   
0046    TFile f2("./10keV.liver.root");
0047    TH1D* h2 = (TH1D*) f2.Get("8");
0048    h2->SetLineColor(kBlue);   
0049    h2->Draw("SAME HIST");
0050    
0051    TFile f3("./10keV.penel.root");
0052    TH1D* h3 = (TH1D*) f3.Get("8");
0053    h3->SetLineColor(kGreen);   
0054    h3->Draw("SAME HIST");
0055 */      
0056    // Print the histograms legend
0057    TLegend *legend = new TLegend(0.7,0.6,0.86,0.78);
0058    legend->AddEntry(h1,"local ","l");
0059    ///legend->AddEntry(h2,"liver ","l");
0060    ///legend->AddEntry(h3,"penel","l");      
0061    legend->AddEntry(h1d,"EGSnrc","l");
0062    legend->Draw();
0063 
0064 }