1 #if !defined(__CINT__) || defined(__MAKECINT__) 8 #include "TGraphAsymmErrors.h" 42 enum centrality{
kpp8,
kpp7,
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;
435 switch(rapiditySlice) {
436 case k08to04: rapidity=
"0804";
break;
437 case k07to04: rapidity=
"0804";
break;
438 case k04to01: rapidity=
"0401";
break;
439 case k01to01: rapidity=
"0101";
break;
440 case k01to04: rapidity=
"0104";
break;
441 case k04to07: rapidity=
"0408";
break;
442 case k04to08: rapidity=
"0408";
break;
443 case k01to05: rapidity=
"0401";
break;
448 if(ccestimator==
kV0A) {
453 }
else if (ccestimator==
kZNA) {
459 }
else if (ccestimator==
kCL1) {
466 cout <<
" Error on the pPb options"<<endl;
492 systematicsAB->SetRunNumber(15);
494 systematicsAB->SetCentrality(
"3050");
497 systematicsAB->SetCentrality(
"3050");
501 cout <<
" Systematics not yet implemented " << endl;
505 if(analysisSpeciality==
kLowPt){
511 else if(analysisSpeciality==
kBDT){
515 systematics->
Init(decay);
519 cout <<
" Doing the calculation... "<< endl;
522 Double_t branchingRatioBintoFinalDecay = 1.0;
525 cout <<
" ended the calculation, getting the histograms back " << endl;
539 histoYieldCorr->SetNameTitle(
"histoYieldCorr",
"corrected yield");
540 histoYieldCorrMax->SetNameTitle(
"histoYieldCorrMax",
"max corrected yield");
541 histoYieldCorrMin->SetNameTitle(
"histoYieldCorrMin",
"min corrected yield");
542 histoSigmaCorr->SetNameTitle(
"histoSigmaCorr",
"corrected invariant cross-section");
543 histoSigmaCorrMax->SetNameTitle(
"histoSigmaCorrMax",
"max corrected invariant cross-section");
544 histoSigmaCorrMin->SetNameTitle(
"histoSigmaCorrMin",
"min corrected invariant cross-section");
553 histofcRcb->SetName(
"histofcRcb");
554 histoYieldCorrRcb->SetName(
"histoYieldCorrRcb");
555 histoSigmaCorrRcb->SetName(
"histoSigmaCorrRcb");
570 gYieldCorr->SetNameTitle(
"gYieldCorr",
"gYieldCorr (uncorr)");
571 gSigmaCorr->SetNameTitle(
"gSigmaCorr",
"gSigmaCorr (uncorr)");
578 histofc->SetNameTitle(
"histofc",
"fc correction factor");
579 histofcMax->SetNameTitle(
"histofcMax",
"max fc correction factor");
580 histofcMin->SetNameTitle(
"histofcMin",
"min fc correction factor");
582 gYieldCorr->SetNameTitle(
"gYieldCorr",
"gYieldCorr (by fc)");
583 gSigmaCorr->SetNameTitle(
"gSigmaCorr",
"gSigmaCorr (by fc)");
585 gFcExtreme->SetNameTitle(
"gFcExtreme",
"gFcExtreme");
586 gYieldCorrExtreme->SetNameTitle(
"gYieldCorrExtreme",
"Extreme gYieldCorr (by fc)");
587 gSigmaCorrExtreme->SetNameTitle(
"gSigmaCorrExtreme",
"Extreme gSigmaCorr (by fc)");
589 gFcConservative->SetNameTitle(
"gFcConservative",
"gFcConservative");
590 gYieldCorrConservative->SetNameTitle(
"gYieldCorrConservative",
"Conservative gYieldCorr (by fc)");
591 gSigmaCorrConservative->SetNameTitle(
"gSigmaCorrConservative",
"Conservative gSigmaCorr (by fc)");
594 if (option==2 && asym) {
595 gYieldCorr->SetNameTitle(
"gYieldCorr",
"gYieldCorr (by Nb)");
596 gSigmaCorr->SetNameTitle(
"gSigmaCorr",
"gSigmaCorr (by Nb)");
597 gYieldCorrExtreme->SetNameTitle(
"gYieldCorrExtreme",
"Extreme gYieldCorr (by Nb)");
598 gSigmaCorrExtreme->SetNameTitle(
"gSigmaCorrExtreme",
"Extreme gSigmaCorr (by Nb)");
599 gYieldCorrConservative->SetNameTitle(
"gYieldCorrConservative",
"Conservative gYieldCorr (by Nb)");
600 gSigmaCorrConservative->SetNameTitle(
"gSigmaCorrConservative",
"Conservative gSigmaCorr (by Nb)");
602 gFcConservative->SetNameTitle(
"gFcConservative",
"gFcConservative");
613 gROOT->SetStyle(
"Plain");
615 cout <<
" Drawing the results ! " << endl;
620 TCanvas *ceff =
new TCanvas(
"ceff",
"efficiency drawing");
623 hDirectEffpt->Draw();
625 hFeedDownEffpt->Draw();
628 TCanvas *cTheoryRebin =
new TCanvas(
"cTheoryRebin",
"control the theoretical spectra rebin");
629 cTheoryRebin->Divide(1,2);
631 hDirectMCpt->Draw(
"");
633 hDirectMCptRebin->SetLineColor(2);
634 hDirectMCptRebin->Draw(
"same");
636 hFeedDownMCpt->Draw(
"");
638 hFeedDownRebin->SetLineColor(2);
639 hFeedDownRebin->Draw(
"same");
640 cTheoryRebin->Update();
642 TCanvas *cTheoryRebinLimits =
new TCanvas(
"cTheoryRebinLimits",
"control the theoretical spectra limits rebin");
643 cTheoryRebinLimits->Divide(1,2);
644 cTheoryRebinLimits->cd(1);
645 hDirectMCptMax->Draw(
"");
647 hDirectMCptMaxRebin->SetLineColor(2);
648 hDirectMCptMaxRebin->Draw(
"same");
649 hDirectMCptMin->Draw(
"same");
651 hDirectMCptMinRebin->SetLineColor(2);
652 hDirectMCptMinRebin->Draw(
"same");
653 cTheoryRebinLimits->cd(2);
654 hFeedDownMCptMax->Draw(
"");
656 hFeedDownMaxRebin->SetLineColor(2);
657 hFeedDownMaxRebin->Draw(
"same");
658 hFeedDownMCptMin->Draw(
"same");
660 hFeedDownMinRebin->SetLineColor(2);
661 hFeedDownMinRebin->Draw(
"same");
662 cTheoryRebinLimits->Update();
667 TCanvas * cfc =
new TCanvas(
"cfc",
"Fc");
668 histofcMax->Draw(
"c");
669 histofc->Draw(
"csame");
670 histofcMin->Draw(
"csame");
674 TH2F *histofcDraw=
new TH2F(
"histofcDraw",
"histofc (for drawing)",100,0,33.25,100,0.01,1.25);
675 histofcDraw->SetStats(0);
676 histofcDraw->GetXaxis()->SetTitle(
"p_{T} [GeV]");
677 histofcDraw ->GetXaxis()->SetTitleSize(0.05);
678 histofcDraw->GetXaxis()->SetTitleOffset(0.95);
679 histofcDraw->GetYaxis()->SetTitle(
" fc ");
680 histofcDraw->GetYaxis()->SetTitleSize(0.05);
698 TCanvas *cfcExtreme =
new TCanvas(
"cfcExtreme",
"Extreme Asymmetric fc (TGraphAsymmErr)");
699 gFcExtreme->SetFillStyle(3006);
700 gFcExtreme->SetLineWidth(3);
701 gFcExtreme->SetMarkerStyle(20);
702 gFcExtreme->SetFillColor(2);
704 gFcExtreme->Draw(
"3same");
707 gFcConservative->SetFillStyle(3007);
708 gFcConservative->SetFillColor(4);
709 gFcConservative->Draw(
"3same");
712 cfcExtreme->Update();
721 TCanvas * cresult =
new TCanvas(
"cresult",
"corrected yields & sigma");
722 hDirectMCpt->SetMarkerStyle(20);
723 hDirectMCpt->SetMarkerColor(4);
724 hDirectMCpt->Draw(
"p");
725 histoSigmaCorr->SetMarkerStyle(21);
726 histoSigmaCorr->SetMarkerColor(2);
727 histoSigmaCorr->Draw(
"psame");
728 histoYieldCorr->SetMarkerStyle(22);
729 histoYieldCorr->SetMarkerColor(6);
730 histoYieldCorr->Draw(
"psame");
731 hRECpt->SetMarkerStyle(23);
732 hRECpt->SetMarkerColor(3);
733 hRECpt->Draw(
"psame");
737 TCanvas * cresult2 =
new TCanvas(
"cresult2",
"corrected yield & sigma");
738 histoSigmaCorr->SetMarkerStyle(21);
739 histoSigmaCorr->SetMarkerColor(2);
740 histoSigmaCorr->Draw(
"p");
741 histoYieldCorr->SetMarkerStyle(22);
742 histoYieldCorr->SetMarkerColor(6);
743 histoYieldCorr->Draw(
"psame");
744 hRECpt->SetMarkerStyle(23);
745 hRECpt->SetMarkerColor(3);
746 hRECpt->Draw(
"psame");
753 TH2F *histoDraw =
new TH2F(
"histoDraw",
"histo (for drawing)",100,0,33.25,100,50.,1e7);
754 float max = 1.1*gYieldCorr->GetMaximum();
755 histoDraw->SetAxisRange(0.1,max,
"Y");
756 histoDraw->SetStats(0);
757 histoDraw->GetXaxis()->SetTitle(
"p_{T} [GeV]");
758 histoDraw->GetXaxis()->SetTitleSize(0.05);
759 histoDraw->GetXaxis()->SetTitleOffset(0.95);
760 histoDraw->GetYaxis()->SetTitle(
"#frac{d#N}{dp_{T}} |_{|y|<1} [L & trigger uncorr]");
761 histoDraw->GetYaxis()->SetTitleSize(0.05);
762 TCanvas * cyieldAsym =
new TCanvas(
"cyieldAsym",
"Asymmetric corrected yield (TGraphAsymmErr)");
763 gYieldCorr->SetFillStyle(3001);
764 gYieldCorr->SetLineWidth(3);
765 gYieldCorr->SetMarkerStyle(20);
766 gYieldCorr->SetFillColor(3);
768 gYieldCorr->Draw(
"3LPsame");
769 gYieldCorr->Draw(
"Xsame");
770 cyieldAsym->SetLogy();
771 cyieldAsym->Update();
773 TCanvas * cyieldExtreme =
new TCanvas(
"cyieldExtreme",
"Extreme Asymmetric corrected yield (TGraphAsymmErr)");
774 histoYieldCorr->Draw();
775 gYieldCorrExtreme->SetFillStyle(3002);
776 gYieldCorrExtreme->SetLineWidth(3);
777 gYieldCorrExtreme->SetMarkerStyle(20);
778 gYieldCorrExtreme->SetFillColor(2);
779 histoYieldCorr->Draw();
780 gYieldCorr->Draw(
"3same");
781 gYieldCorrExtreme->Draw(
"3same");
782 cyieldExtreme->SetLogy();
783 cyieldExtreme->Update();
785 TH2F *histo2Draw =
new TH2F(
"histo2Draw",
"histo2 (for drawing)",100,0,33.25,100,50.,1e9);
786 max = 1.1*gSigmaCorr->GetMaximum();
787 histo2Draw->SetAxisRange(0.1,max,
"Y");
788 histo2Draw->SetStats(0);
789 histo2Draw->GetXaxis()->SetTitle(
"p_{T} [GeV]");
790 histo2Draw->GetXaxis()->SetTitleSize(0.05);
791 histo2Draw->GetXaxis()->SetTitleOffset(0.95);
792 histo2Draw->GetYaxis()->SetTitle(
"#frac{1}{BR} #times #frac{d#sigma}{dp_{T}} |_{|y|<1}");
793 histo2Draw->GetYaxis()->SetTitleSize(0.05);
794 TCanvas * csigmaAsym =
new TCanvas(
"csigmaAsym",
"Asymmetric corrected sigma (TGraphAsymmErr)");
795 gSigmaCorr->SetFillStyle(3001);
796 gSigmaCorr->SetLineWidth(3);
797 gSigmaCorr->SetMarkerStyle(21);
798 gSigmaCorr->SetFillColor(3);
800 gSigmaCorr->Draw(
"3LPsame");
801 gSigmaCorr->Draw(
"Xsame");
802 csigmaAsym->SetLogy();
803 csigmaAsym->Update();
814 TCanvas * csigmaExtreme =
new TCanvas(
"csigmaExtreme",
"Asymmetric extreme corrected sigma (TGraphAsymmErr)");
815 histoSigmaCorr->Draw();
816 gSigmaCorr->Draw(
"3Psame");
817 gSigmaCorrExtreme->SetFillStyle(3002);
818 gSigmaCorrExtreme->SetLineWidth(3);
819 gSigmaCorrExtreme->SetMarkerStyle(21);
820 gSigmaCorrExtreme->SetFillColor(2);
821 gSigmaCorrExtreme->Draw(
"3Psame");
822 csigmaExtreme->SetLogy();
823 csigmaExtreme->Update();
848 gStyle->SetPalette(1);
849 TCanvas *canvasfcRcb =
new TCanvas(
"canvasfcRcb",
"fc vs pt vs Rcb");
851 histofcRcb->Draw(
"colz");
852 canvasfcRcb->Update();
854 TCanvas *canvasfcRcb1 =
new TCanvas(
"canvasfcRcb1",
"fc vs pt vs Rcb=1");
855 histofcRcb_px = (
TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px",40,40);
856 histofcRcb_px->SetLineColor(2);
859 histofcRcb_px->Draw(
"same");
860 }
else histofcRcb_px->Draw(
"");
861 canvasfcRcb1->Update();
862 TCanvas *canvasfcRcb2 =
new TCanvas(
"canvasfcRcb2",
"fc vs pt vs Rcb fixed Rcb");
870 TH1D * histofcRcb_px0a = (
TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px0a",bin0,bin0);
871 TH1D * histofcRcb_px0 = (
TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px0",bin1,bin1);
872 TH1D * histofcRcb_px1 = (
TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px1",bin2,bin2);
873 TH1D * histofcRcb_px2 = (
TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px2",bin3,bin3);
874 TH1D * histofcRcb_px3 = (
TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px3",bin4,bin4);
875 TH1D * histofcRcb_px4 = (
TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px4",bin5,bin5);
876 TH1D * histofcRcb_px5 = (
TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px5",bin6,bin6);
882 histofcRcb_px0a->SetLineColor(2);
883 histofcRcb_px0a->Draw(
"");
885 histofcRcb_px0a->SetLineColor(2);
886 histofcRcb_px0a->Draw(
"same");
887 histofcRcb_px0->SetLineColor(4);
888 histofcRcb_px0->Draw(
"same");
889 histofcRcb_px1->SetLineColor(3);
890 histofcRcb_px1->Draw(
"same");
891 histofcRcb_px2->SetLineColor(kCyan);
892 histofcRcb_px2->Draw(
"same");
893 histofcRcb_px3->SetLineColor(kMagenta+1);
894 histofcRcb_px3->Draw(
"same");
895 histofcRcb_px4->SetLineColor(kOrange+7);
896 histofcRcb_px4->Draw(
"same");
897 histofcRcb_px5->SetLineColor(kGreen+3);
898 histofcRcb_px5->Draw(
"same");
899 TLegend *legrcc =
new TLegend(0.8,0.8,0.95,0.9);
900 legrcc->SetFillColor(0);
902 legrcc->AddEntry(histofcRcb_px0a,
"Rc/b=0.25",
"l");
903 legrcc->AddEntry(histofcRcb_px0,
"Rc/b=0.5",
"l");
904 legrcc->AddEntry(histofcRcb_px1,
"Rc/b=1.0",
"l");
905 legrcc->AddEntry(histofcRcb_px2,
"Rc/b=1.5",
"l");
906 legrcc->AddEntry(histofcRcb_px3,
"Rc/b=2.0",
"l");
907 legrcc->AddEntry(histofcRcb_px4,
"Rc/b=3.0",
"l");
908 legrcc->AddEntry(histofcRcb_px5,
"Rc/b=4.0",
"l");
910 legrcc->AddEntry(histofcRcb_px0a,
"Rb=0.25",
"l");
911 legrcc->AddEntry(histofcRcb_px0,
"Rb=0.5",
"l");
912 legrcc->AddEntry(histofcRcb_px1,
"Rb=1.0",
"l");
913 legrcc->AddEntry(histofcRcb_px2,
"Rb=1.5",
"l");
914 legrcc->AddEntry(histofcRcb_px3,
"Rb=2.0",
"l");
915 legrcc->AddEntry(histofcRcb_px4,
"Rb=3.0",
"l");
916 legrcc->AddEntry(histofcRcb_px5,
"Rb=4.0",
"l");
919 canvasfcRcb2->Update();
920 TCanvas *canvasYRcb =
new TCanvas(
"canvasYRcb",
"corrected yield vs pt vs Rcb");
921 histoYieldCorrRcb->Draw(
"cont4z");
922 canvasYRcb->Update();
923 TCanvas *canvasSRcb =
new TCanvas(
"canvasSRcb",
"sigma vs pt vs Rcb");
924 histoSigmaCorrRcb->Draw(
"cont4z");
925 canvasSRcb->Update();
926 TCanvas *canvasSRcb1 =
new TCanvas(
"canvasSRcb1",
"sigma vs pt vs Rcb fixed Rcb");
927 TH1D * histoSigmaCorrRcb_px0a = (
TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px0a",bin0,bin0);
928 TH1D * histoSigmaCorrRcb_px0 = (
TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px0",bin1,bin1);
929 TH1D * histoSigmaCorrRcb_px1 = (
TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px1",bin2,bin2);
930 TH1D * histoSigmaCorrRcb_px2 = (
TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px2",bin3,bin3);
931 TH1D * histoSigmaCorrRcb_px3 = (
TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px3",bin4,bin4);
932 TH1D * histoSigmaCorrRcb_px4 = (
TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px4",bin5,bin5);
933 TH1D * histoSigmaCorrRcb_px5 = (
TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px5",bin6,bin6);
934 histoSigmaCorr->Draw();
935 histoSigmaCorrRcb_px0a->SetLineColor(2);
936 histoSigmaCorrRcb_px0a->Draw(
"hsame");
937 histoSigmaCorrRcb_px0->SetLineColor(4);
938 histoSigmaCorrRcb_px0->Draw(
"hsame");
939 histoSigmaCorrRcb_px1->SetLineColor(3);
940 histoSigmaCorrRcb_px1->Draw(
"hsame");
941 histoSigmaCorrRcb_px2->SetLineColor(kCyan);
942 histoSigmaCorrRcb_px2->Draw(
"hsame");
943 histoSigmaCorrRcb_px3->SetLineColor(kMagenta+1);
944 histoSigmaCorrRcb_px3->Draw(
"hsame");
945 histoSigmaCorrRcb_px4->SetLineColor(kOrange+7);
946 histoSigmaCorrRcb_px4->Draw(
"same");
947 histoSigmaCorrRcb_px5->SetLineColor(kGreen+3);
948 histoSigmaCorrRcb_px5->Draw(
"same");
949 TLegend *legrcb =
new TLegend(0.8,0.8,0.95,0.9);
950 legrcb->SetFillColor(0);
952 legrcb->AddEntry(histoSigmaCorrRcb_px0a,
"Rc/b=0.25",
"l");
953 legrcb->AddEntry(histoSigmaCorrRcb_px0,
"Rc/b=0.5",
"l");
954 legrcb->AddEntry(histoSigmaCorrRcb_px1,
"Rc/b=1.0",
"l");
955 legrcb->AddEntry(histoSigmaCorrRcb_px2,
"Rc/b=1.5",
"l");
956 legrcb->AddEntry(histoSigmaCorrRcb_px3,
"Rc/b=2.0",
"l");
957 legrcb->AddEntry(histoSigmaCorrRcb_px4,
"Rc/b=3.0",
"l");
958 legrcb->AddEntry(histoSigmaCorrRcb_px5,
"Rc/b=4.0",
"l");
960 legrcb->AddEntry(histoSigmaCorrRcb_px0a,
"Rb=0.25",
"l");
961 legrcb->AddEntry(histoSigmaCorrRcb_px0,
"Rb=0.5",
"l");
962 legrcb->AddEntry(histoSigmaCorrRcb_px1,
"Rb=1.0",
"l");
963 legrcb->AddEntry(histoSigmaCorrRcb_px2,
"Rb=1.5",
"l");
964 legrcb->AddEntry(histoSigmaCorrRcb_px3,
"Rb=2.0",
"l");
965 legrcb->AddEntry(histoSigmaCorrRcb_px4,
"Rb=3.0",
"l");
966 legrcb->AddEntry(histoSigmaCorrRcb_px5,
"Rb=4.0",
"l");
969 canvasSRcb1->Update();
976 cout <<
" Saving the results ! " << endl<< endl;
980 hDirectMCpt->Write(); hFeedDownMCpt->Write();
981 hDirectMCptMax->Write(); hDirectMCptMin->Write();
982 hFeedDownMCptMax->Write(); hFeedDownMCptMin->Write();
983 if(hDirectEffpt) hDirectEffpt->Write();
if(hFeedDownEffpt) hFeedDownEffpt->Write();
986 histoYieldCorr->Write();
987 histoYieldCorrMax->Write(); histoYieldCorrMin->Write();
988 histoSigmaCorr->Write();
989 histoSigmaCorrMax->Write(); histoSigmaCorrMin->Write();
992 histofcRcb->Write(); histofcRcb_px->Write();
993 histoYieldCorrRcb->Write();
994 histoSigmaCorrRcb->Write();
1001 if(gYieldCorrExtreme) gYieldCorrExtreme->Write();
1002 if(gSigmaCorrExtreme) gSigmaCorrExtreme->Write();
1003 if(gYieldCorrConservative) gYieldCorrConservative->Write();
1004 if(gSigmaCorrConservative) gSigmaCorrConservative->Write();
1005 if(asym && gFcConservative) gFcConservative->Write();
1010 histofcMax->Write(); histofcMin->Write();
1011 if(asym && gFcExtreme) gFcExtreme->Write();
1017 hStatUncEffcSigma->Write();
1018 hStatUncEffbSigma->Write();
1022 hStatUncEffcFD->Write();
1023 hStatUncEffbFD->Write();
1025 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.