Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:17:15

0001 // ROOT macro file for plotting example B4 histograms
0002 //
0003 // Can be run from ROOT session:
0004 // root[0] .x plotHisto.C
0005 
0006 {
0007   gROOT->Reset();
0008   gROOT->SetStyle("Plain");
0009 
0010   // Draw histos filled by Geant4 simulation
0011   //
0012 
0013   // Open file filled by Geant4 simulation
0014   TFile f("B4.root");
0015 
0016   // Create a canvas and divide it into 2x2 pads
0017   TCanvas* c1 = new TCanvas("c1", "", 20, 20, 1000, 1000);
0018   c1->Divide(2,2);
0019 
0020   // Draw Eabs histogram in the pad 1
0021   c1->cd(1);
0022   TH1D* hist1 = (TH1D*)f.Get("Eabs");
0023   hist1->Draw("HIST");
0024 
0025   // Draw Labs histogram in the pad 2
0026   c1->cd(2);
0027   TH1D* hist2 = (TH1D*)f.Get("Labs");
0028   hist2->Draw("HIST");
0029 
0030   // Draw Egap histogram in the pad 3
0031 
0032   TH1D* hist3 = (TH1D*)f.Get("Egap");
0033   c1->cd(3);
0034   // set logarithmic scale for y  
0035   //gPad->SetLogy(1);
0036   hist3->Draw("HIST");
0037 
0038   // Draw Lgap histogram in the pad 4
0039   c1->cd(4);
0040   // set logarithmic scale for y  
0041   //gPad->SetLogy(1);  
0042   TH1D* hist4 = (TH1D*)f.Get("Lgap");
0043   hist4->Draw("HIST");
0044 }