Functions | |
def | official2private |
def | private2official |
def | matching_process |
def | is_control_region |
def | remove_procs_and_systs_with_zero_yield |
Variables | |
tuple | log = logging.getLogger(__name__) |
tuple | parser |
string | help = "Input directory." |
list | default = ["all"] |
list | choices = ["individual", "channel", "category", "combined"] |
tuple | args = parser.parse_args() |
tuple | clear_output_dir = raw_input("Do you really want to clear the output directory? [yes]") |
tuple | sample_settings = samples.Samples() |
tuple | binnings_settings = binnings.BinningsDict() |
tuple | systematics_factory = systematics.SystematicsFactory() |
list | plot_configs = [] |
list | output_files = [] |
list | merged_output_files = [] |
list | hadd_commands = [] |
datacards = None | |
dictionary | category_replacements = {} |
tuple | init_directory = os.path.join(args.output_dir, "output/{OUTPUT_SUFFIX}/".format(OUTPUT_SUFFIX=args.output_suffix)) |
string | command = "MorphingSMCP2016 --control_region=1 {DIJET_2D} --postfix -2D --mm_fit=false --ttbar_fit=true {INIT}" |
string | DIJET_2D = "--dijet_2d=true" |
string | INIT = "--only_init=" |
tuple | exit_code = logger.subprocessCall(shlex.split(command)) |
tuple | init_cb = ch.CombineHarvester() |
string | tmp_input_root_filename_template = "shapes/" |
string | input_root_filename_template = "shapes/" |
string | bkg_histogram_name_template = "${BIN}/${PROCESS}" |
string | sig_histogram_name_template = "${BIN}/${PROCESS}${MASS}" |
string | bkg_syst_histogram_name_template = "${BIN}/${PROCESS}_${SYSTEMATIC}" |
string | sig_syst_histogram_name_template = "${BIN}/${PROCESS}${MASS}_${SYSTEMATIC}" |
datacard_filename_templates = datacards.configs.cp_datacard_filename_templates | |
string | output_root_filename_template = "datacards/common/${ANALYSIS}.inputs-sm-${ERA}-2D.root" |
list | jecUncertNames |
dictionary | ss_os_factors |
dictionary | wj_sf_shifts |
dictionary | zmm_cr_factors |
string | zmm_cr_0jet_global = "(1.0)" |
string | zmm_cr_boosted_global = "(1.0)" |
string | zmm_cr_vbf_global = "(1.02)" |
dictionary | zmm_cr_factors_official |
list | top_pt_reweight_nicks |
list | categoriesWithRelaxedIsolationForW |
list | categoriesWithRelaxedIsolationForQCD |
do_not_normalize_by_bin_width = args.do_not_normalize_by_bin_width | |
list | tmp_output_files = [] |
tuple | output_file |
tuple | categories = datacards.cb.cp() |
tuple | categories_save = sorted(categories) |
tuple | category = official2private(official_category, category_replacements) |
tuple | datacards_per_channel_category = initialstatecpstudiesdatacards.InitialStateCPStudiesDatacards(cb=datacards.cb.cp().channel([channel]).bin([official_category])) |
tuple | exclude_cuts = copy.deepcopy(args.exclude_cuts) |
list | higgs_masses = [mass for mass in datacards_per_channel_category.cb.mass_set() if mass != "*"] |
tuple | nominal = (shape_systematic == "nominal") |
list | list_of_samples = [datacards.configs.process2sample(re.sub('125', '', process)) for process in list_of_samples] |
string | systematic = "nominal" |
dictionary | config = {} |
string | samples = "\", \"" |
channel = channel, | |
tuple | ss_os_factor = ss_os_factors.get(category,0.0) |
tuple | wj_sf_shift = wj_sf_shifts.get(category,0.0) |
tuple | zmm_cr_factor = zmm_cr_factors_official.get(category, "(1.0)") |
tuple | systematics_settings = systematics_factory.get(shape_systematic) |
list | weightAtIndex = config["weights"] |
string | binnings_key = "tt_jdphi" |
histogram_name_template = bkg_histogram_name_templateifnominalelsebkg_syst_histogram_name_template | |
tuple | PROCESS = datacards.configs.sample2process(sample) |
BIN = official_category, | |
SYSTEMATIC = systematic | |
tuple | tmp_output_file |
DST = output_file, | |
string | SRC = " " |
list | debug_plot_configs = [] |
OUTPUT_SUFFIX = args.output_suffix, | |
string | SHAPE_UNCS = "--no_shape_systs=true" |
string | SCALE_SIG = "--scale_sig_procs=true" |
string | datacards_path = args.output_dir+"/output/" |
tuple | official_cb = ch.CombineHarvester() |
dictionary | datacards_cbs = {} |
dictionary | datacards_workspaces_alpha = {} |
tuple | tmp_datacard = ch.CombineHarvester() |
DATACARD = official_datacard, | |
tuple | OUTPUT = os.path.splitext(official_datacard) |
N_PROCESSES = args.n_processes | |
string | CHANNELS = "," |
string | directory = "output/" |
string | INPUT_FILE = directory+"higgsCombine.alpha.MultiDimFit.mH125.root" |
string | OUTPUT_FILE = directory+"alpha" |
dictionary | datacards_poi_ranges = {} |
tuple | channels = cb.channel_set() |
tuple | datacards_postfit_shapes = datacards.postfit_shapes_fromworkspace(datacards_cbs, datacards_workspaces_alpha, False, args.n_processes, "--sampling" + (" --print" if args.n_processes <= 1 else ""), higgs_mass="125") |
dictionary | backgrounds_to_merge |
dictionary | titles |
dictionary | x_tick_labels |
dictionary | texts |
dictionary | texts_x |
dictionary | vertical_lines |
tuple | prefit_postfit_plot_configs = datacards.prefit_postfit_plots(datacards_cbs, datacards_postfit_shapes, plotting_args={"ratio" : args.ratio, "args" : args.args, "lumi" : args.lumi, "normalize" : not(do_not_normalize_by_bin_width), "era" : args.era, "x_expressions" : config["x_expressions"][0], "return_configs" : True, "merge_backgrounds" : backgrounds_to_merge, "add_soverb_ratio" : True}, n_processes=args.n_processes, no_plot=[""]) |
list | plot_category = plot_config["filename"] |
list | plot_channel = plot_config["filename"] |
dictionary | bkg_yield = {} |
dictionary | sig_yield = {} |
tuple | bkg_procs = datacards.cb.cp() |
tuple | sig_procs = datacards.cb.cp() |
tuple | tot_bkg = sum(bkg_yield.values()) |
tuple | tot_sig = sum(sig_yield.values()) |
def makePlots_datacardsCPInitialState.is_control_region | ( | obj | ) |
def makePlots_datacardsCPInitialState.matching_process | ( | obj1, | |
obj2 | |||
) |
def makePlots_datacardsCPInitialState.official2private | ( | category, | |
category_replacements | |||
) |
def makePlots_datacardsCPInitialState.private2official | ( | category, | |
category_replacements | |||
) |
def makePlots_datacardsCPInitialState.remove_procs_and_systs_with_zero_yield | ( | proc | ) |
tuple makePlots_datacardsCPInitialState.args = parser.parse_args() |
dictionary makePlots_datacardsCPInitialState.backgrounds_to_merge |
makePlots_datacardsCPInitialState.BIN = official_category, |
string makePlots_datacardsCPInitialState.binnings_key = "tt_jdphi" |
tuple makePlots_datacardsCPInitialState.binnings_settings = binnings.BinningsDict() |
string makePlots_datacardsCPInitialState.bkg_histogram_name_template = "${BIN}/${PROCESS}" |
tuple makePlots_datacardsCPInitialState.bkg_procs = datacards.cb.cp() |
string makePlots_datacardsCPInitialState.bkg_syst_histogram_name_template = "${BIN}/${PROCESS}_${SYSTEMATIC}" |
dictionary makePlots_datacardsCPInitialState.bkg_yield = {} |
tuple makePlots_datacardsCPInitialState.categories = datacards.cb.cp() |
tuple makePlots_datacardsCPInitialState.categories_save = sorted(categories) |
list makePlots_datacardsCPInitialState.categoriesWithRelaxedIsolationForQCD |
list makePlots_datacardsCPInitialState.categoriesWithRelaxedIsolationForW |
makePlots_datacardsCPInitialState.category = official2private(official_category, category_replacements) |
dictionary makePlots_datacardsCPInitialState.category_replacements = {} |
makePlots_datacardsCPInitialState.channel = channel, |
string makePlots_datacardsCPInitialState.CHANNELS = "," |
tuple makePlots_datacardsCPInitialState.channels = cb.channel_set() |
tuple makePlots_datacardsCPInitialState.clear_output_dir = raw_input("Do you really want to clear the output directory? [yes]") |
string makePlots_datacardsCPInitialState.command = "MorphingSMCP2016 --control_region=1 {DIJET_2D} --postfix -2D --mm_fit=false --ttbar_fit=true {INIT}" |
tuple makePlots_datacardsCPInitialState.config = {} |
makePlots_datacardsCPInitialState.DATACARD = official_datacard, |
makePlots_datacardsCPInitialState.datacard_filename_templates = datacards.configs.cp_datacard_filename_templates |
tuple makePlots_datacardsCPInitialState.datacards = None |
dictionary makePlots_datacardsCPInitialState.datacards_cbs = {} |
string makePlots_datacardsCPInitialState.datacards_path = args.output_dir+"/output/" |
tuple makePlots_datacardsCPInitialState.datacards_per_channel_category = initialstatecpstudiesdatacards.InitialStateCPStudiesDatacards(cb=datacards.cb.cp().channel([channel]).bin([official_category])) |
dictionary makePlots_datacardsCPInitialState.datacards_poi_ranges = {} |
tuple makePlots_datacardsCPInitialState.datacards_postfit_shapes = datacards.postfit_shapes_fromworkspace(datacards_cbs, datacards_workspaces_alpha, False, args.n_processes, "--sampling" + (" --print" if args.n_processes <= 1 else ""), higgs_mass="125") |
dictionary makePlots_datacardsCPInitialState.datacards_workspaces_alpha = {} |
list makePlots_datacardsCPInitialState.debug_plot_configs = [] |
list makePlots_datacardsCPInitialState.default = ["all"] |
string makePlots_datacardsCPInitialState.DIJET_2D = "--dijet_2d=true" |
string makePlots_datacardsCPInitialState.directory = "output/" |
makePlots_datacardsCPInitialState.do_not_normalize_by_bin_width = args.do_not_normalize_by_bin_width |
makePlots_datacardsCPInitialState.DST = output_file, |
tuple makePlots_datacardsCPInitialState.exclude_cuts = copy.deepcopy(args.exclude_cuts) |
tuple makePlots_datacardsCPInitialState.exit_code = logger.subprocessCall(shlex.split(command)) |
list makePlots_datacardsCPInitialState.hadd_commands = [] |
string makePlots_datacardsCPInitialState.help = "Input directory." |
list makePlots_datacardsCPInitialState.higgs_masses = [mass for mass in datacards_per_channel_category.cb.mass_set() if mass != "*"] |
makePlots_datacardsCPInitialState.histogram_name_template = bkg_histogram_name_templateifnominalelsebkg_syst_histogram_name_template |
string makePlots_datacardsCPInitialState.INIT = "--only_init=" |
tuple makePlots_datacardsCPInitialState.init_cb = ch.CombineHarvester() |
tuple makePlots_datacardsCPInitialState.init_directory = os.path.join(args.output_dir, "output/{OUTPUT_SUFFIX}/".format(OUTPUT_SUFFIX=args.output_suffix)) |
string makePlots_datacardsCPInitialState.INPUT_FILE = directory+"higgsCombine.alpha.MultiDimFit.mH125.root" |
string makePlots_datacardsCPInitialState.input_root_filename_template = "shapes/" |
list makePlots_datacardsCPInitialState.jecUncertNames |
list makePlots_datacardsCPInitialState.list_of_samples = [datacards.configs.process2sample(re.sub('125', '', process)) for process in list_of_samples] |
tuple makePlots_datacardsCPInitialState.log = logging.getLogger(__name__) |
list makePlots_datacardsCPInitialState.merged_output_files = [] |
makePlots_datacardsCPInitialState.N_PROCESSES = args.n_processes |
tuple makePlots_datacardsCPInitialState.nominal = (shape_systematic == "nominal") |
tuple makePlots_datacardsCPInitialState.official_cb = ch.CombineHarvester() |
tuple makePlots_datacardsCPInitialState.OUTPUT = os.path.splitext(official_datacard) |
tuple makePlots_datacardsCPInitialState.output_file |
string makePlots_datacardsCPInitialState.OUTPUT_FILE = directory+"alpha" |
list makePlots_datacardsCPInitialState.output_files = [] |
string makePlots_datacardsCPInitialState.output_root_filename_template = "datacards/common/${ANALYSIS}.inputs-sm-${ERA}-2D.root" |
makePlots_datacardsCPInitialState.OUTPUT_SUFFIX = args.output_suffix, |
tuple makePlots_datacardsCPInitialState.parser |
list makePlots_datacardsCPInitialState.plot_category = plot_config["filename"] |
list makePlots_datacardsCPInitialState.plot_channel = plot_config["filename"] |
list makePlots_datacardsCPInitialState.plot_configs = [] |
tuple makePlots_datacardsCPInitialState.prefit_postfit_plot_configs = datacards.prefit_postfit_plots(datacards_cbs, datacards_postfit_shapes, plotting_args={"ratio" : args.ratio, "args" : args.args, "lumi" : args.lumi, "normalize" : not(do_not_normalize_by_bin_width), "era" : args.era, "x_expressions" : config["x_expressions"][0], "return_configs" : True, "merge_backgrounds" : backgrounds_to_merge, "add_soverb_ratio" : True}, n_processes=args.n_processes, no_plot=[""]) |
tuple makePlots_datacardsCPInitialState.PROCESS = datacards.configs.sample2process(sample) |
tuple makePlots_datacardsCPInitialState.sample_settings = samples.Samples() |
string makePlots_datacardsCPInitialState.samples = "\", \"" |
string makePlots_datacardsCPInitialState.SCALE_SIG = "--scale_sig_procs=true" |
string makePlots_datacardsCPInitialState.SHAPE_UNCS = "--no_shape_systs=true" |
string makePlots_datacardsCPInitialState.sig_histogram_name_template = "${BIN}/${PROCESS}${MASS}" |
tuple makePlots_datacardsCPInitialState.sig_procs = datacards.cb.cp() |
string makePlots_datacardsCPInitialState.sig_syst_histogram_name_template = "${BIN}/${PROCESS}${MASS}_${SYSTEMATIC}" |
dictionary makePlots_datacardsCPInitialState.sig_yield = {} |
string makePlots_datacardsCPInitialState.SRC = " " |
tuple makePlots_datacardsCPInitialState.ss_os_factor = ss_os_factors.get(category,0.0) |
dictionary makePlots_datacardsCPInitialState.ss_os_factors |
makePlots_datacardsCPInitialState.systematic = "nominal" |
makePlots_datacardsCPInitialState.SYSTEMATIC = systematic |
tuple makePlots_datacardsCPInitialState.systematics_factory = systematics.SystematicsFactory() |
tuple makePlots_datacardsCPInitialState.systematics_settings = systematics_factory.get(shape_systematic) |
dictionary makePlots_datacardsCPInitialState.texts |
dictionary makePlots_datacardsCPInitialState.texts_x |
dictionary makePlots_datacardsCPInitialState.titles |
tuple makePlots_datacardsCPInitialState.tmp_datacard = ch.CombineHarvester() |
string makePlots_datacardsCPInitialState.tmp_input_root_filename_template = "shapes/" |
tuple makePlots_datacardsCPInitialState.tmp_output_file |
list makePlots_datacardsCPInitialState.tmp_output_files = [] |
list makePlots_datacardsCPInitialState.top_pt_reweight_nicks |
tuple makePlots_datacardsCPInitialState.tot_bkg = sum(bkg_yield.values()) |
tuple makePlots_datacardsCPInitialState.tot_sig = sum(sig_yield.values()) |
dictionary makePlots_datacardsCPInitialState.vertical_lines |
tuple makePlots_datacardsCPInitialState.weightAtIndex = config["weights"] |
float makePlots_datacardsCPInitialState.wj_sf_shift = wj_sf_shifts.get(category,0.0) |
dictionary makePlots_datacardsCPInitialState.wj_sf_shifts |
dictionary makePlots_datacardsCPInitialState.x_tick_labels |
string makePlots_datacardsCPInitialState.zmm_cr_0jet_global = "(1.0)" |
string makePlots_datacardsCPInitialState.zmm_cr_boosted_global = "(1.0)" |
tuple makePlots_datacardsCPInitialState.zmm_cr_factor = zmm_cr_factors_official.get(category, "(1.0)") |
dictionary makePlots_datacardsCPInitialState.zmm_cr_factors |
dictionary makePlots_datacardsCPInitialState.zmm_cr_factors_official |
string makePlots_datacardsCPInitialState.zmm_cr_vbf_global = "(1.02)" |