2 c1=
new TCanvas(
"yieldvspt",
"mass",500,500);
4 c2=
new TCanvas(
"yieldvse",
"msass",500,500);
6 c3=
new TCanvas(
"mass",
"msass",500,500);
9 f=
new TFile(
"test.root");
11 h0=(TH1F*) gPt->Clone();
12 h1=(TH1F*) McPt->Clone();
13 h2=(TH1F*) gEnergy->Clone();
14 h3=(TH1F*) McEnergy->Clone();
16 h1->SetTitle(
"efficiency vs pt");
18 h3->SetTitle(
"efficiency vs energy");
19 int nb1=h1->GetNbinsX();
21 int nb2=h3->GetNbinsX();
25 float n0=h0->GetBinContent(i);
26 float n1=h1->GetBinContent(i);
37 error=sqrt(n1*(n0-n1)/pow(n0,3));
40 h1->SetBinContent(i,eff);
41 h1->SetBinError(i,error);
45 float n2=h2->GetBinContent(i);
46 float n3=h3->GetBinContent(i);
57 error=sqrt(n3*(n2-n3)/pow(n2,3));
60 h3->SetBinContent(i,eff);
61 h3->SetBinError(i,error);
67 h1->Fit(
"pol0",
"R",
"",7.5,15.0);
69 c1->Print(
"yieldvspt.gif");
73 h3->Fit(
"pol0",
"R",
"",15.0,35.0);
75 c2->Print(
"yieldvse.gif");
81 hMassAny->SetLineColor(4);
82 c3->Print(
"mass.gif");