Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
extended/medical/dna/svalue/plot.C
이 파일의 문서화 페이지로 가기
1 // -------------------------------------------------------------------
2 // $Id: plot.C 70323 2013-05-29 07:57:44Z gcosmo $
3 // -------------------------------------------------------------------
4 //
5 // *********************************************************************
6 // To execute this macro under ROOT after your simulation ended,
7 // 1 - launch ROOT (usually type 'root' at your machine's prompt)
8 // 2 - type '.X plot.C' at the ROOT session prompt
9 // 3 - OR type directly 'root plot.C'
10 // *********************************************************************
11 
12 {
13 gROOT->Reset();
14 
15 gStyle->SetPalette(1);
16 gROOT->SetStyle("Plain");
17 gStyle->SetOptStat(000000);
18 
19 c1 = new TCanvas ("c1","",60,60,800,800);
20 c1->Divide(1,1);
21 
22 FILE * fp = fopen("s.txt","r");
23 
27 
28 TNtuple *ntuple = new TNtuple("ntuple","s","radius:E:s:ss");
29 while (1)
30 {
31  ncols = fscanf(fp,"%f %f %f %f",&radius,&E,&s,&ss);
32  if (ncols < 0) break;
33  ntuple->Fill(radius,E,s,ss);
34  nlines++;
35 }
36 fclose(fp);
37 
38 c1->cd(1);
39 gPad->SetLogx();
40 gPad->SetLogy();
41 
42 TH2F * h2 = new TH2F ("h2","",2,99.999,1e4,2,1e2,1e4);
43 h2->Draw();
44 ntuple->SetMarkerStyle(20);
45 ntuple->SetMarkerSize(1.);
46 ntuple->Draw("s:E","","LPsame");
47 
48 h2->GetXaxis()->SetLabelSize(0.025);
49 h2->GetYaxis()->SetLabelSize(0.025);
50 h2->GetXaxis()->SetTitleSize(0.035);
51 h2->GetYaxis()->SetTitleSize(0.035);
52 h2->GetXaxis()->SetTitleOffset(1.4);
53 h2->GetYaxis()->SetTitleOffset(1.4);
54 h2->GetXaxis()->SetTitle("E (eV)");
55 h2->GetYaxis()->SetTitle("S (Gy/Bq.s)");
56 
57 }
TTree * ntuple
nlines
G4float Float_t
fclose(fg1)
const XML_Char * s
Definition: expat.h:262
G4int Int_t
Double_t radius
FILE * fp
TH1F * h2
Int_t ncols