Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
extended/medical/dna/icsd/plot.C
이 파일의 문서화 페이지로 가기
1 // *********************************************************************
2 // To execute this macro under ROOT,
3 // 1 - launch ROOT (usually type 'root' at your machine's prompt)
4 // 2 - type '.X plot.C' at the ROOT session prompt
5 // This macro needs the output ROOT file
6 // *********************************************************************
7 {
8  gROOT->Reset();
9  gStyle->SetPalette(1);
10  gROOT->SetStyle("Plain");
11 
12  TCanvas* c1 = new TCanvas ("c1","",20,20,1000,500);
13 
14  TFile f("ICSD.root");
15  f.ls();
16 
17  TH1D* hist1 = new TH1D("histo","ICSD", 30, 0.0, 30);
18  Double_t ion = 0.0;
19 
20  TNtuple* ntuple1 = (TNtuple*)f.Get("ntuple_1");
21  ntuple1->SetBranchAddress("ionisations", &ion);
22  Int_t nentries = ntuple1->GetEntries();
23 
24  for (Int_t i=0; i<nentries; i++)
25  {
26  ntuple1->GetEntry(i);
27  hist1->Fill(ion);
28  }
29 
30  hist1->Draw();
31  hist1->GetXaxis()->SetLabelSize(0.025);
32  hist1->GetYaxis()->SetLabelSize(0.025);
33 
34  hist1->GetXaxis()->SetTitleSize(0.035);
35  hist1->GetYaxis()->SetTitleSize(0.035);
36 
37 // hist1->GetXaxis()->SetTittleOffset(1.4);
38 // hist1->GetYaxis()->SetTittleOffset(1.4);
39 
40  hist1->GetXaxis()->SetTitle("ionisation number");
41  hist1->GetYaxis()->SetTitle("frequency");
42 
43  c1->SaveAs("ICSD.tiff");
44 }
G4double Double_t
G4int Int_t
TNtuple * ntuple1
Int_t nentries
Definition: comparison.C:29