Ejemplo n.º 1
0
    tree = args.tree

    #The enabled systematic up/down variation sample prefixes to put on the ratio plot
    if args.do_systs:
        systs = {
            "JES": ("EnUp", "EnDown"),
            "JER": ["ResUp", "ResDown"],
            "MET": ["UnclusteredEnUp", "UnclusteredEnDown"],
        }
    else:
        systs = {}

    for lepton_channel in args.channels:
        logger.info("Plotting lepton channel %s" % lepton_channel)

        weight = Weights.total(lepton_channel)*Weights.wjets_madgraph_shape_weight()*Weights.wjets_madgraph_flat_weight()

        physics_processes = PhysicsProcess.get_proc_dict(lepton_channel=lepton_channel)#Contains the information about merging samples and proper pretty names for samples
        merge_cmds = PhysicsProcess.get_merge_dict(physics_processes) #The actual merge dictionary

        lumi = lumis[lepton_channel]

        isoreg='iso'
        use_antiiso = False
        if args.use_antiiso:
            isoreg='antiiso'
            use_antiiso = True

        #Get the file lists
        flist = get_file_list(
            merge_cmds,
Ejemplo n.º 2
0
flist = []
for i in ['sig','bg']:
    for j in ['train','eval']:
        flist += mvaFileList[i][j]

logger.debug('Used file list: %s',str(flist))

# Read in the samples
samples = {}
for f in flist:
    samples[f] = Sample.fromFile(args.indir+'/%s/%s.root' % (proc,f), tree_name='Events_MVA')

# Set the weight expression
weightString = str(Weights.total(proc) *
    Weights.wjets_madgraph_shape_weight() *
    Weights.wjets_madgraph_flat_weight())

# Which file do we use to write our TMVA trainings
ext=''
if len(rVar):
    ext='_sans'
    for v in rVar:
        ext+='_'+v

if len(cVar):
    ext='_with'
    for v in cVar:
        ext+='_'+v

out = TFile('TMVA%s%s.root' % (proc,ext),'RECREATE')