1 const int mxTheo=4, mxPN=2;
2 TString theoNameA[mxTheo]={
"dns_k",
"dns_kkp",
"dssv08",
"dssv08/mrst02"};
3 TString pnS[mxPN]={
"+",
"-"};
4 TString pnL[mxPN]={
"p",
"n"};
5 TH1F *hTheoA[mxPN][mxTheo];
6 int theoCol[mxTheo]={kBlue,kRed, 8,kMagenta};
7 TGraphErrors *grP[mxPN];
8 TString iPath=
"asyWALfinalAPS/";
13 gStyle->SetOptStat(0);
16 c=
new TCanvas(
"aa",
"aa",500,700);
17 c->SetFillColor(kWhite); c->SetFrameBorderMode(0);
18 gPad->SetLeftMargin(0.10); gPad->SetRightMargin(0.05);
20 h0=
new TH1F(
"bb",
"; lepton #eta ",10,-2,2);
21 h0->SetMaximum(0.59); h0->SetMinimum(-0.59);h0->Draw();
22 h0->GetXaxis()->SetNdivisions(5); h0->GetXaxis()->SetTickLength(0.02);
24 ln=
new TLine(-1,-0.59,-1,0.3); ln->Draw(); ln->SetLineStyle(3);
25 ln=
new TLine(1,-0.59,1,0.4); ln->Draw(); ln->SetLineStyle(3);
30 uploadTheoryRhicbos();
33 if(!justTheo) plotSysErr();
34 if(!justTheo) plotData();
47 float x0=0.14, y0=0.86;
48 tlx=
new TLatex(x0,y0,
"STAR Preliminary Run9 #sqrt{s}=500 GeV"); tlx->SetNDC(); tlx->SetTextSize(0.048);
49 if(!justTheo) tlx->Draw();
51 tlx=
new TLatex(x0+0.05,y0-0.05,
"#vec{p}+p #rightarrow W^{#\pm} #rightarrow e^{#\pm} + #nu"); tlx->Draw(); tlx->SetNDC(); tlx->SetTextSize(0.05);
53 tlx=
new TLatex(x0+0.05,y0-0.1,
"E_{T}^{e} >25 GeV"); tlx->Draw(); tlx->SetNDC(); tlx->SetTextSize(0.045);
56 tlx=
new TLatex(0.4,0.68,
"W^{ -}"); tlx->Draw(); tlx->SetNDC(); tlx->SetTextSize(0.06);
57 tlx=
new TLatex(0.4,0.22,
"W^{+}"); tlx->Draw(); tlx->SetNDC(); tlx->SetTextSize(0.06);
60 tlx=
new TLatex(0.025,.85,
"A_{L}"); tlx->Draw(); tlx->SetNDC(); tlx->SetTextSize(0.06);
63 tlx=
new TLatex(0.73,.53,
"A_{L}= #frac{#sigma_{+} - #sigma_{-}}{#sigma_{+} + #sigma_{-}}"); tlx->Draw(); tlx->SetNDC(); tlx->SetTextSize(0.04);
69 TLatex *lat3 =
new TLatex(0.25,0.87,
"Theory scaled by #pm 4.7%, #sqrt{s}=500 GeV");
70 lat3->SetNDC(); lat3->Draw(
"same"); lat3->SetTextSize(0.035); lat3->SetTextColor(12);
75 tx=
new TText(-2,-0.72,dt.AsString()); tx->SetTextSize(0.035);
76 if(!justTheo) tx->Draw();
86 float x0=0.68, y0=0.46;
87 tlx=
new TLatex(x0,y0,
"W- W+ RHICBOS"); tlx->Draw(); tlx->SetNDC(); tlx->SetTextSize(0.03);
88 TLegend *thLg[mxPN*2];
91 thLg[0]=
new TLegend(x,y,x+0.27,y+0.07);
92 thLg[2]=
new TLegend(x,y0-dy,x+0.27,y0-dy);
93 x=x-0.07; thLg[1]=
new TLegend(x,y,x+0.27,y+0.07);
94 thLg[3]=
new TLegend(x,y0-dy,x+0.27,y0-dy);
96 for(
int iPN=0; iPN<mxPN*2;iPN++) {
97 TLegend *lg=thLg[iPN];
98 lg->SetFillColor(kWhite);lg->SetLineColor(kWhite); lg->SetTextSize(0.03);
101 char *theoL[mxTheo]={
"DNS-K",
"DNS-KKP",
"DSSV08",
"DSSV08"};
102 for(
int iPN=0; iPN<mxPN;iPN++) {
103 for (
int ith=0;ith<mxTheo; ith++){
104 TH1F *hTheo=hTheoA[iPN][ith];
105 if(justTheo==2) plotOneBandTheory(hTheo,ith);
107 int ko=0;
if(ith==3) ko=2;
109 thLg[iPN+ko]->AddEntry(hTheo,theoL[ith],
"l");
111 thLg[iPN+ko]->AddEntry(hTheo,
" ",
"l");
120 tlx=
new TLatex(x0,y0-dy+0.015,
" deFlorian & Vogelsang"); tlx->Draw(); tlx->SetNDC(); tlx->SetTextSize(0.025);
123 ln=
new TLine(2,-0.4,2,0); ln->Draw();
125 tb=
new TBox(0.62,-0.26,1.96,-0.01); tb->Draw();
126 tb->SetFillStyle(0); tb->SetLineColor(12);
136 TString inpCore=
"run9setP1234";
137 TString fullInpName=iPath; fullInpName+=inpCore;
138 fullInpName+=
".wasy.hist.root";
139 fdd=
new TFile(fullInpName);
140 if(! fdd->IsOpen()) {
141 printf(
"EROR: input histo file not found, quit\n",fullInpName.Data());
144 printf(
"Opened: %s\n",fullInpName.Data());
148 for(
int iq=0;iq<mxPN;iq++) {
149 TGraphErrors *gr=
new TGraphErrors;
150 gr->SetMarkerStyle(21-iq);
151 gr->SetMarkerSize(1.5);
152 gr->SetMarkerColor(kBlack);
154 gr->SetLineColor(kBlack);
157 if(iq==1) tt1=
"hAsyN";
158 TH1F *hAsy=(TH1F *)fdd->Get(tt1); assert( hAsy);
160 double asy=hAsy->GetBinContent(3);
161 double asyEr=hAsy->GetBinError(3);
162 printf(
"W %s AL=%.3f +/- %.3f nSig=%.1f\n", pnS[iq].Data(),asy,asyEr,asy/asyEr);
164 gr->SetPoint(0,0,asy);
165 gr->SetPointError(0,1.,asyEr);
177 for(
int iq=0;iq<mxPN;iq++) {
192 for(
int iq=0;iq<mxPN;iq++) {
193 float x=grP[iq]->GetX()[0];
194 float y=grP[iq]->GetY()[0];
197 float facYup=0.89, facYdw=1.13;
198 if(iq==1) facYup=1.21, facYdw=0.83;
200 bx=
new TBox(x-dx,y*facYdw,x+dx,y*facYup);
201 bx->Draw(); bx->SetFillColor(kBlack);
202 bx->SetFillStyle(3001);
205 float x0=-1.8,y0=-0.57;
206 bx=
new TBox(x0,y0,x0+2*dx,y0+0.08);
207 bx->Draw(); bx->SetFillColor(kBlack);
208 bx->SetFillStyle(3001);
209 tlx=
new TLatex(x0+0.2,y0+.045,
"Syst. uncertainty due to abs. "); tlx->Draw(); tlx->SetTextSize(0.03);
210 tlx=
new TLatex(x0+0.2,y0+.01,
"polarization and background"); tlx->Draw(); tlx->SetTextSize(0.03);
221 void uploadTheoryRhicbos(){
222 for(
int iPN=0; iPN<mxPN;iPN++) {
223 TString nameUn=
"rb400_w"+pnL[iPN]+
"_unp_ct5m_pt25.root";
224 funp=
new TFile( iPath+nameUn); assert(funp->IsOpen());
225 hunp= (TH1F*)funp->Get(
"h3"); assert(hunp);
228 for (
int ith=0;ith<mxTheo-1; ith++){
229 TString namePol=
"rb400_w"+pnL[iPN]+
"_pol_"+theoNameA[ith]+
"_pt25.root";
231 fpol=
new TFile( iPath+namePol); assert(fpol->IsOpen());
232 TH1F* hpol=(TH1F*) fpol->Get(
"h3"); assert(hpol);
234 hal=(TH1F*) hpol->Clone();
236 TString hName=
"w"+pnL[iPN]+
"_"+theoNameA[ith];
237 TString hTitle=
"W"+pnS[iPN]+
" "+theoNameA[ith]+
"; lepton #eta";
239 hal->SetNameTitle(hName,hTitle);
242 hTheoA[iPN][ith]=hal;
243 hal->SetLineColor( theoCol[ith]);
244 if(iPN) hal->SetLineStyle(2);
245 hal->SetLineWidth(2);
252 c->cd(1);hunp->Draw();
253 c->cd(2);hpol->Draw();
255 c->cd(3);hal->Draw(); hal->SetLineColor(kRed);;
256 hal->SetMaximum(0.6); hal->SetMinimum(-0.6);
267 void uploadTheoryDeFlor(){
268 for(
int iPN=0; iPN<mxPN;iPN++) {
269 TString nameUn=
"deFlor_w"+pnL[iPN]+
"_unp_mrst02_pt25_full.root";
270 funp=
new TFile( iPath+nameUn); assert(funp->IsOpen());
271 hunp= (TH1F*)funp->Get(
"h3"); assert(hunp);
273 char * theoName=
"dssv08";
275 TString namePol=
"deFlor_w"+pnL[iPN]+
"_pol_"+theoName+
"_pt25_full.root";
276 fpol=
new TFile( iPath+namePol); assert(fpol->IsOpen());
277 TH1F* hpol=(TH1F*) fpol->Get(
"h3"); assert(hpol);
279 hal=(TH1F*) hpol->Clone();
281 TString hName=
"w"+pnL[iPN]+
"_deFlor_dssv";
282 TString hTitle=
"W"+pnS[iPN]+
" deFlor dssv; lepton #eta";
284 hal->SetNameTitle(hName,hTitle);
287 hTheoA[iPN][ith]=hal;
288 hal->SetLineColor( theoCol[ith]);
289 if(iPN) hal->SetLineStyle(2);
290 hal->SetLineWidth(2);
301 void plotOneBandTheory(TH1F*hIn ,
int it) {
304 for(
int ib=0;ib<2;ib++){
305 TH1F * hu=(TH1F*) hIn->Clone();
308 TAxis *ax=hu->GetXaxis();
309 for(ib=1;ib<=ax->GetNbins();ib++){
310 float y= hu->GetBinContent(ib);
311 hu->SetBinError(ib,y*sysErr);
313 hu->SetFillStyle(3003+it);
315 hu->SetFillColor( hu->GetLineColor());