1 void getSpectrumDAU(
const char *pid)
8 Bool_t subtractNEUTRONS=kTRUE;
14 Double_t B[]={0.3,0.23,0.072,0.061};
16 Double_t T[]={0.205,0.215,0.179,0.173};
18 Double_t n[]={11.00,12.55,10.87,10.49};
20 TF1 *f_antineutron=
new TF1(
"f_antineutron",
"[0]/pow((1.+(sqrt(x*x+1.) - 1.)/([1]*[2])),[2])",0.,15.);
21 f_antineutron->SetParameters(B[1],T[1],n[1]);
24 ifstream pQCDphotons(
"./datapoints/pQCD_Werner/rhic_cteq6_gamma_inv_sc1.dat");
28 cout<<
"pqcd photons:"<<endl;
30 if(!pQCDphotons.good())
break;
32 pQCDphotons>>ppx[iii]>>dummy>>dummy>>ppy[iii];
33 ppy[iii]*=1.e-09*7.5/42.;
36 TGraph *g_dirgamma=
new TGraph(iii,ppx,ppy);
38 ifstream pQCDphotons05(
"./datapoints/pQCD_Werner/rhic_cteq6_gamma_inv_sc05.dat");
43 if(!pQCDphotons05.good())
break;
45 pQCDphotons05>>ppx05[iii05]>>dummy>>dummy>>ppy05[iii05];
46 ppy05[iii05]*=1.e-09*7.5/42.;
49 TGraph *g_dirgamma05=
new TGraph(iii05,ppx05,ppy05);
51 ifstream pQCDphotons2(
"./datapoints/pQCD_Werner/rhic_cteq6_gamma_inv_sc2.dat");
56 if(!pQCDphotons2.good())
break;
58 pQCDphotons2>>ppx2[iii2]>>dummy>>dummy>>ppy2[iii2];
59 ppy2[iii2]*=1.e-09*7.5/42.;
62 TGraph *g_dirgamma2=
new TGraph(iii2,ppx2,ppy2);
65 ifstream phenix(
"./datapoints/phenix.dat");
72 if(!phenix.good())
break;
73 phenix>>phex[iphe]>>phey[iphe]>>ephey[iphe];
77 TGraphErrors *phenix_dau=
new TGraphErrors(iphe,phex,phey,ephex,ephey);
78 phenix_dau->SetMarkerStyle(24);
79 phenix_dau->SetName(
"phenix_dau");
82 ifstream pQCDpions(
"./datapoints/pQCD_Werner/klaus_pi0inv_200_kkp_1.dat");
87 if(!pQCDpions.good())
break;
88 pQCDpions>>pionx[ipion]>>piony[ipion];
91 TGraphErrors *kkp=
new TGraphErrors(ipion,pionx,piony);
92 kkp->SetLineColor(54);
96 ifstream pQCDpions05(
"./datapoints/pQCD_Werner/klaus_pi0inv_200_kkp_05.dat");
101 if(!pQCDpions05.good())
break;
102 pQCDpions05>>pionx05[ipion05]>>piony05[ipion05];
105 TGraphErrors *kkp05=
new TGraphErrors(ipion05,pionx05,piony05);
106 kkp05->SetLineStyle(2);
107 kkp05->SetLineColor(54);
108 kkp05->SetName(
"kkp05");
111 ifstream pQCDpions2(
"./datapoints/pQCD_Werner/klaus_pi0inv_200_kkp_2.dat");
116 if(!pQCDpions2.good())
break;
117 pQCDpions2>>pionx2[ipion2]>>piony2[ipion2];
120 TGraphErrors *kkp2=
new TGraphErrors(ipion2,pionx2,piony2);
121 kkp2->SetLineStyle(2);
122 kkp2->SetLineColor(54);
123 kkp2->SetName(
"kkp2");
125 TFile *f_decaybg=
new TFile(
"~/MyDecay/gammaDecayDAUSum.root",
"OPEN");
126 TH1F *h_decaybg=(TH1F*)f_decaybg->Get(
"gamma");
127 TH1F *h_decaypion=(TH1F*)f_decaybg->Get(
"gamma_pion");
128 TF1 *fit_decay=
new TF1(
"fit_decay",
"[0]/pow(x,[1])+[2]",.3,15.);
129 TF1 *fit_piondecay=
new TF1(*fit_decay);
130 fit_decay->SetParameters(1.,1.,.5);
131 fit_piondecay->SetParameters(1.,1.,.5);
132 h_decaybg->Fit(fit_decay,
"R0");
133 h_decaypion->Fit(fit_piondecay,
"R0Q");
135 TCanvas *c_test=
new TCanvas();
137 fit_decay->Draw(
"same");
138 c_test->SaveAs(
"test.eps");
141 for(Int_t i=0;i<iii;i++){
142 ppy[i]=ppy[i]/piony[i];
143 ppy[i]=ppy[i]/fit_decay->Eval(ppx[i]);
145 ppy05[i]=ppy05[i]/piony05[i];
146 ppy05[i]=ppy05[i]/fit_decay->Eval(ppx05[i]);
148 ppy2[i]=ppy2[i]/piony2[i];
149 ppy2[i]=ppy2[i]/fit_decay->Eval(ppx2[i]);
152 TGraphErrors *g_photonpqcd=
new TGraphErrors(iii,ppx,ppy);
153 g_photonpqcd->SetName(
"g_photonpqcd");
154 TGraphErrors *g_photonpqcd05=
new TGraphErrors(iii05,ppx05,ppy05);
155 g_photonpqcd05->SetName(
"g_photonpqcd05");
156 TGraphErrors *g_photonpqcd2=
new TGraphErrors(iii2,ppx2,ppy2);
157 g_photonpqcd2->SetName(
"g_photonpqcd2");
160 TString dir(
"/star/u/russcher/gamma/analysis/output/dAu/");
165 TString psout_eta=dir;
167 TString eFileGamma=dir;
169 TString nbarFile=dir;
171 eFile.Append(
"pion_eff.root");
172 eFileGamma.Append(
"gamma_eff.root");
173 pi0File.Append(
"pi0_dAu.root");
174 nbarFile.Append(
"antineutron_eff.root");
175 psout_eta.Append(
"/dev/null");
176 psout.Append(
"invmassplots.ps");
179 gSystem->Load(
"$HOME/MyEvent/MyEvent");
180 gSystem->Load(
"$HOME/gamma/analysis/lib/AnaCuts");
181 gSystem->Load(
"$HOME/gamma/analysis/lib/EventMixer");
182 gSystem->Load(
"$HOME/gamma/analysis/lib/Pi0Analysis");
188 TFile f(pi0File.Data(),
"OPEN");
189 TH2F *h_mb=
new TH2F(*h_minvMB);
190 TH2F *h_ht1=
new TH2F(*h_minvHT1);
191 TH2F *h_ht2=
new TH2F(*h_minvHT2);
192 TH1F *h_ev=
new TH1F(*h_events);
196 TFile *file_nbar=
new TFile(nbarFile,
"OPEN");
197 TH1F *h_nbarEffMB=
new TH1F(*h_effMB);
198 h_nbarEffMB->Sumw2();
199 TH1F *h_nbarEffHT1=
new TH1F(*h_effHT1);
200 h_nbarEffHT1->Sumw2();
201 TH1F *h_nbarEffHT2=
new TH1F(*h_effHT2);
202 h_nbarEffHT2->Sumw2();
209 for(Int_t i=1;i<=h_ev->GetNbinsX();i++)
211 trigger=(Int_t)h_ev->GetBinCenter(i);
212 if(trigger&1) numberOfMB+=(Int_t)h_ev->GetBinContent(i);
213 if(trigger&2) numberOfHT1+=(Int_t)h_ev->GetBinContent(i);
214 if(trigger&4) numberOfHT2+=(Int_t)h_ev->GetBinContent(i);
217 cout<<
"number of mb: "<<numberOfMB<<endl;
219 cout<<
"nmb after 93% vertex eff.: "<<numberOfMB<<endl;
226 TFile g(eFile.Data(),
"OPEN");
227 TH1F *h_emb=
new TH1F(*h_effMB);
228 TH1F *h_eht1=
new TH1F(*h_effHT1);
229 TH1F *h_eht2=
new TH1F(*h_effHT2);
233 TF1 *pion_cpv_corrMB=
new TF1(
"pion_cpv_corrMB",
"1./(1.-0.01*(0.4+0.05*x))",0.,15.);
234 TF1 *pion_cpv_corrHT1=
new TF1(
"pion_cpv_corrHT1",
"1./(1.-0.01*(0.4+0.07*x))",0.,15.);
235 TF1 *pion_cpv_corrHT2=
new TF1(
"pion_cpv_corrHT2",
"1./(1.-0.01*(0.5+0.06*x))",0.,15.);
237 TF1 *gamma_cpv_corrMB=
new TF1(
"gamma_cpv_corrMB",
"1./(1.-0.01*(4.1+0.4*x))",0.,15.);
238 TF1 *gamma_cpv_corrHT1=
new TF1(
"gamma_cpv_corrHT1",
"1./(1.-0.01*(3.4+0.5*x))",0.,15.);
239 TF1 *gamma_cpv_corrHT2=
new TF1(
"gamma_cpv_corrHT2",
"1./(1.-0.01*(4.9+0.3*x))",0.,15.);
240 TF1 *gamma_cont_corrMB=
new TF1(
"gamma_cont_corrMB",
"0.98",0.,15.);
241 TF1 *gamma_cont_corrHT1=
new TF1(
"gamma_cont_corrHT1",
"0.98",0.,15.);
242 TF1 *gamma_cont_corrHT2=
new TF1(
"gamma_cont_corrHT2",
"0.965",0.,15.);
246 TF1 *pion_conv_corrMB=
new TF1(
"pion_conv_corrMB",
"1.15",0.,15.);
247 TF1 *pion_conv_corrHT1=
new TF1(
"pion_conv_corrHT1",
"1.15",0.,15.);
248 TF1 *pion_conv_corrHT2=
new TF1(
"pion_conv_corrHT2",
"1.15",0.,15.);
250 TF1 *gamma_conv_corrMB=
new TF1(
"gamma_conv_corrMB",
"1.08",0.,15.);
251 TF1 *gamma_conv_corrHT1=
new TF1(
"gamma_conv_corrHT1",
"1.08",0.,15.);
252 TF1 *gamma_conv_corrHT2=
new TF1(
"gamma_conv_corrHT2",
"1.08",0.,15.);
255 TFile binf(
"~/BinWidth/bincorrectionsDAU.root",
"OPEN");
256 TH1F *h_binmb=
new TH1F(*h4mb);
257 TH1F *h_binht1=
new TH1F(*h4ht1);
258 TH1F *h_binht2=
new TH1F(*h4ht2);
262 for(Int_t i=1;i<=h_binmb->GetNbinsX();i++) h_binmb->SetBinError(i,0);
263 for(Int_t i=1;i<=h_binht1->GetNbinsX();i++) h_binht1->SetBinError(i,0);
264 for(Int_t i=1;i<=h_binht2->GetNbinsX();i++) h_binht2->SetBinError(i,0);
268 pi0->init(
"/dev/null");
269 TH1F *pionYieldMB=
new TH1F(*pi0->getYield(h_mb,
"mb"));
270 TH1F *pionYieldHT1=
new TH1F(*pi0->getYield(h_ht1,
"ht1"));
271 TH1F *pionYieldHT2=
new TH1F(*pi0->getYield(h_ht2,
"ht2"));
272 pi0->storeCanvases((dir+
"canvases.root").Data());
274 cout<<
"***************************************"<<endl;
275 cout<<
"got yield, dividing by rapidity bite!!!"<<endl;
276 float dy_gamma=cuts->rapidityMaxCUT - cuts->rapidityMinCUT;
277 float dy_pion=cuts->rapPionMaxCUT - cuts->rapPionMinCUT;
278 cout<<
"***************************************"<<endl;
280 cout<<
" pion bite is "<<dy_pion<<endl;
281 cout<<
" gamma bite is "<<dy_gamma<<endl;
283 cout<<
"***************************************"<<endl;
285 pionYieldMB->Scale(1./dy_pion);
286 pionYieldHT1->Scale(1./dy_pion);
287 pionYieldHT2->Scale(1./dy_pion);
317 pionYieldMB->SetMarkerStyle(8);
318 pionYieldMB->SetMarkerSize(1.0);
319 pionYieldHT1->SetMarkerStyle(8);
320 pionYieldHT1->SetMarkerSize(1.0);
321 pionYieldHT1->SetMarkerColor(4);
322 pionYieldHT2->SetMarkerStyle(8);
323 pionYieldHT2->SetMarkerSize(1.0);
324 pionYieldHT2->SetMarkerColor(2);
326 TF1 *scale=
new TF1(
"scale",
"x",0.,15.);
328 pionYieldMB->SetNameTitle(
"pionYieldMB",
"corrected yield MB");
329 pionYieldMB->Divide(h_emb);
330 pionYieldMB->Scale(psMB/(psMB*numberOfMB*2.*TMath::Pi()));
331 pionYieldMB->Divide(scale);
332 pionYieldMB->Multiply(h_binmb);
333 pionYieldMB->Multiply(pion_cpv_corrMB);
334 pionYieldMB->Multiply(pion_conv_corrMB);
336 pionYieldHT1->SetNameTitle(
"pionYieldHT1",
"corrected yield HT1");
337 pionYieldHT1->Divide(h_eht1);
338 pionYieldHT1->Scale(psHT1/(psMB*numberOfMB*2.*TMath::Pi()));
339 pionYieldHT1->Divide(scale);
340 pionYieldHT1->Multiply(h_binht1);
341 pionYieldHT1->Multiply(pion_cpv_corrHT1);
342 pionYieldHT1->Multiply(pion_conv_corrHT1);
344 pionYieldHT2->SetNameTitle(
"pionYieldHT2",
"corrected yield HT2");
345 pionYieldHT2->Divide(h_eht2);
346 pionYieldHT2->Scale(psHT2/(psMB*numberOfMB*2.*TMath::Pi()));
347 pionYieldHT2->Divide(scale);
348 pionYieldHT2->Multiply(h_binht2);
349 pionYieldHT2->Multiply(pion_cpv_corrHT2);
350 pionYieldHT2->Multiply(pion_conv_corrHT2);
353 TH1F *pionYieldMBratio=
new TH1F(*pionYieldMB);
354 TH1F *pionYieldHT1ratio=
new TH1F(*pionYieldHT1);
355 TH1F *pionYieldHT2ratio=
new TH1F(*pionYieldHT2);
357 TH1F *pionXsMB=
new TH1F(*pionYieldMB);
358 TH1F *pionXsHT1=
new TH1F(*pionYieldHT1);
359 TH1F *pionXsHT2=
new TH1F(*pionYieldHT2);
361 TH1F *pionXsMBnoErr=
new TH1F(*pionXsMB);
362 TH1F *pionXsHT1noErr=
new TH1F(*pionXsHT1);
363 TH1F *pionXsHT2noErr=
new TH1F(*pionXsHT2);
364 for(
int i=1;i<=pionXsMBnoErr->GetNbinsX();i++){
365 pionXsMBnoErr->SetBinError(i,0.);
367 for(
int i=1;i<=pionXsHT1noErr->GetNbinsX();i++){
368 pionXsHT1noErr->SetBinError(i,0.);
370 for(
int i=1;i<=pionXsHT2noErr->GetNbinsX();i++){
371 pionXsHT2noErr->SetBinError(i,0.);
374 TGraphErrors *g_pionXsMB=
new TGraphErrors(pionXsMB);
375 g_pionXsMB->SetName(
"g_pionXsMB");
376 removeThesePoints(g_pionXsMB,1);
378 TGraphErrors *g_pionXsHT1=
new TGraphErrors(pionXsHT1);
379 g_pionXsHT1->SetName(
"g_pionXsHT1");
380 removeThesePoints(g_pionXsHT1,2);
382 TGraphErrors *g_pionXsHT2=
new TGraphErrors(pionXsHT2);
383 g_pionXsHT2->SetName(
"g_pionXsHT2");
384 removeThesePoints(g_pionXsHT2,3);
387 cout<<endl<<
"yield: x y ex ey"<<endl;
388 cout<<
"minbias"<<endl;
389 printPoints(g_pionXsMB);
390 cout<<endl<<
"hightower-1"<<endl;
391 printPoints(g_pionXsHT1);
392 cout<<endl<<
"hightower-2"<<endl;
393 printPoints(g_pionXsHT2);
398 TMultiGraph *m_pions_fit=
new TMultiGraph();
399 m_pions_fit->SetName(
"m_pions_fit");
400 m_pions_fit->SetMinimum(1.0e-10);
401 m_pions_fit->SetMaximum(.1);
404 m_pions_fit->Add(g_pionXsMB);
405 m_pions_fit->Add(g_pionXsHT1);
406 m_pions_fit->Add(g_pionXsHT2);
408 TF1 *fitQCD=
new TF1(
"fitQCD",sumpqcd,1.,15.,6);
409 fitQCD->SetParameters(100.,-9.,1.,-8.5,1.,6.);
410 fitQCD->FixParameter(4,2.);
411 m_pions_fit->Fit(fitQCD,
"R");
413 bool inclPhenix=
true;
414 bool inclSasha=
false;
416 TCanvas *compare=
new TCanvas(
"compare",
"compare;p_{T}:xsec (mb)",600,750);
419 TPad *padt=
new TPad(
"padt",
"",0.0,0.3,1.,1.0);
420 padt->SetBottomMargin(0.001);
421 padt->SetLeftMargin(0.15);
422 TPad *padb=
new TPad(
"padb",
"",0.0,0.0,1.,0.3);
423 padb->SetTopMargin(0.001);
424 padb->SetBottomMargin(0.25);
425 padb->SetLeftMargin(0.15);
431 TMultiGraph *m_pions=
new TMultiGraph();
432 m_pions->SetName(
"m_pions");
438 m_pions->Add(phenix_dau);
443 g_pionXsHT1->Print();
445 g_pionXsHT2->Print();
449 m_pions->Add(g_pionXsMB);
450 m_pions->Add(g_pionXsHT1);
451 m_pions->Add(g_pionXsHT2);
453 m_pions->SetMinimum(5.0e-10);
454 m_pions->SetMaximum(.099);
455 m_pions->SetTitle(
";p_{T} (GeV/c);invariant yield");
460 TLegend *leg=
new TLegend(.5,.5,.85,.85);
462 if(inclPhenix) leg->AddEntry(phenix_dau,
"PHENIX d+Au",
"p");
463 if(inclSasha) leg->AddEntry(sasha_dau,
"sasha's d+Au",
"p");
464 leg->AddEntry(g_pionXsMB,
"d+Au minimum bias",
"p");
465 leg->AddEntry(g_pionXsHT1,
"hightower 1",
"p");
466 leg->AddEntry(g_pionXsHT2,
"hightower 2",
"p");
468 leg->SetFillColor(0);
475 TGraphErrors *phenix_dau2=
new TGraphErrors(*phenix_dau);
476 divideGraphWithFunction(phenix_dau2,fitQCD);
477 TGraphErrors *g_pionXsMBcopy=
new TGraphErrors(*g_pionXsMB);
478 divideGraphWithFunction(g_pionXsMBcopy,fitQCD);
479 TGraphErrors *g_pionXsHT1copy=
new TGraphErrors(*g_pionXsHT1);
480 divideGraphWithFunction(g_pionXsHT1copy,fitQCD);
481 TGraphErrors *g_pionXsHT2copy=
new TGraphErrors(*g_pionXsHT2);
482 divideGraphWithFunction(g_pionXsHT2copy,fitQCD);
484 TMultiGraph *m_pions2=
new TMultiGraph();
486 if(inclPhenix) m_pions2->Add(phenix_dau2);
487 m_pions2->Add(g_pionXsMBcopy);
488 m_pions2->Add(g_pionXsHT1copy);
489 m_pions2->Add(g_pionXsHT2copy);
490 m_pions2->SetMinimum(0.01);
491 m_pions2->SetMaximum(1.99);
492 m_pions2->Draw(
"ap");
494 compare->SaveAs((dir+
"pionyield_dau.eps").Data());
495 compare->SaveAs((dir+
"pionyield_dau.root").Data());
503 TFile gg(eFile.Data(),
"OPEN");
504 TH1F *effGammaMB=
new TH1F(*h_effDaughtersMB);
505 TH1F *effGammaHT1=
new TH1F(*h_effDaughtersHT1);
506 TH1F *effGammaHT2=
new TH1F(*h_effDaughtersHT2);
509 TFile gg_single(eFileGamma.Data(),
"OPEN");
510 TH1F *effGammaSingleMB=
new TH1F(*h_effMB);
511 TH1F *effGammaSingleHT1=
new TH1F(*h_effHT1);
512 TH1F *effGammaSingleHT2=
new TH1F(*h_effHT2);
515 TFile ff(pi0File.Data(),
"OPEN");
516 TH1F *gammaYieldMB=
new TH1F(*h_gammaMB);
517 TH1F *gammaYieldHT1=
new TH1F(*h_gammaHT1);
518 TH1F *gammaYieldHT2=
new TH1F(*h_gammaHT2);
521 gammaYieldMB->Scale(1./dy_gamma);
522 gammaYieldHT1->Scale(1./dy_gamma);
523 gammaYieldHT2->Scale(1./dy_gamma);
526 for(Int_t i=1;i<=gammaYieldMB->GetNbinsX();i++){
527 gammaYieldMB->SetBinContent(i,gammaYieldMB->GetBinContent(i)/gammaYieldMB->GetXaxis()->GetBinWidth(i));
528 gammaYieldMB->SetBinError(i,gammaYieldMB->GetBinError(i)/gammaYieldMB->GetXaxis()->GetBinWidth(i));
530 gammaYieldMB->Scale(psMB/(psMB*numberOfMB*2.*TMath::Pi()));
531 gammaYieldMB->Divide(scale);
532 gammaYieldMB->Multiply(h_binmb);
533 gammaYieldMB->Divide(effGammaMB);
534 gammaYieldMB->Multiply(gamma_cpv_corrMB);
535 gammaYieldMB->Multiply(gamma_cont_corrMB);
536 gammaYieldMB->Multiply(gamma_conv_corrMB);
538 gammaYieldMB->SetMarkerStyle(8);
539 gammaYieldMB->SetMarkerSize(1.);
540 TGraphErrors *g_inclPhotonsMB=
new TGraphErrors(gammaYieldMB);
543 for(Int_t i=1;i<=gammaYieldHT1->GetNbinsX();i++){
544 gammaYieldHT1->SetBinContent(i,gammaYieldHT1->GetBinContent(i)/gammaYieldHT1->GetXaxis()->GetBinWidth(i));
545 gammaYieldHT1->SetBinError(i,gammaYieldHT1->GetBinError(i)/gammaYieldHT1->GetXaxis()->GetBinWidth(i));
547 gammaYieldHT1->Scale(psHT1/(psMB*numberOfMB*2.*TMath::Pi()));
548 gammaYieldHT1->Divide(scale);
549 gammaYieldHT1->Multiply(h_binht1);
550 gammaYieldHT1->Divide(effGammaHT1);
551 gammaYieldHT1->Multiply(gamma_cpv_corrHT1);
552 gammaYieldHT1->Multiply(gamma_cont_corrHT1);
553 gammaYieldHT1->Multiply(gamma_conv_corrHT1);
555 gammaYieldHT1->SetMarkerStyle(8);
556 gammaYieldHT1->SetMarkerSize(1.);
557 gammaYieldHT1->SetMarkerColor(4);
558 TGraphErrors *g_inclPhotonsHT1=
new TGraphErrors(gammaYieldHT1);
561 for(Int_t i=1;i<=gammaYieldHT2->GetNbinsX();i++){
562 gammaYieldHT2->SetBinContent(i,gammaYieldHT2->GetBinContent(i)/gammaYieldHT2->GetXaxis()->GetBinWidth(i));
563 gammaYieldHT2->SetBinError(i,gammaYieldHT2->GetBinError(i)/gammaYieldHT2->GetXaxis()->GetBinWidth(i));
565 gammaYieldHT2->Scale(psHT2/(psMB*numberOfMB*2.*TMath::Pi()));
566 gammaYieldHT2->Divide(scale);
567 gammaYieldHT2->Multiply(h_binht2);
568 gammaYieldHT2->Divide(effGammaHT2);
569 gammaYieldHT2->Multiply(gamma_cpv_corrHT2);
570 gammaYieldHT2->Multiply(gamma_cont_corrHT2);
571 gammaYieldHT2->Multiply(gamma_conv_corrHT2);
573 gammaYieldHT2->SetMarkerStyle(8);
574 gammaYieldHT2->SetMarkerSize(1.);
575 gammaYieldHT2->SetMarkerColor(2);
576 TGraphErrors *g_inclPhotonsHT2=
new TGraphErrors(gammaYieldHT2);
579 removeThesePoints(g_inclPhotonsMB,1);
580 removeThesePoints(g_inclPhotonsHT1,2);
581 removeThesePoints(g_inclPhotonsHT2,3);
584 TMultiGraph *m_incl=
new TMultiGraph();
585 m_incl->SetTitle(
"inclusive photon invariant yield 0<y<1;p_{T} (GeV/c);#frac{1}{2#piNp_{T}} #frac{d^{2}N}{dydp_{T}}");
586 m_incl->Add(g_inclPhotonsMB);
587 m_incl->Add(g_inclPhotonsHT1);
588 m_incl->Add(g_inclPhotonsHT2);
590 m_incl->Fit(fitQCD,
"R0");
592 m_incl->SetMinimum(1.e-11);
593 m_incl->SetMaximum(10.);
594 TCanvas *c_incl=
new TCanvas(
"c_incl",
"c_incl",600,400);
597 c_incl->SaveAs((dir+
"inclPhotonYield.eps").Data());
598 c_incl->SaveAs((dir+
"inclPhotonYield.root").Data());
603 TH1F *gammaYieldMBratio=
new TH1F(*gammaYieldMB);
604 gammaYieldMBratio->SetName(
"gammaYieldMBratio");
605 TH1F *gammaYieldHT1ratio=
new TH1F(*gammaYieldHT1);
606 gammaYieldHT1ratio->SetName(
"gammaYieldHT1ratio");
607 TH1F *gammaYieldHT2ratio=
new TH1F(*gammaYieldHT2);
608 gammaYieldHT2ratio->SetName(
"gammaYieldHT2ratio");
610 gammaYieldMBratio->Divide(pionYieldMBratio);
611 gammaYieldHT1ratio->Divide(pionYieldHT1ratio);
612 gammaYieldHT2ratio->Divide(pionYieldHT2ratio);
615 getRatio(gammaYieldMBratio,effGammaMB,effGammaSingleMB,fit_piondecay);
616 getRatio(gammaYieldHT1ratio,effGammaHT1,effGammaSingleHT1,fit_piondecay);
617 getRatio(gammaYieldHT2ratio,effGammaHT2,effGammaSingleHT2,fit_piondecay);
619 TH1F *gammaYieldMBratio_incl=
new TH1F(*gammaYieldMBratio);
620 TH1F *gammaYieldHT1ratio_incl=
new TH1F(*gammaYieldHT1ratio);
621 TH1F *gammaYieldHT2ratio_incl=
new TH1F(*gammaYieldHT2ratio);
624 TH1F *gammaYieldMBratioNoErr=
new TH1F(*gammaYieldMBratio);
625 TH1F *gammaYieldHT1ratioNoErr=
new TH1F(*gammaYieldHT1ratio);
626 TH1F *gammaYieldHT2ratioNoErr=
new TH1F(*gammaYieldHT2ratio);
627 for(
int i=1;i<=gammaYieldMBratioNoErr->GetNbinsX();i++){
628 gammaYieldMBratioNoErr->SetBinError(i,0.);
630 for(
int i=1;i<=gammaYieldHT1ratioNoErr->GetNbinsX();i++){
631 gammaYieldHT1ratioNoErr->SetBinError(i,0.);
633 for(
int i=1;i<=gammaYieldHT2ratioNoErr->GetNbinsX();i++){
634 gammaYieldHT2ratioNoErr->SetBinError(i,0.);
637 TGraphErrors *g_ratioMB=
new TGraphErrors(gammaYieldMBratio);
638 g_ratioMB->SetName(
"g_ratioMB");
639 TGraphErrors *g_ratioHT1=
new TGraphErrors(gammaYieldHT1ratio);
640 g_ratioHT1->SetName(
"g_ratioHT1");
641 TGraphErrors *g_ratioHT2=
new TGraphErrors(gammaYieldHT2ratio);
642 g_ratioHT2->SetName(
"g_ratioHT2");
645 removeThesePoints(g_ratioMB,1);
646 removeThesePoints(g_ratioHT1,2);
647 removeThesePoints(g_ratioHT2,3);
649 TCanvas *c_ratio=
new TCanvas(
"c_ratio",
"c_ratio",400,200);
651 TMultiGraph *m_ratio=
new TMultiGraph(
"m_ratio",
"d+Au 2003;p_{T};#gamma/#pi^{0}");
652 m_ratio->Add(g_ratioMB);
653 m_ratio->Add(g_ratioHT1);
654 m_ratio->Add(g_ratioHT2);
657 m_ratio->SetMinimum(.0);
658 m_ratio->SetMaximum(2.);
660 TLegend *leg3=
new TLegend(.35,.65,.65,.85);
661 leg3->AddEntry(g_ratioMB,
"minimum bias",
"p");
662 leg3->AddEntry(g_ratioHT1,
"hightower 1",
"p");
663 leg3->AddEntry(g_ratioHT2,
"hightower 2",
"p");
664 leg3->AddEntry(fit_decay,
"decay background (total)",
"l");
665 leg3->AddEntry(fit_piondecay,
"decay background (#pi^{0})",
"l");
666 leg3->SetFillColor(0);
669 fit_decay->SetLineColor(13);
670 fit_decay->SetLineWidth(1);
671 fit_decay->SetLineColor(1);
672 fit_decay->Draw(
"same");
673 fit_piondecay->SetLineColor(13);
674 fit_piondecay->SetLineWidth(1);
675 fit_piondecay->SetLineStyle(2);
676 fit_piondecay->SetLineColor(1);
677 fit_piondecay->Draw(
"same");
680 c_ratio->SaveAs((dir+
"gammaOverPion.eps").Data());
681 c_ratio->SaveAs((dir+
"gammaOverPion.root").Data());
685 gammaYieldMBratio_incl->Multiply(pionYieldMBratio);
686 gammaYieldHT1ratio_incl->Multiply(pionYieldHT1ratio);
687 gammaYieldHT2ratio_incl->Multiply(pionYieldHT2ratio);
689 TGraphErrors *g_incl_corrMB=
new TGraphErrors(gammaYieldMBratio_incl);
690 TGraphErrors *g_incl_corrHT1=
new TGraphErrors(gammaYieldHT1ratio_incl);
691 TGraphErrors *g_incl_corrHT2=
new TGraphErrors(gammaYieldHT2ratio_incl);
693 TCanvas *c_incl_corr=
new TCanvas(
"c_incl_corr",
"c_incl_corr",400,300);
695 TMultiGraph *m_incl_corr=
new TMultiGraph();
696 m_incl_corr->Add(g_incl_corrMB);
697 m_incl_corr->Add(g_incl_corrHT1);
698 m_incl_corr->Add(g_incl_corrHT2);
700 m_incl_corr->SetMinimum(1.e-11);
701 m_incl_corr->SetMaximum(1.);
703 m_incl_corr->Draw(
"apX");
704 c_incl_corr->SaveAs((dir+
"inclPhotonYieldCorr.eps").Data());
705 c_incl_corr->SaveAs((dir+
"inclPhotonYieldCorr.root").Data());
707 TCanvas *c_doubleratio=
new TCanvas(
"c_doubleratio",
"c_doubleratio",400,300);
708 gStyle->SetOptStat(0);
709 c_doubleratio->cd(1);
711 TH1F *gammaYieldMBdoubleratio=
new TH1F(*gammaYieldMBratio);
712 TH1F *gammaYieldHT1doubleratio=
new TH1F(*gammaYieldHT1ratio);
713 TH1F *gammaYieldHT2doubleratio=
new TH1F(*gammaYieldHT2ratio);
715 gammaYieldMBdoubleratio->Divide(fit_decay);
716 gammaYieldHT1doubleratio->Divide(fit_decay);
717 gammaYieldHT2doubleratio->Divide(fit_decay);
719 TGraphErrors *g_doubleRatioMB=
new TGraphErrors(gammaYieldMBdoubleratio);
720 g_doubleRatioMB->SetName(
"g_doubleRatioMB");
721 g_doubleRatioMB->SetMarkerStyle(8);
722 TGraphErrors *g_doubleRatioHT1=
new TGraphErrors(gammaYieldHT1doubleratio);
723 g_doubleRatioHT1->SetName(
"g_doubleRatioHT1");
724 g_doubleRatioHT1->SetMarkerStyle(8);
725 TGraphErrors *g_doubleRatioHT2=
new TGraphErrors(gammaYieldHT2doubleratio);
726 g_doubleRatioHT2->SetName(
"g_doubleRatioHT2");
727 g_doubleRatioHT2->SetMarkerStyle(8);
729 removeThesePoints(g_doubleRatioMB,1);
730 removeThesePoints(g_doubleRatioHT1,2);
731 removeThesePoints(g_doubleRatioHT2,3);
733 TMultiGraph *m_doubleratio=
new TMultiGraph();
734 m_doubleratio->SetMinimum(.5);
735 m_doubleratio->SetMaximum(2.75);
738 g_doubleRatioHT1->Print();
740 g_doubleRatioHT2->Print();
744 m_doubleratio->Add(g_doubleRatioHT1,
"p");
745 m_doubleratio->Add(g_doubleRatioHT2,
"p");
747 g_photonpqcd->SetLineWidth(2);
748 g_photonpqcd->SetLineColor(2);
749 g_photonpqcd05->SetLineWidth(2);
750 g_photonpqcd05->SetLineColor(2);
751 g_photonpqcd05->SetLineStyle(2);
752 g_photonpqcd2->SetLineWidth(2);
753 g_photonpqcd2->SetLineColor(2);
754 g_photonpqcd2->SetLineStyle(2);
756 m_doubleratio->Add(g_photonpqcd,
"c");
757 m_doubleratio->Add(g_photonpqcd05,
"c");
758 m_doubleratio->Add(g_photonpqcd2,
"c");
763 m_doubleratio->Draw(
"a");
765 m_doubleratio->GetXaxis()->SetTitle(
"p_{T} (GeV/c)");
766 m_doubleratio->GetYaxis()->SetTitle(
"1 + #gamma_{dir}/#gamma_{incl}");
767 m_doubleratio->GetXaxis()->SetRangeUser(2.,16.);
770 TLegend *leg5=
new TLegend(.15,.6,.6,.8);
771 leg5->AddEntry(g_doubleRatioHT1,
"hightower-1",
"p");
772 leg5->AddEntry(g_doubleRatioHT2,
"hightower-2",
"p");
773 leg5->AddEntry(g_photonpqcd,
"NLO (CTEQ6+KKP) #mu=p_{T}",
"l");
774 leg5->AddEntry(g_photonpqcd05,
"#mu=2p_{T}, #mu=p_{T}/2",
"l");
775 leg5->SetFillColor(0);
778 c_doubleratio->cd(0);
779 c_doubleratio->SaveAs((dir+
"gammaDoubleRatio.eps").Data());
780 c_doubleratio->SaveAs((dir+
"gammaDoubleRatio.root").Data());
783 TCanvas *c_dirphoton=
new TCanvas(
"c_dirphoton",
"c_dirphoton",400,300);
784 gStyle->SetOptStat(0);
787 TH1F *dirphotonYieldMB=
new TH1F(*gammaYieldMBdoubleratio);
788 TH1F *dirphotonYieldHT1=
new TH1F(*gammaYieldHT1doubleratio);
789 TH1F *dirphotonYieldHT2=
new TH1F(*gammaYieldHT2doubleratio);
791 TH1F *dirphotonYieldMBnoErr=
new TH1F(*dirphotonYieldMB);
792 for(
int i=1;i<=dirphotonYieldMBnoErr->GetNbinsX();i++){
793 dirphotonYieldMBnoErr->SetBinError(i,0.);
795 TH1F *dirphotonYieldHT1noErr=
new TH1F(*dirphotonYieldHT1);
796 for(
int i=1;i<=dirphotonYieldHT1noErr->GetNbinsX();i++){
797 dirphotonYieldHT1noErr->SetBinError(i,0.);
799 TH1F *dirphotonYieldHT2noErr=
new TH1F(*dirphotonYieldHT2);
800 for(
int i=1;i<=dirphotonYieldHT1noErr->GetNbinsX();i++){
801 dirphotonYieldHT2noErr->SetBinError(i,0.);
804 TF1 *f_unity=
new TF1(
"f_unity",
"1.",0.,15.);
805 dirphotonYieldMB->Add(f_unity,-1.);
806 dirphotonYieldHT1->Add(f_unity,-1.);
807 dirphotonYieldHT2->Add(f_unity,-1.);
810 dirphotonYieldMB->Divide(dirphotonYieldMBnoErr);
811 dirphotonYieldHT1->Divide(dirphotonYieldHT1noErr);
812 dirphotonYieldHT2->Divide(dirphotonYieldHT2noErr);
813 dirphotonYieldMB->Multiply(gammaYieldMBratioNoErr);
814 dirphotonYieldHT1->Multiply(gammaYieldHT1ratioNoErr);
815 dirphotonYieldHT2->Multiply(gammaYieldHT2ratioNoErr);
816 dirphotonYieldMB->Multiply(pionXsMBnoErr);
817 dirphotonYieldHT1->Multiply(pionXsHT1noErr);
818 dirphotonYieldHT2->Multiply(pionXsHT2noErr);
821 TGraphErrors *g_dirphotonMB=
new TGraphErrors(dirphotonYieldMB);
822 g_dirphotonMB->SetName(
"g_dirphotonMB");
823 g_dirphotonMB->SetMarkerStyle(8);
824 TGraphErrors *g_dirphotonHT1=
new TGraphErrors(dirphotonYieldHT1);
825 g_dirphotonHT1->SetName(
"g_dirphotonHT1");
826 g_dirphotonHT1->SetMarkerStyle(8);
827 TGraphErrors *g_dirphotonHT2=
new TGraphErrors(dirphotonYieldHT2);
828 g_dirphotonHT2->SetName(
"g_dirphotonHT2");
829 g_dirphotonHT2->SetMarkerStyle(8);
832 removeThesePoints(g_dirphotonMB,1);
833 removeThesePoints(g_dirphotonHT1,2);
834 removeThesePoints(g_dirphotonHT2,3);
838 TMultiGraph *m_dirphoton=
new TMultiGraph();
839 m_dirphoton->SetName(
"m_dirphoton");
840 m_dirphoton->SetMinimum(1.0e-11);
841 m_dirphoton->SetMaximum(0.1);
843 m_dirphoton->Add(g_dirgamma,
"c");
844 m_dirphoton->Add(g_dirgamma05,
"c");
845 m_dirphoton->Add(g_dirgamma2,
"c");
847 cout<<
"direct photons:"<<endl;
848 g_dirphotonHT1->Print();
850 g_dirphotonHT2->Print();
853 m_dirphoton->Add(g_dirphotonHT1,
"p");
854 m_dirphoton->Add(g_dirphotonHT2,
"p");
856 m_dirphoton->Draw(
"a");
858 m_dirphoton->GetXaxis()->SetTitle(
"p_{T} (GeV/c)");
859 m_dirphoton->GetYaxis()->SetTitle(
"1 - R^{-1}");
860 m_dirphoton->GetXaxis()->SetRangeUser(2.,16.);
863 TLegend *leg5=
new TLegend(.15,.6,.6,.8);
864 leg5->AddEntry(g_dirphotonHT1,
"hightower-1",
"p");
865 leg5->AddEntry(g_dirphotonHT2,
"hightower-2",
"p");
866 leg5->SetFillColor(0);
870 c_dirphoton->SaveAs((dir+
"gammaDirPhoton.eps").Data());
871 c_dirphoton->SaveAs((dir+
"gammaDirPhoton.root").Data());