StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
getRdaPrel.C
1 void getRdaPrel()
2 {
3  //frank's spin2006 pions:
4  ifstream frank("./datapoints/frank_pp05.dat");
5  Float_t frx[100];
6  Float_t fry[100];
7  Float_t frex[100];
8  Float_t frey[100];
9  Int_t ifr=0;
10  while(ifr<12){
11  if(!frank.good()) break;
12  frank>>frx[ifr]>>fry[ifr]>>frey[ifr];
13  fry[ifr]*=0.85/26.1;
14  frey[ifr]*=0.85/26.1;
15  frex[ifr]=0.;
16  ifr++;
17  }
18  TGraphErrors *frank_pp=new TGraphErrors(ifr,frx,fry,frex,frey);
19  frank_pp->SetName("frank");
20  frank_pp->SetMarkerStyle(25);
21  frank_pp->SetMarkerColor(4);
22 
23  TGraphErrors *andre_dau = new TGraphErrors(20);
24  andre_dau->SetName("andre");
25  andre_dau->SetFillColor(1);
26  andre_dau->SetMarkerStyle(20);
27  andre_dau->SetMarkerSize(1.4);
28  andre_dau->SetPoint(1,1.75,0.00500784);
29  andre_dau->SetPointError(1,0,0.000146705);
30  andre_dau->SetPoint(2,2.25,0.00178272);
31  andre_dau->SetPointError(2,0,5.55874e-05);
32  andre_dau->SetPoint(3,2.75,0.000527415);
33  andre_dau->SetPointError(3,0,2.38637e-05);
34  andre_dau->SetPoint(4,3.25,0.000173036);
35  andre_dau->SetPointError(4,0,1.17154e-05);
36  andre_dau->SetPoint(5,3.75,7.47168e-05);
37  andre_dau->SetPointError(5,0,1.44958e-05);
38  andre_dau->SetPoint(6,4.25,2.65451e-05);
39  andre_dau->SetPointError(6,0,4.05473e-06);
40  andre_dau->SetPoint(7,4.75,1.0569e-05);
41  andre_dau->SetPointError(7,0,2.9797e-06);
42  andre_dau->SetPoint(8,5.25,4.08643e-06);
43  andre_dau->SetPointError(8,0,1.23376e-06);
44  andre_dau->SetPoint(9,6,1.29798e-06);
45  andre_dau->SetPointError(9,0,4.30548e-07);
46  andre_dau->SetPoint(10,6.5,7.02737e-07);
47  andre_dau->SetPointError(10,0,1.00577e-07);
48  andre_dau->SetPoint(11,7.5,2.8363e-07);
49  andre_dau->SetPointError(11,0,5.20925e-08);
50  andre_dau->SetPoint(12,8.5,1.22991e-07);
51  andre_dau->SetPointError(12,0,2.57462e-08);
52  andre_dau->SetPoint(13,9.5,5.68615e-08);
53  andre_dau->SetPointError(13,0,6.45742e-09);
54  andre_dau->SetPoint(14,10.5,2.77471e-08);
55  andre_dau->SetPointError(14,0,3.97804e-09);
56  andre_dau->SetPoint(15,11.5,1.61125e-08);
57  andre_dau->SetPointError(15,0,4.34288e-09);
58  andre_dau->SetPoint(16,12.5,9.93835e-09);
59  andre_dau->SetPointError(16,0,2.42936e-09);
60  andre_dau->SetPoint(17,13.5,5.44627e-09);
61  andre_dau->SetPointError(17,0,3.26254e-09);
62  andre_dau->SetPoint(18,14.5,3.15326e-09);
63  andre_dau->SetPointError(18,0,2.1746e-09);
64  andre_dau->SetPoint(19,15.5,1.56401e-09);
65  andre_dau->SetPointError(19,0,1.13746e-09);
66 
67  TMultiGraph *mgfit=new TMultiGraph();
68  mgfit->Add(frank_pp);
69  TF1 *fitQCD=new TF1("fitQCD","[0]*pow(1.+x,[1])*([2]+[3]*x+[4]*x*x+[5]*x*x*x)",1.5,16.);
70  fitQCD->SetParameters(600.,-9.5,1.,0.,0.,0.);
71  mgfit->Fit(fitQCD,"R0");
72 
73  TMultiGraph *m=new TMultiGraph("m","none;p_{T} (GeV/c);1/(2#piNp_{T}) dN/dydp_{T}");
74  gStyle->SetOptStat(0);
75  gStyle->SetOptTitle(0);
76  m->Add(andre_dau);
77  m->Add(frank_pp);
78  m->SetMaximum(.1);
79  m->SetMinimum(1.e-11);
80 
81  TCanvas *c=new TCanvas("c","c",400,400);
82  gPad->SetLogy();
83  m->Draw("ap");
84  fitQCD->SetLineWidth(1);
85  fitQCD->Draw("same");
86 
87  TLegend *legg=new TLegend(.4,.6,.8,.8);
88  legg->AddEntry(andre_dau,"d+Au preliminary","p");
89  legg->AddEntry(frank_pp,"p+p preliminary","p");
90  legg->Draw("same");
91 
92  c->SaveAs("rda_prel.pdf");
93 
94  TCanvas *c2=new TCanvas("c2","c2",400,150);
95  TGraphErrors *andre_dau2=new TGraphErrors();
96  andre_dau2->SetMarkerStyle(20);
97  andre_dau2->SetMarkerSize(1.4);
98  TGraphErrors *frank_pp2=new TGraphErrors();
99 
100  for(int i=0;i<19;i++){
101  double xx=0.;
102  double yy=0;
103  double exx=0.;
104  double eyy=0.;
105  if(i<12){
106  frank_pp->GetPoint(i,xx,yy);
107  eyy=frank_pp->GetErrorY(i);
108  frank_pp2->SetPoint(i,xx,yy/fitQCD->Eval(xx));
109  frank_pp2->SetPointError(i,exx,eyy/fitQCD->Eval(xx));
110  }
111  andre_dau->GetPoint(i,xx,yy);
112  eyy=andre_dau->GetErrorY(i);
113  andre_dau2->SetPoint(i,xx,yy/(7.5*fitQCD->Eval(xx)));
114  andre_dau2->SetPointError(i,exx,eyy/(7.5*fitQCD->Eval(xx)));
115  }
116  frank_pp2->SetMarkerStyle(25);
117  frank_pp2->SetMarkerColor(4);
118 
119 
120 
121  TMultiGraph *m_rda=new TMultiGraph();
122  m_rda->Add(frank_pp2);
123  m_rda->Add(andre_dau2);
124  m_rda->SetMinimum(0.01);
125  m_rda->SetMaximum(3.);
126  m_rda->Draw("ap");
127 
128  c2->SaveAs("rda_prel2.pdf");
129 }