Geant4 Cross Reference |
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"); 10 Double_t scale; 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 } 57