6 if (tit!=
"") g->GetHistogram()->SetTitle(tit);
7 g->GetHistogram()->SetMinimum(0);
9 g->SetMarkerColor(
col);
10 g->SetMarkerStyle(marker);
11 g->SetMarkerSize(1.5);
14 TF1 *
f1 = g->GetFunction(
"f1");
18 f1->SetLineColor(
col);
22 for (
int i=0;
i<g->GetN();++
i)
26 g->SetPoint(
i,x+shift,y);
37 if (tit==
"") tit=g->GetTitle();
39 double ymax = TMath::MaxElement(g->GetN(), g->GetY());
40 double dymax = g->GetErrorY(TMath::LocMax(g->GetN(), g->GetEY()));
44 xmin = TMath::MinElement(g->GetN(), g->GetX());
45 xmax = TMath::MaxElement(g->GetN(), g->GetX());
49 h->GetXaxis()->SetLabelSize(0.05);
50 h->GetXaxis()->SetTitleSize(0.05);
51 h->GetYaxis()->SetLabelSize(0.05);
52 h->GetYaxis()->SetTitleSize(0.05);
53 h->GetYaxis()->SetTitleOffset(1.4);
55 h->SetMaximum((ymax+dymax)*1.05);
67 gStyle->SetOptStat(0);
70 TFile *
f=
new TFile(fname);
72 TString plotnam[2]={
"phi_A",
"phi_B"};
73 TString lab[4] = {
"signal efficiency;EMC missing (polar #theta) [%];signal efficiency [%]",
"background efficiency;EMC missing (polar #theta) [%];background efficiency [%]",
"signal to noise;EMC missing (polar #theta) [%];S/B",
"significance;EMC missing (polar #theta) [%];significance [#sigma]"};
75 TGraphErrors *geffs[2];
76 TGraphErrors *geffb[2];
77 TGraphErrors *gston[2];
78 TGraphErrors *gsign[2];
80 TCanvas *
c1=
new TCanvas(
"c1",
"c1",10,10,1300,1000);
81 c1->Divide(2,2,0.0001,0.0001);
83 int colors[2] = {kBlue,kCyan-2};
91 geffs[
i]=(TGraphErrors*)f->Get(Form(
"effs_%s",plotnam[
i].Data()));
94 if (i==0) h[0]->Draw();
95 geffs[
i]->Draw(
"P same");
98 geffb[
i]=(TGraphErrors*)f->Get(Form(
"effb_%s",plotnam[i].Data()));
99 confgraph(geffb[i],
"",colors[i],20+(i%2)*3,i);
103 if (i==0) h[1]->Draw();
104 geffb[
i]->Draw(
"P same");
107 gston[
i]=(TGraphErrors*)f->Get(Form(
"sn_%s",plotnam[i].Data()));
108 confgraph(gston[i],
"",colors[i],20+(i%2)*3,i);
110 if (i==0) h[2]->Draw();
111 gston[
i]->Draw(
"P same");
114 gsign[
i]=(TGraphErrors*)f->Get(Form(
"sign_%s",plotnam[i].Data()));
115 confgraph(gsign[i],
"",colors[i],20+(i%2)*3,i);
117 if (i==0) h[3]->Draw();
118 gsign[
i]->Draw(
"P same");
122 TLegend *leg1=
new TLegend(0.16,0.18,0.5,0.34);
123 leg1->AddEntry(geffs[0],
"#phi#phi - Setup A",
"lep");
124 leg1->AddEntry(geffs[1],
"#phi#phi - Setup B",
"lep");
128 TLegend *leg2=
new TLegend(0.16,0.18,0.5,0.34);
129 leg2->AddEntry(geffb[0],
"#phi#phi - Setup A",
"lep");
130 leg2->AddEntry(geffb[1],
"#phi#phi - Setup B",
"lep");
134 TLegend *leg3=
new TLegend(0.16,0.18,0.5,0.34);
135 leg3->AddEntry(gston[0],
"#phi#phi - Setup A",
"lep");
136 leg3->AddEntry(gston[1],
"#phi#phi - Setup B",
"lep");
140 TLegend *leg4=
new TLegend(0.16,0.18,0.5,0.34);
141 leg4->AddEntry(gsign[0],
"#phi#phi - Setup A",
"lep");
142 leg4->AddEntry(gsign[1],
"#phi#phi - Setup B",
"lep");
145 c1->SaveAs(
"fig/comb_phi.gif");
TH1F * createHistoGraph(TGraph *g, TString tit="", double xmin=0, double xmax=0)
void confgraph(TGraph *g, TString tit, int col=1, int marker=20)
void combinePlotsPhi(TString fname="anaPhi.root")