File indexing completed on 2025-02-23 09:20:57
0001 {
0002 gROOT->Reset();
0003
0004
0005 TFile f("./93ref0.root");
0006 TH1D* h1d = (TH1D*) f.Get("4");
0007 h1d->SetTitle("30 GeV e- on 20 X0 Fe : energy dep, longit profil");
0008 h1d->GetXaxis()->SetTitle("depth (X0)");
0009 h1d->GetYaxis()->SetTitle("(100/E0) (dE/dt)");
0010 h1d->SetStats(kFALSE);
0011 h1d->Draw("HIST");
0012
0013
0014 ifstream in;
0015 in.open("pdg.ascii");
0016
0017
0018 int nb_bins = 40;
0019 float x_min = 0;
0020 float x_max = 20;
0021 TH1F* h1f = new TH1F("h1f","",nb_bins,x_min,x_max);
0022
0023 Float_t x, y;
0024 while (1) {
0025 in >> x >> y ;
0026 if (!in.good()) break;
0027 h1f->Fill(x,y);
0028 }
0029 in.close();
0030
0031
0032 h1f->SetLineColor(2);
0033 h1f->Draw("SAME");
0034
0035
0036 TLegend *legend = new TLegend(0.65,0.55,0.85,0.68);
0037 legend->AddEntry(h1d,"93ref0","l");
0038 legend->AddEntry(h1f,"EGS4","L");
0039 legend->Draw();
0040 }