Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
sandia.C
이 파일의 문서화 페이지로 가기
1 
2 {
3  gROOT->Reset();
4 
5  // Draw histograms fill by Geant4 TestEm11 simulation
6  TFile f1("./Ta_1000keV_opt3.root");
7  TH1D* h1 = (TH1D*) f1.Get("8");
8  h1->SetTitle("Depth dose distribution of 1000 keV e- in Ta");
9  h1->GetXaxis()->SetTitle("Edep (Mev.cm2/g) along x/r0 x/r0");
10  h1->GetYaxis()->SetTitle("MeV*cm2/g");
11  h1->SetStats(kFALSE); // Eliminate statistics box
12  h1->SetLineColor(4); // blue
13  h1->Draw("HIST");
14 /*
15  TFile f2("./Ta.1000keV.opt2.root");
16  TH1D* h2 = (TH1D*) f2.Get("8");
17  h2->SetStats(kFALSE); // Eliminate statistics box
18  h2->SetLineColor(3); // green
19  h2->Draw("SAME HIST");
20 */
21 /* data
22 * G.J.Lockwood et al.
23 * Sandia report SAND79-0414.UC-34a, February 1987
24 * O.Kadri et al. NIM B 258 (2007) 381
25 */
26 
27  ifstream in;
28  in.open("./data/Ta_1000keV.ascii");
29 
30  TMarker *pt;
32  // First indicate number of data
33  int nbdata = 0;
34  in >> nbdata;
35  for ( int i = 0 ; i < nbdata ; i++ ) {
36  in >> x >> y ;
37  if (!in.good()) break;
38  pt = new TMarker(x,y,22); // 22 for triangle TMatker
39  pt->SetMarkerColor(kRed);
40  pt->Draw();
41  }
42  in.close();
43 
44  // Print the histograms legend
45  TLegend* legend = new TLegend(0.6,0.55,0.8,0.68);
46  legend->AddEntry(h1,"ref10-opt3 ","l");
48  legend->AddEntry(pt,"Sandia data","P");
49  legend->Draw();
50 }
Float_t x
Definition: compare.C:6
G4double Double_t
int nbdata
Definition: egs.C:28
Float_t y
Definition: compare.C:6
TMarker * pt
Definition: egs.C:25
Float_t f1
TLegend * legend
Definition: egs.C:40
ifstream in
Definition: comparison.C:7
TH1F * h1