Exemplo n.º 1
0
        if alphabetagamma : 
            hname = h.GetName()
            if 'DiLepTT' in hname : h.Scale(beta)
            elif 'SemiLepTT' in hname : h.Scale(alpha)
            else : h.Scale(gamma)
        sumbkg.Add(h)
    #sumbkg.Draw('goff')
    sumbkg.SetTitle('Total BKG')
    sumbkg.SetName('sumbkg')
    return sumbkg


if __name__ == '__main__':
    
    # get the plotter class instant 
    instPlot = rootplot(indir,outdire,All_files=All_files)
    for g in instPlot.group:
        # fill the dictionary with all the files founded under the indir under each category 
        All_files[g]['files'] = instPlot.group[g]
        # make chain with each background seperatly 
        chain = instPlot.chain_and_cut (filesList = All_files[g]['files'],Tname = "sf/t",cutstring = cut_strings,extraCuts = All_files[g]['select'])
        # add the chain to each category
        All_files[g]['chain']  = chain
        # init empty list of histogram tio be filled in the next loop
        All_files[g]['hist'] = []
        All_files[g]['hist_bins'] = []
        if do_Oldbins : 
            binlist = list(oldbins.keys())
            All_files[g]['hist_bins'] = make1D_bins(binlist,All_files[g],g+'oldbins')
            #bincount = 1 
            for bin_ in oldbins.keys() : 
Exemplo n.º 2
0
    wdir = os.getcwd()
    if not os.path.exists(outdir):
        os.makedirs(outdir)
    if not os.path.exists(logdir):
        os.makedirs(logdir)

    if sig: massdir = os.path.join(outdir, 'scan/' + mass)
    else: massdir = os.path.join(outdir, 'grid/' + mass)

    print('output will be written in ', massdir)
    #massdir = os.path.join(outdir,mass)

    if not os.path.exists(massdir): os.makedirs(massdir)

    instPlot = rootplot(indir, outdir, All_files=All_files)
    if args.doSyst:
        instPlot_Jec_up = rootplot(indirJecUp,
                                   outdir,
                                   All_files=All_files_Jec_up,
                                   outtext="sample_jec_up")
        instPlot_Jec_dn = rootplot(indirJecdown,
                                   outdir,
                                   All_files=All_files_Jec_dn,
                                   outtext="sample_jec_down")
    cuttext = open(massdir + "/" + cutdict + ".txt", "w+")
    if not batch:
        if sig:
            ithmass = SigToUse(int(mass.split('_')[0]),
                               int(mass.split('_')[1]))
        cuts = cutdict_[ithmass] if sig else cutdict_[mass]