File indexing completed on 2025-02-23 09:21:00
0001 {
0002 gROOT->Reset();
0003
0004
0005 TFile f1("./opt3.root");
0006 TH1D* h1 = (TH1D*) f1.Get("10");
0007 h1->SetTitle("1 TeV muon in 3 m iron : kinetic energy at exit (GeV)");
0008 h1->GetXaxis()->SetTitle("Ekine (GeV)");
0009 h1->GetYaxis()->SetTitle("nb/GeV");
0010 h1->SetStats(kFALSE);
0011 h1->SetLineColor(kBlue);
0012 h1->Draw("HIST");
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 ifstream in;
0028 in.open("mars14.ascii");
0029
0030
0031 int nb_bins = 100;
0032 float x_min = 950.;
0033 float x_max = 1000.;
0034 TH1F* h1f = new TH1F("h1f","",nb_bins,x_min,x_max);
0035
0036 Float_t x, y;
0037 while (1) {
0038 in >> x >> y ;
0039 if (!in.good()) break;
0040 h1f->Fill(x,y);
0041 }
0042 in.close();
0043
0044
0045 h1f->SetLineColor(kRed);
0046 h1f->Draw("SAME");
0047
0048
0049 TLegend* legend = new TLegend(0.2,0.55,0.45,0.70);
0050 legend->AddEntry(h1,"local (Urban90)","l");
0051
0052 legend->AddEntry(h1f,"Mars14 simul ","L");
0053 legend->Draw();
0054
0055
0056 }