def met_lochadtopo(self, muon_algo = "Staco"): met = MissingEnergy() lht = self.sg["MET_LocHadTopo"] reg = lht.getRegions() newMET_LocHadTopo_etx = reg.exReg(reg.Central) + reg.exReg(reg.EndCap) + reg.exReg(reg.Forward) newMET_LocHadTopo_ety = reg.eyReg(reg.Central) + reg.eyReg(reg.EndCap) + reg.eyReg(reg.Forward) newMET_LocHadTopo_etsum = reg.etSumReg(reg.Central) + reg.etSumReg(reg.EndCap) + reg.etSumReg(reg.Forward) if muon_algo == "Staco": midmet = "MET_MuonBoy" else: midmet = "MET_Muid" met.x = newMET_LocHadTopo_etx + self.sg[midmet].etx() - self.sg["MET_RefMuon_Track"].etx() met.y = newMET_LocHadTopo_ety + self.sg[midmet].ety() - self.sg["MET_RefMuon_Track"].ety() met.sum = newMET_LocHadTopo_etsum + self.sg[midmet].sumet() - self.sg["MET_RefMuon_Track"].sumet() met.met_central.x = reg.exReg(reg.Central); met.met_central.y = reg.eyReg(reg.Central); met.met_central.sum = reg.etSumReg(reg.Central); met.met_endcap.x = reg.exReg(reg.EndCap); met.met_endcap.y = reg.eyReg(reg.EndCap); met.met_endcap.sum = reg.etSumReg(reg.EndCap); met.met_forward.x = reg.exReg(reg.Forward); met.met_forward.y = reg.eyReg(reg.Forward); met.met_forward.sum = reg.etSumReg(reg.Forward); return met
def met_reffinal45(self): met = MissingEnergy() lht = self.sg["MET_RefFinal"] reg = lht.getRegions() met.x = reg.exReg(reg.Central) + reg.exReg(reg.EndCap) + reg.exReg(reg.Forward) met.y = reg.eyReg(reg.Central) + reg.eyReg(reg.EndCap) + reg.eyReg(reg.Forward) met.sum = reg.etSumReg(reg.Central) + reg.etSumReg(reg.EndCap) + reg.etSumReg(reg.Forward) met.met_central.x = reg.exReg(reg.Central); met.met_central.y = reg.eyReg(reg.Central); met.met_central.sum = reg.etSumReg(reg.Central); met.met_endcap.x = reg.exReg(reg.EndCap); met.met_endcap.y = reg.eyReg(reg.EndCap); met.met_endcap.sum = reg.etSumReg(reg.EndCap); met.met_forward.x = reg.exReg(reg.Forward); met.met_forward.y = reg.eyReg(reg.Forward); met.met_forward.sum = reg.etSumReg(reg.Forward); return met
def met_detail(self, name): met = MissingEnergy() lht = self.sg[name] if not bool(lht): return met met.x = lht.etx() met.y = lht.ety() met.sum = lht.sumet() reg = lht.getRegions() if not bool(reg): return met met.met_central.x = reg.exReg(reg.Central); met.met_central.y = reg.eyReg(reg.Central); met.met_central.sum = reg.etSumReg(reg.Central); met.met_endcap.x = reg.exReg(reg.EndCap); met.met_endcap.y = reg.eyReg(reg.EndCap); met.met_endcap.sum = reg.etSumReg(reg.EndCap); met.met_forward.x = reg.exReg(reg.Forward); met.met_forward.y = reg.eyReg(reg.Forward); met.met_forward.sum = reg.etSumReg(reg.Forward); return met
def met_from_particles(self, particles): met = MissingEnergy() met.x = -sum(p.momentum().px() for p in particles) met.y = -sum(p.momentum().py() for p in particles) met.sum = sum(abs(p.momentum().perp()) for p in particles) return met
def met_named(self, name): met = MissingEnergy() met.x = self.sg[name].etx(); met.y = self.sg[name].ety(); met.sum = self.sg[name].sumet(); return met