Geant4  10.02.p03
extended/medical/dna/wvalue/plot.C
Go to the documentation of this file.
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 // *********************************************************************
10 
11 {
12 gROOT->Reset();
13 
14 gStyle->SetPalette(1);
15 gROOT->SetStyle("Plain");
16 gStyle->SetOptStat(000000);
17 
18 c1 = new TCanvas ("c1","",60,60,500,500);
19 c1->Divide(1,1);
20 
21 FILE * fp = fopen("wvalue.txt","r");
22 
26 
27 TNtuple *ntuple = new TNtuple("ntuple","w","E:nbioni:snbioni:w:sw");
28 while (1)
29 {
30  ncols = fscanf(fp,"%f %f %f %f %f",&E,&nbioni,&snbioni,&w,&sw);
31  if (ncols < 0) break;
32  ntuple->Fill(E,nbioni,snbioni,w,sw);
33  nlines++;
34 }
35 fclose(fp);
36 
37 c1->cd(1);
38 gPad->SetLogx();
39 gPad->SetLogy();
40 
41 TH2F * h2 = new TH2F ("h2","",2,9.99,1e3,2,9.99,1e3);
42 h2->Draw();
43 ntuple->SetMarkerStyle(20);
44 ntuple->SetMarkerSize(1.);
45 ntuple->Draw("w:E","","LPsame");
46 
47 h2->GetXaxis()->SetLabelSize(0.025);
48 h2->GetYaxis()->SetLabelSize(0.025);
49 h2->GetXaxis()->SetTitleSize(0.035);
50 h2->GetYaxis()->SetTitleSize(0.035);
51 h2->GetXaxis()->SetTitleOffset(1.4);
52 h2->GetYaxis()->SetTitleOffset(1.4);
53 h2->GetXaxis()->SetTitle("E (eV)");
54 h2->GetYaxis()->SetTitle("W (eV)");
55 
56 }
G4int Int_t
fclose(fp)
G4float Float_t
static const G4double e3