本文整理汇总了Python中ROOT.RooDataSet.binnedClone方法的典型用法代码示例。如果您正苦于以下问题:Python RooDataSet.binnedClone方法的具体用法?Python RooDataSet.binnedClone怎么用?Python RooDataSet.binnedClone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ROOT.RooDataSet
的用法示例。
在下文中一共展示了RooDataSet.binnedClone方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: init_pdfs
# 需要导入模块: from ROOT import RooDataSet [as 别名]
# 或者: from ROOT.RooDataSet import binnedClone [as 别名]
#.........这里部分代码省略.........
_comp["title"]+"_comp_2",
fit.mass,
_comp_params.At(4),
_comp_params.At(5),
_comp_params.At(6),
_comp_params.At(7)
)
_funcs.Add(_f1)
_funcs.Add(_f2)
_pdf = RooFFTConvPdf(
_name,
_comp["title"],
fit.mass,
_f1,
_f2
)
_pdf.setBufferFraction(100.0)
_components.Add(_pdf)
elif _comp["type"] == "FFT_RooHistPdf_RooGaussian":
# Load reference ROOT tree
_ref_full_ch = TChain(_comp['config']['tree'])
_ref_full_ch.Add(_comp['config']['files'])
# Run selection
_ref_ch = _ref_full_ch.CopyTree(_comp['config']['selection'])
_bins = fit.mass.getBins()
fit.mass.setBins(_comp['config']['bins'])
# Create hist PDF
_data = RooDataSet(
'ds_' + _name,
'',
RooArgSet(fit.mass),
RooFit.Import(_ref_ch)
)
_hist = _data.binnedClone()
_f1 = RooHistPdf(
name+'_histpdf',
_comp['title']+'_histpdf',
RooArgSet(fit.mass),
_hist,
2 # Order of interpolation function
)
fit.mass.setBins(_bins)
# Define sampling frequency
fit.mass.setBins(10000,"fft") ;
_f2 = RooGaussModel(
_name+"_comp_2",
_comp["title"]+"_comp_2",
fit.mass,
_comp_params.At(0),
_comp_params.At(1)
)
_funcs.Add(_hist)
_funcs.Add(_f1)
_funcs.Add(_f2)
_pdf = RooFFTConvPdf(
_name,
_comp["title"],
fit.mass,
_f2,
_f1
)
_pdf.setBufferFraction(5.0)
_components.Add(_pdf)
elif _comp["type"] == "Conv_RooHistPdf_RooGaussian":
if 'config' not in _comp:
示例2: RooRealVar
# 需要导入模块: from ROOT import RooDataSet [as 别名]
# 或者: from ROOT.RooDataSet import binnedClone [as 别名]
sigma = RooRealVar( 'sigma', 'width of gaussian', 5.0 )
# Load reference ROOT tree
full_ch = TChain("DecayTree")
full_ch.Add("/mnt/home/kklimaszewski/LHCb/Bs2JpsieePhi/M_Bs_Fits/mc/DVNtuples_Bs2JpsieePhi_13154001_MCfull_R14ac_TupleBsDetached_PIDCorr_S21_NewSel_tupleB.root")
# Run selection
ch = full_ch.CopyTree("sigmam>0. && sigmam<250. && time>0.3 && time<14. && sigmat<0.12 && BDT_response_NewSel>0.2 && eminus_bremmult==0 && eplus_bremmult==0")
#fit.mass.setBins(_comp['config']['bins'])
# Create hist PDF
data = RooDataSet(
'data_set',
'',
RooArgSet(x),
RooFit.Import(ch)
)
hist = data.binnedClone()
p1 = RooHistPdf(
'histpdf',
'',
RooArgSet(x),
hist,
2 # Order of interpolation function
)
#p2 = RooGaussian(
p2 = RooGaussModel(
"comp_2",
"",
x,
mean,
sigma
)
示例3: RooAddPdf
# 需要导入模块: from ROOT import RooDataSet [as 别名]
# 或者: from ROOT.RooDataSet import binnedClone [as 别名]
resmodel, RooDecay.SingleSided)
decay = RooAddPdf('decay', 'Decay function for the B_{s}',
decayH, decayL, RooRealConstant.value(0.5))
decayargset = RooArgSet(decay)
# Get tree
rfile = get_file('data/smalltree-new-MC.root', 'read')
ftree = get_object('ftree', rfile)
# dt dataset for denom
trigger = 'HLT2Topo3BodyTOS'
triggerVar = RooRealVar(trigger, trigger, 0, 2)
cut = trigger+'>0'
tmpdtdataset = RooDataSet('dtdataset', 'dt dataset', RooArgSet(dt, triggerVar),
RooFit.Import(ftree), RooFit.Cut(cut))
dtdatahist = tmpdtdataset.binnedClone('dtdatahist', 'Binned dt')
dtdatahist = dtdatahist.reduce(dtargset)
errorPdf = RooHistPdf('errorPdf', 'Time error Hist PDF', dtargset, dtdatahist)
decaywdt = RooProdPdf('decaywdt', 'Decay function with dt distribution',
RooArgSet(errorPdf),
RooFit.Conditional(decayargset, timeargset))
del tmpdtdataset, dtdatahist
# Variable width binning
nbins1 = 50
nbins2 = 24
binedges1 = numpy.zeros(nbins1+1 , dtype=float)
binedges2 = numpy.zeros(nbins2+1 , dtype=float)
logwidth = log10((1E-2 + 2E-4) / 2E-4)