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