13 file.push_back(
"costheta.root");
14 file.push_back(
"check/costheta.root");
33 const int FileNo =
file.size();
34 string branchheader[FileNo] = {
"pos_",
"neg_"};
35 TH2F** h =
new TH2F*[
no];
36 TCanvas** c =
new TCanvas*[
no];
37 TLegend** lgd =
new TLegend*[
no];
38 TGraphErrors***
gr =
new TGraphErrors[
no][FileNo];
39 for(
int i =0;i<
no;i++)
gr[i] =
new TGraphErrors*[FileNo];
40 gStyle->SetOptStat(0);
41 gStyle->SetCanvasColor(10);
46 double chimean[FileNo][
nbins],chimeanerr[FileNo][
nbins],chisigma[FileNo][
nbins];
47 double fitmean[FileNo][
nbins],fitmeanerr[FileNo][
nbins],fitsigma[FileNo][
nbins];
48 double cosBin[FileNo][
nbins];
52 for(
int i=0;i<FileNo;i++)
56 f =
new TFile(ss.str().c_str());
57 tree = (TTree*)
f->Get(
"costhetacalib");
59 branch<<branchheader[i]<<
"chimean";
62 branch<<branchheader[i]<<
"chimeanerr";
65 branch<<branchheader[i]<<
"chisigma";
68 branch<<branchheader[i]<<
"fitmean";
71 branch<<branchheader[i]<<
"fitmeanerr";
74 branch<<branchheader[i]<<
"fitsigma";
83 c[0] =
new TCanvas(
"chimean",
"chimean",800,600);
87 h[0] ->
GetYaxis()->SetTitle(
"#chi_{mean}");
89 h[0] ->
GetXaxis()->SetTitle(
"cos(#theta)");
91 lgd[0] =
new TLegend(.65, .75, .89, .89);
92 lgd[0]->SetFillColor(10);
93 lgd[0]->SetBorderSize(1);
95 for(
int i=0;i<FileNo;i++)
97 gr[0][i] =
new TGraphErrors(
nbins,cosBin[i],chimean[i],0,chimeanerr[i]);
100 gr[0][i] ->
Draw(
"Psame");
106 c[1] =
new TCanvas(
"chisigma",
"chisigma",800,600);
110 h[1] ->
GetYaxis()->SetTitle(
"#chi_{#sigma}");
112 h[1] ->
GetXaxis()->SetTitle(
"cos(#theta)");
114 lgd[1] =
new TLegend(.65, .75, .89, .89);
115 lgd[1]->SetFillColor(10);
116 lgd[1]->SetBorderSize(1);
118 for(
int i=0;i<FileNo;i++)
120 gr[1][i] =
new TGraphErrors(
nbins,cosBin[i],chisigma[i],0,0);
123 gr[1][i] ->
Draw(
"Psame");
129 c[2] =
new TCanvas(
"fitmean",
"fitmean",800,600);
133 h[2] ->
GetYaxis()->SetTitle(
"fitmean");
135 h[2] ->
GetXaxis()->SetTitle(
"cos(#theta)");
137 lgd[2] =
new TLegend(.65, .75, .89, .89);
138 lgd[2]->SetFillColor(10);
139 lgd[2]->SetBorderSize(1);
141 for(
int i=0;i<FileNo;i++)
143 gr[2][i] =
new TGraphErrors(
nbins,cosBin[i],fitmean[i],0,0);
146 gr[2][i] ->
Draw(
"Psame");
152 c[3] =
new TCanvas(
"fitsigma",
"fitsigma",800,600);
156 h[3] ->
GetYaxis()->SetTitle(
"fitsigma");
158 h[3] ->
GetXaxis()->SetTitle(
"cos(#theta)");
160 lgd[3] =
new TLegend(.65, .75, .89, .89);
161 lgd[3]->SetFillColor(10);
162 lgd[3]->SetBorderSize(1);
164 for(
int i=0;i<FileNo;i++)
166 gr[3][i] =
new TGraphErrors(
nbins,cosBin[i],fitsigma[i],0,0);
169 gr[3][i] ->
Draw(
"Psame");
174 TFile* g =
new TFile(
"dEdxVsCostheta.root",
"recreate");
175 for(
int i=0;i<
no;i++)
mg GetYaxis() -> SetRangeUser(0.8, 1.02)
mg GetXaxis() -> SetRangeUser(0.5, 1.9)
legend AddEntry(gr3,"e+ Data oldPat","p")
TFile f("ana_bhabha660a_dqa_mcPat_zy_old.root")
data SetBranchAddress("time",&time)