StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
systematics_rda.h
1 //pion rda:
2 double bemc_escale_rda(double *x,double * /*par*/){
3  double p[]={2.14037e-01,6.55108e-03};
4  return 0.5*(p[0]+p[1]*x[0]);
5 }
6 double bemc_spread_rda(double * /*x*/,double * /*par*/){
7  return (double)0.042;
8 }
9 double material_rda(double * /*x*/,double * /*par*/){
10  return (double)0.032;
11 }
12 double yield_extract_rda(double *x,double * /*par*/){
13  if(x[0]<4.) return (double)0.071;
14  /*if(x[0]>=4.)*/ return (double)0.1;
15 }
16 double prescale_rda(double *x,double * /*par*/){
17  if(x[0]<4.) return (double)0.;
18  /*if(x[0]>=4.)*/ return (double)0.071;
19 }
20 double beambg_rda(double *x,double * /*par*/){
21  if(x[0]<5.) return (double)0.0;
22  /*if(x[0]>=5.)*/ return (double)0.007*(x[0]-5.);
23 }
24 double total_sys_rda(double *x,double *par){
25  double ret=0.;
26  ret=bemc_escale_rda(x,par)*bemc_escale_rda(x,par);
27  ret+=bemc_spread_rda(x,par)*bemc_spread_rda(x,par);
28  ret+=material_rda(x,par)*material_rda(x,par);
29  ret+=yield_extract_rda(x,par)*yield_extract_rda(x,par);
30  ret+=prescale_rda(x,par)*prescale_rda(x,par);
31  ret+=beambg_rda(x,par)*beambg_rda(x,par);
32  return par[0]*sqrt(ret);
33 }
34 void set_sys_rda(TGraphErrors *g){
35  TF1 *sys=new TF1("sys",&total_sys_rda,1.,15.,1);
36  sys->SetParameter(0,1.);
37  for(int i=0;i<g->GetN();i++){
38  double x=0.;
39  double y=0.;
40  g->GetPoint(i,x,y);
41  double rel_err=sys->Eval(x);
42  g->SetPointError(i,0.,rel_err*y);
43  }
44 }
45 
46 //normalization explicit:
47 double error_norm_rda(double * /*x*/,double * /*par*/){
48  return (double)sqrt(0.069*0.069+0.092*0.092+0.01*0.01+0.053*0.053);//s_bbc,e_bbc,e_vert,<nbin>
49 }
50