Geant4_10
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 gROOT->Reset();
12 gStyle->SetPalette(1);
13 gROOT->SetStyle("Plain");
15 
16 c1 = new TCanvas ("c1","",20,20,1000,500);
17 c1.Divide(2,1);
18 
19 system ("rm -rf dna.root");
20 system ("hadd dna.root dna_*.root");
21 
22 TFile f("dna.root");
23 
24 TNtuple* ntuple;
25 ntuple = (TNtuple*)f->Get("dna");
26 
27 c1.cd(1);
28  gStyle->SetOptStat(000000);
29 
30  // All
31  ntuple->Draw("flagProcess","","B");
32  ntuple->SetFillColor(2);
33 
34  // Excitation
35  ntuple->Draw("flagProcess","flagProcess==12||flagProcess==15||flagProcess==16||flagProcess==19||flagProcess==22||flagProcess==25||flagProcess==29","Bsame");
36  ntuple->SetFillColor(3);
37 
38  // Elastic
39  ntuple->Draw("flagProcess","flagProcess==11","Bsame");
40  ntuple->SetFillColor(4);
41 
42  // Ionisation
43  ntuple->Draw("flagProcess","flagProcess==13||flagProcess==17||flagProcess==20||flagProcess==23||flagProcess==26||flagProcess==30","Bsame");
44  ntuple->SetFillColor(5);
45 
46  // Charge decrease
47  ntuple->Draw("flagProcess","flagProcess==18||flagProcess==24||flagProcess==27","Bsame");
48  ntuple->SetFillColor(6);
49 
50  // Charge increase
51  ntuple->Draw("flagProcess","flagProcess==21||flagProcess==28||flagProcess==31","Bsame");
52 
53  gPad->SetLogy();
54 
55 /*
56  htemp->GetXaxis()->SetLabelSize(0.025);
57  htemp->GetYaxis()->SetLabelSize(0.025);
58  htemp->GetZaxis()->SetLabelSize(0.025);
59  htemp->GetXaxis()->SetTitleSize(0.035);
60  htemp->GetYaxis()->SetTitleSize(0.035);
61  htemp->GetXaxis()->SetTitleOffset(1.4);
62  htemp->GetYaxis()->SetTitleOffset(1.4);
63  htemp->GetXaxis()->SetTitle("flagProcess");
64  htemp->GetYaxis()->SetTitle("");
65  htemp->SetTitle("flagProcesses");
66 */
67 
68 c1.cd(2);
69  ntuple->SetMarkerColor(2);
70  ntuple->Draw("x:y:z/1000","flagParticle==1");
71 
72  ntuple->SetMarkerColor(4);
73  ntuple->SetMarkerSize(4);
74  ntuple->Draw("x:y:z/1000","flagParticle==4 || flagParticle==5 || flagParticle==6","same");
75 
76 /*
77  htemp->GetXaxis()->SetLabelSize(0.025);
78  htemp->GetYaxis()->SetLabelSize(0.025);
79  htemp->GetZaxis()->SetLabelSize(0.025);
80  htemp->GetXaxis()->SetTitleSize(0.035);
81  htemp->GetYaxis()->SetTitleSize(0.035);
82  htemp->GetZaxis()->SetTitleSize(0.035);
83  htemp->GetXaxis()->SetTitleOffset(1.6);
84  htemp->GetYaxis()->SetTitleOffset(1.6);
85  htemp->GetZaxis()->SetTitleOffset(1.6);
86  htemp->GetXaxis()->SetTitle("z (micrometer)");
87  htemp->GetYaxis()->SetTitle("x (nanometer)");
88  htemp->GetZaxis()->SetTitle("y (nanometer)");
89  htemp->SetTitle("Track Structure in liquid water");
90 */
91 }
TCanvas * c1
Definition: plotHisto.C:7
TTree * ntuple
Definition: macro.C:6
TFile f
Definition: plotHisto.C:6
Double_t scale
Definition: plot.C:11
system("rm -rf dna.root")
G4double Double_t