1 #if !defined(__CINT__) || defined(__MAKECINT__)
8 #include "TGraphAsymmErrors.h"
42 enum centrality{
kpp8,
kpp7,
kpp276,
k07half,
kpPb0100,
k010,
k1020,
k020,
k2040,
k2030,
k3040,
k4050,
k3050,
k5060,
k4060,
k6080,
k4080,
k5080,
k80100,
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 = 6.86; tabUnc = 0.28;
99 tab = 8.73769; tabUnc = 0.370219;
101 tab = 5.02755; tabUnc = 0.22099;
103 tab = 2.68327; tabUnc = 0.137073;
105 tab = 3.87011; tabUnc = 0.183847;
107 tab = 2.00; tabUnc= 0.11;
109 tab = 1.20451; tabUnc = 0.071843;
111 tab = 1.32884; tabUnc = 0.0929536;
113 tab = 0.419; tabUnc = 0.033;
115 tab = 0.719; tabUnc = 0.054;
117 tab = 0.0690; tabUnc = 0.0062;
122 tab = 3.76; tabUnc = 0.13;
129 tab = 0.098334; tabUnc = 0.0070679;
132 else if( ccestimator ==
kV0A ){
134 tab = 0.183; tabUnc = 0.006245;
136 tab = 0.134; tabUnc = 0.004899;
138 tab = 0.092; tabUnc = 0.004796;
140 tab = 0.041; tabUnc = 0.008832;
143 else if( ccestimator ==
kZNA ){
145 tab = 0.164; tabUnc = 0.010724;
147 tab = 0.137; tabUnc = 0.005099;
149 tab = 0.1011; tabUnc = 0.006;
151 tab = 0.0459; tabUnc = 0.003162;
154 else if( ccestimator ==
kCL1 ){
156 tab = 0.19; tabUnc = 0.007;
158 tab = 0.136; tabUnc = 0.005;
160 tab = 0.088; tabUnc = 0.005;
162 tab = 0.0369; tabUnc = 0.0085;
175 TH1D *hFeedDownMCpt=0;
176 TH1D *hDirectMCptMax=0;
177 TH1D *hDirectMCptMin=0;
178 TH1D *hFeedDownMCptMax=0;
179 TH1D *hFeedDownMCptMin=0;
181 TH1D *hDirectEffpt=0;
182 TH1D *hFeedDownEffpt=0;
189 TFile * mcfile =
new TFile(mcfilename,
"read");
192 hDirectMCpt = (
TH1D*)mcfile->Get(
"hD0Kpipred_central");
193 hFeedDownMCpt = (
TH1D*)mcfile->Get(
"hD0KpifromBpred_central_corr");
194 hDirectMCptMax = (
TH1D*)mcfile->Get(
"hD0Kpipred_max");
195 hDirectMCptMin = (
TH1D*)mcfile->Get(
"hD0Kpipred_min");
196 hFeedDownMCptMax = (
TH1D*)mcfile->Get(
"hD0KpifromBpred_max_corr");
197 hFeedDownMCptMin = (
TH1D*)mcfile->Get(
"hD0KpifromBpred_min_corr");
202 hDirectMCpt = (
TH1D*)mcfile->Get(
"hDpluskpipipred_central");
203 hFeedDownMCpt = (
TH1D*)mcfile->Get(
"hDpluskpipifromBpred_central_corr");
204 hDirectMCptMax = (
TH1D*)mcfile->Get(
"hDpluskpipipred_max");
205 hDirectMCptMin = (
TH1D*)mcfile->Get(
"hDpluskpipipred_min");
206 hFeedDownMCptMax = (
TH1D*)mcfile->Get(
"hDpluskpipifromBpred_max_corr");
207 hFeedDownMCptMin = (
TH1D*)mcfile->Get(
"hDpluskpipifromBpred_min_corr");
212 hDirectMCpt = (
TH1D*)mcfile->Get(
"hDstarD0pipred_central");
213 hFeedDownMCpt = (
TH1D*)mcfile->Get(
"hDstarD0pifromBpred_central_corr");
214 hDirectMCptMax = (
TH1D*)mcfile->Get(
"hDstarD0pipred_max");
215 hDirectMCptMin = (
TH1D*)mcfile->Get(
"hDstarD0pipred_min");
216 hFeedDownMCptMax = (
TH1D*)mcfile->Get(
"hDstarD0pifromBpred_max_corr");
217 hFeedDownMCptMin = (
TH1D*)mcfile->Get(
"hDstarD0pifromBpred_min_corr");
222 hDirectMCpt = (
TH1D*)mcfile->Get(
"hDsPhipitoKkpipred_central");
223 hFeedDownMCpt = (
TH1D*)mcfile->Get(
"hDsPhipitoKkpifromBpred_central_corr");
224 hDirectMCptMax = (
TH1D*)mcfile->Get(
"hDsPhipitoKkpipred_max");
225 hDirectMCptMin = (
TH1D*)mcfile->Get(
"hDsPhipitoKkpipred_min");
226 hFeedDownMCptMax = (
TH1D*)mcfile->Get(
"hDsPhipitoKkpifromBpred_max_corr");
227 hFeedDownMCptMin = (
TH1D*)mcfile->Get(
"hDsPhipitoKkpifromBpred_min_corr");
231 hDirectMCpt = (
TH1D*)mcfile->Get(
"hLcpkpipred_central");
232 hFeedDownMCpt = (
TH1D*)mcfile->Get(
"hLcpkpifromBpred_central_corr");
233 hDirectMCptMax = (
TH1D*)mcfile->Get(
"hLcpkpipred_max");
234 hDirectMCptMin = (
TH1D*)mcfile->Get(
"hLcpkpipred_min");
235 hFeedDownMCptMax = (
TH1D*)mcfile->Get(
"hLcpkpifromBpred_max_corr");
236 hFeedDownMCptMin = (
TH1D*)mcfile->Get(
"hLcpkpifromBpred_min_corr");
240 hDirectMCpt = (
TH1D*)mcfile->Get(
"hLcK0sppred_central");
241 hFeedDownMCpt = (
TH1D*)mcfile->Get(
"hLcK0spfromBpred_central_corr");
242 hDirectMCptMax = (
TH1D*)mcfile->Get(
"hLcK0sppred_max");
243 hDirectMCptMin = (
TH1D*)mcfile->Get(
"hLcK0sppred_min");
244 hFeedDownMCptMax = (
TH1D*)mcfile->Get(
"hLcK0spfromBpred_max_corr");
245 hFeedDownMCptMin = (
TH1D*)mcfile->Get(
"hLcK0spfromBpred_min_corr");
248 hDirectMCpt->SetNameTitle(
"hDirectMCpt",
"direct MC spectra");
249 hFeedDownMCpt->SetNameTitle(
"hFeedDownMCpt",
"feed-down MC spectra");
250 hDirectMCptMax->SetNameTitle(
"hDirectMCptMax",
"max direct MC spectra");
251 hDirectMCptMin->SetNameTitle(
"hDirectMCptMin",
"min direct MC spectra");
252 hFeedDownMCptMax->SetNameTitle(
"hFeedDownMCptMax",
"max feed-down MC spectra");
253 hFeedDownMCptMin->SetNameTitle(
"hFeedDownMCptMin",
"min feed-down MC spectra");
259 switch(rapiditySlice) {
260 case k08to04: scaleFONLL = (0.093+0.280)/1.0;
break;
261 case k07to04: scaleFONLL = 0.280/1.0;
break;
262 case k04to01: scaleFONLL = 0.284/1.0;
break;
263 case k01to01: scaleFONLL = 0.191/1.0;
break;
264 case k01to04: scaleFONLL = 0.288/1.0;
break;
265 case k04to07: scaleFONLL = 0.288/1.0;
break;
266 case k04to08: scaleFONLL = (0.288+0.096)/1.0;
break;
267 case k01to05: scaleFONLL = (0.4)/1.0;
break;
269 hDirectMCpt->Scale(scaleFONLL);
270 hDirectMCptMax->Scale(scaleFONLL);
271 hDirectMCptMin->Scale(scaleFONLL);
272 switch(rapiditySlice) {
273 case k08to04: scaleFONLL = (0.089+0.274)/1.0;
break;
274 case k07to04: scaleFONLL = 0.274/1.0;
break;
275 case k04to01: scaleFONLL = 0.283/1.0;
break;
276 case k01to01: scaleFONLL = 0.192/1.0;
break;
277 case k01to04: scaleFONLL = 0.290/1.0;
break;
278 case k04to07: scaleFONLL = 0.291/1.0;
break;
279 case k04to08: scaleFONLL = (0.291+0.097)/1.0;
break;
280 case k01to05: scaleFONLL = (0.4)/1.0;
break;
282 hFeedDownMCpt->Scale(scaleFONLL);
283 hFeedDownMCptMax->Scale(scaleFONLL);
284 hFeedDownMCptMin->Scale(scaleFONLL);
289 TFile * efffile =
new TFile(efffilename,
"read");
290 hDirectEffpt = (
TH1D*)efffile->Get(
"hEffD");
291 hDirectEffpt->SetNameTitle(
"hDirectEffpt",
"direct acc x eff");
292 hFeedDownEffpt = (
TH1D*)efffile->Get(
"hEffB");
293 hFeedDownEffpt->SetNameTitle(
"hFeedDownEffpt",
"feed-down acc x eff");
296 TFile * recofile =
new TFile(recofilename,
"read");
297 hRECpt = (
TH1D*)recofile->Get(recohistoname);
298 hRECpt->SetNameTitle(
"hRECpt",
"Reconstructed spectra");
302 TH1D *hEPresolCorr=0;
304 EPf =
new TFile(epResolfile,
"read");
305 if(isRaavsEP==
kInPlane) hEPresolCorr = (
TH1D*)EPf->Get(
"hCorrEPresol_InPlane");
306 else if(isRaavsEP==
kOutOfPlane) hEPresolCorr = (
TH1D*)EPf->Get(
"hCorrEPresol_OutOfPlane");
307 for(
Int_t i=1; i<=hRECpt->GetNbinsX(); i++) {
308 Double_t value = hRECpt->GetBinContent(i);
309 Double_t error = hRECpt->GetBinError(i);
310 Double_t pt = hRECpt->GetBinCenter(i);
311 Int_t epbin = hEPresolCorr->FindBin( pt );
312 Double_t epcorr = hEPresolCorr->GetBinContent( epbin );
313 value = value*epcorr;
314 error = error*epcorr;
315 hRECpt->SetBinContent(i,value);
316 hRECpt->SetBinError(i,error);
323 TFile *out =
new TFile(outfilename,
"recreate");
328 TH1D *histoYieldCorr=0;
329 TH1D *histoYieldCorrMax=0;
330 TH1D *histoYieldCorrMin=0;
331 TH1D *histoSigmaCorr=0;
332 TH1D *histoSigmaCorrMax=0;
333 TH1D *histoSigmaCorrMin=0;
336 TH1D *histofcRcb_px=0;
337 TH2D *histoYieldCorrRcb=0;
338 TH2D *histoSigmaCorrRcb=0;
349 TNtuple * nSigma = 0;
367 cout <<
" Setting the reconstructed spectrum,";
370 cout <<
" the efficiency,";
374 cout <<
" the theoretical spectra";
384 cout <<
" and the normalization" <<endl;
396 Double_t globalBCEffRatioUnc = 0.05;
397 if(analysisSpeciality==
kLowPt) globalBCEffRatioUnc = 0.;
415 Bool_t combineFeedDown =
true;
429 switch(rapiditySlice) {
430 case k08to04: rapidity=
"0804";
break;
431 case k07to04: rapidity=
"0804";
break;
432 case k04to01: rapidity=
"0401";
break;
433 case k01to01: rapidity=
"0101";
break;
434 case k01to04: rapidity=
"0104";
break;
435 case k04to07: rapidity=
"0408";
break;
436 case k04to08: rapidity=
"0408";
break;
437 case k01to05: rapidity=
"0401";
break;
442 if(ccestimator==
kV0A) {
447 }
else if (ccestimator==
kZNA) {
452 }
else if (ccestimator==
kCL1) {
459 cout <<
" Error on the pPb options"<<endl;
491 cout <<
" Systematics not yet implemented " << endl;
495 if(analysisSpeciality==
kLowPt){
501 else if(analysisSpeciality==
kBDT){
505 systematics->
Init(decay);
509 cout <<
" Doing the calculation... "<< endl;
512 Double_t branchingRatioBintoFinalDecay = 1.0;
515 cout <<
" ended the calculation, getting the histograms back " << endl;
529 histoYieldCorr->SetNameTitle(
"histoYieldCorr",
"corrected yield");
530 histoYieldCorrMax->SetNameTitle(
"histoYieldCorrMax",
"max corrected yield");
531 histoYieldCorrMin->SetNameTitle(
"histoYieldCorrMin",
"min corrected yield");
532 histoSigmaCorr->SetNameTitle(
"histoSigmaCorr",
"corrected invariant cross-section");
533 histoSigmaCorrMax->SetNameTitle(
"histoSigmaCorrMax",
"max corrected invariant cross-section");
534 histoSigmaCorrMin->SetNameTitle(
"histoSigmaCorrMin",
"min corrected invariant cross-section");
543 histofcRcb->SetName(
"histofcRcb");
544 histoYieldCorrRcb->SetName(
"histoYieldCorrRcb");
545 histoSigmaCorrRcb->SetName(
"histoSigmaCorrRcb");
560 gYieldCorr->SetNameTitle(
"gYieldCorr",
"gYieldCorr (uncorr)");
561 gSigmaCorr->SetNameTitle(
"gSigmaCorr",
"gSigmaCorr (uncorr)");
568 histofc->SetNameTitle(
"histofc",
"fc correction factor");
569 histofcMax->SetNameTitle(
"histofcMax",
"max fc correction factor");
570 histofcMin->SetNameTitle(
"histofcMin",
"min fc correction factor");
572 gYieldCorr->SetNameTitle(
"gYieldCorr",
"gYieldCorr (by fc)");
573 gSigmaCorr->SetNameTitle(
"gSigmaCorr",
"gSigmaCorr (by fc)");
575 gFcExtreme->SetNameTitle(
"gFcExtreme",
"gFcExtreme");
576 gYieldCorrExtreme->SetNameTitle(
"gYieldCorrExtreme",
"Extreme gYieldCorr (by fc)");
577 gSigmaCorrExtreme->SetNameTitle(
"gSigmaCorrExtreme",
"Extreme gSigmaCorr (by fc)");
579 gFcConservative->SetNameTitle(
"gFcConservative",
"gFcConservative");
580 gYieldCorrConservative->SetNameTitle(
"gYieldCorrConservative",
"Conservative gYieldCorr (by fc)");
581 gSigmaCorrConservative->SetNameTitle(
"gSigmaCorrConservative",
"Conservative gSigmaCorr (by fc)");
584 if (option==2 && asym) {
585 gYieldCorr->SetNameTitle(
"gYieldCorr",
"gYieldCorr (by Nb)");
586 gSigmaCorr->SetNameTitle(
"gSigmaCorr",
"gSigmaCorr (by Nb)");
587 gYieldCorrExtreme->SetNameTitle(
"gYieldCorrExtreme",
"Extreme gYieldCorr (by Nb)");
588 gSigmaCorrExtreme->SetNameTitle(
"gSigmaCorrExtreme",
"Extreme gSigmaCorr (by Nb)");
589 gYieldCorrConservative->SetNameTitle(
"gYieldCorrConservative",
"Conservative gYieldCorr (by Nb)");
590 gSigmaCorrConservative->SetNameTitle(
"gSigmaCorrConservative",
"Conservative gSigmaCorr (by Nb)");
592 gFcConservative->SetNameTitle(
"gFcConservative",
"gFcConservative");
603 gROOT->SetStyle(
"Plain");
605 cout <<
" Drawing the results ! " << endl;
610 TCanvas *ceff =
new TCanvas(
"ceff",
"efficiency drawing");
613 hDirectEffpt->Draw();
615 hFeedDownEffpt->Draw();
618 TCanvas *cTheoryRebin =
new TCanvas(
"cTheoryRebin",
"control the theoretical spectra rebin");
619 cTheoryRebin->Divide(1,2);
621 hDirectMCpt->Draw(
"");
623 hDirectMCptRebin->SetLineColor(2);
624 hDirectMCptRebin->Draw(
"same");
626 hFeedDownMCpt->Draw(
"");
628 hFeedDownRebin->SetLineColor(2);
629 hFeedDownRebin->Draw(
"same");
630 cTheoryRebin->Update();
632 TCanvas *cTheoryRebinLimits =
new TCanvas(
"cTheoryRebinLimits",
"control the theoretical spectra limits rebin");
633 cTheoryRebinLimits->Divide(1,2);
634 cTheoryRebinLimits->cd(1);
635 hDirectMCptMax->Draw(
"");
637 hDirectMCptMaxRebin->SetLineColor(2);
638 hDirectMCptMaxRebin->Draw(
"same");
639 hDirectMCptMin->Draw(
"same");
641 hDirectMCptMinRebin->SetLineColor(2);
642 hDirectMCptMinRebin->Draw(
"same");
643 cTheoryRebinLimits->cd(2);
644 hFeedDownMCptMax->Draw(
"");
646 hFeedDownMaxRebin->SetLineColor(2);
647 hFeedDownMaxRebin->Draw(
"same");
648 hFeedDownMCptMin->Draw(
"same");
650 hFeedDownMinRebin->SetLineColor(2);
651 hFeedDownMinRebin->Draw(
"same");
652 cTheoryRebinLimits->Update();
657 TCanvas * cfc =
new TCanvas(
"cfc",
"Fc");
658 histofcMax->Draw(
"c");
659 histofc->Draw(
"csame");
660 histofcMin->Draw(
"csame");
664 TH2F *histofcDraw=
new TH2F(
"histofcDraw",
"histofc (for drawing)",100,0,33.25,100,0.01,1.25);
665 histofcDraw->SetStats(0);
666 histofcDraw->GetXaxis()->SetTitle(
"p_{T} [GeV]");
667 histofcDraw ->GetXaxis()->SetTitleSize(0.05);
668 histofcDraw->GetXaxis()->SetTitleOffset(0.95);
669 histofcDraw->GetYaxis()->SetTitle(
" fc ");
670 histofcDraw->GetYaxis()->SetTitleSize(0.05);
688 TCanvas *cfcExtreme =
new TCanvas(
"cfcExtreme",
"Extreme Asymmetric fc (TGraphAsymmErr)");
689 gFcExtreme->SetFillStyle(3006);
690 gFcExtreme->SetLineWidth(3);
691 gFcExtreme->SetMarkerStyle(20);
692 gFcExtreme->SetFillColor(2);
694 gFcExtreme->Draw(
"3same");
697 gFcConservative->SetFillStyle(3007);
698 gFcConservative->SetFillColor(4);
699 gFcConservative->Draw(
"3same");
702 cfcExtreme->Update();
711 TCanvas * cresult =
new TCanvas(
"cresult",
"corrected yields & sigma");
712 hDirectMCpt->SetMarkerStyle(20);
713 hDirectMCpt->SetMarkerColor(4);
714 hDirectMCpt->Draw(
"p");
715 histoSigmaCorr->SetMarkerStyle(21);
716 histoSigmaCorr->SetMarkerColor(2);
717 histoSigmaCorr->Draw(
"psame");
718 histoYieldCorr->SetMarkerStyle(22);
719 histoYieldCorr->SetMarkerColor(6);
720 histoYieldCorr->Draw(
"psame");
721 hRECpt->SetMarkerStyle(23);
722 hRECpt->SetMarkerColor(3);
723 hRECpt->Draw(
"psame");
727 TCanvas * cresult2 =
new TCanvas(
"cresult2",
"corrected yield & sigma");
728 histoSigmaCorr->SetMarkerStyle(21);
729 histoSigmaCorr->SetMarkerColor(2);
730 histoSigmaCorr->Draw(
"p");
731 histoYieldCorr->SetMarkerStyle(22);
732 histoYieldCorr->SetMarkerColor(6);
733 histoYieldCorr->Draw(
"psame");
734 hRECpt->SetMarkerStyle(23);
735 hRECpt->SetMarkerColor(3);
736 hRECpt->Draw(
"psame");
743 TH2F *histoDraw =
new TH2F(
"histoDraw",
"histo (for drawing)",100,0,33.25,100,50.,1e7);
744 float max = 1.1*gYieldCorr->GetMaximum();
745 histoDraw->SetAxisRange(0.1,max,
"Y");
746 histoDraw->SetStats(0);
747 histoDraw->GetXaxis()->SetTitle(
"p_{T} [GeV]");
748 histoDraw->GetXaxis()->SetTitleSize(0.05);
749 histoDraw->GetXaxis()->SetTitleOffset(0.95);
750 histoDraw->GetYaxis()->SetTitle(
"#frac{d#N}{dp_{T}} |_{|y|<1} [L & trigger uncorr]");
751 histoDraw->GetYaxis()->SetTitleSize(0.05);
752 TCanvas * cyieldAsym =
new TCanvas(
"cyieldAsym",
"Asymmetric corrected yield (TGraphAsymmErr)");
753 gYieldCorr->SetFillStyle(3001);
754 gYieldCorr->SetLineWidth(3);
755 gYieldCorr->SetMarkerStyle(20);
756 gYieldCorr->SetFillColor(3);
758 gYieldCorr->Draw(
"3LPsame");
759 gYieldCorr->Draw(
"Xsame");
760 cyieldAsym->SetLogy();
761 cyieldAsym->Update();
763 TCanvas * cyieldExtreme =
new TCanvas(
"cyieldExtreme",
"Extreme Asymmetric corrected yield (TGraphAsymmErr)");
764 histoYieldCorr->Draw();
765 gYieldCorrExtreme->SetFillStyle(3002);
766 gYieldCorrExtreme->SetLineWidth(3);
767 gYieldCorrExtreme->SetMarkerStyle(20);
768 gYieldCorrExtreme->SetFillColor(2);
769 histoYieldCorr->Draw();
770 gYieldCorr->Draw(
"3same");
771 gYieldCorrExtreme->Draw(
"3same");
772 cyieldExtreme->SetLogy();
773 cyieldExtreme->Update();
775 TH2F *histo2Draw =
new TH2F(
"histo2Draw",
"histo2 (for drawing)",100,0,33.25,100,50.,1e9);
776 max = 1.1*gSigmaCorr->GetMaximum();
777 histo2Draw->SetAxisRange(0.1,max,
"Y");
778 histo2Draw->SetStats(0);
779 histo2Draw->GetXaxis()->SetTitle(
"p_{T} [GeV]");
780 histo2Draw->GetXaxis()->SetTitleSize(0.05);
781 histo2Draw->GetXaxis()->SetTitleOffset(0.95);
782 histo2Draw->GetYaxis()->SetTitle(
"#frac{1}{BR} #times #frac{d#sigma}{dp_{T}} |_{|y|<1}");
783 histo2Draw->GetYaxis()->SetTitleSize(0.05);
784 TCanvas * csigmaAsym =
new TCanvas(
"csigmaAsym",
"Asymmetric corrected sigma (TGraphAsymmErr)");
785 gSigmaCorr->SetFillStyle(3001);
786 gSigmaCorr->SetLineWidth(3);
787 gSigmaCorr->SetMarkerStyle(21);
788 gSigmaCorr->SetFillColor(3);
790 gSigmaCorr->Draw(
"3LPsame");
791 gSigmaCorr->Draw(
"Xsame");
792 csigmaAsym->SetLogy();
793 csigmaAsym->Update();
804 TCanvas * csigmaExtreme =
new TCanvas(
"csigmaExtreme",
"Asymmetric extreme corrected sigma (TGraphAsymmErr)");
805 histoSigmaCorr->Draw();
806 gSigmaCorr->Draw(
"3Psame");
807 gSigmaCorrExtreme->SetFillStyle(3002);
808 gSigmaCorrExtreme->SetLineWidth(3);
809 gSigmaCorrExtreme->SetMarkerStyle(21);
810 gSigmaCorrExtreme->SetFillColor(2);
811 gSigmaCorrExtreme->Draw(
"3Psame");
812 csigmaExtreme->SetLogy();
813 csigmaExtreme->Update();
838 gStyle->SetPalette(1);
839 TCanvas *canvasfcRcb =
new TCanvas(
"canvasfcRcb",
"fc vs pt vs Rcb");
841 histofcRcb->Draw(
"colz");
842 canvasfcRcb->Update();
844 TCanvas *canvasfcRcb1 =
new TCanvas(
"canvasfcRcb1",
"fc vs pt vs Rcb=1");
845 histofcRcb_px = (
TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px",40,40);
846 histofcRcb_px->SetLineColor(2);
849 histofcRcb_px->Draw(
"same");
850 }
else histofcRcb_px->Draw(
"");
851 canvasfcRcb1->Update();
852 TCanvas *canvasfcRcb2 =
new TCanvas(
"canvasfcRcb2",
"fc vs pt vs Rcb fixed Rcb");
860 TH1D * histofcRcb_px0a = (
TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px0a",bin0,bin0);
861 TH1D * histofcRcb_px0 = (
TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px0",bin1,bin1);
862 TH1D * histofcRcb_px1 = (
TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px1",bin2,bin2);
863 TH1D * histofcRcb_px2 = (
TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px2",bin3,bin3);
864 TH1D * histofcRcb_px3 = (
TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px3",bin4,bin4);
865 TH1D * histofcRcb_px4 = (
TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px4",bin5,bin5);
866 TH1D * histofcRcb_px5 = (
TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px5",bin6,bin6);
872 histofcRcb_px0a->SetLineColor(2);
873 histofcRcb_px0a->Draw(
"");
875 histofcRcb_px0a->SetLineColor(2);
876 histofcRcb_px0a->Draw(
"same");
877 histofcRcb_px0->SetLineColor(4);
878 histofcRcb_px0->Draw(
"same");
879 histofcRcb_px1->SetLineColor(3);
880 histofcRcb_px1->Draw(
"same");
881 histofcRcb_px2->SetLineColor(kCyan);
882 histofcRcb_px2->Draw(
"same");
883 histofcRcb_px3->SetLineColor(kMagenta+1);
884 histofcRcb_px3->Draw(
"same");
885 histofcRcb_px4->SetLineColor(kOrange+7);
886 histofcRcb_px4->Draw(
"same");
887 histofcRcb_px5->SetLineColor(kGreen+3);
888 histofcRcb_px5->Draw(
"same");
889 TLegend *legrcc =
new TLegend(0.8,0.8,0.95,0.9);
890 legrcc->SetFillColor(0);
892 legrcc->AddEntry(histofcRcb_px0a,
"Rc/b=0.25",
"l");
893 legrcc->AddEntry(histofcRcb_px0,
"Rc/b=0.5",
"l");
894 legrcc->AddEntry(histofcRcb_px1,
"Rc/b=1.0",
"l");
895 legrcc->AddEntry(histofcRcb_px2,
"Rc/b=1.5",
"l");
896 legrcc->AddEntry(histofcRcb_px3,
"Rc/b=2.0",
"l");
897 legrcc->AddEntry(histofcRcb_px4,
"Rc/b=3.0",
"l");
898 legrcc->AddEntry(histofcRcb_px5,
"Rc/b=4.0",
"l");
900 legrcc->AddEntry(histofcRcb_px0a,
"Rb=0.25",
"l");
901 legrcc->AddEntry(histofcRcb_px0,
"Rb=0.5",
"l");
902 legrcc->AddEntry(histofcRcb_px1,
"Rb=1.0",
"l");
903 legrcc->AddEntry(histofcRcb_px2,
"Rb=1.5",
"l");
904 legrcc->AddEntry(histofcRcb_px3,
"Rb=2.0",
"l");
905 legrcc->AddEntry(histofcRcb_px4,
"Rb=3.0",
"l");
906 legrcc->AddEntry(histofcRcb_px5,
"Rb=4.0",
"l");
909 canvasfcRcb2->Update();
910 TCanvas *canvasYRcb =
new TCanvas(
"canvasYRcb",
"corrected yield vs pt vs Rcb");
911 histoYieldCorrRcb->Draw(
"cont4z");
912 canvasYRcb->Update();
913 TCanvas *canvasSRcb =
new TCanvas(
"canvasSRcb",
"sigma vs pt vs Rcb");
914 histoSigmaCorrRcb->Draw(
"cont4z");
915 canvasSRcb->Update();
916 TCanvas *canvasSRcb1 =
new TCanvas(
"canvasSRcb1",
"sigma vs pt vs Rcb fixed Rcb");
917 TH1D * histoSigmaCorrRcb_px0a = (
TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px0a",bin0,bin0);
918 TH1D * histoSigmaCorrRcb_px0 = (
TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px0",bin1,bin1);
919 TH1D * histoSigmaCorrRcb_px1 = (
TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px1",bin2,bin2);
920 TH1D * histoSigmaCorrRcb_px2 = (
TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px2",bin3,bin3);
921 TH1D * histoSigmaCorrRcb_px3 = (
TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px3",bin4,bin4);
922 TH1D * histoSigmaCorrRcb_px4 = (
TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px4",bin5,bin5);
923 TH1D * histoSigmaCorrRcb_px5 = (
TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px5",bin6,bin6);
924 histoSigmaCorr->Draw();
925 histoSigmaCorrRcb_px0a->SetLineColor(2);
926 histoSigmaCorrRcb_px0a->Draw(
"hsame");
927 histoSigmaCorrRcb_px0->SetLineColor(4);
928 histoSigmaCorrRcb_px0->Draw(
"hsame");
929 histoSigmaCorrRcb_px1->SetLineColor(3);
930 histoSigmaCorrRcb_px1->Draw(
"hsame");
931 histoSigmaCorrRcb_px2->SetLineColor(kCyan);
932 histoSigmaCorrRcb_px2->Draw(
"hsame");
933 histoSigmaCorrRcb_px3->SetLineColor(kMagenta+1);
934 histoSigmaCorrRcb_px3->Draw(
"hsame");
935 histoSigmaCorrRcb_px4->SetLineColor(kOrange+7);
936 histoSigmaCorrRcb_px4->Draw(
"same");
937 histoSigmaCorrRcb_px5->SetLineColor(kGreen+3);
938 histoSigmaCorrRcb_px5->Draw(
"same");
939 TLegend *legrcb =
new TLegend(0.8,0.8,0.95,0.9);
940 legrcb->SetFillColor(0);
942 legrcb->AddEntry(histoSigmaCorrRcb_px0a,
"Rc/b=0.25",
"l");
943 legrcb->AddEntry(histoSigmaCorrRcb_px0,
"Rc/b=0.5",
"l");
944 legrcb->AddEntry(histoSigmaCorrRcb_px1,
"Rc/b=1.0",
"l");
945 legrcb->AddEntry(histoSigmaCorrRcb_px2,
"Rc/b=1.5",
"l");
946 legrcb->AddEntry(histoSigmaCorrRcb_px3,
"Rc/b=2.0",
"l");
947 legrcb->AddEntry(histoSigmaCorrRcb_px4,
"Rc/b=3.0",
"l");
948 legrcb->AddEntry(histoSigmaCorrRcb_px5,
"Rc/b=4.0",
"l");
950 legrcb->AddEntry(histoSigmaCorrRcb_px0a,
"Rb=0.25",
"l");
951 legrcb->AddEntry(histoSigmaCorrRcb_px0,
"Rb=0.5",
"l");
952 legrcb->AddEntry(histoSigmaCorrRcb_px1,
"Rb=1.0",
"l");
953 legrcb->AddEntry(histoSigmaCorrRcb_px2,
"Rb=1.5",
"l");
954 legrcb->AddEntry(histoSigmaCorrRcb_px3,
"Rb=2.0",
"l");
955 legrcb->AddEntry(histoSigmaCorrRcb_px4,
"Rb=3.0",
"l");
956 legrcb->AddEntry(histoSigmaCorrRcb_px5,
"Rb=4.0",
"l");
959 canvasSRcb1->Update();
966 cout <<
" Saving the results ! " << endl<< endl;
970 hDirectMCpt->Write(); hFeedDownMCpt->Write();
971 hDirectMCptMax->Write(); hDirectMCptMin->Write();
972 hFeedDownMCptMax->Write(); hFeedDownMCptMin->Write();
973 if(hDirectEffpt) hDirectEffpt->Write();
if(hFeedDownEffpt) hFeedDownEffpt->Write();
976 histoYieldCorr->Write();
977 histoYieldCorrMax->Write(); histoYieldCorrMin->Write();
978 histoSigmaCorr->Write();
979 histoSigmaCorrMax->Write(); histoSigmaCorrMin->Write();
982 histofcRcb->Write(); histofcRcb_px->Write();
983 histoYieldCorrRcb->Write();
984 histoSigmaCorrRcb->Write();
991 if(gYieldCorrExtreme) gYieldCorrExtreme->Write();
992 if(gSigmaCorrExtreme) gSigmaCorrExtreme->Write();
993 if(gYieldCorrConservative) gYieldCorrConservative->Write();
994 if(gSigmaCorrConservative) gSigmaCorrConservative->Write();
995 if(asym && gFcConservative) gFcConservative->Write();
1000 histofcMax->Write(); histofcMin->Write();
1001 if(asym && gFcExtreme) gFcExtreme->Write();
1007 hStatUncEffcSigma->Write();
1008 hStatUncEffbSigma->Write();
1012 hStatUncEffcFD->Write();
1013 hStatUncEffbFD->Write();
1015 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 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.