示例#1
0
文件: deepjet.py 项目: denschwarz/tWZ
        Fall17.triBoson, Fall17.ZZ, Fall17.nonprompt_3l
    ]
elif args.era == "Run2018":
    mc = [
        Autumn18.TWZ_NLO_DR, Autumn18.TTZ, Autumn18.TTX_rare, Autumn18.TZQ,
        Autumn18.WZ, Autumn18.triBoson, Autumn18.ZZ, Autumn18.nonprompt_3l
    ]
elif args.era == "RunII":
    mc = [TWZ_NLO_DR, TTZ, TTX_rare, TZQ, WZ, triBoson, ZZ, nonprompt_3l]

################################################################################
# Define the data sample
try:
    data_sample = eval(args.era)
except Exception as e:
    logger.error("Didn't find %s", args.era)
    raise e

lumi_scale = data_sample.lumi / 1000
data_sample.scale = 1.
for sample in mc:
    sample.scale = 1  # Scale MCs individually with lumi

if args.small:
    for sample in mc + [data_sample]:
        sample.normalization = 1.
        sample.reduceFiles(to=1)
        #sample.reduceFiles( to=1)
        sample.scale /= sample.normalization

################################################################################
示例#2
0
subDir = args.config

#config
config = getattr(configs, args.config)

sample_names = []
found = False
for sample in config.training_samples:
    if args.sample == sample.name:
        found = True
        break  # found it
    else:
        sample_names.append(sample.name)

if not found:
    logger.error("Need sample to be one of %s, got %s", ",".join(sample_names),
                 args.sample)
    sys.exit()

logger.info("Processing sample %s", sample.name)

count = int(sample.getYieldFromDraw(weightString="(1)")["val"])
logger.info("Found %i events for sample %s", count, sample.name)

if args.small:
    sample.reduceFiles(to=1)
    subDir += '_small'

# selection
if hasattr(config, "selectionString"):
    sample.addSelectionString(config.selectionString)
    logger.info("Add selectionstring %s", config.selectionString)