LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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 // 3 - OR directly type 'root plot.C'
6 // *********************************************************************
7 {
8 gROOT->Reset();
9 gStyle->SetPalette(1);
10 gROOT->SetStyle("Plain");
11 Double_t scale;
12 
13 c1 = new TCanvas ("c1","",20,20,1000,500);
14 c1->Divide(2,1);
15 
16 system ("rm -rf microdosimetry.root");
17 system ("hadd -O microdosimetry.root microdosimetry_*.root");
18 
19 TFile f("microdosimetry.root");
20 
21 TNtuple* ntuple;
22 ntuple = (TNtuple*)f.Get("microdosimetry");
23 
24 c1->cd(1);
25  gStyle->SetOptStat(000000);
26 
27  // All
28  ntuple->SetFillStyle(1001);
29  ntuple->SetFillColor(2);
30  ntuple->Draw("flagProcess","","B");
31 
32  // Excitation
33  ntuple->SetFillStyle(1001);
34  ntuple->SetFillColor(3);
35  ntuple->Draw("flagProcess","flagProcess==12||flagProcess==15||flagProcess==22||flagProcess==32||flagProcess==42||flagProcess==52||flagProcess==62","Bsame");
36 
37  // Elastic
38  ntuple->SetFillStyle(1001);
39  ntuple->SetFillColor(4);
40  ntuple->Draw("flagProcess","flagProcess==11||flagProcess==21||flagProcess==31||flagProcess==41||flagProcess==51||flagProcess==61||flagProcess==110||flagProcess==210||flagProcess==410||flagProcess==510||flagProcess==710||flagProcess==120||flagProcess==220||flagProcess==420||flagProcess==520||flagProcess==720","Bsame");
41 
42  // Ionisation
43  ntuple->SetFillStyle(1001);
44  ntuple->SetFillColor(5);
45  ntuple->Draw("flagProcess","flagProcess==13||flagProcess==23||flagProcess==33||flagProcess==43||flagProcess==53||flagProcess==63||flagProcess==73||flagProcess==130||flagProcess==230||flagProcess==430||flagProcess==530||flagProcess==730","Bsame");
46 
47  // Charge decrease
48  ntuple->SetFillStyle(1001);
49  ntuple->SetFillColor(6);
50  ntuple->Draw("flagProcess","flagProcess==24||flagProcess==44||flagProcess==54","Bsame");
51 
52  // Charge increase
53  ntuple->SetFillStyle(1001);
54  ntuple->SetFillColor(7);
55  ntuple->Draw("flagProcess","flagProcess==35||flagProcess==55||flagProcess==65","Bsame");
56 
57  gPad->SetLogy();
58 
59 c1->cd(2);
60 
61  // Electrons
62  ntuple->SetMarkerColor(2);
63  ntuple->Draw("x:y:z/1000","flagParticle==1","");
64 
65  // Protons
66  ntuple->SetMarkerColor(4);
67  ntuple->SetMarkerSize(4);
68  ntuple->Draw("x:y:z/1000","flagParticle==2","same");
69 
70  // Hydrogen
71  ntuple->SetMarkerColor(3);
72  ntuple->SetMarkerSize(3);
73  ntuple->Draw("x:y:z/1000","flagParticle==3","same");
74 
75 }
system("rm -rf microbeam.root")
TFile f("microbeam.root")
TNtuple * ntuple
Definition: plot.C:20
Double_t scale
Definition: plot.C:24
c1
Definition: plot.C:27