HiggsAnalysis-KITHiggsToTauTau
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
makePlots_datacardsZttCrossSection Namespace Reference

Variables

tuple log = logging.getLogger(__name__)
 
dictionary models
 
tuple parser
 
string help = "Input directory."
 
tuple choices = models.keys()
 
list default = ["all"]
 
tuple args = parser.parse_args()
 
tuple sample_settings = samples.Samples()
 
tuple systematics_factory = systematics.SystematicsFactory()
 
list plot_configs = []
 
list hadd_commands = []
 
tuple datacards = zttxsecdatacards.ZttXsecDatacards(model=args.model)
 
string tmp_input_root_filename_template = "input/${ANALYSIS}_${CHANNEL}_${BIN}_${SYSTEMATIC}_${ERA}.root"
 
string input_root_filename_template = "input/${ANALYSIS}_${CHANNEL}_${BIN}_${ERA}.root"
 
string bkg_histogram_name_template = "${BIN}/${PROCESS}"
 
string sig_histogram_name_template = "${BIN}/${PROCESS}"
 
string bkg_syst_histogram_name_template = "${BIN}/${PROCESS}_${SYSTEMATIC}"
 
string sig_syst_histogram_name_template = "${BIN}/${PROCESS}_${SYSTEMATIC}"
 
list datacard_filename_templates
 
string output_root_filename_template = "datacards/common/${ANALYSIS}.input_${ERA}.root"
 
tuple categories = datacards.cb.cp()
 
tuple datacards_per_channel_category = zttxsecdatacards.ZttXsecDatacards(cb=datacards.cb.cp().channel([channel]).bin([category]), model=args.model)
 
tuple output_file
 
list tmp_output_files = []
 
tuple nominal = (shape_systematic == "nominal")
 
list list_of_samples = [datacards.configs.process2sample(process) for process in list_of_samples]
 
string systematic = "nominal"
 
string samples = "\", \""
 
 channel = channel,
 
 category = category,
 
tuple config
 
tuple systematics_settings = systematics_factory.get(shape_systematic)
 
dictionary json_config = {}
 
tuple binnings_settings = binnings.BinningsDict()
 
string binnings_key = channel+"_"
 
 histogram_name_template = bkg_histogram_name_templateifnominalelsebkg_syst_histogram_name_template
 
tuple PROCESS = datacards.configs.sample2process(sample)
 
 BIN = category,
 
 SYSTEMATIC = systematic
 
tuple tmp_output_file
 
 DST = output_file,
 
string SRC = " "
 
tuple output_files = list(set([os.path.join(config["output_dir"], config["filename"]+".root") for config in plot_configs[:args.n_plots[0]]]))
 
 update_systematics = False
 
dictionary datacards_cbs = {}
 
tuple model_settings = models.get(args.model, {})
 
tuple fit_settings = model_settings.get("fit", {"" : {}})
 
tuple tmp_fit_options = fit_options.get("options", "")
 
tuple GRID_BINS = (int(args.grid_bins) * int(args.grid_bins))
 
tuple datacards_workspaces
 
list FIT_METHOD = fit_options["method"]
 
 FIT_OPTIONS = tmp_fit_options,
 
 STABLE = datacards.stable_options,
 
dictionary datacards_postfit_shapes = {}
 
list bkg_plotting_order = ["ZTT", "ZLL", "ZL", "ZJ", "TT", "TTJT", "TTJL", "VV", "VVT", "VVL", "EWK", "W", "WJT", "WJL", "FF", "QCD"]
 
tuple postfit_shapes = datacards_postfit_shapes.get("fit_s", {})
 
tuple results_file = ROOT.TFile(os.path.join(os.path.dirname(datacard), "mlfit.root"))
 
tuple results_tree = results_file.Get("tree_fit_sb")
 
 bestfit = results_tree.mu
 
list processes = datacards_cbs[datacard]
 
tuple processes_to_plot = list(processes)
 

Variable Documentation

tuple makePlots_datacardsZttCrossSection.args = parser.parse_args()
makePlots_datacardsZttCrossSection.bestfit = results_tree.mu
makePlots_datacardsZttCrossSection.BIN = category,
string makePlots_datacardsZttCrossSection.binnings_key = channel+"_"
tuple makePlots_datacardsZttCrossSection.binnings_settings = binnings.BinningsDict()
string makePlots_datacardsZttCrossSection.bkg_histogram_name_template = "${BIN}/${PROCESS}"
list makePlots_datacardsZttCrossSection.bkg_plotting_order = ["ZTT", "ZLL", "ZL", "ZJ", "TT", "TTJT", "TTJL", "VV", "VVT", "VVL", "EWK", "W", "WJT", "WJL", "FF", "QCD"]
string makePlots_datacardsZttCrossSection.bkg_syst_histogram_name_template = "${BIN}/${PROCESS}_${SYSTEMATIC}"
tuple makePlots_datacardsZttCrossSection.categories = datacards.cb.cp()
makePlots_datacardsZttCrossSection.category = category,
makePlots_datacardsZttCrossSection.channel = channel,
tuple makePlots_datacardsZttCrossSection.choices = models.keys()
dictionary makePlots_datacardsZttCrossSection.config
Initial value:
1 = sample_settings.get_config(
2  samples=[getattr(samples.Samples, sample) for sample in list_of_samples],
3  channel=channel,
4  category="catZtt13TeV_"+category,
5  weight=args.weight,
6  fakefactor_method=args.fakefactor_method,
7  lumi = args.lumi * 1000
8  )
list makePlots_datacardsZttCrossSection.datacard_filename_templates
Initial value:
1 = [
2  "datacards/individual/${BIN}/${ANALYSIS}_${CHANNEL}_${BINID}_${ERA}.txt",
3  "datacards/${CHANNEL}/${ANALYSIS}_${CHANNEL}_${ERA}.txt",
4  #"datacards/${BIN}/${ANALYSIS}_${BINID}_${ERA}.txt",
5  "datacards/combined/${ANALYSIS}_${ERA}.txt",
6  ]
tuple makePlots_datacardsZttCrossSection.datacards = zttxsecdatacards.ZttXsecDatacards(model=args.model)
dictionary makePlots_datacardsZttCrossSection.datacards_cbs = {}
tuple makePlots_datacardsZttCrossSection.datacards_per_channel_category = zttxsecdatacards.ZttXsecDatacards(cb=datacards.cb.cp().channel([channel]).bin([category]), model=args.model)
tuple makePlots_datacardsZttCrossSection.datacards_postfit_shapes = {}
tuple makePlots_datacardsZttCrossSection.datacards_workspaces
Initial value:
1 = datacards.text2workspace(
2  datacards_cbs,
3  args.n_processes,
4  "-P {MODEL} {MODEL_PARAMETERS}".format(
5  MODEL=model_settings["P"],
6  MODEL_PARAMETERS=model_settings.get("model_parameters", "")
7  )
8  )
string makePlots_datacardsZttCrossSection.default = ["all"]
makePlots_datacardsZttCrossSection.DST = output_file,
list makePlots_datacardsZttCrossSection.FIT_METHOD = fit_options["method"]
makePlots_datacardsZttCrossSection.FIT_OPTIONS = tmp_fit_options,
tuple makePlots_datacardsZttCrossSection.fit_settings = model_settings.get("fit", {"" : {}})
tuple makePlots_datacardsZttCrossSection.GRID_BINS = (int(args.grid_bins) * int(args.grid_bins))
list makePlots_datacardsZttCrossSection.hadd_commands = []
string makePlots_datacardsZttCrossSection.help = "Input directory."
makePlots_datacardsZttCrossSection.histogram_name_template = bkg_histogram_name_templateifnominalelsebkg_syst_histogram_name_template
string makePlots_datacardsZttCrossSection.input_root_filename_template = "input/${ANALYSIS}_${CHANNEL}_${BIN}_${ERA}.root"
dictionary makePlots_datacardsZttCrossSection.json_config = {}
list makePlots_datacardsZttCrossSection.list_of_samples = [datacards.configs.process2sample(process) for process in list_of_samples]
tuple makePlots_datacardsZttCrossSection.log = logging.getLogger(__name__)
tuple makePlots_datacardsZttCrossSection.model_settings = models.get(args.model, {})
dictionary makePlots_datacardsZttCrossSection.models
Initial value:
1 = {
2  "default" : {
3  "P" : "HiggsAnalysis.KITHiggsToTauTau.datacards.zttmodels:ztt_xsec",
4  "fit" : {
5  "" : {
6  "method" : "MaxLikelihoodFit",#"MaxLikelihoodFit",#"GoodnessOfFit",
7  "options" : "--skipBOnlyFit",#"--skipBOnlyFit",#"--algo saturated --toys 100 -s 54321",#--expectSignal=1 --toys -1
8  "poi" : "r",
9  },
10  },
11  "fit_plots" : {
12  "$CMSSW_BASE/src/HiggsAnalysis/KITHiggsToTauTau/data/plots/configs/combine/ztt_mlfit_bestfitvalues.json"
13  },
14  },
15  "xsec_and_taueff" : {
16  "P" : "HiggsAnalysis.KITHiggsToTauTau.datacards.zttmodels:ztt_eff_and_xsec",
17  "fit" : {
18  "" : {
19  "method" : "MultiDimFit",
20  "options" : "--algo grid --points {GRID_BINS} --minimizerStrategy 0 --setParameterRanges \"r=0.8,1.2:eff=0.8,1.2\"", #--expectSignal=1 --toys -1
21  "poi" : "r",
22  }
23  },
24  "fit_plots" : {
25  "$CMSSW_BASE/src/HiggsAnalysis/KITHiggsToTauTau/data/plots/configs/combine/ztt_r_tauEff_scan.json"
26  }
27  }
28  }
tuple makePlots_datacardsZttCrossSection.nominal = (shape_systematic == "nominal")
tuple makePlots_datacardsZttCrossSection.output_file
Initial value:
1 = os.path.join(args.output_dir, input_root_filename_template.replace("$", "").format(
2  ANALYSIS="ztt",
3  CHANNEL=channel,
4  BIN=category,
5  ERA="13TeV"
6  ))
tuple makePlots_datacardsZttCrossSection.output_files = list(set([os.path.join(config["output_dir"], config["filename"]+".root") for config in plot_configs[:args.n_plots[0]]]))
string makePlots_datacardsZttCrossSection.output_root_filename_template = "datacards/common/${ANALYSIS}.input_${ERA}.root"
tuple makePlots_datacardsZttCrossSection.parser
Initial value:
1 = argparse.ArgumentParser(description="Create ROOT inputs and datacards for ZTT cross section measurement.",
2  parents=[logger.loggingParser])
list makePlots_datacardsZttCrossSection.plot_configs = []
tuple makePlots_datacardsZttCrossSection.postfit_shapes = datacards_postfit_shapes.get("fit_s", {})
tuple makePlots_datacardsZttCrossSection.PROCESS = datacards.configs.sample2process(sample)
list makePlots_datacardsZttCrossSection.processes = datacards_cbs[datacard]
list makePlots_datacardsZttCrossSection.processes_to_plot = list(processes)
tuple makePlots_datacardsZttCrossSection.results_file = ROOT.TFile(os.path.join(os.path.dirname(datacard), "mlfit.root"))
tuple makePlots_datacardsZttCrossSection.results_tree = results_file.Get("tree_fit_sb")
tuple makePlots_datacardsZttCrossSection.sample_settings = samples.Samples()
string makePlots_datacardsZttCrossSection.samples = "\", \""
string makePlots_datacardsZttCrossSection.sig_histogram_name_template = "${BIN}/${PROCESS}"
string makePlots_datacardsZttCrossSection.sig_syst_histogram_name_template = "${BIN}/${PROCESS}_${SYSTEMATIC}"
string makePlots_datacardsZttCrossSection.SRC = " "
makePlots_datacardsZttCrossSection.STABLE = datacards.stable_options,
makePlots_datacardsZttCrossSection.systematic = "nominal"
makePlots_datacardsZttCrossSection.SYSTEMATIC = systematic
tuple makePlots_datacardsZttCrossSection.systematics_factory = systematics.SystematicsFactory()
tuple makePlots_datacardsZttCrossSection.systematics_settings = systematics_factory.get(shape_systematic)
tuple makePlots_datacardsZttCrossSection.tmp_fit_options = fit_options.get("options", "")
string makePlots_datacardsZttCrossSection.tmp_input_root_filename_template = "input/${ANALYSIS}_${CHANNEL}_${BIN}_${SYSTEMATIC}_${ERA}.root"
tuple makePlots_datacardsZttCrossSection.tmp_output_file
Initial value:
1 = os.path.join(args.output_dir, tmp_input_root_filename_template.replace("$", "").format(
2  ANALYSIS="ztt",
3  CHANNEL=channel,
4  BIN=category,
5  SYSTEMATIC=systematic,
6  ERA="13TeV"
7  ))
list makePlots_datacardsZttCrossSection.tmp_output_files = []
makePlots_datacardsZttCrossSection.update_systematics = False