Geant4  v4-10.4-release
 모두 클래스 네임스페이스들 파일들 함수 변수 타입정의 열거형 타입 열거형 멤버 Friends 매크로 그룹들 페이지들
advanced/microelectronics/plot.C
이 파일의 문서화 페이지로 가기
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 microelectronics.root");
16 system ("hadd microelectronics.root microelectronics_*.root");
17 
18 TFile f("microelectronics.root");
19 
20 TNtuple* ntuple;
21 ntuple = (TNtuple*)f->Get("microelectronics");
22 
23 c1.cd(1);
24  gStyle->SetOptStat(000000);
25 
26  // All
27  ntuple->Draw("flagProcess","","B");
28  ntuple->SetFillColor(2);
29 
30  // Elastic
31  ntuple->Draw("flagProcess","flagProcess==11","same");
32  ntuple->SetFillColor(3);
33 
34  // Ionisation
35  ntuple->Draw("flagProcess","flagProcess==12||flagProcess==14||flagProcess==15||flagProcess==16||flagProcess==17","same");
36  ntuple->SetFillColor(4);
37 
38  gPad->SetLogy();
39 
40 c1.cd(2);
41 
42  // Electrons
43  ntuple->SetMarkerColor(2);
44  ntuple->Draw("x:y:z/1000","flagParticle==1");
45 
46  // Protons
47  ntuple->SetMarkerColor(4);
48  ntuple->SetMarkerSize(4);
49  ntuple->Draw("x:y:z/1000","flagParticle==2","same");
50 
51  // Ions
52  ntuple->SetMarkerColor(3);
53  ntuple->SetMarkerSize(3);
54  ntuple->Draw("x:y:z/1000","flagParticle==3","same");
55 
56 }
G4double Double_t
system("rm -rf microbeam.root")
TTree * ntuple
Double_t scale