if not "mLtight0Gamma" in label.split(" ")[2]: reg = reg.replace("VG","ZG+WG") elif "mLtight0Gamma0" in label.split(" ")[2]: reg = reg.replace("VG","ZG") else: reg = reg.replace("VG","WG") ch = label.split(" ")[1] ch = ch.replace("all","e+mu") ch = ch.replace("mu","#mu") ch = ch.replace("tight","") return reg + ", " + ch labelFormater = formatLabel labels = [ ( i, label ) for i, label in enumerate(Results.getBinLabels( labelFormater=lambda x:x.split(" "))[Results.channels[0]])] if args.plotRegions: labels = filter( lambda (i,(year, ch, lab, reg)): reg in args.plotRegions, labels ) # get list of labels crName = [ cr for i, (year, lep, reg, cr) in labels ] plotBins = [ i for i, (year, lep, reg, cr) in labels ] crLabel = map( lambda (i,(year, ch, lab, reg)): ", ".join( [ reg, ch.replace("mu","#mu").replace("tight","") ] ), labels ) tmpLabels = map( lambda (i,(year, ch, lab, reg)): lab, labels ) ptLabels = map( lambda (i,(year, ch, lab, reg)): convLabel(lab), labels ) for key, val in enumerate(crLabel): if "mLtight0Gamma" in tmpLabels[key]: if "mLtight0Gamma0" in tmpLabels[key]: crLabel[key] = val.replace("VG","ZG") else:
reg = reg.replace("VG", "WG") reg = reg.replace("WG", "HM") reg = reg.replace("ZG", "LM") ch = label.split(" ")[1] ch = ch.replace("all", "e+mu") ch = ch.replace("mu", "#mu") ch = ch.replace("tight", "") return reg + ", " + ch labelFormater = formatLabel labels = [(i, label) for i, label in enumerate( Results.getBinLabels( labelFormater=lambda x: x.split(" "))[Results.channels[0]])] if args.plotRegions: labels = filter(lambda (i, (year, ch, lab, reg)): reg in args.plotRegions, labels) if args.plotChannels: labels = filter(lambda (i, (year, ch, lab, reg)): ch in args.plotChannels, labels) # get list of labels crName = [cr for i, (year, lep, reg, cr) in labels] plotBins = [i for i, (year, lep, reg, cr) in labels] crLabel = map( lambda (i, (year, ch, lab, reg)): ", ".join( [reg, ch.replace("mu", "#mu").replace("tight", "")]), labels) tmpLabels = map(lambda (i, (year, ch, lab, reg)): lab, labels) ptLabels = map(lambda (i, (year, ch, lab, reg)): convLabel(lab), labels)