File indexing completed on 2025-08-06 08:12:08
0001
0002 {
0003 TCanvas c;
0004 TH1F h1("h1","H1;Mass [GeV];Counts [/ GeV];",20,0,20);
0005 TH1F h2("h2","H2;Mass [GeV];Counts [/ GeV];",20,0,20);
0006 for (int i = 0;i<1000;i++){h1.Fill(gRandom->Gaus(7,2));}
0007 for (int i = 0;i<1000;i++){h1.Fill(gRandom->Exp(.5)*20);}
0008 for (int i = 0;i<1000;i++){h2.Fill(gRandom->Exp(.5)*20);}
0009 h1.Draw("e1");
0010 h2.Draw("same");
0011 h2.SetFillColor(5);
0012 h1.Draw("e1same");
0013
0014 TLegend leg(.55,.70,.85,.93);
0015 leg.AddEntry("","#it{#bf{sPHENIX}} Simulation","");
0016 leg.AddEntry("","Au+Au #sqrt{s_{NN}}=200 GeV","");
0017 leg.AddEntry(&h1,"Data","LP");
0018 leg.AddEntry(&h2,"MC","F");
0019 leg.Draw();
0020 c.RedrawAxis();
0021 c.Print("test_style.pdf");
0022 c.Print("test_style.png");
0023
0024 TCanvas c2;
0025 c2.SetRightMargin(.2);
0026 TF2 f2("f2","exp(-x/5)*sin(y)",-5,5,-5,5);
0027
0028 f2.SetNpx(100);
0029 f2.SetNpy(100);
0030 f2.Draw("surf2z");
0031 f2.GetXaxis()->SetTitle("X");
0032 f2.GetYaxis()->SetTitle("Y");
0033 f2.GetZaxis()->SetTitle("Z");
0034 c2.Print("test_style_f2.pdf");
0035 c2.Print("test_style_f2.png");
0036 }