void plot_t_xsecs(){ ifstream phifile("phi_t_yields.dat"); double phi_3pi[8][100]; double dphi_3pi[8][100]; for (int j=0;j<100;j++){ for (int k=0;k<8;k++){ phifile >> phi_3pi[k][j]; phifile >> dphi_3pi[k][j]; cout << phi_3pi[k][j] << endl; } } phifile.close(); double eff[8][100],deff[8][100]; ifstream infile("phi_eff_t.dat"); for (unsigned int i=0;i<100;i++){ for (unsigned int j=0;j<8;j++){ infile >> eff[j][i]; infile >> deff[j][i]; } } infile.close(); double phi_corr[8][100],dphi_corr[8][100]; for (unsigned int i=0;i<100;i++){ for (unsigned int j=0;j<8;j++){ phi_corr[j][i]=phi_3pi[j][i]/(eff[j][i]+0.0000001); dphi_corr[j][i]=phi_corr[j][i]*sqrt(dphi_3pi[j][i]*dphi_3pi[j][i] /(phi_corr[j][i]*phi_corr[j][i]) +deff[j][i]*deff[j][i] /((eff[j][i]+0.0000001) *(eff[j][i]+0.0000001))); // cout << phi_3pi[j][i] << endl; } } double t[100],dt[100]; for (unsigned int i=0;i<100;i++){ t[i]=0.02+0.04*i; dt[i]=0.02; } double tslopes[8]; double errtslopes[8]; double Egamma[8]={7.3,7.9,8.5,9.1,9.7,10.3,10.9,11.5}; double dEgamma[8]={0.3,0.3,0.3,0.3,0.3,0.3,0.3,0.3}; /* TGraphErrors *eg0=new TGraphErrors(100,t,eff[0]); eg0->Draw(); TGraphErrors *eg1=new TGraphErrors(100,t,eff[1]); eg1->Draw(); /* TGraphErrors *yg0=new TGraphErrors(100,t,phi_3pi[0],dt,dphi_3pi[0]); yg0->Draw(); TGraphErrors *yg1=new TGraphErrors(100,t,phi_3pi[1],dt,dphi_3pi[1]); yg1->Draw(); */ TCanvas *myc9=new TCanvas("myc9"); myc9->Draw(); TH2F *h9=new TH2F("h9","E_{#gamma}=8.20-8.80 GeV",100,0,1.4,100,0,12000.); h9->SetXTitle("-t [GeV^{2}]"); h9->SetYTitle("Yield [counts / 0.04 GeV^{2}"); h9->Draw(); TGraphErrors *yg2=new TGraphErrors(100,t,phi_3pi[2],dt,dphi_3pi[2]); yg2->Draw("same,p"); TCanvas *myc1=new TCanvas("myc1"); myc1->Draw(); TH2F *h1=new TH2F("h1","h1",100,0,1.4,100,0,20000.); h1->Draw(); TGraphErrors *g0=new TGraphErrors(100,t,phi_corr[0],dt,dphi_corr[0]); g0->Draw("same"); TF1 *f1=new TF1("f1","expo",0.1,1.); g0->Fit("f1","R"); cout << g0->GetFunction("f1")->GetParameter(1) << endl; cout << g0->GetFunction("f1")->GetParError(1) << endl; tslopes[0]=-g0->GetFunction("f1")->GetParameter(1); errtslopes[0]=g0->GetFunction("f1")->GetParError(1); TCanvas *myc2=new TCanvas("myc2"); myc2->Draw(); TH2F *h2=new TH2F("h2","h2",100,0,1.4,100,0,40000.); h2->Draw(); TGraphErrors *g1=new TGraphErrors(100,t,phi_corr[1],dt,dphi_corr[1]); g1->Draw("same"); g1->Fit("f1","R"); tslopes[1]=-g1->GetFunction("f1")->GetParameter(1); errtslopes[1]=g1->GetFunction("f1")->GetParError(1); TCanvas *myc3=new TCanvas("myc3"); myc3->Draw(); char mytitle[80]; sprintf(mytitle,"E_{#gamma}=%3.2f-%3.2f GeV",7.3+0.6*2-0.3,7.3+0.6*2+0.3); TH2F *h3=new TH2F("h3",mytitle,100,0,1.4,100,0,40000.); h3->SetXTitle("-t [GeV^{2}]"); h3->SetYTitle("Acceptance-corrected Yield [counts / 0.04 GeV^{2}"); h3->Draw(); TGraphErrors *g2=new TGraphErrors(100,t,phi_corr[2],dt,dphi_corr[2]); g2->Draw("same,p"); g2->Fit("f1","R"); tslopes[2]=-g2->GetFunction("f1")->GetParameter(1); errtslopes[2]=g2->GetFunction("f1")->GetParError(1); TCanvas *myc4=new TCanvas("myc4"); myc4->Draw(); TH2F *h4=new TH2F("h4","h4",100,0,1.4,100,0,20000.); h4->Draw(); TGraphErrors *g3=new TGraphErrors(100,t,phi_corr[3],dt,dphi_corr[3]); g3->Draw("same"); g3->Fit("f1","R"); tslopes[3]=-g3->GetFunction("f1")->GetParameter(1); errtslopes[3]=g3->GetFunction("f1")->GetParError(1); TCanvas *myc5=new TCanvas("myc5"); myc5->Draw(); TH2F *h5=new TH2F("h5","h5",100,0,1.4,100,0,20000.); h5->Draw(); TGraphErrors *g4=new TGraphErrors(100,t,phi_corr[4],dt,dphi_corr[4]); g4->Draw("same"); g4->Fit("f1","R"); tslopes[4]=-g4->GetFunction("f1")->GetParameter(1); errtslopes[4]=g4->GetFunction("f1")->GetParError(1); TCanvas *myc6=new TCanvas("myc6"); myc6->Draw(); TH2F *h6=new TH2F("h6","h6",100,0,1.4,100,0,20000.); h6->Draw(); TGraphErrors *g5=new TGraphErrors(100,t,phi_corr[5],dt,dphi_corr[5]); g5->Draw("same"); g5->Fit("f1","R"); tslopes[5]=-g5->GetFunction("f1")->GetParameter(1); errtslopes[5]=g5->GetFunction("f1")->GetParError(1); TCanvas *myc7=new TCanvas("myc7"); myc7->Draw(); TH2F *h7=new TH2F("h7","h7",100,0,1.4,100,0,20000.); h7->Draw(); TGraphErrors *g6=new TGraphErrors(100,t,phi_corr[6],dt,dphi_corr[6]); g6->Draw("same"); g6->Fit("f1","R"); tslopes[6]=-g6->GetFunction("f1")->GetParameter(1); errtslopes[6]=g6->GetFunction("f1")->GetParError(1); /* TCanvas *myc8=new TCanvas("myc8"); myc8->Draw(); TH2F *h8=new TH2F("h8","h8",100,0,1.4,100,0,20000.); h8->Draw(); TGraphErrors *g7=new TGraphErrors(100,t,phi_corr[7],dt,dphi_corr[7]); g7->Draw("same"); g7->Fit("f1","R"); */ TCanvas *myc10=new TCanvas("myc10"); myc10->Draw(); TH2F *h8=new TH2F("h8","t-slope parameter b (yield~e^{bt})",7,7.0,11.2,10,0,6.); h8->SetXTitle("E_{#gamma} [GeV]"); h8->SetYTitle("b [GeV^{-2}"); h8->Draw(); TGraphErrors *g8=new TGraphErrors(7,Egamma,tslopes,dEgamma,errtslopes); g8->Draw("same,p"); TCanvas *myc11=new TCanvas("myc11"); myc9->Draw(); TH2F *h11=new TH2F("h11","E_{#gamma}=8.20-8.80 GeV",100,0,1.4,100,0,0.3); h11->SetXTitle("-t [GeV^{2}]"); h11->SetYTitle("Acceptance"); h11->Draw(); TGraphErrors *eg2=new TGraphErrors(100,t,eff[2],dt,deff[2]); eg2->Draw("same,p"); }