gen_from_toy¶
Documentation for the utilities.gen_from_toy.gen_from_toy function:
- utilities.gen_from_toy.gen_from_toy(filepaths_in=('../data/root_files/toyMC_B0PiPi.root', '../data/root_files/toyMC_B0sKK.root'), filepaths_out=('/home/docs/checkouts/readthedocs.org/user_builds/cmepda-pikclassifier/checkouts/latest/utilities/../data/root_files/B0PiPi_MC.root', '/home/docs/checkouts/readthedocs.org/user_builds/cmepda-pikclassifier/checkouts/latest/utilities/../data/root_files/B0sKK_MC.root', '/home/docs/checkouts/readthedocs.org/user_builds/cmepda-pikclassifier/checkouts/latest/utilities/../data/root_files/Bhh_data.root'), tree='t_M0pipi;1', num_mc=0, num_data=0, fraction=0.42, vars=('M0_Mpipi', 'M0_MKK', 'M0_MKpi', 'M0_MpiK', 'M0_p', 'M0_pt', 'M0_eta', 'h1_thetaC0', 'h1_thetaC1', 'h1_thetaC2', 'h2_thetaC0', 'h2_thetaC1', 'h2_thetaC2'))[source]¶
Generates mixed signal+background datasets to be analysed, starting from two root files of toy events of background only and signal only processes respectively.
- Parameters:
filepaths_in (list[str] or tuple[str]) – 2 element tuple with path to the two toys, first being background, the second being signal species.
filepaths_out (list[str] or tuple[str]) – Three element tuple of .root file paths. The first should indicate the root file containing the “background” species (flag=0), the second the “signal” species (flag=1), the third the data mix to be generated.
tree (str) – Name of the tree in which the desired variables are stored in the toy files (must be the same for both files).
num_mc (int) – Number of events generated for each output MC file. If both
num_mcand ``num_data` are set to zero the maximum possible number of events is extracted from the toysnum_data (int) – Number of events generated for the output data file (mixed). If both
num_mcand ``num_data` are set to zero the maximum possible number of events is extracted from the toysfraction (double) – Ideal fraction of signal events in the generated mixed sample. Actual fraction will be different if fraction*num_data is not an integer.
vars (list[str] or tuple[str]) – List or tuple of variables to export from the toy files.