Beispiel #1
0
    split_cat = split_cats[0][0]
    if hasattr(split_cat, '_target_'):
        split_cat = split_cat._target_()
    means = [sig_sdata.mean(split_obs._target_(), '{0} == {0}::{1}'.format(split_cat.GetName(), s.GetName())) for s in split_cat]

    if options.sf_param or (options.mu_param and 'sigmat' not in options.mu_param):
        assert(len(split_cats[0]) == 1)

        ## The idea is to create a simultaneous PDF, split using the
        ## placeholder which was put in place when the resolution
        ## 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())