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, kBlack,kMagenta};
7 TGraphErrors *grP[mxPN];
8 TString iPath=
"asyWALfinalPRL/";
12 void plPRL_AL(TString cCore=
"WAL_PRL_AL") {
13 gStyle->SetOptStat(0);
14 gStyle->SetLineStyleString(2,
"15 14");
15 gStyle->SetLineStyleString(3,
"4 9");
16 gStyle->SetLineStyleString(4,
"10 10 4 10");
18 const Char_t *title=
"Longitudinal single-spin asymmetry A_L for W boson production at midrapidity";
19 c=
new TCanvas(cCore,title,500,550);
20 setPadPaperSize(245.0);
21 setPadMarginWidthPoint(gPad, 27, 1, 2, (2.0*12.0) + 2, gPad);
22 setPadLineWidthPoint(gPad, 0.5);
25 h0=
new TH1F(
"bb",
";Lepton #eta",10,-2,2);
27 h0->SetMinimum(-0.59);
28 h0->GetXaxis()->SetNdivisions(5);
29 h0->GetXaxis()->CenterTitle(
true);
31 setHistFontSize(h0, 10.0);
32 setLineWidthPoint(h0, 0.5);
33 setMarkerSizePoint(h0, 3.5);
34 setHistTickLength(h0, 4.0, 4.0);
35 setHistTitleLabelOffset(h0, 2.0*12.0 - 2.0, 28, 12.0 - 2.0, 4.5 - 2.0);
38 ln=
new TLine(-1,-0.59,-1,0.3); ln->Draw(); ln->SetLineStyle(3);
39 ln=
new TLine(1,-0.59,1,0.4); ln->Draw(); ln->SetLineStyle(3);
44 uploadTheoryRhicbos();
47 if(!justTheo) plotSysErr();
48 if(!justTheo) plotData();
61 float x0=0.14, y0=0.93;
62 tlx=
new TLatex(x0,y0,
"#font[82]{STAR} 2009 " + SYMBOL_sqrts +
"_{_{ }}#font[122]{=}_{ }_{_{ }}500 " + SYMBOL_GeV);
65 setTextFontSize(tlx, 10.0);
66 if(!justTheo) tlx->Draw();
68 tlx=
new TLatex(x0+0.05,y0-0.06,SYMBOL_parrowplusp +
"_{ }#rightarrow_{ }#font[12]{W}^{#pm}^{ }#rightarrow_{ }#font[12]{e}^{^{ }#pm}^{ }#font[122]{+}_{ }#nu");
72 setTextFontSize(tlx, 10.0);
74 tlx=
new TLatex(x0+0.05,y0-0.11,SYMBOL_ET +
"^{^{ }#font[12]{e}} > 25 " + SYMBOL_GeV);
78 setTextFontSize(tlx, 10.0);
81 tlx=
new TLatex(0.4,0.75,
"#font[12]{W}^{#font[122]{-}}");
85 setTextFontSize(tlx, 10.0);
86 tlx=
new TLatex(0.4,0.22,
"#font[12]{W}^{#font[122]{+}}");
90 setTextFontSize(tlx, 10.0);
93 tlx=
new TLatex(0.025,.92,
"#font[12]{A_{L}}");
97 setTextFontSize(tlx, 10.0);
100 tlx=
new TLatex(0.73,.59,
"#font[12]{A_{L}}_{ }#font[122]{=} #frac{ " + SYMBOL_sigmaplus +
"_{ }#font[122]{-}_{ }" + SYMBOL_sigmaminus +
"}{ #shifty[0.1]{" + SYMBOL_sigmaplus +
"_{ }#font[122]{+}_{ }" + SYMBOL_sigmaminus +
"}}");
104 setLineWidthPoint(tlx, 0.5);
105 setTextFontSize(tlx, 10.0);
110 TLatex *lat3 =
new TLatex(0.25,0.87,
"Theory scaled by #pm 4.7%, #sqrt{s}=500 GeV");
113 lat3->SetTextColor(12);
115 setTextFontSize(lat3, 10.0);
120 tx=
new TLatex(-2,-0.72,dt.AsString());
122 setTextFontSize(tx, 10.0);
123 if(!justTheo) tx->Draw();
133 float x0=0.655, y0=0.508;
134 tlx=
new TLatex(x0,y0,
" #font[12]{W}^{#font[122]{-}} _{_{ }}#font[12]{W}^{#font[122]{+}} _{_{ }}#font[82]{RHICBOS:}");
138 setTextFontSize(tlx, 8.0);
139 TLegend *thLg[mxPN*2];
141 x=x0+0.06; y=y0-0.095;
142 thLg[0]=
new TLegend(x,y,x+0.27,y+0.09);
143 thLg[2]=
new TLegend(x,y0-dy,x+0.27,y0-dy);
144 x=x-0.07; thLg[1]=
new TLegend(x,y,x+0.27,y+0.09);
145 thLg[3]=
new TLegend(x,y0-dy,x+0.27,y0-dy);
147 for(
int iPN=0; iPN<mxPN*2;iPN++) {
148 TLegend *lg=thLg[iPN];
149 lg->SetFillColor(kWhite);
150 lg->SetLineColor(kWhite);
151 lg->SetShadowColor(kWhite);
154 char *theoL[mxTheo]={
" #font[82]{DNS}#shiftx[0.2]{-}K",
" #shifty[0.13]{#font[82]{DNS}#shiftx[0.2]{-}#font[82]{KKP}}",
" #font[82]{DSSV}08",
" #font[82]{DSSV}08"};
155 for(
int iPN=0; iPN<mxPN;iPN++) {
156 for (
int ith=0;ith<mxTheo; ith++){
157 TH1F *hTheo=hTheoA[iPN][ith];
158 if(justTheo==2) plotOneBandTheory(hTheo,ith);
160 int ko=0;
if(ith==3) ko=2;
162 thLg[iPN+ko]->AddEntry(hTheo,theoL[ith],
"l");
164 thLg[iPN+ko]->AddEntry(hTheo,
" ",
"l");
165 stripCmdLegend(thLg[iPN+ko]);
166 setTextFontSize(thLg[iPN+ko], 8.0);
175 tlx=
new TLatex(x0+.142,y0-dy+0.019,
"#font[82]{CHE:}");
179 setTextFontSize(tlx, 8.0);
182 ln=
new TLine(2,-0.4,2,0); ln->Draw();
195 TString inpCore=
"run9setP1234";
196 TString fullInpName=iPath; fullInpName+=inpCore;
197 fullInpName+=
".wasy.hist.root";
198 fdd=
new TFile(fullInpName);
199 if(! fdd->IsOpen()) {
200 printf(
"EROR: input histo file not found, quit\n",fullInpName.Data());
203 printf(
"Opened: %s\n",fullInpName.Data());
207 for(
int iq=0;iq<mxPN;iq++) {
208 TGraphErrors *gr=
new TGraphErrors;
209 gr->SetMarkerStyle(21-iq);
210 setMarkerSizePoint(gr, 3.5);
211 gr->SetMarkerColor(kBlack);
212 setLineWidthPoint(gr, 1);
213 gr->SetLineColor(kBlack);
216 if(iq==1) tt1=
"hAsyN";
217 TH1F *hAsy=(TH1F *)fdd->Get(tt1); assert( hAsy);
219 double asy=hAsy->GetBinContent(3);
220 double asyEr=hAsy->GetBinError(3);
221 printf(
"W %s AL=%.3f +/- %.3f nSig=%.1f\n", pnS[iq].Data(),asy,asyEr,asy/asyEr);
223 gr->SetPoint(0,0,asy);
224 gr->SetPointError(0,1.,asyEr);
236 for(
int iq=0;iq<mxPN;iq++) {
251 for(
int iq=0;iq<mxPN;iq++) {
252 float x=grP[iq]->GetX()[0];
253 float y=grP[iq]->GetY()[0];
256 float facYup=0.88, facYdw=1.12;
257 if(iq==1) facYup=1.16, facYdw=0.84;
259 bx=
new TBox(x-dx,y*facYdw,x+dx,y*facYup);
260 bx->Draw(); bx->SetFillColor(16);
264 float x0=-1.8,y0=-0.57;
265 bx=
new TBox(x0,y0,x0+2*dx,y0+0.08);
266 bx->Draw(); bx->SetFillColor(16);
268 tlx=
new TLatex(x0+0.2,y0+.05,
"Syst. uncertainty due to abs. ");
271 setTextFontSize(tlx, 8.0);
272 tlx=
new TLatex(x0+0.2,y0+.01,
"polarization and background");
275 setTextFontSize(tlx, 8.0);
286 void uploadTheoryRhicbos(){
287 for(
int iPN=0; iPN<mxPN;iPN++) {
288 TString nameUn=
"rb400_w"+pnL[iPN]+
"_unp_ct5m_pt25.root";
289 funp=
new TFile( iPath+nameUn); assert(funp->IsOpen());
290 hunp= (TH1F*)funp->Get(
"h3"); assert(hunp);
293 for (
int ith=0;ith<mxTheo-1; ith++){
294 TString namePol=
"rb400_w"+pnL[iPN]+
"_pol_"+theoNameA[ith]+
"_pt25.root";
296 fpol=
new TFile( iPath+namePol); assert(fpol->IsOpen());
297 TH1F* hpol=(TH1F*) fpol->Get(
"h3"); assert(hpol);
299 hal=(TH1F*) hpol->Clone();
301 TString hName=
"w"+pnL[iPN]+
"_"+theoNameA[ith];
302 TString hTitle=
"W"+pnS[iPN]+
" "+theoNameA[ith]+
"; lepton #eta";
304 hal->SetNameTitle(hName,hTitle);
307 hTheoA[iPN][ith]=hal;
308 hal->SetLineColor( theoCol[ith]);
309 if(iPN) hal->SetLineStyle(2+ith);
310 setLineWidthPoint(hal, 0.5);
317 c->cd(1);hunp->Draw();
318 c->cd(2);hpol->Draw();
320 c->cd(3);hal->Draw(); hal->SetLineColor(kRed);;
321 hal->SetMaximum(0.6); hal->SetMinimum(-0.6);
332 void uploadTheoryDeFlor(){
333 for(
int iPN=0; iPN<mxPN;iPN++) {
334 TString nameUn=
"deFlor_w"+pnL[iPN]+
"_unp_mrst02_pt25_full.root";
335 funp=
new TFile( iPath+nameUn); assert(funp->IsOpen());
336 hunp= (TH1F*)funp->Get(
"h3"); assert(hunp);
338 char * theoName=
"dssv08";
340 TString namePol=
"deFlor_w"+pnL[iPN]+
"_pol_"+theoName+
"_pt25_full.root";
341 fpol=
new TFile( iPath+namePol); assert(fpol->IsOpen());
342 TH1F* hpol=(TH1F*) fpol->Get(
"h3"); assert(hpol);
344 hal=(TH1F*) hpol->Clone();
346 TString hName=
"w"+pnL[iPN]+
"_deFlor_dssv";
347 TString hTitle=
"W"+pnS[iPN]+
" deFlor dssv; lepton #eta";
349 hal->SetNameTitle(hName,hTitle);
352 hTheoA[iPN][ith]=hal;
353 hal->SetLineColor( theoCol[ith]);
354 if(iPN) hal->SetLineStyle(2);
355 setLineWidthPoint(hal, 0.5);
366 void plotOneBandTheory(TH1F*hIn ,
int it) {
369 for(
int ib=0;ib<2;ib++){
370 TH1F * hu=(TH1F*) hIn->Clone();
373 TAxis *ax=hu->GetXaxis();
374 for(ib=1;ib<=ax->GetNbins();ib++){
375 float y= hu->GetBinContent(ib);
376 hu->SetBinError(ib,y*sysErr);
378 hu->SetFillStyle(3003+it);
380 hu->SetFillColor( hu->GetLineColor());