## model was constructed and then in each bin set the created ## split parameter to: (mean_in_bin - overall_mean. ## Set the value to the mean sigmat already here, even if it is changed ## later. placeholder = sig_tres.sfPlaceHolder() placeholder.setVal(split_obs_mean) ## Customize the PDF to be split using the placeholder and any other ## pars which need to be split. from ROOT import RooCustomizer customizer = RooCustomizer(time_pdf._target_(), split_cat, splitLeaves) to_split = RooArgSet(*(split_pars[0])) ## CAREFULL: when do we need this? ## to_split.add(placeholder._target_()) customizer.splitArgs(to_split, split_cat) states = dict([(s.GetName(), customizer.build(s.GetName())) for s in split_cat]) time_pdf = SimultaneousPdf(time_pdf.GetName() + '_simul', SplitCategory = split_cat, ExternalConstraints = time_pdf.ExternalConstraints(), States = states, ConditionalObservables = time_pdf.ConditionalObservables()) ## Set the split parameters to their calculated value and make ## them constant. st_mean = lambda st: 0.04921 + st * 1.220 st_sigma = lambda st: 0.012 + st * 0.165 pars = time_pdf.getParameters(RooArgSet()) for m, s in zip(means, split_cat): for n, f in (('timeResSFMean', st_mean), ('timeResSFSigma', st_sigma)): p = pars.find(n + '_' + s.GetName())