Geant4 Cross Reference |
1 // ******************************************* 1 // ********************************************************************* 2 // To execute this macro under ROOT, 2 // To execute this macro under ROOT, 3 // 1 - launch ROOT (usually type 'root' at y 3 // 1 - launch ROOT (usually type 'root' at your machine's prompt) 4 // 2 - type '.X plot.C' at the ROOT session 4 // 2 - type '.X plot.C' at the ROOT session prompt 5 // ******************************************* 5 // ********************************************************************* 6 { 6 { 7 gROOT->Reset(); 7 gROOT->Reset(); 8 gStyle->SetPalette(1); 8 gStyle->SetPalette(1); 9 gROOT->SetStyle("Plain"); 9 gROOT->SetStyle("Plain"); 10 Double_t scale; 10 Double_t scale; 11 11 12 c1 = new TCanvas ("c1","",20,20,1000,500); 12 c1 = new TCanvas ("c1","",20,20,1000,500); 13 c1->Divide(2,1); 13 c1->Divide(2,1); 14 14 15 //system ("rm -rf microelectronics.root"); 15 //system ("rm -rf microelectronics.root"); 16 //system ("hadd microelectronics.root microele 16 //system ("hadd microelectronics.root microelectronics_*.root"); 17 17 18 TFile f("microelectronics.root"); 18 TFile f("microelectronics.root"); 19 19 20 TNtuple* ntuple; 20 TNtuple* ntuple; 21 ntuple = (TNtuple*)f.Get("microelectronics"); 21 ntuple = (TNtuple*)f.Get("microelectronics"); 22 22 23 c1->cd(1); 23 c1->cd(1); 24 gStyle->SetOptStat(000000); 24 gStyle->SetOptStat(000000); 25 25 26 // All 26 // All 27 ntuple->Draw("flagProcess","","B"); 27 ntuple->Draw("flagProcess","","B"); 28 ntuple->SetFillColor(2); 28 ntuple->SetFillColor(2); 29 29 30 // Elastic 30 // Elastic 31 ntuple->Draw("flagProcess","flagProcess==11" 31 ntuple->Draw("flagProcess","flagProcess==11","same"); 32 ntuple->SetFillColor(3); 32 ntuple->SetFillColor(3); 33 33 34 // Ionisation 34 // Ionisation 35 ntuple->Draw("flagProcess","flagProcess==12| 35 ntuple->Draw("flagProcess","flagProcess==12||flagProcess==14||flagProcess==15||flagProcess==16||flagProcess==17","same"); 36 ntuple->SetFillColor(4); 36 ntuple->SetFillColor(4); 37 37 38 gPad->SetLogy(); 38 gPad->SetLogy(); 39 39 40 c1->cd(2); 40 c1->cd(2); 41 41 42 // Electrons 42 // Electrons 43 ntuple->SetMarkerColor(2); 43 ntuple->SetMarkerColor(2); 44 ntuple->Draw("x:y:z/1000","flagParticle==1") 44 ntuple->Draw("x:y:z/1000","flagParticle==1"); 45 45 46 // Protons 46 // Protons 47 ntuple->SetMarkerColor(4); 47 ntuple->SetMarkerColor(4); 48 ntuple->SetMarkerSize(4); 48 ntuple->SetMarkerSize(4); 49 ntuple->Draw("x:y:z/1000","flagParticle==2", 49 ntuple->Draw("x:y:z/1000","flagParticle==2","same"); 50 50 51 // Ions 51 // Ions 52 ntuple->SetMarkerColor(3); 52 ntuple->SetMarkerColor(3); 53 ntuple->SetMarkerSize(3); 53 ntuple->SetMarkerSize(3); 54 ntuple->Draw("x:y:z/1000","flagParticle==3", 54 ntuple->Draw("x:y:z/1000","flagParticle==3","same"); 55 55 56 } 56 } 57 57