ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
berger.C
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file berger.C
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/100keV-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- 100 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("./100keV_local.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,"local ","l");
61  legend->AddEntry(h1d,"EGSnrc","l");
62  legend->Draw();
63 
64 }