1 #if !defined(__CINT__) || defined(__MAKECINT__)
10 #include "TGraphAsymmErrors.h"
20 #include <Riostream.h>
53 enum centrality{
kpp,
k07half,
kpPb0100,
k010,
k1020,
k020,
k2040,
k2030,
k3040,
k4050,
k3050,
k5060,
k4060,
k6080,
k4080,
k5080,
k80100,
kpPb020,
kpPb2040,
kpPb4060,
kpPb60100 };
74 Double_t data2 = total*total - fd*fd ;
75 return TMath::Sqrt( data2 );
82 Int_t npoints = gr->GetN();
83 for(
Int_t i=0; i<=npoints; i++){
86 if ( TMath::Abs ( x - pt ) < 0.4 ) {
101 void HFPtSpectrumRaa(
const char *ppfile=
"HFPtSpectrum_D0Kpi_method2_rebinnedth_230311_newsigma.root",
102 const char *ABfile=
"HFPtSpectrum_D0Kpi_PbPbcuts_method2_rebinnedth_230311_newsigma.root",
103 const char *outfile=
"HFPtSpectrumRaa.root",
110 Bool_t isUseTaaForRaa=
true,
const char *shadRbcFile=
"",
Int_t nSigmaShad=3.0,
115 gROOT->Macro(
"$ALICE_PHYSICS/PWGHF/vertexingHF/macros/LoadLibraries.C");
120 Double_t Tab = 1., TabSyst = 0., A=207.2, B=207.2;
122 printf(
"\n The Tab values for this cms energy have not yet been implemented, please do it ! \n");
130 if( (ccestimator ==
kV0M) && (Energy==
k276) ) {
132 Tab = 24.81; TabSyst = 0.8037;
133 }
else if (
cc ==
k010 ) {
134 Tab = 23.48; TabSyst = 0.97;
136 Tab = 14.4318; TabSyst = 0.5733;
137 }
else if (
cc ==
k020 ) {
138 Tab = 18.93; TabSyst = 0.74;
140 Tab = 6.86; TabSyst = 0.28;
142 Tab = 8.73769; TabSyst = 0.370219;
144 Tab = 5.02755; TabSyst = 0.22099;
146 Tab = 2.68327; TabSyst = 0.137073;
148 Tab = 3.87011; TabSyst = 0.183847;
150 Tab = 2.00; TabSyst= 0.11;
152 Tab = 1.20451; TabSyst = 0.071843;
154 Tab = 1.32884; TabSyst = 0.0929536;
156 Tab = 0.419; TabSyst = 0.033;
158 Tab = 0.719; TabSyst = 0.054;
160 Tab = 0.0690; TabSyst = 0.0062;
165 Tab = 3.76; TabSyst = 0.13;
173 Tab = 0.098334; TabSyst = 0.0070679;
176 else if( ccestimator ==
kV0A ){
178 Tab = 0.183; TabSyst = 0.006245;
180 Tab = 0.134; TabSyst = 0.004899;
182 Tab = 0.092; TabSyst = 0.004796;
184 Tab = 0.041; TabSyst = 0.008832;
187 else if( ccestimator ==
kZNA ){
189 Tab = 0.164; TabSyst = 0.010724;
191 Tab = 0.137; TabSyst = 0.005099;
193 Tab = 0.1011; TabSyst = 0.006;
195 Tab = 0.0459; TabSyst = 0.003162;
198 else if( ccestimator ==
kCL1 ){
200 Tab = 0.19; TabSyst = 0.007;
202 Tab = 0.136; TabSyst = 0.005;
204 Tab = 0.088; TabSyst = 0.005;
206 Tab = 0.0369; TabSyst = 0.0085;
213 TFile * ppf =
new TFile(ppfile,
"read");
219 TH1I * hCombinedReferenceFlag=0x0;
221 if(isScaledAndExtrapRef){
222 hCombinedReferenceFlag = (
TH1I*)ppf->Get(
"hCombinedReferenceFlag");
223 hSigmaPP = (
TH1D*)ppf->Get(
"hReference");
227 hSigmaPP = (
TH1D*)ppf->Get(
"fhScaledData");
230 Double_t scalePPRefToMatchRapidityBin = 1.0;
235 if(ppf->Get(
"AliHFSystErr")){
236 systematicsPP = (
AliHFSystErr*)ppf->Get(
"AliHFSystErr");
237 printf(
" --> AliHFSystErr object for pp reference read from file. Object title = %s\n",systematicsPP->GetTitle());
240 if(analysisSpeciality==
kLowPt){
247 printf(
" --> AliHFSystErr object for pp reference created based on macro arguments. Object title = %s\n",systematicsPP->GetTitle());
252 TFile * ABf =
new TFile(ABfile,
"read");
253 TH1D *hSigmaAB = (
TH1D*)ABf->Get(
"histoSigmaCorr");
257 TNtuple * nSigmaAB = (TNtuple*)ABf->Get(
"fnSigma");
259 TH1D *hMassAB = (
TH1D*)ABf->Get(
"hRECpt");
260 TH1D *hDirectEffptAB = (
TH1D*)ABf->Get(
"hDirectEffpt");
261 TH1D *histofcAB = (
TH1D*)ABf->Get(
"histofc");
263 TH1D* fhStatUncEffcSigmaAB = (
TH1D*)ABf->Get(
"fhStatUncEffcSigma");
264 TH1D* fhStatUncEffbSigmaAB = (
TH1D*)ABf->Get(
"fhStatUncEffbSigma");
265 TH1D* fhStatUncEffcFDAB = (
TH1D*)ABf->Get(
"fhStatUncEffcFD");
266 TH1D* fhStatUncEffbFDAB = (
TH1D*)ABf->Get(
"fhStatUncEffbFD");
268 TH1D* fhStatUncEffcSigmaAB_Raa = (
TH1D*)fhStatUncEffcSigmaAB->Clone(
"fhStatUncEffcSigmaAB_Raa");
269 TH1D* fhStatUncEffbSigmaAB_Raa = (
TH1D*)fhStatUncEffbSigmaAB->Clone(
"fhStatUncEffbSigmaAB_Raa");
270 TH1D* fhStatUncEffcFDAB_Raa = (
TH1D*)fhStatUncEffcFDAB->Clone(
"fhStatUncEffcFDAB_Raa");
271 TH1D* fhStatUncEffbFDAB_Raa = (
TH1D*)fhStatUncEffbFDAB->Clone(
"fhStatUncEffbFDAB_Raa");
272 fhStatUncEffcSigmaAB_Raa->Reset();
273 fhStatUncEffbSigmaAB_Raa->Reset();
274 fhStatUncEffcFDAB_Raa->Reset();
275 fhStatUncEffbFDAB_Raa->Reset();
276 fhStatUncEffcSigmaAB_Raa->SetName(
"fhStatUncEffcSigmaAB_Raa");
277 fhStatUncEffbSigmaAB_Raa->SetName(
"fhStatUncEffbSigmaAB_Raa");
278 fhStatUncEffcFDAB_Raa->SetName(
"fhStatUncEffcFDAB_Raa");
279 fhStatUncEffbFDAB_Raa->SetName(
"fhStatUncEffvFDAB_Raa");
285 if(ABf->Get(
"AliHFSystErr")){
287 printf(
" --> AliHFSystErr object for A-A read from HFPtSpectrum file. Object title = %s\n",systematicsAB->GetTitle());
321 switch(rapiditySlice) {
322 case k08to04: rapidity=
"0804"; scalePPRefToMatchRapidityBin=(0.093+0.280)/1.0;
break;
323 case k07to04: rapidity=
"0804"; scalePPRefToMatchRapidityBin=0.280/1.0;
break;
324 case k04to01: rapidity=
"0401"; scalePPRefToMatchRapidityBin=0.284/1.0;
break;
325 case k01to01: rapidity=
"0101"; scalePPRefToMatchRapidityBin=0.191/1.0;
break;
326 case k01to04: rapidity=
"0104"; scalePPRefToMatchRapidityBin=0.288/1.0;
break;
327 case k04to07: rapidity=
"0408"; scalePPRefToMatchRapidityBin=0.288/1.0;
break;
328 case k04to08: rapidity=
"0408"; scalePPRefToMatchRapidityBin=(0.288+0.096)/1.0;
break;
329 case k01to05: rapidity=
"0401"; scalePPRefToMatchRapidityBin=0.4;
break;
334 if(ccestimator==
kV0A) {
339 }
else if (ccestimator==
kZNA) {
344 }
else if (ccestimator==
kCL1) {
351 cout <<
" Error on the pPb options"<<endl;
357 cout <<
" Systematics not yet implemented " << endl;
360 if(analysisSpeciality==
kLowPt){
365 printf(
" --> AliHFSystErr object for A-A created based on macro arguments. Object title = %s\n",systematicsAB->GetTitle());
368 Int_t entries = nSigmaAB->GetEntries();
369 Float_t pt=0., signal=0., Rb=0., Rcb=0., fcAB=0., yieldAB=0., sigmaAB=0., statUncSigmaAB=0., sigmaABMin=0.,sigmaABMax=0.;
370 nSigmaAB->SetBranchAddress(
"pt",&pt);
371 nSigmaAB->SetBranchAddress(
"Signal",&signal);
372 if (fdMethod==
kNb) nSigmaAB->SetBranchAddress(
"Rb",&Rb);
373 else if (fdMethod==
kfc) nSigmaAB->SetBranchAddress(
"Rcb",&Rcb);
374 nSigmaAB->SetBranchAddress(
"fc",&fcAB);
375 nSigmaAB->SetBranchAddress(
"Yield",&yieldAB);
376 nSigmaAB->SetBranchAddress(
"Sigma",&sigmaAB);
377 nSigmaAB->SetBranchAddress(
"SigmaStatUnc",&statUncSigmaAB);
378 nSigmaAB->SetBranchAddress(
"SigmaMax",&sigmaABMax);
379 nSigmaAB->SetBranchAddress(
"SigmaMin",&sigmaABMin);
384 Double_t binwidth = hSigmaAB->GetBinWidth(1);
389 binwidth = hSigmaAB->GetBinWidth(i);
390 xlow = hSigmaAB->GetBinLowEdge(i);
392 binwidths[i-1] = binwidth;
394 limits[
nbins] = xlow + binwidth;
400 Double_t centralRbcShad[nbins+1], minRbcShad[nbins+1], maxRbcShad[nbins+1];
401 for(
Int_t i=0; i<=
nbins; i++) { centralRbcShad[i]=1.0; minRbcShad[i]=6.0; maxRbcShad[i]=0.0; }
402 Bool_t isShadHypothesis =
false;
403 if( strcmp(shadRbcFile,
"")!=0 ) {
404 isShadHypothesis =
true;
405 cout<<endl<<
">> Beware, using the shadowing prediction file with an "<<nSigmaShad<<
"*sigma <<"<<endl<<endl;
406 TFile *fshad =
new TFile(shadRbcFile,
"read");
407 if(!fshad){ cout <<
" >> Shadowing file not properly opened!!!"<<endl<<endl;
return;}
411 TH1D *hRbcShadCentral = (
TH1D*)fshad->Get(
"hDfromBoverDfromc_L0");
412 TH1D *hRbcShadMin = (
TH1D*)fshad->Get(
"hDfromBoverDfromc_L0");
413 TH1D *hRbcShadMax = (
TH1D*)fshad->Get(
"hDfromBoverDfromc_L1");
414 if(!hRbcShadCentral || !hRbcShadMin || !hRbcShadMax) {
415 cout<< endl <<
">> Shadowing input histograms are not ok !! "<<endl<<endl;
421 Double_t xpt = hSigmaAB->GetBinCenter(i);
423 centralRbcShad[i] = hRbcShadCentral->GetBinContent( hRbcShadCentral->FindBin(xpt) );
424 Double_t minValue0 = hRbcShadMin->GetBinContent( hRbcShadMin->FindBin(xpt) );
425 Double_t maxValue0 = hRbcShadMax->GetBinContent( hRbcShadMax->FindBin(xpt) );
426 Double_t arrayEl[3] = {minValue0,maxValue0, centralRbcShad[i]};
427 Double_t minValue = TMath::MinElement(3,arrayEl);
428 Double_t maxValue = TMath::MaxElement(3,arrayEl);
429 cout<<
">> Shadowing pt="<<xpt<<
" central="<<centralRbcShad[i]<<
" min="<<minValue<<
" max="<<maxValue<<endl;
430 if(minValue>centralRbcShad[i]){ minValue = centralRbcShad[i]; }
431 if(maxValue<centralRbcShad[i]){ maxValue = centralRbcShad[i]; }
432 minRbcShad[i] = centralRbcShad[i] - nSigmaShad*(centralRbcShad[i] - minValue);
433 maxRbcShad[i] = centralRbcShad[i] + nSigmaShad*(maxValue - centralRbcShad[i]);
434 cout<<
">> Shadowing hypothesis pt="<<xpt<<
" central="<<centralRbcShad[i]<<
" min="<<minRbcShad[i]<<
" max="<<maxRbcShad[i]<<endl;
442 TH2D * hRABvsRcb =
new TH2D(
"hRABvsRcb",
" R_{AB}(c) vs Rcb Eloss hypothesis; p_{T} [GeV/c] ; R_{AB}(c) ; Rcb Eloss hypothesis ",nbins,limits,800,0.,4.);
443 TH2D * hRABvsRb =
new TH2D(
"hRABvsRb",
" R_{AB}(c) vs Rb Eloss hypothesis; p_{T} [GeV/c] ; R_{AB}(c) ; Rb Eloss hypothesis ",nbins,limits,800,0.,4.);
447 for(
Int_t i=1; i<=nbinsHypo+1; i++) limitsHypo[i-1]= i*4./800.;
448 TH3D * hRABCharmVsRBeautyVsPt =
new TH3D(
"hRABCharmVsRBeautyVsPt",
" R_{AB}(c) vs Rb vs p_{T} Eloss hypothesis; p_{T} [GeV/c] ; R_{AB}(b) ; R_{AB}(c) ",nbins,limits,nbinsHypo,limitsHypo,nbinsHypo,limitsHypo);
449 TH2D *hRCharmVsRBeauty[nbins+1];
450 for(
Int_t i=0; i<=
nbins; i++) hRCharmVsRBeauty[i] =
new TH2D(Form(
"hRCharmVsRBeauty_%i",i),Form(
"RAB(c) vs RAB(b) for pt bin %i ; R_{AB}(b) ; R_{AB}(c)",i),nbinsHypo,limitsHypo,nbinsHypo,limitsHypo);
451 TH2D *hRCharmVsElossHypo[nbins+1];
452 for(
Int_t i=0; i<=
nbins; i++) hRCharmVsElossHypo[i] =
new TH2D(Form(
"hRCharmVsElossHypo_%i",i),Form(
"RAB(c) vs ElossHypo for pt bin %i ; Eloss Hypothesis (c/b) ; R_{AB}(c)",i),nbinsHypo,limitsHypo,nbinsHypo,limitsHypo);
454 TH1D *hRABEloss00=
new TH1D(
"hRABEloss00",
"hRABEloss00",nbins,limits);
455 TH1D *hRABEloss05=
new TH1D(
"hRABEloss05",
"hRABEloss05",nbins,limits);
456 TH1D *hRABEloss10=
new TH1D(
"hRABEloss10",
"hRABEloss10",nbins,limits);
457 TH1D *hRABEloss15=
new TH1D(
"hRABEloss15",
"hRABEloss15",nbins,limits);
458 TH1D *hRABEloss20=
new TH1D(
"hRABEloss20",
"hRABEloss20",nbins,limits);
460 TH2D * hRABvsRbFDlow =
new TH2D(
"hRABvsRbFDlow",
" R_{AB}(c) vs Rb Eloss hypothesis (FD low); p_{T} [GeV/c] ; Rb Eloss hypothesis ; R_{AB}(c) ",nbins,limits,800,0.,4.);
461 TH2D * hRABvsRbFDhigh =
new TH2D(
"hRABvsRbFDhigh",
" R_{AB}(c) vs Rb Eloss hypothesis (FD high); p_{T} [GeV/c] ; Rb Eloss hypothesis ; R_{AB}(c) ",nbins,limits,800,0.,4.);
463 TH1D * hRABvsRbFDhigh_proj =
new TH1D(
"hRABvsRbFDhigh_proj",
"hRABvsRbFDhigh_proj",nbins,limits);
464 TH1D * hRABvsRbFDlow_proj =
new TH1D(
"hRABvsRbFDlow_proj",
"hRABvsRbFDlow_proj",nbins,limits);
466 TNtuple *ntupleRAB=0x0 ;
468 ntupleRAB =
new TNtuple(
"ntupleRAB",
"ntupleRAB (Nb)",
"pt:TAB:sigmaPP:sigmaAB:invyieldAB:invyieldABFDHigh:invyieldABFDLow:RABCharm:RABCharmFDHigh:RABCharmFDLow:RABBeauty:fc",100000);
469 }
else if (fdMethod==
kfc) {
470 ntupleRAB =
new TNtuple(
"ntupleRAB",
"ntupleRAB (fc)",
"pt:TAB:sigmaPP:sigmaAB:invyieldAB:invyieldABFDHigh:invyieldABFDLow:Rcb:RABCharm:RABCharmFDHigh:RABCharmFDLow:RABBeauty:RABBeautyFDHigh:RABBeautyFDLow:fc",100000);
472 if(!ntupleRAB) printf(
"ERROR: Wrong method option");
474 TH1D * hYieldABvsPt =
new TH1D(
"hYieldABvsPt",
" Yield_{AB}(c) vs p_{T} (no Eloss hypothesis); p_{T} [GeV/c] ; Yield_{charm} ",nbins,limits);
475 TH1D * hRABvsPt =
new TH1D(
"hRABvsPt",
" R_{AB}(c) vs p_{T} (no Eloss hypothesis); p_{T} [GeV/c] ; R_{charm} ",nbins,limits);
476 TH1D * hRABvsPt_DataSystematics =
new TH1D(
"hRABvsPt_DataSystematics",
" Systematics of R_{AB} (c) vs p_{T} (no Eloss hypothesis); p_{T} [GeV/c] ; R_{charm} ",nbins,limits);
478 gRAB_ElossHypothesis->SetNameTitle(
"gRAB_ElossHypothesis",
"RAB Eloss systematics");
480 gRAB_FeedDownSystematics->SetNameTitle(
"gRAB_FeedDownSystematics",
"RAB Feed-Down systematics");
482 gRAB_fcFeedDownOnly->SetNameTitle(
"gRAB_fcFeedDownOnly",
"RAB fc Feed-Down Only");
484 gRAB_FeedDownSystematicsElossHypothesis->SetNameTitle(
"gRAB_FeedDownSystematicsElossHypothesis",
"RAB Feed-Down systematics considering Eloss hypothesis");
486 gRAB_DataSystematics->SetNameTitle(
"gRAB_DataSystematics",
"RAB Measurement (no FD, no Eloss) systematics");
488 gRAB_DataSystematicsPP->SetNameTitle(
"gRAB_DataSystematicsPP",
"RAB Measurement PP meas. systematics (data+scaling)");
490 gRAB_DataSystematicsAB->SetNameTitle(
"gRAB_DataSystematicsAB",
"RAB Measurement AB (no FD, no Eloss, no PP data) systematics");
492 gRAB_GlobalSystematics->SetNameTitle(
"gRAB_GlobalSystematics",
"RAB Measurement global (data, FD, Eloss) systematics");
493 Double_t ElossMax[nbins+1], ElossMin[nbins+1];
494 for(
Int_t i=0; i<=
nbins; i++) { ElossMax[i]=0.; ElossMin[i]=6.; }
495 Double_t fcElossMax[nbins+1], fcElossMin[nbins+1];
496 for(
Int_t i=0; i<=
nbins; i++) { fcElossMax[i]=0.; fcElossMin[i]=6.; }
497 Double_t FDElossMax[nbins+1], FDElossMin[nbins+1];
498 for(
Int_t i=0; i<=
nbins; i++) { FDElossMax[i]=0.; FDElossMin[i]=6.; }
501 gRAB_Norm->SetNameTitle(
"gRAB_Norm",
"RAB Normalization systematics (pp norm + Tab)");
504 gRAB_Norm->SetPoint(1,0.5,1.);
505 gRAB_Norm->SetPointError(1,0.25,0.25,normUnc,normUnc);
511 Int_t istartPPfd=0, istartPPsyst=0, istartABfd=0, istartPPextr=0;
512 Double_t yPPh=0., yPPl=0., yABh=0., yABl=0.;
513 Double_t RaaCharm =0., RaaBeauty=0.;
514 Double_t RaaCharmFDhigh = 0., RaaCharmFDlow = 0.;
515 Double_t RaaBeautyFDhigh = 0., RaaBeautyFDlow = 0.;
516 Double_t systUp=0., systLow=0., systPPUp=0., systPPLow=0., systABUp=0., systABLow=0.;
522 for(
Int_t i=0; i<=
nbins; i++) { ElossCentral[i]=0.; }
524 for(
Int_t ientry=0; ientry<=entries; ientry++){
526 nSigmaAB->GetEntry(ientry);
528 if ( !(sigmaAB>0.) )
continue;
532 Int_t hppbin = hSigmaPP->FindBin( pt );
533 Int_t hABbin = hSigmaAB->FindBin( pt );
534 Double_t sigmapp = hSigmaPP->GetBinContent( hppbin );
535 sigmapp *= scalePPRefToMatchRapidityBin;
537 if (isRaavsEP>0.) sigmapp = 0.5*sigmapp;
538 if ( !(sigmapp>0.) )
continue;
540 RaaCharm = ( sigmaAB / sigmaABCINT1B ) / ((Tab*1e3) * sigmapp *1e-12 ) ;
541 if(!isUseTaaForRaa) {
542 RaaCharm = ( sigmaAB ) / ( (A*B) * sigmapp ) ;
548 else if (fdMethod==
kfc) {
549 RaaBeauty = ( RaaCharm / Rcb ) ;
553 if (fdMethod==
kfc) { ElossHypo = 1. / Rcb; }
554 else { ElossHypo = 1. / (RaaCharm / RaaBeauty) ; }
555 if(isRbHypo) ElossHypo = RaaBeauty;
558 if(isShadHypothesis) CentralHypo = centralRbcShad[hABbin];
564 if( TMath::Abs( ElossHypo - CentralHypo ) < 0.075 ){
565 Double_t DeltaIni = TMath::Abs( ElossCentral[ hABbin ] - CentralHypo );
566 Double_t DeltaV = TMath::Abs( ElossHypo - CentralHypo );
568 if ( DeltaV < DeltaIni ) ElossCentral[ hABbin ] = ElossHypo;
575 for(
Int_t ientry=0; ientry<entries; ientry++){
577 nSigmaAB->GetEntry(ientry);
578 if ( !(sigmaAB>0.) )
continue;
583 Int_t hppbin = hSigmaPP->FindBin( pt );
584 Double_t sigmapp = hSigmaPP->GetBinContent( hppbin );
585 if (isRaavsEP>0.) sigmapp = 0.5*sigmapp;
586 sigmapp *= scalePPRefToMatchRapidityBin;
587 if ( !(sigmapp>0.) )
continue;
589 RaaCharm = ( sigmaAB / sigmaABCINT1B ) / ((Tab*1e3) * sigmapp *1e-12 );
590 if(!isUseTaaForRaa) {
591 RaaCharm = ( sigmaAB ) / ( (A*B) * sigmapp ) ;
595 Bool_t isExtrapolatedBin = kFALSE;
596 if(isScaledAndExtrapRef && hCombinedReferenceFlag) isExtrapolatedBin = hCombinedReferenceFlag->GetBinContent( hppbin );
604 if(!isExtrapolatedBin) istartPPfd =
FindGraphBin(gSigmaPPSystFeedDown,pt);
609 if(isExtrapolatedBin){
610 if(gReferenceFdSyst){
612 yPPh = gReferenceFdSyst->GetErrorYhigh(ibinfd);
613 yPPl = gReferenceFdSyst->GetErrorYlow(ibinfd);
616 yPPh = gSigmaPPSystFeedDown->GetErrorYhigh(istartPPfd);
617 yPPl = gSigmaPPSystFeedDown->GetErrorYlow(istartPPfd);
623 yPPh *= scalePPRefToMatchRapidityBin;
624 yPPl *= scalePPRefToMatchRapidityBin;
626 yABh = gSigmaABSystFeedDown->GetErrorYhigh(istartABfd);
627 yABl = gSigmaABSystFeedDown->GetErrorYlow(istartABfd);
630 RaaCharmFDhigh = ( sigmaABMax / sigmaABCINT1B ) / ((Tab*1e3) * (sigmapp+yPPh) *1e-12 ) ;
631 RaaCharmFDlow = ( sigmaABMin / sigmaABCINT1B ) / ((Tab*1e3) * (sigmapp-yPPl) *1e-12 ) ;
632 if(
printout && TMath::Abs(
ptprintout-pt)<0.1 ) cout << endl<<
" pt "<< pt <<
" Raa " << RaaCharm <<
" high "<< RaaCharmFDhigh <<
" low "<< RaaCharmFDlow<<endl;
633 if(!isUseTaaForRaa) {
634 RaaCharmFDhigh = ( sigmaABMax ) / ( (A*B)* (sigmapp+yPPh) ) ;
635 RaaCharmFDlow = ( sigmaABMin ) / ( (A*B)* (sigmapp-yPPl) ) ;
641 RaaBeautyFDlow = Rb ;
642 RaaBeautyFDhigh = Rb ;
643 ntupleRAB->Fill( pt, Tab*1e3, sigmapp*1e-12, sigmaAB*1e-12, sigmaAB/sigmaABCINT1B,
644 sigmaABMax / sigmaABCINT1B, sigmaABMin / sigmaABCINT1B,
645 RaaCharm, RaaCharmFDhigh, RaaCharmFDlow, RaaBeauty, fcAB );
647 else if (fdMethod==
kfc) {
648 RaaBeauty = ( RaaCharm / Rcb ) ;
649 RaaBeautyFDlow = ( RaaCharmFDlow / Rcb ) ;
650 RaaBeautyFDhigh = ( RaaCharmFDhigh / Rcb ) ;
651 hRABvsRcb->Fill( pt, RaaCharm, RaaBeauty );
652 ntupleRAB->Fill( pt, Tab*1e3, sigmapp*1e-12, sigmaAB*1e-12, sigmaAB/sigmaABCINT1B,
653 sigmaABMax / sigmaABCINT1B, sigmaABMin / sigmaABCINT1B,
654 Rcb, RaaCharm, RaaCharmFDhigh, RaaCharmFDlow, RaaBeauty, RaaBeautyFDhigh, RaaBeautyFDlow, fcAB );
656 hRABvsRb->Fill( pt, RaaCharm, RaaBeauty );
657 hRABvsRbFDlow->Fill( pt, RaaCharmFDlow, RaaBeautyFDlow );
658 hRABvsRbFDhigh->Fill( pt, RaaCharmFDhigh, RaaBeautyFDhigh );
659 if(
printout && TMath::Abs(
ptprintout-pt)<0.1) cout <<
" pt "<< pt <<
" Rb " << RaaBeauty <<
" high "<< RaaBeautyFDhigh <<
" low "<< RaaBeautyFDlow <<endl;
661 hRABCharmVsRBeautyVsPt->Fill( pt, RaaBeauty, RaaCharm );
662 Int_t ptbin = hRABvsPt->FindBin( pt );
663 hRCharmVsRBeauty[ptbin]->Fill( RaaBeauty, RaaCharm );
664 hRCharmVsRBeauty[ptbin]->Fill( RaaBeautyFDlow, RaaCharmFDlow );
665 hRCharmVsRBeauty[ptbin]->Fill( RaaBeautyFDhigh, RaaCharmFDhigh );
669 if( TMath::Abs(Rcb-0.015)<0.009 ) hRABEloss00->Fill(pt,RaaCharm);
670 if( TMath::Abs(Rcb-0.5)<0.009 ) hRABEloss05->Fill(pt,RaaCharm);
671 if( TMath::Abs(Rcb-1.0)<0.009 ) {
672 hRABEloss10->Fill(pt,RaaCharm);
673 hRABvsRbFDhigh_proj->Fill(pt,RaaCharmFDhigh);
674 hRABvsRbFDlow_proj->Fill(pt,RaaCharmFDlow);
676 if( TMath::Abs(Rcb-1.5)<0.009 ) hRABEloss15->Fill(pt,RaaCharm);
677 if( TMath::Abs(Rcb-2.0)<0.009 ) hRABEloss20->Fill(pt,RaaCharm);
679 else if (fdMethod==
kNb) {
680 if( TMath::Abs(RaaBeauty-0.015)<0.009 ) hRABEloss00->Fill(pt,RaaCharm);
681 if( TMath::Abs(RaaBeauty-0.5)<0.009 ) hRABEloss05->Fill(pt,RaaCharm);
682 if( TMath::Abs(RaaBeauty-1.0)<0.009 ) {
683 hRABEloss10->Fill(pt,RaaCharm);
684 hRABvsRbFDhigh_proj->Fill(pt,RaaCharmFDhigh);
685 hRABvsRbFDlow_proj->Fill(pt,RaaCharmFDlow);
687 if( TMath::Abs(RaaBeauty-1.5)<0.009 ) hRABEloss15->Fill(pt,RaaCharm);
688 if( TMath::Abs(RaaBeauty-2.0)<0.009 ) hRABEloss20->Fill(pt,RaaCharm);
692 Int_t hABbin = hMassAB->FindBin( pt );
693 if(isShadHypothesis) CentralHypo = centralRbcShad[hABbin];
696 if ( fdMethod==
kNb && TMath::Abs(Rb -CentralHypo)< 0.05) {
697 cout <<
" pt "<< pt <<
", at bin "<<hABbin<<endl;
698 cout<<
" entries "<<entries<<
", i="<<ientry<<
", pt="<<pt<<
", Rb="<<Rb<<
", Tab="<<Tab<<
", sigmaAB="<<sigmaAB<<
", sigmapp="<<sigmapp<<
", Raacharm="<<RaaCharm<<
", RaaBeauty="<<RaaBeauty<<endl;
699 cout <<
" AB basis: mass "<< hMassAB->GetBinContent(hABbin)<<
", eff "<< hDirectEffptAB->GetBinContent(hABbin)<<endl;
700 cout<<
" FD low, err low AB "<< (sigmaAB-sigmaABMin)<<
" err low PP "<< yPPl<<
" Raacharm="<<RaaCharmFDlow<<
", RaaBeauty="<<RaaBeautyFDlow<<endl;
701 cout<<
" FD high, err high AB "<< (sigmaABMax-sigmaAB)<<
" err high PP "<< yPPh<<
" Raacharm="<<RaaCharmFDhigh<<
", RaaBeauty="<<RaaBeautyFDhigh<<endl;
704 if ( fdMethod==
kfc)
if(TMath::Abs(Rcb -CentralHypo)< 0.05 ){
705 cout <<
" pt "<< pt <<
", at bin "<<hABbin<<endl;
706 cout<<
" entries "<<entries<<
", i="<<ientry<<
", pt="<<pt<<
", Rcb="<<Rcb<<
", Tab="<<Tab<<
", sigmaAB="<<sigmaAB<<
", sigmapp="<<sigmapp<<
", Raacharm="<<RaaCharm<<
", RaaBeauty="<<RaaBeauty<<endl;
707 cout <<
" AB basis: mass "<< hMassAB->GetBinContent(hABbin)<<
", eff "<< hDirectEffptAB->GetBinContent(hABbin)<<
", fc "<<histofcAB->GetBinContent(hABbin)<< endl;
708 cout<<
" FD low, err low AB "<< (sigmaAB-sigmaABMin)<<
" err low PP "<< yPPl<<
" Raacharm="<<RaaCharmFDlow<<
", RaaBeauty="<<RaaBeautyFDlow<<endl;
709 cout<<
" FD high, err high AB "<< (sigmaABMax-sigmaAB)<<
" err high PP "<< yPPh<<
" Raacharm="<<RaaCharmFDhigh<<
", RaaBeauty="<<RaaBeautyFDhigh<<endl;
717 if (fdMethod==
kfc) { ElossHypo = 1./ Rcb; }
718 else { ElossHypo = 1. / (RaaCharm / RaaBeauty); }
719 if(isRbHypo) ElossHypo = RaaBeauty;
720 hRCharmVsElossHypo[ptbin]->Fill( ElossHypo, RaaCharm );
723 if(isShadHypothesis) {
724 MinHypo = minRbcShad[ hABbin ];
725 MaxHypo = maxRbcShad[ hABbin ];
729 if(ientry==0) cout<<
" pt"<< pt<<
" ElossCentral "<< ElossCentral[hABbin] <<
" min-hypo "<<MinHypo <<
" max-hypo "<<MaxHypo<<endl;
734 Double_t minFdSyst = 0., maxFdSyst = 0.;
735 if ( ElossHypo == ElossCentral[ hABbin ] ) {
740 Double_t sigmappStat = hSigmaPP->GetBinError( hppbin );
741 if (isRaavsEP>0.) sigmappStat = sigmappStat*0.5;
742 sigmappStat *= scalePPRefToMatchRapidityBin;
743 Int_t hRABbin = hRABvsPt->FindBin( pt );
744 Double_t stat = RaaCharm * TMath::Sqrt( (statUncSigmaAB/sigmaAB)*(statUncSigmaAB/sigmaAB) +
745 (sigmappStat/sigmapp)*(sigmappStat/sigmapp) ) ;
746 if ( RaaCharm==0 ) stat =0.;
748 hRABvsPt->SetBinContent( hRABbin, RaaCharm );
749 hRABvsPt->SetBinError( hRABbin, stat );
750 hYieldABvsPt->SetBinContent( hRABbin, sigmaAB/sigmaABCINT1B );
751 hYieldABvsPt->SetBinError( hRABbin, statUncSigmaAB/sigmaABCINT1B );
753 cout <<
"pt="<< pt<<
" Raa " << RaaCharm <<
" stat unc. "<< stat <<
754 " sigma-pp "<< sigmapp <<
" sigma-AB "<< sigmaAB<<endl;
756 cout <<
" Raa " << RaaCharm <<
" stat unc. "<< stat <<
" is "<< stat/RaaCharm * 100. <<
757 "%, stat-pp "<< sigmappStat/sigmapp*100. <<
"% stat-AB "<< statUncSigmaAB/sigmaAB*100.<<
"%"<<endl;
760 Double_t errstatEff = fhStatUncEffcSigmaAB->GetBinError( hRABbin );
761 fhStatUncEffcSigmaAB_Raa->SetBinError( hRABbin, errstatEff*RaaCharm );
762 errstatEff = fhStatUncEffbSigmaAB->GetBinError( hRABbin );
763 fhStatUncEffbSigmaAB_Raa->SetBinError( hRABbin, errstatEff*RaaCharm );
764 errstatEff = fhStatUncEffcFDAB->GetBinError( hRABbin );
765 fhStatUncEffcFDAB_Raa->SetBinError( hRABbin, errstatEff*RaaCharm );
766 errstatEff = fhStatUncEffbFDAB->GetBinError( hRABbin );
767 fhStatUncEffbFDAB_Raa->SetBinError( hRABbin, errstatEff*RaaCharm );
778 Double_t ptwidth = hSigmaAB->GetBinWidth(hABbin) / 2. ;
780 if(!isExtrapolatedBin) istartPPextr =
FindGraphBin(gSigmaPPSystTheory,pt);
783 if(isExtrapolatedBin) {
784 dataPPUp = gSigmaPPSyst->GetErrorYhigh(istartPPsyst);
785 dataPPLow = gSigmaPPSyst->GetErrorYlow(istartPPsyst);
787 systPPLow = dataPPLow;
789 dataPPUp =
ExtractFDSyst( gSigmaPPSystData->GetErrorYhigh(istartPPextr), gSigmaPPSystFeedDown->GetErrorYhigh(istartPPfd) );
790 dataPPLow =
ExtractFDSyst( gSigmaPPSystData->GetErrorYlow(istartPPextr), gSigmaPPSystFeedDown->GetErrorYlow(istartPPfd) );
791 systPPUp = TMath::Sqrt( dataPPUp*dataPPUp + gSigmaPPSystTheory->GetErrorYhigh(istartPPextr)*gSigmaPPSystTheory->GetErrorYhigh(istartPPextr) );
792 systPPLow = TMath::Sqrt( dataPPLow*dataPPLow + gSigmaPPSystTheory->GetErrorYlow(istartPPextr)*gSigmaPPSystTheory->GetErrorYlow(istartPPextr) );
795 dataPPUp = dataPPUp*0.5;
796 dataPPLow = dataPPLow*0.5;
797 if(isExtrapolatedBin) {
799 systPPLow = dataPPLow;
801 systPPUp = TMath::Sqrt( dataPPUp*dataPPUp + 0.5*gSigmaPPSystTheory->GetErrorYhigh(istartPPextr)*0.5*gSigmaPPSystTheory->GetErrorYhigh(istartPPextr) );
802 systPPLow = TMath::Sqrt( dataPPLow*dataPPLow + 0.5*gSigmaPPSystTheory->GetErrorYlow(istartPPextr)*0.5*gSigmaPPSystTheory->GetErrorYlow(istartPPextr) );
805 systPPUp *= scalePPRefToMatchRapidityBin;
806 systPPLow *= scalePPRefToMatchRapidityBin;
810 cout <<
" pt : "<< pt<<
" Syst-pp-data "<< dataPPUp/sigmapp <<
"%, ";
811 if(!isExtrapolatedBin){
812 if (isRaavsEP>0.) cout <<
" extr unc + "<< 0.5*gSigmaPPSystTheory->GetErrorYhigh(istartPPextr)/sigmapp <<
" - "<< 0.5*gSigmaPPSystTheory->GetErrorYlow(istartPPextr)/sigmapp <<
" %";
813 else cout <<
" extr unc + "<< (gSigmaPPSystTheory->GetErrorYhigh(istartPPextr)*scalePPRefToMatchRapidityBin)/sigmapp <<
" - "<< (gSigmaPPSystTheory->GetErrorYlow(istartPPextr)*scalePPRefToMatchRapidityBin)/sigmapp <<
" %";
821 Double_t dataSystUp=0., dataSystDown=0.;
823 if (!PbPbDataSystOk) { cout <<
" There is some issue with the PbPb data systematics, please check and rerun"<<endl;
return; }
824 systABUp = sigmaAB * TMath::Sqrt( dataSystUp*dataSystUp +
825 (hDirectEffptAB->GetBinError(hABbin)/hDirectEffptAB->GetBinContent(hABbin))*(hDirectEffptAB->GetBinError(hABbin)/hDirectEffptAB->GetBinContent(hABbin)) );
827 systABLow = sigmaAB * TMath::Sqrt( dataSystDown*dataSystDown +
828 (hDirectEffptAB->GetBinError(hABbin)/hDirectEffptAB->GetBinContent(hABbin))*(hDirectEffptAB->GetBinError(hABbin)/hDirectEffptAB->GetBinContent(hABbin)) );
832 systLow = sigmapp>0. ?
833 RaaCharm * TMath::Sqrt( (systABLow/sigmaAB)*(systABLow/sigmaAB) + (systPPUp/sigmapp)*(systPPUp/sigmapp) )
836 systUp = sigmapp>0. ?
837 RaaCharm * TMath::Sqrt( (systABUp/sigmaAB)*(systABUp/sigmaAB) + (systPPLow/sigmapp)*(systPPLow/sigmapp) )
839 if ( RaaCharm==0 ) { systPPUp =0.; systPPLow =0.; }
842 cout <<
" Syst-pp-up "<< systPPUp/sigmapp <<
"%, syst-pp-low "<< systPPLow/sigmapp <<
"%, syst-AB-up "<<systABUp/sigmaAB<<
"%, syst-AB-low "<<systABLow/sigmaAB<<
"%, tot-syst-up "<<systUp/RaaCharm<<
"%, tot-syst-low "<<systLow/RaaCharm<<
"%"<<endl;
845 hRABvsPt_DataSystematics->SetBinContent( hRABbin, RaaCharm );
846 hRABvsPt_DataSystematics->SetBinError( hRABbin, systUp );
847 gRAB_DataSystematics->SetPoint( hABbin, pt, RaaCharm );
848 gRAB_DataSystematics->SetPointError( hABbin, ptwidth, ptwidth, systLow, systUp );
849 gRAB_DataSystematics->SetPointEXlow(hABbin, 0.4); gRAB_DataSystematics->SetPointEXhigh(hABbin,0.4);
850 gRAB_DataSystematicsPP->SetPoint( hABbin, pt, RaaCharm );
851 gRAB_DataSystematicsPP->SetPointError( hABbin, ptwidth, ptwidth, RaaCharm *(systPPUp/sigmapp), RaaCharm *systPPLow/sigmapp );
852 gRAB_DataSystematicsAB->SetPoint( hABbin, pt, RaaCharm );
853 gRAB_DataSystematicsAB->SetPointError( hABbin, ptwidth, ptwidth, RaaCharm *systABLow/sigmaAB, RaaCharm *systABUp/sigmaAB );
860 if ( RaaCharmFDhigh > RaaCharmFDlow ){
861 FDH = RaaCharmFDhigh; FDL = RaaCharmFDlow;
863 FDL = RaaCharmFDhigh; FDH = RaaCharmFDlow;
866 if(
printout && TMath::Abs(
ptprintout-pt)<0.1) cout<<
" Raa "<<RaaCharm<<
", Raa-fd-low "<<RaaCharmFDlow <<
", Raa-fd-high "<<RaaCharmFDhigh <<endl;
867 maxFdSyst = TMath::Abs(FDH - RaaCharm);
868 minFdSyst = TMath::Abs(RaaCharm - FDL);
870 gRAB_FeedDownSystematics->SetPoint( hABbin, pt, RaaCharm );
871 gRAB_FeedDownSystematics->SetPointError( hABbin, 0.3, 0.3, minFdSyst, maxFdSyst );
872 gRAB_fcFeedDownOnly->SetPoint( hABbin, pt,fcAB );
873 gRAB_fcFeedDownOnly->SetPointError(hABbin, 0.3, 0.3, fcAB-(sigmaABMin/sigmaAB*fcAB), (sigmaABMax/sigmaAB*fcAB)-fcAB );
877 cout<<
" FD syst +"<< maxFdSyst/RaaCharm <<
" - "<<minFdSyst/RaaCharm<<endl;
878 cout<<
" fc = "<<fcAB<<
", ("<< sigmaABMax/sigmaAB * fcAB <<
","<< sigmaABMin/sigmaAB * fcAB <<
")"<<endl;
885 gRAB_ElossHypothesis->SetPoint( hABbin, pt, RaaCharm );
886 gRAB_ElossHypothesis->SetPointEXlow( hABbin, ptwidth);
887 gRAB_ElossHypothesis->SetPointEXhigh( hABbin, ptwidth);
888 gRAB_FeedDownSystematicsElossHypothesis->SetPoint( hABbin, pt, RaaCharm );
889 gRAB_FeedDownSystematicsElossHypothesis->SetPointEXlow( hABbin, ptwidth);
890 gRAB_FeedDownSystematicsElossHypothesis->SetPointEXhigh( hABbin, ptwidth);
891 gRAB_GlobalSystematics->SetPoint( hABbin, pt, RaaCharm );
892 gRAB_GlobalSystematics->SetPointEXlow(hABbin,0.4); gRAB_GlobalSystematics->SetPointEXhigh(hABbin,0.4);
902 if( RaaCharm>0 && ElossHypo >= MinHypo && ElossHypo <=MaxHypo && RaaBeauty<=MaxRb ) {
904 Double_t Ehigh = ElossMax[ hABbin ] ;
905 Double_t Elow = ElossMin[ hABbin ] ;
906 if ( RaaCharm > Ehigh ) ElossMax[ hABbin ] = RaaCharm ;
907 if ( RaaCharm < Elow ) ElossMin[ hABbin ] = RaaCharm ;
909 cout<<
" Hypothesis " << ElossHypo <<
" sigma-AB "<< sigmaAB <<
", Raa "<< RaaCharm <<
", Raa Eloss max "<< ElossMax[hABbin] <<
" Raa Eloss min "<< ElossMin[hABbin] <<
" Rb="<< RaaBeauty <<endl;
910 cout<<
" Rb="<< RaaBeauty <<
" max "<< RaaBeautyFDhigh <<
" min "<< RaaBeautyFDlow <<endl;
912 Double_t fcEhigh = fcElossMax[ hABbin ] ;
913 Double_t fcElow = fcElossMin[ hABbin ] ;
914 if ( fcAB > fcEhigh ) fcElossMax[ hABbin ] = fcAB ;
915 if ( fcAB < fcElow ) fcElossMin[ hABbin ] = fcAB ;
916 Double_t FDEhigh = FDElossMax[ hABbin ];
917 Double_t FDEmin = FDElossMin[ hABbin ];
918 Double_t RFDhigh = RaaCharmFDhigh>RaaCharmFDlow ? RaaCharmFDhigh : RaaCharmFDlow;
919 Double_t RFDlow = RaaCharmFDlow<RaaCharmFDhigh ? RaaCharmFDlow : RaaCharmFDhigh;
920 if ( RFDhigh > FDEhigh ) FDElossMax[ hABbin ] = RFDhigh ;
921 if ( RFDlow < FDEmin ) FDElossMin[ hABbin ] = RFDlow ;
923 cout<<
" Hypothesis " << ElossHypo <<
" sigma-AB "<< sigmaAB <<
", Raa FD-max Eloss max "<< FDElossMax[hABbin] <<
" Raa FD-min Eloss min "<< FDElossMin[hABbin] <<endl;
933 gRAB_ElossHypothesis->GetPoint(ibin,ipt,value);
937 Double_t elossYhigh = TMath::Abs( ElossMax[ibin] - value );
938 Double_t elossYlow = TMath::Abs( value - ElossMin[ibin] );
939 gRAB_ElossHypothesis->SetPointEYhigh(ibin, elossYhigh );
940 gRAB_ElossHypothesis->SetPointEYlow(ibin, elossYlow );
941 gRAB_ElossHypothesis->SetPointEXhigh(ibin, 0.2);
942 gRAB_ElossHypothesis->SetPointEXlow(ibin, 0.2);
943 cout <<
" pt "<< ipt <<
" Raa "<< value <<
" max "<< ElossMax[ibin] <<
" min " <<ElossMin[ibin] <<endl;
944 cout<<
" Eloss syst +"<< elossYhigh <<
" - "<< elossYlow <<endl;
948 Double_t fdElossEYhigh = TMath::Abs( FDElossMax[ibin] - value );
949 Double_t fdElossEYlow = TMath::Abs( value - FDElossMin[ibin] );
951 Double_t fdEYhigh = gRAB_FeedDownSystematics->GetErrorYhigh(ibin);
952 fdElossEYhigh = TMath::Sqrt( elossYhigh*elossYhigh + fdEYhigh*fdEYhigh );
953 Double_t fdEYlow = gRAB_FeedDownSystematics->GetErrorYlow(ibin);
954 fdElossEYlow = TMath::Sqrt( elossYlow*elossYlow + fdEYlow*fdEYlow );
956 gRAB_FeedDownSystematicsElossHypothesis->SetPointEYhigh(ibin, fdElossEYhigh );
957 gRAB_FeedDownSystematicsElossHypothesis->SetPointEYlow(ibin, fdElossEYlow );
958 gRAB_FeedDownSystematicsElossHypothesis->SetPointEXhigh(ibin, 0.25);
959 gRAB_FeedDownSystematicsElossHypothesis->SetPointEXlow(ibin, 0.25);
960 cout<<
" FD & Eloss syst +"<< fdElossEYhigh <<
" - "<< fdElossEYlow
961 <<
" = + "<< fdElossEYhigh/value <<
" - "<< fdElossEYlow/value <<
" %" <<endl;
964 Double_t systdatal = gRAB_DataSystematics->GetErrorYlow(ibin);
965 Double_t systdatah = gRAB_DataSystematics->GetErrorYhigh(ibin);
966 Double_t systgbhUnc = TMath::Sqrt( systdatah*systdatah + fdElossEYhigh*fdElossEYhigh );
967 Double_t systgblUnc = TMath::Sqrt( systdatal*systdatal + fdElossEYlow*fdElossEYlow );
968 gRAB_GlobalSystematics->SetPointEYhigh(ibin,systgbhUnc);
969 gRAB_GlobalSystematics->SetPointEYlow(ibin,systgblUnc);
970 cout<<
" Data syst +"<< systdatah <<
" - "<< systdatal <<
" = + "<< systdatah/value <<
" - " << systdatal/value <<
" % "<<endl;
971 cout<<
" Global syst +"<< systgbhUnc <<
" - "<< systgblUnc <<
" = + "<< systgbhUnc/value <<
" - "<< systgblUnc/value <<
" %" <<endl;
975 cout<<endl<<
" Calculation finished, now drawing"<<endl<<endl;
978 gROOT->SetStyle(
"Plain");
979 gStyle->SetPalette(1);
980 gStyle->SetOptStat(0);
983 TCanvas *cRABvsRb =
new TCanvas(
"RABvsRb",
"RAB vs Rb");
984 hRABvsRb->Draw(
"colz");
992 cout<<
" Drawing feed-down contribution"<<endl;
993 TCanvas *cRABvsRbFDl =
new TCanvas(
"RABvsRbFDl",
"RAB vs Rb (FD low)");
994 hRABvsRbFDlow->Draw(
"cont4z");
995 cRABvsRbFDl->Update();
996 TCanvas *cRABvsRbFDh =
new TCanvas(
"RABvsRbFDh",
"RAB vs Rb (FD high)");
997 hRABvsRbFDhigh->Draw(
"cont4z");
998 cRABvsRbFDh->Update();
1000 TCanvas * cSigmaABptEloss =
new TCanvas(
"cSigmaABptEloss",
"SigmaAB vs pt, Eloss hypothesis");
1001 TH1D *hSigmaABEloss00=
new TH1D(
"hSigmaABEloss00",
"hSigmaABEloss00",nbins,limits);
1002 TH1D *hSigmaABEloss05=
new TH1D(
"hSigmaABEloss05",
"hSigmaABEloss05",nbins,limits);
1003 TH1D *hSigmaABEloss10=
new TH1D(
"hSigmaABEloss10",
"hSigmaABEloss10",nbins,limits);
1004 TH1D *hSigmaABEloss15=
new TH1D(
"hSigmaABEloss15",
"hSigmaABEloss15",nbins,limits);
1005 TH1D *hSigmaABEloss20=
new TH1D(
"hSigmaABEloss20",
"hSigmaABEloss20",nbins,limits);
1008 delete [] binwidths;
1010 for (
Int_t i=0; i<=nSigmaAB->GetEntriesFast(); i++) {
1011 nSigmaAB->GetEntry(i);
1012 if (fdMethod==
kfc) {
1013 if( TMath::Abs(Rcb-0.015)<0.009 ) hSigmaABEloss00->Fill(pt,sigmaAB);
1014 if( TMath::Abs(Rcb-0.5)<0.009 ) hSigmaABEloss05->Fill(pt,sigmaAB);
1015 if( TMath::Abs(Rcb-1.0)<0.009 ) hSigmaABEloss10->Fill(pt,sigmaAB);
1016 if( TMath::Abs(Rcb-1.5)<0.009 ) hSigmaABEloss15->Fill(pt,sigmaAB);
1017 if( TMath::Abs(Rcb-2.0)<0.009 ) hSigmaABEloss20->Fill(pt,sigmaAB);
1019 else if (fdMethod==
kNb) {
1020 if( TMath::Abs(Rb-0.015)<0.009 ) hSigmaABEloss00->Fill(pt,sigmaAB);
1021 if( TMath::Abs(Rb-0.5)<0.009 ) hSigmaABEloss05->Fill(pt,sigmaAB);
1022 if( TMath::Abs(Rb-1.0)<0.009 ) hSigmaABEloss10->Fill(pt,sigmaAB);
1023 if( TMath::Abs(Rb-1.5)<0.009 ) hSigmaABEloss15->Fill(pt,sigmaAB);
1024 if( TMath::Abs(Rb-2.0)<0.009 ) hSigmaABEloss20->Fill(pt,sigmaAB);
1027 hSigmaABEloss00->SetLineColor(2);
1028 hSigmaABEloss05->SetLineColor(3);
1029 hSigmaABEloss10->SetLineColor(4);
1030 hSigmaABEloss15->SetLineColor(kMagenta+1);
1031 hSigmaABEloss20->SetLineColor(kGreen+2);
1032 hSigmaABEloss00->SetMarkerStyle(22);
1033 hSigmaABEloss05->SetMarkerStyle(26);
1034 hSigmaABEloss10->SetMarkerStyle(20);
1035 hSigmaABEloss15->SetMarkerStyle(25);
1036 hSigmaABEloss20->SetMarkerStyle(21);
1037 if (fdMethod==
kNb) {
1038 hSigmaABEloss05->Draw(
"ph");
1039 hSigmaABEloss10->Draw(
"phsame");
1040 hSigmaABEloss15->Draw(
"phsame");
1041 hSigmaABEloss20->Draw(
"phsame");
1044 hSigmaABEloss20->Draw(
"p");
1045 hSigmaABEloss00->Draw(
"phsame");
1046 hSigmaABEloss05->Draw(
"phsame");
1047 hSigmaABEloss10->Draw(
"phsame");
1048 hSigmaABEloss15->Draw(
"phsame");
1049 hSigmaABEloss20->Draw(
"phsame");
1051 TLegend *legrcb =
new TLegend(0.8,0.8,0.95,0.9);
1052 legrcb->SetFillColor(0);
1053 legrcb->AddEntry(hSigmaABEloss00,
"Rc/b=0.0",
"lp");
1054 legrcb->AddEntry(hSigmaABEloss05,
"Rc/b=0.5",
"lp");
1055 legrcb->AddEntry(hSigmaABEloss10,
"Rc/b=1.0",
"lp");
1056 legrcb->AddEntry(hSigmaABEloss15,
"Rc/b=1.5",
"lp");
1057 legrcb->AddEntry(hSigmaABEloss20,
"Rc/b=2.0",
"lp");
1059 cSigmaABptEloss->Update();
1062 TCanvas * cRABptEloss =
new TCanvas(
"cRABptEloss",
"RAB vs pt, Eloss hypothesis");
1063 hRABEloss00->SetLineColor(2);
1064 hRABEloss05->SetLineColor(3);
1065 hRABEloss10->SetLineColor(4);
1066 hRABEloss15->SetLineColor(kMagenta+1);
1067 hRABEloss20->SetLineColor(kGreen+2);
1068 hRABEloss00->SetMarkerStyle(22);
1069 hRABEloss05->SetMarkerStyle(26);
1070 hRABEloss10->SetMarkerStyle(20);
1071 hRABEloss15->SetMarkerStyle(25);
1072 hRABEloss20->SetMarkerStyle(21);
1073 if (fdMethod==
kNb) {
1074 hRABEloss05->Draw(
"ph");
1075 hRABEloss10->Draw(
"phsame");
1076 hRABEloss15->Draw(
"phsame");
1077 hRABEloss20->Draw(
"phsame");
1080 hRABEloss20->Draw(
"p");
1081 hRABEloss00->Draw(
"phsame");
1082 hRABEloss05->Draw(
"phsame");
1083 hRABEloss10->Draw(
"phsame");
1084 hRABEloss15->Draw(
"phsame");
1085 hRABEloss20->Draw(
"phsame");
1087 legrcb =
new TLegend(0.8,0.8,0.95,0.9);
1088 legrcb->SetFillColor(0);
1089 if (fdMethod==
kfc) {
1090 legrcb->AddEntry(hRABEloss00,
"Rc/b=0.0",
"lp");
1091 legrcb->AddEntry(hRABEloss05,
"Rc/b=0.5",
"lp");
1092 legrcb->AddEntry(hRABEloss10,
"Rc/b=1.0",
"lp");
1093 legrcb->AddEntry(hRABEloss15,
"Rc/b=0.5",
"lp");
1094 legrcb->AddEntry(hRABEloss20,
"Rc/b=2.0",
"lp");
1096 else if (fdMethod==
kNb) {
1097 legrcb->AddEntry(hRABEloss00,
"Rb=0.0",
"lp");
1098 legrcb->AddEntry(hRABEloss05,
"Rb=0.5",
"lp");
1099 legrcb->AddEntry(hRABEloss10,
"Rb=1.0",
"lp");
1100 legrcb->AddEntry(hRABEloss15,
"Rb=0.5",
"lp");
1101 legrcb->AddEntry(hRABEloss20,
"Rb=2.0",
"lp");
1104 cRABptEloss->Update();
1107 cout<<
" Drawing summary results"<<endl;
1108 TCanvas * cRABpt =
new TCanvas(
"cRABpt",
"RAB vs pt, no hypothesis");
1109 hRABEloss10->Draw(
"");
1112 TCanvas * cRABptFDUnc =
new TCanvas(
"cRABptFDUnc",
"RAB vs pt, FD Uncertainties");
1113 hRABvsRbFDlow_proj->Draw(
"");
1114 hRABEloss10->Draw(
"phsame");
1115 hRABvsRbFDhigh_proj->SetLineColor(kMagenta+1);
1116 hRABvsRbFDhigh_proj->Draw(
"same");
1117 hRABvsRbFDlow_proj->SetLineColor(kGreen+2);
1118 hRABvsRbFDlow_proj->Draw(
"same");
1119 legrcb =
new TLegend(0.8,0.8,0.95,0.9);
1120 legrcb->SetFillColor(0);
1121 legrcb->AddEntry(hRABEloss10,
"FD Central",
"lp");
1122 legrcb->AddEntry(hRABvsRbFDhigh_proj,
"FD Upper unc.",
"l");
1123 legrcb->AddEntry(hRABvsRbFDlow_proj,
"FD Lower unc.",
"l");
1125 cRABptFDUnc->Update();
1127 TCanvas *RaaPlot =
new TCanvas(
"RaaPlot",
"RAB vs pt, plot all");
1128 RaaPlot->SetTopMargin(0.085);
1129 RaaPlot->SetBottomMargin(0.1);
1130 RaaPlot->SetTickx();
1131 RaaPlot->SetTicky();
1132 TH2D *hRaaCanvas =
new TH2D(
"hRaaCanvas",
" R_{AB}(c) vs p_{T} (no Eloss hypothesis); p_{t} [GeV/c] ; R_{AA} prompt D",40,0.,40.,100,0.,3.0);
1133 hRaaCanvas->GetXaxis()->SetTitleSize(0.05);
1134 hRaaCanvas->GetXaxis()->SetTitleOffset(0.9);
1135 hRaaCanvas->GetYaxis()->SetTitleSize(0.05);
1136 hRaaCanvas->GetYaxis()->SetTitleOffset(0.9);
1138 gRAB_Norm->SetFillStyle(1001);
1139 gRAB_Norm->SetFillColor(kGray+2);
1140 gRAB_Norm->Draw(
"2");
1141 TLine *line =
new TLine(0.0172415,1.0,40.,1.0);
1142 line->SetLineStyle(2);
1144 hRABvsPt->SetMarkerColor(kBlue);
1145 hRABvsPt->SetMarkerColor(kBlue);
1146 hRABvsPt->SetMarkerStyle(21);
1147 hRABvsPt->SetMarkerSize(1.1);
1148 hRABvsPt->SetLineWidth(2);
1149 hRABvsPt->Draw(
"psame");
1150 gRAB_DataSystematics->SetLineColor(kBlue);
1151 gRAB_DataSystematics->SetLineWidth(3);
1152 gRAB_DataSystematics->SetLineWidth(2);
1153 gRAB_DataSystematics->SetFillColor(kRed);
1154 gRAB_DataSystematics->SetFillStyle(0);
1155 gRAB_DataSystematics->Draw(
"2");
1156 gRAB_FeedDownSystematics->SetFillColor(kViolet+1);
1157 gRAB_FeedDownSystematics->SetFillStyle(1001);
1158 gRAB_FeedDownSystematics->Draw(
"2");
1159 gRAB_ElossHypothesis->SetLineColor(kMagenta-7);
1160 gRAB_ElossHypothesis->SetFillColor(kMagenta-7);
1161 gRAB_ElossHypothesis->SetFillStyle(1001);
1162 gRAB_ElossHypothesis->Draw(
"2");
1163 hRABvsPt->Draw(
"psame");
1164 gRAB_DataSystematics->Draw(
"2");
1165 legrcb =
new TLegend(0.5517241,0.6504237,0.8520115,0.8728814,NULL,
"brNDC");
1166 legrcb->SetBorderSize(0);
1167 legrcb->SetTextSize(0.03389831);
1168 legrcb->SetLineColor(1);
1169 legrcb->SetLineStyle(1);
1170 legrcb->SetLineWidth(1);
1171 legrcb->SetFillColor(0);
1172 legrcb->SetFillStyle(1001);
1173 if(
cc==
k020) legrcb->AddEntry(hRABvsPt,
"R_{AA} 0-20% CC",
"pe");
1174 else if(
cc==
k4080) legrcb->AddEntry(hRABvsPt,
"R_{AA} 40-80% CC",
"pe");
1175 else legrcb->AddEntry(hRABvsPt,
"R_{AA} and stat. unc.",
"pe");
1176 legrcb->AddEntry(gRAB_DataSystematics,
"Syst. from data",
"f");
1177 legrcb->AddEntry(gRAB_ElossHypothesis,
"Syst. from R_{AA}(B)",
"f");
1178 legrcb->AddEntry(gRAB_FeedDownSystematics,
"Syst. from B feed-down",
"f");
1181 TString system =
"Pb-Pb #sqrt{s_{NN}}=2.76 TeV";
1183 if(
decay==1) tc =
new TLatex(0.18,0.82,Form(
"D^{0}, %s ",system.Data()));
1184 else if(
decay==2) tc =
new TLatex(0.18,0.82,Form(
"D^{+}, %s ",system.Data()));
1185 else if(
decay==3) tc =
new TLatex(0.18,0.82,Form(
"D^{*+}, %s ",system.Data()));
1186 else if(
decay==4) tc =
new TLatex(0.18,0.82,Form(
"D_{s}^{+}, %s ",system.Data()));
1187 else tc =
new TLatex(0.18,0.82,Form(
"any (?) D meson, %s ",system.Data()));
1189 tc->SetTextSize(0.038);
1190 tc->SetTextFont(42);
1195 TCanvas *RaaPlotFDEloss =
new TCanvas(
"RaaPlotFDEloss",
"RAB vs pt, plot FD & ElossUnc");
1196 RaaPlotFDEloss->SetTopMargin(0.085);
1197 RaaPlotFDEloss->SetBottomMargin(0.1);
1200 hRABvsPt->Draw(
"psame");
1201 gRAB_FeedDownSystematics->SetFillColor(kViolet+1);
1202 gRAB_FeedDownSystematics->SetFillStyle(1001);
1203 gRAB_FeedDownSystematics->Draw(
"2");
1204 gRAB_ElossHypothesis->SetLineColor(kMagenta-7);
1205 gRAB_ElossHypothesis->SetFillColor(kMagenta-7);
1206 gRAB_ElossHypothesis->SetFillStyle(1001);
1207 gRAB_ElossHypothesis->Draw(
"2");
1208 gRAB_FeedDownSystematicsElossHypothesis->SetLineColor(kBlack);
1209 gRAB_FeedDownSystematicsElossHypothesis->SetFillStyle(0);
1210 gRAB_FeedDownSystematicsElossHypothesis->SetFillColor(kViolet+1);
1211 gRAB_FeedDownSystematicsElossHypothesis->Draw(
"2");
1212 hRABvsPt->Draw(
"psame");
1213 legrcb =
new TLegend(0.6,0.6,0.9,0.9);
1214 legrcb->SetBorderSize(0);
1215 legrcb->SetTextSize(0.03389831);
1216 legrcb->SetLineColor(1);
1217 legrcb->SetLineStyle(1);
1218 legrcb->SetLineWidth(1);
1219 legrcb->SetFillColor(0);
1220 legrcb->SetFillStyle(1001);
1221 legrcb->AddEntry(hRABvsPt,
"R_{PbPb} and stat. unc.",
"pe");
1222 legrcb->AddEntry(gRAB_ElossHypothesis,
"Energy loss syst.",
"f");
1223 legrcb->AddEntry(gRAB_FeedDownSystematics,
"Feed down syst.",
"f");
1224 legrcb->AddEntry(gRAB_FeedDownSystematicsElossHypothesis,
"Feed down & Eloss syst.",
"f");
1226 RaaPlotFDEloss->Update();
1229 TCanvas *RaaPlotGlob =
new TCanvas(
"RaaPlotGlob",
"RAB vs pt, plot Global unc");
1230 RaaPlotGlob->SetTopMargin(0.085);
1231 RaaPlotGlob->SetBottomMargin(0.1);
1232 RaaPlotGlob->SetTickx();
1233 RaaPlotGlob->SetTicky();
1236 hRABvsPt->Draw(
"psame");
1237 gRAB_DataSystematics->Draw(
"2");
1238 gRAB_FeedDownSystematicsElossHypothesis->Draw(
"2");
1239 gRAB_GlobalSystematics->SetLineColor(kRed);
1240 gRAB_GlobalSystematics->SetLineWidth(2);
1241 gRAB_GlobalSystematics->SetFillColor(kRed);
1242 gRAB_GlobalSystematics->SetFillStyle(3002);
1243 gRAB_GlobalSystematics->Draw(
"2");
1244 hRABvsPt->Draw(
"psame");
1245 legrcb =
new TLegend(0.6,0.6,0.9,0.9);
1246 legrcb->SetBorderSize(0);
1247 legrcb->SetTextSize(0.03389831);
1248 legrcb->SetLineColor(1);
1249 legrcb->SetLineStyle(1);
1250 legrcb->SetLineWidth(1);
1251 legrcb->SetFillColor(0);
1252 legrcb->SetFillStyle(1001);
1253 legrcb->AddEntry(hRABvsPt,
"R_{PbPb} and stat. unc.",
"pe");
1254 legrcb->AddEntry(gRAB_DataSystematics,
"Data syst.",
"f");
1255 legrcb->AddEntry(gRAB_FeedDownSystematicsElossHypothesis,
"Feed down & Eloss syst.",
"f");
1256 legrcb->AddEntry(gRAB_GlobalSystematics,
"Global syst.",
"f");
1258 RaaPlotGlob->Update();
1262 TCanvas *RaaPlotSimple =
new TCanvas(
"RaaPlotSimple",
"RAB vs pt, plot Simple unc");
1263 RaaPlotSimple->SetTopMargin(0.085);
1264 RaaPlotSimple->SetBottomMargin(0.1);
1265 RaaPlotSimple->SetTickx();
1266 RaaPlotSimple->SetTicky();
1269 hRABvsPt->Draw(
"psame");
1270 gRAB_GlobalSystematics->SetLineColor(kBlue);
1271 gRAB_GlobalSystematics->SetLineWidth(2);
1272 gRAB_GlobalSystematics->SetFillStyle(0);
1273 gRAB_GlobalSystematics->Draw(
"2");
1274 gRAB_Norm->Draw(
"2");
1275 hRABvsPt->Draw(
"psame");
1276 legrcb =
new TLegend(0.5991379,0.6949153,0.8534483,0.8559322,NULL,
"brNDC");
1277 legrcb->SetBorderSize(0);
1278 legrcb->SetTextSize(0.03389831);
1279 legrcb->SetLineColor(1);
1280 legrcb->SetLineStyle(1);
1281 legrcb->SetLineWidth(1);
1282 legrcb->SetFillColor(0);
1283 legrcb->SetFillStyle(1001);
1284 if(
cc==
k020) legrcb->AddEntry(hRABvsPt,
"R_{AA} 0-20% CC",
"pe");
1285 else if(
cc==
k4080) legrcb->AddEntry(hRABvsPt,
"R_{AA} 40-80% CC",
"pe");
1286 else legrcb->AddEntry(hRABvsPt,
"R_{AA} and stat. unc.",
"pe");
1287 legrcb->AddEntry(gRAB_GlobalSystematics,
"Systematics",
"f");
1290 RaaPlotSimple->Update();
1293 TCanvas *
c =
new TCanvas(
"c",
"");
1297 TCanvas *cStatUnc =
new TCanvas(
"cStatUnc",
"stat unc");
1298 cStatUnc->Divide(2,2);
1300 fhStatUncEffcSigmaAB_Raa->Draw(
"e");
1302 fhStatUncEffbSigmaAB_Raa->Draw(
"e");
1304 fhStatUncEffcFDAB_Raa->Draw(
"e");
1306 fhStatUncEffbFDAB_Raa->Draw(
"e");
1312 cout<<endl<<
" Save results in the output file"<<endl<<endl;
1313 TFile * out =
new TFile(outfile,
"recreate");
1318 hRABCharmVsRBeautyVsPt->Write();
1319 for(
Int_t j=0; j<=
nbins; j++) hRCharmVsRBeauty[j]->Write();
1322 hRABvsPt_DataSystematics->Write();
1323 gRAB_ElossHypothesis->Write();
1324 gRAB_FeedDownSystematics->Write();
1325 gRAB_fcFeedDownOnly->Write();
1326 gRAB_DataSystematics->Write();
1327 gRAB_DataSystematicsPP->Write();
1328 gSigmaPPSystTheory->Write();
1329 gRAB_DataSystematicsAB->Write();
1331 gRAB_FeedDownSystematicsElossHypothesis->Write();
1332 gRAB_GlobalSystematics->Write();
1333 if(isScaledAndExtrapRef && hCombinedReferenceFlag) hCombinedReferenceFlag->Write();
1343 Double_t err=0., errUp=1., errDown=1.;
1354 if(pt<6) pidunc = 0.15;
1360 if(pt<3.1) pidunc = 0.10;
1366 else { isOk =
true; }
1368 dataSystUp = TMath::Sqrt(errUp);
1369 dataSystDown = TMath::Sqrt(errDown);
void SetCentrality(TString centrality)
void SetIsPbPb2010EnergyScan(Bool_t flag)
Int_t GetRunNumber() const
void SetIsPass4Analysis(Bool_t flag)
void HFPtSpectrumRaa(const char *ppfile="HFPtSpectrum_D0Kpi_method2_rebinnedth_230311_newsigma.root", const char *ABfile="HFPtSpectrum_D0Kpi_PbPbcuts_method2_rebinnedth_230311_newsigma.root", const char *outfile="HFPtSpectrumRaa.root", Int_t decay=1, Double_t sigmaABCINT1B=54.e9, Int_t fdMethod=kNb, Int_t cc=kpp, Int_t Energy=k276, Double_t MinHypo=1./3., Double_t MaxHypo=3.0, Double_t MaxRb=6.0, Bool_t isRbHypo=false, Double_t CentralHypo=1.0, Int_t ccestimator=kV0M, Bool_t isUseTaaForRaa=true, const char *shadRbcFile="", Int_t nSigmaShad=3.0, Int_t isRaavsEP=kPhiIntegrated, Bool_t isScaledAndExtrapRef=kFALSE, Int_t rapiditySlice=kdefault, Int_t analysisSpeciality=kTopological)
Double_t GetTotalSystErr(Double_t pt, Double_t feeddownErr=0) const
void SetIsLowPtAnalysis(Bool_t flag)
Double_t ExtractFDSyst(Double_t total, Double_t fd)
void Init(Int_t decay)
Function to initialize the variables/histograms.
void SetIspPb2011RapidityScan(Bool_t flag)
void SetCollisionType(Int_t type)
Bool_t PbPbDataSyst(AliHFSystErr *syst, Double_t pt, Int_t cc, Double_t &dataSystUp, Double_t &dataSystDown)
void DrawErrors(TGraphAsymmErrors *grErrFeeddown=0) const
Int_t FindGraphBin(TGraphAsymmErrors *gr, Double_t pt)
void SetRapidity(TString rapidity)
Settings of rapidity ranges for pPb 0-100% CC.
Int_t GetCollisionType() const
void SetRunNumber(Int_t number)
Double_t GetPIDEffErr(Double_t pt) const