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 };
50 const char *mcfilename=
"FeedDownCorrectionMC.root",
51 const char *efffilename=
"Efficiencies.root",
52 const char *recofilename=
"Reconstructed.root",
const char *recohistoname=
"hRawSpectrumD0",
53 const char *outfilename=
"HFPtSpectrum.root",
55 Bool_t isParticlePlusAntiParticleYield=
true, Int_t cc=
kpp7, Bool_t PbPbEloss=
false,
56 Int_t ccestimator =
kV0M,
60 Bool_t setUsePtDependentEffUncertainty=
true) {
69 if (fdMethod==
kfc) option=1;
70 else if (fdMethod==
kNb) option=2;
71 else if (fdMethod==
knone) { option=0; asym=
false; }
75 cout<<
"Bad calculation option, should be <=2"<<endl;
84 Double_t tab = 1., tabUnc = 0.;
85 if( ccestimator ==
kV0M ) {
87 tab = 24.81; tabUnc = 0.8037;
88 }
else if ( cc ==
k010 ) {
89 tab = 23.48; tabUnc = 0.97;
90 }
else if ( cc ==
k1020 ) {
91 tab = 14.4318; tabUnc = 0.5733;
92 }
else if ( cc ==
k020 ) {
93 tab = 18.93; tabUnc = 0.74;
94 }
else if ( cc ==
k2040 ) {
95 tab = 6.86; tabUnc = 0.28;
96 }
else if ( cc ==
k2030 ) {
97 tab = 8.73769; tabUnc = 0.370219;
98 }
else if ( cc ==
k3040 ) {
99 tab = 5.02755; tabUnc = 0.22099;
100 }
else if ( cc ==
k4050 ) {
101 tab = 2.68327; tabUnc = 0.137073;
102 }
else if ( cc ==
k3050 ) {
103 tab = 3.87011; tabUnc = 0.183847;
104 }
else if ( cc ==
k4060 ) {
105 tab = 2.00; tabUnc= 0.11;
106 }
else if ( cc ==
k4080 ) {
107 tab = 1.20451; tabUnc = 0.071843;
108 }
else if ( cc ==
k5060 ) {
109 tab = 1.32884; tabUnc = 0.0929536;
110 }
else if ( cc ==
k6080 ) {
111 tab = 0.419; tabUnc = 0.033;
112 }
else if ( cc ==
k5080 ) {
113 tab = 0.719; tabUnc = 0.054;
114 }
else if ( cc ==
k80100 ){
115 tab = 0.0690; tabUnc = 0.0062;
122 tab = 0.098334; tabUnc = 0.0070679;
125 else if( ccestimator ==
kV0A ){
127 tab = 0.183; tabUnc = 0.006245;
129 tab = 0.134; tabUnc = 0.004899;
131 tab = 0.092; tabUnc = 0.004796;
133 tab = 0.041; tabUnc = 0.008832;
136 else if( ccestimator ==
kZNA ){
138 tab = 0.164; tabUnc = 0.010724;
140 tab = 0.137; tabUnc = 0.005099;
142 tab = 0.1011; tabUnc = 0.006;
144 tab = 0.0459; tabUnc = 0.003162;
147 else if( ccestimator ==
kCL1 ){
149 tab = 0.19; tabUnc = 0.007;
151 tab = 0.136; tabUnc = 0.005;
153 tab = 0.088; tabUnc = 0.005;
155 tab = 0.0369; tabUnc = 0.0085;
168 TH1D *hFeedDownMCpt=0;
169 TH1D *hDirectMCptMax=0;
170 TH1D *hDirectMCptMin=0;
171 TH1D *hFeedDownMCptMax=0;
172 TH1D *hFeedDownMCptMin=0;
174 TH1D *hDirectEffpt=0;
175 TH1D *hFeedDownEffpt=0;
182 TFile * mcfile =
new TFile(mcfilename,
"read");
185 hDirectMCpt = (TH1D*)mcfile->Get(
"hD0Kpipred_central");
186 hFeedDownMCpt = (TH1D*)mcfile->Get(
"hD0KpifromBpred_central_corr");
187 hDirectMCptMax = (TH1D*)mcfile->Get(
"hD0Kpipred_max");
188 hDirectMCptMin = (TH1D*)mcfile->Get(
"hD0Kpipred_min");
189 hFeedDownMCptMax = (TH1D*)mcfile->Get(
"hD0KpifromBpred_max_corr");
190 hFeedDownMCptMin = (TH1D*)mcfile->Get(
"hD0KpifromBpred_min_corr");
195 hDirectMCpt = (TH1D*)mcfile->Get(
"hDpluskpipipred_central");
196 hFeedDownMCpt = (TH1D*)mcfile->Get(
"hDpluskpipifromBpred_central_corr");
197 hDirectMCptMax = (TH1D*)mcfile->Get(
"hDpluskpipipred_max");
198 hDirectMCptMin = (TH1D*)mcfile->Get(
"hDpluskpipipred_min");
199 hFeedDownMCptMax = (TH1D*)mcfile->Get(
"hDpluskpipifromBpred_max_corr");
200 hFeedDownMCptMin = (TH1D*)mcfile->Get(
"hDpluskpipifromBpred_min_corr");
205 hDirectMCpt = (TH1D*)mcfile->Get(
"hDstarD0pipred_central");
206 hFeedDownMCpt = (TH1D*)mcfile->Get(
"hDstarD0pifromBpred_central_corr");
207 hDirectMCptMax = (TH1D*)mcfile->Get(
"hDstarD0pipred_max");
208 hDirectMCptMin = (TH1D*)mcfile->Get(
"hDstarD0pipred_min");
209 hFeedDownMCptMax = (TH1D*)mcfile->Get(
"hDstarD0pifromBpred_max_corr");
210 hFeedDownMCptMin = (TH1D*)mcfile->Get(
"hDstarD0pifromBpred_min_corr");
215 hDirectMCpt = (TH1D*)mcfile->Get(
"hDsPhipitoKkpipred_central");
216 hFeedDownMCpt = (TH1D*)mcfile->Get(
"hDsPhipitoKkpifromBpred_central_corr");
217 hDirectMCptMax = (TH1D*)mcfile->Get(
"hDsPhipitoKkpipred_max");
218 hDirectMCptMin = (TH1D*)mcfile->Get(
"hDsPhipitoKkpipred_min");
219 hFeedDownMCptMax = (TH1D*)mcfile->Get(
"hDsPhipitoKkpifromBpred_max_corr");
220 hFeedDownMCptMin = (TH1D*)mcfile->Get(
"hDsPhipitoKkpifromBpred_min_corr");
224 hDirectMCpt = (TH1D*)mcfile->Get(
"hLcpkpipred_central");
225 hFeedDownMCpt = (TH1D*)mcfile->Get(
"hLcpkpifromBpred_central_corr");
226 hDirectMCptMax = (TH1D*)mcfile->Get(
"hLcpkpipred_max");
227 hDirectMCptMin = (TH1D*)mcfile->Get(
"hLcpkpipred_min");
228 hFeedDownMCptMax = (TH1D*)mcfile->Get(
"hLcpkpifromBpred_max_corr");
229 hFeedDownMCptMin = (TH1D*)mcfile->Get(
"hLcpkpifromBpred_min_corr");
233 hDirectMCpt = (TH1D*)mcfile->Get(
"hLcK0sppred_central");
234 hFeedDownMCpt = (TH1D*)mcfile->Get(
"hLcK0spfromBpred_central_corr");
235 hDirectMCptMax = (TH1D*)mcfile->Get(
"hLcK0sppred_max");
236 hDirectMCptMin = (TH1D*)mcfile->Get(
"hLcK0sppred_min");
237 hFeedDownMCptMax = (TH1D*)mcfile->Get(
"hLcK0spfromBpred_max_corr");
238 hFeedDownMCptMin = (TH1D*)mcfile->Get(
"hLcK0spfromBpred_min_corr");
241 hDirectMCpt->SetNameTitle(
"hDirectMCpt",
"direct MC spectra");
242 hFeedDownMCpt->SetNameTitle(
"hFeedDownMCpt",
"feed-down MC spectra");
243 hDirectMCptMax->SetNameTitle(
"hDirectMCptMax",
"max direct MC spectra");
244 hDirectMCptMin->SetNameTitle(
"hDirectMCptMin",
"min direct MC spectra");
245 hFeedDownMCptMax->SetNameTitle(
"hFeedDownMCptMax",
"max feed-down MC spectra");
246 hFeedDownMCptMin->SetNameTitle(
"hFeedDownMCptMin",
"min feed-down MC spectra");
251 Double_t scaleFONLL = 1.0;
252 switch(rapiditySlice) {
253 case k08to04: scaleFONLL = (0.093+0.280)/1.0;
break;
254 case k07to04: scaleFONLL = 0.280/1.0;
break;
255 case k04to01: scaleFONLL = 0.284/1.0;
break;
256 case k01to01: scaleFONLL = 0.191/1.0;
break;
257 case k01to04: scaleFONLL = 0.288/1.0;
break;
258 case k04to07: scaleFONLL = 0.288/1.0;
break;
259 case k04to08: scaleFONLL = (0.288+0.096)/1.0;
break;
260 case k01to05: scaleFONLL = (0.4)/1.0;
break;
262 hDirectMCpt->Scale(scaleFONLL);
263 hDirectMCptMax->Scale(scaleFONLL);
264 hDirectMCptMin->Scale(scaleFONLL);
265 switch(rapiditySlice) {
266 case k08to04: scaleFONLL = (0.089+0.274)/1.0;
break;
267 case k07to04: scaleFONLL = 0.274/1.0;
break;
268 case k04to01: scaleFONLL = 0.283/1.0;
break;
269 case k01to01: scaleFONLL = 0.192/1.0;
break;
270 case k01to04: scaleFONLL = 0.290/1.0;
break;
271 case k04to07: scaleFONLL = 0.291/1.0;
break;
272 case k04to08: scaleFONLL = (0.291+0.097)/1.0;
break;
273 case k01to05: scaleFONLL = (0.4)/1.0;
break;
275 hFeedDownMCpt->Scale(scaleFONLL);
276 hFeedDownMCptMax->Scale(scaleFONLL);
277 hFeedDownMCptMin->Scale(scaleFONLL);
282 TFile * efffile =
new TFile(efffilename,
"read");
283 hDirectEffpt = (TH1D*)efffile->Get(
"hEffD");
284 hDirectEffpt->SetNameTitle(
"hDirectEffpt",
"direct acc x eff");
285 hFeedDownEffpt = (TH1D*)efffile->Get(
"hEffB");
286 hFeedDownEffpt->SetNameTitle(
"hFeedDownEffpt",
"feed-down acc x eff");
289 TFile * recofile =
new TFile(recofilename,
"read");
290 hRECpt = (TH1D*)recofile->Get(recohistoname);
291 hRECpt->SetNameTitle(
"hRECpt",
"Reconstructed spectra");
295 TH1D *hEPresolCorr=0;
297 EPf =
new TFile(epResolfile,
"read");
298 if(isRaavsEP==
kInPlane) hEPresolCorr = (TH1D*)EPf->Get(
"hCorrEPresol_InPlane");
299 else if(isRaavsEP==
kOutOfPlane) hEPresolCorr = (TH1D*)EPf->Get(
"hCorrEPresol_OutOfPlane");
300 for(Int_t i=1; i<=hRECpt->GetNbinsX(); i++) {
301 Double_t value = hRECpt->GetBinContent(i);
302 Double_t error = hRECpt->GetBinError(i);
303 Double_t pt = hRECpt->GetBinCenter(i);
304 Int_t epbin = hEPresolCorr->FindBin( pt );
305 Double_t epcorr = hEPresolCorr->GetBinContent( epbin );
306 value = value*epcorr;
307 error = error*epcorr;
308 hRECpt->SetBinContent(i,value);
309 hRECpt->SetBinError(i,error);
316 TFile *out =
new TFile(outfilename,
"recreate");
321 TH1D *histoYieldCorr=0;
322 TH1D *histoYieldCorrMax=0;
323 TH1D *histoYieldCorrMin=0;
324 TH1D *histoSigmaCorr=0;
325 TH1D *histoSigmaCorrMax=0;
326 TH1D *histoSigmaCorrMin=0;
329 TH1D *histofcRcb_px=0;
330 TH2D *histoYieldCorrRcb=0;
331 TH2D *histoSigmaCorrRcb=0;
333 TGraphAsymmErrors * gYieldCorr = 0;
334 TGraphAsymmErrors * gSigmaCorr = 0;
335 TGraphAsymmErrors * gFcExtreme = 0;
336 TGraphAsymmErrors * gFcConservative = 0;
337 TGraphAsymmErrors * gYieldCorrExtreme = 0;
338 TGraphAsymmErrors * gSigmaCorrExtreme = 0;
339 TGraphAsymmErrors * gYieldCorrConservative = 0;
340 TGraphAsymmErrors * gSigmaCorrConservative = 0;
342 TNtuple * nSigma = 0;
360 cout <<
" Setting the reconstructed spectrum,";
363 cout <<
" the efficiency,";
367 cout <<
" the theoretical spectra";
377 cout <<
" and the normalization" <<endl;
381 Double_t lumiUnc = 0.04*lumi;
383 Double_t effTrig = 1.0;
388 Double_t globalEffUnc = 0.05;
389 Double_t globalBCEffRatioUnc = 0.05;
390 if(analysisSpeciality==
kLowPt) globalBCEffRatioUnc = 0.;
408 Bool_t combineFeedDown =
true;
422 switch(rapiditySlice) {
423 case k08to04: rapidity=
"0804";
break;
424 case k07to04: rapidity=
"0804";
break;
425 case k04to01: rapidity=
"0401";
break;
426 case k01to01: rapidity=
"0101";
break;
427 case k01to04: rapidity=
"0104";
break;
428 case k04to07: rapidity=
"0408";
break;
429 case k04to08: rapidity=
"0408";
break;
430 case k01to05: rapidity=
"0401";
break;
435 if(ccestimator==
kV0A) {
440 }
else if (ccestimator==
kZNA) {
445 }
else if (ccestimator==
kCL1) {
452 cout <<
" Error on the pPb options"<<endl;
458 else if( cc!=
kpp7 ) {
468 else if ( cc ==
k3050 ) {
477 cout <<
" Systematics not yet implemented " << endl;
481 if(analysisSpeciality==
kLowPt){
484 else if(analysisSpeciality==
kPass4){
488 systematics->
Init(decay);
492 cout <<
" Doing the calculation... "<< endl;
493 Double_t deltaY = 1.0;
494 Double_t branchingRatioC = 1.0;
495 Double_t branchingRatioBintoFinalDecay = 1.0;
498 cout <<
" ended the calculation, getting the histograms back " << endl;
512 histoYieldCorr->SetNameTitle(
"histoYieldCorr",
"corrected yield");
513 histoYieldCorrMax->SetNameTitle(
"histoYieldCorrMax",
"max corrected yield");
514 histoYieldCorrMin->SetNameTitle(
"histoYieldCorrMin",
"min corrected yield");
515 histoSigmaCorr->SetNameTitle(
"histoSigmaCorr",
"corrected invariant cross-section");
516 histoSigmaCorrMax->SetNameTitle(
"histoSigmaCorrMax",
"max corrected invariant cross-section");
517 histoSigmaCorrMin->SetNameTitle(
"histoSigmaCorrMin",
"min corrected invariant cross-section");
526 histofcRcb->SetName(
"histofcRcb");
527 histoYieldCorrRcb->SetName(
"histoYieldCorrRcb");
528 histoSigmaCorrRcb->SetName(
"histoSigmaCorrRcb");
543 gYieldCorr->SetNameTitle(
"gYieldCorr",
"gYieldCorr (uncorr)");
544 gSigmaCorr->SetNameTitle(
"gSigmaCorr",
"gSigmaCorr (uncorr)");
551 histofc->SetNameTitle(
"histofc",
"fc correction factor");
552 histofcMax->SetNameTitle(
"histofcMax",
"max fc correction factor");
553 histofcMin->SetNameTitle(
"histofcMin",
"min fc correction factor");
555 gYieldCorr->SetNameTitle(
"gYieldCorr",
"gYieldCorr (by fc)");
556 gSigmaCorr->SetNameTitle(
"gSigmaCorr",
"gSigmaCorr (by fc)");
558 gFcExtreme->SetNameTitle(
"gFcExtreme",
"gFcExtreme");
559 gYieldCorrExtreme->SetNameTitle(
"gYieldCorrExtreme",
"Extreme gYieldCorr (by fc)");
560 gSigmaCorrExtreme->SetNameTitle(
"gSigmaCorrExtreme",
"Extreme gSigmaCorr (by fc)");
562 gFcConservative->SetNameTitle(
"gFcConservative",
"gFcConservative");
563 gYieldCorrConservative->SetNameTitle(
"gYieldCorrConservative",
"Conservative gYieldCorr (by fc)");
564 gSigmaCorrConservative->SetNameTitle(
"gSigmaCorrConservative",
"Conservative gSigmaCorr (by fc)");
567 if (option==2 && asym) {
568 gYieldCorr->SetNameTitle(
"gYieldCorr",
"gYieldCorr (by Nb)");
569 gSigmaCorr->SetNameTitle(
"gSigmaCorr",
"gSigmaCorr (by Nb)");
570 gYieldCorrExtreme->SetNameTitle(
"gYieldCorrExtreme",
"Extreme gYieldCorr (by Nb)");
571 gSigmaCorrExtreme->SetNameTitle(
"gSigmaCorrExtreme",
"Extreme gSigmaCorr (by Nb)");
572 gYieldCorrConservative->SetNameTitle(
"gYieldCorrConservative",
"Conservative gYieldCorr (by Nb)");
573 gSigmaCorrConservative->SetNameTitle(
"gSigmaCorrConservative",
"Conservative gSigmaCorr (by Nb)");
575 gFcConservative->SetNameTitle(
"gFcConservative",
"gFcConservative");
586 gROOT->SetStyle(
"Plain");
588 cout <<
" Drawing the results ! " << endl;
593 TCanvas *ceff =
new TCanvas(
"ceff",
"efficiency drawing");
596 hDirectEffpt->Draw();
598 hFeedDownEffpt->Draw();
601 TCanvas *cTheoryRebin =
new TCanvas(
"cTheoryRebin",
"control the theoretical spectra rebin");
602 cTheoryRebin->Divide(1,2);
604 hDirectMCpt->Draw(
"");
606 hDirectMCptRebin->SetLineColor(2);
607 hDirectMCptRebin->Draw(
"same");
609 hFeedDownMCpt->Draw(
"");
611 hFeedDownRebin->SetLineColor(2);
612 hFeedDownRebin->Draw(
"same");
613 cTheoryRebin->Update();
615 TCanvas *cTheoryRebinLimits =
new TCanvas(
"cTheoryRebinLimits",
"control the theoretical spectra limits rebin");
616 cTheoryRebinLimits->Divide(1,2);
617 cTheoryRebinLimits->cd(1);
618 hDirectMCptMax->Draw(
"");
620 hDirectMCptMaxRebin->SetLineColor(2);
621 hDirectMCptMaxRebin->Draw(
"same");
622 hDirectMCptMin->Draw(
"same");
624 hDirectMCptMinRebin->SetLineColor(2);
625 hDirectMCptMinRebin->Draw(
"same");
626 cTheoryRebinLimits->cd(2);
627 hFeedDownMCptMax->Draw(
"");
629 hFeedDownMaxRebin->SetLineColor(2);
630 hFeedDownMaxRebin->Draw(
"same");
631 hFeedDownMCptMin->Draw(
"same");
633 hFeedDownMinRebin->SetLineColor(2);
634 hFeedDownMinRebin->Draw(
"same");
635 cTheoryRebinLimits->Update();
640 TCanvas * cfc =
new TCanvas(
"cfc",
"Fc");
641 histofcMax->Draw(
"c");
642 histofc->Draw(
"csame");
643 histofcMin->Draw(
"csame");
647 TH2F *histofcDraw=
new TH2F(
"histofcDraw",
"histofc (for drawing)",100,0,33.25,100,0.01,1.25);
648 histofcDraw->SetStats(0);
649 histofcDraw->GetXaxis()->SetTitle(
"p_{T} [GeV]");
650 histofcDraw ->GetXaxis()->SetTitleSize(0.05);
651 histofcDraw->GetXaxis()->SetTitleOffset(0.95);
652 histofcDraw->GetYaxis()->SetTitle(
" fc ");
653 histofcDraw->GetYaxis()->SetTitleSize(0.05);
671 TCanvas *cfcExtreme =
new TCanvas(
"cfcExtreme",
"Extreme Asymmetric fc (TGraphAsymmErr)");
672 gFcExtreme->SetFillStyle(3006);
673 gFcExtreme->SetLineWidth(3);
674 gFcExtreme->SetMarkerStyle(20);
675 gFcExtreme->SetFillColor(2);
677 gFcExtreme->Draw(
"3same");
680 gFcConservative->SetFillStyle(3007);
681 gFcConservative->SetFillColor(4);
682 gFcConservative->Draw(
"3same");
685 cfcExtreme->Update();
694 TCanvas * cresult =
new TCanvas(
"cresult",
"corrected yields & sigma");
695 hDirectMCpt->SetMarkerStyle(20);
696 hDirectMCpt->SetMarkerColor(4);
697 hDirectMCpt->Draw(
"p");
698 histoSigmaCorr->SetMarkerStyle(21);
699 histoSigmaCorr->SetMarkerColor(2);
700 histoSigmaCorr->Draw(
"psame");
701 histoYieldCorr->SetMarkerStyle(22);
702 histoYieldCorr->SetMarkerColor(6);
703 histoYieldCorr->Draw(
"psame");
704 hRECpt->SetMarkerStyle(23);
705 hRECpt->SetMarkerColor(3);
706 hRECpt->Draw(
"psame");
710 TCanvas * cresult2 =
new TCanvas(
"cresult2",
"corrected yield & sigma");
711 histoSigmaCorr->SetMarkerStyle(21);
712 histoSigmaCorr->SetMarkerColor(2);
713 histoSigmaCorr->Draw(
"p");
714 histoYieldCorr->SetMarkerStyle(22);
715 histoYieldCorr->SetMarkerColor(6);
716 histoYieldCorr->Draw(
"psame");
717 hRECpt->SetMarkerStyle(23);
718 hRECpt->SetMarkerColor(3);
719 hRECpt->Draw(
"psame");
726 TH2F *histoDraw =
new TH2F(
"histoDraw",
"histo (for drawing)",100,0,33.25,100,50.,1e7);
727 float max = 1.1*gYieldCorr->GetMaximum();
728 histoDraw->SetAxisRange(0.1,max,
"Y");
729 histoDraw->SetStats(0);
730 histoDraw->GetXaxis()->SetTitle(
"p_{T} [GeV]");
731 histoDraw->GetXaxis()->SetTitleSize(0.05);
732 histoDraw->GetXaxis()->SetTitleOffset(0.95);
733 histoDraw->GetYaxis()->SetTitle(
"#frac{d#N}{dp_{T}} |_{|y|<1} [L & trigger uncorr]");
734 histoDraw->GetYaxis()->SetTitleSize(0.05);
735 TCanvas * cyieldAsym =
new TCanvas(
"cyieldAsym",
"Asymmetric corrected yield (TGraphAsymmErr)");
736 gYieldCorr->SetFillStyle(3001);
737 gYieldCorr->SetLineWidth(3);
738 gYieldCorr->SetMarkerStyle(20);
739 gYieldCorr->SetFillColor(3);
741 gYieldCorr->Draw(
"3LPsame");
742 gYieldCorr->Draw(
"Xsame");
743 cyieldAsym->SetLogy();
744 cyieldAsym->Update();
746 TCanvas * cyieldExtreme =
new TCanvas(
"cyieldExtreme",
"Extreme Asymmetric corrected yield (TGraphAsymmErr)");
747 histoYieldCorr->Draw();
748 gYieldCorrExtreme->SetFillStyle(3002);
749 gYieldCorrExtreme->SetLineWidth(3);
750 gYieldCorrExtreme->SetMarkerStyle(20);
751 gYieldCorrExtreme->SetFillColor(2);
752 histoYieldCorr->Draw();
753 gYieldCorr->Draw(
"3same");
754 gYieldCorrExtreme->Draw(
"3same");
755 cyieldExtreme->SetLogy();
756 cyieldExtreme->Update();
758 TH2F *histo2Draw =
new TH2F(
"histo2Draw",
"histo2 (for drawing)",100,0,33.25,100,50.,1e9);
759 max = 1.1*gSigmaCorr->GetMaximum();
760 histo2Draw->SetAxisRange(0.1,max,
"Y");
761 histo2Draw->SetStats(0);
762 histo2Draw->GetXaxis()->SetTitle(
"p_{T} [GeV]");
763 histo2Draw->GetXaxis()->SetTitleSize(0.05);
764 histo2Draw->GetXaxis()->SetTitleOffset(0.95);
765 histo2Draw->GetYaxis()->SetTitle(
"#frac{1}{BR} #times #frac{d#sigma}{dp_{T}} |_{|y|<1}");
766 histo2Draw->GetYaxis()->SetTitleSize(0.05);
767 TCanvas * csigmaAsym =
new TCanvas(
"csigmaAsym",
"Asymmetric corrected sigma (TGraphAsymmErr)");
768 gSigmaCorr->SetFillStyle(3001);
769 gSigmaCorr->SetLineWidth(3);
770 gSigmaCorr->SetMarkerStyle(21);
771 gSigmaCorr->SetFillColor(3);
773 gSigmaCorr->Draw(
"3LPsame");
774 gSigmaCorr->Draw(
"Xsame");
775 csigmaAsym->SetLogy();
776 csigmaAsym->Update();
787 TCanvas * csigmaExtreme =
new TCanvas(
"csigmaExtreme",
"Asymmetric extreme corrected sigma (TGraphAsymmErr)");
788 histoSigmaCorr->Draw();
789 gSigmaCorr->Draw(
"3Psame");
790 gSigmaCorrExtreme->SetFillStyle(3002);
791 gSigmaCorrExtreme->SetLineWidth(3);
792 gSigmaCorrExtreme->SetMarkerStyle(21);
793 gSigmaCorrExtreme->SetFillColor(2);
794 gSigmaCorrExtreme->Draw(
"3Psame");
795 csigmaExtreme->SetLogy();
796 csigmaExtreme->Update();
821 gStyle->SetPalette(1);
822 TCanvas *canvasfcRcb =
new TCanvas(
"canvasfcRcb",
"fc vs pt vs Rcb");
824 histofcRcb->Draw(
"colz");
825 canvasfcRcb->Update();
827 TCanvas *canvasfcRcb1 =
new TCanvas(
"canvasfcRcb1",
"fc vs pt vs Rcb=1");
828 histofcRcb_px = (TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px",40,40);
829 histofcRcb_px->SetLineColor(2);
832 histofcRcb_px->Draw(
"same");
833 }
else histofcRcb_px->Draw(
"");
834 canvasfcRcb1->Update();
835 TCanvas *canvasfcRcb2 =
new TCanvas(
"canvasfcRcb2",
"fc vs pt vs Rcb fixed Rcb");
836 Int_t bin0 = CalcBins->
FindTH2YBin(histofcRcb,0.25);
837 Int_t bin1 = CalcBins->
FindTH2YBin(histofcRcb,0.5);
838 Int_t bin2 = CalcBins->
FindTH2YBin(histofcRcb,1.0);
839 Int_t bin3 = CalcBins->
FindTH2YBin(histofcRcb,1.5);
840 Int_t bin4 = CalcBins->
FindTH2YBin(histofcRcb,2.0);
841 Int_t bin5 = CalcBins->
FindTH2YBin(histofcRcb,3.0);
842 Int_t bin6 = CalcBins->
FindTH2YBin(histofcRcb,4.0);
843 TH1D * histofcRcb_px0a = (TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px0a",bin0,bin0);
844 TH1D * histofcRcb_px0 = (TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px0",bin1,bin1);
845 TH1D * histofcRcb_px1 = (TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px1",bin2,bin2);
846 TH1D * histofcRcb_px2 = (TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px2",bin3,bin3);
847 TH1D * histofcRcb_px3 = (TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px3",bin4,bin4);
848 TH1D * histofcRcb_px4 = (TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px4",bin5,bin5);
849 TH1D * histofcRcb_px5 = (TH1D*)histofcRcb->ProjectionX(
"histofcRcb_px5",bin6,bin6);
855 histofcRcb_px0a->SetLineColor(2);
856 histofcRcb_px0a->Draw(
"");
858 histofcRcb_px0a->SetLineColor(2);
859 histofcRcb_px0a->Draw(
"same");
860 histofcRcb_px0->SetLineColor(4);
861 histofcRcb_px0->Draw(
"same");
862 histofcRcb_px1->SetLineColor(3);
863 histofcRcb_px1->Draw(
"same");
864 histofcRcb_px2->SetLineColor(kCyan);
865 histofcRcb_px2->Draw(
"same");
866 histofcRcb_px3->SetLineColor(kMagenta+1);
867 histofcRcb_px3->Draw(
"same");
868 histofcRcb_px4->SetLineColor(kOrange+7);
869 histofcRcb_px4->Draw(
"same");
870 histofcRcb_px5->SetLineColor(kGreen+3);
871 histofcRcb_px5->Draw(
"same");
872 TLegend *legrcc =
new TLegend(0.8,0.8,0.95,0.9);
873 legrcc->SetFillColor(0);
875 legrcc->AddEntry(histofcRcb_px0a,
"Rc/b=0.25",
"l");
876 legrcc->AddEntry(histofcRcb_px0,
"Rc/b=0.5",
"l");
877 legrcc->AddEntry(histofcRcb_px1,
"Rc/b=1.0",
"l");
878 legrcc->AddEntry(histofcRcb_px2,
"Rc/b=1.5",
"l");
879 legrcc->AddEntry(histofcRcb_px3,
"Rc/b=2.0",
"l");
880 legrcc->AddEntry(histofcRcb_px4,
"Rc/b=3.0",
"l");
881 legrcc->AddEntry(histofcRcb_px5,
"Rc/b=4.0",
"l");
883 legrcc->AddEntry(histofcRcb_px0a,
"Rb=0.25",
"l");
884 legrcc->AddEntry(histofcRcb_px0,
"Rb=0.5",
"l");
885 legrcc->AddEntry(histofcRcb_px1,
"Rb=1.0",
"l");
886 legrcc->AddEntry(histofcRcb_px2,
"Rb=1.5",
"l");
887 legrcc->AddEntry(histofcRcb_px3,
"Rb=2.0",
"l");
888 legrcc->AddEntry(histofcRcb_px4,
"Rb=3.0",
"l");
889 legrcc->AddEntry(histofcRcb_px5,
"Rb=4.0",
"l");
892 canvasfcRcb2->Update();
893 TCanvas *canvasYRcb =
new TCanvas(
"canvasYRcb",
"corrected yield vs pt vs Rcb");
894 histoYieldCorrRcb->Draw(
"cont4z");
895 canvasYRcb->Update();
896 TCanvas *canvasSRcb =
new TCanvas(
"canvasSRcb",
"sigma vs pt vs Rcb");
897 histoSigmaCorrRcb->Draw(
"cont4z");
898 canvasSRcb->Update();
899 TCanvas *canvasSRcb1 =
new TCanvas(
"canvasSRcb1",
"sigma vs pt vs Rcb fixed Rcb");
900 TH1D * histoSigmaCorrRcb_px0a = (TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px0a",bin0,bin0);
901 TH1D * histoSigmaCorrRcb_px0 = (TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px0",bin1,bin1);
902 TH1D * histoSigmaCorrRcb_px1 = (TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px1",bin2,bin2);
903 TH1D * histoSigmaCorrRcb_px2 = (TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px2",bin3,bin3);
904 TH1D * histoSigmaCorrRcb_px3 = (TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px3",bin4,bin4);
905 TH1D * histoSigmaCorrRcb_px4 = (TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px4",bin5,bin5);
906 TH1D * histoSigmaCorrRcb_px5 = (TH1D*)histoSigmaCorrRcb->ProjectionX(
"histoSigmaCorrRcb_px5",bin6,bin6);
907 histoSigmaCorr->Draw();
908 histoSigmaCorrRcb_px0a->SetLineColor(2);
909 histoSigmaCorrRcb_px0a->Draw(
"hsame");
910 histoSigmaCorrRcb_px0->SetLineColor(4);
911 histoSigmaCorrRcb_px0->Draw(
"hsame");
912 histoSigmaCorrRcb_px1->SetLineColor(3);
913 histoSigmaCorrRcb_px1->Draw(
"hsame");
914 histoSigmaCorrRcb_px2->SetLineColor(kCyan);
915 histoSigmaCorrRcb_px2->Draw(
"hsame");
916 histoSigmaCorrRcb_px3->SetLineColor(kMagenta+1);
917 histoSigmaCorrRcb_px3->Draw(
"hsame");
918 histoSigmaCorrRcb_px4->SetLineColor(kOrange+7);
919 histoSigmaCorrRcb_px4->Draw(
"same");
920 histoSigmaCorrRcb_px5->SetLineColor(kGreen+3);
921 histoSigmaCorrRcb_px5->Draw(
"same");
922 TLegend *legrcb =
new TLegend(0.8,0.8,0.95,0.9);
923 legrcb->SetFillColor(0);
925 legrcb->AddEntry(histoSigmaCorrRcb_px0a,
"Rc/b=0.25",
"l");
926 legrcb->AddEntry(histoSigmaCorrRcb_px0,
"Rc/b=0.5",
"l");
927 legrcb->AddEntry(histoSigmaCorrRcb_px1,
"Rc/b=1.0",
"l");
928 legrcb->AddEntry(histoSigmaCorrRcb_px2,
"Rc/b=1.5",
"l");
929 legrcb->AddEntry(histoSigmaCorrRcb_px3,
"Rc/b=2.0",
"l");
930 legrcb->AddEntry(histoSigmaCorrRcb_px4,
"Rc/b=3.0",
"l");
931 legrcb->AddEntry(histoSigmaCorrRcb_px5,
"Rc/b=4.0",
"l");
933 legrcb->AddEntry(histoSigmaCorrRcb_px0a,
"Rb=0.25",
"l");
934 legrcb->AddEntry(histoSigmaCorrRcb_px0,
"Rb=0.5",
"l");
935 legrcb->AddEntry(histoSigmaCorrRcb_px1,
"Rb=1.0",
"l");
936 legrcb->AddEntry(histoSigmaCorrRcb_px2,
"Rb=1.5",
"l");
937 legrcb->AddEntry(histoSigmaCorrRcb_px3,
"Rb=2.0",
"l");
938 legrcb->AddEntry(histoSigmaCorrRcb_px4,
"Rb=3.0",
"l");
939 legrcb->AddEntry(histoSigmaCorrRcb_px5,
"Rb=4.0",
"l");
942 canvasSRcb1->Update();
949 cout <<
" Saving the results ! " << endl<< endl;
953 hDirectMCpt->Write(); hFeedDownMCpt->Write();
954 hDirectMCptMax->Write(); hDirectMCptMin->Write();
955 hFeedDownMCptMax->Write(); hFeedDownMCptMin->Write();
956 if(hDirectEffpt) hDirectEffpt->Write();
if(hFeedDownEffpt) hFeedDownEffpt->Write();
959 histoYieldCorr->Write();
960 histoYieldCorrMax->Write(); histoYieldCorrMin->Write();
961 histoSigmaCorr->Write();
962 histoSigmaCorrMax->Write(); histoSigmaCorrMin->Write();
965 histofcRcb->Write(); histofcRcb_px->Write();
966 histoYieldCorrRcb->Write();
967 histoSigmaCorrRcb->Write();
974 if(gYieldCorrExtreme) gYieldCorrExtreme->Write();
975 if(gSigmaCorrExtreme) gSigmaCorrExtreme->Write();
976 if(gYieldCorrConservative) gYieldCorrConservative->Write();
977 if(gSigmaCorrConservative) gSigmaCorrConservative->Write();
978 if(asym && gFcConservative) gFcConservative->Write();
983 histofcMax->Write(); histofcMin->Write();
984 if(asym && gFcExtreme) gFcExtreme->Write();
990 hStatUncEffcSigma->Write();
991 hStatUncEffbSigma->Write();
995 hStatUncEffcFD->Write();
996 hStatUncEffbFD->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
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.
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.
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 ccestimator=kV0M, Int_t isRaavsEP=kPhiIntegrated, const char *epResolfile="", Int_t rapiditySlice=kdefault, Int_t analysisSpeciality=kTopological, Bool_t setUsePtDependentEffUncertainty=true)
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.