[1199] | 1 | { |
---|
| 2 | gROOT->Reset(); |
---|
| 3 | gStyle->SetOptStat(0); |
---|
| 4 | gStyle->SetNdivisions(210, "x"); |
---|
| 5 | gStyle->SetNdivisions(210, "y"); |
---|
| 6 | gStyle->SetLabelOffset(0.005, "x"); |
---|
| 7 | gStyle->SetLabelOffset(0.005, "y"); |
---|
| 8 | gStyle->SetLabelSize(0.07, "x"); |
---|
| 9 | gStyle->SetLabelSize(0.07, "y"); |
---|
| 10 | gStyle->SetTitleOffset(0.8, "x"); |
---|
| 11 | gStyle->SetTitleOffset(0.8, "y"); |
---|
| 12 | gStyle->SetTitleSize(0.08, "x"); |
---|
| 13 | gStyle->SetTitleSize(0.08, "y"); |
---|
| 14 | gStyle->SetPadBottomMargin(0.15); |
---|
| 15 | gStyle->SetPadTopMargin(0.1); |
---|
| 16 | gStyle->SetPadLeftMargin(0.15); |
---|
| 17 | gStyle->SetPadRightMargin(0.1); |
---|
| 18 | gStyle->SetTickLength(0.04, "x"); |
---|
| 19 | gStyle->SetTickLength(0.02, "y"); |
---|
| 20 | gStyle->SetPadBorderMode(0); |
---|
| 21 | |
---|
| 22 | TCanvas c1("c1","eegg ",0.5, 5, 600, 600); |
---|
| 23 | |
---|
| 24 | c1->Divide(1,2); |
---|
| 25 | |
---|
| 26 | TString ang[2] = {"",""}; |
---|
| 27 | |
---|
| 28 | TLegend* leg[2]; |
---|
| 29 | TH1F* hh[4]; |
---|
| 30 | leg[0] = new TLegend(0.2, 0.5, 0.35, 0.8); |
---|
| 31 | leg[0]->SetTextSize(0.07); |
---|
| 32 | leg[1] = new TLegend(0.2, 0.5, 0.35, 0.8); |
---|
| 33 | leg[1]->SetTextSize(0.07); |
---|
| 34 | leg[0]->SetHeader("100 keV"); |
---|
| 35 | leg[1]->SetHeader("100 keV"); |
---|
| 36 | // c1.cd(i+1); |
---|
| 37 | // hh[i] = gPad->DrawFrame(0, 0, 6.5, 700, ""); |
---|
| 38 | // hh[i]->GetXaxis()->SetTitle("p (GeV)"); |
---|
| 39 | // hh[i]->GetYaxis()->SetTitle("#sigma (mb/GeV/srad)"); |
---|
| 40 | // hh[i]->Draw("AXIS"); |
---|
| 41 | |
---|
| 42 | TString file1 = "eegg100kev.root"; |
---|
| 43 | //TString file1 = "eegg10kev.root"; |
---|
| 44 | //TString file1 = "eegg1mev.root"; |
---|
| 45 | |
---|
| 46 | TFile ff(file1); |
---|
| 47 | c1.cd(1); |
---|
| 48 | h2->SetLineColor(4); |
---|
| 49 | h2->Draw("HIST"); |
---|
| 50 | leg[0]->AddEntry(h2, "G4 8.2", "l"); |
---|
| 51 | |
---|
| 52 | h1->SetLineColor(2); |
---|
| 53 | h1->Draw("HIST SAME"); |
---|
| 54 | leg[0]->AddEntry(h1, "G4 8.1", "l"); |
---|
| 55 | |
---|
| 56 | c1.cd(2); |
---|
| 57 | h4->SetLineColor(4); |
---|
| 58 | h4->Draw("HIST"); |
---|
| 59 | leg[1]->AddEntry(h4, "G4 8.2", "l"); |
---|
| 60 | |
---|
| 61 | h3->SetLineColor(2); |
---|
| 62 | h3->Draw("HIST SAME"); |
---|
| 63 | leg[1]->AddEntry(h3, "G4 8.1", "l"); |
---|
| 64 | |
---|
| 65 | for(i=0; i<2; i++) { |
---|
| 66 | c1.cd(i+1); |
---|
| 67 | leg[i]->Draw(); |
---|
| 68 | } |
---|
| 69 | |
---|
| 70 | c1.Update(); |
---|
| 71 | |
---|
| 72 | c1.Print("eegg100kev.eps"); |
---|
| 73 | //c1.Print("eegg1mev.eps"); |
---|
| 74 | |
---|
| 75 | } |
---|