Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:21:00

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("pixe.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 pixe in the pad 1
0021   c1->cd(1);
0022   gPad->SetLogy(1);
0023   gPad->SetGridy(1);
0024   TH1D* hist1 = (TH1D*)f.Get("h55");
0025   hist1->SetLineColor(kBlue); 
0026   hist1->Draw("HIST");
0027   
0028   // Draw deexcitation in the pad 2
0029   c1->cd(2);
0030   gPad->SetLogy(1);
0031   gPad->SetGridy(0);  
0032   TH1D* hist2 = (TH1D*)f.Get("h51");
0033   hist2->SetLineColor(kBlue);   
0034   hist2->Draw("HIST");
0035   
0036   // Draw total in the pad 3
0037   c1->cd(3);
0038   gPad->SetLogy(1);
0039   gPad->SetGridy(1);
0040   TH1D* hist3 = (TH1D*)f.Get("h3");
0041   hist3->SetLineColor(kRed); 
0042   hist3->Draw("HIST");
0043 }