mc_e.setSelectionString( [filterCutMC, "reweightHEM>0", cutInterpreter.cutString("e")]) mc_e.setWeightString(weightStringAR) print "e", mc_e.selectionString print print "mu", mc_mu.selectionString setup = Setup( year=args.year, photonSelection=False, checkOnly=False, runOnLxPlus=False) #photonselection always false for qcd estimate setup = setup.sysClone(parameters=allRegions[args.selection]["parameters"]) selection = setup.selection("MC", channel="all", **setup.defaultParameters())["prefix"] selection = cutInterpreter.cutString(selection) selection += "&&pTStitching==1&&triggered==1" print selection if args.addCut: selection += "&&" + cutInterpreter.cutString(args.addCut) print("Using selection string: %s" % selection) key = (mc_e.name, "AR", args.variable, "_".join(map(str, args.binning)), mc_e.weightString, mc_e.selectionString, selection) if dirDB.contains(key) and not args.overwrite: mcHist_e = dirDB.get(key.Clone("e")) else: mcHist_e = mc_e.get1DHistoFromDraw(args.variable, binning=args.binning, selectionString=selection)
s.normalization = 1. s.reduceFiles(factor=100) sampleWeight = "%f" % (1. / s.normalization) if len(args.selection.split("-")) == 1 and args.selection in allRegions.keys(): print("Plotting region from SetupHelpers: %s" % args.selection) setup = Setup( year=args.year, photonSelection=False, checkOnly=False, runOnLxPlus=False) #photonselection always false for qcd estimate setup = setup.sysClone(parameters=allRegions[args.selection]["parameters"]) selection = setup.selection("MC", channel=args.mode, **setup.defaultParameters())["prefix"] selection = cutInterpreter.cutString(selection) selection += "&&triggered==1" print selection if args.addCut: selection += "&&" + cutInterpreter.cutString(args.addCut) print("Using selection string: %s" % selection) if "2" in args.selection and not "2p" in args.selection: DYSF_val = DY2SF_val misIDSF_val = misID2SF_val WGSF_val = WG2SF_val ZGSF_val = ZG2SF_val QCDSF_val = QCD2SF_val elif "3" in args.selection and not "3p" in args.selection:
"JetGood0": "JetGoodInvLepIso0", "JetGood1": "JetGoodInvLepIso1", } if len(args.selection.split("-")) == 1 and args.selection in allRegions.keys(): print("Plotting region from SetupHelpers: %s" % args.selection) setup = Setup( year=args.year, photonSelection=False, checkOnly=False, runOnLxPlus=False) #photonselection always false for qcd estimate setup = setup.sysClone(parameters=allRegions[args.selection]["parameters"]) selection = setup.selection("MC", channel=args.mode, **setup.defaultParameters())["prefix"] selection = cutInterpreter.cutString(selection) selection += "&&triggered==1" if args.addCut: selection += "&&" + cutInterpreter.cutString(args.addCut) print("Using selection string: %s" % args.selection) preSelection = setup.selection( "MC", channel=args.mode, **setup.defaultParameters(update=QCD_updates))["prefix"] preSelection = cutInterpreter.cutString(preSelection) preSelection += "&&triggeredInvIso==1" if args.addCut: addSel = cutInterpreter.cutString(args.addCut) for iso, invIso in replaceSelection.iteritems():
filterCutData = getFilterCut(args.year, isData=True, skipBadChargedCandidate=True) mc_high = copy.deepcopy(mc) mc_low = copy.deepcopy(mc) data_high = copy.deepcopy(data_sample) data_low = copy.deepcopy(data_sample) setup = Setup( year=args.year, photonSelection=False, checkOnly=False, runOnLxPlus=False) #photonselection always false for qcd estimate setup = setup.sysClone(parameters=allRegions[args.selection]["parameters"]) selection = setup.selection("MC", channel="all", **setup.defaultParameters())["cut"] selection += "&&pTStitching==1&&triggered==1" if args.addCut: selection += "&&" + cutInterpreter.cutString(args.addCut) dataselection = setup.selection("Data", channel="all", **setup.defaultParameters())["cut"] dataselection += "&&triggered==1" if args.addCut: dataselection += "&&" + cutInterpreter.cutString(args.addCut) print("Using selection string: %s" % selection) if "2" in args.selection and not "2p" in args.selection: misIDSF_val = misID2SF_val elif "3" in args.selection and not "3p" in args.selection: