// macro for comparision DPM model and E760 model with their uncertainty in LMD range #include #include #include //#include #include #include //#include #include //#include #include // macro to repoduce DPM fit #include #include #include #include #include #include #include #include #include #include #include #include #include #include "TVirtualFitter.h" using namespace std; double s_inv(double pl){// s double m_p = 0.938;//GeV/c barp mass double res = 2*TMath::Power(m_p,2) + 2*m_p*TMath::Sqrt(m_p*m_p+pl*pl); return res; } double p_cm(double pl){// Plab -> Pcm double m_p = 0.938;//GeV/c barp mass double s = s_inv(pl); double res = pl*m_p/sqrt(s); return res; } double t_cosCM(double cosCM, double pl){ // cos theta in CM -> t double pcm = p_cm(pl); double res = -2*TMath::Power(pcm,2)*(1-cosCM); return res; } double cosCM_t(double x, double pl){ // t -> cos theta in CM double t = -TMath::Abs(x); double pcm = p_cm(pl); double res = 1+0.5*t/TMath::Power(pcm,2); return res; } double thLAB_t(double pl, double t){ // t -> theta in LAB double cosTh1 = cosCM_t(t,pl); double ThCM = TMath::ACos(cosTh1); double res = 0.5*ThCM; // cout<<"t= "<SetMarkerStyle(21); grSIGT->SetMarkerSize(0.9); TF1 *fsigt = new TF1("fsigt","[0]+[1]*TMath::Power(x,[2])",mom[0]-0.5,mom[5]+0.5); fsigt->SetParNames("par0","par1","par2"); fsigt->SetParameter(0,34); fsigt->SetParameter(1,89.7); fsigt->SetParameter(2,-0.7); grSIGT->Fit(fsigt,"R"); TF1 *fsigt_dpm = new TF1("fsigt_dpm","[0]+[1]*TMath::Power(x,[2])",mom[0]-0.5,mom[5]+0.5); fsigt_dpm->SetParNames("par0","par1","par2"); fsigt_dpm->SetParameter(0,34.48); fsigt_dpm->SetParameter(1,89.7); fsigt_dpm->SetParameter(2,-0.7); fsigt_dpm->SetLineColor(4); //Create a TGraphErrors to hold the confidence intervals int np=1e4; // int np=1e3; TGraphErrors *grint_sigt = new TGraphErrors(np); TGraphErrors *grdiff_sigt = new TGraphErrors(np); // grint->SetTitle("Fitted line with .68 conf. band"); grint_sigt->SetTitle(""); grdiff_sigt->SetTitle(""); for (int i=0; iSetPoint(i, pcur, 0); double myfit = fsigt->Eval(pcur); double dpmfit = fsigt_dpm->Eval(pcur); double difffit = 100.*(dpmfit-myfit)/dpmfit; grdiff_sigt->SetPoint(i, pcur, difffit); } //Compute the confidence intervals at the x points of the created graph (TVirtualFitter::GetFitter())->GetConfidenceIntervals(grint_sigt,0.68); grint_sigt->SetLineColor(2); grint_sigt->SetLineWidth(3); grint_sigt->GetXaxis()->SetTitle("P_{lab}, GeV/c"); grint_sigt->GetYaxis()->SetTitle("#sigma_{T}"); grint_sigt->SetFillColor(2); grint_sigt->SetFillStyle(3005); //TLegend *leg_sigt = new TLegend(0.62,0.35,0.85,0.55); TLegend *leg_sigt = new TLegend(0.72,0.5,0.68,0.7); // TLegend *leg = new TLegend(0.22,0.15,0.37,0.35); leg_sigt->SetFillColor(0); leg_sigt->SetTextFont(42); leg_sigt->SetTextSize(0.05); leg_sigt->AddEntry(grSIGT,"data","ep"); leg_sigt->AddEntry(fsigt_dpm,"E760 fit","l"); leg_sigt->AddEntry(fsigt,"our fit","l"); c1.cd(1); grint_sigt->Draw("AP4"); grSIGT->Draw("psame"); fsigt_dpm->Draw("same"); leg_sigt->Draw(); c1.cd(4); //c1.cd(2); grdiff_sigt->GetXaxis()->SetTitle("P_{lab}, GeV/c"); grdiff_sigt->GetYaxis()->SetTitle("(E760-fit)/E760, %"); grdiff_sigt->SetMarkerStyle(20); grdiff_sigt->SetMarkerSize(0.5); grdiff_sigt->Draw("AP"); //B TGraphErrors *grB = new TGraphErrors(6,mom,b,0,errb); grB->SetMarkerStyle(21); grB->SetMarkerSize(0.9); TF1 *fb = new TF1("fb","[0]+[1]*x",mom[0]-0.5,mom[5]+0.5); fb->SetParNames("par0","par1"); fb->SetParameter(0,13.64); fb->SetParameter(1,-0.2); grB->Fit(fb,"R"); TF1 *fb_dpm = new TF1("fb_dpm","[0]+[1]*x",mom[0]-0.5,mom[5]+0.5); fb_dpm->SetParNames("par0","par1"); fb_dpm->SetParameter(0,13.64); fb_dpm->SetParameter(1,-0.2); fb_dpm->SetLineColor(4); //Create a TGraphErrors to hold the confidence intervals TGraphErrors *grint_b = new TGraphErrors(np); TGraphErrors *grdiff_b = new TGraphErrors(np); // grint->SetTitle("Fitted line with .95 conf. band"); grint_b->SetTitle(""); grdiff_b->SetTitle(""); for (int i=0; iSetPoint(i, pcur, 0); double myfit = fb->Eval(pcur); double dpmfit = fb_dpm->Eval(pcur); double difffit = 100.*(dpmfit-myfit)/dpmfit; grdiff_b->SetPoint(i, pcur, difffit); } //Compute the confidence intervals at the x points of the created graph (TVirtualFitter::GetFitter())->GetConfidenceIntervals(grint_b,0.68); grint_b->SetLineColor(kRed); grint_b->GetXaxis()->SetTitle("P_{lab}, GeV/c"); grint_b->GetYaxis()->SetTitle("b"); grint_b->SetFillColor(2); grint_b->SetFillStyle(3005); c1.cd(2); // c1.cd(1); grint_b->Draw("AP4"); grB->Draw("psame"); fb_dpm->Draw("same"); leg_sigt->Draw(); c1.cd(5); //c1.cd(2); grdiff_b->GetXaxis()->SetTitle("P_{lab}, GeV/c"); grdiff_b->GetYaxis()->SetTitle("(E760-fit)/E760, %"); grdiff_b->SetMarkerStyle(20); grdiff_b->SetMarkerSize(0.5); grdiff_b->Draw("AP"); //rho TGraphErrors *grRHO = new TGraphErrors(6,mom,rho,0,errrho); grRHO->SetMarkerStyle(21); grRHO->SetMarkerSize(0.9); TF1 *frho = new TF1("frho","[0]+[1]*x",mom[0]-0.5,mom[5]+0.5); frho->SetParNames("par0","par1"); frho->SetParameter(0,-0.12); frho->SetParameter(1,0.03); grRHO->Fit(frho,"R"); TF1 *frho_dpm = new TF1("frho_dpm","[0]+[1]*x",mom[0]-0.5,mom[5]+0.5); frho_dpm->SetParNames("par0","par1"); frho_dpm->SetParameter(0,-0.12); frho_dpm->SetParameter(1,0.03); frho_dpm->SetLineColor(4); //Create a TGraphErrors to hold the confidence intervals TGraphErrors *grint_rho = new TGraphErrors(np); TGraphErrors *grdiff_rho = new TGraphErrors(np); // grint->SetTitle("Fitted line with .95 conf. band"); grint_rho->SetTitle(""); grdiff_rho->SetTitle(""); for (int i=0; iSetPoint(i, pcur, 0); double myfit = frho->Eval(pcur); double dpmfit = frho_dpm->Eval(pcur); double difffit = 100.*(dpmfit-myfit)/dpmfit; grdiff_rho->SetPoint(i, pcur, difffit); // double y = grint_rho->GetErrorY(i); // double un = TMath::Sqrt(TMath::Power(dpmfit-myfit,2)+TMath::Power(y,2)); // cout<<"OLD: "<SetPointError(i, 0, un);//!TEST } //Compute the confidence intervals at the x points of the created graph (TVirtualFitter::GetFitter())->GetConfidenceIntervals(grint_rho,0.68); grint_rho->SetLineColor(kRed); grint_rho->GetXaxis()->SetTitle("P_{lab}, GeV/c"); grint_rho->GetYaxis()->SetTitle("#rho"); grint_rho->SetFillColor(2); grint_rho->SetFillStyle(3005); c1.cd(3); // c1.cd(1); grint_rho->Draw("AP4"); grRHO->Draw("psame"); frho_dpm->Draw("same"); leg_sigt->Draw(); c1.cd(6); // c1.cd(2); grdiff_rho->GetXaxis()->SetTitle("P_{lab}, GeV/c"); grdiff_rho->GetYaxis()->SetTitle("(E760-fit)/E760, %"); grdiff_rho->SetMarkerStyle(20); grdiff_rho->SetMarkerSize(0.5); grdiff_rho->SetMinimum(-9e2); grdiff_rho->SetMaximum(9e2); grdiff_rho->Draw("AP"); c1.SaveAs("E760_fit.pdf"); // CONTROL Plots // c1.SaveAs("E760_fit.root"); //[end] part1: fit energy dependence of E760 parameters --------------------- // part2: model params uncertanty at given Plab -------------------------- double par[4],errpar[4]; par[0] = fsigt->Eval(plab); par[1] = fb->Eval(plab); par[2] = frho->Eval(plab); parsigT = par[0]; parb = par[1]; parrho = par[2]; for(int i=0;iGetN();i++){ double xval,yval; grint_sigt->GetPoint(i,xval,yval); double errpar_0 = grint_sigt->GetErrorY(i); // if(fabs(xval-plab)<1e-2 && fabs(par[0]-yval)<2*errpar_0){ if(fabs(xval-plab)<1e-3){ errpar[0] = grint_sigt->GetErrorY(i); errpar[1] = grint_b->GetErrorY(i); errpar[2] = grint_rho->GetErrorY(i); } } errparsigT = errpar[0]; errparb = errpar[1]; errparrho = errpar[2]; // cout<<"E760-like Params for Plab="<SetMarkerStyle(21); grA1->SetMarkerSize(0.9); TF1 *fa1 = new TF1("fa1","[0]+[1]*exp(-x/[2])",mom[0]-0.5,mom[5]+0.5); fa1->SetParNames("par0","par1","par2"); fa1->SetParameter(0,115); fa1->SetParameter(1,650); fa1->SetParameter(2,4.08); grA1->Fit(fa1,"R"); TF1 *fa1_dpm = new TF1("fa1_dpm","[0]+[1]*exp(-x/[2])",mom[0]-0.5,mom[5]+0.5); fa1_dpm->SetParNames("par0","par1","par2"); fa1_dpm->SetParameter(0,115); fa1_dpm->SetParameter(1,650); fa1_dpm->SetParameter(2,4.08); fa1_dpm->SetLineColor(4); //Create a TGraphErrors to hold the confidence intervals int np=1e4; TGraphErrors *grint_a1 = new TGraphErrors(np); TGraphErrors *grdiff_a1 = new TGraphErrors(np); // grint->SetTitle("Fitted line with .95 conf. band"); grint_a1->SetTitle(""); grdiff_a1->SetTitle(""); for (int i=0; iSetPoint(i, pcur, 0); double myfit = fa1->Eval(pcur); double dpmfit = fa1_dpm->Eval(pcur); double difffit = 100.*(dpmfit-myfit)/dpmfit; grdiff_a1->SetPoint(i, pcur, difffit); } //Compute the confidence intervals at the x points of the created graph (TVirtualFitter::GetFitter())->GetConfidenceIntervals(grint_a1,0.68); grint_a1->SetLineColor(kRed); grint_a1->GetXaxis()->SetTitle("P_{lab}, GeV/c"); grint_a1->GetYaxis()->SetTitle("A_{1}"); grint_a1->SetFillColor(2); grint_a1->SetFillStyle(3005); c1.cd(1); grint_a1->Draw("AP4"); grA1->Draw("psame"); fa1_dpm->Draw("same"); TLegend *leg_a1 = new TLegend(0.42,0.35,0.65,0.55); // TLegend *leg = new TLegend(0.22,0.15,0.37,0.35); leg_a1->SetFillColor(0); leg_a1->SetTextFont(42); leg_a1->SetTextSize(0.05); leg_a1->AddEntry(grA1,"data","ep"); leg_a1->AddEntry(fa1_dpm,"DPM fit","l"); leg_a1->AddEntry(fa1,"our fit","l"); leg_a1->Draw(); c1.cd(5); grdiff_a1->GetXaxis()->SetTitle("P_{lab}, GeV/c"); grdiff_a1->GetYaxis()->SetTitle("(DPM-fit)/DPM, %"); grdiff_a1->SetMarkerStyle(20); grdiff_a1->SetMarkerSize(0.5); grdiff_a1->Draw("AP"); //A2 TGraphErrors *grA2 = new TGraphErrors(6,mom,A2,0,errA2); grA2->SetMarkerStyle(21); grA2->SetMarkerSize(0.9); TF1 *fa2 = new TF1("fa2","[0]+[1]*exp(-x/[2])",mom[0]-0.5,mom[5]+0.5); fa2->SetParNames("par0","par1","par2"); fa2->SetParameter(0,0.0687); fa2->SetParameter(1,0.307); fa2->SetParameter(2,2.367); grA2->Fit(fa2,"R"); TF1 *fa2_dpm = new TF1("fa2_dpm","[0]+[1]*exp(-x/[2])",mom[0]-0.5,mom[5]+0.5); fa2_dpm->SetParNames("par0","par1","par2"); fa2_dpm->SetParameter(0,0.0687); fa2_dpm->SetParameter(1,0.307); fa2_dpm->SetParameter(2,2.367); fa2_dpm->SetLineColor(4); //Create a TGraphErrors to hold the confidence intervals TGraphErrors *grint_a2 = new TGraphErrors(np); TGraphErrors *grdiff_a2 = new TGraphErrors(np); // grint->SetTitle("Fitted line with .95 conf. band"); grint_a2->SetTitle(""); grdiff_a2->SetTitle(""); for (int i=0; iSetPoint(i, pcur, 0); double myfit = fa2->Eval(pcur); double dpmfit = fa2_dpm->Eval(pcur); double difffit = 100.*(dpmfit-myfit)/dpmfit; grdiff_a2->SetPoint(i, pcur, difffit); } //Compute the confidence intervals at the x points of the created graph (TVirtualFitter::GetFitter())->GetConfidenceIntervals(grint_a2,0.68); grint_a2->SetLineColor(kRed); grint_a2->GetXaxis()->SetTitle("P_{lab}, GeV/c"); grint_a2->GetYaxis()->SetTitle("A_{2}"); grint_a2->SetFillColor(2); grint_a2->SetFillStyle(3005); c1.cd(2); grint_a2->Draw("AP4"); grA2->Draw("psame"); fa2_dpm->Draw("same"); leg_a1->Draw(); c1.cd(6); grdiff_a2->GetXaxis()->SetTitle("P_{lab}, GeV/c"); grdiff_a2->GetYaxis()->SetTitle("(DPM-fit)/DPM, %"); grdiff_a2->SetMarkerStyle(20); grdiff_a2->SetMarkerSize(0.5); grdiff_a2->Draw("AP"); //t2 TGraphErrors *grT2 = new TGraphErrors(6,mom,T2,0,errT2); grT2->SetMarkerStyle(21); grT2->SetMarkerSize(0.9); TF1 *ft2 = new TF1("ft2","[0]+[1]*exp(-x/[2])",mom[0]-0.5,mom[5]+0.5); ft2->SetParNames("par0","par1","par2"); ft2->SetParameter(0,-2.979); ft2->SetParameter(1,3.353); ft2->SetParameter(2,483.4); grT2->Fit(ft2,"R"); TF1 *ft2_dpm = new TF1("ft2_dpm","[0]+[1]*exp(-x/[2])",mom[0]-0.5,mom[5]+0.5); ft2_dpm->SetParNames("par0","par1","par2"); ft2_dpm->SetParameter(0,-2.979); ft2_dpm->SetParameter(1,3.353); ft2_dpm->SetParameter(2,483.4); ft2_dpm->SetLineColor(4); //Create a TGraphErrors to hold the confidence intervals TGraphErrors *grint_t2 = new TGraphErrors(np); TGraphErrors *grdiff_t2 = new TGraphErrors(np); // grint->SetTitle("Fitted line with .95 conf. band"); grint_t2->SetTitle(""); grdiff_t2->SetTitle(""); for (int i=0; iSetPoint(i, pcur, 0); double myfit = ft2->Eval(pcur); double dpmfit = ft2_dpm->Eval(pcur); double difffit = 100.*(dpmfit-myfit)/dpmfit; grdiff_t2->SetPoint(i, pcur, difffit); } //Compute the confidence intervals at the x points of the created graph (TVirtualFitter::GetFitter())->GetConfidenceIntervals(grint_t2,0.68); grint_t2->SetLineColor(kRed); grint_t2->GetXaxis()->SetTitle("P_{lab}, GeV/c"); grint_t2->GetYaxis()->SetTitle("t_{2}"); grint_t2->SetFillColor(2); grint_t2->SetFillStyle(3005); c1.cd(3); grint_t2->Draw("AP4"); grT2->Draw("psame"); ft2_dpm->Draw("same"); leg_a1->Draw(); c1.cd(7); grdiff_t2->GetXaxis()->SetTitle("P_{lab}, GeV/c"); grdiff_t2->GetYaxis()->SetTitle("(DPM-fit)/DPM, %"); grdiff_t2->SetMarkerStyle(20); grdiff_t2->SetMarkerSize(0.5); grdiff_t2->Draw("AP"); //A3 TGraphErrors *grA3 = new TGraphErrors(6,mom,A3,0,errA3); grA3->SetMarkerStyle(21); grA3->SetMarkerSize(0.9); TF1 *fa3 = new TF1("fa3","[0]+[1]*exp(-x/[2])",mom[0]-0.5,mom[5]+0.5); fa3->SetParNames("par0","par1","par2"); fa3->SetParameter(0,0.8372); fa3->SetParameter(1,39.53); fa3->SetParameter(2,0.765); grA3->Fit(fa3,"R"); TF1 *fa3_dpm = new TF1("fa3_dpm","[0]+[1]*exp(-x/[2])",mom[0]-0.5,mom[5]+0.5); fa3_dpm->SetParNames("par0","par1","par2"); fa3_dpm->SetParameter(0,0.8372); fa3_dpm->SetParameter(1,39.53); fa3_dpm->SetParameter(2,0.765); fa3_dpm->SetLineColor(4); //Create a TGraphErrors to hold the confidence intervals TGraphErrors *grint_a3 = new TGraphErrors(np); TGraphErrors *grdiff_a3 = new TGraphErrors(np); // grint->SetTitle("Fitted line with .95 conf. band"); grint_a3->SetTitle(""); grdiff_a3->SetTitle(""); for (int i=0; iSetPoint(i, pcur, 0); double myfit = fa3->Eval(pcur); double dpmfit = fa3_dpm->Eval(pcur); double difffit = 100.*(dpmfit-myfit)/dpmfit; grdiff_a3->SetPoint(i, pcur, difffit); } //Compute the confidence intervals at the x points of the created graph (TVirtualFitter::GetFitter())->GetConfidenceIntervals(grint_a3,0.68); grint_a3->SetLineColor(kRed); grint_a3->GetXaxis()->SetTitle("P_{lab}, GeV/c"); grint_a3->GetYaxis()->SetTitle("A_{3}"); grint_a3->SetFillColor(2); grint_a3->SetFillStyle(3005); c1.cd(4); grint_a3->Draw("AP4"); grA3->Draw("psame"); fa3_dpm->Draw("same"); leg_a1->Draw(); c1.cd(8); grdiff_a3->GetXaxis()->SetTitle("P_{lab}, GeV/c"); grdiff_a3->GetYaxis()->SetTitle("(DPM-fit)/DPM, %"); grdiff_a3->SetMarkerStyle(20); grdiff_a3->SetMarkerSize(0.5); grdiff_a3->Draw("AP"); c1.SaveAs("DPM_fit.pdf"); //CONTROL plots //[end] part1: fit energy dependence of DPM parameters ------------------- //part2: model params uncertanty at given Plab --------------------------- double par[5],errpar[5]; par[0] = fa1->Eval(plab); par[1] = fa2->Eval(plab); par[2] = fa3->Eval(plab); par[3] = 0.0899; errpar[3] = 0.010; par[4] = ft2->Eval(plab); para1 = par[0]; para2 = par[1]; para3 = par[2]; part1 = par[3]; part2 = par[4]; for(int i=0;iGetN();i++){ double xval,yval; grint_a1->GetPoint(i,xval,yval); double errpar_0 = grint_a1->GetErrorY(i); // if(fabs(xval-plab)<1e-1 && fabs(par[0]-yval)<1e-1){ // cout<GetPoint(i,xval,yval); // cout<GetPoint(i,xval,yval); // cout<GetErrorY(i); errpar[1] = grint_a2->GetErrorY(i); errpar[2] = grint_a3->GetErrorY(i); errpar[4] = grint_t2->GetErrorY(i); } // grint_a1->Print(); } cout<<"DPM Params for Plab="<SetMarkerStyle(21); grA1->SetMarkerSize(0.9); TF1 *fa1 = new TF1("fa1","[0]+[1]*exp(-x/[2])",mom[0]-1.5,mom[3]+1.5); fa1->SetParNames("par0","par1","par2"); fa1->SetParameter(0,115); fa1->SetParameter(1,650); fa1->SetParameter(2,4.08); grA1->Fit(fa1,"R"); TF1 *fa1_dpm = new TF1("fa1_dpm","[0]+[1]*exp(-x/[2])",mom[0]-1.5,mom[3]+1.5); fa1_dpm->SetParNames("par0","par1","par2"); fa1_dpm->SetParameter(0,115); fa1_dpm->SetParameter(1,650); fa1_dpm->SetParameter(2,4.08); fa1_dpm->SetLineColor(4); //Create a TGraphErrors to hold the confidence intervals int np=1e4; TGraphErrors *grint_a1 = new TGraphErrors(np); TGraphErrors *grdiff_a1 = new TGraphErrors(np); // grint->SetTitle("Fitted line with .95 conf. band"); grint_a1->SetTitle(""); grdiff_a1->SetTitle(""); for (int i=0; iSetPoint(i, pcur, 0); double myfit = fa1->Eval(pcur); double dpmfit = fa1_dpm->Eval(pcur); double difffit = 100.*(dpmfit-myfit)/dpmfit; grdiff_a1->SetPoint(i, pcur, difffit); } // Compute the confidence intervals at the x points of the created graph (TVirtualFitter::GetFitter())->GetConfidenceIntervals(grint_a1,0.68); grint_a1->SetLineColor(kRed); grint_a1->GetXaxis()->SetTitle("P_{lab}, GeV/c"); grint_a1->GetYaxis()->SetTitle("A_{1}"); grint_a1->SetFillColor(2); grint_a1->SetFillStyle(3005); c1.cd(1); grint_a1->Draw("AP4"); grA1->Draw("psame"); // grA1->Draw("AP"); fa1_dpm->Draw("same"); TLegend *leg_a1 = new TLegend(0.42,0.35,0.65,0.55); // TLegend *leg = new TLegend(0.22,0.15,0.37,0.35); leg_a1->SetFillColor(0); leg_a1->SetTextFont(42); leg_a1->SetTextSize(0.05); leg_a1->AddEntry(grA1,"data","ep"); leg_a1->AddEntry(fa1_dpm,"DPM fit","l"); leg_a1->AddEntry(fa1,"our fit","l"); leg_a1->Draw(); c1.cd(5); grdiff_a1->GetXaxis()->SetTitle("P_{lab}, GeV/c"); grdiff_a1->GetYaxis()->SetTitle("(DPM-fit)/DPM, %"); grdiff_a1->SetMarkerStyle(20); grdiff_a1->SetMarkerSize(0.5); grdiff_a1->Draw("AP"); //A2 TGraphErrors *grA2 = new TGraphErrors(5,mom,A2,0,errA2); grA2->SetMarkerStyle(21); grA2->SetMarkerSize(0.9); TF1 *fa2 = new TF1("fa2","[0]+[1]*exp(-x/[2])",mom[0]-1.5,mom[3]+1.5); fa2->SetParNames("par0","par1","par2"); fa2->SetParameter(0,0.0687); fa2->SetParameter(1,0.307); fa2->SetParameter(2,2.367); grA2->Fit(fa2,"R"); TF1 *fa2_dpm = new TF1("fa2_dpm","[0]+[1]*exp(-x/[2])",mom[0]-1.5,mom[3]+1.5); fa2_dpm->SetParNames("par0","par1","par2"); fa2_dpm->SetParameter(0,0.0687); fa2_dpm->SetParameter(1,0.307); fa2_dpm->SetParameter(2,2.367); fa2_dpm->SetLineColor(4); //Create a TGraphErrors to hold the confidence intervals TGraphErrors *grint_a2 = new TGraphErrors(np); TGraphErrors *grdiff_a2 = new TGraphErrors(np); // grint->SetTitle("Fitted line with .95 conf. band"); grint_a2->SetTitle(""); grdiff_a2->SetTitle(""); for (int i=0; iSetPoint(i, pcur, 0); double myfit = fa2->Eval(pcur); double dpmfit = fa2_dpm->Eval(pcur); double difffit = 100.*(dpmfit-myfit)/dpmfit; grdiff_a2->SetPoint(i, pcur, difffit); } //Compute the confidence intervals at the x points of the created graph (TVirtualFitter::GetFitter())->GetConfidenceIntervals(grint_a2,0.68); grint_a2->SetLineColor(kRed); grint_a2->GetXaxis()->SetTitle("P_{lab}, GeV/c"); grint_a2->GetYaxis()->SetTitle("A_{2}"); grint_a2->SetFillColor(2); grint_a2->SetFillStyle(3005); c1.cd(2); grint_a2->Draw("AP4"); grA2->Draw("psame"); fa2_dpm->Draw("same"); leg_a1->Draw(); c1.cd(6); grdiff_a2->GetXaxis()->SetTitle("P_{lab}, GeV/c"); grdiff_a2->GetYaxis()->SetTitle("(DPM-fit)/DPM, %"); grdiff_a2->SetMarkerStyle(20); grdiff_a2->SetMarkerSize(0.5); grdiff_a2->Draw("AP"); //t2 TGraphErrors *grT2 = new TGraphErrors(5,mom,T2,0,errT2); grT2->SetMarkerStyle(21); grT2->SetMarkerSize(0.9); TF1 *ft2 = new TF1("ft2","[0]+[1]*exp(-x/[2])",mom[0]-1.5,mom[3]+1.5); ft2->SetParNames("par0","par1","par2"); ft2->SetParameter(0,-2.979); ft2->SetParameter(1,3.353); ft2->SetParameter(2,483.4); grT2->Fit(ft2,"R"); TF1 *ft2_dpm = new TF1("ft2_dpm","[0]+[1]*exp(-x/[2])",mom[0]-1.5,mom[3]+1.5); ft2_dpm->SetParNames("par0","par1","par2"); ft2_dpm->SetParameter(0,-2.979); ft2_dpm->SetParameter(1,3.353); ft2_dpm->SetParameter(2,483.4); ft2_dpm->SetLineColor(4); //Create a TGraphErrors to hold the confidence intervals TGraphErrors *grint_t2 = new TGraphErrors(np); TGraphErrors *grdiff_t2 = new TGraphErrors(np); // grint->SetTitle("Fitted line with .95 conf. band"); grint_t2->SetTitle(""); grdiff_t2->SetTitle(""); for (int i=0; iSetPoint(i, pcur, 0); double myfit = ft2->Eval(pcur); double dpmfit = ft2_dpm->Eval(pcur); double difffit = 100.*(dpmfit-myfit)/dpmfit; grdiff_t2->SetPoint(i, pcur, difffit); } //Compute the confidence intervals at the x points of the created graph (TVirtualFitter::GetFitter())->GetConfidenceIntervals(grint_t2,0.68); grint_t2->SetLineColor(kRed); grint_t2->GetXaxis()->SetTitle("P_{lab}, GeV/c"); grint_t2->GetYaxis()->SetTitle("t_{2}"); grint_t2->SetFillColor(2); grint_t2->SetFillStyle(3005); c1.cd(3); grint_t2->Draw("AP4"); grT2->Draw("psame"); ft2_dpm->Draw("same"); leg_a1->Draw(); c1.cd(7); grdiff_t2->GetXaxis()->SetTitle("P_{lab}, GeV/c"); grdiff_t2->GetYaxis()->SetTitle("(DPM-fit)/DPM, %"); grdiff_t2->SetMarkerStyle(20); grdiff_t2->SetMarkerSize(0.5); grdiff_t2->Draw("AP"); //A3 TGraphErrors *grA3 = new TGraphErrors(5,mom,A3,0,errA3); grA3->SetMarkerStyle(21); grA3->SetMarkerSize(0.9); TF1 *fa3 = new TF1("fa3","[0]+[1]*exp(-x/[2])",mom[0]-1.5,mom[3]+1.5); fa3->SetParNames("par0","par1","par2"); fa3->SetParameter(0,0.8372); fa3->SetParameter(1,39.53); fa3->SetParameter(2,0.765); grA3->Fit(fa3,"R"); TF1 *fa3_dpm = new TF1("fa3_dpm","[0]+[1]*exp(-x/[2])",mom[0]-1.5,mom[3]+1.5); fa3_dpm->SetParNames("par0","par1","par2"); fa3_dpm->SetParameter(0,0.8372); fa3_dpm->SetParameter(1,39.53); fa3_dpm->SetParameter(2,0.765); fa3_dpm->SetLineColor(4); //Create a TGraphErrors to hold the confidence intervals TGraphErrors *grint_a3 = new TGraphErrors(np); TGraphErrors *grdiff_a3 = new TGraphErrors(np); // grint->SetTitle("Fitted line with .95 conf. band"); grint_a3->SetTitle(""); grdiff_a3->SetTitle(""); for (int i=0; iSetPoint(i, pcur, 0); double myfit = fa3->Eval(pcur); double dpmfit = fa3_dpm->Eval(pcur); double difffit = 100.*(dpmfit-myfit)/dpmfit; grdiff_a3->SetPoint(i, pcur, difffit); } //Compute the confidence intervals at the x points of the created graph (TVirtualFitter::GetFitter())->GetConfidenceIntervals(grint_a3,0.68); grint_a3->SetLineColor(kRed); grint_a3->GetXaxis()->SetTitle("P_{lab}, GeV/c"); grint_a3->GetYaxis()->SetTitle("A_{3}"); grint_a3->SetFillColor(2); grint_a3->SetFillStyle(3005); c1.cd(4); grint_a3->Draw("AP4"); grA3->Draw("psame"); fa3_dpm->Draw("same"); leg_a1->Draw(); c1.cd(8); grdiff_a3->GetXaxis()->SetTitle("P_{lab}, GeV/c"); grdiff_a3->GetYaxis()->SetTitle("(DPM-fit)/DPM, %"); grdiff_a3->SetMarkerStyle(20); grdiff_a3->SetMarkerSize(0.5); grdiff_a3->Draw("AP"); c1.SaveAs("DPM_fit.pdf"); //CONTROL plots //[end] part1: fit energy dependence of DPM parameters --------------------- //part2: model params uncertanty at given Plab --------------------------- double par[5],errpar[5]; par[0] = fa1->Eval(plab); par[1] = fa2->Eval(plab); par[2] = fa3->Eval(plab); par[3] = 0.0899; errpar[3] = 0.010; par[4] = ft2->Eval(plab); para1 = par[0]; para2 = par[1]; para3 = par[2]; part1 = par[3]; part2 = par[4]; for(int i=0;iGetN();i++){ double xval,yval; grint_a1->GetPoint(i,xval,yval); double errpar_0 = grint_a1->GetErrorY(i); // if(fabs(xval-plab)<1e-1 && fabs(par[0]-yval)<1e-1){ // cout<GetPoint(i,xval,yval); // cout<GetPoint(i,xval,yval); // cout<GetErrorY(i); errpar[1] = grint_a2->GetErrorY(i); errpar[2] = grint_a3->GetErrorY(i); errpar[4] = grint_t2->GetErrorY(i); } // grint_a1->Print(); } cout<<"DPM Params for Plab="< t for(int it=0;it<95;it++){ double cosCm = p7011_d3x1y3_xval[it]; double t_val = t_cosCM(cosCm, plab); p7011_d3x1y3_xval[it] = fabs(t_val); } //step 2: dsig/dOmega -> dsig/dt for(int it=0;it<95;it++){ double ds_do = p7011_d3x1y3_yval[it]; double ds_dt_val = ds_dt(ds_do,plab); p7011_d3x1y3_yval[it] = ds_dt_val; double err_ds_do = p7011_d3x1y3_yerr[it]; double err_ds_dt_val = ds_dt(err_ds_do,plab); p7011_d3x1y3_yerr[it] = err_ds_dt_val; } //---------------------------------------- int p7011_d3x1y3_numpoints = 95; expdata = TGraphErrors(p7011_d3x1y3_numpoints, p7011_d3x1y3_xval, p7011_d3x1y3_yval,0,p7011_d3x1y3_yerr); return 0; } if(fabs(plab-1.6)<1e-3){ //http://durpdg.dur.ac.uk/view/ins109426 cout<<"Data from EISENHANDLER 1976 — Differential Cross-Sections for anti-Proton-Proton Elastic Scattering Between 0.69-GeV/c and 2.43-GeV/c, added 4% system.error!"< t for(int it=0;it<95;it++){ double cosCm = p7011_d3x1y4_xval[it]; double t_val = t_cosCM(cosCm, plab); p7011_d3x1y4_xval[it] = fabs(t_val); } //step 2: dsig/dOmega -> dsig/dt for(int it=0;it<95;it++){ double ds_do = p7011_d3x1y4_yval[it]; double ds_dt_val = ds_dt(ds_do,plab); p7011_d3x1y4_yval[it] = ds_dt_val; double err_ds_do = p7011_d3x1y4_yerr[it]; double err_ds_dt_val = ds_dt(err_ds_do,plab); p7011_d3x1y4_yerr[it] = err_ds_dt_val; } //---------------------------------------- int p7011_d3x1y4_numpoints = 95; expdata = TGraphErrors(p7011_d3x1y4_numpoints, p7011_d3x1y4_xval, p7011_d3x1y4_yval,0, p7011_d3x1y4_yerr); return 0; } if(fabs(plab-1.71)<1e-3){ //http://durpdg.dur.ac.uk/view/ins109426 cout<<"Data from EISENHANDLER 1976 — Differential Cross-Sections for anti-Proton-Proton Elastic Scattering Between 0.69-GeV/c and 2.43-GeV/c, added 4% system.error!"< t for(int it=0;it<95;it++){ double cosCm = p7011_d4x1y1_xval[it]; double t_val = t_cosCM(cosCm, plab); p7011_d4x1y1_xval[it] = fabs(t_val); } //step 2: dsig/dOmega -> dsig/dt for(int it=0;it<95;it++){ double ds_do = p7011_d4x1y1_yval[it]; double ds_dt_val = ds_dt(ds_do,plab); p7011_d4x1y1_yval[it] = ds_dt_val; double err_ds_do = p7011_d4x1y1_yerr[it]; double err_ds_dt_val = ds_dt(err_ds_do,plab); p7011_d4x1y1_yerr[it] = err_ds_dt_val; } //---------------------------------------- int p7011_d4x1y1_numpoints = 95; expdata = TGraphErrors(p7011_d4x1y1_numpoints, p7011_d4x1y1_xval, p7011_d4x1y1_yval, 0, p7011_d4x1y1_yerr); return 0; } if(fabs(plab-1.81)<1e-4){ //http://durpdg.dur.ac.uk/view/ins109426 cout<<"Data from EISENHANDLER 1976 — Differential Cross-Sections for anti-Proton-Proton Elastic Scattering Between 0.69-GeV/c and 2.43-GeV/c, added 4% system.error!"< t for(int it=0;it<95;it++){ double cosCm = p7011_d4x1y2_xval[it]; double t_val = t_cosCM(cosCm, plab); p7011_d4x1y2_xval[it] = fabs(t_val); } //step 2: dsig/dOmega -> dsig/dt for(int it=0;it<95;it++){ double ds_do = p7011_d4x1y2_yval[it]; double ds_dt_val = ds_dt(ds_do,plab); p7011_d4x1y2_yval[it] = ds_dt_val; double err_ds_do = p7011_d4x1y2_yerr[it]; double err_ds_dt_val = ds_dt(err_ds_do,plab); p7011_d4x1y2_yerr[it] = err_ds_dt_val; } //---------------------------------------- int p7011_d4x1y2_numpoints = 95; expdata = TGraphErrors(p7011_d4x1y2_numpoints, p7011_d4x1y2_xval, p7011_d4x1y2_yval, 0, p7011_d4x1y2_yerr); return 0; } if(fabs(plab-1.86)<1e-4){ //http://durpdg.dur.ac.uk/view/ins109426 cout<<"Data from EISENHANDLER 1976 — Differential Cross-Sections for anti-Proton-Proton Elastic Scattering Between 0.69-GeV/c and 2.43-GeV/c, added 4% system.error!"< t for(int it=0;it<95;it++){ double cosCm = p7011_d4x1y3_xval[it]; double t_val = t_cosCM(cosCm, plab); p7011_d4x1y3_xval[it] = fabs(t_val); } //step 2: dsig/dOmega -> dsig/dt for(int it=0;it<95;it++){ double ds_do = p7011_d4x1y3_yval[it]; double ds_dt_val = ds_dt(ds_do,plab); p7011_d4x1y3_yval[it] = ds_dt_val; double err_ds_do = p7011_d4x1y3_yerr[it]; double err_ds_dt_val = ds_dt(err_ds_do,plab); p7011_d4x1y3_yerr[it] = err_ds_dt_val; } //---------------------------------------- int p7011_d4x1y3_numpoints = 95; expdata = TGraphErrors(p7011_d4x1y3_numpoints, p7011_d4x1y3_xval, p7011_d4x1y3_yval,0,p7011_d4x1y3_yerr); return 0; } if(fabs(plab-1.91)<1e-4){ //http://durpdg.dur.ac.uk/view/ins109426 cout<<"Data from EISENHANDLER 1976 — Differential Cross-Sections for anti-Proton-Proton Elastic Scattering Between 0.69-GeV/c and 2.43-GeV/c, added 4% system.error!"< t for(int it=0;it<95;it++){ double cosCm = p7011_d4x1y4_xval[it]; double t_val = t_cosCM(cosCm, plab); p7011_d4x1y4_xval[it] = fabs(t_val); } //step 2: dsig/dOmega -> dsig/dt for(int it=0;it<95;it++){ double ds_do = p7011_d4x1y4_yval[it]; double ds_dt_val = ds_dt(ds_do,plab); p7011_d4x1y4_yval[it] = ds_dt_val; double err_ds_do = p7011_d4x1y4_yerr[it]; double err_ds_dt_val = ds_dt(err_ds_do,plab); p7011_d4x1y4_yerr[it] = err_ds_dt_val; } //---------------------------------------- int p7011_d4x1y4_numpoints = 95; expdata = TGraphErrors(p7011_d4x1y4_numpoints, p7011_d4x1y4_xval, p7011_d4x1y4_yval,0,p7011_d4x1y4_yerr); return 0; } if(fabs(plab-2.01)<1e-4){ //http://durpdg.dur.ac.uk/view/ins109426 cout<<"Data from EISENHANDLER 1976 — Differential Cross-Sections for anti-Proton-Proton Elastic Scattering Between 0.69-GeV/c and 2.43-GeV/c, added 4% system.error!"< t for(int it=0;it<95;it++){ double cosCm = p7011_d5x1y1_xval[it]; double t_val = t_cosCM(cosCm, plab); p7011_d5x1y1_xval[it] = fabs(t_val); } //step 2: dsig/dOmega -> dsig/dt for(int it=0;it<95;it++){ double ds_do = p7011_d5x1y1_yval[it]; double ds_dt_val = ds_dt(ds_do,plab); p7011_d5x1y1_yval[it] = ds_dt_val; double err_ds_do = p7011_d5x1y1_yerr[it]; double err_ds_dt_val = ds_dt(err_ds_do,plab); p7011_d5x1y1_yerr[it] = err_ds_dt_val; } //---------------------------------------- int p7011_d5x1y1_numpoints = 95; expdata = TGraphErrors(p7011_d5x1y1_numpoints, p7011_d5x1y1_xval, p7011_d5x1y1_yval,0,p7011_d5x1y1_yerr); return 0; } if(fabs(plab-2.12)<1e-4){ //http://durpdg.dur.ac.uk/view/ins109426 cout<<"Data from EISENHANDLER 1976 — Differential Cross-Sections for anti-Proton-Proton Elastic Scattering Between 0.69-GeV/c and 2.43-GeV/c, added 4% system.error!"< t for(int it=0;it<95;it++){ double cosCm = p7011_d5x1y2_xval[it]; double t_val = t_cosCM(cosCm, plab); p7011_d5x1y2_xval[it] = fabs(t_val); } //step 2: dsig/dOmega -> dsig/dt for(int it=0;it<95;it++){ double ds_do = p7011_d5x1y2_yval[it]; double ds_dt_val = ds_dt(ds_do,plab); p7011_d5x1y2_yval[it] = ds_dt_val; double err_ds_do = p7011_d5x1y2_yerr[it]; double err_ds_dt_val = ds_dt(err_ds_do,plab); p7011_d5x1y2_yerr[it] = err_ds_dt_val; } //---------------------------------------- int p7011_d5x1y2_numpoints = 95; expdata = TGraphErrors(p7011_d5x1y2_numpoints, p7011_d5x1y2_xval, p7011_d5x1y2_yval,0, p7011_d5x1y2_yerr); return 0; } if(fabs(plab-2.23)<1e-4){ //http://durpdg.dur.ac.uk/view/ins109426 cout<<"Data from EISENHANDLER 1976 — Differential Cross-Sections for anti-Proton-Proton Elastic Scattering Between 0.69-GeV/c and 2.43-GeV/c, added 4% system.error!"< t for(int it=0;it<95;it++){ double cosCm = p7011_d5x1y3_xval[it]; double t_val = t_cosCM(cosCm, plab); p7011_d5x1y3_xval[it] = fabs(t_val); } //step 2: dsig/dOmega -> dsig/dt for(int it=0;it<95;it++){ double ds_do = p7011_d5x1y3_yval[it]; double ds_dt_val = ds_dt(ds_do,plab); p7011_d5x1y3_yval[it] = ds_dt_val; double err_ds_do = p7011_d5x1y3_yerr[it]; double err_ds_dt_val = ds_dt(err_ds_do,plab); p7011_d5x1y3_yerr[it] = err_ds_dt_val; } //---------------------------------------- // int p7011_d5x1y3_numpoints = 95; int p7011_d5x1y3_numpoints = 86; expdata = TGraphErrors(p7011_d5x1y3_numpoints, p7011_d5x1y3_xval, p7011_d5x1y3_yval, 0, p7011_d5x1y3_yerr); return 0; } if(fabs(plab-2.43)<1e-4){ //http://durpdg.dur.ac.uk/view/ins109426 cout<<"Data from EISENHANDLER 1976 — Differential Cross-Sections for anti-Proton-Proton Elastic Scattering Between 0.69-GeV/c and 2.43-GeV/c, added 4% system.error!"< t for(int it=0;it<94;it++){ double cosCm = p7011_d6x1y1_xval[it]; double t_val = t_cosCM(cosCm, plab); p7011_d6x1y1_xval[it] = fabs(t_val); } //step 2: dsig/dOmega -> dsig/dt for(int it=0;it<94;it++){ double ds_do = p7011_d6x1y1_yval[it]; double ds_dt_val = ds_dt(ds_do,plab); p7011_d6x1y1_yval[it] = ds_dt_val; double err_ds_do = p7011_d6x1y1_yerr[it]; double err_ds_dt_val = ds_dt(err_ds_do,plab); p7011_d6x1y1_yerr[it] = err_ds_dt_val; } //---------------------------------------- // int p7011_d6x1y1_numpoints = 94; int p7011_d6x1y1_numpoints = 81; expdata = TGraphErrors(p7011_d6x1y1_numpoints, p7011_d6x1y1_xval, p7011_d6x1y1_yval, 0, p7011_d6x1y1_yerr); return 0; } if(fabs(plab-2.33)<1e-4 && sampl==0){ //http://durpdg.dur.ac.uk/view/ins109426 cout<<"Data from EISENHANDLER 1976 — Differential Cross-Sections for anti-Proton-Proton Elastic Scattering Between 0.69-GeV/c and 2.43-GeV/c, added 4% system.error!"< t for(int it=0;it<94;it++){ double cosCm = p7011_d5x1y4_xval[it]; double t_val = t_cosCM(cosCm, plab); p7011_d5x1y4_xval[it] = fabs(t_val); } //step 2: dsig/dOmega -> dsig/dt for(int it=0;it<94;it++){ double ds_do = p7011_d5x1y4_yval[it]; double ds_dt_val = ds_dt(ds_do,plab); p7011_d5x1y4_yval[it] = ds_dt_val; double err_ds_do = p7011_d5x1y4_yerr[it]; double err_ds_dt_val = ds_dt(err_ds_do,plab); p7011_d5x1y4_yerr[it] = err_ds_dt_val; } //---------------------------------------- // int p7011_d5x1y4_numpoints = 95; int p7011_d5x1y4_numpoints = 84; expdata = TGraphErrors(p7011_d5x1y4_numpoints, p7011_d5x1y4_xval, p7011_d5x1y4_yval,0,p7011_d5x1y4_yerr); return 0; } if(fabs(plab-2.33)<1e-4 && sampl==1){ //http://durpdg.dur.ac.uk/view/ins93330 cout<<"Data from CRAWLEY 1973 — Anti-p p elastic scattering at 2.33 gev/c, added system.error 2.7%"< mb p7064_d5x1y1_yval[it] *=1e-3;//mub -> mb } int p7064_d5x1y1_numpoints = 86; expdata = TGraphErrors(p7064_d5x1y1_numpoints, p7064_d5x1y1_xval, p7064_d5x1y1_yval,0,p7064_d5x1y1_yerr); return 0; } if(fabs(plab-3.55)<1e-4){ //http://durpdg.dur.ac.uk/view/ins56106 cout<<"Data from BAKER 1969 — Anti-proton-proton elastic scattering at 3.55 gev/c , added system.error 20%"<Macro("$VMCWORKDIR/macro/lmd/Anastasia/tests/ModelUncert/rootlogon.C"); double zoomLim=0.26; // double zoomLim=0.0062; //double zoomLim=0.5; //double zoomLim=1.; // double plab = 6.2; // double plab = 8.0; //Compares DPM and E760 models with Data. //Models uncertanties are calculated from fit of energy dependence of model parameters //following data is included: //from http://durpdg.dur.ac.uk/view/ins109426 //double plab = 1.5; // double plab = 1.6; //double plab = 1.71; //double plab = 1.81; //double plab = 1.86; // double plab = 1.91; // double plab = 2.01; //double plab = 2.12; // double plab = 2.23; // double plab = 2.43; // double plab = 2.33; //from http://durpdg.dur.ac.uk/view/ins93330 // double plab = 2.33; //from http://durpdg.dur.ac.uk/view/ins99005 //double plab = 1.776; //double plab = 2.607; //from http://durpdg.dur.ac.uk/view/ins93404 //double plab = 2.85; //from http://durpdg.dur.ac.uk/view/ins92992 //double plab = 3.0; // double plab = 3.65; //double plab = 5.0; //from http://durpdg.dur.ac.uk/view/ins83926 //double plab = 5.0; //from http://durpdg.dur.ac.uk/view/ins56106 // double plab = 3.55; //from http://durpdg.dur.ac.uk/view/ins431921 //double plab = 3.7; // double plab = 4.07; //double plab = 5.6; //double plab = 5.72; //double plab = 5.94; //double plab = 6.23; //from http://durpdg.dur.ac.uk/view/ins120467 // double plab = 4.2; //double plab = 6.0; //double plab = 8.0; // double plab = 10.0; //from http://durpdg.dur.ac.uk/view/ins124704 //double plab = 8.0; //double plab = 16.0; //from http://durpdg.dur.ac.uk/view/ins99557 //double plab = 6.2; //from http://durpdg.dur.ac.uk/view/ins2106 // double plab = 5.7; //from http://durpdg.dur.ac.uk/view/ins100639 //double plab = 10.4; //from http://durpdg.dur.ac.uk/view/ins133174 //double plab = 10.1; //from http://durpdg.dur.ac.uk/view/ins56380 //plab given in range. middle value is taken! //double plab = 8.0; double plab = 16.0; // //one data sample TGraphErrors expdata; //int resData = ExpDataBase(plab,expdata); // expdata.Print(); // // //2nd data sample // TGraphErrors expdata; int resData = ExpDataBase(plab,expdata,2); // if(resData!=0) return 1; // resData = ExpDataBase(plab,expdata1,0); //E760-like model with sigmaTot, B and rho parameters; double parsigT,parb,parrho; double errparsigT,errparb,errparrho; E760fit(plab,parsigT,parb,parrho, errparsigT,errparb, errparrho); double parE760[4],errparE760[4]; //par[3]={sigT,b,rho,dsig/dt} parE760[0] = parsigT; parE760[1] = parb; parE760[2] = parrho; errparE760[0] = errparsigT; errparE760[1] = errparb; errparE760[2] = errparrho; // cout< paraE760(new PndLmdE760LikeModelParametrization(modelE760.getModelParameterSet())); // shared_ptr para(new PndLmdE760ModelParametrization(modelE760.getModelParameterSet())); modelE760.getModelParameterHandler().registerParametrizations( modelE760.getModelParameterSet(), paraE760); modelE760.getModelParameterSet().setModelParameterValue("p_lab", plab); modelE760.getModelParameterSet().setModelParameterValue("luminosity", 1); ((Model1D*) &modelE760)->init(); cout< para( new PndLmdDPMModelParametrization(modelDPM.getModelParameterSet())); modelDPM.getModelParameterHandler().registerParametrizations( modelDPM.getModelParameterSet(), para); modelDPM.getModelParameterSet().setModelParameterValue("p_lab", plab); modelDPM.getModelParameterSet().setModelParameterValue("luminosity", 1); ((Model1D*) &modelDPM)->init(); Double_t* trange_exp = expdata.GetX(); int Nexppoints = expdata.GetN(); //if data in t ------------- double t_dw = trange_exp[0]; double t_up = trange_exp[Nexppoints-1]; //------------------------- // //if data for cos(theta) --- //PndLmdLumiHelper *lmd_help = new PndLmdLumiHelper(); // //radians = degrees x PI / 180 // double th_dw = TMath::Pi()*TMath::ACos(trange_exp[Nexppoints-1])/180.; // double t_dw = (-1)*(lmd_help->getMomentumTransferFromTheta(plab, th_dw)); // double th_up = TMath::Pi()*TMath::ACos(trange_exp[0])/180.; // double t_up = (-1)*(lmd_help->getMomentumTransferFromTheta(plab, th_up)); // //-------------------------- const int nst = 7*Nexppoints; //const int nst = 10; double csDPM_val[nst], csDPM_uncert[nst];//dpm double csE760_val[nst], csE760_uncert[nst];//dpm double th_val[nst]; double t_val[nst]; for(int i=0;igetMomentumTransferFromTheta(plab, th_val[i])); // cout<<" t_test "<getMomentumTransferFromTheta(plab, th_cur)); // //-------------------------- double dpm_val = modelDPM.getRawFullElastic(&t_cur); double dpm_un = DfDPM(t_cur,parDPM,errparDPM); // double dpm_un = 0; diffDPM[i] = 100.*(cs_exp[i]-dpm_val)/cs_exp[i]; double un1 = 100.*dpm_val*errcs_exp[i]/(cs_exp[i]*cs_exp[i]); double un2 = 100.*dpm_un/cs_exp[i]; undiffDPM[i] = sqrt(un1*un1+un2*un2); double e760_val = modelE760.getRawRhoBSigtotFullElastic(&t_cur); double e760_un = DfE760(t_cur,parE760,errparE760); diffE760[i] = 100.*(cs_exp[i]-e760_val)/cs_exp[i]; un1 = 100.*e760_val*errcs_exp[i]/(cs_exp[i]*cs_exp[i]); un2 = 100.*e760_un/cs_exp[i]; undiffE760[i] = sqrt(un1*un1+un2*un2); cout<SetHeader(head); leg->SetFillColor(0); leg->SetTextFont(42); leg->SetTextSize(0.05); leg->AddEntry(gr_csDPM_t,"DPM","lpe"); leg->AddEntry(gr_csE760_t,"E760-like","lpe"); //Add exp data if(resData==0){ // expdata.SetMarkerColor(kSpring-1); // expdata.SetMarkerColor(kOrange+8); expdata.SetMarkerStyle(20); expdata.SetMarkerSize(0.9); mg_cs_t->Add(&expdata); leg->AddEntry(&expdata,"exp. data","pe"); } TGraphErrors *gr_uncsDPM_t = new TGraphErrors(Nexppoints,trange_exp,diffDPM,0,undiffDPM); gr_uncsDPM_t->SetMarkerColor(kBlue+1); gr_uncsDPM_t->SetLineColor(kBlue+1); gr_uncsDPM_t->SetMarkerStyle(21); gr_uncsDPM_t->SetMarkerSize(0.4); TGraphErrors *gr_uncsE760_t = new TGraphErrors(Nexppoints,trange_exp,diffE760,0,undiffE760); gr_uncsE760_t->SetMarkerColor(kAzure+1); gr_uncsE760_t->SetLineColor(kAzure+1); gr_uncsE760_t->SetMarkerStyle(21); gr_uncsE760_t->SetMarkerSize(0.4); TMultiGraph *mg_uncs_t = new TMultiGraph(); mg_uncs_t->Add(gr_uncsDPM_t); mg_uncs_t->Add(gr_uncsE760_t); TLegend *leg2 = new TLegend(0.73,0.8,0.95,0.95); // leg2->SetHeader(head); leg2->SetFillColor(0); leg2->SetTextFont(42); leg2->SetTextSize(0.05); leg2->AddEntry(gr_uncsDPM_t,"DPM","lpe"); // leg2->AddEntry(gr_uncsE760_t,"E760-like","lpe"); TLegend *leg3 = new TLegend(0.73,0.8,0.95,0.95); // leg3->SetHeader(head); leg3->SetFillColor(0); leg3->SetTextFont(42); leg3->SetTextSize(0.05); leg3->AddEntry(gr_uncsE760_t,"E760-like","lpe"); TGraph *gr_t_th = new TGraph(nst,t_val,th_val); TCanvas cRES("cRES","canvas",600,800); cRES.Divide(2,3); cRES.cd(2); mg_cs_t->Draw("AP"); mg_cs_t->GetXaxis()->SetTitle("|t|, (GeV/c)^{2}"); //mg_cs_t->GetXaxis()->SetLimits(-0.001,0.021); mg_cs_t->GetYaxis()->SetTitle("d#sigma/dt, mb/(GeV/c)^{2}"); // mg_cs_t->GetXaxis()->SetLimits(-1e-6,0.25); leg->Draw(); cRES.cd(1); gr_t_th->SetTitle(""); gr_t_th->GetXaxis()->SetTitle("|t|, (GeV/c)^{2}"); gr_t_th->GetYaxis()->SetTitle("#theta^{#bar{p}}_{lab}, rad"); gr_t_th->Draw("AL"); // gr_t_th->GetXaxis()->SetLimits(-1e-6,0.25); cRES.cd(5); TMultiGraph *mg_cs_t2 = new TMultiGraph(); mg_cs_t2->Add(gr_csDPM_t); mg_cs_t2->Add(gr_csE760_t); mg_cs_t2->Add(&expdata); mg_cs_t2->Draw("AP"); mg_cs_t2->GetXaxis()->SetRangeUser(0,zoomLim); mg_cs_t2->GetXaxis()->SetTitle("|t|, (GeV/c)^{2}"); mg_cs_t2->GetYaxis()->SetTitle("d#sigma/dt, mb/(GeV/c)^{2}"); leg->Draw(); cRES.cd(3); gr_uncsDPM_t->SetTitle(""); gr_uncsDPM_t->Draw("AP"); gr_uncsDPM_t->GetXaxis()->SetTitle("|t|, (GeV/c)^{2}"); gr_uncsDPM_t->GetYaxis()->SetTitle("((d#sigma/dt)_{exp} - (d#sigma/dt)_{model})/(d#sigma/dt)_{exp}, %"); // gr_uncsDPM_t->GetXaxis()->SetLimits(-1e-6,0.25); //mg_uncs_t->Draw("AP"); leg2->Draw(); // mg_uncs_t->GetXaxis()->SetTitle("|t|, (GeV/c)^{2}"); // mg_uncs_t->GetYaxis()->SetTitle("((d#sigma/dt)_{exp} - (d#sigma/dt)_{model})/(d#sigma/dt)_{exp}, %"); cRES.cd(4); gr_uncsE760_t->SetTitle(""); gr_uncsE760_t->Draw("AP"); gr_uncsE760_t->GetXaxis()->SetTitle("|t|, (GeV/c)^{2}"); gr_uncsE760_t->GetYaxis()->SetTitle("((d#sigma/dt)_{exp} - (d#sigma/dt)_{model})/(d#sigma/dt)_{exp}, %"); // gr_uncsE760_t->GetXaxis()->SetLimits(-1e-6,0.25); leg3->Draw(); cRES.cd(6); mg_uncs_t->Draw("AP"); mg_uncs_t->GetXaxis()->SetRangeUser(0,zoomLim); mg_uncs_t->GetYaxis()->SetRangeUser(-100,100); mg_uncs_t->GetXaxis()->SetTitle("|t|, (GeV/c)^{2}"); mg_uncs_t->GetYaxis()->SetTitle("((d#sigma/dt)_{exp} - (d#sigma/dt)_{model})/(d#sigma/dt)_{exp}, %"); TLegend *leg4 = new TLegend(0.75,0.7,0.99,0.99); // leg4->SetHeader(head); leg4->SetFillColor(0); leg4->SetTextFont(42); leg4->SetTextSize(0.05); leg4->AddEntry(gr_uncsDPM_t,"DPM","lpe"); leg4->AddEntry(gr_uncsE760_t,"E760-like","lpe"); leg4->Draw(); TString fname = "cs_and_uncert_DPM_E760like_vs_exp_"; fname += plab; TString fnamepdf = fname + ".pdf"; TString fnameroot = fname + ".root"; cRES.SaveAs(fnamepdf); cRES.SaveAs(fnameroot); return 0; }