LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
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");
14 
15 c1 = new TCanvas ("c1","",20,20,1000,500);
16 c1->Divide(2,1);
17 
18 system ("rm -rf dna.root");
19 system ("hadd dna.root dna_*.root");
20 
21 TFile f("dna.root");
22 
23 TNtuple* ntuple;
24 ntuple = (TNtuple*)f.Get("dna");
25 
26 c1->cd(1);
27  gStyle->SetOptStat(000000);
28 
29  // All
30  ntuple->Draw("flagProcess","","B");
31  ntuple->SetFillStyle(1001);
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->SetFillStyle(1001);
37  ntuple->SetFillColor(3);
38 
39  // Elastic
40  ntuple->Draw("flagProcess","flagProcess==11","Bsame");
41  ntuple->SetFillStyle(1001);
42  ntuple->SetFillColor(4);
43 
44  // Ionisation
45  ntuple->Draw("flagProcess","flagProcess==13||flagProcess==17||flagProcess==20||flagProcess==23||flagProcess==26||flagProcess==30","Bsame");
46  ntuple->SetFillStyle(1001);
47  ntuple->SetFillColor(5);
48 
49  // Charge decrease
50  //ntuple->Draw("flagProcess","flagProcess==18||flagProcess==24||flagProcess==27","Bsame");
51  //ntuple->SetFillStyle(1001);
52  //ntuple->SetFillColor(6);
53 
54  // Charge increase
55  //ntuple->Draw("flagProcess","flagProcess==21||flagProcess==28||flagProcess==31","Bsame");
56  //ntuple->SetFillStyle(1001);
57  //ntuple->SetFillColor(7);
58 
59  gPad->SetLogy();
60 
61 c1->cd(2);
62 
63  ntuple->SetMarkerColor(2);
64  ntuple->Draw("x:y:z/1000","flagParticle==1");
65 
66  //ntuple->SetMarkerColor(4);
67  //ntuple->SetMarkerSize(4);
68  //ntuple->Draw("x:y:z/1000","flagParticle==4 || flagParticle==5 || flagParticle==6","same");
69 
70 end:
71 }
system("rm -rf microbeam.root")
TFile f("microbeam.root")
TNtuple * ntuple
Definition: plot.C:20
c1
Definition: plot.C:28
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)