3 Double_t
rho_error (Float_t *y1, Float_t *y1_err, Float_t *y2, Float_t *y2_err) {
19 vector <TString> sdme;
20 vector <double> parms;
21 vector <double> parms_err;
24 TString
infile = filename+
".fit2";
26 cout <<
"Opening parameters file: " << infile.Data() << endl;
30 parameters.open (infile.Data());
32 cout <<
"ERROR: Failed to open data file= " << infile.Data() << endl;
38 c[j] =
new TCanvas(CanvasName,CanvasName,200,10,1000,700);
41 while (line.ReadLine(parameters)){
43 TObjArray *tokens = line.Tokenize(
"\t");
44 Int_t ntokens = tokens->GetEntries();
48 for (Int_t j=0; j<jmax; j++){
49 sdme.push_back( (((TObjString*)tokens->At(3*j))->GetString()) );
50 parms.push_back( (((TObjString*)tokens->At(3*j+1))->GetString()).Atof() );
51 parms_err.push_back( (((TObjString*)tokens->At(3*j+2))->GetString()).Atof());
57 TLatex *
t1 =
new TLatex(0.2,0.85,title);
59 t1->SetTextSize(0.04);
62 for (Int_t j=0; j<sdme.size()-2; j++) {
63 cout << sdme[j] <<
"=" << parms[j] <<
" err=" << parms_err[j] << endl;
67 title.Form(
"%s = \t%.3f #pm %.3f\n",sdmename.Data(),parms[j],parms_err[j]);
69 TLatex *t1 =
new TLatex(0.2,0.75 - 0.05*j,title);
71 t1->SetTextSize(0.04);
77 for (jj=0; jj<parms.size()-2; jj++) {
78 yparms[jj] = parms[jj];
79 yparms_err[jj] = parms_err[jj];
96 gStyle->SetPalette(1,0);
97 gStyle->SetOptStat(111111);
98 gStyle->SetOptFit(111111);
99 gStyle->SetPadRightMargin(0.15);
100 gStyle->SetPadLeftMargin(0.15);
101 gStyle->SetPadBottomMargin(0.15);
110 Float_t g1V1m1_re[
nfiles];
111 Float_t g1V1m1_im[
nfiles];
112 Float_t g1V00_re_err[
nfiles];
113 Float_t g1V00_im_err[
nfiles];
114 Float_t g1V11_re_err[
nfiles];
115 Float_t g1V11_im_err[
nfiles];
116 Float_t g1V10_re_err[
nfiles];
117 Float_t g1V10_im_err[
nfiles];
118 Float_t g1V1m1_re_err[
nfiles];
119 Float_t g1V1m1_im_err[
nfiles];
120 Float_t xparms[
nfiles]={1,2,3,4,5,6,7,8};
121 Float_t xparms_err[
nfiles]={0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01};
122 Float_t g1V00_rho[
nfiles];
123 Float_t g1V00_phi[
nfiles];
124 Float_t g1V11_rho[
nfiles];
125 Float_t g1V11_phi[
nfiles];
126 Float_t g1V10_rho[
nfiles];
127 Float_t g1V10_phi[
nfiles];
128 Float_t g1V1m1_rho[
nfiles];
129 Float_t g1V1m1_phi[
nfiles];
131 Float_t g1V00_rho_err[
nfiles];
132 Float_t g1V00_phi_err[
nfiles];
133 Float_t g1V11_rho_err[
nfiles];
134 Float_t g1V11_phi_err[
nfiles];
135 Float_t g1V10_rho_err[
nfiles];
136 Float_t g1V10_phi_err[
nfiles];
137 Float_t g1V1m1_rho_err[
nfiles];
138 Float_t g1V1m1_phi_err[
nfiles];
141 const Int_t nparms=8;
142 Float_t yparms[nparms];
143 Float_t yparms_err[nparms];
145 TGraphErrors *gr_g1V00_re;
146 TGraphErrors *gr_g1V00_im;
147 TGraphErrors *gr_g1V11_re;
148 TGraphErrors *gr_g1V11_im;
149 TGraphErrors *gr_g1V10_re;
150 TGraphErrors *gr_g1V10_im;
151 TGraphErrors *gr_g1V1m1_re;
152 TGraphErrors *gr_g1V1m1_im;
154 TGraphErrors *gr_g1V00_rho;
155 TGraphErrors *gr_g1V00_phi;
156 TGraphErrors *gr_g1V11_rho;
157 TGraphErrors *gr_g1V11_phi;
158 TGraphErrors *gr_g1V10_rho;
159 TGraphErrors *gr_g1V10_phi;
160 TGraphErrors *gr_g1V1m1_rho;
161 TGraphErrors *gr_g1V1m1_phi;
163 filenames.push_back(
"twopi_primakoff_DSelect_sw1pw1000_NOTAG_W_1000000");
164 filenames.push_back(
"twopi_primakoff_DSelect_sw1pw1000_NOTAG_File_1000000");
165 filenames.push_back(
"twopi_primakoff_DSelect_sw1pw1000_TAG_W_1000000");
166 filenames.push_back(
"twopi_primakoff_DSelect_sw1pw1000_TAG_File_1000000");
167 filenames.push_back(
"twopi_primakoff_DSelect_sw1pw1000_TAG10_W_1000000");
168 filenames.push_back(
"twopi_primakoff_DSelect_sw1pw1000_TAG10_File_1000000");
169 filenames.push_back(
"twopi_primakoff_DSelect_sw1pw1000_TAG40_W_1000000");
170 filenames.push_back(
"twopi_primakoff_DSelect_sw1pw1000_TAG40_File_1000000");
173 for (j=0; j<filenames.size(); j++) {
174 read_parms(j, filenames[j], yparms, yparms_err);
175 cout <<
" yparms=" << yparms[0] <<
" " << yparms[1] <<
" " << yparms[2] <<
" " << yparms[3] <<
" " << yparms[4] <<
" " << yparms[5] <<
" " << yparms[6] <<
" " << yparms[7] << endl;
176 g1V00_re[j] = yparms[0];
177 g1V00_im[j] = yparms[1];
178 g1V11_re[j] = yparms[2];
179 g1V11_im[j] = yparms[3];
180 g1V10_re[j] = yparms[4];
181 g1V10_im[j] = yparms[5];
182 g1V1m1_re[j] = yparms[6];
183 g1V1m1_im[j] = yparms[7];
184 g1V00_re_err[j] = yparms_err[0];
185 g1V00_im_err[j] = yparms_err[1];
186 g1V11_re_err[j] = yparms_err[2];
187 g1V11_im_err[j] = yparms_err[3];
188 g1V10_re_err[j] = yparms_err[4];
189 g1V10_im_err[j] = yparms_err[5];
190 g1V1m1_re_err[j] = yparms_err[6];
191 g1V1m1_im_err[j] = yparms_err[7];
194 g1V00_rho[j] =
sqrt(yparms[0]*yparms[0]+yparms[1]*yparms[1]);
195 g1V00_phi[j] = atan2(yparms[1],yparms[0])*180./3.14159;
196 g1V11_rho[j] =
sqrt(yparms[2]*yparms[2]+yparms[3]*yparms[3]);
197 g1V11_phi[j] = atan2(yparms[3],yparms[2])*180./3.14159;
198 g1V10_rho[j] =
sqrt(yparms[4]*yparms[4]+yparms[5]*yparms[5]);
199 g1V10_phi[j] = atan2(yparms[5],yparms[4])*180./3.14159;
200 g1V1m1_rho[j] =
sqrt(yparms[6]*yparms[6]+yparms[7]*yparms[7]);
201 g1V1m1_phi[j] = atan2(yparms[7],yparms[6])*180./3.14159;
205 gr_g1V00_re =
new TGraphErrors(
nfiles,xparms,g1V00_re,xparms_err,g1V00_re_err);
206 gr_g1V00_im =
new TGraphErrors(
nfiles,xparms,g1V00_im,xparms_err,g1V00_im_err);
207 gr_g1V11_re =
new TGraphErrors(
nfiles,xparms,g1V11_re,xparms_err,g1V11_re_err);
208 gr_g1V11_im =
new TGraphErrors(
nfiles,xparms,g1V11_im,xparms_err,g1V11_im_err);
209 gr_g1V10_re =
new TGraphErrors(
nfiles,xparms,g1V10_re,xparms_err,g1V10_re_err);
210 gr_g1V10_im =
new TGraphErrors(
nfiles,xparms,g1V10_im,xparms_err,g1V10_im_err);
211 gr_g1V1m1_re =
new TGraphErrors(
nfiles,xparms,g1V1m1_re,xparms_err,g1V1m1_re_err);
212 gr_g1V1m1_im =
new TGraphErrors(
nfiles,xparms,g1V1m1_im,xparms_err,g1V1m1_im_err);
214 gr_g1V00_rho =
new TGraphErrors(
nfiles,xparms,g1V00_rho,xparms_err,g1V00_rho_err);
215 gr_g1V00_phi =
new TGraphErrors(
nfiles,xparms,g1V00_phi,xparms_err,g1V00_phi_err);
216 gr_g1V11_rho =
new TGraphErrors(
nfiles,xparms,g1V11_rho,xparms_err,g1V11_rho_err);
217 gr_g1V11_phi =
new TGraphErrors(
nfiles,xparms,g1V11_phi,xparms_err,g1V11_phi_err);
218 gr_g1V10_rho =
new TGraphErrors(
nfiles,xparms,g1V10_rho,xparms_err,g1V10_rho_err);
219 gr_g1V10_phi =
new TGraphErrors(
nfiles,xparms,g1V10_phi,xparms_err,g1V10_phi_err);
220 gr_g1V1m1_rho =
new TGraphErrors(
nfiles,xparms,g1V1m1_rho,xparms_err,g1V1m1_rho_err);
221 gr_g1V1m1_phi =
new TGraphErrors(
nfiles,xparms,g1V1m1_phi,xparms_err,g1V1m1_phi_err);
223 c0 =
new TCanvas(
"c0",
"c0",200,10,1000,700);
226 gr_g1V00_re->SetTitle(
"g1V00_re");
227 gr_g1V00_re->GetXaxis()->SetTitleSize(0.05);
228 gr_g1V00_re->GetYaxis()->SetTitleSize(0.05);
229 gr_g1V00_re->GetXaxis()->SetTitle(
"Measurement");
230 gr_g1V00_re->SetMarkerStyle(20);
231 gr_g1V00_re->SetMarkerColor(4);
232 gr_g1V00_re->Draw(
"p");
236 gr_g1V00_im->SetTitle(
"g1V00_im");
237 gr_g1V00_im->GetXaxis()->SetTitleSize(0.05);
238 gr_g1V00_im->GetYaxis()->SetTitleSize(0.05);
239 gr_g1V00_im->GetXaxis()->SetTitle(
"Measurement");
240 gr_g1V00_im->SetMarkerStyle(20);
241 gr_g1V00_im->SetMarkerColor(4);
242 gr_g1V00_im->Draw(
"p");
246 gr_g1V11_re->SetTitle(
"g1V11_re");
247 gr_g1V11_re->GetXaxis()->SetTitleSize(0.05);
248 gr_g1V11_re->GetYaxis()->SetTitleSize(0.05);
249 gr_g1V11_re->GetXaxis()->SetTitle(
"Measurement");
250 gr_g1V11_re->SetMarkerStyle(20);
251 gr_g1V11_re->SetMarkerColor(4);
252 gr_g1V11_re->Draw(
"p");
256 gr_g1V11_im->SetTitle(
"g1V11_im");
257 gr_g1V11_im->GetXaxis()->SetTitleSize(0.05);
258 gr_g1V11_im->GetYaxis()->SetTitleSize(0.05);
259 gr_g1V11_im->GetXaxis()->SetTitle(
"Measurement");
260 gr_g1V11_im->SetMarkerStyle(20);
261 gr_g1V11_im->SetMarkerColor(4);
262 gr_g1V11_im->Draw(
"p");
266 gr_g1V10_re->SetTitle(
"g1V10_re");
267 gr_g1V10_re->GetXaxis()->SetTitleSize(0.05);
268 gr_g1V10_re->GetYaxis()->SetTitleSize(0.05);
269 gr_g1V10_re->GetXaxis()->SetTitle(
"Measurement");
270 gr_g1V10_re->SetMarkerStyle(20);
271 gr_g1V10_re->SetMarkerColor(4);
272 gr_g1V10_re->Draw(
"p");
276 gr_g1V10_im->SetTitle(
"g1V10_im");
277 gr_g1V10_im->GetXaxis()->SetTitleSize(0.05);
278 gr_g1V10_im->GetYaxis()->SetTitleSize(0.05);
279 gr_g1V10_im->GetXaxis()->SetTitle(
"Measurement");
280 gr_g1V10_im->SetMarkerStyle(20);
281 gr_g1V10_im->SetMarkerColor(4);
282 gr_g1V10_im->Draw(
"p");
286 gr_g1V1m1_re->SetTitle(
"g1V1m1_re");
287 gr_g1V1m1_re->GetXaxis()->SetTitleSize(0.05);
288 gr_g1V1m1_re->GetYaxis()->SetTitleSize(0.05);
289 gr_g1V1m1_re->GetXaxis()->SetTitle(
"Measurement");
290 gr_g1V1m1_re->SetMarkerStyle(20);
291 gr_g1V1m1_re->SetMarkerColor(4);
292 gr_g1V1m1_re->Draw(
"p");
293 gr_g1V1m1_re->Draw();
296 gr_g1V1m1_im->SetTitle(
"g1V1m1_im");
297 gr_g1V1m1_im->GetXaxis()->SetTitleSize(0.05);
298 gr_g1V1m1_im->GetYaxis()->SetTitleSize(0.05);
299 gr_g1V1m1_im->GetXaxis()->SetTitle(
"Measurement");
300 gr_g1V1m1_im->SetMarkerStyle(20);
301 gr_g1V1m1_im->SetMarkerColor(4);
302 gr_g1V1m1_im->Draw(
"p");
303 gr_g1V1m1_im->Draw();
305 c1 =
new TCanvas(
"c1",
"c1",200,10,1000,700);
308 gr_g1V00_rho->SetTitle(
"g1V00_rho");
309 gr_g1V00_rho->GetXaxis()->SetTitleSize(0.05);
310 gr_g1V00_rho->GetYaxis()->SetTitleSize(0.05);
311 gr_g1V00_rho->GetXaxis()->SetTitle(
"Measurement");
312 gr_g1V00_rho->SetMarkerStyle(20);
313 gr_g1V00_rho->SetMarkerColor(4);
314 gr_g1V00_rho->Draw(
"p");
315 gr_g1V00_rho->Draw();
318 gr_g1V00_phi->SetTitle(
"g1V00_phi");
319 gr_g1V00_phi->GetXaxis()->SetTitleSize(0.05);
320 gr_g1V00_phi->GetYaxis()->SetTitleSize(0.05);
321 gr_g1V00_phi->GetXaxis()->SetTitle(
"Measurement");
322 gr_g1V00_phi->SetMarkerStyle(20);
323 gr_g1V00_phi->SetMarkerColor(4);
324 gr_g1V00_phi->Draw(
"p");
325 gr_g1V00_phi->Draw();
328 gr_g1V11_rho->SetTitle(
"g1V11_rho");
329 gr_g1V11_rho->GetXaxis()->SetTitleSize(0.05);
330 gr_g1V11_rho->GetYaxis()->SetTitleSize(0.05);
331 gr_g1V11_rho->GetXaxis()->SetTitle(
"Measurement");
332 gr_g1V11_rho->SetMarkerStyle(20);
333 gr_g1V11_rho->SetMarkerColor(4);
334 gr_g1V11_rho->Draw(
"p");
335 gr_g1V11_rho->Draw();
338 gr_g1V11_phi->SetTitle(
"g1V11_phi");
339 gr_g1V11_phi->GetXaxis()->SetTitleSize(0.05);
340 gr_g1V11_phi->GetYaxis()->SetTitleSize(0.05);
341 gr_g1V11_phi->GetXaxis()->SetTitle(
"Measurement");
342 gr_g1V11_phi->SetMarkerStyle(20);
343 gr_g1V11_phi->SetMarkerColor(4);
344 gr_g1V11_phi->Draw(
"p");
345 gr_g1V11_phi->Draw();
348 gr_g1V10_rho->SetTitle(
"g1V10_rho");
349 gr_g1V10_rho->GetXaxis()->SetTitleSize(0.05);
350 gr_g1V10_rho->GetYaxis()->SetTitleSize(0.05);
351 gr_g1V10_rho->GetXaxis()->SetTitle(
"Measurement");
352 gr_g1V10_rho->SetMarkerStyle(20);
353 gr_g1V10_rho->SetMarkerColor(4);
354 gr_g1V10_rho->Draw(
"p");
355 gr_g1V10_rho->Draw();
358 gr_g1V10_phi->SetTitle(
"g1V10_phi");
359 gr_g1V10_phi->GetXaxis()->SetTitleSize(0.05);
360 gr_g1V10_phi->GetYaxis()->SetTitleSize(0.05);
361 gr_g1V10_phi->GetXaxis()->SetTitle(
"Measurement");
362 gr_g1V10_phi->SetMarkerStyle(20);
363 gr_g1V10_phi->SetMarkerColor(4);
364 gr_g1V10_phi->Draw(
"p");
365 gr_g1V10_phi->Draw();
368 gr_g1V1m1_rho->SetTitle(
"g1V1m1_rho");
369 gr_g1V1m1_rho->GetXaxis()->SetTitleSize(0.05);
370 gr_g1V1m1_rho->GetYaxis()->SetTitleSize(0.05);
371 gr_g1V1m1_rho->GetXaxis()->SetTitle(
"Measurement");
372 gr_g1V1m1_rho->SetMarkerStyle(20);
373 gr_g1V1m1_rho->SetMarkerColor(4);
374 gr_g1V1m1_rho->Draw(
"p");
375 gr_g1V1m1_rho->Draw();
378 gr_g1V1m1_phi->SetTitle(
"g1V1m1_phi");
379 gr_g1V1m1_phi->GetXaxis()->SetTitleSize(0.05);
380 gr_g1V1m1_phi->GetYaxis()->SetTitleSize(0.05);
381 gr_g1V1m1_phi->GetXaxis()->SetTitle(
"Measurement");
382 gr_g1V1m1_phi->SetMarkerStyle(20);
383 gr_g1V1m1_phi->SetMarkerColor(4);
384 gr_g1V1m1_phi->Draw(
"p");
385 gr_g1V1m1_phi->Draw();
387 c[0]->SaveAs(
"fitparm_summary.pdf(");
388 for (j=1; j<
nfiles; j++) {
389 c[j]->SaveAs(
"fitparm_summary.pdf");
391 c0->SaveAs(
"fitparm_summary.pdf");
392 c1->SaveAs(
"fitparm_summary.pdf)");
Double_t rho_error(Float_t *y1, Float_t *y1_err, Float_t *y2, Float_t *y2_err)
Double_t phi_error(Float_t *y1, Float_t *y2)
Int_t read_parms(Int_t j, TString filename, Float_t *yparms, Float_t *yparms_err)
vector< string > filenames