double extr_cs(double *x, double *par){ //a = par[0], b = par[1], c = par[2] double mom = x[0]; double cs = par[0]*TMath::Exp(-par[1]*mom)+par[2]/mom+par[3]*TMath::Log(mom); return cs; } void AllarecFunc2(){ TF1 *fppbarpi0 = new TF1("ppbarpi0",extr_cs,1.2,35,4); fppbarpi0->SetParameters(-39.59,1.63,7.12,0.29); fppbarpi0->SetParNames("a","b","c","d"); fppbarpi0->SetLineColor(2); fppbarpi0->SetLineWidth(3); fppbarpi0->Draw(); // TF1 *fppbarpi0_up = new TF1("ppbarpi0_up",extr_cs,1.2,35,4); // fppbarpi0_up->SetParameters(-39.59+2.44,1.63+0.01,7.12+0.42,0.29+0.03); // fppbarpi0_up->SetParNames("a","b","c","d"); // fppbarpi0_up->SetLineColor(2); // fppbarpi0_up->SetLineStyle(2); // fppbarpi0_up->SetLineWidth(1.5); // fppbarpi0_up->Draw("same"); // TF1 *fppbarpi0_dw = new TF1("ppbarpi0_dw",extr_cs,1.2,35,4); // fppbarpi0_dw->SetParameters(-39.59-2.44,1.63-0.01,7.12-0.42,0.29-0.03); // fppbarpi0_dw->SetParNames("a","b","c","d"); // fppbarpi0_dw->SetLineColor(2); // fppbarpi0_dw->SetLineStyle(2); // fppbarpi0_dw->SetLineWidth(1.5); // fppbarpi0_dw->Draw("same"); double pmom_ppbarpi0[]={22.4,8.8,9.1,2.23,1.23,1.3,1.36,1.43,1.23,1.3,1.36, 1.43,1.61,2.7,3,3.28,3.6,5.7,6.94,3.6}; double cs_ppbarpi0[]={1.4, 1.27, 1.47, 2.11, 0.526, 0.739, 1.011, 1.247, 0.526, 0.739, 1.011, 1.247, 1.85, 2.67, 2.41, 2.3, 1.9, 2.1, 1.3, 1.89 }; double cs_err_ppbarpi0[]={0.1, 0.08, 0.14, 0.13, 0.035, 0.046, 0.054, 0.06, 0.035, 0.046, 0.054, 0.06, 0.22, 0.09, 0.29, 0.5, 0.3, 0.23, 0.3, 0.32}; TGraphErrors *grppbarpi0 = new TGraphErrors(20,pmom_ppbarpi0, cs_ppbarpi0,0,cs_err_ppbarpi0); grppbarpi0->SetMarkerStyle(20); grppbarpi0->SetMarkerColor(2); grppbarpi0->SetMarkerSize(1.5); grppbarpi0->Draw("P"); TF1 *fppbarpiplpimn = new TF1("ppbarpiplpimn",extr_cs,1.2,35,4); fppbarpiplpimn->SetParameters(-46.41,0.83,18.39,0.21); fppbarpiplpimn->SetParNames("a","b","c","d"); fppbarpiplpimn->SetLineColor(8); fppbarpiplpimn->SetLineWidth(3); fppbarpiplpimn->Draw("same"); // TF1 *fppbarpiplpimn_up = new TF1("ppbarpiplpimn_up",extr_cs,1.2,35,4); // fppbarpiplpimn_up->SetParameters(-46.41+0.86,0.83+0.01,18.39+0.44,0.21+0.01); // fppbarpiplpimn_up->SetParNames("a","b","c","d"); // fppbarpiplpimn_up->SetLineColor(8); // fppbarpiplpimn_up->SetLineStyle(2); // fppbarpiplpimn_up->SetLineWidth(1.5); // fppbarpiplpimn_up->Draw("same"); // TF1 *fppbarpiplpimn_dw = new TF1("ppbarpiplpimn_dw",extr_cs,1.2,35,4); // fppbarpiplpimn_dw->SetParameters(-46.41-0.86,0.83-0.01,18.39-0.44,0.21-0.01); // fppbarpiplpimn_dw->SetParNames("a","b","c","d"); // fppbarpiplpimn_dw->SetLineColor(8); // fppbarpiplpimn_dw->SetLineStyle(2); // fppbarpiplpimn_dw->SetLineWidth(1.5); // fppbarpiplpimn_dw->Draw("same"); double pmom_ppbarpiplpimn[]={2.375,2.5,2.7,2.885,3.28,3.6,3.66, 5.7,5.7,6.94,8.8,2.32,1.9,22.4, 32.1,49,32,9.125}; double cs_ppbarpiplpimn[]={ 1.5, 1.37, 1.93, 2.57, 3.43, 3.8, 3.67, 3.18, 3.311, 2.7, 2.4, 1.11, 0.165, 1.41, 1.32, 1.19, 1.34, 2.6 }; double cs_err_ppbarpiplpimn[]={ 0.07, 0.07, 0.16, 0.1, 0.23, 0.2, 0.3, 0.16, 0.16, 0.3, 0.06, 0.07, 0.004, 0.03, 0.02, 0.19, 0.1, 0.1}; TGraphErrors *grppbarpiplpimn = new TGraphErrors(18,pmom_ppbarpiplpimn, cs_ppbarpiplpimn,0,cs_err_ppbarpiplpimn); grppbarpiplpimn->SetMarkerStyle(20); grppbarpiplpimn->SetMarkerColor(8); grppbarpiplpimn->SetMarkerSize(1.5); grppbarpiplpimn->Draw("P"); TF1 *fppbarpiplpimnpi0 = new TF1("ppbarpiplpimnpi0",extr_cs,2.5,35,4); fppbarpiplpimnpi0->SetParameters(99.34,2.24,-3.49,1.15); fppbarpiplpimnpi0->SetParNames("a","b","c","d"); fppbarpiplpimnpi0->SetLineColor(kYellow-8); fppbarpiplpimnpi0->SetLineWidth(3); fppbarpiplpimnpi0->Draw("same"); // TF1 *fppbarpiplpimnpi0_up = new TF1("ppbarpiplpimnpi0_up",extr_cs,2.5,35,4); // fppbarpiplpimnpi0_up->SetParameters(99.34+0.63,2.24+0.02,-3.49+0.09,1.15+0.03); // fppbarpiplpimnpi0_up->SetParNames("a","b","c","d"); // fppbarpiplpimnpi0_up->SetLineColor(kYellow-8); // fppbarpiplpimnpi0_up->SetLineStyle(2); // fppbarpiplpimnpi0_up->SetLineWidth(1.5); // fppbarpiplpimnpi0_up->Draw("same"); // TF1 *fppbarpiplpimnpi0_dw = new TF1("ppbarpiplpimnpi0_dw",extr_cs,2.5,35,4); // fppbarpiplpimnpi0_dw->SetParameters(99.34-0.63,2.24-0.02,-3.49-0.09,1.15-0.03); // fppbarpiplpimnpi0_dw->SetParNames("a","b","c","d"); // fppbarpiplpimnpi0_dw->SetLineColor(kYellow-8); // fppbarpiplpimnpi0_dw->SetLineStyle(2); // fppbarpiplpimnpi0_dw->SetLineWidth(1.5); // fppbarpiplpimnpi0_dw->Draw("same"); double pmom_ppbarpiplpimnpi0[]={2.375,2.5,2.885,3.28,3.6,3.66,5.7,5.7,6.94, 8.8,2.32,5.7}; double cs_ppbarpiplpimnpi0[]={ 0.01, 0.01, 0.124, 0.3, 0.6, 0.5, 2.16, 1.55, 1.3, 2.04, 0.0088, 1.95 }; double cs_err_ppbarpiplpimnpi0[]={ 0.005, 0.005, 0.04, 0.1, 0.1, 0.1, 0.14, 0.25, 0.3, 0.06, 0.0016, 0.12}; TGraphErrors *grppbarpiplpimnpi0 = new TGraphErrors(12,pmom_ppbarpiplpimnpi0, cs_ppbarpiplpimnpi0,0,cs_err_ppbarpiplpimnpi0); grppbarpiplpimnpi0->SetMarkerStyle(20); grppbarpiplpimnpi0->SetMarkerColor(kYellow-8); grppbarpiplpimnpi0->SetMarkerSize(1.5); grppbarpiplpimnpi0->Draw("P"); TF1 *fpbarpipln = new TF1("pbarpipln",extr_cs,1.2,35,4); fpbarpipln->SetParameters(-33.07,0.99,12.28,0.07); fpbarpipln->SetParNames("a","b","c","d"); fpbarpipln->SetLineColor(9); fpbarpipln->SetLineWidth(3); fpbarpipln->Draw("same"); // TF1 *fpbarpipln_up = new TF1("pbarpipln_up",extr_cs,1.2,35,4); // fpbarpipln_up->SetParameters(-33.07+1.36,0.99+0.02,12.28+0.73,0.07+0.04); // fpbarpipln_up->SetParNames("a","b","c","d"); // fpbarpipln_up->SetLineColor(9); // fpbarpipln_up->SetLineStyle(2); // fpbarpipln_up->SetLineWidth(1.5); // fpbarpipln_up->Draw("same"); // TF1 *fpbarpipln_dw = new TF1("pbarpipln_dw",extr_cs,1.2,35,4); // fpbarpipln_dw->SetParameters(-33.07-1.36,0.99-0.02,12.28-0.73,0.07-0.04); // fpbarpipln_dw->SetParNames("a","b","c","d"); // fpbarpipln_dw->SetLineColor(9); // fpbarpipln_dw->SetLineStyle(2); // fpbarpipln_dw->SetLineWidth(1.5); // fpbarpipln_dw->Draw("same"); double pmom_pbarpipln[]={22.4, 8.8, 9.1, 2.23, 1.23, 1.3,1.36, 1.43, 1.23, 1.3, 1.36,1.43, 1.61, 2.7, 3, 3.6,5.7}; double cs_pbarpipln[]={ 0.9, 1.35, 1.56, 1.65, 0.2, 0.279, 0.388, 0.586, 0.2, 0.279, 0.388, 0.586, 1, 2.65, 2.07, 2.2 , 1.82 }; double cs_err_pbarpipln[]={ 0.1, 0.09, 0.14, 0.11, 0.021, 0.028, 0.033, 0.039, 0.021, 0.028, 0.033, 0.039, 0.16, 0.09, 0.27, 0.4, 0.34 }; TGraphErrors *grpbarpipln = new TGraphErrors(17,pmom_pbarpipln, cs_pbarpipln,0,cs_err_pbarpipln); grpbarpipln->SetMarkerStyle(20); grpbarpipln->SetMarkerColor(9); grpbarpipln->SetMarkerSize(1.5); grpbarpipln->Draw("P"); double pmom_dpm[]={1.5,15}; double cs_ppbarpi0_dpm[]={3.44,696.67*1e-3}; double cs_err_ppbarpi0_dpm[]={0.01,2.29*1e-3}; TGraphErrors *grppbarpi0_dpm = new TGraphErrors(2,pmom_dpm, cs_ppbarpi0_dpm,0,cs_err_ppbarpi0_dpm); grppbarpi0_dpm->SetMarkerStyle(21); grppbarpi0_dpm->SetMarkerColor(2); grppbarpi0_dpm->SetMarkerSize(2); grppbarpi0_dpm->Draw("P"); double cs_ppbarpiplpimn_dpm[]={4.01309*1e-3, 1.36}; double cs_err_ppbarpiplpimn_dpm[]={0.049852*1e-3, 0.0015}; TGraphErrors *grppbarpiplpimn_dpm = new TGraphErrors(2,pmom_dpm, cs_ppbarpiplpimn_dpm,0,cs_err_ppbarpiplpimn_dpm); grppbarpiplpimn_dpm->SetMarkerStyle(21); grppbarpiplpimn_dpm->SetMarkerColor(8); grppbarpiplpimn_dpm->SetMarkerSize(2); grppbarpiplpimn_dpm->Draw("P"); double cs_ppbarpiplpimnpi0_dpm[]={0,1.86}; double cs_err_ppbarpiplpimnpi0_dpm[]={0,0.01}; TGraphErrors *grppbarpiplpimnpi0_dpm = new TGraphErrors(2,pmom_dpm, cs_ppbarpiplpimnpi0_dpm,0,cs_err_ppbarpiplpimnpi0_dpm); grppbarpiplpimnpi0_dpm->SetMarkerStyle(21); grppbarpiplpimnpi0_dpm->SetMarkerColor(kYellow-8); grppbarpiplpimnpi0_dpm->SetMarkerSize(2); grppbarpiplpimnpi0_dpm->Draw("P"); double cs_pbarpipln_dpm[]={1.32,552.51*1e-3}; double cs_err_pbarpipln_dpm[]={0.01,0.92*1e-3}; TGraphErrors *grpbarpipln_dpm = new TGraphErrors(2,pmom_dpm, cs_pbarpipln_dpm,0,cs_err_pbarpipln_dpm); grpbarpipln_dpm->SetMarkerStyle(21); grpbarpipln_dpm->SetMarkerColor(9); grpbarpipln_dpm->SetMarkerSize(2); grpbarpipln_dpm->Draw("P"); double shiftx = 0.; double shifty = 0.4; TLegend *leg1 = new TLegend(0.7-shiftx,0.75-shifty,0.84-shiftx,0.95-shifty); leg1->SetHeader("#bar{p}p#pi^{0}"); leg1->SetTextAlign(22); leg1->SetTextSize(0.04); leg1->SetFillColor(0); leg1->AddEntry(grppbarpi0," exp","pe"); leg1->AddEntry("ppbarpi0"," fit","l"); leg1->AddEntry(grppbarpi0_dpm," DPM","pe"); leg1->Draw(); TLegend *leg2 = new TLegend(0.85-shiftx,0.75-shifty,0.99-shiftx,0.95-shifty); leg2->SetHeader("#bar{p}p#pi^{-}#pi^{+}"); leg2->SetTextAlign(22); leg2->SetTextSize(0.04); leg2->SetFillColor(0); leg2->AddEntry(grppbarpiplpimn," exp","pe"); leg2->AddEntry("ppbarpiplpimn"," fit","l"); leg2->AddEntry(grppbarpiplpimn_dpm," DPM","pe"); leg2->Draw(); TLegend *leg3 = new TLegend(0.7-shiftx,0.54-shifty,0.84-shiftx,0.74-shifty); leg3->SetHeader("#bar{p}p#pi^{-}#pi^{+}#pi^{0}"); leg3->SetTextAlign(22); leg3->SetTextSize(0.04); leg3->SetFillColor(0); leg3->AddEntry(grppbarpiplpimnpi0," exp","pe"); leg3->AddEntry("ppbarpiplpimnpi0"," fit","l"); leg3->AddEntry(grppbarpiplpimnpi0_dpm," DPM","pe"); leg3->Draw(); TLegend *leg4 = new TLegend(0.85-shiftx,0.54-shifty,0.99-shiftx,0.74-shifty); leg4->SetHeader("#bar{p}#pi^{+}n"); leg4->SetTextAlign(22); leg4->SetTextSize(0.04); leg4->SetFillColor(0); leg4->AddEntry(grpbarpipln," exp","pe"); leg4->AddEntry("pbarpipln"," fit","l"); leg4->AddEntry(grpbarpipln_dpm," DPM","pe"); leg4->Draw(); }