14 file.push_back(
"dEdxVsP.root");
15 file.push_back(
"dEdxVsP.root");
42 const int FileNo =
file.size();
43 string branchheader[FileNo] = {
"pos_",
"neg_"};
44 TH2F** h =
new TH2F*[
no];
45 TCanvas** c =
new TCanvas*[
no];
46 TLegend** lgd =
new TLegend*[
no];
47 TGraphErrors***
gr =
new TGraphErrors[
no][FileNo];
48 for(
int i =0;i<
no;i++)
gr[i] =
new TGraphErrors*[FileNo];
49 gStyle->SetOptStat(0);
50 gStyle->SetCanvasColor(10);
55 double chimean[FileNo][
nbins],chimeanerr[FileNo][
nbins],chisigma[FileNo][
nbins];
56 double fitmean[FileNo][
nbins],fitmeanerr[FileNo][
nbins],fitsigma[FileNo][
nbins];
57 double hits_mean[FileNo][
nbins],hits_sigma[FileNo][
nbins];
58 double pBin[FileNo][
nbins];
62 for(
int i=0;i<FileNo;i++)
66 f =
new TFile(ss.str().c_str());
67 tree = (TTree*)
f->Get(
"momInfor");
69 branch<<branchheader[i]<<
"chimean";
74 branch<<branchheader[i]<<
"chimeanerr";
77 branch<<branchheader[i]<<
"chisigma";
80 branch<<branchheader[i]<<
"fitmean";
83 branch<<branchheader[i]<<
"fitmeanerr";
86 branch<<branchheader[i]<<
"fitsigma";
101 c[0] =
new TCanvas(
"chimean",
"chimean",800,600);
105 h[0] ->
GetYaxis()->SetTitle(
"#chi_{mean}");
107 h[0] ->
GetXaxis()->SetTitle(
"momentum");
109 lgd[0] =
new TLegend(.65, .75, .89, .89);
110 lgd[0]->SetFillColor(10);
111 lgd[0]->SetBorderSize(1);
113 for(
int i=0;i<FileNo;i++)
115 gr[0][i] =
new TGraphErrors(
nbins,pBin[i],chimean[i],0,chimeanerr[i]);
118 gr[0][i] ->
Draw(
"Psame");
124 c[1] =
new TCanvas(
"chisigma",
"chisigma",800,600);
128 h[1] ->
GetYaxis()->SetTitle(
"#chi_{#sigma}");
130 h[1] ->
GetXaxis()->SetTitle(
"momentum");
132 lgd[1] =
new TLegend(.65, .75, .89, .89);
133 lgd[1]->SetFillColor(10);
134 lgd[1]->SetBorderSize(1);
136 for(
int i=0;i<FileNo;i++)
138 gr[1][i] =
new TGraphErrors(
nbins,pBin[i],chisigma[i],0,0);
141 gr[1][i] ->
Draw(
"Psame");
147 c[2] =
new TCanvas(
"fitmean",
"fitmean",800,600);
151 h[2] ->
GetYaxis()->SetTitle(
"fitmean");
153 h[2] ->
GetXaxis()->SetTitle(
"momentum");
155 lgd[2] =
new TLegend(.65, .75, .89, .89);
156 lgd[2]->SetFillColor(10);
157 lgd[2]->SetBorderSize(1);
159 for(
int i=0;i<FileNo;i++)
161 gr[2][i] =
new TGraphErrors(
nbins,pBin[i],fitmean[i],0,0);
164 gr[2][i] ->
Draw(
"Psame");
170 c[3] =
new TCanvas(
"fitsigma",
"fitsigma",800,600);
174 h[3] ->
GetYaxis()->SetTitle(
"fitsigma");
176 h[3] ->
GetXaxis()->SetTitle(
"momentum");
178 lgd[3] =
new TLegend(.65, .75, .89, .89);
179 lgd[3]->SetFillColor(10);
180 lgd[3]->SetBorderSize(1);
182 for(
int i=0;i<FileNo;i++)
184 gr[3][i] =
new TGraphErrors(
nbins,pBin[i],fitsigma[i],0,0);
187 gr[3][i] ->
Draw(
"Psame");
193 c[4] =
new TCanvas(
"hits_mean",
"hits_mean",800,600);
197 h[4] ->
GetYaxis()->SetTitle(
"hits_mean");
199 h[4] ->
GetXaxis()->SetTitle(
"momentum");
201 lgd[4] =
new TLegend(.65, .75, .89, .89);
202 lgd[4]->SetFillColor(10);
203 lgd[4]->SetBorderSize(1);
205 for(
int i=0;i<FileNo;i++)
207 gr[4][i] =
new TGraphErrors(
nbins,pBin[i],hits_mean[i],0,0);
210 gr[4][i] ->
Draw(
"Psame");
216 c[5] =
new TCanvas(
"hits_sigma",
"hits_sigma",800,600);
220 h[5] ->
GetYaxis()->SetTitle(
"hits_sigma");
222 h[5] ->
GetXaxis()->SetTitle(
"momentum");
224 lgd[5] =
new TLegend(.65, .75, .89, .89);
225 lgd[5]->SetFillColor(10);
226 lgd[5]->SetBorderSize(1);
228 for(
int i=0;i<FileNo;i++)
230 gr[5][i] =
new TGraphErrors(
nbins,pBin[i],hits_sigma[i],0,0);
233 gr[5][i] ->
Draw(
"Psame");
238 TFile* g =
new TFile(
"dEdxVsP_show.root",
"recreate");
239 for(
int i=0;i<
no;i++)
242 TString str_path =
"figs/mom_check_";
243 TString str_epsname = c[i]->GetName();
244 if(str_epsname==
"fitmean" || str_epsname==
"fitsigma") c[i]->SaveAs(str_path + str_epsname +
".eps");
const double hitsSigmaMax
const double hitsSigmaMin
vector< string > str_name
data SetBranchAddress("time",&time)
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")