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,
7 // 1 - launch ROOT (usually type 'root' at your machine's prompt)
8 // 2 - type '.X plot.C' at the ROOT session prompt
9 // This macro needs the track.txt file
10 // *********************************************************************
11 {
12 gROOT->Reset();
13 gStyle->SetPalette(1);
14 gROOT->SetStyle("Plain");
16 
17 c1 = new TCanvas ("c1","",20,20,1000,500);
18 c1.Divide(2,1);
19 
20 TFile f("microdosimetry.root");
21 
22 TNtuple* ntuple;
23 ntuple = (TNtuple*)f->Get("ntuple");
24 
25 c1.cd(1);
26  gStyle->SetOptStat(000000);
27 
28  // All
29  ntuple->Draw("flagProcess","","B");
30  ntuple->SetFillColor(2);
31 
32  // Excitation
33 
34  ntuple->Draw("flagProcess","flagProcess==12||flagProcess==15||flagProcess==17||flagProcess==20||flagProcess==23||flagProcess==26||flagProcess==30","Bsame");
35  ntuple->SetFillColor(3);
36 
37  // Elastic
38  ntuple->Draw("flagProcess","flagProcess==11","Bsame");
39  ntuple->SetFillColor(4);
40 
41  // Ionisation
42  ntuple->Draw("flagProcess","flagProcess==13||flagProcess==18||flagProcess==21||flagProcess==24||flagProcess==27||flagProcess==31||flagProcess==33||flagProcess==34","Bsame");
43  ntuple->SetFillColor(5);
44 
45  // Charge decrease
46  ntuple->Draw("flagProcess","flagProcess==19||flagProcess==25||flagProcess==28","Bsame");
47  ntuple->SetFillColor(6);
48 
49  // Charge increase
50  ntuple->Draw("flagProcess","flagProcess==22||flagProcess==29||flagProcess==32","Bsame");
51 
52  gPad->SetLogy();
53 
54 c1.cd(2);
55 
56  // Electrons
57  ntuple->SetMarkerColor(2);
58  ntuple->Draw("x:y:z/1000","flagParticle==1","");
59 
60  // Protons
61  ntuple->SetMarkerColor(4);
62  ntuple->SetMarkerSize(4);
63  ntuple->Draw("x:y:z/1000","flagParticle==2","same");
64 
65  //Hydrogen
66  ntuple->SetMarkerColor(3);
67  ntuple->SetMarkerSize(3);
68  ntuple->Draw("x:y:z/1000","flagParticle==3","same");
69 
70 }