(float(nEvents) / 100), 2)) + "%") sys.stdout.flush() sys.stdout.write('\r') chain.GetEntry(eList.GetEntry(ev)) #No double counting in data samples if getVarValue(chain, "evt") in ListOfDataEvents: continue else: ListOfDataEvents.append(getVarValue(chain, "evt")) weight = reduceStat * getVarValue( chain, "weight") * (luminosity / 1000.) if not s['isData'] else 1 #leptons electrons = getGoodElectrons(chain) muons = getGoodMuons(chain) leptons = getGoodLeptons(chain, 10) #mt2ll for 2l mt2ll = getVarValue(chain, "dl_mt2ll") #met met = getVarValue(chain, 'met_pt') #jets jets = getGoodJets(chain) bjets = filter(lambda j: j['btagCSV'] > btagcoeff, jets) nobjets = filter(lambda j: j['btagCSV'] <= btagcoeff, jets) zleptons = []
#MET met = getVarValue(chain, "met_pt") metPhi = getVarValue(chain, "met_phi") #jetpt leadingjetpt = getVarValue(chain, "Jet_pt",0) subleadingjetpt = getVarValue(chain, "Jet_pt",1) #leptons l0pt = getVarValue(chain, "l1_pt") l1pt = getVarValue(chain, "l2_pt") mll = getVarValue(chain,"dl_mass") #Leptons allLeptons = getGoodLeptons(chain) muons = getGoodMuons(chain) electrons = getGoodElectrons(chain) #SF and OF channels leptons = {\ 'mu': {'name': 'mumu', 'file': muons}, 'e': {'name': 'ee', 'file': electrons}, 'emu': {'name': 'emu', 'file': [electrons,muons]}, } for lep in leptons.keys(): twoleptons = False #Same Flavor if lep != 'emu': if len(leptons[lep]['file'])==2 and (len(muons)+len(electrons))==2 and leptons[lep]['file'][0]['pdgId']*leptons[lep]['file'][1]['pdgId']<0: twoleptons = True zveto = True