Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
analysis.C
이 파일의 문서화 페이지로 가기
1 // -------------------------------------------------------------------
2 // $Id$
3 // -------------------------------------------------------------------
4 
5 // This macro requires the pdb4dna_output.root file generated from PDB4DNA example
6 
7 {
8  gROOT->Reset();
9 
10  gStyle->SetOptStat("em");
11 
12  TCanvas *c1;
13  TPad *pad1, *pad2, *pad3;
14  c1 = new TCanvas("c1","PDB DNA outputs",200,10,700,780);
15  c1->SetFillColor(0);
16 
17  pad1 = new TPad("pad1","pad1",0.02,0.52,0.98,0.98,21);
18  pad2 = new TPad("pad2","pad2",0.02,0.02,0.48,0.48,21);
19  pad3 = new TPad("pad3","pad3",0.52,0.02,0.98,0.48,21);
20 
21  pad1->SetFillColor(0);
22  pad1->Draw();
23  pad2->SetFillColor(0);
24  pad2->Draw();
25  pad3->SetFillColor(0);
26  pad3->Draw();
27 
28 
29  TFile f("pdb4dna_output.root");
30 
31  // Draw histograms
32 
33  TH1D* hist1 = (TH1D*)f.Get("1");
34  pad1->cd();
35  hist1->Draw("HIST");
36 
37  TH1D* hist2 = (TH1D*)f.Get("2");
38  pad2->cd();
39  hist2->Draw("HIST");
40 
41  TH1D* hist3 = (TH1D*)f.Get("3");
42  pad3->cd();
43  hist3->Draw("HIST");
44 
45  c1->Modified();
46  c1->Update();
47 
48 
49  // Read stats to get global quantities
50 
51  double* pdbStats=new double[4];
52 
53  hist1->GetStats(pdbStats);
54  cout << "-> Edep in the target : " << pdbStats[2]/1E6 << " MeV" << endl;
55 
56  hist2->GetStats(pdbStats);
57  cout << "-> Number of SSB : " << pdbStats[2] << endl;
58 
59  hist3->GetStats(pdbStats);
60  cout << "-> Number of DSB : " << pdbStats[2] << endl;
61 }
double * pdbStats
Definition: analysis.C:51
TPad * pad3
Definition: analysis.C:13
TPad * pad2
Definition: analysis.C:13
TPad * pad1
Definition: analysis.C:13