37 const int FileNo =
file.size();
38 string branchheader[FileNo] = {
"pos_",
"neg_"};
39 string str_names[FileNo] = {
"positron",
"electron"};
40 TH2F** h =
new TH2F*[
no];
41 TCanvas** c =
new TCanvas*[
no];
42 TLegend** lgd =
new TLegend*[
no];
43 TGraphErrors***
gr =
new TGraphErrors[
no][FileNo];
44 for(
int i =0;i<
no;i++)
gr[i] =
new TGraphErrors*[FileNo];
45 gStyle->SetOptStat(0);
46 gStyle->SetCanvasColor(10);
51 double chimean[FileNo][
nbins],chimeanerr[FileNo][
nbins],chisigma[FileNo][
nbins];
52 double fitmean[FileNo][
nbins],fitmeanerr[FileNo][
nbins],fitsigma[FileNo][
nbins];
57 for(
int i=0;i<FileNo;i++)
61 f =
new TFile(ss.str().c_str());
62 tree = (TTree*)
f->Get(
"costhetacalib");
64 branch<<branchheader[i]<<
"chimean";
67 branch<<branchheader[i]<<
"chimeanerr";
70 branch<<branchheader[i]<<
"chisigma";
73 branch<<branchheader[i]<<
"fitmean";
76 branch<<branchheader[i]<<
"fitmeanerr";
79 branch<<branchheader[i]<<
"fitsigma";
88 c[0] =
new TCanvas(
"chimean",
"chimean",800,600);
92 h[0] ->
GetYaxis()->SetTitle(
"#chi_{mean}");
94 h[0] ->
GetXaxis()->SetTitle(
"cos(#theta)");
96 lgd[0] =
new TLegend(.65, .75, .89, .89);
97 lgd[0]->SetFillColor(10);
98 lgd[0]->SetBorderSize(1);
100 for(
int i=0;i<FileNo;i++)
102 gr[0][i] =
new TGraphErrors(
nbins,cosBin[i],chimean[i],0,chimeanerr[i]);
105 gr[0][i] ->
Draw(
"Psame");
106 lgd[0] ->
AddEntry(
gr[0][i], str_names[i].c_str() ,
"p");
111 c[1] =
new TCanvas(
"chisigma",
"chisigma",800,600);
115 h[1] ->
GetYaxis()->SetTitle(
"#chi_{#sigma}");
117 h[1] ->
GetXaxis()->SetTitle(
"cos(#theta)");
119 lgd[1] =
new TLegend(.65, .75, .89, .89);
120 lgd[1]->SetFillColor(10);
121 lgd[1]->SetBorderSize(1);
123 for(
int i=0;i<FileNo;i++)
125 gr[1][i] =
new TGraphErrors(
nbins,cosBin[i],chisigma[i],0,0);
128 gr[1][i] ->
Draw(
"Psame");
129 lgd[1] ->
AddEntry(
gr[1][i], str_names[i].c_str() ,
"p");
134 c[2] =
new TCanvas(
"fitmean",
"fitmean",800,600);
138 h[2] ->
GetYaxis()->SetTitle(
"fitmean");
140 h[2] ->
GetXaxis()->SetTitle(
"cos(#theta)");
142 lgd[2] =
new TLegend(.65, .75, .89, .89);
143 lgd[2]->SetFillColor(10);
144 lgd[2]->SetBorderSize(1);
146 for(
int i=0;i<FileNo;i++){
147 gr[2][i] =
new TGraphErrors(
nbins,cosBin[i],fitmean[i],0,0);
150 gr[2][i] ->
Draw(
"Psame");
151 lgd[2] ->
AddEntry(
gr[2][i], str_names[i].c_str() ,
"p");
156 c[3] =
new TCanvas(
"fitsigma",
"fitsigma",800,600);
160 h[3] ->
GetYaxis()->SetTitle(
"fitsigma");
162 h[3] ->
GetXaxis()->SetTitle(
"cos(#theta)");
164 lgd[3] =
new TLegend(.65, .75, .89, .89);
165 lgd[3]->SetFillColor(10);
166 lgd[3]->SetBorderSize(1);
168 for(
int i=0;i<FileNo;i++)
170 gr[3][i] =
new TGraphErrors(
nbins,cosBin[i],fitsigma[i],0,0);
173 gr[3][i] ->
Draw(
"Psame");
174 lgd[3] ->
AddEntry(
gr[3][i], str_names[i].c_str() ,
"p");
179 c[4] =
new TCanvas(
"slope",
"slope",800,600);
183 h[4] ->
GetYaxis()->SetTitle(
"slope");
185 h[4] ->
GetXaxis()->SetTitle(
"cos(#theta)");
187 lgd[4] =
new TLegend(.65, .75, .89, .89);
188 lgd[4]->SetFillColor(10);
189 lgd[4]->SetBorderSize(1);
192 for(
int j=0; j<FileNo; j++){
193 for(
int k=0; k<
nbins; k++){
194 if(fitmean[j][k])
slope[j][k] = fitmean[j][k]/fitmean[j][
nbins-k-1];
195 else slope[j][k] = 0;
199 for(
int i=0;i<FileNo;i++)
201 gr[4][i] =
new TGraphErrors(
nbins/2,cosBin[i],
slope[i],0,0);
204 gr[4][i] ->
Draw(
"Psame");
205 lgd[4] ->
AddEntry(
gr[4][i], str_names[i].c_str() ,
"p");
210 TFile* g =
new TFile(
"dEdxVsCosNP.root",
"recreate");
211 for(
int i=0;i<
no;i++)