Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-02-23 09:22:41

0001 {
0002   gROOT->Reset();
0003   
0004   // Draw histos filled by Geant4 simulation 
0005   //   
0006   TCanvas* c1 = new TCanvas("c1", "  ");
0007   
0008   c1->SetLogy(1);
0009   c1->cd();
0010   c1->Update();
0011   
0012   TFile fa("Li7.root");  
0013   TFile fb("Li6.root");  
0014 
0015   TH1D* ha1 = (TH1D*)fa.Get("6");  
0016   ha1->SetStats(kFALSE);
0017   ha1->SetLineColor(kBlue);        
0018   ha1->Draw("HIST");
0019   TH1D* hb1 = (TH1D*)fb.Get("6");  
0020   hb1->SetLineColor(kRed);   
0021   hb1->Draw("HIST SAME");
0022    
0023   // Print the histograms legend
0024   TLegend *le = new TLegend(0.6,0.6,0.8,0.8);
0025   le->AddEntry(ha1,"Li7","l");  
0026   le->AddEntry(hb1,"Li6","l");
0027   le->Draw();      
0028 }