def add_xH_Yukawa(real_args): args = copy.deepcopy(real_args) for dc in ['hgg', 'hzz', 'combination']: if dc == 'combination': continue differentialutils.set_one_decay_channel(args, dc) card = LatestPaths.card.yukawa_noXHunc[dc] add_xH_nuisance_parameter(card, 24, 20, 43)
def scan_top_radialpoints(args): args = differentialutils.set_one_decay_channel(args, 'combWithHbb', asimov=True) config = basic_config_points(args) config.datacard = 'out/workspaces_May22/combWithHbb_Top_reweighted_scalingttH_floatingBRs.root' config.make_unique_directory() pointsscan = differentials.combine.combine.CombineScanSinglePoints(config) pointsscan.add_point(ct=1.0, cg=0.0) # pointsscan.add_point(ct = 4.0, cg = -0.27) # pointsscan.add_point(ct = 4.0, cg = -0.25) # pointsscan.add_point(ct = 4.0, cg = -0.23) # pointsscan.add_point(ct = 4.0, cg = -0.20) # pointsscan.add_point(ct = 3.0, cg = -0.05) # pointsscan.add_point(ct = 3.0, cg = 0.05) # pointsscan.add_point(ct = 1.0, cg = 0.1) # pointsscan.add_point(ct = 0.0, cg = 0.3) # pointsscan.add_point(ct = -0.25, cg = 0.3) # pointsscan.add_point(ct = -0.5, cg = 0.3) # pointsscan.add_point(ct = -0.75, cg = 0.3) # pointsscan.add_point(ct = -1.0, cg = 0.3) # pointsscan.add_point(ct = -1.25, cg = 0.3) # pointsscan.add_point(ct = -1.5, cg = 0.3) # pointsscan.add_point(ct = -2.0, cg = 0.3) pointsscan.run()
def scan_yukawa_oneKappa(args): args = differentialutils.set_one_decay_channel(args, 'combination') for kappa in [ # 'kappac', 'kappab' ]: config = basic_config(args) config.datacard = LatestPaths.ws.yukawa.nominal[config.decay_channel] config.nPoints = 72 config.nPointsPerJob = 3 config.queue = 'short.q' config.POIs = [ kappa ] otherKappa = { 'kappab' : 'kappac', 'kappac' : 'kappab' }[kappa] config.floatNuisances.append(otherKappa) config.tags.append('oneKappa_' + kappa) for i, range_str in enumerate(config.PhysicsModelParameterRanges): if range_str.startswith('kappab'): config.PhysicsModelParameterRanges[i] = 'kappab={0},{1}'.format(-7.0, 9.0) if kappa == 'kappab': config.nPoints = 80 config.nPointsPerJob = 2 if args.lumiScale: config.datacard = 'out/workspaces_Feb12/combinedCard_Nov03_CouplingModel_Yukawa_withTheoryUncertainties_lumiScale.root' config.freezeNuisances.append('lumiScale') config.tags.append('lumi300fb') config.hardPhysicsModelParameters.append( 'lumiScale=8.356546' ) differentialutils.scan_directly(config)
def t2ws_Yukawa_G1B_reweighted_noTheoryUnc(args): args = differentialutils.set_one_decay_channel(args, 'combination', asimov=True) t2ws = base_t2ws_fitOnlyTotalXS(args, apply_reweighting=True, apply_theory_uncertainties=False) t2ws.tags.append('G1B') t2ws.tags.append('noTheoryUnc') t2ws.extra_options.append('--PO BRs_kappa_dependent=True') t2ws.run()
def scan_top_scalingttH_cgonly(args): args = differentialutils.set_one_decay_channel(args, 'combWithHbb') config = basic_config(args) # config.datacard = 'out/workspaces_May17/combWithHbb_Top_reweighted_scalingttH.root' config.datacard = 'out/workspaces_May22/combWithHbb_Top_reweighted_scalingttH_floatingBRs.root' config.tags.append('scalingttH') config.tags.append('cgonly') config.suppress_output = True config.queue = 'short.q' config.FLOAT_OTHER_POIS = False config.del_parameter_range('ct') config.del_poi('ct') config.set_parameter('ct', 1.0, hard=True) config.freeze_parameter('ct') if args.asimov: config.set_parameter_range('cg', -1.6, 0.2) else: config.set_parameter_range('cg', -0.1, 0.4) config.nPoints = 25 config.nPointsPerJob = 1 # differentialutils.run_postfit_fastscan_scan(config) differentialutils.run_postfit_scan( config, postfit_file= 'out/Scan_May25_Top_combWithHbb_scalingttH_cgonly_asimov/postfit_and_fastscan/higgsCombine_POSTFIT_ASIMOV_combWithHbb_Top_reweighted_scalingttH_floatingBRs.MultiDimFit.mH125.root' )
def combine_all_cards(args): args = differentialutils.set_one_decay_channel(args, 'combination') # combine_pth_ggH(args) # combine_pth_smH(args) combine_njets(args) combine_ptjet(args) combine_rapidity(args)
def scan_yukawa_G1A(args): args = differentialutils.set_one_decay_channel(args, 'combination', asimov=True) config = basic_config(args) config.set_parameter_range('kappab', -7., 7.) config.set_parameter_range('kappac', -14., 14.) config.tags.append('G1A') config.datacard = yukawa_G.G1A differentialutils.run_postfit_fastscan_scan(config)
def projection_postfit_hbb_300ifb(args): decay_channel = 'hbb' args = differentialutils.set_one_decay_channel(args, decay_channel, asimov=True) ws = scenario1[decay_channel] config = differential_config(args, ws, 'pth_smH', lumiscale=lumiscale300) only_postfit(args, config)
def scan_yukawa_G0B(args): args = differentialutils.set_one_decay_channel(args, 'combination', asimov=True) config = basic_config(args) config.queue = 'short.q' config.nPointsPerJob = 600 config.tags.append('G0B') config.datacard = yukawa_G.G0B differentialutils.run_postfit_fastscan_scan(config)
def t2ws_Yukawa_G0A_reweighted_scaledByMuTotalXS(args): # Basically nominal, but force asimov and hzz args = differentialutils.set_one_decay_channel(args, 'combination', asimov=True) t2ws = base_t2ws(args) t2ws.tags.append('G0A') t2ws.tags.append('scaledByMuTotalXS') t2ws.extra_options.append('--PO scale_with_mu_totalXS=True') t2ws.run()
def scan_yukawa_G2A(args): args = differentialutils.set_one_decay_channel(args, 'combination', asimov=True) config = basic_config(args) config.nPoints = 50*50 config.set_parameter_range('kappab', -40., 40.) config.set_parameter_range('kappac', -70., 70.) config.tags.append('G2A') config.datacard = yukawa_G.G2A differentialutils.run_postfit_scan(config)
def scan_yukawa_G1B(args): args = differentialutils.set_one_decay_channel(args, 'combination', asimov=True) config = basic_config(args) config.queue = 'short.q' config.nPointsPerJob = 600 config.set_parameter_range('kappab', -3., 3.) config.set_parameter_range('kappac', -10., 10.) config.tags.append('G1B') config.datacard = yukawa_G.G1B differentialutils.run_postfit_fastscan_scan(config)
def pth_ggH_scan_hbb_fixedOOA(args): args = differentialutils.set_one_decay_channel(args, 'hbb', asimov=True) ws = LatestPaths.ws.pth_ggH['hbb'] config = differential_config(args, ws, 'pth_ggH') config.POIs.pop(config.POIs.index('r_ggH_PTH_200_350')) config.FLOAT_OTHER_POIS = False config.del_parameter_range('r_ggH_PTH_200_350') config.freezeNuisances.append('r_ggH_PTH_200_350') config.tags.append('fixedOOA') postfit_and_scan(args, config)
def scan_topctcb_lumiscale(args): args = differentialutils.set_one_decay_channel(args, 'combWithHbb', asimov=True) config = basic_config_ctcb(args) config.datacard = LatestPaths.ws.topctcb.lumiScale config.freezeNuisances.append('lumiScale') config.hardPhysicsModelParameters.append('lumiScale=8.356546') config.tags.append('lumiStudy') differentialutils.run_postfit_fastscan_scan(config)
def test_dopoints_option_implementation(args): args = differentialutils.set_one_decay_channel(args, 'hzz', asimov=True) decay_channel = differentialutils.get_decay_channel_tag(args) config = CombineConfigKBKC(args) config.datacard = workspaces.couplingdependentBRs[decay_channel] config.tags.append('couplingdependentBRs') config.range_couplingdependentBRs(args) config.nPoints = 10 * 10 config.nPointsPerJob = 50 differentialutils.run_postfit_fastscan_scan(config)
def scan_topctcb_scalingbbHttH_floatingBRs(args): args = differentialutils.set_one_decay_channel(args, 'combWithHbb') config = basic_config_ctcb(args) config.datacard = 'out/workspaces_May29/combWithHbb_TopCtCb_reweighted_scalingbbHttH_floatingBRs.root' config.tags.append('scalingbbHttH') config.tags.append('floatingBRs') config.set_parameter_range('ct', -10.0, 10.0) config.set_parameter_range('cb', -20., 20.) config.nPoints = 40 * 40 config.nPointsPerJob = 9 differentialutils.run_postfit_scan(config)
def scan_yukawa_G0B_reweighted(args): args = differentialutils.set_one_decay_channel(args, 'combination', asimov=True) config = basic_config(args) config.nPoints = 50*50 config.queue = 'short.q' config.nPointsPerJob = 600 config.set_parameter_range('kappab', -5., 8.) config.set_parameter_range('kappac', -20., 20.) config.tags.append('G0B_reweighted') config.datacard = yukawa_G.G0B_reweighted differentialutils.run_postfit_fastscan_scan(config)
def scan_yukawa_G1BKV(args): args = differentialutils.set_one_decay_channel(args, 'combination', asimov=True) config = basic_config(args) config.queue = 'short.q' config.nPointsPerJob = 350 config.set_parameter_range('kappab', -7., 7.) config.set_parameter_range('kappac', -14., 14.) config.set_parameter_range('kappa_V', -10000., 1.) config.hardPhysicsModelParameters.append('kappa_V=0.999') config.floatNuisances.append('kappa_V') config.tags.append('G1BKV') config.datacard = yukawa_G.G1B differentialutils.run_postfit_fastscan_scan(config)
def scan_yukawa_G1A_reweighted_noTheoryUnc_scaledByMuTotalXS(args): args = differentialutils.set_one_decay_channel(args, 'combination', asimov=True) config = basic_config(args) config.nPoints = 50*50 config.set_parameter_range('kappab', -2., 2.) config.set_parameter_range('kappac', -8., 8.) config.nPointsPerJob = 16 config.queue = 'short.q' config.tags.append('G1A_reweighted_noTheoryUnc_scaledByMuTotalXS') config.datacard = yukawa_G.G1A_reweighted_noTheoryUnc_scaledByMuTotalXS differentialutils.run_postfit_fastscan_scan(config)
def all_scans_Yukawa(args_original): args = copy.deepcopy(args_original) # for asimov in [ False, True ]: # args.asimov = asimov # for decay_channel in ['hgg', 'hzz', 'combination']: # set_decay_channel(args, decay_channel) # # t2ws_Yukawa_nominal(args) # differentialutils.try_call_function_with_args(scan_yukawa, args) differentialutils.set_one_decay_channel(args, 'combination') args.asimov = True fns = [ scan_yukawa_uncorrelatedTheoryUnc, # scan_yukawa_fitOnlyNormalization, # scan_yukawa_oneKappa, scan_yukawa_lumiScale, scan_yukawa_BRdependent, # scan_yukawa_BRdependent_and_profiledTotalXS, scan_yukawa_profiledTotalXS, ] for fn in fns: differentialutils.try_call_function_with_args(fn, args)
def projection_pth_smH_scan_one_bin_locally(args): decay_channel = 'combWithHbb' args = differentialutils.set_one_decay_channel(args, decay_channel, asimov=True) ws = workspaces[decay_channel] config = differential_config(args, ws, 'pth_smH') POI = 'r_smH_PTH_0_15' left = 0.9 right = 1.1 n_points = 8 config.onBatch = False config.POIs = [POI] config.set_parameter_range(POI, left, right) scan_directly(args, config, verbosity=1)
def scan_top_scalingttH_floatingBRs_NONconstrainedbbZZ(args): args = differentialutils.set_one_decay_channel(args, 'combWithHbb') config = basic_config(args) config.datacard = 'out/workspaces_May30/combWithHbb_Top_reweighted_scalingttH_floatingBRs.root' config.tags.append('scalingttH') config.tags.append('floatingBRs') config.tags.append('NONconstrainedbbZZ') config.set_parameter_range('ct', -1.7, 1.7) config.set_parameter_range('cg', -0.10, 0.10) # config.nPoints = 10*10 # config.nPointsPerJob = 1 # config.queue = 'short.q' config.nPoints = 30 * 30 config.nPointsPerJob = 7 config.queue = 'all.q' differentialutils.run_postfit_scan(config)
def rescan(real_args): for asimov in [False, True]: for obsname in ['pth_ggH', 'pth_smH']: for rescan in rescans[obsname]['asimov' if asimov else 'observed']: args = differentialutils.set_one_decay_channel(real_args, rescan.dc, asimov=asimov) ws = LatestPaths.ws[obsname][rescan.dc] config = differential_config(args, ws, obsname) config.POIs = [rescan.POI] config.nPoints = 40 for i in xrange(len(config.PhysicsModelParameterRanges)): range_str = config.PhysicsModelParameterRanges[i] if range_str.startswith(rescan.POI): config.PhysicsModelParameterRanges[ i] = '{0}={1},{2}'.format(rescan.POI, rescan.x_min, rescan.x_max) config.tags.append('rescan') scan_directly(args, config)
def scan_top_scalingttH_floatingBRs(args): raise RuntimeError('Probably not what I want!') args = differentialutils.set_one_decay_channel(args, 'combWithHbb') config = basic_config(args) # config.datacard = 'out/workspaces_May17/combWithHbb_Top_reweighted_scalingttH.root' config.datacard = 'out/workspaces_May22/combWithHbb_Top_reweighted_scalingttH_floatingBRs.root' config.tags.append('scalingttH') config.tags.append('floatingBRs') # Runs out of CPU # config.set_parameter_range('ct', -2.5, 2.5) # config.set_parameter_range('cg', -0.15, 0.15) # config.nPoints = 40*40 # config.nPointsPerJob = 12 # Even faster config.set_parameter_range('ct', -1.7, 1.7) config.set_parameter_range('cg', -0.10, 0.10) config.nPoints = 10 * 10 config.nPointsPerJob = 4 # differentialutils.run_postfit_fastscan_scan(config) differentialutils.run_postfit_scan(config)
def scan_yukawa_withBRuncertainties(args): args = differentialutils.set_one_decay_channel(args, 'hzz', asimov=True) config = basic_config(args) config.tags.append('withBRuncertainties') config.datacard = 'out/workspaces_May08/hzz_Yukawa_reweighted_withBRuncertainties.root' differentialutils.run_postfit_fastscan_scan(config)
def t2ws_Yukawa_G2A(args): args = differentialutils.set_one_decay_channel(args, 'combination', asimov=True) t2ws = base_t2ws(args) t2ws.tags.append('G2A') t2ws.extra_options.append('--PO freely_floating_BRs=True') t2ws.run()
def testing_spline2d(args): x_coupling = 'ct' y_coupling = 'cg' x_min = 0.0 x_max = 2.5 y_min = -0.065 y_max = 0.08 x_min = -0.1 x_max = 2.0 y_min = -0.05 y_max = 0.085 args = differentialutils.set_one_decay_channel(args, 'combWithHbb') if args.asimov: scandir = 'out/Scan_May22_Top_combWithHbb_scalingttH_couplingdependentBRs_asimov' else: scandir = 'out/Scan_May31_Top_combWithHbb_scalingttH_couplingdependentBRs' scalingttH = differentials.scans.Scan2D('scalingttH', x_coupling, y_coupling, scandir=scandir) scalingttH.title = 'Combination (incl. bbH / BR(#vec{#kappa}))' scalingttH.color = 1 scalingttH.read() unsplined_hist = scalingttH.to_hist() spline = scalingttH.to_spline( x_min=x_min, x_max=x_max, y_min=y_min, y_max=y_max, ) spline.add_noise_selector(lambda ct, cg: (cg < (1. / 12.) - 0.02 - (1. / 12.) * ct)) spline.add_noise_selector(lambda ct, cg: (cg > (1. / 12.) + 0.04 - (1. / 13.) * ct)) splined_hist = spline.to_hist() splined_hist.color = 1 plot = differentials.plotting.plots.Single2DHistPlot( 'debug_unsplined', unsplined_hist, x_min=x_min, x_max=x_max, y_min=y_min, y_max=y_max, ) plot.set_ranges_by_contour = False plot.x_SM = 1.0 plot.y_SM = 0.0 plot.x_title = '#kappa_{t}' plot.y_title = 'c_{g}' plot.draw() plot.wrapup() plot = differentials.plotting.plots.Single2DHistPlot( 'debug_splined', splined_hist, x_min=x_min, x_max=x_max, y_min=y_min, y_max=y_max, ) plot.set_ranges_by_contour = False plot.x_SM = 1.0 plot.y_SM = 0.0 plot.x_title = '#kappa_{t}' plot.y_title = 'c_{g}' plot.draw() plot.wrapup() #____________________________________________________________________ # Get 1d ct_graph = get_1d_x(unsplined_hist) get_unc_for_graph(ct_graph) ct_graph.draw_style = 'repr_smooth_line' ct_graph.title = '{0} observed; ({1:.2f} - {2:.2f}) @ 68% CL'.format( differentials.core.standard_titles['ct'], ct_graph.unc.left_bound, ct_graph.unc.right_bound) ct_graph.color = 1 differentials.plotting.canvas.c.resize_temporarily(850, 800) plot = differentials.plotting.plots.MultiScanPlot('onekappascan_ct') plot.manual_graphs.append(ct_graph) # plot.manual_graphs.append(exp1D) plot.x_title = differentials.core.standard_titles['ct'] plot.x_min = x_min plot.x_max = x_max plot.leg.SetNColumns(1) plot.leg._y1 = lambda c: 1. - c.GetTopMargin() - 0.20 plot.draw() plot.wrapup() cg_graph = get_1d_y(unsplined_hist) get_unc_for_graph(cg_graph) cg_graph.draw_style = 'repr_smooth_line' cg_graph.title = '{0} observed; ({1:.2f} - {2:.2f}) @ 68% CL'.format( differentials.core.standard_titles['cg'], cg_graph.unc.left_bound, cg_graph.unc.right_bound) cg_graph.color = 1 differentials.plotting.canvas.c.resize_temporarily(850, 800) plot = differentials.plotting.plots.MultiScanPlot('onekappascan_cg') plot.manual_graphs.append(cg_graph) # plot.manual_graphs.append(exp1D) plot.x_title = differentials.core.standard_titles['cg'] plot.x_min = y_min plot.x_max = y_max plot.leg.SetNColumns(1) plot.leg._y1 = lambda c: 1. - c.GetTopMargin() - 0.20 plot.draw() plot.wrapup()
def create_projection_datacards_s2grouping(args): for dc in [ 'hbb', 'hgg', 'hzz', 'combWithHbb' ]: args = differentialutils.set_one_decay_channel(args, dc) create_projection_datacard_s2grouping(args)
def set_combination_and_asimov(args): args = differentialutils.set_one_decay_channel(args, 'combination') args.asimov = True return args
def scan_yukawa_G0A(args): args = differentialutils.set_one_decay_channel(args, 'combination', asimov=True) config = basic_config(args) config.tags.append('G0A') config.datacard = yukawa_G.G0A differentialutils.run_postfit_fastscan_scan(config)