From 02594a839e8e17fdc8456f176b3b91a6299baf3e Mon Sep 17 00:00:00 2001 From: Fabio Catalano Date: Fri, 23 Apr 2021 09:53:23 +0200 Subject: [PATCH] Utility scripts for non-prompt studies + model predictions (#224) * Add GMVFNS predictions with two-step approach * Add NNLO predictions * Add utility scripts for non-prompt studies * remove NNLO --- models/GetFDCharmHadronComposition.py | 38 +++++++++ models/estimate_fonll_nonprompt_fractions.py | 80 +++++++++++++++++++ ...FNS-nonPromptDplus-pp5-y05-2Steps-2021.txt | 15 ++++ ...FNS-nonPromptDzero-pp5-y05-2Steps-2021.txt | 18 +++++ 4 files changed, 151 insertions(+) create mode 100644 models/GetFDCharmHadronComposition.py create mode 100644 models/estimate_fonll_nonprompt_fractions.py create mode 100644 models/gvmfs/GMVFNS-nonPromptDplus-pp5-y05-2Steps-2021.txt create mode 100644 models/gvmfs/GMVFNS-nonPromptDzero-pp5-y05-2Steps-2021.txt diff --git a/models/GetFDCharmHadronComposition.py b/models/GetFDCharmHadronComposition.py new file mode 100644 index 00000000..940a1afc --- /dev/null +++ b/models/GetFDCharmHadronComposition.py @@ -0,0 +1,38 @@ +''' +python script to get the fraction of the non-prompt charmed hadrons coming from each B hadron +''' + +import argparse +import numpy as np +from ROOT import TFile #pylint: disable=import-error,no-name-in-module + +parser = argparse.ArgumentParser(description='Arguments to pass') +parser.add_argument('inFileName', metavar='text', default='predictions.root', + help='input root or txt file with non-prompt FONLL predictions') +args = parser.parse_args() + +charmHadronNames = ['D0 ', 'Dplus', 'Ds ', 'Lc ', 'Dstar'] +beautyHadronNames = ['B0', 'Bplus', 'Bs', 'Lb'] +histNames = ['hBRHbtoD0', 'hBRHbtoDplus', 'hBRHbtoDs', 'hBRHbtoLc', 'hBRHbtoDstar'] + +brMatrix = np.zeros((len(charmHadronNames), len(beautyHadronNames))) +ffArray = np.zeros(len(beautyHadronNames)) + +#hHbFF +inFile = TFile.Open(args.inFileName) + +ffHisto = inFile.Get('hHbFF') +for iBin in range(ffHisto.GetNbinsX()): + ffArray[iBin] = ffHisto.GetBinContent(iBin+1) + +for iHadron, histName in enumerate(histNames): + histo = inFile.Get(histName) + for iBin in range(histo.GetNbinsX()): + brMatrix[iHadron][iBin] = histo.GetBinContent(iBin+1) + +contrMatrix = np.multiply(brMatrix, ffArray) +normContrMatrix = (contrMatrix.T/contrMatrix.sum(axis=1)).T + +print(' ', *beautyHadronNames, sep=' ') +for iHadron, hadronName in enumerate(charmHadronNames): + print(hadronName, normContrMatrix[iHadron]) diff --git a/models/estimate_fonll_nonprompt_fractions.py b/models/estimate_fonll_nonprompt_fractions.py new file mode 100644 index 00000000..96cc1658 --- /dev/null +++ b/models/estimate_fonll_nonprompt_fractions.py @@ -0,0 +1,80 @@ +""" +Utility script to estimate the "natural" non-prompt fraction from FONLL + PYTHIA8 +""" + +import sys +import numpy as np +from ROOT import TFile, TCanvas, TLegend #pylint: disable=import-error,no-name-in-module +from ROOT import kRed, kOrange, kGreen #pylint: disable=import-error,no-name-in-module +sys.path.append('..') +from utils.StyleFormatter import SetGlobalStyle, SetObjectStyle #pylint: disable=wrong-import-position,import-error + +def main(): #pylint: disable=too-many-statements + SetGlobalStyle(padleftmargin=0.18, padbottommargin=0.14, titleoffsety=1.6, maxdigits=2, optstat=0) + + inFileFONLL = TFile.Open('fonll/feeddown/DmesonLcPredictions_502TeV_y05_FFee_BRpythia8_SepContr_PDG2020.root') + hFONLLPromptD0 = inFileFONLL.Get('hD0Kpipred_max') + hFONLLPromptDplus = inFileFONLL.Get('hDpluskpipipred_max') + hFONLLPromptDs = inFileFONLL.Get('hDsPhipitoKkpipred_max') + hFONLLNonPromptD0 = inFileFONLL.Get('hD0KpifromBpred_central_corr') + hFONLLNonPromptDplus = inFileFONLL.Get('hDpluskpipifromBpred_central_corr') + hFONLLNonPromptDs = inFileFONLL.Get('hDsPhipitoKkpifromBpred_central_corr') + + binLims = np.array([0., 1., 2., 3., 4., 5., 6., 7., 8., 10., 12., 16., 24.], 'd') + nBins = 12 + + hFONLLPromptD0 = hFONLLPromptD0.Rebin(nBins, 'hFONLLPromptD0', binLims) + hFONLLPromptDplus = hFONLLPromptDplus.Rebin(nBins, 'hFONLLPromptDplus', binLims) + hFONLLPromptDs = hFONLLPromptDs.Rebin(nBins, 'hFONLLPromptDs', binLims) + hFONLLNonPromptD0 = hFONLLNonPromptD0.Rebin(nBins, 'hFONLLNonPromptD0', binLims) + hFONLLNonPromptDplus = hFONLLNonPromptDplus.Rebin(nBins, 'hFONLLNonPromptDplus', binLims) + hFONLLNonPromptDs = hFONLLNonPromptDs.Rebin(nBins, 'hFONLLNonPromptDs', binLims) + + hFONLLNPfracD0 = hFONLLPromptD0.Clone('hFONLLNPfracD0') + hFONLLNPfracD0.Divide(hFONLLNonPromptD0, hFONLLNPfracD0) + hFONLLNPfracDplus = hFONLLPromptDplus.Clone('hFONLLNPfracDplus') + hFONLLNPfracDplus.Divide(hFONLLNonPromptDplus, hFONLLNPfracDplus) + hFONLLNPfracDs = hFONLLPromptDs.Clone('hFONLLNPfracDs') + hFONLLNPfracDs.Divide(hFONLLNonPromptDs, hFONLLNPfracDs) + + SetObjectStyle(hFONLLNPfracD0, color=kRed, linewitdh=2, markerstyle=0, fillstyle=0) + SetObjectStyle(hFONLLNPfracDplus, color=kGreen, linewitdh=2, markerstyle=0, fillstyle=0) + SetObjectStyle(hFONLLNPfracDs, color=kOrange, linewitdh=2, markerstyle=0, fillstyle=0) + + mesonList = ['D0', 'D+', 'Ds'] + histoList = [hFONLLNPfracD0, hFONLLNPfracDplus, hFONLLNPfracDs] + + print(*binLims, sep=' ') + for meson, histo in zip(mesonList, histoList): + valueList = [] + for iBin in range(1, nBins + 1): + valueList.append(f'{histo.GetBinContent(iBin):.3f}') + print(meson) + print(*valueList, sep=' ') + + legMeson = TLegend(0.65, 0.6, 0.85, 0.8) + legMeson.SetTextSize(0.04) + legMeson.SetFillStyle(0) + legMeson.AddEntry(hFONLLNPfracD0, 'D^{0}', 'l') + legMeson.AddEntry(hFONLLNPfracDplus, 'D^{+}', 'l') + legMeson.AddEntry(hFONLLNPfracDs, 'D_{s}^{+}', 'l') + + cFrac = TCanvas('cFrac', '', 500, 500) + hFrame = cFrac.DrawFrame(0., 0.01, 24., 1.05, ';#it{p}_{T} (GeV/#it{c}); #it{f}_{non-prompt}') + hFrame.GetYaxis().SetDecimals() + hFrame.Draw('axis same') + hFONLLNPfracD0.Draw('same') + hFONLLNPfracDplus.Draw('same') + hFONLLNPfracDs.Draw('same') + legMeson.Draw('same') + cFrac.Update() + + TFile('./NaturalNonPromptFrac_FONLL_FFee_BRpythia8.root', 'recreate') + hFONLLNPfracD0.Write() + hFONLLNPfracDplus.Write() + hFONLLNPfracDs.Write() + cFrac.Write() + + input('Press enter to exit') + +main() diff --git a/models/gvmfs/GMVFNS-nonPromptDplus-pp5-y05-2Steps-2021.txt b/models/gvmfs/GMVFNS-nonPromptDplus-pp5-y05-2Steps-2021.txt new file mode 100644 index 00000000..1384d1a2 --- /dev/null +++ b/models/gvmfs/GMVFNS-nonPromptDplus-pp5-y05-2Steps-2021.txt @@ -0,0 +1,15 @@ +#pp -> Dplus+X from pp -> b-quark +#(using the two-step approach Bolzoni, Kramer, J.Phys.G 41 (2014) 075006) +#for ALICE at 5.02 TeV +#CT14nlo, m_b = 4.5 GeV, m_c = 1.3 GeV +#sig-min/max from varying renormalization scale by factors 1/2-2 (nb/GeV) + +pTmin pTmax cen min max +2.00 3.00 8.1497E+02 6.0081E+02 1.1792E+03 +3.00 4.00 4.0445E+02 2.9910E+02 5.8251E+02 +4.00 5.00 2.3112E+02 1.7164E+02 3.3081E+02 +5.00 6.00 1.3774E+02 1.0350E+02 1.9385E+02 +6.00 8.00 7.0719E+01 5.4000E+01 9.7244E+01 +8.00 10.00 3.0133E+01 2.3535E+01 4.0089E+01 +10.00 12.00 1.4078E+01 1.1240E+01 1.8133E+01 +12.00 16.00 5.5852E+00 4.5651E+00 6.9491E+00 diff --git a/models/gvmfs/GMVFNS-nonPromptDzero-pp5-y05-2Steps-2021.txt b/models/gvmfs/GMVFNS-nonPromptDzero-pp5-y05-2Steps-2021.txt new file mode 100644 index 00000000..0d492c8c --- /dev/null +++ b/models/gvmfs/GMVFNS-nonPromptDzero-pp5-y05-2Steps-2021.txt @@ -0,0 +1,18 @@ +#pp -> D0+X from pp -> b-quark +#(using the two-step approach Bolzoni, Kramer, J.Phys.G 41 (2014) 075006) +#for ALICE at 5.02 TeV +#CT14nlo, m_b = 4.5 GeV, m_c = 1.3 GeV +#sig-min/max from varying renormalization scale by factors 1/2-2 (nb/GeV) + +pTmin pTmax cen min max +1.00 2.00 4.2973E+03 3.1851E+03 6.1719E+03 +2.00 3.00 2.1125E+03 1.5453E+03 3.0562E+03 +3.00 4.00 1.0598E+03 7.7617E+02 1.5379E+03 +4.00 5.00 5.8139E+02 4.2811E+02 8.3531E+02 +5.00 6.00 3.3950E+02 2.5758E+02 4.7889E+02 +6.00 7.00 2.1198E+02 1.6094E+02 2.9442E+02 +7.00 8.00 1.3360E+02 1.0284E+02 1.8207E+02 +8.00 10.00 7.2144E+01 5.6764E+01 9.5963E+01 +10.00 12.00 3.3512E+01 2.6667E+01 4.3157E+01 +12.00 16.00 1.3045E+01 1.0696E+01 1.6161E+01 +16.00 24.00 2.9370E+00 2.4936E+00 3.4488E+00