const Int_t nfiles=12; TCanvas *c[nfiles]; Int_t read_parms (Int_t j, TString filename, vector &yparms, vector &yparms_err, vector< vector< double > > & covMatrix ) { vector sdme; yparms.clear(); yparms_err.clear(); covMatrix.clear(); TString infile = filename+".fit2"; // file with parameters cout << endl << "Opening parameters file: " << infile.Data() << endl; // now read and print fitted values ifstream parameters; parameters.open (infile.Data()); if (!parameters) { cout << "ERROR: Failed to open data file= " << infile.Data() << endl; return 1; // failed to open data file } TString CanvasName = filename; // cout << "j=" << j << " CanvasName=" << CanvasName << endl; c[j] = new TCanvas(CanvasName,CanvasName,200,10,1000,700); TString line; Int_t ndx=0; while (line.ReadLine(parameters)){ TObjArray *tokens = line.Tokenize("\t"); Int_t ntokens = tokens->GetEntries(); // cout << " ntokens=" << ntokens << " line=" << line.Data() << endl; Int_t jmax=ntokens/3; for (Int_t j=0; jAt(3*j))->GetString()) ); yparms.push_back( (((TObjString*)tokens->At(3*j+1))->GetString()).Atof() ); yparms_err.push_back( (((TObjString*)tokens->At(3*j+2))->GetString()).Atof()); } if (ntokens != 1) continue; // get entries with covariance matrix TObjArray *tokens2 = line.Tokenize(" "); Int_t ntokens2 = tokens2->GetEntries(); // cout << " ntokens2=" << ntokens2 << " line=" << line << endl; vector temp; temp.clear(); for (Int_t j=0; jAt(j))->GetString()).Atof() ); } // cout << " vector=" << setw(20) << temp[0] << setw(20) << temp[1] << setw(20) << temp[2] << setw(20) << temp[3] << setw(20) << temp[4] << setw(20) << temp[5] << setw(20) << temp[6] << setw(20) << temp[7] << endl; covMatrix.push_back(temp); ndx++; } // end loop over lines // Output parameters to canvas TString title = filename; TLatex *t1 = new TLatex(0.2,0.85,title); t1->SetNDC(); t1->SetTextSize(0.04); t1->Draw(); for (Int_t j=0; jDivide(3,3); c0->cd(1); gr_g1V00_re->SetTitle(""); gr_g1V00_re->GetYaxis()->SetTitle("g1V00_re"); // gr_g1V00_re->GetTitle()->SetTitleSize(0.08); gr_g1V00_re->GetYaxis()->SetRangeUser(-ymax/1000.,ymax/1000.); gr_g1V00_re->GetXaxis()->SetTitleSize(0.07); gr_g1V00_re->GetYaxis()->SetTitleSize(0.07); gr_g1V00_re->GetXaxis()->SetLabelSize(0.07); gr_g1V00_re->GetYaxis()->SetLabelSize(0.07); gr_g1V00_re->GetXaxis()->SetTitle("Measurement"); gr_g1V00_re->SetMarkerStyle(20); gr_g1V00_re->SetMarkerColor(4); gr_g1V00_re->Draw("p"); gr_g1V00_re->Draw(); c0->cd(2); gr_g1V00_im->SetTitle(""); gr_g1V00_im->GetYaxis()->SetTitle("g1V00_im"); gr_g1V00_im->GetYaxis()->SetRangeUser(-ymax/1000.,ymax/1000.); gr_g1V00_im->GetXaxis()->SetTitleSize(0.07); gr_g1V00_im->GetYaxis()->SetTitleSize(0.07); gr_g1V00_im->GetXaxis()->SetLabelSize(0.07); gr_g1V00_im->GetYaxis()->SetLabelSize(0.07); gr_g1V00_im->GetXaxis()->SetTitle("Measurement"); gr_g1V00_im->SetMarkerStyle(20); gr_g1V00_im->SetMarkerColor(4); gr_g1V00_im->Draw("p"); gr_g1V00_im->Draw(); c0->cd(3); gr_g1V11_re->SetTitle(""); gr_g1V11_re->GetYaxis()->SetTitle("g1V11_re"); gr_g1V11_re->GetYaxis()->SetRangeUser(-ymax,ymax); gr_g1V11_re->GetXaxis()->SetTitleSize(0.07); gr_g1V11_re->GetYaxis()->SetTitleSize(0.07); gr_g1V11_re->GetXaxis()->SetLabelSize(0.07); gr_g1V11_re->GetYaxis()->SetLabelSize(0.07); gr_g1V11_re->GetXaxis()->SetTitle("Measurement"); gr_g1V11_re->SetMarkerStyle(20); gr_g1V11_re->SetMarkerColor(4); gr_g1V11_re->Draw("p"); gr_g1V11_re->Draw(); c0->cd(4); gr_g1V11_im->SetTitle(""); gr_g1V11_im->GetYaxis()->SetTitle("g1V11_im"); gr_g1V11_im->GetYaxis()->SetRangeUser(-ymax,ymax); gr_g1V11_im->GetXaxis()->SetTitleSize(0.07); gr_g1V11_im->GetYaxis()->SetTitleSize(0.07); gr_g1V11_im->GetXaxis()->SetLabelSize(0.07); gr_g1V11_im->GetYaxis()->SetLabelSize(0.07); gr_g1V11_im->GetXaxis()->SetTitle("Measurement"); gr_g1V11_im->SetMarkerStyle(20); gr_g1V11_im->SetMarkerColor(4); gr_g1V11_im->Draw("p"); gr_g1V11_im->Draw(); c0->cd(5); gr_g1V10_re->SetTitle(""); gr_g1V10_re->GetYaxis()->SetTitle("g1V10_re"); gr_g1V10_re->GetYaxis()->SetRangeUser(-ymax,ymax); gr_g1V10_re->GetXaxis()->SetTitleSize(0.07); gr_g1V10_re->GetYaxis()->SetTitleSize(0.07); gr_g1V10_re->GetXaxis()->SetLabelSize(0.07); gr_g1V10_re->GetYaxis()->SetLabelSize(0.07); gr_g1V10_re->GetXaxis()->SetTitle("Measurement"); gr_g1V10_re->SetMarkerStyle(20); gr_g1V10_re->SetMarkerColor(4); gr_g1V10_re->Draw("p"); gr_g1V10_re->Draw(); c0->cd(6); gr_g1V10_im->SetTitle(""); gr_g1V10_im->GetYaxis()->SetTitle("g1V10_im"); gr_g1V10_im->GetYaxis()->SetRangeUser(-ymax,ymax); gr_g1V10_im->GetXaxis()->SetTitleSize(0.07); gr_g1V10_im->GetYaxis()->SetTitleSize(0.07); gr_g1V10_im->GetXaxis()->SetLabelSize(0.07); gr_g1V10_im->GetYaxis()->SetLabelSize(0.07); gr_g1V10_im->GetXaxis()->SetTitle("Measurement"); gr_g1V10_im->SetMarkerStyle(20); gr_g1V10_im->SetMarkerColor(4); gr_g1V10_im->Draw("p"); gr_g1V10_im->Draw(); c0->cd(7); gr_g1V1m1_re->SetTitle(""); gr_g1V1m1_re->GetYaxis()->SetTitle("g1V1m1_re"); gr_g1V1m1_re->GetYaxis()->SetRangeUser(-ymax,ymax); gr_g1V1m1_re->GetXaxis()->SetTitleSize(0.07); gr_g1V1m1_re->GetYaxis()->SetTitleSize(0.07); gr_g1V1m1_re->GetXaxis()->SetLabelSize(0.07); gr_g1V1m1_re->GetYaxis()->SetLabelSize(0.07); gr_g1V1m1_re->GetXaxis()->SetTitle("Measurement"); gr_g1V1m1_re->SetMarkerStyle(20); gr_g1V1m1_re->SetMarkerColor(4); gr_g1V1m1_re->Draw("p"); gr_g1V1m1_re->Draw(); c0->cd(8); gr_g1V1m1_im->SetTitle(""); gr_g1V1m1_im->GetYaxis()->SetTitle("g1V1m1_im"); gr_g1V1m1_im->GetYaxis()->SetRangeUser(-ymax,ymax); gr_g1V1m1_im->GetXaxis()->SetTitleSize(0.07); gr_g1V1m1_im->GetYaxis()->SetTitleSize(0.07); gr_g1V1m1_im->GetXaxis()->SetLabelSize(0.07); gr_g1V1m1_im->GetYaxis()->SetLabelSize(0.07); gr_g1V1m1_im->GetXaxis()->SetTitle("Measurement"); gr_g1V1m1_im->SetMarkerStyle(20); gr_g1V1m1_im->SetMarkerColor(4); gr_g1V1m1_im->Draw("p"); gr_g1V1m1_im->Draw(); c1 = new TCanvas("c1","c1",200,10,1000,700); ymin = 10; ymax = 5000; c1->Divide(3,3); c1->cd(1); gPad->SetLogy(); gr_g1V00_rho->SetTitle(""); gr_g1V00_rho->GetYaxis()->SetTitle("g1V00_rho"); gr_g1V00_rho->GetYaxis()->SetRangeUser(ymin/1000.,ymax/1000.); gr_g1V00_rho->GetXaxis()->SetTitleSize(0.07); gr_g1V00_rho->GetYaxis()->SetTitleSize(0.07); gr_g1V00_rho->GetXaxis()->SetLabelSize(0.07); gr_g1V00_rho->GetYaxis()->SetLabelSize(0.07); gr_g1V00_rho->GetXaxis()->SetTitle("Measurement"); gr_g1V00_rho->SetMarkerStyle(20); gr_g1V00_rho->SetMarkerColor(4); gr_g1V00_rho->Draw("p"); gr_g1V00_rho->Draw(); c1->cd(2); //gPad->SetLogy(); gr_g1V00_phi->SetTitle(""); gr_g1V00_phi->GetYaxis()->SetTitle("g1V00_phi(degrees)"); gr_g1V00_phi->GetXaxis()->SetTitleSize(0.07); gr_g1V00_phi->GetYaxis()->SetTitleSize(0.07); gr_g1V00_phi->GetXaxis()->SetLabelSize(0.07); gr_g1V00_phi->GetYaxis()->SetLabelSize(0.07); gr_g1V00_phi->GetXaxis()->SetTitle("Measurement"); gr_g1V00_phi->SetMarkerStyle(20); gr_g1V00_phi->SetMarkerColor(4); gr_g1V00_phi->Draw("p"); gr_g1V00_phi->Draw(); c1->cd(3); gPad->SetLogy(); gr_g1V11_rho->SetTitle(""); gr_g1V11_rho->GetYaxis()->SetTitle("g1V11_rho"); gr_g1V11_rho->GetYaxis()->SetRangeUser(ymin,ymax); gr_g1V11_rho->GetXaxis()->SetTitleSize(0.07); gr_g1V11_rho->GetYaxis()->SetTitleSize(0.07); gr_g1V11_rho->GetXaxis()->SetLabelSize(0.07); gr_g1V11_rho->GetYaxis()->SetLabelSize(0.07); gr_g1V11_rho->GetXaxis()->SetTitle("Measurement"); gr_g1V11_rho->SetMarkerStyle(20); gr_g1V11_rho->SetMarkerColor(4); gr_g1V11_rho->Draw("p"); gr_g1V11_rho->Draw(); c1->cd(4); //gPad->SetLogy(); gr_g1V11_phi->SetTitle(""); gr_g1V11_phi->GetYaxis()->SetTitle("g1V11_phi(degrees)"); gr_g1V11_phi->GetXaxis()->SetTitleSize(0.07); gr_g1V11_phi->GetYaxis()->SetTitleSize(0.07); gr_g1V11_phi->GetXaxis()->SetLabelSize(0.07); gr_g1V11_phi->GetYaxis()->SetLabelSize(0.07); gr_g1V11_phi->GetXaxis()->SetTitle("Measurement"); gr_g1V11_phi->SetMarkerStyle(20); gr_g1V11_phi->SetMarkerColor(4); gr_g1V11_phi->Draw("p"); gr_g1V11_phi->Draw(); c1->cd(5); gPad->SetLogy(); gr_g1V10_rho->SetTitle(""); gr_g1V10_rho->GetYaxis()->SetTitle("g1V10_rho"); gr_g1V10_rho->GetYaxis()->SetRangeUser(ymin,ymax); gr_g1V10_rho->GetXaxis()->SetTitleSize(0.07); gr_g1V10_rho->GetYaxis()->SetTitleSize(0.07); gr_g1V10_rho->GetXaxis()->SetLabelSize(0.07); gr_g1V10_rho->GetYaxis()->SetLabelSize(0.07); gr_g1V10_rho->GetXaxis()->SetTitle("Measurement"); gr_g1V10_rho->SetMarkerStyle(20); gr_g1V10_rho->SetMarkerColor(4); gr_g1V10_rho->Draw("p"); gr_g1V10_rho->Draw(); c1->cd(6); //gPad->SetLogy(); gr_g1V10_phi->SetTitle(""); gr_g1V10_phi->GetYaxis()->SetTitle("g1V10_phi(degrees)"); gr_g1V10_phi->GetXaxis()->SetTitleSize(0.07); gr_g1V10_phi->GetYaxis()->SetTitleSize(0.07); gr_g1V10_phi->GetXaxis()->SetLabelSize(0.07); gr_g1V10_phi->GetYaxis()->SetLabelSize(0.07); gr_g1V10_phi->GetXaxis()->SetTitle("Measurement"); gr_g1V10_phi->SetMarkerStyle(20); gr_g1V10_phi->SetMarkerColor(4); gr_g1V10_phi->Draw("p"); gr_g1V10_phi->Draw(); c1->cd(7); gPad->SetLogy(); gr_g1V1m1_rho->SetTitle(""); gr_g1V1m1_rho->GetYaxis()->SetTitle("g1V1m1_rho"); gr_g1V1m1_rho->GetYaxis()->SetRangeUser(ymin,ymax); gr_g1V1m1_rho->GetXaxis()->SetTitleSize(0.07); gr_g1V1m1_rho->GetYaxis()->SetTitleSize(0.07); gr_g1V1m1_rho->GetXaxis()->SetLabelSize(0.07); gr_g1V1m1_rho->GetYaxis()->SetLabelSize(0.07); gr_g1V1m1_rho->GetXaxis()->SetTitle("Measurement"); gr_g1V1m1_rho->SetMarkerStyle(20); gr_g1V1m1_rho->SetMarkerColor(4); gr_g1V1m1_rho->Draw("p"); gr_g1V1m1_rho->Draw(); c1->cd(8); //gPad->SetLogy(); gr_g1V1m1_phi->SetTitle(""); gr_g1V1m1_phi->GetYaxis()->SetTitle("g1V1m1_phi(degrees)"); gr_g1V1m1_phi->GetXaxis()->SetTitleSize(0.07); gr_g1V1m1_phi->GetYaxis()->SetTitleSize(0.07); gr_g1V1m1_phi->GetXaxis()->SetLabelSize(0.07); gr_g1V1m1_phi->GetYaxis()->SetLabelSize(0.07); gr_g1V1m1_phi->GetXaxis()->SetTitle("Measurement"); gr_g1V1m1_phi->SetMarkerStyle(20); gr_g1V1m1_phi->SetMarkerColor(4); gr_g1V1m1_phi->Draw("p"); gr_g1V1m1_phi->Draw(); c[0]->SaveAs("fits_errors.pdf("); for (j=1; jSaveAs("fits_errors.pdf"); } c0->SaveAs("fits_errors.pdf"); c1->SaveAs("fits_errors.pdf)"); }