00001
00002
00003
00004 const int mx=4;
00005 const int mt=1;
00006 TFile *fd[mx];
00007 TCanvas *c1=0;
00008 int bg1[7][4],bg2[7][4];
00009 float cut1[7]={6,5,4,5,5,6,7};
00010
00011 BackgroundLL(){
00012 gStyle->SetPadGridX(0);
00013 gStyle->SetPadGridY(0);
00014 gStyle->SetCanvasColor(0);
00015 gStyle->SetOptStat(0);
00016 c=new TCanvas("tmp","tmp",700,500);
00017 float fptmin[7]={4.0,5.0,6.0,7.0,8.0,9.0,10.0};
00018 float fptmax[7]={5.0,6.0,7.0,8.0,9.0,10.0,25.0};
00019 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);
00020 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);
00021 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);
00022 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);
00023 const int nBins = 7;
00024 float bins[nBins+1] = {4,5,6,7,8,9,10,12};
00025 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);
00026 h4->SetMarkerStyle(8);
00027 #endif
00028 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);
00029 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);
00030 float baseLine=-0.14;
00031 float sysErr[7] = {0.00239,0.00521,0.00485,0.00405,0.012,0.0108,0.0104};
00032
00033
00034 psquare=0.3;
00035
00036 for(int i=0;i<7;i++){
00037 float bgll=0.0,bgll_error=0.0,bgll1=0.0,bgll1_error=0.0,bgll2=0.0,bgll2_error=0.0;
00038 Background(i, fptmin[i], fptmax[i]);
00039 int Nsame1=bg1[i][0]+bg1[i][3];
00040 int Nanti1=bg1[i][1]+bg1[i][2];
00041 int Nsame2=bg2[i][0]+bg2[i][3];
00042 int Nanti2=bg2[i][1]+bg2[i][2];
00043
00044
00045 bgll1=1.0/psquare*(Nsame1-Nanti1)/(Nsame1+Nanti1);
00046 bgll1_error=1.0/psquare*1.0/sqrt(Nsame1+Nanti1);
00047 bgll2=1.0/psquare*(Nsame2-Nanti2)/(Nsame2+Nanti2);
00048 bgll2_error=1.0/psquare*1.0/sqrt(Nsame2+Nanti2);
00049 bgll=0.5*(bgll1+bgll2);
00050 bgll_error=0.5*(bgll1_error+bgll2_error);
00051
00052 cout<<"bgll="<<bgll<<" error1="<<bgll1_error<<" error2="<<bgll2_error<<" error="<<bgll_error<<endl;
00053 h4->Fill(fptmin[i]+0.5,bgll);
00054 int nbin0=h4->FindBin(fptmin[i]+0.5);
00055 h4->SetBinError(nbin0,bgll_error);
00056
00057 hSys->SetBinContent(nbin0,baseLine + sysErr[i]);
00058 hB->SetBinContent(nbin0,baseLine);
00059
00060 }
00061
00062
00063 ifstream unp("theorycurve/pion-unp-cteq6-rap1to2.dat");
00064 ifstream g0("theorycurve/pion-pol-g0-rap1to2.dat");
00065 ifstream plusg("theorycurve/pion-pol-max-rap1to2.dat");
00066 ifstream minusg("theorycurve/pion-pol-maxminus-rap1to2.dat");
00067 ifstream stdg("theorycurve/pion-pol-std-rap1to2.dat");
00068 double x1=0.0,x2=0.0,x3=0.0,x4=0.0,x5=0.0;
00069 double d1=0.0,d2=0.0,d3=0.0,d4=0.0,d5=0.0;
00070 double b1=0.0,b2=0.0,b3=0.0,b4=0.0,b5=0.0;
00071 double c1=0.0,c2=0.0,c3=0.0,c4=0.0,c5=0.0;
00072 double y1=0.0,y2=0.0,y3=0.0,y4=0.0,y5=0.0;
00073 int ccount=0;
00074 double theoryd[18],theoryb[18],theoryc[18],theoryg[18];;
00075 while(1){
00076 unp>>y1>>y2>>y3>>y4>>y5;
00077 g0>>x1>>x2>>x3>>x4>>x5;
00078 plusg>>d1>>d2>>d3>>d4>>d5;
00079 minusg>>b1>>b2>>b3>>b4>>b5;
00080 stdg>>c1>>c2>>c3>>c4>>c5;
00081 theoryd[ccount]=d5/y5;
00082 theoryb[ccount]=b5/y5;
00083 theoryc[ccount]=c5/y5;
00084 theoryg[ccount]=x5/y5;
00085
00086 h5->Fill(d3,theoryd[ccount]);
00087 h6->Fill(b3,theoryb[ccount]);
00088 h7->Fill(c3,theoryc[ccount]);
00089 h8->Fill(x3,theoryg[ccount]);
00090 ccount++;
00091 if(ccount>17) break;
00092 }
00093 h5->Fill(8.0,0.03);
00094 h5->SetAxisRange(0,25,"X");
00095 h5->Fill(9.0,0.0305);
00096 h5->Fill(10.0,0.031);
00097 h5->Fill(10.5,0.0312);
00098 h5->Fill(11.5,0.031);
00099 h6->Fill(8.0,-0.001);
00100 h6->Fill(9.0,-0.0035);
00101 h6->Fill(10.0,-0.0065);
00102 h6->Fill(10.5,-0.0075);
00103 h6->Fill(11.5,-0.01);
00104 h7->Fill(8.0,0.0072);
00105 h7->Fill(9.0,0.0079);
00106 h7->Fill(10.0,0.0087);
00107 h7->Fill(10.5,0.0091);
00108 h7->Fill(11.5,0.0099);
00109 h8->Fill(8.0,0.00152);
00110 h8->Fill(9.0,0.00183);
00111 h8->Fill(10.0,0.00204);
00112 h8->Fill(10.5,0.0022);
00113 h8->Fill(11.5,0.0026);
00114 #if 1
00115
00116 c->cd(1);
00117 h5->SetLineColor(kRed);
00118 h5->Draw("C");
00119 h5->SetMinimum(-0.15);
00120 h5->SetMaximum(0.15);
00121 hB->SetFillColor(11);
00122 hB->Draw("same");
00123 hSys->SetFillColor(10);
00124 hSys->Draw("same");
00125 h6->SetLineColor(kGreen);
00126 h6->Draw("Csame");
00127 h7->Draw("Csame");
00128 h8->SetLineColor(kBlue);
00129 h8->Draw("Csame");
00130
00131 h4->Draw("E1same,p");
00132
00133 TLegend* leg = new TLegend(0.15,0.6,0.4,0.8);
00134 leg->AddEntry(h5,"#Delta{G}=G","L");
00135 leg->AddEntry(h6,"#Delta{G}=-G","L");
00136 leg->AddEntry(h7,"#Delta{G}=std","L");
00137 leg->AddEntry(h8,"#Delta{G}=0","L");
00138 leg->SetHeader("Vogelsang Prediction(GRSV)");
00139 leg->SetBorderSize(0.0);
00140 leg->SetFillColor(0.0);
00141 leg->Draw();
00142 TLegend* leg2 = new TLegend(0.6,0.75,0.9,0.85);
00143 leg2->SetHeader("STAR 2006 Preliminary #pi^{0}");
00144 leg2->SetBorderSize(0.0);
00145 leg2->SetFillColor(0.0);
00146 leg2->Draw();
00147
00148 #endif
00149 c->Print("tmp.gif");
00150 }
00151
00152 void Background(int key, float ptmin, float ptmax) {
00153
00154 int Realpi=0,backpi=0,totpi=0;
00155
00156 char *PlotName[mx]={"hMassPtUU","hMassPtUD","hMassPtDU","hMassPtDD"};
00157 char *fName[mt]={"allfill.hist"};
00158 TString inPath="";
00159
00160 gStyle->SetPalette(1,0);
00161 int i;
00162 for(i=0;i<mt;i++) {
00163 TString hFile=inPath+fName[i];
00164 hFile+=".root";
00165 fd0=new TFile(hFile); assert(fd0->IsOpen());
00166 fd[i]=fd0;
00167 }
00168
00169
00170 for(int ploti=0;ploti<mx;ploti++)
00171 {
00172 int ent=0;
00173 int minbin,maxbin;
00174 TH1F* h1= new TH1F("hMassAny","diphoton invariant mass",120,0.,1.2 );
00175 TString hname=PlotName[ploti];
00176 printf("i= %d =%s=\n",ploti,hname.Data());
00177 h0=(TH2F*)fd[0]->Get(hname); assert(h0);
00178 minbin=h0->GetYaxis()->FindBin(ptmin);
00179 maxbin=h0->GetYaxis()->FindBin(ptmax)-1;
00180 h1->Add(h0->ProjectionX("htemp",minbin,maxbin,""));
00181 ent=h1->Integral();
00182 bg1[key][ploti]=h1->Integral(5,9);
00183 bg2[key][ploti]=h1->Integral(20,41);
00184 cout<<"entry="<<ent<<" bg1="<<bg1[key][ploti]<<" bg2="<<bg2[key][ploti]<<endl;
00185 h1->SetEntries(ent);
00186
00187 }
00188 return;
00189
00190 }
00191