8 int bg1[7][4],bg2[7][4];
9 float cut1[7]={6,5,4,5,5,6,7};
12 gStyle->SetPadGridX(0);
13 gStyle->SetPadGridY(0);
14 gStyle->SetCanvasColor(0);
15 gStyle->SetOptStat(0);
16 c=
new TCanvas(
"tmp",
"tmp",700,500);
17 float fptmin[7]={4.0,5.0,6.0,7.0,8.0,9.0,10.0};
18 float fptmax[7]={5.0,6.0,7.0,8.0,9.0,10.0,25.0};
19 TH1F* h5=
new TH1F(
"A_LL_back",
"#vec{p}+#vec{p}->#pi^{0}X, #sqrt{s}=200Gev, 1.0#leq#eta#leq2.0;pT[Gev/c];A_{LL}_back",22,1.0,12.0);
20 TH1F* h6=
new TH1F(
"A_LL",
"#vec{p}+#vec{p}->#pi^{0}X, #sqrt{s}=200Gev, 1.089#leq#eta#leq2.0,P=60%;[Gev/c];A_{LL}",22,1.0,12.0);
21 TH1F* h7=
new TH1F(
"A_LL",
"#vec{p}+#vec{p}->#pi^{0}X, #sqrt{s}=200Gev, 1.089#leq#eta#leq2.0,P=60%;[Gev/c];A_{LL}",22,1.0,12.0);
22 TH1F* h8=
new TH1F(
"A_LL",
"#vec{p}+#vec{p}->#pi^{0}X, #sqrt{s}=200Gev, 1.089#leq#eta#leq2.0,P=60%;[Gev/c];A_{LL}",22,1.0,12.0);
24 float bins[nBins+1] = {4,5,6,7,8,9,10,12};
25 TH1F* h4 =
new TH1F(
"A_LL_back",
"#vec{p}+#vec{p}->#pi^{0}X, #sqrt{s}=200Gev, 1.0#leq#eta#leq2.0;pT[Gev/c];A_{LL};",nBins,bins);
26 h4->SetMarkerStyle(8);
28 TH1F* hSys =
new TH1F(
"A_LL_back",
"#vec{p}+#vec{p}->#pi^{0}X, #sqrt{s}=200Gev, 1.0#leq#eta#leq2.0;pT[Gev/c];A_{LL};",nBins,bins);
29 TH1F* hB =
new TH1F(
"A_LL_back",
"#vec{p}+#vec{p}->#pi^{0}X, #sqrt{s}=200Gev, 1.0#leq#eta#leq2.0;pT[Gev/c];A_{LL};",nBins,bins);
31 float sysErr[7] = {0.00239,0.00521,0.00485,0.00405,0.012,0.0108,0.0104};
37 float bgll=0.0,bgll_error=0.0,bgll1=0.0,bgll1_error=0.0,bgll2=0.0,bgll2_error=0.0;
38 Background(i, fptmin[i], fptmax[i]);
39 int Nsame1=bg1[i][0]+bg1[i][3];
40 int Nanti1=bg1[i][1]+bg1[i][2];
41 int Nsame2=bg2[i][0]+bg2[i][3];
42 int Nanti2=bg2[i][1]+bg2[i][2];
45 bgll1=1.0/psquare*(Nsame1-Nanti1)/(Nsame1+Nanti1);
46 bgll1_error=1.0/psquare*1.0/sqrt(Nsame1+Nanti1);
47 bgll2=1.0/psquare*(Nsame2-Nanti2)/(Nsame2+Nanti2);
48 bgll2_error=1.0/psquare*1.0/sqrt(Nsame2+Nanti2);
49 bgll=0.5*(bgll1+bgll2);
50 bgll_error=0.5*(bgll1_error+bgll2_error);
52 cout<<
"bgll="<<bgll<<
" error1="<<bgll1_error<<
" error2="<<bgll2_error<<
" error="<<bgll_error<<endl;
53 h4->Fill(fptmin[i]+0.5,bgll);
54 int nbin0=h4->FindBin(fptmin[i]+0.5);
55 h4->SetBinError(nbin0,bgll_error);
57 hSys->SetBinContent(nbin0,baseLine + sysErr[i]);
58 hB->SetBinContent(nbin0,baseLine);
63 ifstream unp(
"theorycurve/pion-unp-cteq6-rap1to2.dat");
64 ifstream g0(
"theorycurve/pion-pol-g0-rap1to2.dat");
65 ifstream plusg(
"theorycurve/pion-pol-max-rap1to2.dat");
66 ifstream minusg(
"theorycurve/pion-pol-maxminus-rap1to2.dat");
67 ifstream stdg(
"theorycurve/pion-pol-std-rap1to2.dat");
68 double x1=0.0,x2=0.0,x3=0.0,x4=0.0,x5=0.0;
69 double d1=0.0,d2=0.0,d3=0.0,d4=0.0,d5=0.0;
70 double b1=0.0,b2=0.0,b3=0.0,b4=0.0,b5=0.0;
71 double c1=0.0,c2=0.0,c3=0.0,c4=0.0,c5=0.0;
72 double y1=0.0,y2=0.0,y3=0.0,y4=0.0,y5=0.0;
74 double theoryd[18],theoryb[18],theoryc[18],theoryg[18];;
76 unp>>y1>>y2>>y3>>y4>>y5;
77 g0>>x1>>x2>>x3>>x4>>x5;
78 plusg>>d1>>d2>>d3>>d4>>d5;
79 minusg>>b1>>b2>>b3>>b4>>b5;
80 stdg>>c1>>c2>>c3>>c4>>c5;
81 theoryd[ccount]=d5/y5;
82 theoryb[ccount]=b5/y5;
83 theoryc[ccount]=c5/y5;
84 theoryg[ccount]=x5/y5;
86 h5->Fill(d3,theoryd[ccount]);
87 h6->Fill(b3,theoryb[ccount]);
88 h7->Fill(c3,theoryc[ccount]);
89 h8->Fill(x3,theoryg[ccount]);
94 h5->SetAxisRange(0,25,
"X");
97 h5->Fill(10.5,0.0312);
100 h6->Fill(9.0,-0.0035);
101 h6->Fill(10.0,-0.0065);
102 h6->Fill(10.5,-0.0075);
103 h6->Fill(11.5,-0.01);
104 h7->Fill(8.0,0.0072);
105 h7->Fill(9.0,0.0079);
106 h7->Fill(10.0,0.0087);
107 h7->Fill(10.5,0.0091);
108 h7->Fill(11.5,0.0099);
109 h8->Fill(8.0,0.00152);
110 h8->Fill(9.0,0.00183);
111 h8->Fill(10.0,0.00204);
112 h8->Fill(10.5,0.0022);
113 h8->Fill(11.5,0.0026);
117 h5->SetLineColor(kRed);
119 h5->SetMinimum(-0.15);
120 h5->SetMaximum(0.15);
121 hB->SetFillColor(11);
123 hSys->SetFillColor(10);
125 h6->SetLineColor(kGreen);
128 h8->SetLineColor(kBlue);
131 h4->Draw(
"E1same,p");
133 TLegend* leg =
new TLegend(0.15,0.6,0.4,0.8);
134 leg->AddEntry(h5,
"#Delta{G}=G",
"L");
135 leg->AddEntry(h6,
"#Delta{G}=-G",
"L");
136 leg->AddEntry(h7,
"#Delta{G}=std",
"L");
137 leg->AddEntry(h8,
"#Delta{G}=0",
"L");
138 leg->SetHeader(
"Vogelsang Prediction(GRSV)");
139 leg->SetBorderSize(0.0);
140 leg->SetFillColor(0.0);
142 TLegend* leg2 =
new TLegend(0.6,0.75,0.9,0.85);
143 leg2->SetHeader(
"STAR 2006 Preliminary #pi^{0}");
144 leg2->SetBorderSize(0.0);
145 leg2->SetFillColor(0.0);
152 void Background(
int key,
float ptmin,
float ptmax) {
154 int Realpi=0,backpi=0,totpi=0;
156 char *PlotName[mx]={
"hMassPtUU",
"hMassPtUD",
"hMassPtDU",
"hMassPtDD"};
157 char *fName[mt]={
"allfill.hist"};
160 gStyle->SetPalette(1,0);
163 TString hFile=inPath+fName[i];
165 fd0=
new TFile(hFile); assert(fd0->IsOpen());
170 for(
int ploti=0;ploti<mx;ploti++)
174 TH1F* h1=
new TH1F(
"hMassAny",
"diphoton invariant mass",120,0.,1.2 );
175 TString hname=PlotName[ploti];
176 printf(
"i= %d =%s=\n",ploti,hname.Data());
177 h0=(TH2F*)fd[0]->Get(hname); assert(h0);
178 minbin=h0->GetYaxis()->FindBin(ptmin);
179 maxbin=h0->GetYaxis()->FindBin(ptmax)-1;
180 h1->Add(h0->ProjectionX(
"htemp",minbin,maxbin,
""));
182 bg1[key][ploti]=h1->Integral(5,9);
183 bg2[key][ploti]=h1->Integral(20,41);
184 cout<<
"entry="<<ent<<
" bg1="<<bg1[key][ploti]<<
" bg2="<<bg2[key][ploti]<<endl;