3 Int_t
read_parms (Int_t j, TString
filename, vector<double> &yparms, vector<double> &yparms_err, vector< vector< double > > & covMatrix ) {
11 TString
infile = filename+
".fit2";
13 cout << endl <<
"Opening parameters file: " << infile.Data() << endl;
17 parameters.open (infile.Data());
19 cout <<
"ERROR: Failed to open data file= " << infile.Data() << endl;
25 c[j] =
new TCanvas(CanvasName,CanvasName,200,10,1000,700);
29 while (line.ReadLine(parameters)){
31 TObjArray *tokens = line.Tokenize(
"\t");
32 Int_t ntokens = tokens->GetEntries();
36 for (Int_t j=0; j<jmax; j++){
37 sdme.push_back( (((TObjString*)tokens->At(3*j))->GetString()) );
38 yparms.push_back( (((TObjString*)tokens->At(3*j+1))->GetString()).Atof() );
39 yparms_err.push_back( (((TObjString*)tokens->At(3*j+2))->GetString()).Atof());
41 if (ntokens != 1)
continue;
43 TObjArray *tokens2 = line.Tokenize(
" ");
44 Int_t ntokens2 = tokens2->GetEntries();
48 for (Int_t j=0; j<ntokens2; j++) {
49 temp.push_back( (((TObjString*)tokens2->At(j))->GetString()).Atof() );
52 covMatrix.push_back(temp);
60 TLatex *
t1 =
new TLatex(0.2,0.85,title);
62 t1->SetTextSize(0.04);
65 for (Int_t j=0; j<sdme.size()-2; j++) {
70 title.Form(
"%s = \t%.3f #pm %.3f\n",sdmename.Data(),yparms[j],yparms_err[j]);
72 TLatex *t1 =
new TLatex(0.2,0.75 - 0.05*j,title);
74 t1->SetTextSize(0.04);
100 gStyle->SetPalette(1,0);
101 gStyle->SetOptStat(111111);
102 gStyle->SetOptFit(111111);
103 gStyle->SetPadRightMargin(0.15);
104 gStyle->SetPadLeftMargin(0.15);
105 gStyle->SetPadBottomMargin(0.15);
107 vector <double> yparms;
108 vector <double> yparms_err;
109 vector< vector< double > > covMatrix;
119 Float_t g1V1m1_re[
nfiles];
120 Float_t g1V1m1_im[
nfiles];
121 Float_t g1V00_re_err[
nfiles];
122 Float_t g1V00_im_err[
nfiles];
123 Float_t g1V11_re_err[
nfiles];
124 Float_t g1V11_im_err[
nfiles];
125 Float_t g1V10_re_err[
nfiles];
126 Float_t g1V10_im_err[
nfiles];
127 Float_t g1V1m1_re_err[
nfiles];
128 Float_t g1V1m1_im_err[
nfiles];
130 Float_t xparms[
nfiles]={1,2,3,4,5,6,7,8};
131 Float_t xparms_err[
nfiles]={0.01,0.01,0.01,0.01,0.01,0.01,0.01,0.01};
132 Float_t g1V00_rho[
nfiles];
133 Float_t g1V00_phi[
nfiles];
134 Float_t g1V11_rho[
nfiles];
135 Float_t g1V11_phi[
nfiles];
136 Float_t g1V10_rho[
nfiles];
137 Float_t g1V10_phi[
nfiles];
138 Float_t g1V1m1_rho[
nfiles];
139 Float_t g1V1m1_phi[
nfiles];
141 Float_t g1V00_rho_err[
nfiles];
142 Float_t g1V00_phi_err[
nfiles];
143 Float_t g1V11_rho_err[
nfiles];
144 Float_t g1V11_phi_err[
nfiles];
145 Float_t g1V10_rho_err[
nfiles];
146 Float_t g1V10_phi_err[
nfiles];
147 Float_t g1V1m1_rho_err[
nfiles];
148 Float_t g1V1m1_phi_err[
nfiles];
151 const Int_t nparms=8;
153 TGraphErrors *gr_g1V00_re;
154 TGraphErrors *gr_g1V00_im;
155 TGraphErrors *gr_g1V11_re;
156 TGraphErrors *gr_g1V11_im;
157 TGraphErrors *gr_g1V10_re;
158 TGraphErrors *gr_g1V10_im;
159 TGraphErrors *gr_g1V1m1_re;
160 TGraphErrors *gr_g1V1m1_im;
162 TGraphErrors *gr_g1V00_rho;
163 TGraphErrors *gr_g1V00_phi;
164 TGraphErrors *gr_g1V11_rho;
165 TGraphErrors *gr_g1V11_phi;
166 TGraphErrors *gr_g1V10_rho;
167 TGraphErrors *gr_g1V10_phi;
168 TGraphErrors *gr_g1V1m1_rho;
169 TGraphErrors *gr_g1V1m1_phi;
173 filenames.push_back(
"twopi_primakoff_DSelect_sw1pw1000_NOTAG_W_1000000");
174 filenames.push_back(
"twopi_primakoff_DSelect_sw1pw1000_NOTAG_File_1000000");
175 filenames.push_back(
"twopi_primakoff_DSelect_sw1pw1000_TAG_W_1000000");
176 filenames.push_back(
"twopi_primakoff_DSelect_sw1pw1000_TAG_File_1000000");
177 filenames.push_back(
"twopi_primakoff_DSelect_sw1pw1000_TAG10_W_1000000");
178 filenames.push_back(
"twopi_primakoff_DSelect_sw1pw1000_TAG10_File_1000000");
179 filenames.push_back(
"twopi_primakoff_DSelect_sw1pw1000_TAG40_W_1000000");
180 filenames.push_back(
"twopi_primakoff_DSelect_sw1pw1000_TAG40_File_1000000");
184 for (j=0; j<filenames.size(); j++) {
185 read_parms(j, filenames[j], yparms, yparms_err, covMatrix);
186 cout <<
" yparms=" << yparms[0] <<
" " << yparms[1] <<
" " << yparms[2] <<
" " << yparms[3] <<
" " << yparms[4] <<
" " << yparms[5] <<
" " << yparms[6] <<
" " << yparms[7] << endl;
187 cout <<
" yparms_err=" << yparms_err[0] <<
" " << yparms_err[1] <<
" " << yparms_err[2] <<
" " << yparms_err[3] <<
" " << yparms_err[4] <<
" " << yparms_err[5] <<
" " << yparms_err[6] <<
" " << yparms_err[7] << endl;
188 g1V00_re[j] = yparms[0];
189 g1V00_im[j] = yparms[1];
190 g1V11_re[j] = yparms[2];
191 g1V11_im[j] = yparms[3];
192 g1V10_re[j] = yparms[4];
193 g1V10_im[j] = yparms[5];
194 g1V1m1_re[j] = yparms[6];
195 g1V1m1_im[j] = yparms[7];
196 g1V00_re_err[j] = yparms_err[0];
197 g1V00_im_err[j] = yparms_err[1];
198 g1V11_re_err[j] = yparms_err[2];
199 g1V11_im_err[j] = yparms_err[3];
200 g1V10_re_err[j] = yparms_err[4];
201 g1V10_im_err[j] = yparms_err[5];
202 g1V1m1_re_err[j] = yparms_err[6];
203 g1V1m1_im_err[j] = yparms_err[7];
206 g1V00_rho[j] =
sqrt(yparms[0]*yparms[0]+yparms[1]*yparms[1]);
207 g1V00_phi[j] = atan2(yparms[1],yparms[0])*180./3.14159;
208 g1V11_rho[j] =
sqrt(yparms[2]*yparms[2]+yparms[3]*yparms[3]);
209 g1V11_phi[j] = atan2(yparms[3],yparms[2])*180./3.14159;
210 g1V10_rho[j] =
sqrt(yparms[4]*yparms[4]+yparms[5]*yparms[5]);
211 g1V10_phi[j] = atan2(yparms[5],yparms[4])*180./3.14159;
212 g1V1m1_rho[j] =
sqrt(yparms[6]*yparms[6]+yparms[7]*yparms[7]);
213 g1V1m1_phi[j] = atan2(yparms[7],yparms[6])*180./3.14159;
226 double A = g1V00_re[j];
227 double B = g1V00_im[j];
228 double rho =
sqrt (A*A + B*B);
229 double A_err = g1V00_re_err[j];
230 double B_err = g1V00_im_err[j];
231 double AB_corr = covMatrix[0][1];
232 g1V00_rho_err[j] =
sqrt( (A*A)*(A_err*A_err) + (B*B)*(B_err*B_err) + 2*A*B*AB_corr )/rho;
233 double R = B==0? 0 : A/B;
234 double R_err = abs(R)*
sqrt( (A_err/A)*(A_err/A) + (B_err/B)*(B_err/B) -2*AB_corr/(A*B));
235 double phi_err = R_err*(180./3.14159)/(1+R*R);
236 double phi = g1V00_phi[j];
237 g1V00_phi_err[j] = phi_err;
238 cout << endl <<
" g1V00";
239 cout <<
" rho=" << rho <<
" A=" << A <<
" B=" << B <<
" AB_corr=" << AB_corr <<
" R=" << R <<
" R_err=" << R_err <<
" phi=" << phi <<
" phi_err=" << phi_err << endl;
240 cout <<
" A_err/A=" << A_err/A <<
" B_err/B=" << B_err/B <<
" rho_err/rho=" << g1V00_rho_err[j]/rho <<
" R_err/R=" << R_err/R <<
" phi_err/phi=" << phi_err/phi << endl;
246 rho =
sqrt (A*A + B*B);
247 A_err = g1V11_re_err[j];
248 B_err = g1V11_im_err[j];
249 AB_corr = covMatrix[2][3];
250 g1V11_rho_err[j] =
sqrt( (A*A)*(A_err*A_err) + (B*B)*(B_err*B_err) + 2*A*B*AB_corr )/rho;
252 R_err = abs(R)*
sqrt( (A_err/A)*(A_err/A) + (B_err/B)*(B_err/B) -2*AB_corr/(A*B));
253 phi_err = R_err*(180./3.14159)/(1+R*R);
255 g1V11_phi_err[j] = phi_err;
256 cout << endl <<
" g1V11";
257 cout <<
" rho=" << rho <<
" A=" << A <<
" B=" << B <<
" AB_corr=" << AB_corr <<
" R=" << R <<
" R_err=" << R_err <<
" phi=" << phi <<
" phi_err=" << phi_err << endl;
258 cout <<
" A_err/A=" << A_err/A <<
" B_err/B=" << B_err/B <<
" rho_err/rho=" << g1V00_rho_err[j]/rho <<
" R_err/R=" << R_err/R <<
" phi_err/phi=" << phi_err/phi << endl;
262 rho =
sqrt (A*A + B*B);
263 A_err = g1V10_re_err[j];
264 B_err = g1V10_im_err[j];
265 AB_corr = covMatrix[4][5];
266 g1V10_rho_err[j] =
sqrt( (A*A)*(A_err*A_err) + (B*B)*(B_err*B_err) + 2*A*B*AB_corr )/rho;
268 R_err = abs(R)*
sqrt( (A_err/A)*(A_err/A) + (B_err/B)*(B_err/B) -2*AB_corr/(A*B));
269 phi_err = R_err*(180./3.14159)/(1+R*R);
271 g1V10_phi_err[j] = phi_err;
272 cout << endl <<
" g1V10";
273 cout <<
" rho=" << rho <<
" A=" << A <<
" B=" << B <<
" AB_corr=" << AB_corr <<
" R=" << R <<
" R_err=" << R_err <<
" phi=" << phi <<
" phi_err=" << phi_err << endl;
274 cout <<
" A_err/A=" << A_err/A <<
" B_err/B=" << B_err/B <<
" rho_err/rho=" << g1V00_rho_err[j]/rho <<
" R_err/R=" << R_err/R <<
" phi_err/phi=" << phi_err/phi << endl;
279 rho =
sqrt (A*A + B*B);
280 A_err = g1V1m1_re_err[j];
281 B_err = g1V1m1_im_err[j];
282 AB_corr = covMatrix[6][7];
283 g1V1m1_rho_err[j] =
sqrt( (A*A)*(A_err*A_err) + (B*B)*(B_err*B_err) + 2*A*B*AB_corr )/rho;
285 R_err = abs(R)*
sqrt( (A_err/A)*(A_err/A) + (B_err/B)*(B_err/B) -2*AB_corr/(A*B));
286 phi_err = R_err*(180./3.14159)/(1+R*R);
288 g1V1m1_phi_err[j] = phi_err;
289 cout << endl <<
" g1V1m1";
290 cout <<
" rho=" << rho <<
" A=" << A <<
" B=" << B <<
" AB_corr=" << AB_corr <<
" R=" << R <<
" R_err=" << R_err <<
" phi=" << phi <<
" phi_err=" << phi_err << endl;
291 cout <<
" A_err/A=" << A_err/A <<
" B_err/B=" << B_err/B <<
" rho_err/rho=" << g1V00_rho_err[j]/rho <<
" R_err/R=" << R_err/R <<
" phi_err/phi=" << phi_err/phi << endl;
294 gr_g1V00_re =
new TGraphErrors(
nfiles,xparms,g1V00_re,xparms_err,g1V00_re_err);
295 gr_g1V00_im =
new TGraphErrors(
nfiles,xparms,g1V00_im,xparms_err,g1V00_im_err);
296 gr_g1V11_re =
new TGraphErrors(
nfiles,xparms,g1V11_re,xparms_err,g1V11_re_err);
297 gr_g1V11_im =
new TGraphErrors(
nfiles,xparms,g1V11_im,xparms_err,g1V11_im_err);
298 gr_g1V10_re =
new TGraphErrors(
nfiles,xparms,g1V10_re,xparms_err,g1V10_re_err);
299 gr_g1V10_im =
new TGraphErrors(
nfiles,xparms,g1V10_im,xparms_err,g1V10_im_err);
300 gr_g1V1m1_re =
new TGraphErrors(
nfiles,xparms,g1V1m1_re,xparms_err,g1V1m1_re_err);
301 gr_g1V1m1_im =
new TGraphErrors(
nfiles,xparms,g1V1m1_im,xparms_err,g1V1m1_im_err);
303 gr_g1V00_rho =
new TGraphErrors(
nfiles,xparms,g1V00_rho,xparms_err,g1V00_rho_err);
304 gr_g1V00_phi =
new TGraphErrors(
nfiles,xparms,g1V00_phi,xparms_err,g1V00_phi_err);
305 gr_g1V11_rho =
new TGraphErrors(
nfiles,xparms,g1V11_rho,xparms_err,g1V11_rho_err);
306 gr_g1V11_phi =
new TGraphErrors(
nfiles,xparms,g1V11_phi,xparms_err,g1V11_phi_err);
307 gr_g1V10_rho =
new TGraphErrors(
nfiles,xparms,g1V10_rho,xparms_err,g1V10_rho_err);
308 gr_g1V10_phi =
new TGraphErrors(
nfiles,xparms,g1V10_phi,xparms_err,g1V10_phi_err);
309 gr_g1V1m1_rho =
new TGraphErrors(
nfiles,xparms,g1V1m1_rho,xparms_err,g1V1m1_rho_err);
310 gr_g1V1m1_phi =
new TGraphErrors(
nfiles,xparms,g1V1m1_phi,xparms_err,g1V1m1_phi_err);
315 c0 =
new TCanvas(
"c0",
"c0",200,10,1000,700);
318 gr_g1V00_re->SetTitle(
"g1V00_re");
319 gr_g1V00_re->GetXaxis()->SetTitleSize(0.05);
320 gr_g1V00_re->GetYaxis()->SetTitleSize(0.05);
321 gr_g1V00_re->GetXaxis()->SetTitle(
"Measurement");
322 gr_g1V00_re->SetMarkerStyle(20);
323 gr_g1V00_re->SetMarkerColor(4);
324 gr_g1V00_re->Draw(
"p");
328 gr_g1V00_im->SetTitle(
"g1V00_im");
329 gr_g1V00_im->GetXaxis()->SetTitleSize(0.05);
330 gr_g1V00_im->GetYaxis()->SetTitleSize(0.05);
331 gr_g1V00_im->GetXaxis()->SetTitle(
"Measurement");
332 gr_g1V00_im->SetMarkerStyle(20);
333 gr_g1V00_im->SetMarkerColor(4);
334 gr_g1V00_im->Draw(
"p");
338 gr_g1V11_re->SetTitle(
"g1V11_re");
339 gr_g1V11_re->GetXaxis()->SetTitleSize(0.05);
340 gr_g1V11_re->GetYaxis()->SetTitleSize(0.05);
341 gr_g1V11_re->GetXaxis()->SetTitle(
"Measurement");
342 gr_g1V11_re->SetMarkerStyle(20);
343 gr_g1V11_re->SetMarkerColor(4);
344 gr_g1V11_re->Draw(
"p");
348 gr_g1V11_im->SetTitle(
"g1V11_im");
349 gr_g1V11_im->GetXaxis()->SetTitleSize(0.05);
350 gr_g1V11_im->GetYaxis()->SetTitleSize(0.05);
351 gr_g1V11_im->GetXaxis()->SetTitle(
"Measurement");
352 gr_g1V11_im->SetMarkerStyle(20);
353 gr_g1V11_im->SetMarkerColor(4);
354 gr_g1V11_im->Draw(
"p");
359 gr_g1V10_re->SetTitle(
"g1V10_re");
360 gr_g1V10_re->GetXaxis()->SetTitleSize(0.05);
361 gr_g1V10_re->GetYaxis()->SetTitleSize(0.05);
362 gr_g1V10_re->GetXaxis()->SetTitle(
"Measurement");
363 gr_g1V10_re->SetMarkerStyle(20);
364 gr_g1V10_re->SetMarkerColor(4);
365 gr_g1V10_re->Draw(
"p");
369 gr_g1V10_im->SetTitle(
"g1V10_im");
370 gr_g1V10_im->GetXaxis()->SetTitleSize(0.05);
371 gr_g1V10_im->GetYaxis()->SetTitleSize(0.05);
372 gr_g1V10_im->GetXaxis()->SetTitle(
"Measurement");
373 gr_g1V10_im->SetMarkerStyle(20);
374 gr_g1V10_im->SetMarkerColor(4);
375 gr_g1V10_im->Draw(
"p");
379 gr_g1V1m1_re->SetTitle(
"g1V1m1_re");
380 gr_g1V1m1_re->GetXaxis()->SetTitleSize(0.05);
381 gr_g1V1m1_re->GetYaxis()->SetTitleSize(0.05);
382 gr_g1V1m1_re->GetXaxis()->SetTitle(
"Measurement");
383 gr_g1V1m1_re->SetMarkerStyle(20);
384 gr_g1V1m1_re->SetMarkerColor(4);
385 gr_g1V1m1_re->Draw(
"p");
386 gr_g1V1m1_re->Draw();
389 gr_g1V1m1_im->SetTitle(
"g1V1m1_im");
390 gr_g1V1m1_im->GetXaxis()->SetTitleSize(0.05);
391 gr_g1V1m1_im->GetYaxis()->SetTitleSize(0.05);
392 gr_g1V1m1_im->GetXaxis()->SetTitle(
"Measurement");
393 gr_g1V1m1_im->SetMarkerStyle(20);
394 gr_g1V1m1_im->SetMarkerColor(4);
395 gr_g1V1m1_im->Draw(
"p");
396 gr_g1V1m1_im->Draw();
398 c1 =
new TCanvas(
"c1",
"c1",200,10,1000,700);
401 gr_g1V00_rho->SetTitle(
"g1V00_rho");
402 gr_g1V00_rho->GetXaxis()->SetTitleSize(0.05);
403 gr_g1V00_rho->GetYaxis()->SetTitleSize(0.05);
404 gr_g1V00_rho->GetXaxis()->SetTitle(
"Measurement");
405 gr_g1V00_rho->SetMarkerStyle(20);
406 gr_g1V00_rho->SetMarkerColor(4);
407 gr_g1V00_rho->Draw(
"p");
408 gr_g1V00_rho->Draw();
411 gr_g1V00_phi->SetTitle(
"g1V00_phi");
412 gr_g1V00_phi->GetXaxis()->SetTitleSize(0.05);
413 gr_g1V00_phi->GetYaxis()->SetTitleSize(0.05);
414 gr_g1V00_phi->GetXaxis()->SetTitle(
"Measurement");
415 gr_g1V00_phi->SetMarkerStyle(20);
416 gr_g1V00_phi->SetMarkerColor(4);
417 gr_g1V00_phi->Draw(
"p");
418 gr_g1V00_phi->Draw();
421 gr_g1V11_rho->SetTitle(
"g1V11_rho");
422 gr_g1V11_rho->GetXaxis()->SetTitleSize(0.05);
423 gr_g1V11_rho->GetYaxis()->SetTitleSize(0.05);
424 gr_g1V11_rho->GetXaxis()->SetTitle(
"Measurement");
425 gr_g1V11_rho->SetMarkerStyle(20);
426 gr_g1V11_rho->SetMarkerColor(4);
427 gr_g1V11_rho->Draw(
"p");
428 gr_g1V11_rho->Draw();
431 gr_g1V11_phi->SetTitle(
"g1V11_phi");
432 gr_g1V11_phi->GetXaxis()->SetTitleSize(0.05);
433 gr_g1V11_phi->GetYaxis()->SetTitleSize(0.05);
434 gr_g1V11_phi->GetXaxis()->SetTitle(
"Measurement");
435 gr_g1V11_phi->SetMarkerStyle(20);
436 gr_g1V11_phi->SetMarkerColor(4);
437 gr_g1V11_phi->Draw(
"p");
438 gr_g1V11_phi->Draw();
441 gr_g1V10_rho->SetTitle(
"g1V10_rho");
442 gr_g1V10_rho->GetXaxis()->SetTitleSize(0.05);
443 gr_g1V10_rho->GetYaxis()->SetTitleSize(0.05);
444 gr_g1V10_rho->GetXaxis()->SetTitle(
"Measurement");
445 gr_g1V10_rho->SetMarkerStyle(20);
446 gr_g1V10_rho->SetMarkerColor(4);
447 gr_g1V10_rho->Draw(
"p");
448 gr_g1V10_rho->Draw();
451 gr_g1V10_phi->SetTitle(
"g1V10_phi");
452 gr_g1V10_phi->GetXaxis()->SetTitleSize(0.05);
453 gr_g1V10_phi->GetYaxis()->SetTitleSize(0.05);
454 gr_g1V10_phi->GetXaxis()->SetTitle(
"Measurement");
455 gr_g1V10_phi->SetMarkerStyle(20);
456 gr_g1V10_phi->SetMarkerColor(4);
457 gr_g1V10_phi->Draw(
"p");
458 gr_g1V10_phi->Draw();
461 gr_g1V1m1_rho->SetTitle(
"g1V1m1_rho");
462 gr_g1V1m1_rho->GetXaxis()->SetTitleSize(0.05);
463 gr_g1V1m1_rho->GetYaxis()->SetTitleSize(0.05);
464 gr_g1V1m1_rho->GetXaxis()->SetTitle(
"Measurement");
465 gr_g1V1m1_rho->SetMarkerStyle(20);
466 gr_g1V1m1_rho->SetMarkerColor(4);
467 gr_g1V1m1_rho->Draw(
"p");
468 gr_g1V1m1_rho->Draw();
471 gr_g1V1m1_phi->SetTitle(
"g1V1m1_phi");
472 gr_g1V1m1_phi->GetXaxis()->SetTitleSize(0.05);
473 gr_g1V1m1_phi->GetYaxis()->SetTitleSize(0.05);
474 gr_g1V1m1_phi->GetXaxis()->SetTitle(
"Measurement");
475 gr_g1V1m1_phi->SetMarkerStyle(20);
476 gr_g1V1m1_phi->SetMarkerColor(4);
477 gr_g1V1m1_phi->Draw(
"p");
478 gr_g1V1m1_phi->Draw();
482 c[0]->SaveAs(
"fits_errors.pdf(");
483 for (j=1; j<
nfiles; j++) {
484 c[j]->SaveAs(
"fits_errors.pdf");
486 c0->SaveAs(
"fits_errors.pdf");
487 c1->SaveAs(
"fits_errors.pdf)");
Int_t read_parms(Int_t j, TString filename, Float_t *yparms, Float_t *yparms_err)
vector< string > filenames