def __init__(self, cb=None): super(Datacards, self).__init__() self.cb = cb if self.cb is None: self.cb = ch.CombineHarvester() if log.isEnabledFor(logging.DEBUG): self.cb.SetVerbosity(1) self.configs = datacardconfigs.DatacardConfigs() self.stable_options = r"--robustFit 1 --preFitValue 1.0 --cminDefaultMinimizerType Minuit2 --cminDefaultMinimizerAlgo Minuit2 --cminDefaultMinimizerStrategy 0 --cminFallbackAlgo Minuit2,0:1.0"
if args.channel != parser.get_default("channel"): args.channel = args.channel[len(parser.get_default("channel")):] if args.categories != parser.get_default("categories"): args.categories = args.categories[len(parser.get_default("categories") ):] args.categories = (args.categories * len(args.channel))[:len(args.channel)] args.output_dir = os.path.abspath(os.path.expandvars(args.output_dir)) if args.clear_output_dir and os.path.exists(args.output_dir): logger.subprocessCall("rm -r " + args.output_dir, shell=True) #1.-----Create Datacards print WARNING + UNDERLINE + '----- Creating datacard with processes and systematics... -----' + ENDC datacards = CreateDatacard(args) datacards.configs = datacardconfigs.DatacardConfigs() if args.no_shape_uncs: print OKBLUE + "No shape uncs!" + ENDC datacards.cb.FilterSysts( lambda systematic: systematic.type() == "shape") print OKGREEN + 'Datacard channels:' + ENDC, datacards.cb.channel_set() print OKGREEN + 'Datacard categories :' + ENDC, datacards.cb.bin_set() print OKGREEN + 'Datacard systematics :' + ENDC, datacards.cb.syst_name_set( ) #2.-----Creating input root files print WARNING + '----- Creating input root files... -----' + ENDC create_input_root_files(datacards, args)