1 #if !defined(__CINT__) || defined(__MAKECINT__) 8 #include "TGraphAsymmErrors.h" 42 enum centrality{
kpp8,
kpp7,
kpp5,
kpp276,
k07half,
kpPb0100,
k010,
k1020,
k020,
k1030,
k2040,
k2030,
k3040,
k4050,
k3050,
k5060,
k4060,
k6080,
k4080,
k5080,
k80100,
kpPb010,
kpPb020,
kpPb2040,
kpPb4060,
kpPb60100 };
51 const char *mcfilename=
"FeedDownCorrectionMC.root",
52 const char *efffilename=
"Efficiencies.root",
53 const char *recofilename=
"Reconstructed.root",
const char *recohistoname=
"hRawSpectrumD0",
54 const char *outfilename=
"HFPtSpectrum.root",
62 Bool_t setUsePtDependentEffUncertainty=
true) {
71 if (fdMethod==
kfc) option=1;
72 else if (fdMethod==
kNb) option=2;
73 else if (fdMethod==
knone) { option=0; asym=
false; }
77 cout<<
"Bad calculation option, should be <=2"<<endl;
87 if( (ccestimator ==
kV0M) && (Energy==
k276) ) {
89 tab = 24.81; tabUnc = 0.8037;
91 tab = 23.48; tabUnc = 0.97;
93 tab = 14.4318; tabUnc = 0.5733;
95 tab = 18.93; tabUnc = 0.74;
97 tab = 11.4; tabUnc = 0.36;
99 tab = 6.86; tabUnc = 0.28;
101 tab = 8.73769; tabUnc = 0.370219;
103 tab = 5.02755; tabUnc = 0.22099;
105 tab = 2.68327; tabUnc = 0.137073;
107 tab = 3.87011; tabUnc = 0.183847;
109 tab = 2.00; tabUnc= 0.11;
111 tab = 1.20451; tabUnc = 0.071843;
113 tab = 1.32884; tabUnc = 0.0929536;
115 tab = 0.419; tabUnc = 0.033;
117 tab = 0.719; tabUnc = 0.054;
119 tab = 0.0690; tabUnc = 0.0062;
124 tab = 3.76; tabUnc = 0.13;
131 tab = 0.098334; tabUnc = 0.0070679;
134 else if( ccestimator ==
kV0A ){
136 tab = 0.183; tabUnc = 0.006245;
138 tab = 0.134; tabUnc = 0.004899;
140 tab = 0.092; tabUnc = 0.004796;
142 tab = 0.041; tabUnc = 0.008832;
145 else if( ccestimator ==
kZNA ){
147 tab = 0.17; tabUnc = 0.01275;
149 tab = 0.164; tabUnc = 0.010724;
151 tab = 0.137; tabUnc = 0.005099;
153 tab = 0.1011; tabUnc = 0.006;
155 tab = 0.0459; tabUnc = 0.003162;
158 else if( ccestimator ==
kCL1 ){
160 tab = 0.19; tabUnc = 0.007;
162 tab = 0.136; tabUnc = 0.005;
164 tab = 0.088; tabUnc = 0.005;
166 tab = 0.0369; tabUnc = 0.0085;
179 TH1D *hFeedDownMCpt=0;
180 TH1D *hDirectMCptMax=0;
181 TH1D *hDirectMCptMin=0;
182 TH1D *hFeedDownMCptMax=0;
183 TH1D *hFeedDownMCptMin=0;
185 TH1D *hDirectEffpt=0;
186 TH1D *hFeedDownEffpt=0;
193 TFile * mcfile =
new TFile(mcfilename,
"read");
196 hDirectMCpt = (
TH1D*)mcfile->Get(
"hD0Kpipred_central");
197 hFeedDownMCpt = (
TH1D*)mcfile->Get(
"hD0KpifromBpred_central_corr");
198 hDirectMCptMax = (
TH1D*)mcfile->Get(
"hD0Kpipred_max");
199 hDirectMCptMin = (
TH1D*)mcfile->Get(
"hD0Kpipred_min");
200 hFeedDownMCptMax = (
TH1D*)mcfile->Get(
"hD0KpifromBpred_max_corr");
201 hFeedDownMCptMin = (
TH1D*)mcfile->Get(
"hD0KpifromBpred_min_corr");
206 hDirectMCpt = (
TH1D*)mcfile->Get(
"hDpluskpipipred_central");
207 hFeedDownMCpt = (
TH1D*)mcfile->Get(
"hDpluskpipifromBpred_central_corr");
208 hDirectMCptMax = (
TH1D*)mcfile->Get(
"hDpluskpipipred_max");
209 hDirectMCptMin = (
TH1D*)mcfile->Get(
"hDpluskpipipred_min");
210 hFeedDownMCptMax = (
TH1D*)mcfile->Get(
"hDpluskpipifromBpred_max_corr");
211 hFeedDownMCptMin = (
TH1D*)mcfile->Get(
"hDpluskpipifromBpred_min_corr");
216 hDirectMCpt = (
TH1D*)mcfile->Get(
"hDstarD0pipred_central");
217 hFeedDownMCpt = (
TH1D*)mcfile->Get(
"hDstarD0pifromBpred_central_corr");
218 hDirectMCptMax = (
TH1D*)mcfile->Get(
"hDstarD0pipred_max");
219 hDirectMCptMin = (
TH1D*)mcfile->Get(
"hDstarD0pipred_min");
220 hFeedDownMCptMax = (
TH1D*)mcfile->Get(
"hDstarD0pifromBpred_max_corr");
221 hFeedDownMCptMin = (
TH1D*)mcfile->Get(
"hDstarD0pifromBpred_min_corr");
226 hDirectMCpt = (
TH1D*)mcfile->Get(
"hDsPhipitoKkpipred_central");
227 hFeedDownMCpt = (
TH1D*)mcfile->Get(
"hDsPhipitoKkpifromBpred_central_corr");
228 hDirectMCptMax = (
TH1D*)mcfile->Get(
"hDsPhipitoKkpipred_max");
229 hDirectMCptMin = (
TH1D*)mcfile->Get(
"hDsPhipitoKkpipred_min");
230 hFeedDownMCptMax = (
TH1D*)mcfile->Get(
"hDsPhipitoKkpifromBpred_max_corr");
231 hFeedDownMCptMin = (
TH1D*)mcfile->Get(
"hDsPhipitoKkpifromBpred_min_corr");
235 hDirectMCpt = (
TH1D*)mcfile->Get(
"hLcpkpipred_central");
236 hFeedDownMCpt = (
TH1D*)mcfile->Get(
"hLcpkpifromBpred_central_corr");
237 hDirectMCptMax = (
TH1D*)mcfile->Get(
"hLcpkpipred_max");
238 hDirectMCptMin = (
TH1D*)mcfile->Get(
"hLcpkpipred_min");
239 hFeedDownMCptMax = (
TH1D*)mcfile->Get(
"hLcpkpifromBpred_max_corr");
240 hFeedDownMCptMin = (
TH1D*)mcfile->Get(
"hLcpkpifromBpred_min_corr");
244 hDirectMCpt = (
TH1D*)mcfile->Get(
"hLcK0sppred_central");
245 hFeedDownMCpt = (
TH1D*)mcfile->Get(
"hLcK0spfromBpred_central_corr");
246 hDirectMCptMax = (
TH1D*)mcfile->Get(
"hLcK0sppred_max");
247 hDirectMCptMin = (
TH1D*)mcfile->Get(
"hLcK0sppred_min");
248 hFeedDownMCptMax = (
TH1D*)mcfile->Get(
"hLcK0spfromBpred_max_corr");
249 hFeedDownMCptMin = (
TH1D*)mcfile->Get(
"hLcK0spfromBpred_min_corr");
252 hDirectMCpt->SetNameTitle(
"hDirectMCpt",
"direct MC spectra");
253 hFeedDownMCpt->SetNameTitle(
"hFeedDownMCpt",
"feed-down MC spectra");
254 hDirectMCptMax->SetNameTitle(
"hDirectMCptMax",
"max direct MC spectra");
255 hDirectMCptMin->SetNameTitle(
"hDirectMCptMin",
"min direct MC spectra");
256 hFeedDownMCptMax->SetNameTitle(
"hFeedDownMCptMax",
"max feed-down MC spectra");
257 hFeedDownMCptMin->SetNameTitle(
"hFeedDownMCptMin",
"min feed-down MC spectra");
263 switch(rapiditySlice) {
264 case k08to04: scaleFONLL = (0.093+0.280)/1.0;
break;
265 case k07to04: scaleFONLL = 0.280/1.0;
break;
266 case k04to01: scaleFONLL = 0.284/1.0;
break;
267 case k01to01: scaleFONLL = 0.191/1.0;
break;
268 case k01to04: scaleFONLL = 0.288/1.0;
break;
269 case k04to07: scaleFONLL = 0.288/1.0;
break;
270 case k04to08: scaleFONLL = (0.288+0.096)/1.0;
break;
271 case k01to05: scaleFONLL = (0.4)/1.0;
break;
273 hDirectMCpt->Scale(scaleFONLL);
274 hDirectMCptMax->Scale(scaleFONLL);
275 hDirectMCptMin->Scale(scaleFONLL);
276 switch(rapiditySlice) {
277 case k08to04: scaleFONLL = (0.089+0.274)/1.0;
break;
278 case k07to04: scaleFONLL = 0.274/1.0;
break;
279 case k04to01: scaleFONLL = 0.283/1.0;
break;
280 case k01to01: scaleFONLL = 0.192/1.0;
break;
281 case k01to04: scaleFONLL = 0.290/1.0;
break;
282 case k04to07: scaleFONLL = 0.291/1.0;
break;
283 case k04to08: scaleFONLL = (0.291+0.097)/1.0;
break;
284 case k01to05: scaleFONLL = (0.4)/1.0;
break;
286 hFeedDownMCpt->Scale(scaleFONLL);
287 hFeedDownMCptMax->Scale(scaleFONLL);
288 hFeedDownMCptMin->Scale(scaleFONLL);
293 TFile * efffile =
new TFile(efffilename,
"read");
294 hDirectEffpt = (
TH1D*)efffile->Get(
"hEffD");
295 hDirectEffpt->SetNameTitle(
"hDirectEffpt",
"direct acc x eff");
296 hFeedDownEffpt = (
TH1D*)efffile->Get(
"hEffB");
297 hFeedDownEffpt->SetNameTitle(
"hFeedDownEffpt",
"feed-down acc x eff");
300 TFile * recofile =
new TFile(recofilename,
"read");
301 hRECpt = (
TH1D*)recofile->Get(recohistoname);
302 hRECpt->SetNameTitle(
"hRECpt",
"Reconstructed spectra");
306 TH1D *hEPresolCorr=0;
308 EPf =
new TFile(epResolfile,
"read");
309 if(isRaavsEP==
kInPlane) hEPresolCorr = (
TH1D*)EPf->Get(
"hCorrEPresol_InPlane");
310 else if(isRaavsEP==
kOutOfPlane) hEPresolCorr = (
TH1D*)EPf->Get(
"hCorrEPresol_OutOfPlane");
311 for(
Int_t i=1; i<=hRECpt->GetNbinsX(); i++) {
312 Double_t value = hRECpt->GetBinContent(i);
313 Double_t error = hRECpt->GetBinError(i);
314 Double_t pt = hRECpt->GetBinCenter(i);
315 Int_t epbin = hEPresolCorr->FindBin( pt );
316 Double_t epcorr = hEPresolCorr->GetBinContent( epbin );
317 value = value*epcorr;
318 error = error*epcorr;
319 hRECpt->SetBinContent(i,value);
320 hRECpt->SetBinError(i,error);
327 TFile *out =
new TFile(outfilename,
"recreate");
332 TH1D *histoYieldCorr=0;
333 TH1D *histoYieldCorrMax=0;
334 TH1D *histoYieldCorrMin=0;
335 TH1D *histoSigmaCorr=0;
336 TH1D *histoSigmaCorrMax=0;
337 TH1D *histoSigmaCorrMin=0;
340 TH1D *histofcRcb_px=0;
341 TH2D *histoYieldCorrRcb=0;
342 TH2D *histoSigmaCorrRcb=0;
353 TNtuple * nSigma = 0;
371 cout <<
" Setting the reconstructed spectrum,";
374 cout <<
" the efficiency,";
378 cout <<
" the theoretical spectra";
388 cout <<
" and the normalization" <<endl;
400 Double_t globalBCEffRatioUnc = 0.05;
401 if(analysisSpeciality==
kLowPt) globalBCEffRatioUnc = 0.;
419 Bool_t combineFeedDown =
true;
440 switch(rapiditySlice) {
441 case k08to04: rapidity=
"0804";
break;
442 case k07to04: rapidity=
"0804";
break;
443 case k04to01: rapidity=
"0401";
break;
444 case k01to01: rapidity=
"0101";
break;
445 case k01to04: rapidity=
"0104";
break;
446 case k04to07: rapidity=
"0408";
break;
447 case k04to08: rapidity=
"0408";
break;
448 case k01to05: rapidity=
"0401";
break;
453 if(ccestimator==
kV0A) {
458 }
else if (ccestimator==
kZNA) {
464 }
else if (ccestimator==
kCL1) {
471 cout <<
" Error on the pPb options"<<endl;
506 cout <<
" Systematics not yet implemented " << endl;
510 if(analysisSpeciality==
kLowPt){
516 else if(analysisSpeciality==
kBDT){
520 systematics->
Init(decay);
524 cout <<
" Doing the calculation... "<< endl;
527 Double_t branchingRatioBintoFinalDecay = 1.0;
530 cout <<
" ended the calculation, getting the histograms back " << endl;
544 histoYieldCorr->SetNameTitle(
"histoYieldCorr",
"corrected yield");
545 histoYieldCorrMax->SetNameTitle(
"histoYieldCorrMax",
"max corrected yield");
546 histoYieldCorrMin->SetNameTitle(
"histoYieldCorrMin",
"min corrected yield");
547 histoSigmaCorr->SetNameTitle(
"histoSigmaCorr",
"corrected invariant cross-section");
548 histoSigmaCorrMax->SetNameTitle(
"histoSigmaCorrMax",
"max corrected invariant cross-section");
549 histoSigmaCorrMin->SetNameTitle(
"histoSigmaCorrMin",
"min corrected invariant cross-section");
558 histofcRcb->SetName(
"histofcRcb");
559 histoYieldCorrRcb->SetName(
"histoYieldCorrRcb");
560 histoSigmaCorrRcb->SetName(
"histoSigmaCorrRcb");
575 gYieldCorr->SetNameTitle(
"gYieldCorr",
"gYieldCorr (uncorr)");
576 gSigmaCorr->SetNameTitle(
"gSigmaCorr",
"gSigmaCorr (uncorr)");
583 histofc->SetNameTitle(
"histofc",
"fc correction factor");
584 histofcMax->SetNameTitle(
"histofcMax",
"max fc correction factor");
585 histofcMin->SetNameTitle(
"histofcMin",
"min fc correction factor");
587 gYieldCorr->SetNameTitle(
"gYieldCorr",
"gYieldCorr (by fc)");
588 gSigmaCorr->SetNameTitle(
"gSigmaCorr",
"gSigmaCorr (by fc)");
590 gFcExtreme->SetNameTitle(
"gFcExtreme",
"gFcExtreme");
591 gYieldCorrExtreme->SetNameTitle(
"gYieldCorrExtreme",
"Extreme gYieldCorr (by fc)");
592 gSigmaCorrExtreme->SetNameTitle(
"gSigmaCorrExtreme",
"Extreme gSigmaCorr (by fc)");
594 gFcConservative->SetNameTitle(
"gFcConservative",
"gFcConservative");
595 gYieldCorrConservative->SetNameTitle(
"gYieldCorrConservative",
"Conservative gYieldCorr (by fc)");
596 gSigmaCorrConservative->SetNameTitle(
"gSigmaCorrConservative",
"Conservative gSigmaCorr (by fc)");
599 if (option==2 && asym) {
600 gYieldCorr->SetNameTitle(
"gYieldCorr",
"gYieldCorr (by Nb)");
601 gSigmaCorr->SetNameTitle(
"gSigmaCorr",
"gSigmaCorr (by Nb)");
602 gYieldCorrExtreme->SetNameTitle(
"gYieldCorrExtreme",
"Extreme gYieldCorr (by Nb)");
603 gSigmaCorrExtreme->SetNameTitle(
"gSigmaCorrExtreme",
"Extreme gSigmaCorr (by Nb)");
604 gYieldCorrConservative->SetNameTitle(
"gYieldCorrConservative",
"Conservative gYieldCorr (by Nb)");
605 gSigmaCorrConservative->SetNameTitle(
"gSigmaCorrConservative",
"Conservative gSigmaCorr (by Nb)");
607 gFcConservative->SetNameTitle(
"gFcConservative",
"gFcConservative");
618 gROOT->SetStyle(
"Plain");
620 cout <<
" Drawing the results ! " << endl;
625 TCanvas *ceff =
new TCanvas(
"ceff",
"efficiency drawing");
628 hDirectEffpt->Draw();
630 hFeedDownEffpt->Draw();
633 TCanvas *cTheoryRebin =
new TCanvas(
"cTheoryRebin",
"control the theoretical spectra rebin");
634 cTheoryRebin->Divide(1,2);
636 hDirectMCpt->Draw(
"");
638 hDirectMCptRebin->SetLineColor(2);
639 hDirectMCptRebin->Draw(
"same");
641 hFeedDownMCpt->Draw(
"");
643 hFeedDownRebin->SetLineColor(2);
644 hFeedDownRebin->Draw(
"same");
645 cTheoryRebin->Update();
647 TCanvas *cTheoryRebinLimits =
new TCanvas(
"cTheoryRebinLimits",
"control the theoretical spectra limits rebin");
648 cTheoryRebinLimits->Divide(1,2);
649 cTheoryRebinLimits->cd(1);
650 hDirectMCptMax->Draw(
"");
652 hDirectMCptMaxRebin->SetLineColor(2);
653 hDirectMCptMaxRebin->Draw(
"same");
654 hDirectMCptMin->Draw(
"same");
656 hDirectMCptMinRebin->SetLineColor(2);
657 hDirectMCptMinRebin->Draw(
"same");
658 cTheoryRebinLimits->cd(2);
659 hFeedDownMCptMax->Draw(
"");
661 hFeedDownMaxRebin->SetLineColor(2);
662 hFeedDownMaxRebin->Draw(
"same");
663 hFeedDownMCptMin->Draw(
"same");
665 hFeedDownMinRebin->SetLineColor(2);
666 hFeedDownMinRebin->Draw(
"same");
667 cTheoryRebinLimits->Update();
672 TCanvas * cfc =
new TCanvas(
"cfc",
"Fc");
673 histofcMax->Draw(
"c");
674 histofc->Draw(
"csame");
675 histofcMin->Draw(
"csame");
679 TH2F *histofcDraw=
new TH2F(
"histofcDraw",
"histofc (for drawing)",100,0,33.25,100,0.01,1.25);
680 histofcDraw->SetStats(0);
681 histofcDraw->GetXaxis()->SetTitle(
"p_{T} [GeV]");
682 histofcDraw ->GetXaxis()->SetTitleSize(0.05);
683 histofcDraw->GetXaxis()->SetTitleOffset(0.95);
684 histofcDraw->GetYaxis()->SetTitle(
" fc ");
685 histofcDraw->GetYaxis()->SetTitleSize(0.05);
703 TCanvas *cfcExtreme =
new TCanvas(
"cfcExtreme",
"Extreme Asymmetric fc (TGraphAsymmErr)");
704 gFcExtreme->SetFillStyle(3006);
705 gFcExtreme->SetLineWidth(3);
706 gFcExtreme->SetMarkerStyle(20);
707 gFcExtreme->SetFillColor(2);
709 gFcExtreme->Draw(
"3same");
712 gFcConservative->SetFillStyle(3007);
713 gFcConservative->SetFillColor(4);
714 gFcConservative->Draw(
"3same");
717 cfcExtreme->Update();
726 TCanvas * cresult =
new TCanvas(
"cresult",
"corrected yields & sigma");
727 hDirectMCpt->SetMarkerStyle(20);
728 hDirectMCpt->SetMarkerColor(4);
729 hDirectMCpt->Draw(
"p");
730 histoSigmaCorr->SetMarkerStyle(21);
731 histoSigmaCorr->SetMarkerColor(2);
732 histoSigmaCorr->Draw(
"psame");
733 histoYieldCorr->SetMarkerStyle(22);
734 histoYieldCorr->SetMarkerColor(6);
735 histoYieldCorr->Draw(
"psame");
736 hRECpt->SetMarkerStyle(23);
737 hRECpt->SetMarkerColor(3);
738 hRECpt->Draw(
"psame");
742 TCanvas * cresult2 =
new TCanvas(
"cresult2",
"corrected yield & sigma");
743 histoSigmaCorr->SetMarkerStyle(21);
744 histoSigmaCorr->SetMarkerColor(2);
745 histoSigmaCorr->Draw(
"p");
746 histoYieldCorr->SetMarkerStyle(22);
747 histoYieldCorr->SetMarkerColor(6);
748 histoYieldCorr->Draw(
"psame");
749 hRECpt->SetMarkerStyle(23);
750 hRECpt->SetMarkerColor(3);
751 hRECpt->Draw(
"psame");
758 TH2F *histoDraw =
new TH2F(
"histoDraw",
"histo (for drawing)",100,0,33.25,100,50.,1e7);
759 float max = 1.1*gYieldCorr->GetMaximum();
760 histoDraw->SetAxisRange(0.1,max,
"Y");
761 histoDraw->SetStats(0);
762 histoDraw->GetXaxis()->SetTitle(
"p_{T} [GeV]");
763 histoDraw->GetXaxis()->SetTitleSize(0.05);
764 histoDraw->GetXaxis()->SetTitleOffset(0.95);
765 histoDraw->GetYaxis()->SetTitle(
"#frac{d#N}{dp_{T}} |_{|y|<1} [L & trigger uncorr]");
766 histoDraw->GetYaxis()->SetTitleSize(0.05);
767 TCanvas * cyieldAsym =
new TCanvas(
"cyieldAsym",
"Asymmetric corrected yield (TGraphAsymmErr)");
768 gYieldCorr->SetFillStyle(3001);
769 gYieldCorr->SetLineWidth(3);
770 gYieldCorr->SetMarkerStyle(20);
771 gYieldCorr->SetFillColor(3);
773 gYieldCorr->Draw(
"3LPsame");
774 gYieldCorr->Draw(
"Xsame");
775 cyieldAsym->SetLogy();
776 cyieldAsym->Update();
778 TCanvas * cyieldExtreme =
new TCanvas(
"cyieldExtreme",
"Extreme Asymmetric corrected yield (TGraphAsymmErr)");
779 histoYieldCorr->Draw();
780 gYieldCorrExtreme->SetFillStyle(3002);
781 gYieldCorrExtreme->SetLineWidth(3);
782 gYieldCorrExtreme->SetMarkerStyle(20);
783 gYieldCorrExtreme->SetFillColor(2);
784 histoYieldCorr->Draw();
785 gYieldCorr->Draw(
"3same");
786 gYieldCorrExtreme->Draw(
"3same");
787 cyieldExtreme->SetLogy();
788 cyieldExtreme->Update();
790 TH2F *histo2Draw =
new TH2F(
"histo2Draw",
"histo2 (for drawing)",100,0,33.25,100,50.,1e9);
791 max = 1.1*gSigmaCorr->GetMaximum();
792 histo2Draw->SetAxisRange(0.1,max,
"Y");
793 histo2Draw->SetStats(0);
794 histo2Draw->GetXaxis()->SetTitle(
"p_{T} [GeV]");
795 histo2Draw->GetXaxis()->SetTitleSize(0.05);
796 histo2Draw->GetXaxis()->SetTitleOffset(0.95);
797 histo2Draw->GetYaxis()->SetTitle(
"#frac{1}{BR} #times #frac{d#sigma}{dp_{T}} |_{|y|<1}");
798 histo2Draw->GetYaxis()->SetTitleSize(0.05);
799 TCanvas * csigmaAsym =
new TCanvas(
"csigmaAsym",
"Asymmetric corrected sigma (TGraphAsymmErr)");
800 gSigmaCorr->SetFillStyle(3001);
801 gSigmaCorr->SetLineWidth(3);
802 gSigmaCorr->SetMarkerStyle(21);
803 gSigmaCorr->SetFillColor(3);
805 gSigmaCorr->Draw(
"3LPsame");
806 gSigmaCorr->Draw(
"Xsame");
807 csigmaAsym->SetLogy();
808 csigmaAsym->Update();
819 TCanvas * csigmaExtreme =
new TCanvas(
"csigmaExtreme",
"Asymmetric extreme corrected sigma (TGraphAsymmErr)");
820 histoSigmaCorr->Draw();
821 gSigmaCorr->Draw(
"3Psame");
822 gSigmaCorrExtreme->SetFillStyle(3002);
823 gSigmaCorrExtreme->SetLineWidth(3);
824 gSigmaCorrExtreme->SetMarkerStyle(21);
825 gSigmaCorrExtreme->SetFillColor(2);
826 gSigmaCorrExtreme->Draw(
"3Psame");
827 csigmaExtreme->SetLogy();
828 csigmaExtreme->Update();
853 gStyle->SetPalette(1);
854 TCanvas *canvasfcRcb =
new TCanvas(
"canvasfcRcb",
"fc vs pt vs Rcb");
856 histofcRcb->Draw(
"colz");
857 canvasfcRcb->Update();
859 TCanvas *canvasfcRcb1 =
new TCanvas(
"canvasfcRcb1",
"fc vs pt vs Rcb=1");
860 histofcRcb_px = (
TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px",40,40);
861 histofcRcb_px->SetLineColor(2);
864 histofcRcb_px->Draw(
"same");
865 }
else histofcRcb_px->Draw(
"");
866 canvasfcRcb1->Update();
867 TCanvas *canvasfcRcb2 =
new TCanvas(
"canvasfcRcb2",
"fc vs pt vs Rcb fixed Rcb");
875 TH1D * histofcRcb_px0a = (
TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px0a",bin0,bin0);
876 TH1D * histofcRcb_px0 = (
TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px0",bin1,bin1);
877 TH1D * histofcRcb_px1 = (
TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px1",bin2,bin2);
878 TH1D * histofcRcb_px2 = (
TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px2",bin3,bin3);
879 TH1D * histofcRcb_px3 = (
TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px3",bin4,bin4);
880 TH1D * histofcRcb_px4 = (
TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px4",bin5,bin5);
881 TH1D * histofcRcb_px5 = (
TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px5",bin6,bin6);
887 histofcRcb_px0a->SetLineColor(2);
888 histofcRcb_px0a->Draw(
"");
890 histofcRcb_px0a->SetLineColor(2);
891 histofcRcb_px0a->Draw(
"same");
892 histofcRcb_px0->SetLineColor(4);
893 histofcRcb_px0->Draw(
"same");
894 histofcRcb_px1->SetLineColor(3);
895 histofcRcb_px1->Draw(
"same");
896 histofcRcb_px2->SetLineColor(kCyan);
897 histofcRcb_px2->Draw(
"same");
898 histofcRcb_px3->SetLineColor(kMagenta+1);
899 histofcRcb_px3->Draw(
"same");
900 histofcRcb_px4->SetLineColor(kOrange+7);
901 histofcRcb_px4->Draw(
"same");
902 histofcRcb_px5->SetLineColor(kGreen+3);
903 histofcRcb_px5->Draw(
"same");
904 TLegend *legrcc =
new TLegend(0.8,0.8,0.95,0.9);
905 legrcc->SetFillColor(0);
907 legrcc->AddEntry(histofcRcb_px0a,
"Rc/b=0.25",
"l");
908 legrcc->AddEntry(histofcRcb_px0,
"Rc/b=0.5",
"l");
909 legrcc->AddEntry(histofcRcb_px1,
"Rc/b=1.0",
"l");
910 legrcc->AddEntry(histofcRcb_px2,
"Rc/b=1.5",
"l");
911 legrcc->AddEntry(histofcRcb_px3,
"Rc/b=2.0",
"l");
912 legrcc->AddEntry(histofcRcb_px4,
"Rc/b=3.0",
"l");
913 legrcc->AddEntry(histofcRcb_px5,
"Rc/b=4.0",
"l");
915 legrcc->AddEntry(histofcRcb_px0a,
"Rb=0.25",
"l");
916 legrcc->AddEntry(histofcRcb_px0,
"Rb=0.5",
"l");
917 legrcc->AddEntry(histofcRcb_px1,
"Rb=1.0",
"l");
918 legrcc->AddEntry(histofcRcb_px2,
"Rb=1.5",
"l");
919 legrcc->AddEntry(histofcRcb_px3,
"Rb=2.0",
"l");
920 legrcc->AddEntry(histofcRcb_px4,
"Rb=3.0",
"l");
921 legrcc->AddEntry(histofcRcb_px5,
"Rb=4.0",
"l");
924 canvasfcRcb2->Update();
925 TCanvas *canvasYRcb =
new TCanvas(
"canvasYRcb",
"corrected yield vs pt vs Rcb");
926 histoYieldCorrRcb->Draw(
"cont4z");
927 canvasYRcb->Update();
928 TCanvas *canvasSRcb =
new TCanvas(
"canvasSRcb",
"sigma vs pt vs Rcb");
929 histoSigmaCorrRcb->Draw(
"cont4z");
930 canvasSRcb->Update();
931 TCanvas *canvasSRcb1 =
new TCanvas(
"canvasSRcb1",
"sigma vs pt vs Rcb fixed Rcb");
932 TH1D * histoSigmaCorrRcb_px0a = (
TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px0a",bin0,bin0);
933 TH1D * histoSigmaCorrRcb_px0 = (
TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px0",bin1,bin1);
934 TH1D * histoSigmaCorrRcb_px1 = (
TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px1",bin2,bin2);
935 TH1D * histoSigmaCorrRcb_px2 = (
TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px2",bin3,bin3);
936 TH1D * histoSigmaCorrRcb_px3 = (
TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px3",bin4,bin4);
937 TH1D * histoSigmaCorrRcb_px4 = (
TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px4",bin5,bin5);
938 TH1D * histoSigmaCorrRcb_px5 = (
TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px5",bin6,bin6);
939 histoSigmaCorr->Draw();
940 histoSigmaCorrRcb_px0a->SetLineColor(2);
941 histoSigmaCorrRcb_px0a->Draw(
"hsame");
942 histoSigmaCorrRcb_px0->SetLineColor(4);
943 histoSigmaCorrRcb_px0->Draw(
"hsame");
944 histoSigmaCorrRcb_px1->SetLineColor(3);
945 histoSigmaCorrRcb_px1->Draw(
"hsame");
946 histoSigmaCorrRcb_px2->SetLineColor(kCyan);
947 histoSigmaCorrRcb_px2->Draw(
"hsame");
948 histoSigmaCorrRcb_px3->SetLineColor(kMagenta+1);
949 histoSigmaCorrRcb_px3->Draw(
"hsame");
950 histoSigmaCorrRcb_px4->SetLineColor(kOrange+7);
951 histoSigmaCorrRcb_px4->Draw(
"same");
952 histoSigmaCorrRcb_px5->SetLineColor(kGreen+3);
953 histoSigmaCorrRcb_px5->Draw(
"same");
954 TLegend *legrcb =
new TLegend(0.8,0.8,0.95,0.9);
955 legrcb->SetFillColor(0);
957 legrcb->AddEntry(histoSigmaCorrRcb_px0a,
"Rc/b=0.25",
"l");
958 legrcb->AddEntry(histoSigmaCorrRcb_px0,
"Rc/b=0.5",
"l");
959 legrcb->AddEntry(histoSigmaCorrRcb_px1,
"Rc/b=1.0",
"l");
960 legrcb->AddEntry(histoSigmaCorrRcb_px2,
"Rc/b=1.5",
"l");
961 legrcb->AddEntry(histoSigmaCorrRcb_px3,
"Rc/b=2.0",
"l");
962 legrcb->AddEntry(histoSigmaCorrRcb_px4,
"Rc/b=3.0",
"l");
963 legrcb->AddEntry(histoSigmaCorrRcb_px5,
"Rc/b=4.0",
"l");
965 legrcb->AddEntry(histoSigmaCorrRcb_px0a,
"Rb=0.25",
"l");
966 legrcb->AddEntry(histoSigmaCorrRcb_px0,
"Rb=0.5",
"l");
967 legrcb->AddEntry(histoSigmaCorrRcb_px1,
"Rb=1.0",
"l");
968 legrcb->AddEntry(histoSigmaCorrRcb_px2,
"Rb=1.5",
"l");
969 legrcb->AddEntry(histoSigmaCorrRcb_px3,
"Rb=2.0",
"l");
970 legrcb->AddEntry(histoSigmaCorrRcb_px4,
"Rb=3.0",
"l");
971 legrcb->AddEntry(histoSigmaCorrRcb_px5,
"Rb=4.0",
"l");
974 canvasSRcb1->Update();
981 cout <<
" Saving the results ! " << endl<< endl;
985 hDirectMCpt->Write(); hFeedDownMCpt->Write();
986 hDirectMCptMax->Write(); hDirectMCptMin->Write();
987 hFeedDownMCptMax->Write(); hFeedDownMCptMin->Write();
988 if(hDirectEffpt) hDirectEffpt->Write();
if(hFeedDownEffpt) hFeedDownEffpt->Write();
991 histoYieldCorr->Write();
992 histoYieldCorrMax->Write(); histoYieldCorrMin->Write();
993 histoSigmaCorr->Write();
994 histoSigmaCorrMax->Write(); histoSigmaCorrMin->Write();
997 histofcRcb->Write(); histofcRcb_px->Write();
998 histoYieldCorrRcb->Write();
999 histoSigmaCorrRcb->Write();
1003 gYieldCorr->Write();
1004 gSigmaCorr->Write();
1006 if(gYieldCorrExtreme) gYieldCorrExtreme->Write();
1007 if(gSigmaCorrExtreme) gSigmaCorrExtreme->Write();
1008 if(gYieldCorrConservative) gYieldCorrConservative->Write();
1009 if(gSigmaCorrConservative) gSigmaCorrConservative->Write();
1010 if(asym && gFcConservative) gFcConservative->Write();
1015 histofcMax->Write(); histofcMin->Write();
1016 if(asym && gFcExtreme) gFcExtreme->Write();
1022 hStatUncEffcSigma->Write();
1023 hStatUncEffbSigma->Write();
1027 hStatUncEffcFD->Write();
1028 hStatUncEffbFD->Write();
1030 systematics->Write();
void SetMCptDistributionsBounds(TH1D *hDirectMax, TH1D *hDirectMin, TH1D *hFeedDownMax, TH1D *hFeedDownMin)
Set the theoretical direct & feeddown pt spectrum upper and lower bounds.
void SetIsLowEnergy(Bool_t flag)
void SetSystematicUncertainty(AliHFSystErr *syst)
void SetFeedDownCalculationOption(Int_t option)
Set the calculation option flag for feed-down correction: 0=none, 1=fc , 2=Nb.
TH1D * GetDirectTheoreticalLowerLimitSpectrum() const
void HFPtSpectrum(Int_t decayChan=kDplusKpipi, const char *mcfilename="FeedDownCorrectionMC.root", const char *efffilename="Efficiencies.root", const char *recofilename="Reconstructed.root", const char *recohistoname="hRawSpectrumD0", const char *outfilename="HFPtSpectrum.root", Int_t fdMethod=kNb, Double_t nevents=1.0, Double_t sigma=1.0, Bool_t isParticlePlusAntiParticleYield=true, Int_t cc=kpp7, Bool_t PbPbEloss=false, Int_t Energy=k276, Int_t ccestimator=kV0M, Int_t isRaavsEP=kPhiIntegrated, const char *epResolfile="", Int_t rapiditySlice=kdefault, Int_t analysisSpeciality=kTopological, Bool_t setUsePtDependentEffUncertainty=true)
TGraphAsymmErrors * GetFeedDownCorrectionFcExtreme() const
Return the TGraphAsymmErrors of the feed-down correction (extreme systematics)
TGraphAsymmErrors * GetFeedDownCorrectedSpectrumConservative() const
Return the TGraphAsymmErrors of the yield after feed-down correction (feed-down conservative systemat...
TH1D * GetHistoFeedDownCorrectionFc() const
Return the histogram of the feed-down correction.
TH1D * GetHistoLowerLimitCrossSectionFromYieldSpectrum() const
void SetCentrality(TString centrality)
TGraphAsymmErrors * GetFeedDownCorrectionFcConservative() const
Return the TGraphAsymmErrors of the feed-down correction (conservative systematics) ...
TH1D * GetHistoUpperLimitFeedDownCorrectedSpectrum() const
Return the histogram of the yield after feed-down correction bounds.
TH1D * GetFeedDownTheoreticalLowerLimitSpectrum() const
void SetIsPbPb2010EnergyScan(Bool_t flag)
TH1D * GetHistoUpperLimitCrossSectionFromYieldSpectrum() const
Return the equivalent invariant cross-section histogram bounds.
TGraphAsymmErrors * GetCrossSectionFromYieldSpectrumConservative() const
Return the equivalent invariant cross-section TGraphAsymmErrors (feed-down conservative systematics) ...
TH1D * GetHistoLowerLimitFeedDownCorrectedSpectrum() const
void SetFeedDownMCptDistributionsBounds(TH1D *hFeedDownMax, TH1D *hFeedDownMin)
Set the theoretical feeddown pt spectrum upper and lower bounds.
TH1D * GetFeedDownStatEffUncOnSigma() const
void SetTriggerEfficiency(Double_t efficiency, Double_t unc)
Set the trigger efficiency and its uncertainty.
void SetIsBDTAnalysis(Bool_t flag)
TH1D * GetDirectAccEffCorrection() const
Return the acceptance and efficiency corrections (rebinned if needed)
TH1D * GetHistoUpperLimitFeedDownCorrectionFc() const
Return the histograms of the feed-down correction bounds.
void SetComputeAsymmetricUncertainties(Bool_t flag)
Set if the calculation has to consider asymmetric uncertaInt_ties or not.
TH2D * GetHistoFeedDownCorrectedSpectrumVsEloss() const
Return the histogram of the yield after feed-down correction vs the Ratio(c/b eloss) ...
TH1D * GetDirectTheoreticalSpectrum() const
TGraphAsymmErrors * GetFeedDownCorrectedSpectrumExtreme() const
Return the TGraphAsymmErrors of the yield after feed-down correction (feed-down extreme systematics) ...
TNtuple * GetNtupleCrossSectionVsEloss()
Return the ntuple of the calculation vs the Ratio(c/b eloss)
void SetAccEffPercentageUncertainty(Double_t globalEffUnc, Double_t globalBCEffRatioUnc)
Set global acceptance x efficiency correction uncertainty (in percentages)
TH1D * GetFeedDownAccEffCorrection() const
TH1D * GetHistoFeedDownCorrectedSpectrum() const
Return the histogram of the yield after feed-down correction.
TGraphAsymmErrors * GetCrossSectionFromYieldSpectrum() const
Return the equivalent invariant cross-section TGraphAsymmErrors (systematics but feed-down) ...
TH1D * GetDirectTheoreticalUpperLimitSpectrum() const
void SetUsePtDependentEffUncertainty(Bool_t flag)
Setter to switch on the pt dependent efficiency correction uncertainty (feed-down calculation) ...
void SetNormalization(Double_t normalization)
Set the normalization factors.
void SetIsPass4Analysis(Bool_t flag)
TGraphAsymmErrors * GetCrossSectionFromYieldSpectrumExtreme() const
Return the equivalent invariant cross-section TGraphAsymmErrors (feed-down extreme systematics) ...
void SetReconstructedSpectrum(TH1D *hRec)
Set the reconstructed spectrum.
TH1D * GetHistoLowerLimitFeedDownCorrectionFc() const
Int_t FindTH2YBin(TH2D *histo, Float_t yvalue)
Functionality to find the y-axis bin of a TH2 for a given y-value.
void SetIsLowPtAnalysis(Bool_t flag)
void ComputeSystUncertainties(Bool_t combineFeedDown)
void SetFeedDownMCptSpectra(TH1D *hFeedDown)
Set the theoretical feeddown pt spectrum.
void Init(Int_t decay)
Function to initialize the variables/histograms.
TH1D * GetDirectStatEffUncOnSigma() const
void SetIspPb2011RapidityScan(Bool_t flag)
TH1D * GetHistoCrossSectionFromYieldSpectrum() const
Return the equivalent invariant cross-section histogram.
void SetComputeElossHypothesis(Bool_t flag)
Set if the calculation has to consider Ratio(c/b eloss) hypothesis.
void ComputeHFPtSpectrum(Double_t deltaY=1.0, Double_t branchingRatioC=1.0, Double_t branchingRatioBintoFinalDecay=1.0)
void SetCollisionType(Int_t ct)
void SetAccEffCorrection(TH1D *hDirectEff, TH1D *hFeedDownEff)
Set the acceptance and efficiency corrections for direct & feeddown.
TH1D * GetFeedDownTheoreticalSpectrum() const
void SetCollisionType(Int_t type)
void SetIs5TeVAnalysis(Bool_t flag)
void SetIsEventPlaneAnalysis(Bool_t flag)
TH1D * GetFeedDownTheoreticalUpperLimitSpectrum() const
void SetIsParticlePlusAntiParticleYield(Bool_t flag)
Set if the yield is for particle plus anti-particle or not.
TGraphAsymmErrors * GetFeedDownCorrectedSpectrum() const
Return the TGraphAsymmErrors of the yield after feed-down correction (systematics but feed-down) ...
void SetRapidity(TString rapidity)
Settings of rapidity ranges for pPb 0-100% CC.
void SetMCptSpectra(TH1D *hDirect, TH1D *hFeedDown)
TH2D * GetHistoCrossSectionFromYieldSpectrumVsEloss() const
void SetRunNumber(Int_t number)
TH2D * GetHistoFeedDownCorrectionFcVsEloss() const
Return the histogram of the feed-down correction times the Ratio(c/b eloss)
void SetLuminosity(Double_t luminosity, Double_t unc)
Set the luminosity and its uncertainty.
TH1D * GetFeedDownStatEffUncOnFc() const
TH1D * GetDirectStatEffUncOnFc() const
Histograms to keep track of the influence of the efficiencies statistical uncertainty on the feed-dow...
void SetTabParameter(Double_t tabvalue, Double_t uncertainty)
Set the Tab parameter and its uncertainty.