Geant4  9.6.p02
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
plot.C
Go to the documentation of this file.
1 // -------------------------------------------------------------------
2 // $Id$
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 TFile f("dna.root");
20 
21 TNtuple* ntuple;
22 ntuple = (TNtuple*)f->Get("ntuple");
23 
24 c1.cd(1);
25  gStyle->SetOptStat(000000);
26 
27  // All
28  ntuple->Draw("flagProcess","","B");
29  ntuple->SetFillColor(2);
30 
31  // Excitation
32  ntuple->Draw("flagProcess","flagProcess==12||flagProcess==15||flagProcess==16||flagProcess==19||flagProcess==22||flagProcess==25||flagProcess==29","Bsame");
33  ntuple->SetFillColor(3);
34 
35  // Elastic
36  ntuple->Draw("flagProcess","flagProcess==11","Bsame");
37  ntuple->SetFillColor(4);
38 
39  // Ionisation
40  ntuple->Draw("flagProcess","flagProcess==13||flagProcess==17||flagProcess==20||flagProcess==23||flagProcess==26||flagProcess==30","Bsame");
41  ntuple->SetFillColor(5);
42 
43  // Charge decrease
44  ntuple->Draw("flagProcess","flagProcess==18||flagProcess==24||flagProcess==27","Bsame");
45  ntuple->SetFillColor(6);
46 
47  // Charge increase
48  ntuple->Draw("flagProcess","flagProcess==21||flagProcess==28||flagProcess==31","Bsame");
49 
50  gPad->SetLogy();
51 
52 /*
53  htemp->GetXaxis()->SetLabelSize(0.025);
54  htemp->GetYaxis()->SetLabelSize(0.025);
55  htemp->GetZaxis()->SetLabelSize(0.025);
56  htemp->GetXaxis()->SetTitleSize(0.035);
57  htemp->GetYaxis()->SetTitleSize(0.035);
58  htemp->GetXaxis()->SetTitleOffset(1.4);
59  htemp->GetYaxis()->SetTitleOffset(1.4);
60  htemp->GetXaxis()->SetTitle("flagProcess");
61  htemp->GetYaxis()->SetTitle("");
62  htemp->SetTitle("flagProcesses");
63 */
64 
65 c1.cd(2);
66  ntuple->SetMarkerColor(2);
67  ntuple->Draw("x:y:z/1000","flagParticle==1");
68 
69  ntuple->SetMarkerColor(4);
70  ntuple->SetMarkerSize(4);
71  ntuple->Draw("x:y:z/1000","flagParticle==4 || flagParticle==5 || flagParticle==6","same");
72 
73 /*
74  htemp->GetXaxis()->SetLabelSize(0.025);
75  htemp->GetYaxis()->SetLabelSize(0.025);
76  htemp->GetZaxis()->SetLabelSize(0.025);
77  htemp->GetXaxis()->SetTitleSize(0.035);
78  htemp->GetYaxis()->SetTitleSize(0.035);
79  htemp->GetZaxis()->SetTitleSize(0.035);
80  htemp->GetXaxis()->SetTitleOffset(1.6);
81  htemp->GetYaxis()->SetTitleOffset(1.6);
82  htemp->GetZaxis()->SetTitleOffset(1.6);
83  htemp->GetXaxis()->SetTitle("z (micrometer)");
84  htemp->GetYaxis()->SetTitle("x (nanometer)");
85  htemp->GetZaxis()->SetTitle("y (nanometer)");
86  htemp->SetTitle("Track Structure in liquid water");
87 */
88 }