HiggsAnalysis-KITHiggsToTauTau
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
makePlots_datacardsCPInitialState.py File Reference

Namespaces

 makePlots_datacardsCPInitialState
 

Functions

def makePlots_datacardsCPInitialState.official2private
 
def makePlots_datacardsCPInitialState.private2official
 
def makePlots_datacardsCPInitialState.matching_process
 
def makePlots_datacardsCPInitialState.is_control_region
 
def makePlots_datacardsCPInitialState.remove_procs_and_systs_with_zero_yield
 

Variables

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