config_loader
- class ConfigLoader(file_name, vm=None, share_dict=None)[source]
Bases:
BaseConfig
class for loading config.yml
- cal_bins_numbers(adapter, data, phsp, read_data, bg=None, bg_weight=None)
- cal_chi2(read_data=None, bins=[[2, 2], [2, 2], [2, 2]], mass=['R_BD', 'R_CD'])
- cal_fitfractions(params={}, mcdata=None, res=None, exclude_res=[], batch=25000, method='old')[source]
- fit(data=None, phsp=None, bg=None, inmc=None, batch=65000, method='BFGS', check_grad=False, improve=False, reweight=False, maxiter=None, jac=True, print_init_nll=True)[source]
- generate_phsp(N=1000, include_charge=False, cal_max=False)
- generate_phsp_p(N=1000, cal_max=False)
- generate_toy(N=1000, force=True, gen=None, gen_p=None, importance_f=None, max_N=100000, include_charge=False, cal_phsp_max=False)
A more accurate method for generating toy data.
- Parameters
N – number of events.
force – if romove extra data generated.
gen – optional function for generate phase space, the return value is same as config.get_data.
gen_p – optional function for generate phase space, the return value is dict as
{B: pb, C: pc, D: pd}
.max_N – max number of events for every try.
- generate_toy2(*args, **kwargs)
- generate_toy_o(N=1000, force=True, max_N=100000)
- generate_toy_p(N=1000, force=True, gen_p=None, importance_f=None, max_N=100000, include_charge=False, cal_phsp_max=False)
generate toy data momentum.
- get_chain_property(idx, display=True)
Get chain name and curve style in plot
- get_params_error(params=None, data=None, phsp=None, bg=None, inmc=None, batch=10000, using_cached=False, method=None, force_pos=True, correct_params=None)[source]
calculate parameters error
- get_particle_function(name, d_norm=False)
- get_phsp_generator(include_charge=False)
- get_phsp_p_generator(nodes=[])
- plot_partial_wave(params=None, data=None, phsp=None, bg=None, prefix='figure/', res=None, save_root=False, chains_id_method=None, **kwargs)
plot partial wave plots
- Parameters
self – ConfigLoader object
params – params, dict or FitResutls
data – data sample, a list of CalAngleData
phsp – phase space sample, a list of CalAngleData (the same size as data)
bg – background sample, a list of CalAngleData (the same size as data)
prefix – figure saving folder and nameing prefix
res – combination of resonaces in partial wave, list of (list of (string for resoances name or int for decay chain index))
save_root – if save weights in a root file, bool
chains_id_method – method of how legend label display, string
bin_scale – more binning in partial waves for a smooth histogram. int
batch – batching in calculating weights, int
smooth – if plot smooth binned kde shape or histogram, bool
single_legend – if save all legend in a file “legend.pdf”, bool
plot_pull – if plot the pull distribution, bool
format – save figure with image format, string (such as “.png”, “.jpeg”)
linestyle_file – legend linestyle configuration file name (YAML format), string (such as “legend.yml”)