Beispiel #1
0

    # //////////////////////////////////////////////////////////////////////
    # For each trial, generate two pseudo-data experiemnts (one for each
    # hierarchy), and for each find the best matching template in each of the
    # hierarchy hypothesis.
    # //////////////////////////////////////////////////////////////////////
    results = {}
    for data_tag, data_normal in [('data_NMH',True),('data_IMH',False)]:

        results[data_tag] = {}
        # 0) get a random seed and store with the data
        results[data_tag]['seed'] = get_seed()
        # 1) get a pseudo data fmap from fiducial model (best fit vals of params).
        fmap = get_pseudo_data_fmap(template_maker,
                                    get_values(select_hierarchy(params,
                                                                normal_hierarchy=data_normal)),
                                    seed=results[data_tag]['seed'])

        # 2) find max llh (and best fit free params) from matching pseudo data
        #    to templates.
        for hypo_tag, hypo_normal in [('hypo_NMH',True),('hypo_IMH',False)]:

            physics.info("Finding best fit for %s under %s assumption"%(data_tag,hypo_tag))
            profile.info("start optimizer")
            llh_data = find_max_llh_bfgs(fmap,template_maker,params,
                                        minimizer_settings,args.save_steps,normal_hierarchy=hypo_normal)
            profile.info("stop optimizer")

            #Store the LLH data
            results[data_tag][hypo_tag] = llh_data
Beispiel #2
0
for itrial in xrange(1, args.ntrials + 1):
    profile.info("start trial %d" % itrial)
    logging.info(">" * 10 + "Running trial: %05d" % itrial + "<" * 10)

    # //////////////////////////////////////////////////////////////////////
    # For each trial, generate two pseudo-data experiemnts (one for each
    # hierarchy), and for each find the best matching template in each of the
    # hierarchy hypothesis.
    # //////////////////////////////////////////////////////////////////////
    results = {}
    for data_tag, data_normal in [("data_NMH", True), ("data_IMH", False)]:

        results[data_tag] = {}
        # 1) get a pseudo data fmap from fiducial model (best fit vals of params).
        fmap = get_pseudo_data_fmap(template_maker, get_values(select_hierarchy(params, normal_hierarchy=data_normal)))

        # 2) find max llh (and best fit free params) from matching pseudo data
        #    to templates.
        for hypo_tag, hypo_normal in [("hypo_NMH", True), ("hypo_IMH", False)]:

            physics.info("Finding best fit for %s under %s assumption" % (data_tag, hypo_tag))
            profile.info("start scan")
            llh_data = find_max_grid(
                fmap, template_maker, params, grid_settings, args.save_steps, normal_hierarchy=hypo_normal
            )
            profile.info("stop scan")

            # Store the LLH data
            results[data_tag][hypo_tag] = llh_data
Beispiel #3
0
        # For each trial, generate two pseudo-data experiemnts (one for each
        # hierarchy), and for each find the best matching template in each of the
        # hierarchy hypotheses.
        # //////////////////////////////////////////////////////////////////////
        results = {}
        for data_tag, data_normal in [('data_NMH', True), ('data_IMH', False)]:

            results[data_tag] = {}
            # 0) get a random seed and store with the data
            results[data_tag]['seed'] = get_seed()
            logging.info("  RNG seed: %ld" % results[data_tag]['seed'])
            # 1) get a pseudo data fmap from fiducial model (best fit vals of params).
            fmap = get_pseudo_data_fmap(pseudo_data_template_maker,
                                        get_values(
                                            select_hierarchy(
                                                pseudo_data_settings['params'],
                                                normal_hierarchy=data_normal)),
                                        seed=results[data_tag]['seed'],
                                        chan=channel)

            # 2) find max llh (and best fit free params) from matching pseudo data
            #    to templates.
            for hypo_tag, hypo_normal in [('hypo_NMH', True),
                                          ('hypo_IMH', False)]:

                physics.info("Finding best fit for %s under %s assumption" %
                             (data_tag, hypo_tag))
                with Timer() as t:
                    llh_data = find_max_llh_bfgs(fmap,
                                                 template_maker,
                                                 template_settings['params'],
Beispiel #4
0
        # //////////////////////////////////////////////////////////////////////
        # For each trial, generate two pseudo-data experiemnts (one for each
        # hierarchy), and for each find the best matching template in each of the
        # hierarchy hypotheses.
        # //////////////////////////////////////////////////////////////////////
        results = {}
        for data_tag, data_normal in [('data_NMH',True),('data_IMH',False)]:

            results[data_tag] = {}
            # 0) get a random seed and store with the data
            results[data_tag]['seed'] = get_seed()
            logging.info("  RNG seed: %ld"%results[data_tag]['seed'])
            # 1) get a pseudo data fmap from fiducial model (best fit vals of params).
            fmap = get_pseudo_data_fmap(
                pseudo_data_template_maker,
                get_values(select_hierarchy(pseudo_data_settings['params'],
                                            normal_hierarchy=data_normal)),
                seed=results[data_tag]['seed'],chan=channel)

            # 2) find max llh (and best fit free params) from matching pseudo data
            #    to templates.
            for hypo_tag, hypo_normal in [('hypo_NMH',True),('hypo_IMH',False)]:

                physics.info("Finding best fit for %s under %s assumption"%(data_tag,hypo_tag))
                with Timer() as t:
                    llh_data = find_max_llh_bfgs(fmap,template_maker,template_settings['params'],
                                                 minimizer_settings,args.save_steps,
                                                 normal_hierarchy=hypo_normal)
                profile.info("==> elapsed time for optimizer: %s sec"%t.secs)

                # Store the LLH data
Beispiel #5
0
    logging.info(">"*10 + "Running trial: %05d"%itrial + "<"*10)


    # //////////////////////////////////////////////////////////////////////
    # For each trial, generate two pseudo-data experiemnts (one for each
    # hierarchy), and for each find the best matching template in each of the
    # hierarchy hypothesis.
    # //////////////////////////////////////////////////////////////////////
    results = {}
    for data_tag, data_normal in [('data_NMH',True),('data_IMH',False)]:

        results[data_tag] = {}
        # 1) get a pseudo data fmap from fiducial model (best fit vals of params).
        fiducial_param_values = get_values(select_hierarchy(params, normal_hierarchy=data_normal))
        fmap = get_pseudo_data_fmap(template_maker=template_maker,
                                    fiducial_params=fiducial_param_values,
                                    channel=fiducial_param_values['channel'])

        # 2) find max llh (and best fit free params) from matching pseudo data
        #    to templates.
        for hypo_tag, hypo_normal in [('hypo_NMH',True),('hypo_IMH',False)]:
            physics.info("Finding best fit for %s under %s assumption"%(data_tag,hypo_tag))
            profile.info("start scan")
            llh_data = find_max_grid(fmap=fmap,
                                     template_maker=template_maker,
                                     params=params,
                                     grid_settings=grid_settings,
                                     save_steps=args.save_steps,
                                     normal_hierarchy=hypo_normal)
            profile.info("stop scan")
Beispiel #6
0
for itrial in xrange(1, args.ntrials + 1):
    profile.info("start trial %d" % itrial)
    logging.info(">" * 10 + "Running trial: %05d" % itrial + "<" * 10)

    # //////////////////////////////////////////////////////////////////////
    # For each trial, generate two pseudo-data experiemnts (one for each
    # hierarchy), and for each find the best matching template in each of the
    # hierarchy hypothesis.
    # //////////////////////////////////////////////////////////////////////
    results = {}
    for data_tag, data_normal in [('data_NMH', True), ('data_IMH', False)]:

        results[data_tag] = {}
        # 1) get a pseudo data fmap from fiducial model (best fit vals of params).
        fmap = get_pseudo_data_fmap(
            template_maker,
            get_values(select_hierarchy(params, normal_hierarchy=data_normal)))

        # 2) find max llh (and best fit free params) from matching pseudo data
        #    to templates.
        for hypo_tag, hypo_normal in [('hypo_NMH', True), ('hypo_IMH', False)]:

            physics.info("Finding best fit for %s under %s assumption" %
                         (data_tag, hypo_tag))
            profile.info("start scan")
            llh_data = find_max_grid(fmap,
                                     template_maker,
                                     params,
                                     grid_settings,
                                     args.save_steps,
                                     normal_hierarchy=hypo_normal)