2 double bemc_escale_dau_pion(
double *x,
double * ){
3 double p[]={2.14037e-01,6.55108e-03};
4 return 1.25*(p[0]+p[1]*x[0]);
6 double bemc_spread_dau_pion(
double * ,
double * ){
9 double bsmd_escale_dau_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_dau_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_dau_pion(
double * ,
double * ){
20 double yield_extract_dau_pion(
double *x,
double * ){
21 if(x[0]<4.)
return (
double)0.05;
24 double beambg_dau_pion(
double *x,
double * ){
25 if(x[0]<5.)
return (
double)0.0;
26 return (
double)0.007*(x[0]-5.);
28 double error_norm_dau_pion(
double * ,
double * ){
31 double prescale_dau_pion(
double *x,
double * ){
32 if(x[0]<4.)
return (
double)0.;
35 double total_sys_dau_pion(
double *x,
double *par){
37 ret=bemc_escale_dau_pion(x,par)*bemc_escale_dau_pion(x,par);
38 ret+=bemc_spread_dau_pion(x,par)*bemc_spread_dau_pion(x,par);
39 ret+=bsmd_escale_dau_pion(x,par)*bsmd_escale_dau_pion(x,par);
40 ret+=bsmd_spread_dau_pion(x,par)*bsmd_spread_dau_pion(x,par);
41 ret+=material_dau_pion(x,par)*material_dau_pion(x,par);
42 ret+=yield_extract_dau_pion(x,par)*yield_extract_dau_pion(x,par);
43 ret+=beambg_dau_pion(x,par)*beambg_dau_pion(x,par);
44 ret+=error_norm_dau_pion(x,par)*error_norm_dau_pion(x,par);
45 ret+=prescale_dau_pion(x,par)*prescale_dau_pion(x,par);
46 return par[0]*sqrt(ret);
48 void set_sys_dau_pion(TGraphErrors *g){
49 TF1 *sys=
new TF1(
"sys",&total_sys_dau_pion,1.,15.,1);
50 sys->SetParameter(0,1.);
51 for(
int i=0;i<g->GetN();i++){
55 double rel_err=sys->Eval(x);
56 g->SetPointError(i,0.,rel_err*y);
59 void plotErrors_dau_pion(){
61 TF1 *error_up=
new TF1(
"error_up",&total_sys_dau_pion,1.,15.,1);
62 error_up->SetParameter(0,1.);
63 TF1 *error_down=
new TF1(
"error_down",&total_sys_dau_pion,1.,15.,1);
64 error_down->SetParameter(0,-1.);
66 error_up->SetFillColor(5);
67 error_down->SetFillColor(5);
70 TCanvas *test=
new TCanvas();
72 error_up->SetMinimum(-1.*error_up->GetMaximum());
73 error_down->Draw(
"same");
74 test->SaveAs(
"systotal_dau_pions.eps");
75 test->SaveAs(
"systotal_dau_pions.root");
79 double bemc_escale_dau_ratio(
double * ,
double * ){
82 double bemc_spread_dau_ratio(
double * ,
double * ){
85 double bsmd_escale_dau_ratio(
double * ,
double * ){
89 double bsmd_spread_dau_ratio(
double * ,
double * ){
92 double yield_extract_dau_ratio(
double *x,
double *par){
93 return yield_extract_dau_pion(x,par);
95 double eta_over_pi_dau(
double * ,
double * ){
98 double fit_pion_dau(
double * ,
double * ){
105 double total_sys_dau_ratio(
double *x,
double *par){
107 ret=bemc_escale_dau_ratio(x,par)*bemc_escale_dau_ratio(x,par);
108 ret+=bemc_spread_dau_ratio(x,par)*bemc_spread_dau_ratio(x,par);
109 ret+=bsmd_escale_dau_ratio(x,par)*bsmd_escale_dau_ratio(x,par);
110 ret+=bsmd_spread_dau_ratio(x,par)*bsmd_spread_dau_ratio(x,par);
111 ret+=yield_extract_dau_ratio(x,par)*yield_extract_dau_ratio(x,par);
112 ret+=eta_over_pi_dau(x,par)*eta_over_pi_dau(x,par);
113 ret+=fit_pion_dau(x,par)*fit_pion_dau(x,par);
114 ret+=beambg_dau_pion(x,par)*beambg_dau_pion(x,par);
115 return par[0]*sqrt(ret);
117 void set_sys_dau_ratio(TGraphErrors *g){
118 TF1 *sys=
new TF1(
"sys",&total_sys_dau_ratio,1.,15.,1);
119 sys->SetParameter(0,1.);
120 for(
int i=0;i<g->GetN();i++){
124 double rel_err=sys->Eval(x);
125 g->SetPointError(i,0.2,rel_err*y);