Geant4_10
berger.C
Go to the documentation of this file.
1 {
2  gROOT->Reset();
3 
4  /*
5  * Mainegra et al. Med. Phys. 32, 685-699 (2005)
6  * Seltzer, Appl. Radiat. Isot. 42 (1991) page 917
7  * L. Ferrer et al. Cancer Bio. Rad. 22-1 (2007)
8  */
9 
10  ifstream in;
11  in.open("./EGSnrc/10keV-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,x_max);
22 
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 deposition profile, e- 10 keV");
33  h1d->GetXaxis()->SetTitle("d(E/E0)/d(r/r0) along r/r0 r/r0");
34  h1d->GetYaxis()->SetTitle("DPK");
35  h1d->SetStats(kFALSE); // Eliminate statistics box
36  h1d->SetLineColor(kRed);
37  h1d->Draw("L");
38 
39 
40  // Draw histograms fill by Geant4 TestEm12 simulation
41  TFile f1("./10keV.opt3.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,0.78);
58  legend->AddEntry(h1,"opt3 ","l");
61  legend->AddEntry(h1d,"EGSnrc","l");
62  legend->Draw();
63 
64 }
TLegend * legend
Definition: egs.C:37
int nbdata
Definition: egs.C:25
TH1F * h1
Definition: plot.C:43
ifstream in
Definition: comparison.C:7
tuple x
Definition: test.py:50
Double_t y
Definition: plot.C:279
Float_t f1
double x_min
Definition: berger.C:15
TH1D * h1d
Definition: berger.C:21
double x_max
Definition: berger.C:16
G4double Double_t