1 #if !defined(__CINT__) || defined(__MAKECINT__) 8 #include "TGraphAsymmErrors.h" 34 TH2F *hdraw =
new TH2F(
"hdraw",
"fprompt vs pt; p_{T} (GeV/c); f_{prompt}",36,0.,36.,10.,0.,1);
37 cout<<endl<<endl<<
" ********* Checking Nb method ********* "<<endl<<endl;
39 gfPromptNb->SetNameTitle(
"gfPromptNb",
"fprompt Nb method, Eloss range considered");
40 gfPromptNb->SetLineColor(kBlack);
41 gfPromptNb->SetMarkerColor(kGreen+2);
42 gfPromptNb->SetMarkerStyle(25);
43 gfPromptNb->Draw(
"P");
45 cout<<endl<<endl<<
" ********* Checking fc method ********* "<<endl<<endl;
47 gfPromptfc->SetNameTitle(
"gfPromptfc",
"fprompt fc method, Eloss range considered");
48 gfPromptfc->SetLineColor(kBlack);
49 gfPromptfc->SetMarkerColor(kRed);
50 gfPromptfc->SetMarkerStyle(21);
51 gfPromptfc->Draw(
"P");
53 cout<<endl<<endl<<
" ********* Computing the envelope ******** "<<endl<<endl;
55 gFPromptCombined->SetNameTitle(
"gFPromptCombined",
"fprompt Nb + fc, Eloss range considered");
59 Double_t pt=0.,value=0.,ptfc=0.,valuefc=0.,exlow=0.,eylow=0.,eyNblow=0.,eyfclow=0.,eyhigh=0.,eyNbhigh=0.,eyfchigh=0.;
60 gfPromptNb->GetPoint(i,pt,value);
61 gfPromptfc->GetPoint(i,ptfc,valuefc);
62 exlow = gfPromptNb->GetErrorXlow(i);
63 eyNblow = gfPromptNb->GetErrorYlow(i);
64 eyNbhigh = gfPromptNb->GetErrorYhigh(i);
65 eyfclow = gfPromptfc->GetErrorYlow(i);
66 eyfchigh = gfPromptfc->GetErrorYhigh(i);
67 Double_t uncertainties[5]={ value, value-eyNblow, value+eyNbhigh, valuefc-eyfclow, valuefc+eyfchigh };
68 eylow = value - TMath::MinElement(5,uncertainties);
69 eyhigh = TMath::MaxElement(5,uncertainties) - value;
70 gFPromptCombined->SetPoint(i,pt,value);
71 gFPromptCombined->SetPointError(i,exlow,exlow,eylow,eyhigh);
74 gFPromptCombined->SetFillStyle(0);
75 gFPromptCombined->SetLineColor(kBlack);
76 gFPromptCombined->SetMarkerColor(kBlack);
77 gFPromptCombined->SetMarkerStyle(20);
78 gFPromptCombined->Draw(
"2P");
82 TFile*
fout=
new TFile(outfile,
"recreate");
85 gFPromptCombined->Write();
95 Float_t pt=0.,TAB=0.,sigmaPP=0.,invyieldAB=0.,RaaCharm=0.,RaaBeauty=0., fc=0.;
96 Float_t yieldFdHigh=0., yieldFdLow=0.,RaaCharmFdHigh=0.,RaaCharmFdLow=0.;
98 TFile *fRaa =
new TFile(infile,
"read");
99 TH1D *hRABvsPt = (
TH1D*)fRaa->Get(
"hRABvsPt");
100 TNtuple *ntRaa = (TNtuple*)fRaa->Get(
"ntupleRAB");
101 ntRaa->SetBranchAddress(
"pt",&pt);
102 ntRaa->SetBranchAddress(
"TAB",&TAB);
103 ntRaa->SetBranchAddress(
"sigmaPP",&sigmaPP);
104 ntRaa->SetBranchAddress(
"invyieldAB",&invyieldAB);
105 ntRaa->SetBranchAddress(
"RABCharm",&RaaCharm);
106 ntRaa->SetBranchAddress(
"RABBeauty",&RaaBeauty);
107 ntRaa->SetBranchAddress(
"RABCharmFDHigh",&RaaCharmFdHigh);
108 ntRaa->SetBranchAddress(
"RABCharmFDLow",&RaaCharmFdLow);
109 ntRaa->SetBranchAddress(
"invyieldABFDHigh",&yieldFdHigh);
110 ntRaa->SetBranchAddress(
"invyieldABFDLow",&yieldFdLow);
111 ntRaa->SetBranchAddress(
"fc",&fc);
121 Double_t fcV[nbins+1], fcVmax[nbins+1], fcVmin[nbins+1];
122 Double_t fdMax[nbins+1], fdMin[nbins+1];
125 fcV[i]=0.; fcVmax[i]=0.; fcVmin[i]=6.;
126 fdMax[i]=0.; fdMin[i]=6.;
129 Int_t netries = ntRaa->GetEntries();
131 for(
Int_t ientry=0; ientry<=netries; ientry++){
132 ntRaa->GetEntry(ientry);
133 Double_t ElossHypo = 1. / (RaaCharm / RaaBeauty) ;
137 if( TMath::Abs( ElossHypo - CentralHypo ) < 0.075 ){
138 Int_t hABbin = hRABvsPt->FindBin( pt );
139 Double_t DeltaIni = TMath::Abs( ElossCentral[ hABbin ] - CentralHypo );
140 Double_t DeltaV = TMath::Abs( ElossHypo - CentralHypo );
142 if ( DeltaV < DeltaIni ) ElossCentral[ hABbin ] = ElossHypo;
148 for(
Int_t ientry=0; ientry<=netries; ientry++){
150 ntRaa->GetEntry(ientry);
151 Double_t ElossHypo = 1. / (RaaCharm / RaaBeauty) ;
152 Int_t hABbin = hRABvsPt->FindBin( pt );
155 if ( ElossHypo == ElossCentral[ hABbin ] ) {
165 elems[1]=yieldFdHigh;
169 elems[1]=RaaCharmFdHigh;
170 elems[2]=RaaCharmFdLow;
172 fdMax[hABbin]= (TMath::MaxElement(3,elems)-elems[0])/elems[0];
173 fdMin[hABbin]= (elems[0]-TMath::MinElement(3,elems))/elems[0];
178 if( RaaCharm>0 && ElossHypo >= MinHypo && ElossHypo <=MaxHypo ) {
179 if( fc < fcVmin[hABbin] ) fcVmin[hABbin] = fc;
180 if( fc > fcVmax[hABbin] ) fcVmax[hABbin] = fc;
187 Double_t xpt = hRABvsPt->GetBinCenter(i);
188 Double_t width = hRABvsPt->GetBinWidth(i)/2;
189 Double_t elossLow = (fcV[i]-fcVmin[i])/fcV[i];
190 Double_t elossHigh = (fcVmax[i]-fcV[i])/fcV[i];
196 fcLow = TMath::Sqrt( fdMin[i]*fdMin[i] + elossLow*elossLow )*fcV[i];
197 fcHigh = TMath::Sqrt( fdMax[i]*fdMax[i] + elossHigh*elossHigh )*fcV[i];
199 fcLow = ( fdMin[i] + elossLow )*fcV[i];
200 fcHigh = ( fdMax[i] + elossHigh )*fcV[i];
203 gFPrompt->SetPoint(j,xpt,fcV[i]);
205 gFPrompt->SetPointError(j,width,width,fcLow,fcHigh);
208 cout<<
" pt="<<xpt<<
" , fprompt="<<fcV[i]<<
" +"<<fcHigh<<
" -"<<fcLow<<
" ( splitted it is +"<<elossLow*fcV[i]<<
" -"<<elossHigh*fcV[i]<<
" Eloss, +"<<fdMax[i]*fcV[i]<<
" -"<<fdMin[i]*fcV[i]<<
" FONLL-band )"<<endl;
TGraphAsymmErrors * DrawFpromptVsRaaElossHypo(const char *infile="", Double_t MinHypo=1./3., Double_t MaxHypo=3.0, Double_t CentralHypo=1.0, Bool_t isYieldUnc=true)
void DrawFpromptVsRaaElossHypoCombined(const char *infileNb="", const char *infilefc="", const char *outfile="", Double_t MinHypo=1./3., Double_t MaxHypo=3.0, Double_t CentralHypo=1.0, Bool_t isYieldUnc=true)
TFile * fout
input train file