2 double bemc_escale_pp_pion(
double *x,
double * ){
3 double p[]={2.14037e-01,6.55108e-03};
6 double bemc_spread_pp_pion(
double * ,
double * ){
9 double bsmd_escale_pp_pion(
double *x,
double * ){
10 double p[]={4.47017e-02,9.96379e-01,-7.68552e-01};
11 return p[0]+p[1]*exp(p[2]*x[0]);
13 double bsmd_spread_pp_pion(
double *x,
double * ){
14 double p[]={1.26779e-02,-1.55283e-01,-1.68008e-01};
15 return p[0]+p[1]*exp(p[2]*x[0]);
17 double material_pp_pion(
double * ,
double * ){
20 double yield_extract_pp_pion(
double *x,
double * ){
21 if(x[0]<4.)
return (
double)0.05;
24 double error_xsec_pp_pion(
double * ,
double * ){
25 return (
double)sqrt(0.069*0.069+0.092*0.092);
27 double prescale_pp_pion(
double *x,
double * ){
28 if(x[0]<4.)
return (
double)0.;
31 double total_sys_pp_pion(
double *x,
double *par){
33 ret=bemc_escale_pp_pion(x,par)*bemc_escale_pp_pion(x,par);
34 ret+=bemc_spread_pp_pion(x,par)*bemc_spread_pp_pion(x,par);
35 ret+=bsmd_escale_pp_pion(x,par)*bsmd_escale_pp_pion(x,par);
36 ret+=bsmd_spread_pp_pion(x,par)*bsmd_spread_pp_pion(x,par);
37 ret+=material_pp_pion(x,par)*material_pp_pion(x,par);
38 ret+=yield_extract_pp_pion(x,par)*yield_extract_pp_pion(x,par);
39 ret+=error_xsec_pp_pion(x,par)*error_xsec_pp_pion(x,par);
40 ret+=prescale_pp_pion(x,par)*prescale_pp_pion(x,par);
41 return par[0]*sqrt(ret);
43 void set_sys_pp_pion(TGraphErrors *g){
44 TF1 *sys=
new TF1(
"sys",&total_sys_pp_pion,1.,15.,1);
45 sys->SetParameter(0,1.);
46 for(
int i=0;i<g->GetN();i++){
50 double rel_err=sys->Eval(x);
51 g->SetPointError(i,0.,rel_err*y);
54 void plotErrors_pp_pion(){
56 TF1 *error_up=
new TF1(
"error_up",&total_sys_pp_pion,1.,15.,1);
57 error_up->SetParameter(0,1.);
58 TF1 *error_down=
new TF1(
"error_down",&total_sys_pp_pion,1.,15.,1);
59 error_down->SetParameter(0,-1.);
61 error_up->SetFillColor(5);
62 error_down->SetFillColor(5);
65 TCanvas *test=
new TCanvas();
67 error_up->SetMinimum(-1.*error_up->GetMaximum());
68 error_down->Draw(
"same");
69 test->SaveAs(
"systotal_pp_pions.eps");
70 test->SaveAs(
"systotal_pp_pions.root");
74 double bemc_escale_pp_ratio(
double * ,
double * ){
77 double bemc_spread_pp_ratio(
double * ,
double * ){
80 double bsmd_escale_pp_ratio(
double * ,
double * ){
84 double bsmd_spread_pp_ratio(
double * ,
double * ){
87 double yield_extract_pp_ratio(
double *x,
double *par){
88 return yield_extract_pp_pion(x,par);
90 double eta_over_pi_pp(
double * ,
double * ){
93 double fit_pion_pp(
double * ,
double * ){
96 double total_sys_pp_ratio(
double *x,
double *par){
98 ret=bemc_escale_pp_ratio(x,par)*bemc_escale_pp_ratio(x,par);
99 ret+=bemc_spread_pp_ratio(x,par)*bemc_spread_pp_ratio(x,par);
100 ret+=bsmd_escale_pp_ratio(x,par)*bsmd_escale_pp_ratio(x,par);
101 ret+=bsmd_spread_pp_ratio(x,par)*bsmd_spread_pp_ratio(x,par);
102 ret+=yield_extract_pp_ratio(x,par)*yield_extract_pp_ratio(x,par);
103 ret+=eta_over_pi_pp(x,par)*eta_over_pi_pp(x,par);
104 ret+=fit_pion_pp(x,par)*fit_pion_pp(x,par);
105 return par[0]*sqrt(ret);
107 void set_sys_pp_ratio(TGraphErrors *g){
108 TF1 *sys=
new TF1(
"sys",&total_sys_pp_ratio,1.,15.,1);
109 sys->SetParameter(0,1.);
110 for(
int i=0;i<g->GetN();i++){
114 double rel_err=sys->Eval(x);
115 g->SetPointError(i,0.2,rel_err*y);